scratch-storage 4.0.52 → 4.0.54

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.
@@ -18,20 +18,6 @@ module.exports = __webpack_require__(14)("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAAAAA
18
18
 
19
19
  /***/ }),
20
20
 
21
- /***/ 680:
22
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
23
-
24
- module.exports = __webpack_require__(14)("UklGRiYAAABXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0YQIAAAAAAA==")
25
-
26
- /***/ }),
27
-
28
- /***/ 914:
29
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
30
-
31
- module.exports = __webpack_require__(14)("PD94bWwgdmVyc2lvbj0iMS4wIj8+Cjxzdmcgd2lkdGg9IjEyOCIgaGVpZ2h0PSIxMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiA8Zz4KICA8cmVjdCBmaWxsPSIjQ0NDIiBoZWlnaHQ9IjEyOCIgd2lkdGg9IjEyOCIvPgogIDx0ZXh0IGZpbGw9ImJsYWNrIiB5PSIxMDciIHg9IjM1LjUiIGZvbnQtc2l6ZT0iMTI4Ij4/PC90ZXh0PgogPC9nPgo8L3N2Zz4K")
32
-
33
- /***/ }),
34
-
35
21
  /***/ 14:
36
22
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
37
23
 
@@ -54,316 +40,390 @@ module.exports = function (base64Data) {
54
40
 
55
41
  /***/ }),
56
42
 
57
- /***/ 953:
58
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
43
+ /***/ 15:
44
+ /***/ ((module, exports, __webpack_require__) => {
59
45
 
60
- const crossFetch = __webpack_require__(945);
46
+ var Transform = __webpack_require__(408),
47
+ Filter = __webpack_require__(84);
61
48
 
62
- /**
63
- * Metadata header names
64
- * @enum {string} The enum value is the name of the associated header.
65
- * @readonly
66
- */
67
- const RequestMetadata = {
68
- /** The ID of the project associated with this request */
69
- ProjectId: 'X-Project-ID',
70
- /** The ID of the project run associated with this request */
71
- RunId: 'X-Run-ID'
49
+ var log = new Transform(),
50
+ slice = Array.prototype.slice;
51
+
52
+ exports = module.exports = function create(name) {
53
+ var o = function() { log.write(name, undefined, slice.call(arguments)); return o; };
54
+ o.debug = function() { log.write(name, 'debug', slice.call(arguments)); return o; };
55
+ o.info = function() { log.write(name, 'info', slice.call(arguments)); return o; };
56
+ o.warn = function() { log.write(name, 'warn', slice.call(arguments)); return o; };
57
+ o.error = function() { log.write(name, 'error', slice.call(arguments)); return o; };
58
+ o.log = o.debug; // for interface compliance with Node and browser consoles
59
+ o.suggest = exports.suggest;
60
+ o.format = log.format;
61
+ return o;
72
62
  };
73
63
 
74
- /**
75
- * Metadata headers for requests
76
- * @type {Headers}
77
- */
78
- const metadata = new crossFetch.Headers();
64
+ // filled in separately
65
+ exports.defaultBackend = exports.defaultFormatter = null;
79
66
 
80
- /**
81
- * Check if there is any metadata to apply.
82
- * @returns {boolean} true if `metadata` has contents, or false if it is empty.
83
- */
84
- const hasMetadata = () => {
85
- /* global self */
86
- const searchParams = typeof self !== 'undefined' && self && self.location && self.location.search && self.location.search.split(/[?&]/) || [];
87
- if (!searchParams.includes('scratchMetadata=1')) {
88
- // for now, disable this feature unless scratchMetadata=1
89
- // TODO: remove this check once we're sure the feature works correctly in production
90
- return false;
91
- }
92
- for (const _ of metadata) {
93
- return true;
94
- }
95
- return false;
67
+ exports.pipe = function(dest) {
68
+ return log.pipe(dest);
96
69
  };
97
70
 
98
- /**
99
- * Non-destructively merge any metadata state (if any) with the provided options object (if any).
100
- * If there is metadata state but no options object is provided, make a new object.
101
- * If there is no metadata state, return the provided options parameter without modification.
102
- * If there is metadata and an options object is provided, modify a copy and return it.
103
- * Headers in the provided options object may override headers generated from metadata state.
104
- * @param {RequestInit} [options] The initial request options. May be null or undefined.
105
- * @returns {RequestInit|undefined} the provided options parameter without modification, or a new options object.
106
- */
107
- const applyMetadata = options => {
108
- if (hasMetadata()) {
109
- const augmentedOptions = Object.assign({}, options);
110
- augmentedOptions.headers = new crossFetch.Headers(metadata);
111
- if (options && options.headers) {
112
- // the Fetch spec says options.headers could be:
113
- // "A Headers object, an object literal, or an array of two-item arrays to set request's headers."
114
- // turn it into a Headers object to be sure of how to interact with it
115
- const overrideHeaders = options.headers instanceof crossFetch.Headers ? options.headers : new crossFetch.Headers(options.headers);
116
- for (const [name, value] of overrideHeaders.entries()) {
117
- augmentedOptions.headers.set(name, value);
118
- }
119
- }
120
- return augmentedOptions;
121
- }
122
- return options;
71
+ exports.end = exports.unpipe = exports.disable = function(from) {
72
+ return log.unpipe(from);
123
73
  };
124
74
 
125
- /**
126
- * Make a network request.
127
- * This is a wrapper for the global fetch method, adding some Scratch-specific functionality.
128
- * @param {RequestInfo|URL} resource The resource to fetch.
129
- * @param {RequestInit} options Optional object containing custom settings for this request.
130
- * @see {@link https://developer.mozilla.org/docs/Web/API/fetch} for more about the fetch API.
131
- * @returns {Promise<Response>} A promise for the response to the request.
132
- */
133
- const scratchFetch = (resource, options) => {
134
- const augmentedOptions = applyMetadata(options);
135
- return crossFetch(resource, augmentedOptions);
136
- };
75
+ exports.Transform = Transform;
76
+ exports.Filter = Filter;
77
+ // this is the default filter that's applied when .enable() is called normally
78
+ // you can bypass it completely and set up your own pipes
79
+ exports.suggest = new Filter();
137
80
 
138
- /**
139
- * Set the value of a named request metadata item.
140
- * Setting the value to `null` or `undefined` will NOT remove the item.
141
- * Use `unsetMetadata` for that.
142
- * @param {RequestMetadata} name The name of the metadata item to set.
143
- * @param {any} value The value to set (will be converted to a string).
144
- */
145
- const setMetadata = (name, value) => {
146
- metadata.set(name, value);
81
+ exports.enable = function() {
82
+ if(exports.defaultFormatter) {
83
+ return log.pipe(exports.suggest) // filter
84
+ .pipe(exports.defaultFormatter) // formatter
85
+ .pipe(exports.defaultBackend); // backend
86
+ }
87
+ return log.pipe(exports.suggest) // filter
88
+ .pipe(exports.defaultBackend); // formatter
147
89
  };
148
90
 
149
- /**
150
- * Remove a named request metadata item.
151
- * @param {RequestMetadata} name The name of the metadata item to remove.
152
- */
153
- const unsetMetadata = name => {
154
- metadata.delete(name);
155
- };
156
91
 
157
- /**
158
- * Retrieve a named request metadata item.
159
- * Only for use in tests. At the time of writing, used in scratch-vm tests.
160
- * @param {RequestMetadata} name The name of the metadata item to retrieve.
161
- * @returns {any} value The value of the metadata item, or `undefined` if it was not found.
162
- */
163
- const getMetadata = name => metadata.get(name);
164
- module.exports = {
165
- Headers: crossFetch.Headers,
166
- RequestMetadata,
167
- applyMetadata,
168
- scratchFetch,
169
- setMetadata,
170
- unsetMetadata,
171
- getMetadata
172
- };
173
92
 
174
93
  /***/ }),
175
94
 
176
- /***/ 526:
177
- /***/ ((__unused_webpack_module, exports) => {
95
+ /***/ 84:
96
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
178
97
 
179
- "use strict";
98
+ // default filter
99
+ var Transform = __webpack_require__(408);
180
100
 
101
+ var levelMap = { debug: 1, info: 2, warn: 3, error: 4 };
181
102
 
182
- exports.byteLength = byteLength
183
- exports.toByteArray = toByteArray
184
- exports.fromByteArray = fromByteArray
103
+ function Filter() {
104
+ this.enabled = true;
105
+ this.defaultResult = true;
106
+ this.clear();
107
+ }
185
108
 
186
- var lookup = []
187
- var revLookup = []
188
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
109
+ Transform.mixin(Filter);
189
110
 
190
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
191
- for (var i = 0, len = code.length; i < len; ++i) {
192
- lookup[i] = code[i]
193
- revLookup[code.charCodeAt(i)] = i
194
- }
111
+ // allow all matching, with level >= given level
112
+ Filter.prototype.allow = function(name, level) {
113
+ this._white.push({ n: name, l: levelMap[level] });
114
+ return this;
115
+ };
195
116
 
196
- // Support decoding URL-safe base64 strings, as Node.js does.
197
- // See: https://en.wikipedia.org/wiki/Base64#URL_applications
198
- revLookup['-'.charCodeAt(0)] = 62
199
- revLookup['_'.charCodeAt(0)] = 63
117
+ // deny all matching, with level <= given level
118
+ Filter.prototype.deny = function(name, level) {
119
+ this._black.push({ n: name, l: levelMap[level] });
120
+ return this;
121
+ };
200
122
 
201
- function getLens (b64) {
202
- var len = b64.length
123
+ Filter.prototype.clear = function() {
124
+ this._white = [];
125
+ this._black = [];
126
+ return this;
127
+ };
203
128
 
204
- if (len % 4 > 0) {
205
- throw new Error('Invalid string. Length must be a multiple of 4')
206
- }
129
+ function test(rule, name) {
130
+ // use .test for RegExps
131
+ return (rule.n.test ? rule.n.test(name) : rule.n == name);
132
+ };
207
133
 
208
- // Trim off extra bytes after placeholder bytes are found
209
- // See: https://github.com/beatgammit/base64-js/issues/42
210
- var validLen = b64.indexOf('=')
211
- if (validLen === -1) validLen = len
134
+ Filter.prototype.test = function(name, level) {
135
+ var i, len = Math.max(this._white.length, this._black.length);
136
+ for(i = 0; i < len; i++) {
137
+ if(this._white[i] && test(this._white[i], name) && levelMap[level] >= this._white[i].l) {
138
+ return true;
139
+ }
140
+ if(this._black[i] && test(this._black[i], name) && levelMap[level] <= this._black[i].l) {
141
+ return false;
142
+ }
143
+ }
144
+ return this.defaultResult;
145
+ };
212
146
 
213
- var placeHoldersLen = validLen === len
214
- ? 0
215
- : 4 - (validLen % 4)
147
+ Filter.prototype.write = function(name, level, args) {
148
+ if(!this.enabled || this.test(name, level)) {
149
+ return this.emit('item', name, level, args);
150
+ }
151
+ };
216
152
 
217
- return [validLen, placeHoldersLen]
218
- }
153
+ module.exports = Filter;
219
154
 
220
- // base64 is 4/3 + up to two characters of the original data
221
- function byteLength (b64) {
222
- var lens = getLens(b64)
223
- var validLen = lens[0]
224
- var placeHoldersLen = lens[1]
225
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
226
- }
227
155
 
228
- function _byteLength (b64, validLen, placeHoldersLen) {
229
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
230
- }
156
+ /***/ }),
231
157
 
232
- function toByteArray (b64) {
233
- var tmp
234
- var lens = getLens(b64)
235
- var validLen = lens[0]
236
- var placeHoldersLen = lens[1]
158
+ /***/ 113:
159
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
237
160
 
238
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
161
+ var Transform = __webpack_require__(408),
162
+ cache = false;
239
163
 
240
- var curByte = 0
164
+ var logger = new Transform();
241
165
 
242
- // if there are placeholders, only get up to the last complete 4 chars
243
- var len = placeHoldersLen > 0
244
- ? validLen - 4
245
- : validLen
166
+ logger.write = function(name, level, args) {
167
+ if(typeof window == 'undefined' || typeof JSON == 'undefined' || !JSON.stringify || !JSON.parse) return;
168
+ try {
169
+ if(!cache) { cache = (window.localStorage.minilog ? JSON.parse(window.localStorage.minilog) : []); }
170
+ cache.push([ new Date().toString(), name, level, args ]);
171
+ window.localStorage.minilog = JSON.stringify(cache);
172
+ } catch(e) {}
173
+ };
246
174
 
247
- var i
248
- for (i = 0; i < len; i += 4) {
249
- tmp =
250
- (revLookup[b64.charCodeAt(i)] << 18) |
251
- (revLookup[b64.charCodeAt(i + 1)] << 12) |
252
- (revLookup[b64.charCodeAt(i + 2)] << 6) |
253
- revLookup[b64.charCodeAt(i + 3)]
254
- arr[curByte++] = (tmp >> 16) & 0xFF
255
- arr[curByte++] = (tmp >> 8) & 0xFF
256
- arr[curByte++] = tmp & 0xFF
257
- }
175
+ module.exports = logger;
258
176
 
259
- if (placeHoldersLen === 2) {
260
- tmp =
261
- (revLookup[b64.charCodeAt(i)] << 2) |
262
- (revLookup[b64.charCodeAt(i + 1)] >> 4)
263
- arr[curByte++] = tmp & 0xFF
264
- }
177
+ /***/ }),
265
178
 
266
- if (placeHoldersLen === 1) {
267
- tmp =
268
- (revLookup[b64.charCodeAt(i)] << 10) |
269
- (revLookup[b64.charCodeAt(i + 1)] << 4) |
270
- (revLookup[b64.charCodeAt(i + 2)] >> 2)
271
- arr[curByte++] = (tmp >> 8) & 0xFF
272
- arr[curByte++] = tmp & 0xFF
179
+ /***/ 173:
180
+ /***/ ((module) => {
181
+
182
+ function M() { this._events = {}; }
183
+ M.prototype = {
184
+ on: function(ev, cb) {
185
+ this._events || (this._events = {});
186
+ var e = this._events;
187
+ (e[ev] || (e[ev] = [])).push(cb);
188
+ return this;
189
+ },
190
+ removeListener: function(ev, cb) {
191
+ var e = this._events[ev] || [], i;
192
+ for(i = e.length-1; i >= 0 && e[i]; i--){
193
+ if(e[i] === cb || e[i].cb === cb) { e.splice(i, 1); }
194
+ }
195
+ },
196
+ removeAllListeners: function(ev) {
197
+ if(!ev) { this._events = {}; }
198
+ else { this._events[ev] && (this._events[ev] = []); }
199
+ },
200
+ listeners: function(ev) {
201
+ return (this._events ? this._events[ev] || [] : []);
202
+ },
203
+ emit: function(ev) {
204
+ this._events || (this._events = {});
205
+ var args = Array.prototype.slice.call(arguments, 1), i, e = this._events[ev] || [];
206
+ for(i = e.length-1; i >= 0 && e[i]; i--){
207
+ e[i].apply(this, args);
208
+ }
209
+ return this;
210
+ },
211
+ when: function(ev, cb) {
212
+ return this.once(ev, cb, true);
213
+ },
214
+ once: function(ev, cb, when) {
215
+ if(!cb) return this;
216
+ function c() {
217
+ if(!when) this.removeListener(ev, c);
218
+ if(cb.apply(this, arguments) && when) this.removeListener(ev, c);
219
+ }
220
+ c.cb = cb;
221
+ this.on(ev, c);
222
+ return this;
223
+ }
224
+ };
225
+ M.mixin = function(dest) {
226
+ var o = M.prototype, k;
227
+ for (k in o) {
228
+ o.hasOwnProperty(k) && (dest.prototype[k] = o[k]);
273
229
  }
230
+ };
231
+ module.exports = M;
274
232
 
275
- return arr
276
- }
277
233
 
278
- function tripletToBase64 (num) {
279
- return lookup[num >> 18 & 0x3F] +
280
- lookup[num >> 12 & 0x3F] +
281
- lookup[num >> 6 & 0x3F] +
282
- lookup[num & 0x3F]
283
- }
234
+ /***/ }),
284
235
 
285
- function encodeChunk (uint8, start, end) {
286
- var tmp
287
- var output = []
288
- for (var i = start; i < end; i += 3) {
289
- tmp =
290
- ((uint8[i] << 16) & 0xFF0000) +
291
- ((uint8[i + 1] << 8) & 0xFF00) +
292
- (uint8[i + 2] & 0xFF)
293
- output.push(tripletToBase64(tmp))
236
+ /***/ 193:
237
+ /***/ ((module) => {
238
+
239
+ var hex = {
240
+ black: '#000',
241
+ red: '#c23621',
242
+ green: '#25bc26',
243
+ yellow: '#bbbb00',
244
+ blue: '#492ee1',
245
+ magenta: '#d338d3',
246
+ cyan: '#33bbc8',
247
+ gray: '#808080',
248
+ purple: '#708'
249
+ };
250
+ function color(fg, isInverse) {
251
+ if(isInverse) {
252
+ return 'color: #fff; background: '+hex[fg]+';';
253
+ } else {
254
+ return 'color: '+hex[fg]+';';
294
255
  }
295
- return output.join('')
296
256
  }
297
257
 
298
- function fromByteArray (uint8) {
299
- var tmp
300
- var len = uint8.length
301
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
302
- var parts = []
303
- var maxChunkLength = 16383 // must be multiple of 3
258
+ module.exports = color;
304
259
 
305
- // go through the array every three bytes, we'll deal with trailing stuff later
306
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
307
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
308
- }
309
260
 
310
- // pad the end with zeros, but make sure to not forget the extra bytes
311
- if (extraBytes === 1) {
312
- tmp = uint8[len - 1]
313
- parts.push(
314
- lookup[tmp >> 2] +
315
- lookup[(tmp << 4) & 0x3F] +
316
- '=='
317
- )
318
- } else if (extraBytes === 2) {
319
- tmp = (uint8[len - 2] << 8) + uint8[len - 1]
320
- parts.push(
321
- lookup[tmp >> 10] +
322
- lookup[(tmp >> 4) & 0x3F] +
323
- lookup[(tmp << 2) & 0x3F] +
324
- '='
325
- )
326
- }
261
+ /***/ }),
327
262
 
328
- return parts.join('')
329
- }
263
+ /***/ 251:
264
+ /***/ ((__unused_webpack_module, exports) => {
330
265
 
266
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
267
+ exports.read = function (buffer, offset, isLE, mLen, nBytes) {
268
+ var e, m
269
+ var eLen = (nBytes * 8) - mLen - 1
270
+ var eMax = (1 << eLen) - 1
271
+ var eBias = eMax >> 1
272
+ var nBits = -7
273
+ var i = isLE ? (nBytes - 1) : 0
274
+ var d = isLE ? -1 : 1
275
+ var s = buffer[offset + i]
331
276
 
332
- /***/ }),
277
+ i += d
333
278
 
334
- /***/ 287:
335
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
279
+ e = s & ((1 << (-nBits)) - 1)
280
+ s >>= (-nBits)
281
+ nBits += eLen
282
+ for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
336
283
 
337
- "use strict";
338
- var __webpack_unused_export__;
339
- /*!
340
- * The buffer module from node.js, for the browser.
341
- *
342
- * @author Feross Aboukhadijeh <https://feross.org>
343
- * @license MIT
344
- */
345
- /* eslint-disable no-proto */
284
+ m = e & ((1 << (-nBits)) - 1)
285
+ e >>= (-nBits)
286
+ nBits += mLen
287
+ for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
346
288
 
289
+ if (e === 0) {
290
+ e = 1 - eBias
291
+ } else if (e === eMax) {
292
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
293
+ } else {
294
+ m = m + Math.pow(2, mLen)
295
+ e = e - eBias
296
+ }
297
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
298
+ }
347
299
 
300
+ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
301
+ var e, m, c
302
+ var eLen = (nBytes * 8) - mLen - 1
303
+ var eMax = (1 << eLen) - 1
304
+ var eBias = eMax >> 1
305
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
306
+ var i = isLE ? 0 : (nBytes - 1)
307
+ var d = isLE ? 1 : -1
308
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
348
309
 
349
- const base64 = __webpack_require__(526)
350
- const ieee754 = __webpack_require__(251)
351
- const customInspectSymbol =
352
- (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
353
- ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
354
- : null
310
+ value = Math.abs(value)
355
311
 
356
- exports.hp = Buffer
357
- __webpack_unused_export__ = SlowBuffer
358
- exports.IS = 50
312
+ if (isNaN(value) || value === Infinity) {
313
+ m = isNaN(value) ? 1 : 0
314
+ e = eMax
315
+ } else {
316
+ e = Math.floor(Math.log(value) / Math.LN2)
317
+ if (value * (c = Math.pow(2, -e)) < 1) {
318
+ e--
319
+ c *= 2
320
+ }
321
+ if (e + eBias >= 1) {
322
+ value += rt / c
323
+ } else {
324
+ value += rt * Math.pow(2, 1 - eBias)
325
+ }
326
+ if (value * c >= 2) {
327
+ e++
328
+ c /= 2
329
+ }
359
330
 
360
- const K_MAX_LENGTH = 0x7fffffff
361
- __webpack_unused_export__ = K_MAX_LENGTH
331
+ if (e + eBias >= eMax) {
332
+ m = 0
333
+ e = eMax
334
+ } else if (e + eBias >= 1) {
335
+ m = ((value * c) - 1) * Math.pow(2, mLen)
336
+ e = e + eBias
337
+ } else {
338
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
339
+ e = 0
340
+ }
341
+ }
362
342
 
363
- /**
364
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
365
- * === true Use Uint8Array implementation (fastest)
366
- * === false Print warning and recommend using `buffer` v4.x which has an Object
343
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
344
+
345
+ e = (e << mLen) | m
346
+ eLen += mLen
347
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
348
+
349
+ buffer[offset + i - d] |= s * 128
350
+ }
351
+
352
+
353
+ /***/ }),
354
+
355
+ /***/ 260:
356
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
357
+
358
+ var Transform = __webpack_require__(408);
359
+
360
+ var newlines = /\n+$/,
361
+ logger = new Transform();
362
+
363
+ logger.write = function(name, level, args) {
364
+ var i = args.length-1;
365
+ if (typeof console === 'undefined' || !console.log) {
366
+ return;
367
+ }
368
+ if(console.log.apply) {
369
+ return console.log.apply(console, [name, level].concat(args));
370
+ } else if(JSON && JSON.stringify) {
371
+ // console.log.apply is undefined in IE8 and IE9
372
+ // for IE8/9: make console.log at least a bit less awful
373
+ if(args[i] && typeof args[i] == 'string') {
374
+ args[i] = args[i].replace(newlines, '');
375
+ }
376
+ try {
377
+ for(i = 0; i < args.length; i++) {
378
+ args[i] = JSON.stringify(args[i]);
379
+ }
380
+ } catch(e) {}
381
+ console.log(args.join(' '));
382
+ }
383
+ };
384
+
385
+ logger.formatters = ['color', 'minilog'];
386
+ logger.color = __webpack_require__(638);
387
+ logger.minilog = __webpack_require__(658);
388
+
389
+ module.exports = logger;
390
+
391
+
392
+ /***/ }),
393
+
394
+ /***/ 287:
395
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
396
+
397
+ "use strict";
398
+ var __webpack_unused_export__;
399
+ /*!
400
+ * The buffer module from node.js, for the browser.
401
+ *
402
+ * @author Feross Aboukhadijeh <https://feross.org>
403
+ * @license MIT
404
+ */
405
+ /* eslint-disable no-proto */
406
+
407
+
408
+
409
+ const base64 = __webpack_require__(526)
410
+ const ieee754 = __webpack_require__(251)
411
+ const customInspectSymbol =
412
+ (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
413
+ ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
414
+ : null
415
+
416
+ exports.hp = Buffer
417
+ __webpack_unused_export__ = SlowBuffer
418
+ exports.IS = 50
419
+
420
+ const K_MAX_LENGTH = 0x7fffffff
421
+ __webpack_unused_export__ = K_MAX_LENGTH
422
+
423
+ /**
424
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
425
+ * === true Use Uint8Array implementation (fastest)
426
+ * === false Print warning and recommend using `buffer` v4.x which has an Object
367
427
  * implementation (most compatible, even IE6)
368
428
  *
369
429
  * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
@@ -2446,2038 +2506,1978 @@ function BufferBigIntNotDefined () {
2446
2506
 
2447
2507
  /***/ }),
2448
2508
 
2449
- /***/ 945:
2509
+ /***/ 386:
2450
2510
  /***/ ((module, exports, __webpack_require__) => {
2451
2511
 
2452
- // Save global object in a variable
2453
- var __global__ =
2454
- (typeof globalThis !== 'undefined' && globalThis) ||
2455
- (typeof self !== 'undefined' && self) ||
2456
- (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g);
2457
- // Create an object that extends from __global__ without the fetch function
2458
- var __globalThis__ = (function () {
2459
- function F() {
2460
- this.fetch = false;
2461
- this.DOMException = __global__.DOMException
2462
- }
2463
- F.prototype = __global__; // Needed for feature detection on whatwg-fetch's code
2464
- return new F();
2465
- })();
2466
- // Wraps whatwg-fetch with a function scope to hijack the global object
2467
- // "globalThis" that's going to be patched
2468
- (function(globalThis) {
2469
-
2470
- var irrelevant = (function (exports) {
2471
-
2472
- /* eslint-disable no-prototype-builtins */
2473
- var g =
2474
- (typeof globalThis !== 'undefined' && globalThis) ||
2475
- (typeof self !== 'undefined' && self) ||
2476
- // eslint-disable-next-line no-undef
2477
- (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g) ||
2478
- {};
2479
-
2480
- var support = {
2481
- searchParams: 'URLSearchParams' in g,
2482
- iterable: 'Symbol' in g && 'iterator' in Symbol,
2483
- blob:
2484
- 'FileReader' in g &&
2485
- 'Blob' in g &&
2486
- (function() {
2487
- try {
2488
- new Blob();
2489
- return true
2490
- } catch (e) {
2491
- return false
2492
- }
2493
- })(),
2494
- formData: 'FormData' in g,
2495
- arrayBuffer: 'ArrayBuffer' in g
2496
- };
2497
-
2498
- function isDataView(obj) {
2499
- return obj && DataView.prototype.isPrototypeOf(obj)
2500
- }
2501
-
2502
- if (support.arrayBuffer) {
2503
- var viewClasses = [
2504
- '[object Int8Array]',
2505
- '[object Uint8Array]',
2506
- '[object Uint8ClampedArray]',
2507
- '[object Int16Array]',
2508
- '[object Uint16Array]',
2509
- '[object Int32Array]',
2510
- '[object Uint32Array]',
2511
- '[object Float32Array]',
2512
- '[object Float64Array]'
2513
- ];
2512
+ var __WEBPACK_AMD_DEFINE_RESULT__;/**
2513
+ * [js-md5]{@link https://github.com/emn178/js-md5}
2514
+ *
2515
+ * @namespace md5
2516
+ * @version 0.7.3
2517
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
2518
+ * @copyright Chen, Yi-Cyuan 2014-2017
2519
+ * @license MIT
2520
+ */
2521
+ (function () {
2522
+ 'use strict';
2514
2523
 
2515
- var isArrayBufferView =
2516
- ArrayBuffer.isView ||
2517
- function(obj) {
2518
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
2519
- };
2524
+ var ERROR = 'input is invalid type';
2525
+ var WINDOW = typeof window === 'object';
2526
+ var root = WINDOW ? window : {};
2527
+ if (root.JS_MD5_NO_WINDOW) {
2528
+ WINDOW = false;
2520
2529
  }
2521
-
2522
- function normalizeName(name) {
2523
- if (typeof name !== 'string') {
2524
- name = String(name);
2525
- }
2526
- if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
2527
- throw new TypeError('Invalid character in header field name: "' + name + '"')
2528
- }
2529
- return name.toLowerCase()
2530
+ var WEB_WORKER = !WINDOW && typeof self === 'object';
2531
+ var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
2532
+ if (NODE_JS) {
2533
+ root = __webpack_require__.g;
2534
+ } else if (WEB_WORKER) {
2535
+ root = self;
2530
2536
  }
2537
+ var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && "object" === 'object' && module.exports;
2538
+ var AMD = true && __webpack_require__.amdO;
2539
+ var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
2540
+ var HEX_CHARS = '0123456789abcdef'.split('');
2541
+ var EXTRA = [128, 32768, 8388608, -2147483648];
2542
+ var SHIFT = [0, 8, 16, 24];
2543
+ var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64'];
2544
+ var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
2531
2545
 
2532
- function normalizeValue(value) {
2533
- if (typeof value !== 'string') {
2534
- value = String(value);
2535
- }
2536
- return value
2546
+ var blocks = [], buffer8;
2547
+ if (ARRAY_BUFFER) {
2548
+ var buffer = new ArrayBuffer(68);
2549
+ buffer8 = new Uint8Array(buffer);
2550
+ blocks = new Uint32Array(buffer);
2537
2551
  }
2538
2552
 
2539
- // Build a destructive iterator for the value list
2540
- function iteratorFor(items) {
2541
- var iterator = {
2542
- next: function() {
2543
- var value = items.shift();
2544
- return {done: value === undefined, value: value}
2545
- }
2553
+ if (root.JS_MD5_NO_NODE_JS || !Array.isArray) {
2554
+ Array.isArray = function (obj) {
2555
+ return Object.prototype.toString.call(obj) === '[object Array]';
2546
2556
  };
2547
-
2548
- if (support.iterable) {
2549
- iterator[Symbol.iterator] = function() {
2550
- return iterator
2551
- };
2552
- }
2553
-
2554
- return iterator
2555
2557
  }
2556
2558
 
2557
- function Headers(headers) {
2558
- this.map = {};
2559
-
2560
- if (headers instanceof Headers) {
2561
- headers.forEach(function(value, name) {
2562
- this.append(name, value);
2563
- }, this);
2564
- } else if (Array.isArray(headers)) {
2565
- headers.forEach(function(header) {
2566
- if (header.length != 2) {
2567
- throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)
2568
- }
2569
- this.append(header[0], header[1]);
2570
- }, this);
2571
- } else if (headers) {
2572
- Object.getOwnPropertyNames(headers).forEach(function(name) {
2573
- this.append(name, headers[name]);
2574
- }, this);
2575
- }
2559
+ if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
2560
+ ArrayBuffer.isView = function (obj) {
2561
+ return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
2562
+ };
2576
2563
  }
2577
2564
 
2578
- Headers.prototype.append = function(name, value) {
2579
- name = normalizeName(name);
2580
- value = normalizeValue(value);
2581
- var oldValue = this.map[name];
2582
- this.map[name] = oldValue ? oldValue + ', ' + value : value;
2583
- };
2584
-
2585
- Headers.prototype['delete'] = function(name) {
2586
- delete this.map[normalizeName(name)];
2587
- };
2588
-
2589
- Headers.prototype.get = function(name) {
2590
- name = normalizeName(name);
2591
- return this.has(name) ? this.map[name] : null
2565
+ /**
2566
+ * @method hex
2567
+ * @memberof md5
2568
+ * @description Output hash as hex string
2569
+ * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
2570
+ * @returns {String} Hex string
2571
+ * @example
2572
+ * md5.hex('The quick brown fox jumps over the lazy dog');
2573
+ * // equal to
2574
+ * md5('The quick brown fox jumps over the lazy dog');
2575
+ */
2576
+ /**
2577
+ * @method digest
2578
+ * @memberof md5
2579
+ * @description Output hash as bytes array
2580
+ * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
2581
+ * @returns {Array} Bytes array
2582
+ * @example
2583
+ * md5.digest('The quick brown fox jumps over the lazy dog');
2584
+ */
2585
+ /**
2586
+ * @method array
2587
+ * @memberof md5
2588
+ * @description Output hash as bytes array
2589
+ * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
2590
+ * @returns {Array} Bytes array
2591
+ * @example
2592
+ * md5.array('The quick brown fox jumps over the lazy dog');
2593
+ */
2594
+ /**
2595
+ * @method arrayBuffer
2596
+ * @memberof md5
2597
+ * @description Output hash as ArrayBuffer
2598
+ * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
2599
+ * @returns {ArrayBuffer} ArrayBuffer
2600
+ * @example
2601
+ * md5.arrayBuffer('The quick brown fox jumps over the lazy dog');
2602
+ */
2603
+ /**
2604
+ * @method buffer
2605
+ * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
2606
+ * @memberof md5
2607
+ * @description Output hash as ArrayBuffer
2608
+ * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
2609
+ * @returns {ArrayBuffer} ArrayBuffer
2610
+ * @example
2611
+ * md5.buffer('The quick brown fox jumps over the lazy dog');
2612
+ */
2613
+ /**
2614
+ * @method base64
2615
+ * @memberof md5
2616
+ * @description Output hash as base64 string
2617
+ * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
2618
+ * @returns {String} base64 string
2619
+ * @example
2620
+ * md5.base64('The quick brown fox jumps over the lazy dog');
2621
+ */
2622
+ var createOutputMethod = function (outputType) {
2623
+ return function (message) {
2624
+ return new Md5(true).update(message)[outputType]();
2625
+ };
2592
2626
  };
2593
2627
 
2594
- Headers.prototype.has = function(name) {
2595
- return this.map.hasOwnProperty(normalizeName(name))
2628
+ /**
2629
+ * @method create
2630
+ * @memberof md5
2631
+ * @description Create Md5 object
2632
+ * @returns {Md5} Md5 object.
2633
+ * @example
2634
+ * var hash = md5.create();
2635
+ */
2636
+ /**
2637
+ * @method update
2638
+ * @memberof md5
2639
+ * @description Create and update Md5 object
2640
+ * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
2641
+ * @returns {Md5} Md5 object.
2642
+ * @example
2643
+ * var hash = md5.update('The quick brown fox jumps over the lazy dog');
2644
+ * // equal to
2645
+ * var hash = md5.create();
2646
+ * hash.update('The quick brown fox jumps over the lazy dog');
2647
+ */
2648
+ var createMethod = function () {
2649
+ var method = createOutputMethod('hex');
2650
+ if (NODE_JS) {
2651
+ method = nodeWrap(method);
2652
+ }
2653
+ method.create = function () {
2654
+ return new Md5();
2655
+ };
2656
+ method.update = function (message) {
2657
+ return method.create().update(message);
2658
+ };
2659
+ for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
2660
+ var type = OUTPUT_TYPES[i];
2661
+ method[type] = createOutputMethod(type);
2662
+ }
2663
+ return method;
2596
2664
  };
2597
2665
 
2598
- Headers.prototype.set = function(name, value) {
2599
- this.map[normalizeName(name)] = normalizeValue(value);
2666
+ var nodeWrap = function (method) {
2667
+ var crypto = eval("require('crypto')");
2668
+ var Buffer = eval("require('buffer').Buffer");
2669
+ var nodeMethod = function (message) {
2670
+ if (typeof message === 'string') {
2671
+ return crypto.createHash('md5').update(message, 'utf8').digest('hex');
2672
+ } else {
2673
+ if (message === null || message === undefined) {
2674
+ throw ERROR;
2675
+ } else if (message.constructor === ArrayBuffer) {
2676
+ message = new Uint8Array(message);
2677
+ }
2678
+ }
2679
+ if (Array.isArray(message) || ArrayBuffer.isView(message) ||
2680
+ message.constructor === Buffer) {
2681
+ return crypto.createHash('md5').update(new Buffer(message)).digest('hex');
2682
+ } else {
2683
+ return method(message);
2684
+ }
2685
+ };
2686
+ return nodeMethod;
2600
2687
  };
2601
2688
 
2602
- Headers.prototype.forEach = function(callback, thisArg) {
2603
- for (var name in this.map) {
2604
- if (this.map.hasOwnProperty(name)) {
2605
- callback.call(thisArg, this.map[name], name, this);
2689
+ /**
2690
+ * Md5 class
2691
+ * @class Md5
2692
+ * @description This is internal class.
2693
+ * @see {@link md5.create}
2694
+ */
2695
+ function Md5(sharedMemory) {
2696
+ if (sharedMemory) {
2697
+ blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
2698
+ blocks[4] = blocks[5] = blocks[6] = blocks[7] =
2699
+ blocks[8] = blocks[9] = blocks[10] = blocks[11] =
2700
+ blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
2701
+ this.blocks = blocks;
2702
+ this.buffer8 = buffer8;
2703
+ } else {
2704
+ if (ARRAY_BUFFER) {
2705
+ var buffer = new ArrayBuffer(68);
2706
+ this.buffer8 = new Uint8Array(buffer);
2707
+ this.blocks = new Uint32Array(buffer);
2708
+ } else {
2709
+ this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
2606
2710
  }
2607
2711
  }
2608
- };
2609
-
2610
- Headers.prototype.keys = function() {
2611
- var items = [];
2612
- this.forEach(function(value, name) {
2613
- items.push(name);
2614
- });
2615
- return iteratorFor(items)
2616
- };
2617
-
2618
- Headers.prototype.values = function() {
2619
- var items = [];
2620
- this.forEach(function(value) {
2621
- items.push(value);
2622
- });
2623
- return iteratorFor(items)
2624
- };
2625
-
2626
- Headers.prototype.entries = function() {
2627
- var items = [];
2628
- this.forEach(function(value, name) {
2629
- items.push([name, value]);
2630
- });
2631
- return iteratorFor(items)
2632
- };
2633
-
2634
- if (support.iterable) {
2635
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
2712
+ this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0;
2713
+ this.finalized = this.hashed = false;
2714
+ this.first = true;
2636
2715
  }
2637
2716
 
2638
- function consumed(body) {
2639
- if (body._noBody) return
2640
- if (body.bodyUsed) {
2641
- return Promise.reject(new TypeError('Already read'))
2717
+ /**
2718
+ * @method update
2719
+ * @memberof Md5
2720
+ * @instance
2721
+ * @description Update hash
2722
+ * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
2723
+ * @returns {Md5} Md5 object.
2724
+ * @see {@link md5.update}
2725
+ */
2726
+ Md5.prototype.update = function (message) {
2727
+ if (this.finalized) {
2728
+ return;
2642
2729
  }
2643
- body.bodyUsed = true;
2644
- }
2645
-
2646
- function fileReaderReady(reader) {
2647
- return new Promise(function(resolve, reject) {
2648
- reader.onload = function() {
2649
- resolve(reader.result);
2650
- };
2651
- reader.onerror = function() {
2652
- reject(reader.error);
2653
- };
2654
- })
2655
- }
2656
-
2657
- function readBlobAsArrayBuffer(blob) {
2658
- var reader = new FileReader();
2659
- var promise = fileReaderReady(reader);
2660
- reader.readAsArrayBuffer(blob);
2661
- return promise
2662
- }
2663
-
2664
- function readBlobAsText(blob) {
2665
- var reader = new FileReader();
2666
- var promise = fileReaderReady(reader);
2667
- var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
2668
- var encoding = match ? match[1] : 'utf-8';
2669
- reader.readAsText(blob, encoding);
2670
- return promise
2671
- }
2672
2730
 
2673
- function readArrayBufferAsText(buf) {
2674
- var view = new Uint8Array(buf);
2675
- var chars = new Array(view.length);
2676
-
2677
- for (var i = 0; i < view.length; i++) {
2678
- chars[i] = String.fromCharCode(view[i]);
2731
+ var notString, type = typeof message;
2732
+ if (type !== 'string') {
2733
+ if (type === 'object') {
2734
+ if (message === null) {
2735
+ throw ERROR;
2736
+ } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
2737
+ message = new Uint8Array(message);
2738
+ } else if (!Array.isArray(message)) {
2739
+ if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
2740
+ throw ERROR;
2741
+ }
2742
+ }
2743
+ } else {
2744
+ throw ERROR;
2745
+ }
2746
+ notString = true;
2679
2747
  }
2680
- return chars.join('')
2681
- }
2748
+ var code, index = 0, i, length = message.length, blocks = this.blocks;
2749
+ var buffer8 = this.buffer8;
2682
2750
 
2683
- function bufferClone(buf) {
2684
- if (buf.slice) {
2685
- return buf.slice(0)
2686
- } else {
2687
- var view = new Uint8Array(buf.byteLength);
2688
- view.set(new Uint8Array(buf));
2689
- return view.buffer
2690
- }
2691
- }
2692
-
2693
- function Body() {
2694
- this.bodyUsed = false;
2695
-
2696
- this._initBody = function(body) {
2697
- /*
2698
- fetch-mock wraps the Response object in an ES6 Proxy to
2699
- provide useful test harness features such as flush. However, on
2700
- ES5 browsers without fetch or Proxy support pollyfills must be used;
2701
- the proxy-pollyfill is unable to proxy an attribute unless it exists
2702
- on the object before the Proxy is created. This change ensures
2703
- Response.bodyUsed exists on the instance, while maintaining the
2704
- semantic of setting Request.bodyUsed in the constructor before
2705
- _initBody is called.
2706
- */
2707
- // eslint-disable-next-line no-self-assign
2708
- this.bodyUsed = this.bodyUsed;
2709
- this._bodyInit = body;
2710
- if (!body) {
2711
- this._noBody = true;
2712
- this._bodyText = '';
2713
- } else if (typeof body === 'string') {
2714
- this._bodyText = body;
2715
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
2716
- this._bodyBlob = body;
2717
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
2718
- this._bodyFormData = body;
2719
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
2720
- this._bodyText = body.toString();
2721
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
2722
- this._bodyArrayBuffer = bufferClone(body.buffer);
2723
- // IE 10-11 can't handle a DataView body.
2724
- this._bodyInit = new Blob([this._bodyArrayBuffer]);
2725
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
2726
- this._bodyArrayBuffer = bufferClone(body);
2727
- } else {
2728
- this._bodyText = body = Object.prototype.toString.call(body);
2729
- }
2730
-
2731
- if (!this.headers.get('content-type')) {
2732
- if (typeof body === 'string') {
2733
- this.headers.set('content-type', 'text/plain;charset=UTF-8');
2734
- } else if (this._bodyBlob && this._bodyBlob.type) {
2735
- this.headers.set('content-type', this._bodyBlob.type);
2736
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
2737
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
2738
- }
2751
+ while (index < length) {
2752
+ if (this.hashed) {
2753
+ this.hashed = false;
2754
+ blocks[0] = blocks[16];
2755
+ blocks[16] = blocks[1] = blocks[2] = blocks[3] =
2756
+ blocks[4] = blocks[5] = blocks[6] = blocks[7] =
2757
+ blocks[8] = blocks[9] = blocks[10] = blocks[11] =
2758
+ blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
2739
2759
  }
2740
- };
2741
-
2742
- if (support.blob) {
2743
- this.blob = function() {
2744
- var rejected = consumed(this);
2745
- if (rejected) {
2746
- return rejected
2747
- }
2748
2760
 
2749
- if (this._bodyBlob) {
2750
- return Promise.resolve(this._bodyBlob)
2751
- } else if (this._bodyArrayBuffer) {
2752
- return Promise.resolve(new Blob([this._bodyArrayBuffer]))
2753
- } else if (this._bodyFormData) {
2754
- throw new Error('could not read FormData body as blob')
2761
+ if (notString) {
2762
+ if (ARRAY_BUFFER) {
2763
+ for (i = this.start; index < length && i < 64; ++index) {
2764
+ buffer8[i++] = message[index];
2765
+ }
2755
2766
  } else {
2756
- return Promise.resolve(new Blob([this._bodyText]))
2767
+ for (i = this.start; index < length && i < 64; ++index) {
2768
+ blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
2769
+ }
2757
2770
  }
2758
- };
2759
- }
2760
-
2761
- this.arrayBuffer = function() {
2762
- if (this._bodyArrayBuffer) {
2763
- var isConsumed = consumed(this);
2764
- if (isConsumed) {
2765
- return isConsumed
2766
- } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
2767
- return Promise.resolve(
2768
- this._bodyArrayBuffer.buffer.slice(
2769
- this._bodyArrayBuffer.byteOffset,
2770
- this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
2771
- )
2772
- )
2771
+ } else {
2772
+ if (ARRAY_BUFFER) {
2773
+ for (i = this.start; index < length && i < 64; ++index) {
2774
+ code = message.charCodeAt(index);
2775
+ if (code < 0x80) {
2776
+ buffer8[i++] = code;
2777
+ } else if (code < 0x800) {
2778
+ buffer8[i++] = 0xc0 | (code >> 6);
2779
+ buffer8[i++] = 0x80 | (code & 0x3f);
2780
+ } else if (code < 0xd800 || code >= 0xe000) {
2781
+ buffer8[i++] = 0xe0 | (code >> 12);
2782
+ buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
2783
+ buffer8[i++] = 0x80 | (code & 0x3f);
2784
+ } else {
2785
+ code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
2786
+ buffer8[i++] = 0xf0 | (code >> 18);
2787
+ buffer8[i++] = 0x80 | ((code >> 12) & 0x3f);
2788
+ buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
2789
+ buffer8[i++] = 0x80 | (code & 0x3f);
2790
+ }
2791
+ }
2773
2792
  } else {
2774
- return Promise.resolve(this._bodyArrayBuffer)
2793
+ for (i = this.start; index < length && i < 64; ++index) {
2794
+ code = message.charCodeAt(index);
2795
+ if (code < 0x80) {
2796
+ blocks[i >> 2] |= code << SHIFT[i++ & 3];
2797
+ } else if (code < 0x800) {
2798
+ blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
2799
+ blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
2800
+ } else if (code < 0xd800 || code >= 0xe000) {
2801
+ blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
2802
+ blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
2803
+ blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
2804
+ } else {
2805
+ code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
2806
+ blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
2807
+ blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
2808
+ blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
2809
+ blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
2810
+ }
2811
+ }
2775
2812
  }
2776
- } else if (support.blob) {
2777
- return this.blob().then(readBlobAsArrayBuffer)
2778
- } else {
2779
- throw new Error('could not read as ArrayBuffer')
2780
- }
2781
- };
2782
-
2783
- this.text = function() {
2784
- var rejected = consumed(this);
2785
- if (rejected) {
2786
- return rejected
2787
2813
  }
2788
-
2789
- if (this._bodyBlob) {
2790
- return readBlobAsText(this._bodyBlob)
2791
- } else if (this._bodyArrayBuffer) {
2792
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
2793
- } else if (this._bodyFormData) {
2794
- throw new Error('could not read FormData body as text')
2814
+ this.lastByteIndex = i;
2815
+ this.bytes += i - this.start;
2816
+ if (i >= 64) {
2817
+ this.start = i - 64;
2818
+ this.hash();
2819
+ this.hashed = true;
2795
2820
  } else {
2796
- return Promise.resolve(this._bodyText)
2821
+ this.start = i;
2797
2822
  }
2798
- };
2799
-
2800
- if (support.formData) {
2801
- this.formData = function() {
2802
- return this.text().then(decode)
2803
- };
2804
2823
  }
2824
+ if (this.bytes > 4294967295) {
2825
+ this.hBytes += this.bytes / 4294967296 << 0;
2826
+ this.bytes = this.bytes % 4294967296;
2827
+ }
2828
+ return this;
2829
+ };
2805
2830
 
2806
- this.json = function() {
2807
- return this.text().then(JSON.parse)
2808
- };
2809
-
2810
- return this
2811
- }
2812
-
2813
- // HTTP methods whose capitalization should be normalized
2814
- var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];
2815
-
2816
- function normalizeMethod(method) {
2817
- var upcased = method.toUpperCase();
2818
- return methods.indexOf(upcased) > -1 ? upcased : method
2819
- }
2820
-
2821
- function Request(input, options) {
2822
- if (!(this instanceof Request)) {
2823
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
2831
+ Md5.prototype.finalize = function () {
2832
+ if (this.finalized) {
2833
+ return;
2834
+ }
2835
+ this.finalized = true;
2836
+ var blocks = this.blocks, i = this.lastByteIndex;
2837
+ blocks[i >> 2] |= EXTRA[i & 3];
2838
+ if (i >= 56) {
2839
+ if (!this.hashed) {
2840
+ this.hash();
2841
+ }
2842
+ blocks[0] = blocks[16];
2843
+ blocks[16] = blocks[1] = blocks[2] = blocks[3] =
2844
+ blocks[4] = blocks[5] = blocks[6] = blocks[7] =
2845
+ blocks[8] = blocks[9] = blocks[10] = blocks[11] =
2846
+ blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
2824
2847
  }
2848
+ blocks[14] = this.bytes << 3;
2849
+ blocks[15] = this.hBytes << 3 | this.bytes >>> 29;
2850
+ this.hash();
2851
+ };
2825
2852
 
2826
- options = options || {};
2827
- var body = options.body;
2853
+ Md5.prototype.hash = function () {
2854
+ var a, b, c, d, bc, da, blocks = this.blocks;
2828
2855
 
2829
- if (input instanceof Request) {
2830
- if (input.bodyUsed) {
2831
- throw new TypeError('Already read')
2832
- }
2833
- this.url = input.url;
2834
- this.credentials = input.credentials;
2835
- if (!options.headers) {
2836
- this.headers = new Headers(input.headers);
2837
- }
2838
- this.method = input.method;
2839
- this.mode = input.mode;
2840
- this.signal = input.signal;
2841
- if (!body && input._bodyInit != null) {
2842
- body = input._bodyInit;
2843
- input.bodyUsed = true;
2844
- }
2856
+ if (this.first) {
2857
+ a = blocks[0] - 680876937;
2858
+ a = (a << 7 | a >>> 25) - 271733879 << 0;
2859
+ d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708;
2860
+ d = (d << 12 | d >>> 20) + a << 0;
2861
+ c = (-271733879 ^ (d & (a ^ -271733879))) + blocks[2] - 1126478375;
2862
+ c = (c << 17 | c >>> 15) + d << 0;
2863
+ b = (a ^ (c & (d ^ a))) + blocks[3] - 1316259209;
2864
+ b = (b << 22 | b >>> 10) + c << 0;
2845
2865
  } else {
2846
- this.url = String(input);
2866
+ a = this.h0;
2867
+ b = this.h1;
2868
+ c = this.h2;
2869
+ d = this.h3;
2870
+ a += (d ^ (b & (c ^ d))) + blocks[0] - 680876936;
2871
+ a = (a << 7 | a >>> 25) + b << 0;
2872
+ d += (c ^ (a & (b ^ c))) + blocks[1] - 389564586;
2873
+ d = (d << 12 | d >>> 20) + a << 0;
2874
+ c += (b ^ (d & (a ^ b))) + blocks[2] + 606105819;
2875
+ c = (c << 17 | c >>> 15) + d << 0;
2876
+ b += (a ^ (c & (d ^ a))) + blocks[3] - 1044525330;
2877
+ b = (b << 22 | b >>> 10) + c << 0;
2847
2878
  }
2848
2879
 
2849
- this.credentials = options.credentials || this.credentials || 'same-origin';
2850
- if (options.headers || !this.headers) {
2851
- this.headers = new Headers(options.headers);
2852
- }
2853
- this.method = normalizeMethod(options.method || this.method || 'GET');
2854
- this.mode = options.mode || this.mode || null;
2855
- this.signal = options.signal || this.signal || (function () {
2856
- if ('AbortController' in g) {
2857
- var ctrl = new AbortController();
2858
- return ctrl.signal;
2859
- }
2860
- }());
2861
- this.referrer = null;
2862
-
2863
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
2864
- throw new TypeError('Body not allowed for GET or HEAD requests')
2865
- }
2866
- this._initBody(body);
2880
+ a += (d ^ (b & (c ^ d))) + blocks[4] - 176418897;
2881
+ a = (a << 7 | a >>> 25) + b << 0;
2882
+ d += (c ^ (a & (b ^ c))) + blocks[5] + 1200080426;
2883
+ d = (d << 12 | d >>> 20) + a << 0;
2884
+ c += (b ^ (d & (a ^ b))) + blocks[6] - 1473231341;
2885
+ c = (c << 17 | c >>> 15) + d << 0;
2886
+ b += (a ^ (c & (d ^ a))) + blocks[7] - 45705983;
2887
+ b = (b << 22 | b >>> 10) + c << 0;
2888
+ a += (d ^ (b & (c ^ d))) + blocks[8] + 1770035416;
2889
+ a = (a << 7 | a >>> 25) + b << 0;
2890
+ d += (c ^ (a & (b ^ c))) + blocks[9] - 1958414417;
2891
+ d = (d << 12 | d >>> 20) + a << 0;
2892
+ c += (b ^ (d & (a ^ b))) + blocks[10] - 42063;
2893
+ c = (c << 17 | c >>> 15) + d << 0;
2894
+ b += (a ^ (c & (d ^ a))) + blocks[11] - 1990404162;
2895
+ b = (b << 22 | b >>> 10) + c << 0;
2896
+ a += (d ^ (b & (c ^ d))) + blocks[12] + 1804603682;
2897
+ a = (a << 7 | a >>> 25) + b << 0;
2898
+ d += (c ^ (a & (b ^ c))) + blocks[13] - 40341101;
2899
+ d = (d << 12 | d >>> 20) + a << 0;
2900
+ c += (b ^ (d & (a ^ b))) + blocks[14] - 1502002290;
2901
+ c = (c << 17 | c >>> 15) + d << 0;
2902
+ b += (a ^ (c & (d ^ a))) + blocks[15] + 1236535329;
2903
+ b = (b << 22 | b >>> 10) + c << 0;
2904
+ a += (c ^ (d & (b ^ c))) + blocks[1] - 165796510;
2905
+ a = (a << 5 | a >>> 27) + b << 0;
2906
+ d += (b ^ (c & (a ^ b))) + blocks[6] - 1069501632;
2907
+ d = (d << 9 | d >>> 23) + a << 0;
2908
+ c += (a ^ (b & (d ^ a))) + blocks[11] + 643717713;
2909
+ c = (c << 14 | c >>> 18) + d << 0;
2910
+ b += (d ^ (a & (c ^ d))) + blocks[0] - 373897302;
2911
+ b = (b << 20 | b >>> 12) + c << 0;
2912
+ a += (c ^ (d & (b ^ c))) + blocks[5] - 701558691;
2913
+ a = (a << 5 | a >>> 27) + b << 0;
2914
+ d += (b ^ (c & (a ^ b))) + blocks[10] + 38016083;
2915
+ d = (d << 9 | d >>> 23) + a << 0;
2916
+ c += (a ^ (b & (d ^ a))) + blocks[15] - 660478335;
2917
+ c = (c << 14 | c >>> 18) + d << 0;
2918
+ b += (d ^ (a & (c ^ d))) + blocks[4] - 405537848;
2919
+ b = (b << 20 | b >>> 12) + c << 0;
2920
+ a += (c ^ (d & (b ^ c))) + blocks[9] + 568446438;
2921
+ a = (a << 5 | a >>> 27) + b << 0;
2922
+ d += (b ^ (c & (a ^ b))) + blocks[14] - 1019803690;
2923
+ d = (d << 9 | d >>> 23) + a << 0;
2924
+ c += (a ^ (b & (d ^ a))) + blocks[3] - 187363961;
2925
+ c = (c << 14 | c >>> 18) + d << 0;
2926
+ b += (d ^ (a & (c ^ d))) + blocks[8] + 1163531501;
2927
+ b = (b << 20 | b >>> 12) + c << 0;
2928
+ a += (c ^ (d & (b ^ c))) + blocks[13] - 1444681467;
2929
+ a = (a << 5 | a >>> 27) + b << 0;
2930
+ d += (b ^ (c & (a ^ b))) + blocks[2] - 51403784;
2931
+ d = (d << 9 | d >>> 23) + a << 0;
2932
+ c += (a ^ (b & (d ^ a))) + blocks[7] + 1735328473;
2933
+ c = (c << 14 | c >>> 18) + d << 0;
2934
+ b += (d ^ (a & (c ^ d))) + blocks[12] - 1926607734;
2935
+ b = (b << 20 | b >>> 12) + c << 0;
2936
+ bc = b ^ c;
2937
+ a += (bc ^ d) + blocks[5] - 378558;
2938
+ a = (a << 4 | a >>> 28) + b << 0;
2939
+ d += (bc ^ a) + blocks[8] - 2022574463;
2940
+ d = (d << 11 | d >>> 21) + a << 0;
2941
+ da = d ^ a;
2942
+ c += (da ^ b) + blocks[11] + 1839030562;
2943
+ c = (c << 16 | c >>> 16) + d << 0;
2944
+ b += (da ^ c) + blocks[14] - 35309556;
2945
+ b = (b << 23 | b >>> 9) + c << 0;
2946
+ bc = b ^ c;
2947
+ a += (bc ^ d) + blocks[1] - 1530992060;
2948
+ a = (a << 4 | a >>> 28) + b << 0;
2949
+ d += (bc ^ a) + blocks[4] + 1272893353;
2950
+ d = (d << 11 | d >>> 21) + a << 0;
2951
+ da = d ^ a;
2952
+ c += (da ^ b) + blocks[7] - 155497632;
2953
+ c = (c << 16 | c >>> 16) + d << 0;
2954
+ b += (da ^ c) + blocks[10] - 1094730640;
2955
+ b = (b << 23 | b >>> 9) + c << 0;
2956
+ bc = b ^ c;
2957
+ a += (bc ^ d) + blocks[13] + 681279174;
2958
+ a = (a << 4 | a >>> 28) + b << 0;
2959
+ d += (bc ^ a) + blocks[0] - 358537222;
2960
+ d = (d << 11 | d >>> 21) + a << 0;
2961
+ da = d ^ a;
2962
+ c += (da ^ b) + blocks[3] - 722521979;
2963
+ c = (c << 16 | c >>> 16) + d << 0;
2964
+ b += (da ^ c) + blocks[6] + 76029189;
2965
+ b = (b << 23 | b >>> 9) + c << 0;
2966
+ bc = b ^ c;
2967
+ a += (bc ^ d) + blocks[9] - 640364487;
2968
+ a = (a << 4 | a >>> 28) + b << 0;
2969
+ d += (bc ^ a) + blocks[12] - 421815835;
2970
+ d = (d << 11 | d >>> 21) + a << 0;
2971
+ da = d ^ a;
2972
+ c += (da ^ b) + blocks[15] + 530742520;
2973
+ c = (c << 16 | c >>> 16) + d << 0;
2974
+ b += (da ^ c) + blocks[2] - 995338651;
2975
+ b = (b << 23 | b >>> 9) + c << 0;
2976
+ a += (c ^ (b | ~d)) + blocks[0] - 198630844;
2977
+ a = (a << 6 | a >>> 26) + b << 0;
2978
+ d += (b ^ (a | ~c)) + blocks[7] + 1126891415;
2979
+ d = (d << 10 | d >>> 22) + a << 0;
2980
+ c += (a ^ (d | ~b)) + blocks[14] - 1416354905;
2981
+ c = (c << 15 | c >>> 17) + d << 0;
2982
+ b += (d ^ (c | ~a)) + blocks[5] - 57434055;
2983
+ b = (b << 21 | b >>> 11) + c << 0;
2984
+ a += (c ^ (b | ~d)) + blocks[12] + 1700485571;
2985
+ a = (a << 6 | a >>> 26) + b << 0;
2986
+ d += (b ^ (a | ~c)) + blocks[3] - 1894986606;
2987
+ d = (d << 10 | d >>> 22) + a << 0;
2988
+ c += (a ^ (d | ~b)) + blocks[10] - 1051523;
2989
+ c = (c << 15 | c >>> 17) + d << 0;
2990
+ b += (d ^ (c | ~a)) + blocks[1] - 2054922799;
2991
+ b = (b << 21 | b >>> 11) + c << 0;
2992
+ a += (c ^ (b | ~d)) + blocks[8] + 1873313359;
2993
+ a = (a << 6 | a >>> 26) + b << 0;
2994
+ d += (b ^ (a | ~c)) + blocks[15] - 30611744;
2995
+ d = (d << 10 | d >>> 22) + a << 0;
2996
+ c += (a ^ (d | ~b)) + blocks[6] - 1560198380;
2997
+ c = (c << 15 | c >>> 17) + d << 0;
2998
+ b += (d ^ (c | ~a)) + blocks[13] + 1309151649;
2999
+ b = (b << 21 | b >>> 11) + c << 0;
3000
+ a += (c ^ (b | ~d)) + blocks[4] - 145523070;
3001
+ a = (a << 6 | a >>> 26) + b << 0;
3002
+ d += (b ^ (a | ~c)) + blocks[11] - 1120210379;
3003
+ d = (d << 10 | d >>> 22) + a << 0;
3004
+ c += (a ^ (d | ~b)) + blocks[2] + 718787259;
3005
+ c = (c << 15 | c >>> 17) + d << 0;
3006
+ b += (d ^ (c | ~a)) + blocks[9] - 343485551;
3007
+ b = (b << 21 | b >>> 11) + c << 0;
2867
3008
 
2868
- if (this.method === 'GET' || this.method === 'HEAD') {
2869
- if (options.cache === 'no-store' || options.cache === 'no-cache') {
2870
- // Search for a '_' parameter in the query string
2871
- var reParamSearch = /([?&])_=[^&]*/;
2872
- if (reParamSearch.test(this.url)) {
2873
- // If it already exists then set the value with the current time
2874
- this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
2875
- } else {
2876
- // Otherwise add a new '_' parameter to the end with the current time
2877
- var reQueryString = /\?/;
2878
- this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
2879
- }
2880
- }
3009
+ if (this.first) {
3010
+ this.h0 = a + 1732584193 << 0;
3011
+ this.h1 = b - 271733879 << 0;
3012
+ this.h2 = c - 1732584194 << 0;
3013
+ this.h3 = d + 271733878 << 0;
3014
+ this.first = false;
3015
+ } else {
3016
+ this.h0 = this.h0 + a << 0;
3017
+ this.h1 = this.h1 + b << 0;
3018
+ this.h2 = this.h2 + c << 0;
3019
+ this.h3 = this.h3 + d << 0;
2881
3020
  }
2882
- }
2883
-
2884
- Request.prototype.clone = function() {
2885
- return new Request(this, {body: this._bodyInit})
2886
3021
  };
2887
3022
 
2888
- function decode(body) {
2889
- var form = new FormData();
2890
- body
2891
- .trim()
2892
- .split('&')
2893
- .forEach(function(bytes) {
2894
- if (bytes) {
2895
- var split = bytes.split('=');
2896
- var name = split.shift().replace(/\+/g, ' ');
2897
- var value = split.join('=').replace(/\+/g, ' ');
2898
- form.append(decodeURIComponent(name), decodeURIComponent(value));
2899
- }
2900
- });
2901
- return form
2902
- }
2903
-
2904
- function parseHeaders(rawHeaders) {
2905
- var headers = new Headers();
2906
- // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
2907
- // https://tools.ietf.org/html/rfc7230#section-3.2
2908
- var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
2909
- // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
2910
- // https://github.com/github/fetch/issues/748
2911
- // https://github.com/zloirock/core-js/issues/751
2912
- preProcessedHeaders
2913
- .split('\r')
2914
- .map(function(header) {
2915
- return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header
2916
- })
2917
- .forEach(function(line) {
2918
- var parts = line.split(':');
2919
- var key = parts.shift().trim();
2920
- if (key) {
2921
- var value = parts.join(':').trim();
2922
- try {
2923
- headers.append(key, value);
2924
- } catch (error) {
2925
- console.warn('Response ' + error.message);
2926
- }
2927
- }
2928
- });
2929
- return headers
2930
- }
3023
+ /**
3024
+ * @method hex
3025
+ * @memberof Md5
3026
+ * @instance
3027
+ * @description Output hash as hex string
3028
+ * @returns {String} Hex string
3029
+ * @see {@link md5.hex}
3030
+ * @example
3031
+ * hash.hex();
3032
+ */
3033
+ Md5.prototype.hex = function () {
3034
+ this.finalize();
2931
3035
 
2932
- Body.call(Request.prototype);
3036
+ var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
2933
3037
 
2934
- function Response(bodyInit, options) {
2935
- if (!(this instanceof Response)) {
2936
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
2937
- }
2938
- if (!options) {
2939
- options = {};
2940
- }
3038
+ return HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +
3039
+ HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +
3040
+ HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +
3041
+ HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +
3042
+ HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +
3043
+ HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +
3044
+ HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +
3045
+ HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +
3046
+ HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +
3047
+ HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +
3048
+ HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +
3049
+ HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +
3050
+ HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +
3051
+ HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +
3052
+ HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +
3053
+ HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F];
3054
+ };
2941
3055
 
2942
- this.type = 'default';
2943
- this.status = options.status === undefined ? 200 : options.status;
2944
- if (this.status < 200 || this.status > 599) {
2945
- throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].")
2946
- }
2947
- this.ok = this.status >= 200 && this.status < 300;
2948
- this.statusText = options.statusText === undefined ? '' : '' + options.statusText;
2949
- this.headers = new Headers(options.headers);
2950
- this.url = options.url || '';
2951
- this._initBody(bodyInit);
2952
- }
3056
+ /**
3057
+ * @method toString
3058
+ * @memberof Md5
3059
+ * @instance
3060
+ * @description Output hash as hex string
3061
+ * @returns {String} Hex string
3062
+ * @see {@link md5.hex}
3063
+ * @example
3064
+ * hash.toString();
3065
+ */
3066
+ Md5.prototype.toString = Md5.prototype.hex;
2953
3067
 
2954
- Body.call(Response.prototype);
3068
+ /**
3069
+ * @method digest
3070
+ * @memberof Md5
3071
+ * @instance
3072
+ * @description Output hash as bytes array
3073
+ * @returns {Array} Bytes array
3074
+ * @see {@link md5.digest}
3075
+ * @example
3076
+ * hash.digest();
3077
+ */
3078
+ Md5.prototype.digest = function () {
3079
+ this.finalize();
2955
3080
 
2956
- Response.prototype.clone = function() {
2957
- return new Response(this._bodyInit, {
2958
- status: this.status,
2959
- statusText: this.statusText,
2960
- headers: new Headers(this.headers),
2961
- url: this.url
2962
- })
3081
+ var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
3082
+ return [
3083
+ h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 24) & 0xFF,
3084
+ h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 24) & 0xFF,
3085
+ h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 24) & 0xFF,
3086
+ h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 24) & 0xFF
3087
+ ];
2963
3088
  };
2964
3089
 
2965
- Response.error = function() {
2966
- var response = new Response(null, {status: 200, statusText: ''});
2967
- response.ok = false;
2968
- response.status = 0;
2969
- response.type = 'error';
2970
- return response
3090
+ /**
3091
+ * @method array
3092
+ * @memberof Md5
3093
+ * @instance
3094
+ * @description Output hash as bytes array
3095
+ * @returns {Array} Bytes array
3096
+ * @see {@link md5.array}
3097
+ * @example
3098
+ * hash.array();
3099
+ */
3100
+ Md5.prototype.array = Md5.prototype.digest;
3101
+
3102
+ /**
3103
+ * @method arrayBuffer
3104
+ * @memberof Md5
3105
+ * @instance
3106
+ * @description Output hash as ArrayBuffer
3107
+ * @returns {ArrayBuffer} ArrayBuffer
3108
+ * @see {@link md5.arrayBuffer}
3109
+ * @example
3110
+ * hash.arrayBuffer();
3111
+ */
3112
+ Md5.prototype.arrayBuffer = function () {
3113
+ this.finalize();
3114
+
3115
+ var buffer = new ArrayBuffer(16);
3116
+ var blocks = new Uint32Array(buffer);
3117
+ blocks[0] = this.h0;
3118
+ blocks[1] = this.h1;
3119
+ blocks[2] = this.h2;
3120
+ blocks[3] = this.h3;
3121
+ return buffer;
2971
3122
  };
2972
3123
 
2973
- var redirectStatuses = [301, 302, 303, 307, 308];
3124
+ /**
3125
+ * @method buffer
3126
+ * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
3127
+ * @memberof Md5
3128
+ * @instance
3129
+ * @description Output hash as ArrayBuffer
3130
+ * @returns {ArrayBuffer} ArrayBuffer
3131
+ * @see {@link md5.buffer}
3132
+ * @example
3133
+ * hash.buffer();
3134
+ */
3135
+ Md5.prototype.buffer = Md5.prototype.arrayBuffer;
2974
3136
 
2975
- Response.redirect = function(url, status) {
2976
- if (redirectStatuses.indexOf(status) === -1) {
2977
- throw new RangeError('Invalid status code')
3137
+ /**
3138
+ * @method base64
3139
+ * @memberof Md5
3140
+ * @instance
3141
+ * @description Output hash as base64 string
3142
+ * @returns {String} base64 string
3143
+ * @see {@link md5.base64}
3144
+ * @example
3145
+ * hash.base64();
3146
+ */
3147
+ Md5.prototype.base64 = function () {
3148
+ var v1, v2, v3, base64Str = '', bytes = this.array();
3149
+ for (var i = 0; i < 15;) {
3150
+ v1 = bytes[i++];
3151
+ v2 = bytes[i++];
3152
+ v3 = bytes[i++];
3153
+ base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
3154
+ BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
3155
+ BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] +
3156
+ BASE64_ENCODE_CHAR[v3 & 63];
2978
3157
  }
2979
-
2980
- return new Response(null, {status: status, headers: {location: url}})
3158
+ v1 = bytes[i];
3159
+ base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
3160
+ BASE64_ENCODE_CHAR[(v1 << 4) & 63] +
3161
+ '==';
3162
+ return base64Str;
2981
3163
  };
2982
3164
 
2983
- exports.DOMException = g.DOMException;
2984
- try {
2985
- new exports.DOMException();
2986
- } catch (err) {
2987
- exports.DOMException = function(message, name) {
2988
- this.message = message;
2989
- this.name = name;
2990
- var error = Error(message);
2991
- this.stack = error.stack;
2992
- };
2993
- exports.DOMException.prototype = Object.create(Error.prototype);
2994
- exports.DOMException.prototype.constructor = exports.DOMException;
3165
+ var exports = createMethod();
3166
+
3167
+ if (COMMON_JS) {
3168
+ module.exports = exports;
3169
+ } else {
3170
+ /**
3171
+ * @method md5
3172
+ * @description Md5 hash function, export to global in browsers.
3173
+ * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3174
+ * @returns {String} md5 hashes
3175
+ * @example
3176
+ * md5(''); // d41d8cd98f00b204e9800998ecf8427e
3177
+ * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6
3178
+ * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0
3179
+ *
3180
+ * // It also supports UTF-8 encoding
3181
+ * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
3182
+ *
3183
+ * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
3184
+ * md5([]); // d41d8cd98f00b204e9800998ecf8427e
3185
+ * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
3186
+ */
3187
+ root.md5 = exports;
3188
+ if (AMD) {
3189
+ !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
3190
+ return exports;
3191
+ }).call(exports, __webpack_require__, exports, module),
3192
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
3193
+ }
2995
3194
  }
3195
+ })();
2996
3196
 
2997
- function fetch(input, init) {
2998
- return new Promise(function(resolve, reject) {
2999
- var request = new Request(input, init);
3000
3197
 
3001
- if (request.signal && request.signal.aborted) {
3002
- return reject(new exports.DOMException('Aborted', 'AbortError'))
3003
- }
3198
+ /***/ }),
3004
3199
 
3005
- var xhr = new XMLHttpRequest();
3200
+ /***/ 408:
3201
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3006
3202
 
3007
- function abortXhr() {
3008
- xhr.abort();
3009
- }
3203
+ var microee = __webpack_require__(173);
3010
3204
 
3011
- xhr.onload = function() {
3012
- var options = {
3013
- statusText: xhr.statusText,
3014
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
3015
- };
3016
- // This check if specifically for when a user fetches a file locally from the file system
3017
- // Only if the status is out of a normal range
3018
- if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {
3019
- options.status = 200;
3020
- } else {
3021
- options.status = xhr.status;
3022
- }
3023
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
3024
- var body = 'response' in xhr ? xhr.response : xhr.responseText;
3025
- setTimeout(function() {
3026
- resolve(new Response(body, options));
3027
- }, 0);
3028
- };
3205
+ // Implements a subset of Node's stream.Transform - in a cross-platform manner.
3206
+ function Transform() {}
3029
3207
 
3030
- xhr.onerror = function() {
3031
- setTimeout(function() {
3032
- reject(new TypeError('Network request failed'));
3033
- }, 0);
3034
- };
3208
+ microee.mixin(Transform);
3035
3209
 
3036
- xhr.ontimeout = function() {
3037
- setTimeout(function() {
3038
- reject(new TypeError('Network request timed out'));
3039
- }, 0);
3040
- };
3210
+ // The write() signature is different from Node's
3211
+ // --> makes it much easier to work with objects in logs.
3212
+ // One of the lessons from v1 was that it's better to target
3213
+ // a good browser rather than the lowest common denominator
3214
+ // internally.
3215
+ // If you want to use external streams, pipe() to ./stringify.js first.
3216
+ Transform.prototype.write = function(name, level, args) {
3217
+ this.emit('item', name, level, args);
3218
+ };
3041
3219
 
3042
- xhr.onabort = function() {
3043
- setTimeout(function() {
3044
- reject(new exports.DOMException('Aborted', 'AbortError'));
3045
- }, 0);
3046
- };
3220
+ Transform.prototype.end = function() {
3221
+ this.emit('end');
3222
+ this.removeAllListeners();
3223
+ };
3047
3224
 
3048
- function fixUrl(url) {
3049
- try {
3050
- return url === '' && g.location.href ? g.location.href : url
3051
- } catch (e) {
3052
- return url
3053
- }
3054
- }
3225
+ Transform.prototype.pipe = function(dest) {
3226
+ var s = this;
3227
+ // prevent double piping
3228
+ s.emit('unpipe', dest);
3229
+ // tell the dest that it's being piped to
3230
+ dest.emit('pipe', s);
3055
3231
 
3056
- xhr.open(request.method, fixUrl(request.url), true);
3232
+ function onItem() {
3233
+ dest.write.apply(dest, Array.prototype.slice.call(arguments));
3234
+ }
3235
+ function onEnd() { !dest._isStdio && dest.end(); }
3057
3236
 
3058
- if (request.credentials === 'include') {
3059
- xhr.withCredentials = true;
3060
- } else if (request.credentials === 'omit') {
3061
- xhr.withCredentials = false;
3062
- }
3237
+ s.on('item', onItem);
3238
+ s.on('end', onEnd);
3063
3239
 
3064
- if ('responseType' in xhr) {
3065
- if (support.blob) {
3066
- xhr.responseType = 'blob';
3067
- } else if (
3068
- support.arrayBuffer
3069
- ) {
3070
- xhr.responseType = 'arraybuffer';
3071
- }
3072
- }
3240
+ s.when('unpipe', function(from) {
3241
+ var match = (from === dest) || typeof from == 'undefined';
3242
+ if(match) {
3243
+ s.removeListener('item', onItem);
3244
+ s.removeListener('end', onEnd);
3245
+ dest.emit('unpipe');
3246
+ }
3247
+ return match;
3248
+ });
3073
3249
 
3074
- if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {
3075
- var names = [];
3076
- Object.getOwnPropertyNames(init.headers).forEach(function(name) {
3077
- names.push(normalizeName(name));
3078
- xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
3079
- });
3080
- request.headers.forEach(function(value, name) {
3081
- if (names.indexOf(name) === -1) {
3082
- xhr.setRequestHeader(name, value);
3083
- }
3084
- });
3085
- } else {
3086
- request.headers.forEach(function(value, name) {
3087
- xhr.setRequestHeader(name, value);
3088
- });
3089
- }
3250
+ return dest;
3251
+ };
3090
3252
 
3091
- if (request.signal) {
3092
- request.signal.addEventListener('abort', abortXhr);
3253
+ Transform.prototype.unpipe = function(from) {
3254
+ this.emit('unpipe', from);
3255
+ return this;
3256
+ };
3093
3257
 
3094
- xhr.onreadystatechange = function() {
3095
- // DONE (success or failure)
3096
- if (xhr.readyState === 4) {
3097
- request.signal.removeEventListener('abort', abortXhr);
3098
- }
3099
- };
3100
- }
3258
+ Transform.prototype.format = function(dest) {
3259
+ throw new Error([
3260
+ 'Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:',
3261
+ 'var Minilog = require(\'minilog\');',
3262
+ 'Minilog',
3263
+ ' .pipe(Minilog.backends.console.formatClean)',
3264
+ ' .pipe(Minilog.backends.console);'].join('\n'));
3265
+ };
3101
3266
 
3102
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
3103
- })
3267
+ Transform.mixin = function(dest) {
3268
+ var o = Transform.prototype, k;
3269
+ for (k in o) {
3270
+ o.hasOwnProperty(k) && (dest.prototype[k] = o[k]);
3104
3271
  }
3272
+ };
3105
3273
 
3106
- fetch.polyfill = true;
3274
+ module.exports = Transform;
3107
3275
 
3108
- if (!g.fetch) {
3109
- g.fetch = fetch;
3110
- g.Headers = Headers;
3111
- g.Request = Request;
3112
- g.Response = Response;
3113
- }
3114
3276
 
3115
- exports.Headers = Headers;
3116
- exports.Request = Request;
3117
- exports.Response = Response;
3118
- exports.fetch = fetch;
3277
+ /***/ }),
3119
3278
 
3120
- return exports;
3279
+ /***/ 526:
3280
+ /***/ ((__unused_webpack_module, exports) => {
3121
3281
 
3122
- })({});
3123
- })(__globalThis__);
3124
- // This is a ponyfill, so...
3125
- __globalThis__.fetch.ponyfill = true;
3126
- delete __globalThis__.fetch.polyfill;
3127
- // Choose between native implementation (__global__) or custom implementation (__globalThis__)
3128
- var ctx = __global__.fetch ? __global__ : __globalThis__;
3129
- exports = ctx.fetch // To enable: import fetch from 'cross-fetch'
3130
- exports["default"] = ctx.fetch // For TypeScript consumers without esModuleInterop.
3131
- exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'
3132
- exports.Headers = ctx.Headers
3133
- exports.Request = ctx.Request
3134
- exports.Response = ctx.Response
3135
- module.exports = exports
3282
+ "use strict";
3136
3283
 
3137
3284
 
3138
- /***/ }),
3285
+ exports.byteLength = byteLength
3286
+ exports.toByteArray = toByteArray
3287
+ exports.fromByteArray = fromByteArray
3139
3288
 
3140
- /***/ 767:
3141
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
3289
+ var lookup = []
3290
+ var revLookup = []
3291
+ var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
3142
3292
 
3143
- "use strict";
3144
- (function(r){function x(){}function y(){}var z=String.fromCharCode,v={}.toString,A=v.call(r.SharedArrayBuffer),B=v(),q=r.Uint8Array,t=q||Array,w=q?ArrayBuffer:t,C=w.isView||function(g){return g&&"length"in g},D=v.call(w.prototype);w=y.prototype;var E=r.TextEncoder,a=new (q?Uint16Array:t)(32);x.prototype.decode=function(g){if(!C(g)){var l=v.call(g);if(l!==D&&l!==A&&l!==B)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
3145
- g=q?new t(g):g||[]}for(var f=l="",b=0,c=g.length|0,u=c-32|0,e,d,h=0,p=0,m,k=0,n=-1;b<c;){for(e=b<=u?32:c-b|0;k<e;b=b+1|0,k=k+1|0){d=g[b]&255;switch(d>>4){case 15:m=g[b=b+1|0]&255;if(2!==m>>6||247<d){b=b-1|0;break}h=(d&7)<<6|m&63;p=5;d=256;case 14:m=g[b=b+1|0]&255,h<<=6,h|=(d&15)<<6|m&63,p=2===m>>6?p+4|0:24,d=d+256&768;case 13:case 12:m=g[b=b+1|0]&255,h<<=6,h|=(d&31)<<6|m&63,p=p+7|0,b<c&&2===m>>6&&h>>p&&1114112>h?(d=h,h=h-65536|0,0<=h&&(n=(h>>10)+55296|0,d=(h&1023)+56320|0,31>k?(a[k]=n,k=k+1|0,n=-1):
3146
- (m=n,n=d,d=m))):(d>>=8,b=b-d-1|0,d=65533),h=p=0,e=b<=u?32:c-b|0;default:a[k]=d;continue;case 11:case 10:case 9:case 8:}a[k]=65533}f+=z(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15],a[16],a[17],a[18],a[19],a[20],a[21],a[22],a[23],a[24],a[25],a[26],a[27],a[28],a[29],a[30],a[31]);32>k&&(f=f.slice(0,k-32|0));if(b<c){if(a[0]=n,k=~n>>>31,n=-1,f.length<l.length)continue}else-1!==n&&(f+=z(n));l+=f;f=""}return l};w.encode=function(g){g=void 0===g?"":""+g;var l=g.length|
3147
- 0,f=new t((l<<1)+8|0),b,c=0,u=!q;for(b=0;b<l;b=b+1|0,c=c+1|0){var e=g.charCodeAt(b)|0;if(127>=e)f[c]=e;else{if(2047>=e)f[c]=192|e>>6;else{a:{if(55296<=e)if(56319>=e){var d=g.charCodeAt(b=b+1|0)|0;if(56320<=d&&57343>=d){e=(e<<10)+d-56613888|0;if(65535<e){f[c]=240|e>>18;f[c=c+1|0]=128|e>>12&63;f[c=c+1|0]=128|e>>6&63;f[c=c+1|0]=128|e&63;continue}break a}e=65533}else 57343>=e&&(e=65533);!u&&b<<1<c&&b<<1<(c-7|0)&&(u=!0,d=new t(3*l),d.set(f),f=d)}f[c]=224|e>>12;f[c=c+1|0]=128|e>>6&63}f[c=c+1|0]=128|e&63}}return q?
3148
- f.subarray(0,c):f.slice(0,c)};E||(r.TextDecoder=x,r.TextEncoder=y)})(""+void 0==typeof __webpack_require__.g?""+void 0==typeof self?this:self:__webpack_require__.g);//AnonyCo
3149
- //# sourceMappingURL=https://cdn.jsdelivr.net/gh/AnonyCo/FastestSmallestTextEncoderDecoder/EncoderDecoderTogether.min.js.map
3293
+ var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
3294
+ for (var i = 0, len = code.length; i < len; ++i) {
3295
+ lookup[i] = code[i]
3296
+ revLookup[code.charCodeAt(i)] = i
3297
+ }
3150
3298
 
3299
+ // Support decoding URL-safe base64 strings, as Node.js does.
3300
+ // See: https://en.wikipedia.org/wiki/Base64#URL_applications
3301
+ revLookup['-'.charCodeAt(0)] = 62
3302
+ revLookup['_'.charCodeAt(0)] = 63
3151
3303
 
3152
- /***/ }),
3304
+ function getLens (b64) {
3305
+ var len = b64.length
3153
3306
 
3154
- /***/ 251:
3155
- /***/ ((__unused_webpack_module, exports) => {
3307
+ if (len % 4 > 0) {
3308
+ throw new Error('Invalid string. Length must be a multiple of 4')
3309
+ }
3156
3310
 
3157
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3158
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
3159
- var e, m
3160
- var eLen = (nBytes * 8) - mLen - 1
3161
- var eMax = (1 << eLen) - 1
3162
- var eBias = eMax >> 1
3163
- var nBits = -7
3164
- var i = isLE ? (nBytes - 1) : 0
3165
- var d = isLE ? -1 : 1
3166
- var s = buffer[offset + i]
3311
+ // Trim off extra bytes after placeholder bytes are found
3312
+ // See: https://github.com/beatgammit/base64-js/issues/42
3313
+ var validLen = b64.indexOf('=')
3314
+ if (validLen === -1) validLen = len
3167
3315
 
3168
- i += d
3316
+ var placeHoldersLen = validLen === len
3317
+ ? 0
3318
+ : 4 - (validLen % 4)
3169
3319
 
3170
- e = s & ((1 << (-nBits)) - 1)
3171
- s >>= (-nBits)
3172
- nBits += eLen
3173
- for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
3320
+ return [validLen, placeHoldersLen]
3321
+ }
3174
3322
 
3175
- m = e & ((1 << (-nBits)) - 1)
3176
- e >>= (-nBits)
3177
- nBits += mLen
3178
- for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
3323
+ // base64 is 4/3 + up to two characters of the original data
3324
+ function byteLength (b64) {
3325
+ var lens = getLens(b64)
3326
+ var validLen = lens[0]
3327
+ var placeHoldersLen = lens[1]
3328
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
3329
+ }
3179
3330
 
3180
- if (e === 0) {
3181
- e = 1 - eBias
3182
- } else if (e === eMax) {
3183
- return m ? NaN : ((s ? -1 : 1) * Infinity)
3184
- } else {
3185
- m = m + Math.pow(2, mLen)
3186
- e = e - eBias
3187
- }
3188
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
3331
+ function _byteLength (b64, validLen, placeHoldersLen) {
3332
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
3189
3333
  }
3190
3334
 
3191
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
3192
- var e, m, c
3193
- var eLen = (nBytes * 8) - mLen - 1
3194
- var eMax = (1 << eLen) - 1
3195
- var eBias = eMax >> 1
3196
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
3197
- var i = isLE ? 0 : (nBytes - 1)
3198
- var d = isLE ? 1 : -1
3199
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
3335
+ function toByteArray (b64) {
3336
+ var tmp
3337
+ var lens = getLens(b64)
3338
+ var validLen = lens[0]
3339
+ var placeHoldersLen = lens[1]
3200
3340
 
3201
- value = Math.abs(value)
3341
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
3202
3342
 
3203
- if (isNaN(value) || value === Infinity) {
3204
- m = isNaN(value) ? 1 : 0
3205
- e = eMax
3206
- } else {
3207
- e = Math.floor(Math.log(value) / Math.LN2)
3208
- if (value * (c = Math.pow(2, -e)) < 1) {
3209
- e--
3210
- c *= 2
3211
- }
3212
- if (e + eBias >= 1) {
3213
- value += rt / c
3214
- } else {
3215
- value += rt * Math.pow(2, 1 - eBias)
3216
- }
3217
- if (value * c >= 2) {
3218
- e++
3219
- c /= 2
3220
- }
3343
+ var curByte = 0
3221
3344
 
3222
- if (e + eBias >= eMax) {
3223
- m = 0
3224
- e = eMax
3225
- } else if (e + eBias >= 1) {
3226
- m = ((value * c) - 1) * Math.pow(2, mLen)
3227
- e = e + eBias
3228
- } else {
3229
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
3230
- e = 0
3231
- }
3345
+ // if there are placeholders, only get up to the last complete 4 chars
3346
+ var len = placeHoldersLen > 0
3347
+ ? validLen - 4
3348
+ : validLen
3349
+
3350
+ var i
3351
+ for (i = 0; i < len; i += 4) {
3352
+ tmp =
3353
+ (revLookup[b64.charCodeAt(i)] << 18) |
3354
+ (revLookup[b64.charCodeAt(i + 1)] << 12) |
3355
+ (revLookup[b64.charCodeAt(i + 2)] << 6) |
3356
+ revLookup[b64.charCodeAt(i + 3)]
3357
+ arr[curByte++] = (tmp >> 16) & 0xFF
3358
+ arr[curByte++] = (tmp >> 8) & 0xFF
3359
+ arr[curByte++] = tmp & 0xFF
3232
3360
  }
3233
3361
 
3234
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
3362
+ if (placeHoldersLen === 2) {
3363
+ tmp =
3364
+ (revLookup[b64.charCodeAt(i)] << 2) |
3365
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
3366
+ arr[curByte++] = tmp & 0xFF
3367
+ }
3235
3368
 
3236
- e = (e << mLen) | m
3237
- eLen += mLen
3238
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
3369
+ if (placeHoldersLen === 1) {
3370
+ tmp =
3371
+ (revLookup[b64.charCodeAt(i)] << 10) |
3372
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
3373
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
3374
+ arr[curByte++] = (tmp >> 8) & 0xFF
3375
+ arr[curByte++] = tmp & 0xFF
3376
+ }
3239
3377
 
3240
- buffer[offset + i - d] |= s * 128
3378
+ return arr
3241
3379
  }
3242
3380
 
3381
+ function tripletToBase64 (num) {
3382
+ return lookup[num >> 18 & 0x3F] +
3383
+ lookup[num >> 12 & 0x3F] +
3384
+ lookup[num >> 6 & 0x3F] +
3385
+ lookup[num & 0x3F]
3386
+ }
3243
3387
 
3244
- /***/ }),
3245
-
3246
- /***/ 386:
3247
- /***/ ((module, exports, __webpack_require__) => {
3248
-
3249
- var __WEBPACK_AMD_DEFINE_RESULT__;/**
3250
- * [js-md5]{@link https://github.com/emn178/js-md5}
3251
- *
3252
- * @namespace md5
3253
- * @version 0.7.3
3254
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
3255
- * @copyright Chen, Yi-Cyuan 2014-2017
3256
- * @license MIT
3257
- */
3258
- (function () {
3259
- 'use strict';
3260
-
3261
- var ERROR = 'input is invalid type';
3262
- var WINDOW = typeof window === 'object';
3263
- var root = WINDOW ? window : {};
3264
- if (root.JS_MD5_NO_WINDOW) {
3265
- WINDOW = false;
3266
- }
3267
- var WEB_WORKER = !WINDOW && typeof self === 'object';
3268
- var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
3269
- if (NODE_JS) {
3270
- root = __webpack_require__.g;
3271
- } else if (WEB_WORKER) {
3272
- root = self;
3273
- }
3274
- var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && "object" === 'object' && module.exports;
3275
- var AMD = true && __webpack_require__.amdO;
3276
- var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
3277
- var HEX_CHARS = '0123456789abcdef'.split('');
3278
- var EXTRA = [128, 32768, 8388608, -2147483648];
3279
- var SHIFT = [0, 8, 16, 24];
3280
- var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64'];
3281
- var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
3282
-
3283
- var blocks = [], buffer8;
3284
- if (ARRAY_BUFFER) {
3285
- var buffer = new ArrayBuffer(68);
3286
- buffer8 = new Uint8Array(buffer);
3287
- blocks = new Uint32Array(buffer);
3288
- }
3289
-
3290
- if (root.JS_MD5_NO_NODE_JS || !Array.isArray) {
3291
- Array.isArray = function (obj) {
3292
- return Object.prototype.toString.call(obj) === '[object Array]';
3293
- };
3294
- }
3295
-
3296
- if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
3297
- ArrayBuffer.isView = function (obj) {
3298
- return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
3299
- };
3300
- }
3301
-
3302
- /**
3303
- * @method hex
3304
- * @memberof md5
3305
- * @description Output hash as hex string
3306
- * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3307
- * @returns {String} Hex string
3308
- * @example
3309
- * md5.hex('The quick brown fox jumps over the lazy dog');
3310
- * // equal to
3311
- * md5('The quick brown fox jumps over the lazy dog');
3312
- */
3313
- /**
3314
- * @method digest
3315
- * @memberof md5
3316
- * @description Output hash as bytes array
3317
- * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3318
- * @returns {Array} Bytes array
3319
- * @example
3320
- * md5.digest('The quick brown fox jumps over the lazy dog');
3321
- */
3322
- /**
3323
- * @method array
3324
- * @memberof md5
3325
- * @description Output hash as bytes array
3326
- * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3327
- * @returns {Array} Bytes array
3328
- * @example
3329
- * md5.array('The quick brown fox jumps over the lazy dog');
3330
- */
3331
- /**
3332
- * @method arrayBuffer
3333
- * @memberof md5
3334
- * @description Output hash as ArrayBuffer
3335
- * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3336
- * @returns {ArrayBuffer} ArrayBuffer
3337
- * @example
3338
- * md5.arrayBuffer('The quick brown fox jumps over the lazy dog');
3339
- */
3340
- /**
3341
- * @method buffer
3342
- * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
3343
- * @memberof md5
3344
- * @description Output hash as ArrayBuffer
3345
- * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3346
- * @returns {ArrayBuffer} ArrayBuffer
3347
- * @example
3348
- * md5.buffer('The quick brown fox jumps over the lazy dog');
3349
- */
3350
- /**
3351
- * @method base64
3352
- * @memberof md5
3353
- * @description Output hash as base64 string
3354
- * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3355
- * @returns {String} base64 string
3356
- * @example
3357
- * md5.base64('The quick brown fox jumps over the lazy dog');
3358
- */
3359
- var createOutputMethod = function (outputType) {
3360
- return function (message) {
3361
- return new Md5(true).update(message)[outputType]();
3362
- };
3363
- };
3364
-
3365
- /**
3366
- * @method create
3367
- * @memberof md5
3368
- * @description Create Md5 object
3369
- * @returns {Md5} Md5 object.
3370
- * @example
3371
- * var hash = md5.create();
3372
- */
3373
- /**
3374
- * @method update
3375
- * @memberof md5
3376
- * @description Create and update Md5 object
3377
- * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3378
- * @returns {Md5} Md5 object.
3379
- * @example
3380
- * var hash = md5.update('The quick brown fox jumps over the lazy dog');
3381
- * // equal to
3382
- * var hash = md5.create();
3383
- * hash.update('The quick brown fox jumps over the lazy dog');
3384
- */
3385
- var createMethod = function () {
3386
- var method = createOutputMethod('hex');
3387
- if (NODE_JS) {
3388
- method = nodeWrap(method);
3389
- }
3390
- method.create = function () {
3391
- return new Md5();
3392
- };
3393
- method.update = function (message) {
3394
- return method.create().update(message);
3395
- };
3396
- for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
3397
- var type = OUTPUT_TYPES[i];
3398
- method[type] = createOutputMethod(type);
3399
- }
3400
- return method;
3401
- };
3402
-
3403
- var nodeWrap = function (method) {
3404
- var crypto = eval("require('crypto')");
3405
- var Buffer = eval("require('buffer').Buffer");
3406
- var nodeMethod = function (message) {
3407
- if (typeof message === 'string') {
3408
- return crypto.createHash('md5').update(message, 'utf8').digest('hex');
3409
- } else {
3410
- if (message === null || message === undefined) {
3411
- throw ERROR;
3412
- } else if (message.constructor === ArrayBuffer) {
3413
- message = new Uint8Array(message);
3414
- }
3415
- }
3416
- if (Array.isArray(message) || ArrayBuffer.isView(message) ||
3417
- message.constructor === Buffer) {
3418
- return crypto.createHash('md5').update(new Buffer(message)).digest('hex');
3419
- } else {
3420
- return method(message);
3421
- }
3422
- };
3423
- return nodeMethod;
3424
- };
3425
-
3426
- /**
3427
- * Md5 class
3428
- * @class Md5
3429
- * @description This is internal class.
3430
- * @see {@link md5.create}
3431
- */
3432
- function Md5(sharedMemory) {
3433
- if (sharedMemory) {
3434
- blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
3435
- blocks[4] = blocks[5] = blocks[6] = blocks[7] =
3436
- blocks[8] = blocks[9] = blocks[10] = blocks[11] =
3437
- blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
3438
- this.blocks = blocks;
3439
- this.buffer8 = buffer8;
3440
- } else {
3441
- if (ARRAY_BUFFER) {
3442
- var buffer = new ArrayBuffer(68);
3443
- this.buffer8 = new Uint8Array(buffer);
3444
- this.blocks = new Uint32Array(buffer);
3445
- } else {
3446
- this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
3447
- }
3448
- }
3449
- this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0;
3450
- this.finalized = this.hashed = false;
3451
- this.first = true;
3452
- }
3453
-
3454
- /**
3455
- * @method update
3456
- * @memberof Md5
3457
- * @instance
3458
- * @description Update hash
3459
- * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3460
- * @returns {Md5} Md5 object.
3461
- * @see {@link md5.update}
3462
- */
3463
- Md5.prototype.update = function (message) {
3464
- if (this.finalized) {
3465
- return;
3466
- }
3467
-
3468
- var notString, type = typeof message;
3469
- if (type !== 'string') {
3470
- if (type === 'object') {
3471
- if (message === null) {
3472
- throw ERROR;
3473
- } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
3474
- message = new Uint8Array(message);
3475
- } else if (!Array.isArray(message)) {
3476
- if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
3477
- throw ERROR;
3478
- }
3479
- }
3480
- } else {
3481
- throw ERROR;
3482
- }
3483
- notString = true;
3484
- }
3485
- var code, index = 0, i, length = message.length, blocks = this.blocks;
3486
- var buffer8 = this.buffer8;
3487
-
3488
- while (index < length) {
3489
- if (this.hashed) {
3490
- this.hashed = false;
3491
- blocks[0] = blocks[16];
3492
- blocks[16] = blocks[1] = blocks[2] = blocks[3] =
3493
- blocks[4] = blocks[5] = blocks[6] = blocks[7] =
3494
- blocks[8] = blocks[9] = blocks[10] = blocks[11] =
3495
- blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
3496
- }
3497
-
3498
- if (notString) {
3499
- if (ARRAY_BUFFER) {
3500
- for (i = this.start; index < length && i < 64; ++index) {
3501
- buffer8[i++] = message[index];
3502
- }
3503
- } else {
3504
- for (i = this.start; index < length && i < 64; ++index) {
3505
- blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
3506
- }
3507
- }
3508
- } else {
3509
- if (ARRAY_BUFFER) {
3510
- for (i = this.start; index < length && i < 64; ++index) {
3511
- code = message.charCodeAt(index);
3512
- if (code < 0x80) {
3513
- buffer8[i++] = code;
3514
- } else if (code < 0x800) {
3515
- buffer8[i++] = 0xc0 | (code >> 6);
3516
- buffer8[i++] = 0x80 | (code & 0x3f);
3517
- } else if (code < 0xd800 || code >= 0xe000) {
3518
- buffer8[i++] = 0xe0 | (code >> 12);
3519
- buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
3520
- buffer8[i++] = 0x80 | (code & 0x3f);
3521
- } else {
3522
- code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
3523
- buffer8[i++] = 0xf0 | (code >> 18);
3524
- buffer8[i++] = 0x80 | ((code >> 12) & 0x3f);
3525
- buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
3526
- buffer8[i++] = 0x80 | (code & 0x3f);
3527
- }
3528
- }
3529
- } else {
3530
- for (i = this.start; index < length && i < 64; ++index) {
3531
- code = message.charCodeAt(index);
3532
- if (code < 0x80) {
3533
- blocks[i >> 2] |= code << SHIFT[i++ & 3];
3534
- } else if (code < 0x800) {
3535
- blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
3536
- blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
3537
- } else if (code < 0xd800 || code >= 0xe000) {
3538
- blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
3539
- blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
3540
- blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
3541
- } else {
3542
- code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
3543
- blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
3544
- blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
3545
- blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
3546
- blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
3547
- }
3548
- }
3549
- }
3550
- }
3551
- this.lastByteIndex = i;
3552
- this.bytes += i - this.start;
3553
- if (i >= 64) {
3554
- this.start = i - 64;
3555
- this.hash();
3556
- this.hashed = true;
3557
- } else {
3558
- this.start = i;
3559
- }
3560
- }
3561
- if (this.bytes > 4294967295) {
3562
- this.hBytes += this.bytes / 4294967296 << 0;
3563
- this.bytes = this.bytes % 4294967296;
3564
- }
3565
- return this;
3566
- };
3567
-
3568
- Md5.prototype.finalize = function () {
3569
- if (this.finalized) {
3570
- return;
3571
- }
3572
- this.finalized = true;
3573
- var blocks = this.blocks, i = this.lastByteIndex;
3574
- blocks[i >> 2] |= EXTRA[i & 3];
3575
- if (i >= 56) {
3576
- if (!this.hashed) {
3577
- this.hash();
3578
- }
3579
- blocks[0] = blocks[16];
3580
- blocks[16] = blocks[1] = blocks[2] = blocks[3] =
3581
- blocks[4] = blocks[5] = blocks[6] = blocks[7] =
3582
- blocks[8] = blocks[9] = blocks[10] = blocks[11] =
3583
- blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
3584
- }
3585
- blocks[14] = this.bytes << 3;
3586
- blocks[15] = this.hBytes << 3 | this.bytes >>> 29;
3587
- this.hash();
3588
- };
3589
-
3590
- Md5.prototype.hash = function () {
3591
- var a, b, c, d, bc, da, blocks = this.blocks;
3592
-
3593
- if (this.first) {
3594
- a = blocks[0] - 680876937;
3595
- a = (a << 7 | a >>> 25) - 271733879 << 0;
3596
- d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708;
3597
- d = (d << 12 | d >>> 20) + a << 0;
3598
- c = (-271733879 ^ (d & (a ^ -271733879))) + blocks[2] - 1126478375;
3599
- c = (c << 17 | c >>> 15) + d << 0;
3600
- b = (a ^ (c & (d ^ a))) + blocks[3] - 1316259209;
3601
- b = (b << 22 | b >>> 10) + c << 0;
3602
- } else {
3603
- a = this.h0;
3604
- b = this.h1;
3605
- c = this.h2;
3606
- d = this.h3;
3607
- a += (d ^ (b & (c ^ d))) + blocks[0] - 680876936;
3608
- a = (a << 7 | a >>> 25) + b << 0;
3609
- d += (c ^ (a & (b ^ c))) + blocks[1] - 389564586;
3610
- d = (d << 12 | d >>> 20) + a << 0;
3611
- c += (b ^ (d & (a ^ b))) + blocks[2] + 606105819;
3612
- c = (c << 17 | c >>> 15) + d << 0;
3613
- b += (a ^ (c & (d ^ a))) + blocks[3] - 1044525330;
3614
- b = (b << 22 | b >>> 10) + c << 0;
3615
- }
3616
-
3617
- a += (d ^ (b & (c ^ d))) + blocks[4] - 176418897;
3618
- a = (a << 7 | a >>> 25) + b << 0;
3619
- d += (c ^ (a & (b ^ c))) + blocks[5] + 1200080426;
3620
- d = (d << 12 | d >>> 20) + a << 0;
3621
- c += (b ^ (d & (a ^ b))) + blocks[6] - 1473231341;
3622
- c = (c << 17 | c >>> 15) + d << 0;
3623
- b += (a ^ (c & (d ^ a))) + blocks[7] - 45705983;
3624
- b = (b << 22 | b >>> 10) + c << 0;
3625
- a += (d ^ (b & (c ^ d))) + blocks[8] + 1770035416;
3626
- a = (a << 7 | a >>> 25) + b << 0;
3627
- d += (c ^ (a & (b ^ c))) + blocks[9] - 1958414417;
3628
- d = (d << 12 | d >>> 20) + a << 0;
3629
- c += (b ^ (d & (a ^ b))) + blocks[10] - 42063;
3630
- c = (c << 17 | c >>> 15) + d << 0;
3631
- b += (a ^ (c & (d ^ a))) + blocks[11] - 1990404162;
3632
- b = (b << 22 | b >>> 10) + c << 0;
3633
- a += (d ^ (b & (c ^ d))) + blocks[12] + 1804603682;
3634
- a = (a << 7 | a >>> 25) + b << 0;
3635
- d += (c ^ (a & (b ^ c))) + blocks[13] - 40341101;
3636
- d = (d << 12 | d >>> 20) + a << 0;
3637
- c += (b ^ (d & (a ^ b))) + blocks[14] - 1502002290;
3638
- c = (c << 17 | c >>> 15) + d << 0;
3639
- b += (a ^ (c & (d ^ a))) + blocks[15] + 1236535329;
3640
- b = (b << 22 | b >>> 10) + c << 0;
3641
- a += (c ^ (d & (b ^ c))) + blocks[1] - 165796510;
3642
- a = (a << 5 | a >>> 27) + b << 0;
3643
- d += (b ^ (c & (a ^ b))) + blocks[6] - 1069501632;
3644
- d = (d << 9 | d >>> 23) + a << 0;
3645
- c += (a ^ (b & (d ^ a))) + blocks[11] + 643717713;
3646
- c = (c << 14 | c >>> 18) + d << 0;
3647
- b += (d ^ (a & (c ^ d))) + blocks[0] - 373897302;
3648
- b = (b << 20 | b >>> 12) + c << 0;
3649
- a += (c ^ (d & (b ^ c))) + blocks[5] - 701558691;
3650
- a = (a << 5 | a >>> 27) + b << 0;
3651
- d += (b ^ (c & (a ^ b))) + blocks[10] + 38016083;
3652
- d = (d << 9 | d >>> 23) + a << 0;
3653
- c += (a ^ (b & (d ^ a))) + blocks[15] - 660478335;
3654
- c = (c << 14 | c >>> 18) + d << 0;
3655
- b += (d ^ (a & (c ^ d))) + blocks[4] - 405537848;
3656
- b = (b << 20 | b >>> 12) + c << 0;
3657
- a += (c ^ (d & (b ^ c))) + blocks[9] + 568446438;
3658
- a = (a << 5 | a >>> 27) + b << 0;
3659
- d += (b ^ (c & (a ^ b))) + blocks[14] - 1019803690;
3660
- d = (d << 9 | d >>> 23) + a << 0;
3661
- c += (a ^ (b & (d ^ a))) + blocks[3] - 187363961;
3662
- c = (c << 14 | c >>> 18) + d << 0;
3663
- b += (d ^ (a & (c ^ d))) + blocks[8] + 1163531501;
3664
- b = (b << 20 | b >>> 12) + c << 0;
3665
- a += (c ^ (d & (b ^ c))) + blocks[13] - 1444681467;
3666
- a = (a << 5 | a >>> 27) + b << 0;
3667
- d += (b ^ (c & (a ^ b))) + blocks[2] - 51403784;
3668
- d = (d << 9 | d >>> 23) + a << 0;
3669
- c += (a ^ (b & (d ^ a))) + blocks[7] + 1735328473;
3670
- c = (c << 14 | c >>> 18) + d << 0;
3671
- b += (d ^ (a & (c ^ d))) + blocks[12] - 1926607734;
3672
- b = (b << 20 | b >>> 12) + c << 0;
3673
- bc = b ^ c;
3674
- a += (bc ^ d) + blocks[5] - 378558;
3675
- a = (a << 4 | a >>> 28) + b << 0;
3676
- d += (bc ^ a) + blocks[8] - 2022574463;
3677
- d = (d << 11 | d >>> 21) + a << 0;
3678
- da = d ^ a;
3679
- c += (da ^ b) + blocks[11] + 1839030562;
3680
- c = (c << 16 | c >>> 16) + d << 0;
3681
- b += (da ^ c) + blocks[14] - 35309556;
3682
- b = (b << 23 | b >>> 9) + c << 0;
3683
- bc = b ^ c;
3684
- a += (bc ^ d) + blocks[1] - 1530992060;
3685
- a = (a << 4 | a >>> 28) + b << 0;
3686
- d += (bc ^ a) + blocks[4] + 1272893353;
3687
- d = (d << 11 | d >>> 21) + a << 0;
3688
- da = d ^ a;
3689
- c += (da ^ b) + blocks[7] - 155497632;
3690
- c = (c << 16 | c >>> 16) + d << 0;
3691
- b += (da ^ c) + blocks[10] - 1094730640;
3692
- b = (b << 23 | b >>> 9) + c << 0;
3693
- bc = b ^ c;
3694
- a += (bc ^ d) + blocks[13] + 681279174;
3695
- a = (a << 4 | a >>> 28) + b << 0;
3696
- d += (bc ^ a) + blocks[0] - 358537222;
3697
- d = (d << 11 | d >>> 21) + a << 0;
3698
- da = d ^ a;
3699
- c += (da ^ b) + blocks[3] - 722521979;
3700
- c = (c << 16 | c >>> 16) + d << 0;
3701
- b += (da ^ c) + blocks[6] + 76029189;
3702
- b = (b << 23 | b >>> 9) + c << 0;
3703
- bc = b ^ c;
3704
- a += (bc ^ d) + blocks[9] - 640364487;
3705
- a = (a << 4 | a >>> 28) + b << 0;
3706
- d += (bc ^ a) + blocks[12] - 421815835;
3707
- d = (d << 11 | d >>> 21) + a << 0;
3708
- da = d ^ a;
3709
- c += (da ^ b) + blocks[15] + 530742520;
3710
- c = (c << 16 | c >>> 16) + d << 0;
3711
- b += (da ^ c) + blocks[2] - 995338651;
3712
- b = (b << 23 | b >>> 9) + c << 0;
3713
- a += (c ^ (b | ~d)) + blocks[0] - 198630844;
3714
- a = (a << 6 | a >>> 26) + b << 0;
3715
- d += (b ^ (a | ~c)) + blocks[7] + 1126891415;
3716
- d = (d << 10 | d >>> 22) + a << 0;
3717
- c += (a ^ (d | ~b)) + blocks[14] - 1416354905;
3718
- c = (c << 15 | c >>> 17) + d << 0;
3719
- b += (d ^ (c | ~a)) + blocks[5] - 57434055;
3720
- b = (b << 21 | b >>> 11) + c << 0;
3721
- a += (c ^ (b | ~d)) + blocks[12] + 1700485571;
3722
- a = (a << 6 | a >>> 26) + b << 0;
3723
- d += (b ^ (a | ~c)) + blocks[3] - 1894986606;
3724
- d = (d << 10 | d >>> 22) + a << 0;
3725
- c += (a ^ (d | ~b)) + blocks[10] - 1051523;
3726
- c = (c << 15 | c >>> 17) + d << 0;
3727
- b += (d ^ (c | ~a)) + blocks[1] - 2054922799;
3728
- b = (b << 21 | b >>> 11) + c << 0;
3729
- a += (c ^ (b | ~d)) + blocks[8] + 1873313359;
3730
- a = (a << 6 | a >>> 26) + b << 0;
3731
- d += (b ^ (a | ~c)) + blocks[15] - 30611744;
3732
- d = (d << 10 | d >>> 22) + a << 0;
3733
- c += (a ^ (d | ~b)) + blocks[6] - 1560198380;
3734
- c = (c << 15 | c >>> 17) + d << 0;
3735
- b += (d ^ (c | ~a)) + blocks[13] + 1309151649;
3736
- b = (b << 21 | b >>> 11) + c << 0;
3737
- a += (c ^ (b | ~d)) + blocks[4] - 145523070;
3738
- a = (a << 6 | a >>> 26) + b << 0;
3739
- d += (b ^ (a | ~c)) + blocks[11] - 1120210379;
3740
- d = (d << 10 | d >>> 22) + a << 0;
3741
- c += (a ^ (d | ~b)) + blocks[2] + 718787259;
3742
- c = (c << 15 | c >>> 17) + d << 0;
3743
- b += (d ^ (c | ~a)) + blocks[9] - 343485551;
3744
- b = (b << 21 | b >>> 11) + c << 0;
3388
+ function encodeChunk (uint8, start, end) {
3389
+ var tmp
3390
+ var output = []
3391
+ for (var i = start; i < end; i += 3) {
3392
+ tmp =
3393
+ ((uint8[i] << 16) & 0xFF0000) +
3394
+ ((uint8[i + 1] << 8) & 0xFF00) +
3395
+ (uint8[i + 2] & 0xFF)
3396
+ output.push(tripletToBase64(tmp))
3397
+ }
3398
+ return output.join('')
3399
+ }
3745
3400
 
3746
- if (this.first) {
3747
- this.h0 = a + 1732584193 << 0;
3748
- this.h1 = b - 271733879 << 0;
3749
- this.h2 = c - 1732584194 << 0;
3750
- this.h3 = d + 271733878 << 0;
3751
- this.first = false;
3752
- } else {
3753
- this.h0 = this.h0 + a << 0;
3754
- this.h1 = this.h1 + b << 0;
3755
- this.h2 = this.h2 + c << 0;
3756
- this.h3 = this.h3 + d << 0;
3757
- }
3758
- };
3401
+ function fromByteArray (uint8) {
3402
+ var tmp
3403
+ var len = uint8.length
3404
+ var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
3405
+ var parts = []
3406
+ var maxChunkLength = 16383 // must be multiple of 3
3759
3407
 
3760
- /**
3761
- * @method hex
3762
- * @memberof Md5
3763
- * @instance
3764
- * @description Output hash as hex string
3765
- * @returns {String} Hex string
3766
- * @see {@link md5.hex}
3767
- * @example
3768
- * hash.hex();
3769
- */
3770
- Md5.prototype.hex = function () {
3771
- this.finalize();
3408
+ // go through the array every three bytes, we'll deal with trailing stuff later
3409
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
3410
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
3411
+ }
3772
3412
 
3773
- var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
3413
+ // pad the end with zeros, but make sure to not forget the extra bytes
3414
+ if (extraBytes === 1) {
3415
+ tmp = uint8[len - 1]
3416
+ parts.push(
3417
+ lookup[tmp >> 2] +
3418
+ lookup[(tmp << 4) & 0x3F] +
3419
+ '=='
3420
+ )
3421
+ } else if (extraBytes === 2) {
3422
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
3423
+ parts.push(
3424
+ lookup[tmp >> 10] +
3425
+ lookup[(tmp >> 4) & 0x3F] +
3426
+ lookup[(tmp << 2) & 0x3F] +
3427
+ '='
3428
+ )
3429
+ }
3774
3430
 
3775
- return HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +
3776
- HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +
3777
- HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +
3778
- HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +
3779
- HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +
3780
- HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +
3781
- HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +
3782
- HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +
3783
- HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +
3784
- HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +
3785
- HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +
3786
- HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +
3787
- HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +
3788
- HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +
3789
- HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +
3790
- HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F];
3791
- };
3431
+ return parts.join('')
3432
+ }
3792
3433
 
3793
- /**
3794
- * @method toString
3795
- * @memberof Md5
3796
- * @instance
3797
- * @description Output hash as hex string
3798
- * @returns {String} Hex string
3799
- * @see {@link md5.hex}
3800
- * @example
3801
- * hash.toString();
3802
- */
3803
- Md5.prototype.toString = Md5.prototype.hex;
3804
3434
 
3805
- /**
3806
- * @method digest
3807
- * @memberof Md5
3808
- * @instance
3809
- * @description Output hash as bytes array
3810
- * @returns {Array} Bytes array
3811
- * @see {@link md5.digest}
3812
- * @example
3813
- * hash.digest();
3814
- */
3815
- Md5.prototype.digest = function () {
3816
- this.finalize();
3435
+ /***/ }),
3817
3436
 
3818
- var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
3819
- return [
3820
- h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 24) & 0xFF,
3821
- h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 24) & 0xFF,
3822
- h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 24) & 0xFF,
3823
- h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 24) & 0xFF
3824
- ];
3825
- };
3437
+ /***/ 557:
3438
+ /***/ ((module, exports, __webpack_require__) => {
3826
3439
 
3827
- /**
3828
- * @method array
3829
- * @memberof Md5
3830
- * @instance
3831
- * @description Output hash as bytes array
3832
- * @returns {Array} Bytes array
3833
- * @see {@link md5.array}
3834
- * @example
3835
- * hash.array();
3836
- */
3837
- Md5.prototype.array = Md5.prototype.digest;
3440
+ var Minilog = __webpack_require__(15);
3838
3441
 
3839
- /**
3840
- * @method arrayBuffer
3841
- * @memberof Md5
3842
- * @instance
3843
- * @description Output hash as ArrayBuffer
3844
- * @returns {ArrayBuffer} ArrayBuffer
3845
- * @see {@link md5.arrayBuffer}
3846
- * @example
3847
- * hash.arrayBuffer();
3848
- */
3849
- Md5.prototype.arrayBuffer = function () {
3850
- this.finalize();
3442
+ var oldEnable = Minilog.enable,
3443
+ oldDisable = Minilog.disable,
3444
+ isChrome = (typeof navigator != 'undefined' && /chrome/i.test(navigator.userAgent)),
3445
+ console = __webpack_require__(260);
3851
3446
 
3852
- var buffer = new ArrayBuffer(16);
3853
- var blocks = new Uint32Array(buffer);
3854
- blocks[0] = this.h0;
3855
- blocks[1] = this.h1;
3856
- blocks[2] = this.h2;
3857
- blocks[3] = this.h3;
3858
- return buffer;
3859
- };
3447
+ // Use a more capable logging backend if on Chrome
3448
+ Minilog.defaultBackend = (isChrome ? console.minilog : console);
3860
3449
 
3861
- /**
3862
- * @method buffer
3863
- * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
3864
- * @memberof Md5
3865
- * @instance
3866
- * @description Output hash as ArrayBuffer
3867
- * @returns {ArrayBuffer} ArrayBuffer
3868
- * @see {@link md5.buffer}
3869
- * @example
3870
- * hash.buffer();
3871
- */
3872
- Md5.prototype.buffer = Md5.prototype.arrayBuffer;
3450
+ // apply enable inputs from localStorage and from the URL
3451
+ if(typeof window != 'undefined') {
3452
+ try {
3453
+ Minilog.enable(JSON.parse(window.localStorage['minilogSettings']));
3454
+ } catch(e) {}
3455
+ if(window.location && window.location.search) {
3456
+ var match = RegExp('[?&]minilog=([^&]*)').exec(window.location.search);
3457
+ match && Minilog.enable(decodeURIComponent(match[1]));
3458
+ }
3459
+ }
3873
3460
 
3874
- /**
3875
- * @method base64
3876
- * @memberof Md5
3877
- * @instance
3878
- * @description Output hash as base64 string
3879
- * @returns {String} base64 string
3880
- * @see {@link md5.base64}
3881
- * @example
3882
- * hash.base64();
3883
- */
3884
- Md5.prototype.base64 = function () {
3885
- var v1, v2, v3, base64Str = '', bytes = this.array();
3886
- for (var i = 0; i < 15;) {
3887
- v1 = bytes[i++];
3888
- v2 = bytes[i++];
3889
- v3 = bytes[i++];
3890
- base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
3891
- BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
3892
- BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] +
3893
- BASE64_ENCODE_CHAR[v3 & 63];
3894
- }
3895
- v1 = bytes[i];
3896
- base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
3897
- BASE64_ENCODE_CHAR[(v1 << 4) & 63] +
3898
- '==';
3899
- return base64Str;
3900
- };
3461
+ // Make enable also add to localStorage
3462
+ Minilog.enable = function() {
3463
+ oldEnable.call(Minilog, true);
3464
+ try { window.localStorage['minilogSettings'] = JSON.stringify(true); } catch(e) {}
3465
+ return this;
3466
+ };
3467
+
3468
+ Minilog.disable = function() {
3469
+ oldDisable.call(Minilog);
3470
+ try { delete window.localStorage.minilogSettings; } catch(e) {}
3471
+ return this;
3472
+ };
3473
+
3474
+ exports = module.exports = Minilog;
3475
+
3476
+ exports.backends = {
3477
+ array: __webpack_require__(692),
3478
+ browser: Minilog.defaultBackend,
3479
+ localStorage: __webpack_require__(113),
3480
+ jQuery: __webpack_require__(740)
3481
+ };
3482
+
3483
+
3484
+ /***/ }),
3485
+
3486
+ /***/ 638:
3487
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3488
+
3489
+ var Transform = __webpack_require__(408),
3490
+ color = __webpack_require__(193);
3491
+
3492
+ var colors = { debug: ['cyan'], info: ['purple' ], warn: [ 'yellow', true ], error: [ 'red', true ] },
3493
+ logger = new Transform();
3494
+
3495
+ logger.write = function(name, level, args) {
3496
+ var fn = console.log;
3497
+ if(console[level] && console[level].apply) {
3498
+ fn = console[level];
3499
+ fn.apply(console, [ '%c'+name+' %c'+level, color('gray'), color.apply(color, colors[level])].concat(args));
3500
+ }
3501
+ };
3502
+
3503
+ // NOP, because piping the formatted logs can only cause trouble.
3504
+ logger.pipe = function() { };
3505
+
3506
+ module.exports = logger;
3507
+
3508
+
3509
+ /***/ }),
3510
+
3511
+ /***/ 658:
3512
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3513
+
3514
+ var Transform = __webpack_require__(408),
3515
+ color = __webpack_require__(193),
3516
+ colors = { debug: ['gray'], info: ['purple' ], warn: [ 'yellow', true ], error: [ 'red', true ] },
3517
+ logger = new Transform();
3901
3518
 
3902
- var exports = createMethod();
3519
+ logger.write = function(name, level, args) {
3520
+ var fn = console.log;
3521
+ if(level != 'debug' && console[level]) {
3522
+ fn = console[level];
3523
+ }
3903
3524
 
3904
- if (COMMON_JS) {
3905
- module.exports = exports;
3906
- } else {
3907
- /**
3908
- * @method md5
3909
- * @description Md5 hash function, export to global in browsers.
3910
- * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
3911
- * @returns {String} md5 hashes
3912
- * @example
3913
- * md5(''); // d41d8cd98f00b204e9800998ecf8427e
3914
- * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6
3915
- * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0
3916
- *
3917
- * // It also supports UTF-8 encoding
3918
- * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
3919
- *
3920
- * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
3921
- * md5([]); // d41d8cd98f00b204e9800998ecf8427e
3922
- * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
3923
- */
3924
- root.md5 = exports;
3925
- if (AMD) {
3926
- !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
3927
- return exports;
3928
- }).call(exports, __webpack_require__, exports, module),
3929
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
3525
+ var subset = [], i = 0;
3526
+ if(level != 'info') {
3527
+ for(; i < args.length; i++) {
3528
+ if(typeof args[i] != 'string') break;
3930
3529
  }
3530
+ fn.apply(console, [ '%c'+name +' '+ args.slice(0, i).join(' '), color.apply(color, colors[level]) ].concat(args.slice(i)));
3531
+ } else {
3532
+ fn.apply(console, [ '%c'+name, color.apply(color, colors[level]) ].concat(args));
3931
3533
  }
3932
- })();
3534
+ };
3535
+
3536
+ // NOP, because piping the formatted logs can only cause trouble.
3537
+ logger.pipe = function() { };
3538
+
3539
+ module.exports = logger;
3933
3540
 
3934
3541
 
3935
3542
  /***/ }),
3936
3543
 
3937
- /***/ 173:
3938
- /***/ ((module) => {
3544
+ /***/ 680:
3545
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3939
3546
 
3940
- function M() { this._events = {}; }
3941
- M.prototype = {
3942
- on: function(ev, cb) {
3943
- this._events || (this._events = {});
3944
- var e = this._events;
3945
- (e[ev] || (e[ev] = [])).push(cb);
3946
- return this;
3947
- },
3948
- removeListener: function(ev, cb) {
3949
- var e = this._events[ev] || [], i;
3950
- for(i = e.length-1; i >= 0 && e[i]; i--){
3951
- if(e[i] === cb || e[i].cb === cb) { e.splice(i, 1); }
3952
- }
3953
- },
3954
- removeAllListeners: function(ev) {
3955
- if(!ev) { this._events = {}; }
3956
- else { this._events[ev] && (this._events[ev] = []); }
3957
- },
3958
- listeners: function(ev) {
3959
- return (this._events ? this._events[ev] || [] : []);
3960
- },
3961
- emit: function(ev) {
3962
- this._events || (this._events = {});
3963
- var args = Array.prototype.slice.call(arguments, 1), i, e = this._events[ev] || [];
3964
- for(i = e.length-1; i >= 0 && e[i]; i--){
3965
- e[i].apply(this, args);
3547
+ module.exports = __webpack_require__(14)("UklGRiYAAABXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0YQIAAAAAAA==")
3548
+
3549
+ /***/ }),
3550
+
3551
+ /***/ 692:
3552
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3553
+
3554
+ var Transform = __webpack_require__(408),
3555
+ cache = [ ];
3556
+
3557
+ var logger = new Transform();
3558
+
3559
+ logger.write = function(name, level, args) {
3560
+ cache.push([ name, level, args ]);
3561
+ };
3562
+
3563
+ // utility functions
3564
+ logger.get = function() { return cache; };
3565
+ logger.empty = function() { cache = []; };
3566
+
3567
+ module.exports = logger;
3568
+
3569
+
3570
+ /***/ }),
3571
+
3572
+ /***/ 740:
3573
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3574
+
3575
+ var Transform = __webpack_require__(408);
3576
+
3577
+ var cid = new Date().valueOf().toString(36);
3578
+
3579
+ function AjaxLogger(options) {
3580
+ this.url = options.url || '';
3581
+ this.cache = [];
3582
+ this.timer = null;
3583
+ this.interval = options.interval || 30*1000;
3584
+ this.enabled = true;
3585
+ this.jQuery = window.jQuery;
3586
+ this.extras = {};
3587
+ }
3588
+
3589
+ Transform.mixin(AjaxLogger);
3590
+
3591
+ AjaxLogger.prototype.write = function(name, level, args) {
3592
+ if(!this.timer) { this.init(); }
3593
+ this.cache.push([name, level].concat(args));
3594
+ };
3595
+
3596
+ AjaxLogger.prototype.init = function() {
3597
+ if(!this.enabled || !this.jQuery) return;
3598
+ var self = this;
3599
+ this.timer = setTimeout(function() {
3600
+ var i, logs = [], ajaxData, url = self.url;
3601
+ if(self.cache.length == 0) return self.init();
3602
+ // Test each log line and only log the ones that are valid (e.g. don't have circular references).
3603
+ // Slight performance hit but benefit is we log all valid lines.
3604
+ for(i = 0; i < self.cache.length; i++) {
3605
+ try {
3606
+ JSON.stringify(self.cache[i]);
3607
+ logs.push(self.cache[i]);
3608
+ } catch(e) { }
3966
3609
  }
3967
- return this;
3968
- },
3969
- when: function(ev, cb) {
3970
- return this.once(ev, cb, true);
3971
- },
3972
- once: function(ev, cb, when) {
3973
- if(!cb) return this;
3974
- function c() {
3975
- if(!when) this.removeListener(ev, c);
3976
- if(cb.apply(this, arguments) && when) this.removeListener(ev, c);
3610
+ if(self.jQuery.isEmptyObject(self.extras)) {
3611
+ ajaxData = JSON.stringify({ logs: logs });
3612
+ url = self.url + '?client_id=' + cid;
3613
+ } else {
3614
+ ajaxData = JSON.stringify(self.jQuery.extend({logs: logs}, self.extras));
3977
3615
  }
3978
- c.cb = cb;
3979
- this.on(ev, c);
3980
- return this;
3981
- }
3616
+
3617
+ self.jQuery.ajax(url, {
3618
+ type: 'POST',
3619
+ cache: false,
3620
+ processData: false,
3621
+ data: ajaxData,
3622
+ contentType: 'application/json',
3623
+ timeout: 10000
3624
+ }).success(function(data, status, jqxhr) {
3625
+ if(data.interval) {
3626
+ self.interval = Math.max(1000, data.interval);
3627
+ }
3628
+ }).error(function() {
3629
+ self.interval = 30000;
3630
+ }).always(function() {
3631
+ self.init();
3632
+ });
3633
+ self.cache = [];
3634
+ }, this.interval);
3982
3635
  };
3983
- M.mixin = function(dest) {
3984
- var o = M.prototype, k;
3985
- for (k in o) {
3986
- o.hasOwnProperty(k) && (dest.prototype[k] = o[k]);
3636
+
3637
+ AjaxLogger.prototype.end = function() {};
3638
+
3639
+ // wait until jQuery is defined. Useful if you don't control the load order.
3640
+ AjaxLogger.jQueryWait = function(onDone) {
3641
+ if(typeof window !== 'undefined' && (window.jQuery || window.$)) {
3642
+ return onDone(window.jQuery || window.$);
3643
+ } else if (typeof window !== 'undefined') {
3644
+ setTimeout(function() { AjaxLogger.jQueryWait(onDone); }, 200);
3987
3645
  }
3988
3646
  };
3989
- module.exports = M;
3647
+
3648
+ module.exports = AjaxLogger;
3990
3649
 
3991
3650
 
3992
3651
  /***/ }),
3993
3652
 
3994
- /***/ 84:
3653
+ /***/ 767:
3654
+ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
3655
+
3656
+ "use strict";
3657
+ (function(r){function x(){}function y(){}var z=String.fromCharCode,v={}.toString,A=v.call(r.SharedArrayBuffer),B=v(),q=r.Uint8Array,t=q||Array,w=q?ArrayBuffer:t,C=w.isView||function(g){return g&&"length"in g},D=v.call(w.prototype);w=y.prototype;var E=r.TextEncoder,a=new (q?Uint16Array:t)(32);x.prototype.decode=function(g){if(!C(g)){var l=v.call(g);if(l!==D&&l!==A&&l!==B)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
3658
+ g=q?new t(g):g||[]}for(var f=l="",b=0,c=g.length|0,u=c-32|0,e,d,h=0,p=0,m,k=0,n=-1;b<c;){for(e=b<=u?32:c-b|0;k<e;b=b+1|0,k=k+1|0){d=g[b]&255;switch(d>>4){case 15:m=g[b=b+1|0]&255;if(2!==m>>6||247<d){b=b-1|0;break}h=(d&7)<<6|m&63;p=5;d=256;case 14:m=g[b=b+1|0]&255,h<<=6,h|=(d&15)<<6|m&63,p=2===m>>6?p+4|0:24,d=d+256&768;case 13:case 12:m=g[b=b+1|0]&255,h<<=6,h|=(d&31)<<6|m&63,p=p+7|0,b<c&&2===m>>6&&h>>p&&1114112>h?(d=h,h=h-65536|0,0<=h&&(n=(h>>10)+55296|0,d=(h&1023)+56320|0,31>k?(a[k]=n,k=k+1|0,n=-1):
3659
+ (m=n,n=d,d=m))):(d>>=8,b=b-d-1|0,d=65533),h=p=0,e=b<=u?32:c-b|0;default:a[k]=d;continue;case 11:case 10:case 9:case 8:}a[k]=65533}f+=z(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15],a[16],a[17],a[18],a[19],a[20],a[21],a[22],a[23],a[24],a[25],a[26],a[27],a[28],a[29],a[30],a[31]);32>k&&(f=f.slice(0,k-32|0));if(b<c){if(a[0]=n,k=~n>>>31,n=-1,f.length<l.length)continue}else-1!==n&&(f+=z(n));l+=f;f=""}return l};w.encode=function(g){g=void 0===g?"":""+g;var l=g.length|
3660
+ 0,f=new t((l<<1)+8|0),b,c=0,u=!q;for(b=0;b<l;b=b+1|0,c=c+1|0){var e=g.charCodeAt(b)|0;if(127>=e)f[c]=e;else{if(2047>=e)f[c]=192|e>>6;else{a:{if(55296<=e)if(56319>=e){var d=g.charCodeAt(b=b+1|0)|0;if(56320<=d&&57343>=d){e=(e<<10)+d-56613888|0;if(65535<e){f[c]=240|e>>18;f[c=c+1|0]=128|e>>12&63;f[c=c+1|0]=128|e>>6&63;f[c=c+1|0]=128|e&63;continue}break a}e=65533}else 57343>=e&&(e=65533);!u&&b<<1<c&&b<<1<(c-7|0)&&(u=!0,d=new t(3*l),d.set(f),f=d)}f[c]=224|e>>12;f[c=c+1|0]=128|e>>6&63}f[c=c+1|0]=128|e&63}}return q?
3661
+ f.subarray(0,c):f.slice(0,c)};E||(r.TextDecoder=x,r.TextEncoder=y)})(""+void 0==typeof __webpack_require__.g?""+void 0==typeof self?this:self:__webpack_require__.g);//AnonyCo
3662
+ //# sourceMappingURL=https://cdn.jsdelivr.net/gh/AnonyCo/FastestSmallestTextEncoderDecoder/EncoderDecoderTogether.min.js.map
3663
+
3664
+
3665
+ /***/ }),
3666
+
3667
+ /***/ 914:
3995
3668
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3996
3669
 
3997
- // default filter
3998
- var Transform = __webpack_require__(408);
3670
+ module.exports = __webpack_require__(14)("PD94bWwgdmVyc2lvbj0iMS4wIj8+Cjxzdmcgd2lkdGg9IjEyOCIgaGVpZ2h0PSIxMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiA8Zz4KICA8cmVjdCBmaWxsPSIjQ0NDIiBoZWlnaHQ9IjEyOCIgd2lkdGg9IjEyOCIvPgogIDx0ZXh0IGZpbGw9ImJsYWNrIiB5PSIxMDciIHg9IjM1LjUiIGZvbnQtc2l6ZT0iMTI4Ij4/PC90ZXh0PgogPC9nPgo8L3N2Zz4K")
3999
3671
 
4000
- var levelMap = { debug: 1, info: 2, warn: 3, error: 4 };
3672
+ /***/ }),
4001
3673
 
4002
- function Filter() {
4003
- this.enabled = true;
4004
- this.defaultResult = true;
4005
- this.clear();
3674
+ /***/ 945:
3675
+ /***/ ((module, exports, __webpack_require__) => {
3676
+
3677
+ // Save global object in a variable
3678
+ var __global__ =
3679
+ (typeof globalThis !== 'undefined' && globalThis) ||
3680
+ (typeof self !== 'undefined' && self) ||
3681
+ (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g);
3682
+ // Create an object that extends from __global__ without the fetch function
3683
+ var __globalThis__ = (function () {
3684
+ function F() {
3685
+ this.fetch = false;
3686
+ this.DOMException = __global__.DOMException
4006
3687
  }
3688
+ F.prototype = __global__; // Needed for feature detection on whatwg-fetch's code
3689
+ return new F();
3690
+ })();
3691
+ // Wraps whatwg-fetch with a function scope to hijack the global object
3692
+ // "globalThis" that's going to be patched
3693
+ (function(globalThis) {
4007
3694
 
4008
- Transform.mixin(Filter);
3695
+ var irrelevant = (function (exports) {
4009
3696
 
4010
- // allow all matching, with level >= given level
4011
- Filter.prototype.allow = function(name, level) {
4012
- this._white.push({ n: name, l: levelMap[level] });
4013
- return this;
4014
- };
3697
+ /* eslint-disable no-prototype-builtins */
3698
+ var g =
3699
+ (typeof globalThis !== 'undefined' && globalThis) ||
3700
+ (typeof self !== 'undefined' && self) ||
3701
+ // eslint-disable-next-line no-undef
3702
+ (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g) ||
3703
+ {};
3704
+
3705
+ var support = {
3706
+ searchParams: 'URLSearchParams' in g,
3707
+ iterable: 'Symbol' in g && 'iterator' in Symbol,
3708
+ blob:
3709
+ 'FileReader' in g &&
3710
+ 'Blob' in g &&
3711
+ (function() {
3712
+ try {
3713
+ new Blob();
3714
+ return true
3715
+ } catch (e) {
3716
+ return false
3717
+ }
3718
+ })(),
3719
+ formData: 'FormData' in g,
3720
+ arrayBuffer: 'ArrayBuffer' in g
3721
+ };
4015
3722
 
4016
- // deny all matching, with level <= given level
4017
- Filter.prototype.deny = function(name, level) {
4018
- this._black.push({ n: name, l: levelMap[level] });
4019
- return this;
4020
- };
3723
+ function isDataView(obj) {
3724
+ return obj && DataView.prototype.isPrototypeOf(obj)
3725
+ }
4021
3726
 
4022
- Filter.prototype.clear = function() {
4023
- this._white = [];
4024
- this._black = [];
4025
- return this;
4026
- };
3727
+ if (support.arrayBuffer) {
3728
+ var viewClasses = [
3729
+ '[object Int8Array]',
3730
+ '[object Uint8Array]',
3731
+ '[object Uint8ClampedArray]',
3732
+ '[object Int16Array]',
3733
+ '[object Uint16Array]',
3734
+ '[object Int32Array]',
3735
+ '[object Uint32Array]',
3736
+ '[object Float32Array]',
3737
+ '[object Float64Array]'
3738
+ ];
4027
3739
 
4028
- function test(rule, name) {
4029
- // use .test for RegExps
4030
- return (rule.n.test ? rule.n.test(name) : rule.n == name);
4031
- };
3740
+ var isArrayBufferView =
3741
+ ArrayBuffer.isView ||
3742
+ function(obj) {
3743
+ return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
3744
+ };
3745
+ }
4032
3746
 
4033
- Filter.prototype.test = function(name, level) {
4034
- var i, len = Math.max(this._white.length, this._black.length);
4035
- for(i = 0; i < len; i++) {
4036
- if(this._white[i] && test(this._white[i], name) && levelMap[level] >= this._white[i].l) {
4037
- return true;
3747
+ function normalizeName(name) {
3748
+ if (typeof name !== 'string') {
3749
+ name = String(name);
4038
3750
  }
4039
- if(this._black[i] && test(this._black[i], name) && levelMap[level] <= this._black[i].l) {
4040
- return false;
3751
+ if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
3752
+ throw new TypeError('Invalid character in header field name: "' + name + '"')
4041
3753
  }
3754
+ return name.toLowerCase()
4042
3755
  }
4043
- return this.defaultResult;
4044
- };
4045
3756
 
4046
- Filter.prototype.write = function(name, level, args) {
4047
- if(!this.enabled || this.test(name, level)) {
4048
- return this.emit('item', name, level, args);
3757
+ function normalizeValue(value) {
3758
+ if (typeof value !== 'string') {
3759
+ value = String(value);
3760
+ }
3761
+ return value
4049
3762
  }
4050
- };
4051
-
4052
- module.exports = Filter;
4053
-
4054
-
4055
- /***/ }),
4056
-
4057
- /***/ 15:
4058
- /***/ ((module, exports, __webpack_require__) => {
4059
3763
 
4060
- var Transform = __webpack_require__(408),
4061
- Filter = __webpack_require__(84);
3764
+ // Build a destructive iterator for the value list
3765
+ function iteratorFor(items) {
3766
+ var iterator = {
3767
+ next: function() {
3768
+ var value = items.shift();
3769
+ return {done: value === undefined, value: value}
3770
+ }
3771
+ };
4062
3772
 
4063
- var log = new Transform(),
4064
- slice = Array.prototype.slice;
3773
+ if (support.iterable) {
3774
+ iterator[Symbol.iterator] = function() {
3775
+ return iterator
3776
+ };
3777
+ }
4065
3778
 
4066
- exports = module.exports = function create(name) {
4067
- var o = function() { log.write(name, undefined, slice.call(arguments)); return o; };
4068
- o.debug = function() { log.write(name, 'debug', slice.call(arguments)); return o; };
4069
- o.info = function() { log.write(name, 'info', slice.call(arguments)); return o; };
4070
- o.warn = function() { log.write(name, 'warn', slice.call(arguments)); return o; };
4071
- o.error = function() { log.write(name, 'error', slice.call(arguments)); return o; };
4072
- o.log = o.debug; // for interface compliance with Node and browser consoles
4073
- o.suggest = exports.suggest;
4074
- o.format = log.format;
4075
- return o;
4076
- };
3779
+ return iterator
3780
+ }
4077
3781
 
4078
- // filled in separately
4079
- exports.defaultBackend = exports.defaultFormatter = null;
3782
+ function Headers(headers) {
3783
+ this.map = {};
4080
3784
 
4081
- exports.pipe = function(dest) {
4082
- return log.pipe(dest);
4083
- };
3785
+ if (headers instanceof Headers) {
3786
+ headers.forEach(function(value, name) {
3787
+ this.append(name, value);
3788
+ }, this);
3789
+ } else if (Array.isArray(headers)) {
3790
+ headers.forEach(function(header) {
3791
+ if (header.length != 2) {
3792
+ throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)
3793
+ }
3794
+ this.append(header[0], header[1]);
3795
+ }, this);
3796
+ } else if (headers) {
3797
+ Object.getOwnPropertyNames(headers).forEach(function(name) {
3798
+ this.append(name, headers[name]);
3799
+ }, this);
3800
+ }
3801
+ }
4084
3802
 
4085
- exports.end = exports.unpipe = exports.disable = function(from) {
4086
- return log.unpipe(from);
4087
- };
3803
+ Headers.prototype.append = function(name, value) {
3804
+ name = normalizeName(name);
3805
+ value = normalizeValue(value);
3806
+ var oldValue = this.map[name];
3807
+ this.map[name] = oldValue ? oldValue + ', ' + value : value;
3808
+ };
4088
3809
 
4089
- exports.Transform = Transform;
4090
- exports.Filter = Filter;
4091
- // this is the default filter that's applied when .enable() is called normally
4092
- // you can bypass it completely and set up your own pipes
4093
- exports.suggest = new Filter();
3810
+ Headers.prototype['delete'] = function(name) {
3811
+ delete this.map[normalizeName(name)];
3812
+ };
4094
3813
 
4095
- exports.enable = function() {
4096
- if(exports.defaultFormatter) {
4097
- return log.pipe(exports.suggest) // filter
4098
- .pipe(exports.defaultFormatter) // formatter
4099
- .pipe(exports.defaultBackend); // backend
4100
- }
4101
- return log.pipe(exports.suggest) // filter
4102
- .pipe(exports.defaultBackend); // formatter
4103
- };
3814
+ Headers.prototype.get = function(name) {
3815
+ name = normalizeName(name);
3816
+ return this.has(name) ? this.map[name] : null
3817
+ };
4104
3818
 
3819
+ Headers.prototype.has = function(name) {
3820
+ return this.map.hasOwnProperty(normalizeName(name))
3821
+ };
4105
3822
 
3823
+ Headers.prototype.set = function(name, value) {
3824
+ this.map[normalizeName(name)] = normalizeValue(value);
3825
+ };
4106
3826
 
4107
- /***/ }),
3827
+ Headers.prototype.forEach = function(callback, thisArg) {
3828
+ for (var name in this.map) {
3829
+ if (this.map.hasOwnProperty(name)) {
3830
+ callback.call(thisArg, this.map[name], name, this);
3831
+ }
3832
+ }
3833
+ };
4108
3834
 
4109
- /***/ 408:
4110
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3835
+ Headers.prototype.keys = function() {
3836
+ var items = [];
3837
+ this.forEach(function(value, name) {
3838
+ items.push(name);
3839
+ });
3840
+ return iteratorFor(items)
3841
+ };
4111
3842
 
4112
- var microee = __webpack_require__(173);
3843
+ Headers.prototype.values = function() {
3844
+ var items = [];
3845
+ this.forEach(function(value) {
3846
+ items.push(value);
3847
+ });
3848
+ return iteratorFor(items)
3849
+ };
4113
3850
 
4114
- // Implements a subset of Node's stream.Transform - in a cross-platform manner.
4115
- function Transform() {}
3851
+ Headers.prototype.entries = function() {
3852
+ var items = [];
3853
+ this.forEach(function(value, name) {
3854
+ items.push([name, value]);
3855
+ });
3856
+ return iteratorFor(items)
3857
+ };
4116
3858
 
4117
- microee.mixin(Transform);
3859
+ if (support.iterable) {
3860
+ Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
3861
+ }
4118
3862
 
4119
- // The write() signature is different from Node's
4120
- // --> makes it much easier to work with objects in logs.
4121
- // One of the lessons from v1 was that it's better to target
4122
- // a good browser rather than the lowest common denominator
4123
- // internally.
4124
- // If you want to use external streams, pipe() to ./stringify.js first.
4125
- Transform.prototype.write = function(name, level, args) {
4126
- this.emit('item', name, level, args);
4127
- };
3863
+ function consumed(body) {
3864
+ if (body._noBody) return
3865
+ if (body.bodyUsed) {
3866
+ return Promise.reject(new TypeError('Already read'))
3867
+ }
3868
+ body.bodyUsed = true;
3869
+ }
4128
3870
 
4129
- Transform.prototype.end = function() {
4130
- this.emit('end');
4131
- this.removeAllListeners();
4132
- };
3871
+ function fileReaderReady(reader) {
3872
+ return new Promise(function(resolve, reject) {
3873
+ reader.onload = function() {
3874
+ resolve(reader.result);
3875
+ };
3876
+ reader.onerror = function() {
3877
+ reject(reader.error);
3878
+ };
3879
+ })
3880
+ }
4133
3881
 
4134
- Transform.prototype.pipe = function(dest) {
4135
- var s = this;
4136
- // prevent double piping
4137
- s.emit('unpipe', dest);
4138
- // tell the dest that it's being piped to
4139
- dest.emit('pipe', s);
3882
+ function readBlobAsArrayBuffer(blob) {
3883
+ var reader = new FileReader();
3884
+ var promise = fileReaderReady(reader);
3885
+ reader.readAsArrayBuffer(blob);
3886
+ return promise
3887
+ }
4140
3888
 
4141
- function onItem() {
4142
- dest.write.apply(dest, Array.prototype.slice.call(arguments));
3889
+ function readBlobAsText(blob) {
3890
+ var reader = new FileReader();
3891
+ var promise = fileReaderReady(reader);
3892
+ var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
3893
+ var encoding = match ? match[1] : 'utf-8';
3894
+ reader.readAsText(blob, encoding);
3895
+ return promise
4143
3896
  }
4144
- function onEnd() { !dest._isStdio && dest.end(); }
4145
3897
 
4146
- s.on('item', onItem);
4147
- s.on('end', onEnd);
3898
+ function readArrayBufferAsText(buf) {
3899
+ var view = new Uint8Array(buf);
3900
+ var chars = new Array(view.length);
4148
3901
 
4149
- s.when('unpipe', function(from) {
4150
- var match = (from === dest) || typeof from == 'undefined';
4151
- if(match) {
4152
- s.removeListener('item', onItem);
4153
- s.removeListener('end', onEnd);
4154
- dest.emit('unpipe');
3902
+ for (var i = 0; i < view.length; i++) {
3903
+ chars[i] = String.fromCharCode(view[i]);
4155
3904
  }
4156
- return match;
4157
- });
3905
+ return chars.join('')
3906
+ }
4158
3907
 
4159
- return dest;
4160
- };
3908
+ function bufferClone(buf) {
3909
+ if (buf.slice) {
3910
+ return buf.slice(0)
3911
+ } else {
3912
+ var view = new Uint8Array(buf.byteLength);
3913
+ view.set(new Uint8Array(buf));
3914
+ return view.buffer
3915
+ }
3916
+ }
4161
3917
 
4162
- Transform.prototype.unpipe = function(from) {
4163
- this.emit('unpipe', from);
4164
- return this;
4165
- };
3918
+ function Body() {
3919
+ this.bodyUsed = false;
4166
3920
 
4167
- Transform.prototype.format = function(dest) {
4168
- throw new Error([
4169
- 'Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:',
4170
- 'var Minilog = require(\'minilog\');',
4171
- 'Minilog',
4172
- ' .pipe(Minilog.backends.console.formatClean)',
4173
- ' .pipe(Minilog.backends.console);'].join('\n'));
4174
- };
3921
+ this._initBody = function(body) {
3922
+ /*
3923
+ fetch-mock wraps the Response object in an ES6 Proxy to
3924
+ provide useful test harness features such as flush. However, on
3925
+ ES5 browsers without fetch or Proxy support pollyfills must be used;
3926
+ the proxy-pollyfill is unable to proxy an attribute unless it exists
3927
+ on the object before the Proxy is created. This change ensures
3928
+ Response.bodyUsed exists on the instance, while maintaining the
3929
+ semantic of setting Request.bodyUsed in the constructor before
3930
+ _initBody is called.
3931
+ */
3932
+ // eslint-disable-next-line no-self-assign
3933
+ this.bodyUsed = this.bodyUsed;
3934
+ this._bodyInit = body;
3935
+ if (!body) {
3936
+ this._noBody = true;
3937
+ this._bodyText = '';
3938
+ } else if (typeof body === 'string') {
3939
+ this._bodyText = body;
3940
+ } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
3941
+ this._bodyBlob = body;
3942
+ } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
3943
+ this._bodyFormData = body;
3944
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
3945
+ this._bodyText = body.toString();
3946
+ } else if (support.arrayBuffer && support.blob && isDataView(body)) {
3947
+ this._bodyArrayBuffer = bufferClone(body.buffer);
3948
+ // IE 10-11 can't handle a DataView body.
3949
+ this._bodyInit = new Blob([this._bodyArrayBuffer]);
3950
+ } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
3951
+ this._bodyArrayBuffer = bufferClone(body);
3952
+ } else {
3953
+ this._bodyText = body = Object.prototype.toString.call(body);
3954
+ }
4175
3955
 
4176
- Transform.mixin = function(dest) {
4177
- var o = Transform.prototype, k;
4178
- for (k in o) {
4179
- o.hasOwnProperty(k) && (dest.prototype[k] = o[k]);
4180
- }
4181
- };
3956
+ if (!this.headers.get('content-type')) {
3957
+ if (typeof body === 'string') {
3958
+ this.headers.set('content-type', 'text/plain;charset=UTF-8');
3959
+ } else if (this._bodyBlob && this._bodyBlob.type) {
3960
+ this.headers.set('content-type', this._bodyBlob.type);
3961
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
3962
+ this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
3963
+ }
3964
+ }
3965
+ };
4182
3966
 
4183
- module.exports = Transform;
3967
+ if (support.blob) {
3968
+ this.blob = function() {
3969
+ var rejected = consumed(this);
3970
+ if (rejected) {
3971
+ return rejected
3972
+ }
4184
3973
 
3974
+ if (this._bodyBlob) {
3975
+ return Promise.resolve(this._bodyBlob)
3976
+ } else if (this._bodyArrayBuffer) {
3977
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]))
3978
+ } else if (this._bodyFormData) {
3979
+ throw new Error('could not read FormData body as blob')
3980
+ } else {
3981
+ return Promise.resolve(new Blob([this._bodyText]))
3982
+ }
3983
+ };
3984
+ }
4185
3985
 
4186
- /***/ }),
3986
+ this.arrayBuffer = function() {
3987
+ if (this._bodyArrayBuffer) {
3988
+ var isConsumed = consumed(this);
3989
+ if (isConsumed) {
3990
+ return isConsumed
3991
+ } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
3992
+ return Promise.resolve(
3993
+ this._bodyArrayBuffer.buffer.slice(
3994
+ this._bodyArrayBuffer.byteOffset,
3995
+ this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
3996
+ )
3997
+ )
3998
+ } else {
3999
+ return Promise.resolve(this._bodyArrayBuffer)
4000
+ }
4001
+ } else if (support.blob) {
4002
+ return this.blob().then(readBlobAsArrayBuffer)
4003
+ } else {
4004
+ throw new Error('could not read as ArrayBuffer')
4005
+ }
4006
+ };
4187
4007
 
4188
- /***/ 692:
4189
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4008
+ this.text = function() {
4009
+ var rejected = consumed(this);
4010
+ if (rejected) {
4011
+ return rejected
4012
+ }
4190
4013
 
4191
- var Transform = __webpack_require__(408),
4192
- cache = [ ];
4014
+ if (this._bodyBlob) {
4015
+ return readBlobAsText(this._bodyBlob)
4016
+ } else if (this._bodyArrayBuffer) {
4017
+ return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
4018
+ } else if (this._bodyFormData) {
4019
+ throw new Error('could not read FormData body as text')
4020
+ } else {
4021
+ return Promise.resolve(this._bodyText)
4022
+ }
4023
+ };
4193
4024
 
4194
- var logger = new Transform();
4025
+ if (support.formData) {
4026
+ this.formData = function() {
4027
+ return this.text().then(decode)
4028
+ };
4029
+ }
4195
4030
 
4196
- logger.write = function(name, level, args) {
4197
- cache.push([ name, level, args ]);
4198
- };
4031
+ this.json = function() {
4032
+ return this.text().then(JSON.parse)
4033
+ };
4199
4034
 
4200
- // utility functions
4201
- logger.get = function() { return cache; };
4202
- logger.empty = function() { cache = []; };
4035
+ return this
4036
+ }
4203
4037
 
4204
- module.exports = logger;
4038
+ // HTTP methods whose capitalization should be normalized
4039
+ var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];
4205
4040
 
4041
+ function normalizeMethod(method) {
4042
+ var upcased = method.toUpperCase();
4043
+ return methods.indexOf(upcased) > -1 ? upcased : method
4044
+ }
4206
4045
 
4207
- /***/ }),
4046
+ function Request(input, options) {
4047
+ if (!(this instanceof Request)) {
4048
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
4049
+ }
4208
4050
 
4209
- /***/ 260:
4210
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4051
+ options = options || {};
4052
+ var body = options.body;
4211
4053
 
4212
- var Transform = __webpack_require__(408);
4054
+ if (input instanceof Request) {
4055
+ if (input.bodyUsed) {
4056
+ throw new TypeError('Already read')
4057
+ }
4058
+ this.url = input.url;
4059
+ this.credentials = input.credentials;
4060
+ if (!options.headers) {
4061
+ this.headers = new Headers(input.headers);
4062
+ }
4063
+ this.method = input.method;
4064
+ this.mode = input.mode;
4065
+ this.signal = input.signal;
4066
+ if (!body && input._bodyInit != null) {
4067
+ body = input._bodyInit;
4068
+ input.bodyUsed = true;
4069
+ }
4070
+ } else {
4071
+ this.url = String(input);
4072
+ }
4213
4073
 
4214
- var newlines = /\n+$/,
4215
- logger = new Transform();
4074
+ this.credentials = options.credentials || this.credentials || 'same-origin';
4075
+ if (options.headers || !this.headers) {
4076
+ this.headers = new Headers(options.headers);
4077
+ }
4078
+ this.method = normalizeMethod(options.method || this.method || 'GET');
4079
+ this.mode = options.mode || this.mode || null;
4080
+ this.signal = options.signal || this.signal || (function () {
4081
+ if ('AbortController' in g) {
4082
+ var ctrl = new AbortController();
4083
+ return ctrl.signal;
4084
+ }
4085
+ }());
4086
+ this.referrer = null;
4216
4087
 
4217
- logger.write = function(name, level, args) {
4218
- var i = args.length-1;
4219
- if (typeof console === 'undefined' || !console.log) {
4220
- return;
4221
- }
4222
- if(console.log.apply) {
4223
- return console.log.apply(console, [name, level].concat(args));
4224
- } else if(JSON && JSON.stringify) {
4225
- // console.log.apply is undefined in IE8 and IE9
4226
- // for IE8/9: make console.log at least a bit less awful
4227
- if(args[i] && typeof args[i] == 'string') {
4228
- args[i] = args[i].replace(newlines, '');
4088
+ if ((this.method === 'GET' || this.method === 'HEAD') && body) {
4089
+ throw new TypeError('Body not allowed for GET or HEAD requests')
4229
4090
  }
4230
- try {
4231
- for(i = 0; i < args.length; i++) {
4232
- args[i] = JSON.stringify(args[i]);
4091
+ this._initBody(body);
4092
+
4093
+ if (this.method === 'GET' || this.method === 'HEAD') {
4094
+ if (options.cache === 'no-store' || options.cache === 'no-cache') {
4095
+ // Search for a '_' parameter in the query string
4096
+ var reParamSearch = /([?&])_=[^&]*/;
4097
+ if (reParamSearch.test(this.url)) {
4098
+ // If it already exists then set the value with the current time
4099
+ this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
4100
+ } else {
4101
+ // Otherwise add a new '_' parameter to the end with the current time
4102
+ var reQueryString = /\?/;
4103
+ this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
4104
+ }
4233
4105
  }
4234
- } catch(e) {}
4235
- console.log(args.join(' '));
4106
+ }
4236
4107
  }
4237
- };
4238
-
4239
- logger.formatters = ['color', 'minilog'];
4240
- logger.color = __webpack_require__(638);
4241
- logger.minilog = __webpack_require__(658);
4242
-
4243
- module.exports = logger;
4244
4108
 
4109
+ Request.prototype.clone = function() {
4110
+ return new Request(this, {body: this._bodyInit})
4111
+ };
4245
4112
 
4246
- /***/ }),
4113
+ function decode(body) {
4114
+ var form = new FormData();
4115
+ body
4116
+ .trim()
4117
+ .split('&')
4118
+ .forEach(function(bytes) {
4119
+ if (bytes) {
4120
+ var split = bytes.split('=');
4121
+ var name = split.shift().replace(/\+/g, ' ');
4122
+ var value = split.join('=').replace(/\+/g, ' ');
4123
+ form.append(decodeURIComponent(name), decodeURIComponent(value));
4124
+ }
4125
+ });
4126
+ return form
4127
+ }
4247
4128
 
4248
- /***/ 638:
4249
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4129
+ function parseHeaders(rawHeaders) {
4130
+ var headers = new Headers();
4131
+ // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
4132
+ // https://tools.ietf.org/html/rfc7230#section-3.2
4133
+ var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
4134
+ // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
4135
+ // https://github.com/github/fetch/issues/748
4136
+ // https://github.com/zloirock/core-js/issues/751
4137
+ preProcessedHeaders
4138
+ .split('\r')
4139
+ .map(function(header) {
4140
+ return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header
4141
+ })
4142
+ .forEach(function(line) {
4143
+ var parts = line.split(':');
4144
+ var key = parts.shift().trim();
4145
+ if (key) {
4146
+ var value = parts.join(':').trim();
4147
+ try {
4148
+ headers.append(key, value);
4149
+ } catch (error) {
4150
+ console.warn('Response ' + error.message);
4151
+ }
4152
+ }
4153
+ });
4154
+ return headers
4155
+ }
4250
4156
 
4251
- var Transform = __webpack_require__(408),
4252
- color = __webpack_require__(193);
4157
+ Body.call(Request.prototype);
4253
4158
 
4254
- var colors = { debug: ['cyan'], info: ['purple' ], warn: [ 'yellow', true ], error: [ 'red', true ] },
4255
- logger = new Transform();
4159
+ function Response(bodyInit, options) {
4160
+ if (!(this instanceof Response)) {
4161
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
4162
+ }
4163
+ if (!options) {
4164
+ options = {};
4165
+ }
4256
4166
 
4257
- logger.write = function(name, level, args) {
4258
- var fn = console.log;
4259
- if(console[level] && console[level].apply) {
4260
- fn = console[level];
4261
- fn.apply(console, [ '%c'+name+' %c'+level, color('gray'), color.apply(color, colors[level])].concat(args));
4167
+ this.type = 'default';
4168
+ this.status = options.status === undefined ? 200 : options.status;
4169
+ if (this.status < 200 || this.status > 599) {
4170
+ throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].")
4171
+ }
4172
+ this.ok = this.status >= 200 && this.status < 300;
4173
+ this.statusText = options.statusText === undefined ? '' : '' + options.statusText;
4174
+ this.headers = new Headers(options.headers);
4175
+ this.url = options.url || '';
4176
+ this._initBody(bodyInit);
4262
4177
  }
4263
- };
4264
4178
 
4265
- // NOP, because piping the formatted logs can only cause trouble.
4266
- logger.pipe = function() { };
4179
+ Body.call(Response.prototype);
4267
4180
 
4268
- module.exports = logger;
4181
+ Response.prototype.clone = function() {
4182
+ return new Response(this._bodyInit, {
4183
+ status: this.status,
4184
+ statusText: this.statusText,
4185
+ headers: new Headers(this.headers),
4186
+ url: this.url
4187
+ })
4188
+ };
4269
4189
 
4190
+ Response.error = function() {
4191
+ var response = new Response(null, {status: 200, statusText: ''});
4192
+ response.ok = false;
4193
+ response.status = 0;
4194
+ response.type = 'error';
4195
+ return response
4196
+ };
4270
4197
 
4271
- /***/ }),
4198
+ var redirectStatuses = [301, 302, 303, 307, 308];
4272
4199
 
4273
- /***/ 658:
4274
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4200
+ Response.redirect = function(url, status) {
4201
+ if (redirectStatuses.indexOf(status) === -1) {
4202
+ throw new RangeError('Invalid status code')
4203
+ }
4275
4204
 
4276
- var Transform = __webpack_require__(408),
4277
- color = __webpack_require__(193),
4278
- colors = { debug: ['gray'], info: ['purple' ], warn: [ 'yellow', true ], error: [ 'red', true ] },
4279
- logger = new Transform();
4205
+ return new Response(null, {status: status, headers: {location: url}})
4206
+ };
4280
4207
 
4281
- logger.write = function(name, level, args) {
4282
- var fn = console.log;
4283
- if(level != 'debug' && console[level]) {
4284
- fn = console[level];
4208
+ exports.DOMException = g.DOMException;
4209
+ try {
4210
+ new exports.DOMException();
4211
+ } catch (err) {
4212
+ exports.DOMException = function(message, name) {
4213
+ this.message = message;
4214
+ this.name = name;
4215
+ var error = Error(message);
4216
+ this.stack = error.stack;
4217
+ };
4218
+ exports.DOMException.prototype = Object.create(Error.prototype);
4219
+ exports.DOMException.prototype.constructor = exports.DOMException;
4285
4220
  }
4286
4221
 
4287
- var subset = [], i = 0;
4288
- if(level != 'info') {
4289
- for(; i < args.length; i++) {
4290
- if(typeof args[i] != 'string') break;
4291
- }
4292
- fn.apply(console, [ '%c'+name +' '+ args.slice(0, i).join(' '), color.apply(color, colors[level]) ].concat(args.slice(i)));
4293
- } else {
4294
- fn.apply(console, [ '%c'+name, color.apply(color, colors[level]) ].concat(args));
4295
- }
4296
- };
4222
+ function fetch(input, init) {
4223
+ return new Promise(function(resolve, reject) {
4224
+ var request = new Request(input, init);
4297
4225
 
4298
- // NOP, because piping the formatted logs can only cause trouble.
4299
- logger.pipe = function() { };
4226
+ if (request.signal && request.signal.aborted) {
4227
+ return reject(new exports.DOMException('Aborted', 'AbortError'))
4228
+ }
4300
4229
 
4301
- module.exports = logger;
4230
+ var xhr = new XMLHttpRequest();
4302
4231
 
4232
+ function abortXhr() {
4233
+ xhr.abort();
4234
+ }
4303
4235
 
4304
- /***/ }),
4236
+ xhr.onload = function() {
4237
+ var options = {
4238
+ statusText: xhr.statusText,
4239
+ headers: parseHeaders(xhr.getAllResponseHeaders() || '')
4240
+ };
4241
+ // This check if specifically for when a user fetches a file locally from the file system
4242
+ // Only if the status is out of a normal range
4243
+ if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {
4244
+ options.status = 200;
4245
+ } else {
4246
+ options.status = xhr.status;
4247
+ }
4248
+ options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
4249
+ var body = 'response' in xhr ? xhr.response : xhr.responseText;
4250
+ setTimeout(function() {
4251
+ resolve(new Response(body, options));
4252
+ }, 0);
4253
+ };
4305
4254
 
4306
- /***/ 193:
4307
- /***/ ((module) => {
4255
+ xhr.onerror = function() {
4256
+ setTimeout(function() {
4257
+ reject(new TypeError('Network request failed'));
4258
+ }, 0);
4259
+ };
4308
4260
 
4309
- var hex = {
4310
- black: '#000',
4311
- red: '#c23621',
4312
- green: '#25bc26',
4313
- yellow: '#bbbb00',
4314
- blue: '#492ee1',
4315
- magenta: '#d338d3',
4316
- cyan: '#33bbc8',
4317
- gray: '#808080',
4318
- purple: '#708'
4319
- };
4320
- function color(fg, isInverse) {
4321
- if(isInverse) {
4322
- return 'color: #fff; background: '+hex[fg]+';';
4323
- } else {
4324
- return 'color: '+hex[fg]+';';
4325
- }
4326
- }
4261
+ xhr.ontimeout = function() {
4262
+ setTimeout(function() {
4263
+ reject(new TypeError('Network request timed out'));
4264
+ }, 0);
4265
+ };
4327
4266
 
4328
- module.exports = color;
4267
+ xhr.onabort = function() {
4268
+ setTimeout(function() {
4269
+ reject(new exports.DOMException('Aborted', 'AbortError'));
4270
+ }, 0);
4271
+ };
4329
4272
 
4273
+ function fixUrl(url) {
4274
+ try {
4275
+ return url === '' && g.location.href ? g.location.href : url
4276
+ } catch (e) {
4277
+ return url
4278
+ }
4279
+ }
4330
4280
 
4331
- /***/ }),
4281
+ xhr.open(request.method, fixUrl(request.url), true);
4332
4282
 
4333
- /***/ 557:
4334
- /***/ ((module, exports, __webpack_require__) => {
4283
+ if (request.credentials === 'include') {
4284
+ xhr.withCredentials = true;
4285
+ } else if (request.credentials === 'omit') {
4286
+ xhr.withCredentials = false;
4287
+ }
4335
4288
 
4336
- var Minilog = __webpack_require__(15);
4289
+ if ('responseType' in xhr) {
4290
+ if (support.blob) {
4291
+ xhr.responseType = 'blob';
4292
+ } else if (
4293
+ support.arrayBuffer
4294
+ ) {
4295
+ xhr.responseType = 'arraybuffer';
4296
+ }
4297
+ }
4298
+
4299
+ if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {
4300
+ var names = [];
4301
+ Object.getOwnPropertyNames(init.headers).forEach(function(name) {
4302
+ names.push(normalizeName(name));
4303
+ xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
4304
+ });
4305
+ request.headers.forEach(function(value, name) {
4306
+ if (names.indexOf(name) === -1) {
4307
+ xhr.setRequestHeader(name, value);
4308
+ }
4309
+ });
4310
+ } else {
4311
+ request.headers.forEach(function(value, name) {
4312
+ xhr.setRequestHeader(name, value);
4313
+ });
4314
+ }
4337
4315
 
4338
- var oldEnable = Minilog.enable,
4339
- oldDisable = Minilog.disable,
4340
- isChrome = (typeof navigator != 'undefined' && /chrome/i.test(navigator.userAgent)),
4341
- console = __webpack_require__(260);
4316
+ if (request.signal) {
4317
+ request.signal.addEventListener('abort', abortXhr);
4342
4318
 
4343
- // Use a more capable logging backend if on Chrome
4344
- Minilog.defaultBackend = (isChrome ? console.minilog : console);
4319
+ xhr.onreadystatechange = function() {
4320
+ // DONE (success or failure)
4321
+ if (xhr.readyState === 4) {
4322
+ request.signal.removeEventListener('abort', abortXhr);
4323
+ }
4324
+ };
4325
+ }
4345
4326
 
4346
- // apply enable inputs from localStorage and from the URL
4347
- if(typeof window != 'undefined') {
4348
- try {
4349
- Minilog.enable(JSON.parse(window.localStorage['minilogSettings']));
4350
- } catch(e) {}
4351
- if(window.location && window.location.search) {
4352
- var match = RegExp('[?&]minilog=([^&]*)').exec(window.location.search);
4353
- match && Minilog.enable(decodeURIComponent(match[1]));
4327
+ xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
4328
+ })
4354
4329
  }
4355
- }
4356
4330
 
4357
- // Make enable also add to localStorage
4358
- Minilog.enable = function() {
4359
- oldEnable.call(Minilog, true);
4360
- try { window.localStorage['minilogSettings'] = JSON.stringify(true); } catch(e) {}
4361
- return this;
4362
- };
4331
+ fetch.polyfill = true;
4363
4332
 
4364
- Minilog.disable = function() {
4365
- oldDisable.call(Minilog);
4366
- try { delete window.localStorage.minilogSettings; } catch(e) {}
4367
- return this;
4368
- };
4333
+ if (!g.fetch) {
4334
+ g.fetch = fetch;
4335
+ g.Headers = Headers;
4336
+ g.Request = Request;
4337
+ g.Response = Response;
4338
+ }
4369
4339
 
4370
- exports = module.exports = Minilog;
4340
+ exports.Headers = Headers;
4341
+ exports.Request = Request;
4342
+ exports.Response = Response;
4343
+ exports.fetch = fetch;
4371
4344
 
4372
- exports.backends = {
4373
- array: __webpack_require__(692),
4374
- browser: Minilog.defaultBackend,
4375
- localStorage: __webpack_require__(113),
4376
- jQuery: __webpack_require__(740)
4377
- };
4345
+ return exports;
4346
+
4347
+ })({});
4348
+ })(__globalThis__);
4349
+ // This is a ponyfill, so...
4350
+ __globalThis__.fetch.ponyfill = true;
4351
+ delete __globalThis__.fetch.polyfill;
4352
+ // Choose between native implementation (__global__) or custom implementation (__globalThis__)
4353
+ var ctx = __global__.fetch ? __global__ : __globalThis__;
4354
+ exports = ctx.fetch // To enable: import fetch from 'cross-fetch'
4355
+ exports["default"] = ctx.fetch // For TypeScript consumers without esModuleInterop.
4356
+ exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'
4357
+ exports.Headers = ctx.Headers
4358
+ exports.Request = ctx.Request
4359
+ exports.Response = ctx.Response
4360
+ module.exports = exports
4378
4361
 
4379
4362
 
4380
4363
  /***/ }),
4381
4364
 
4382
- /***/ 740:
4365
+ /***/ 953:
4383
4366
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4384
4367
 
4385
- var Transform = __webpack_require__(408);
4386
-
4387
- var cid = new Date().valueOf().toString(36);
4388
-
4389
- function AjaxLogger(options) {
4390
- this.url = options.url || '';
4391
- this.cache = [];
4392
- this.timer = null;
4393
- this.interval = options.interval || 30*1000;
4394
- this.enabled = true;
4395
- this.jQuery = window.jQuery;
4396
- this.extras = {};
4397
- }
4398
-
4399
- Transform.mixin(AjaxLogger);
4368
+ const crossFetch = __webpack_require__(945);
4400
4369
 
4401
- AjaxLogger.prototype.write = function(name, level, args) {
4402
- if(!this.timer) { this.init(); }
4403
- this.cache.push([name, level].concat(args));
4370
+ /**
4371
+ * Metadata header names
4372
+ * @enum {string} The enum value is the name of the associated header.
4373
+ * @readonly
4374
+ */
4375
+ const RequestMetadata = {
4376
+ /** The ID of the project associated with this request */
4377
+ ProjectId: 'X-Project-ID',
4378
+ /** The ID of the project run associated with this request */
4379
+ RunId: 'X-Run-ID'
4404
4380
  };
4405
4381
 
4406
- AjaxLogger.prototype.init = function() {
4407
- if(!this.enabled || !this.jQuery) return;
4408
- var self = this;
4409
- this.timer = setTimeout(function() {
4410
- var i, logs = [], ajaxData, url = self.url;
4411
- if(self.cache.length == 0) return self.init();
4412
- // Test each log line and only log the ones that are valid (e.g. don't have circular references).
4413
- // Slight performance hit but benefit is we log all valid lines.
4414
- for(i = 0; i < self.cache.length; i++) {
4415
- try {
4416
- JSON.stringify(self.cache[i]);
4417
- logs.push(self.cache[i]);
4418
- } catch(e) { }
4419
- }
4420
- if(self.jQuery.isEmptyObject(self.extras)) {
4421
- ajaxData = JSON.stringify({ logs: logs });
4422
- url = self.url + '?client_id=' + cid;
4423
- } else {
4424
- ajaxData = JSON.stringify(self.jQuery.extend({logs: logs}, self.extras));
4425
- }
4382
+ /**
4383
+ * Metadata headers for requests
4384
+ * @type {Headers}
4385
+ */
4386
+ const metadata = new crossFetch.Headers();
4426
4387
 
4427
- self.jQuery.ajax(url, {
4428
- type: 'POST',
4429
- cache: false,
4430
- processData: false,
4431
- data: ajaxData,
4432
- contentType: 'application/json',
4433
- timeout: 10000
4434
- }).success(function(data, status, jqxhr) {
4435
- if(data.interval) {
4436
- self.interval = Math.max(1000, data.interval);
4437
- }
4438
- }).error(function() {
4439
- self.interval = 30000;
4440
- }).always(function() {
4441
- self.init();
4442
- });
4443
- self.cache = [];
4444
- }, this.interval);
4388
+ /**
4389
+ * Check if there is any metadata to apply.
4390
+ * @returns {boolean} true if `metadata` has contents, or false if it is empty.
4391
+ */
4392
+ const hasMetadata = () => {
4393
+ /* global self */
4394
+ const searchParams = typeof self !== 'undefined' && self && self.location && self.location.search && self.location.search.split(/[?&]/) || [];
4395
+ if (!searchParams.includes('scratchMetadata=1')) {
4396
+ // for now, disable this feature unless scratchMetadata=1
4397
+ // TODO: remove this check once we're sure the feature works correctly in production
4398
+ return false;
4399
+ }
4400
+ for (const _ of metadata) {
4401
+ return true;
4402
+ }
4403
+ return false;
4445
4404
  };
4446
4405
 
4447
- AjaxLogger.prototype.end = function() {};
4448
-
4449
- // wait until jQuery is defined. Useful if you don't control the load order.
4450
- AjaxLogger.jQueryWait = function(onDone) {
4451
- if(typeof window !== 'undefined' && (window.jQuery || window.$)) {
4452
- return onDone(window.jQuery || window.$);
4453
- } else if (typeof window !== 'undefined') {
4454
- setTimeout(function() { AjaxLogger.jQueryWait(onDone); }, 200);
4406
+ /**
4407
+ * Non-destructively merge any metadata state (if any) with the provided options object (if any).
4408
+ * If there is metadata state but no options object is provided, make a new object.
4409
+ * If there is no metadata state, return the provided options parameter without modification.
4410
+ * If there is metadata and an options object is provided, modify a copy and return it.
4411
+ * Headers in the provided options object may override headers generated from metadata state.
4412
+ * @param {RequestInit} [options] The initial request options. May be null or undefined.
4413
+ * @returns {RequestInit|undefined} the provided options parameter without modification, or a new options object.
4414
+ */
4415
+ const applyMetadata = options => {
4416
+ if (hasMetadata()) {
4417
+ const augmentedOptions = Object.assign({}, options);
4418
+ augmentedOptions.headers = new crossFetch.Headers(metadata);
4419
+ if (options && options.headers) {
4420
+ // the Fetch spec says options.headers could be:
4421
+ // "A Headers object, an object literal, or an array of two-item arrays to set request's headers."
4422
+ // turn it into a Headers object to be sure of how to interact with it
4423
+ const overrideHeaders = options.headers instanceof crossFetch.Headers ? options.headers : new crossFetch.Headers(options.headers);
4424
+ for (const [name, value] of overrideHeaders.entries()) {
4425
+ augmentedOptions.headers.set(name, value);
4426
+ }
4427
+ }
4428
+ return augmentedOptions;
4455
4429
  }
4430
+ return options;
4456
4431
  };
4457
4432
 
4458
- module.exports = AjaxLogger;
4459
-
4460
-
4461
- /***/ }),
4462
-
4463
- /***/ 113:
4464
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4465
-
4466
- var Transform = __webpack_require__(408),
4467
- cache = false;
4433
+ /**
4434
+ * Make a network request.
4435
+ * This is a wrapper for the global fetch method, adding some Scratch-specific functionality.
4436
+ * @param {RequestInfo|URL} resource The resource to fetch.
4437
+ * @param {RequestInit} options Optional object containing custom settings for this request.
4438
+ * @see {@link https://developer.mozilla.org/docs/Web/API/fetch} for more about the fetch API.
4439
+ * @returns {Promise<Response>} A promise for the response to the request.
4440
+ */
4441
+ const scratchFetch = (resource, options) => {
4442
+ const augmentedOptions = applyMetadata(options);
4443
+ return crossFetch(resource, augmentedOptions);
4444
+ };
4468
4445
 
4469
- var logger = new Transform();
4446
+ /**
4447
+ * Set the value of a named request metadata item.
4448
+ * Setting the value to `null` or `undefined` will NOT remove the item.
4449
+ * Use `unsetMetadata` for that.
4450
+ * @param {RequestMetadata} name The name of the metadata item to set.
4451
+ * @param {any} value The value to set (will be converted to a string).
4452
+ */
4453
+ const setMetadata = (name, value) => {
4454
+ metadata.set(name, value);
4455
+ };
4470
4456
 
4471
- logger.write = function(name, level, args) {
4472
- if(typeof window == 'undefined' || typeof JSON == 'undefined' || !JSON.stringify || !JSON.parse) return;
4473
- try {
4474
- if(!cache) { cache = (window.localStorage.minilog ? JSON.parse(window.localStorage.minilog) : []); }
4475
- cache.push([ new Date().toString(), name, level, args ]);
4476
- window.localStorage.minilog = JSON.stringify(cache);
4477
- } catch(e) {}
4457
+ /**
4458
+ * Remove a named request metadata item.
4459
+ * @param {RequestMetadata} name The name of the metadata item to remove.
4460
+ */
4461
+ const unsetMetadata = name => {
4462
+ metadata.delete(name);
4478
4463
  };
4479
4464
 
4480
- module.exports = logger;
4465
+ /**
4466
+ * Retrieve a named request metadata item.
4467
+ * Only for use in tests. At the time of writing, used in scratch-vm tests.
4468
+ * @param {RequestMetadata} name The name of the metadata item to retrieve.
4469
+ * @returns {any} value The value of the metadata item, or `undefined` if it was not found.
4470
+ */
4471
+ const getMetadata = name => metadata.get(name);
4472
+ module.exports = {
4473
+ Headers: crossFetch.Headers,
4474
+ RequestMetadata,
4475
+ applyMetadata,
4476
+ scratchFetch,
4477
+ setMetadata,
4478
+ unsetMetadata,
4479
+ getMetadata
4480
+ };
4481
4481
 
4482
4482
  /***/ })
4483
4483