@loaders.gl/polyfills 4.0.0-beta.6 → 4.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -656,7 +656,7 @@ var require_stream_readable = __commonJS({
656
656
  if (state.pipesCount === 1)
657
657
  write(state.pipes, 0, null);
658
658
  else
659
- forEach(state.pipes, write);
659
+ forEach2(state.pipes, write);
660
660
  src.emit("data", chunk);
661
661
  if (state.awaitDrain > 0)
662
662
  return;
@@ -813,7 +813,7 @@ var require_stream_readable = __commonJS({
813
813
  }
814
814
  }
815
815
  var events = ["error", "close", "destroy", "pause", "resume"];
816
- forEach(events, function(ev) {
816
+ forEach2(events, function(ev) {
817
817
  stream2.on(ev, self2.emit.bind(self2, ev));
818
818
  });
819
819
  self2._read = function(n) {
@@ -888,7 +888,7 @@ var require_stream_readable = __commonJS({
888
888
  });
889
889
  }
890
890
  }
891
- function forEach(xs, f) {
891
+ function forEach2(xs, f) {
892
892
  for (var i = 0, l = xs.length; i < l; i++) {
893
893
  f(xs[i], i);
894
894
  }
@@ -918,7 +918,7 @@ var require_stream_duplex = __commonJS({
918
918
  var Readable5 = require_stream_readable();
919
919
  var Writable = require_stream_writable();
920
920
  util.inherits(Duplex, Readable5);
921
- forEach(objectKeys(Writable.prototype), function(method) {
921
+ forEach2(objectKeys(Writable.prototype), function(method) {
922
922
  if (!Duplex.prototype[method])
923
923
  Duplex.prototype[method] = Writable.prototype[method];
924
924
  });
@@ -941,7 +941,7 @@ var require_stream_duplex = __commonJS({
941
941
  return;
942
942
  process.nextTick(this.end.bind(this));
943
943
  }
944
- function forEach(xs, f) {
944
+ function forEach2(xs, f) {
945
945
  for (var i = 0, l = xs.length; i < l; i++) {
946
946
  f(xs[i], i);
947
947
  }
@@ -1654,7 +1654,7 @@ var require_stream_duplex2 = __commonJS({
1654
1654
  var Readable5 = require_stream_readable2();
1655
1655
  var Writable = require_stream_writable2();
1656
1656
  util.inherits(Duplex, Readable5);
1657
- forEach(objectKeys(Writable.prototype), function(method) {
1657
+ forEach2(objectKeys(Writable.prototype), function(method) {
1658
1658
  if (!Duplex.prototype[method])
1659
1659
  Duplex.prototype[method] = Writable.prototype[method];
1660
1660
  });
@@ -1677,7 +1677,7 @@ var require_stream_duplex2 = __commonJS({
1677
1677
  return;
1678
1678
  process.nextTick(this.end.bind(this));
1679
1679
  }
1680
- function forEach(xs, f) {
1680
+ function forEach2(xs, f) {
1681
1681
  for (var i = 0, l = xs.length; i < l; i++) {
1682
1682
  f(xs[i], i);
1683
1683
  }
@@ -2221,7 +2221,7 @@ var require_stream_readable2 = __commonJS({
2221
2221
  }
2222
2222
  }
2223
2223
  var events = ["error", "close", "destroy", "pause", "resume"];
2224
- forEach(events, function(ev) {
2224
+ forEach2(events, function(ev) {
2225
2225
  stream2.on(ev, self2.emit.bind(self2, ev));
2226
2226
  });
2227
2227
  self2._read = function(n) {
@@ -2297,7 +2297,7 @@ var require_stream_readable2 = __commonJS({
2297
2297
  });
2298
2298
  }
2299
2299
  }
2300
- function forEach(xs, f) {
2300
+ function forEach2(xs, f) {
2301
2301
  for (var i = 0, l = xs.length; i < l; i++) {
2302
2302
  f(xs[i], i);
2303
2303
  }
@@ -22771,7 +22771,7 @@ var require_helpers = __commonJS({
22771
22771
  "../../node_modules/request/lib/helpers.js"(exports) {
22772
22772
  "use strict";
22773
22773
  var jsonSafeStringify = require_stringify();
22774
- var crypto = require("crypto");
22774
+ var crypto2 = require("crypto");
22775
22775
  var Buffer2 = require_safe_buffer().Buffer;
22776
22776
  var defer = typeof setImmediate === "undefined" ? process.nextTick : setImmediate;
22777
22777
  function paramsHaveRequestBody(params) {
@@ -22787,7 +22787,7 @@ var require_helpers = __commonJS({
22787
22787
  return ret;
22788
22788
  }
22789
22789
  function md5(str) {
22790
- return crypto.createHash("md5").update(str).digest("hex");
22790
+ return crypto2.createHash("md5").update(str).digest("hex");
22791
22791
  }
22792
22792
  function isReadStream(rs) {
22793
22793
  return rs.readable && rs.path && rs.mode;
@@ -22824,7 +22824,7 @@ var require_helpers = __commonJS({
22824
22824
  // ../../node_modules/aws-sign2/index.js
22825
22825
  var require_aws_sign2 = __commonJS({
22826
22826
  "../../node_modules/aws-sign2/index.js"(exports, module2) {
22827
- var crypto = require("crypto");
22827
+ var crypto2 = require("crypto");
22828
22828
  var parse = require("url").parse;
22829
22829
  var keys = [
22830
22830
  "acl",
@@ -22848,7 +22848,7 @@ var require_aws_sign2 = __commonJS({
22848
22848
  module2.exports = authorization;
22849
22849
  module2.exports.authorization = authorization;
22850
22850
  function hmacSha1(options) {
22851
- return crypto.createHmac("sha1", options.secret).update(options.message).digest("base64");
22851
+ return crypto2.createHmac("sha1", options.secret).update(options.message).digest("base64");
22852
22852
  }
22853
22853
  module2.exports.hmacSha1 = hmacSha1;
22854
22854
  function sign(options) {
@@ -23002,14 +23002,14 @@ var require_aws4 = __commonJS({
23002
23002
  var aws4 = exports;
23003
23003
  var url = require("url");
23004
23004
  var querystring = require("querystring");
23005
- var crypto = require("crypto");
23005
+ var crypto2 = require("crypto");
23006
23006
  var lru = require_lru();
23007
23007
  var credentialsCache = lru(1e3);
23008
23008
  function hmac(key, string, encoding) {
23009
- return crypto.createHmac("sha256", key).update(string, "utf8").digest(encoding);
23009
+ return crypto2.createHmac("sha256", key).update(string, "utf8").digest(encoding);
23010
23010
  }
23011
23011
  function hash(string, encoding) {
23012
- return crypto.createHash("sha256").update(string, "utf8").digest(encoding);
23012
+ return crypto2.createHash("sha256").update(string, "utf8").digest(encoding);
23013
23013
  }
23014
23014
  function encodeRfc3986(urlEncodedString) {
23015
23015
  return urlEncodedString.replace(/[!'()*]/g, function(c) {
@@ -28320,23 +28320,23 @@ var require_nacl_fast = __commonJS({
28320
28320
  randombytes = fn;
28321
28321
  };
28322
28322
  (function() {
28323
- var crypto = typeof self !== "undefined" ? self.crypto || self.msCrypto : null;
28324
- if (crypto && crypto.getRandomValues) {
28323
+ var crypto2 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null;
28324
+ if (crypto2 && crypto2.getRandomValues) {
28325
28325
  var QUOTA = 65536;
28326
28326
  nacl.setPRNG(function(x, n) {
28327
28327
  var i, v = new Uint8Array(n);
28328
28328
  for (i = 0; i < n; i += QUOTA) {
28329
- crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
28329
+ crypto2.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
28330
28330
  }
28331
28331
  for (i = 0; i < n; i++)
28332
28332
  x[i] = v[i];
28333
28333
  cleanup(v);
28334
28334
  });
28335
28335
  } else if (typeof require !== "undefined") {
28336
- crypto = require("crypto");
28337
- if (crypto && crypto.randomBytes) {
28336
+ crypto2 = require("crypto");
28337
+ if (crypto2 && crypto2.randomBytes) {
28338
28338
  nacl.setPRNG(function(x, n) {
28339
- var i, v = crypto.randomBytes(n);
28339
+ var i, v = crypto2.randomBytes(n);
28340
28340
  for (i = 0; i < n; i++)
28341
28341
  x[i] = v[i];
28342
28342
  cleanup(v);
@@ -28375,7 +28375,7 @@ var require_utils = __commonJS({
28375
28375
  var Buffer2 = require_safer().Buffer;
28376
28376
  var PrivateKey = require_private_key();
28377
28377
  var Key = require_key();
28378
- var crypto = require("crypto");
28378
+ var crypto2 = require("crypto");
28379
28379
  var algs = require_algs();
28380
28380
  var asn1 = require_lib();
28381
28381
  var ec = require_ec();
@@ -28459,7 +28459,7 @@ var require_utils = __commonJS({
28459
28459
  bufs.push(salt);
28460
28460
  D = Buffer2.concat(bufs);
28461
28461
  for (var j = 0; j < count; ++j)
28462
- D = crypto.createHash("md5").update(D).digest();
28462
+ D = crypto2.createHash("md5").update(D).digest();
28463
28463
  material = Buffer2.concat([material, D]);
28464
28464
  D_prev = D;
28465
28465
  }
@@ -28481,13 +28481,13 @@ var require_utils = __commonJS({
28481
28481
  return Buffer2.concat(ts).slice(0, size);
28482
28482
  function T(I) {
28483
28483
  hkey.writeUInt32BE(I, hkey.length - 4);
28484
- var hmac = crypto.createHmac(hashAlg, passphrase);
28484
+ var hmac = crypto2.createHmac(hashAlg, passphrase);
28485
28485
  hmac.update(hkey);
28486
28486
  var Ti = hmac.digest();
28487
28487
  var Uc = Ti;
28488
28488
  var c = 1;
28489
28489
  while (c++ < iterations) {
28490
- hmac = crypto.createHmac(hashAlg, passphrase);
28490
+ hmac = crypto2.createHmac(hashAlg, passphrase);
28491
28491
  hmac.update(Uc);
28492
28492
  Uc = hmac.digest();
28493
28493
  for (var x = 0; x < Ti.length; ++x)
@@ -28856,7 +28856,7 @@ var require_signature = __commonJS({
28856
28856
  var assert2 = require_assert();
28857
28857
  var Buffer2 = require_safer().Buffer;
28858
28858
  var algs = require_algs();
28859
- var crypto = require("crypto");
28859
+ var crypto2 = require("crypto");
28860
28860
  var errs = require_errors();
28861
28861
  var utils = require_utils();
28862
28862
  var asn1 = require_lib();
@@ -29234,7 +29234,7 @@ var require_sec = __commonJS({
29234
29234
  // ../../node_modules/ecc-jsbn/index.js
29235
29235
  var require_ecc_jsbn = __commonJS({
29236
29236
  "../../node_modules/ecc-jsbn/index.js"(exports) {
29237
- var crypto = require("crypto");
29237
+ var crypto2 = require("crypto");
29238
29238
  var BigInteger = require_jsbn().BigInteger;
29239
29239
  var ECPointFp = require_ec().ECPointFp;
29240
29240
  var Buffer2 = require_safer().Buffer;
@@ -29258,7 +29258,7 @@ var require_ecc_jsbn = __commonJS({
29258
29258
  }
29259
29259
  } else {
29260
29260
  var n1 = n.subtract(BigInteger.ONE);
29261
- var r = new BigInteger(crypto.randomBytes(n.bitLength()));
29261
+ var r = new BigInteger(crypto2.randomBytes(n.bitLength()));
29262
29262
  priv = r.mod(n1).add(BigInteger.ONE);
29263
29263
  this.P = c.getG().multiply(priv);
29264
29264
  }
@@ -29287,14 +29287,14 @@ var require_dhe = __commonJS({
29287
29287
  generateED25519
29288
29288
  };
29289
29289
  var assert2 = require_assert();
29290
- var crypto = require("crypto");
29290
+ var crypto2 = require("crypto");
29291
29291
  var Buffer2 = require_safer().Buffer;
29292
29292
  var algs = require_algs();
29293
29293
  var utils = require_utils();
29294
29294
  var nacl = require_nacl_fast();
29295
29295
  var Key = require_key();
29296
29296
  var PrivateKey = require_private_key();
29297
- var CRYPTO_HAVE_ECDH = crypto.createECDH !== void 0;
29297
+ var CRYPTO_HAVE_ECDH = crypto2.createECDH !== void 0;
29298
29298
  var ecdh = require_ecc_jsbn();
29299
29299
  var ec = require_ec();
29300
29300
  var jsbn = require_jsbn().BigInteger;
@@ -29308,7 +29308,7 @@ var require_dhe = __commonJS({
29308
29308
  if (!CRYPTO_HAVE_ECDH) {
29309
29309
  throw new Error("Due to bugs in the node 0.10 crypto API, node 0.12.x or later is required to use DH");
29310
29310
  }
29311
- this._dh = crypto.createDiffieHellman(
29311
+ this._dh = crypto2.createDiffieHellman(
29312
29312
  key.part.p.data,
29313
29313
  void 0,
29314
29314
  key.part.g.data,
@@ -29335,7 +29335,7 @@ var require_dhe = __commonJS({
29335
29335
  "nistp384": "secp384r1",
29336
29336
  "nistp521": "secp521r1"
29337
29337
  }[key.curve];
29338
- this._dh = crypto.createECDH(curve);
29338
+ this._dh = crypto2.createECDH(curve);
29339
29339
  if (typeof this._dh !== "object" || typeof this._dh.setPrivateKey !== "function") {
29340
29340
  CRYPTO_HAVE_ECDH = false;
29341
29341
  DiffieHellman.call(this, key);
@@ -29487,7 +29487,7 @@ var require_dhe = __commonJS({
29487
29487
  return this._key;
29488
29488
  } else {
29489
29489
  var n = this._ecParams.getN();
29490
- var r = new jsbn(crypto.randomBytes(n.bitLength()));
29490
+ var r = new jsbn(crypto2.randomBytes(n.bitLength()));
29491
29491
  var n1 = n.subtract(jsbn.ONE);
29492
29492
  priv = r.mod(n1).add(jsbn.ONE);
29493
29493
  pub = this._ecParams.getG().multiply(priv);
@@ -29593,7 +29593,7 @@ var require_dhe = __commonJS({
29593
29593
  "nistp384": "secp384r1",
29594
29594
  "nistp521": "secp521r1"
29595
29595
  }[curve];
29596
- var dh = crypto.createECDH(osCurve);
29596
+ var dh = crypto2.createECDH(osCurve);
29597
29597
  dh.generateKeys();
29598
29598
  parts.push({
29599
29599
  name: "curve",
@@ -29611,7 +29611,7 @@ var require_dhe = __commonJS({
29611
29611
  var ecParams = new X9ECParameters(curve);
29612
29612
  var n = ecParams.getN();
29613
29613
  var cByteLen = Math.ceil((n.bitLength() + 64) / 8);
29614
- var c = new jsbn(crypto.randomBytes(cByteLen));
29614
+ var c = new jsbn(crypto2.randomBytes(cByteLen));
29615
29615
  var n1 = n.subtract(jsbn.ONE);
29616
29616
  var priv = c.mod(n1).add(jsbn.ONE);
29617
29617
  var pub = ecParams.getG().multiply(priv);
@@ -31943,7 +31943,7 @@ var require_ssh_private = __commonJS({
31943
31943
  var Buffer2 = require_safer().Buffer;
31944
31944
  var algs = require_algs();
31945
31945
  var utils = require_utils();
31946
- var crypto = require("crypto");
31946
+ var crypto2 = require("crypto");
31947
31947
  var Key = require_key();
31948
31948
  var PrivateKey = require_private_key();
31949
31949
  var pem = require_pem();
@@ -32017,7 +32017,7 @@ var require_ssh_private = __commonJS({
32017
32017
  out = Buffer2.from(out);
32018
32018
  var ckey = out.slice(0, cinf.keySize);
32019
32019
  var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
32020
- var cipherStream = crypto.createDecipheriv(
32020
+ var cipherStream = crypto2.createDecipheriv(
32021
32021
  cinf.opensslName,
32022
32022
  ckey,
32023
32023
  iv
@@ -32082,7 +32082,7 @@ var require_ssh_private = __commonJS({
32082
32082
  var privBuf;
32083
32083
  if (PrivateKey.isPrivateKey(key)) {
32084
32084
  privBuf = new SSHBuffer({});
32085
- var checkInt = crypto.randomBytes(4).readUInt32BE(0);
32085
+ var checkInt = crypto2.randomBytes(4).readUInt32BE(0);
32086
32086
  privBuf.writeInt(checkInt);
32087
32087
  privBuf.writeInt(checkInt);
32088
32088
  privBuf.write(key.toBuffer("rfc4253"));
@@ -32096,7 +32096,7 @@ var require_ssh_private = __commonJS({
32096
32096
  case "none":
32097
32097
  break;
32098
32098
  case "bcrypt":
32099
- var salt = crypto.randomBytes(16);
32099
+ var salt = crypto2.randomBytes(16);
32100
32100
  var rounds = 16;
32101
32101
  var kdfssh = new SSHBuffer({});
32102
32102
  kdfssh.writeBuffer(salt);
@@ -32123,7 +32123,7 @@ var require_ssh_private = __commonJS({
32123
32123
  out = Buffer2.from(out);
32124
32124
  var ckey = out.slice(0, cinf.keySize);
32125
32125
  var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
32126
- var cipherStream = crypto.createCipheriv(
32126
+ var cipherStream = crypto2.createCipheriv(
32127
32127
  cinf.opensslName,
32128
32128
  ckey,
32129
32129
  iv
@@ -32185,7 +32185,7 @@ var require_pem = __commonJS({
32185
32185
  };
32186
32186
  var assert2 = require_assert();
32187
32187
  var asn1 = require_lib();
32188
- var crypto = require("crypto");
32188
+ var crypto2 = require("crypto");
32189
32189
  var Buffer2 = require_safer().Buffer;
32190
32190
  var algs = require_algs();
32191
32191
  var utils = require_utils();
@@ -32353,7 +32353,7 @@ var require_pem = __commonJS({
32353
32353
  alg = void 0;
32354
32354
  }
32355
32355
  if (cipher && key && iv) {
32356
- var cipherStream = crypto.createDecipheriv(cipher, key, iv);
32356
+ var cipherStream = crypto2.createDecipheriv(cipher, key, iv);
32357
32357
  var chunk, chunks = [];
32358
32358
  cipherStream.once("error", function(e) {
32359
32359
  if (e.toString().indexOf("bad decrypt") !== -1) {
@@ -32778,7 +32778,7 @@ var require_putty = __commonJS({
32778
32778
  var rfc4253 = require_rfc4253();
32779
32779
  var Key = require_key();
32780
32780
  var SSHBuffer = require_ssh_buffer();
32781
- var crypto = require("crypto");
32781
+ var crypto2 = require("crypto");
32782
32782
  var PrivateKey = require_private_key();
32783
32783
  var errors = require_errors();
32784
32784
  function read(buf, options) {
@@ -32848,7 +32848,7 @@ var require_putty = __commonJS({
32848
32848
  );
32849
32849
  }
32850
32850
  var iv = Buffer2.alloc(16, 0);
32851
- var decipher = crypto.createDecipheriv(
32851
+ var decipher = crypto2.createDecipheriv(
32852
32852
  "aes-256-cbc",
32853
32853
  derivePPK2EncryptionKey(options.passphrase),
32854
32854
  iv
@@ -32899,11 +32899,11 @@ var require_putty = __commonJS({
32899
32899
  return key;
32900
32900
  }
32901
32901
  function derivePPK2EncryptionKey(passphrase) {
32902
- var hash1 = crypto.createHash("sha1").update(Buffer2.concat([
32902
+ var hash1 = crypto2.createHash("sha1").update(Buffer2.concat([
32903
32903
  Buffer2.from([0, 0, 0, 0]),
32904
32904
  Buffer2.from(passphrase)
32905
32905
  ])).digest();
32906
- var hash2 = crypto.createHash("sha1").update(Buffer2.concat([
32906
+ var hash2 = crypto2.createHash("sha1").update(Buffer2.concat([
32907
32907
  Buffer2.from([0, 0, 0, 1]),
32908
32908
  Buffer2.from(passphrase)
32909
32909
  ])).digest();
@@ -33057,7 +33057,7 @@ var require_private_key = __commonJS({
33057
33057
  var assert2 = require_assert();
33058
33058
  var Buffer2 = require_safer().Buffer;
33059
33059
  var algs = require_algs();
33060
- var crypto = require("crypto");
33060
+ var crypto2 = require("crypto");
33061
33061
  var Fingerprint = require_fingerprint();
33062
33062
  var Signature = require_signature();
33063
33063
  var errs = require_errors();
@@ -33168,14 +33168,14 @@ var require_private_key = __commonJS({
33168
33168
  var v, nm, err;
33169
33169
  try {
33170
33170
  nm = hashAlgo.toUpperCase();
33171
- v = crypto.createSign(nm);
33171
+ v = crypto2.createSign(nm);
33172
33172
  } catch (e) {
33173
33173
  err = e;
33174
33174
  }
33175
33175
  if (v === void 0 || err instanceof Error && err.message.match(/Unknown message digest/)) {
33176
33176
  nm = "RSA-";
33177
33177
  nm += hashAlgo.toUpperCase();
33178
- v = crypto.createSign(nm);
33178
+ v = crypto2.createSign(nm);
33179
33179
  }
33180
33180
  assert2.ok(v, "failed to create verifier");
33181
33181
  var oldSign = v.sign.bind(v);
@@ -33260,7 +33260,7 @@ var require_identity = __commonJS({
33260
33260
  module2.exports = Identity;
33261
33261
  var assert2 = require_assert();
33262
33262
  var algs = require_algs();
33263
- var crypto = require("crypto");
33263
+ var crypto2 = require("crypto");
33264
33264
  var Fingerprint = require_fingerprint();
33265
33265
  var Signature = require_signature();
33266
33266
  var errs = require_errors();
@@ -33577,7 +33577,7 @@ var require_openssh_cert = __commonJS({
33577
33577
  };
33578
33578
  var assert2 = require_assert();
33579
33579
  var SSHBuffer = require_ssh_buffer();
33580
- var crypto = require("crypto");
33580
+ var crypto2 = require("crypto");
33581
33581
  var Buffer2 = require_safer().Buffer;
33582
33582
  var algs = require_algs();
33583
33583
  var Key = require_key();
@@ -33766,7 +33766,7 @@ var require_openssh_cert = __commonJS({
33766
33766
  assert2.object(cert.signatures.openssh, "signature for openssh format");
33767
33767
  var sig = cert.signatures.openssh;
33768
33768
  if (sig.nonce === void 0)
33769
- sig.nonce = crypto.randomBytes(16);
33769
+ sig.nonce = crypto2.randomBytes(16);
33770
33770
  var buf = new SSHBuffer({});
33771
33771
  buf.writeString(getCertType(cert.subjectKey));
33772
33772
  buf.writeBuffer(sig.nonce);
@@ -34569,7 +34569,7 @@ var require_certificate = __commonJS({
34569
34569
  var assert2 = require_assert();
34570
34570
  var Buffer2 = require_safer().Buffer;
34571
34571
  var algs = require_algs();
34572
- var crypto = require("crypto");
34572
+ var crypto2 = require("crypto");
34573
34573
  var Fingerprint = require_fingerprint();
34574
34574
  var Signature = require_signature();
34575
34575
  var errs = require_errors();
@@ -34656,7 +34656,7 @@ var require_certificate = __commonJS({
34656
34656
  throw new InvalidAlgorithmError(algo);
34657
34657
  if (this._hashCache[algo])
34658
34658
  return this._hashCache[algo];
34659
- var hash = crypto.createHash(algo).update(this.toBuffer("x509")).digest();
34659
+ var hash = crypto2.createHash(algo).update(this.toBuffer("x509")).digest();
34660
34660
  this._hashCache[algo] = hash;
34661
34661
  return hash;
34662
34662
  };
@@ -34926,7 +34926,7 @@ var require_fingerprint = __commonJS({
34926
34926
  var assert2 = require_assert();
34927
34927
  var Buffer2 = require_safer().Buffer;
34928
34928
  var algs = require_algs();
34929
- var crypto = require("crypto");
34929
+ var crypto2 = require("crypto");
34930
34930
  var errs = require_errors();
34931
34931
  var Key = require_key();
34932
34932
  var PrivateKey = require_private_key();
@@ -34993,9 +34993,9 @@ var require_fingerprint = __commonJS({
34993
34993
  );
34994
34994
  }
34995
34995
  var theirHash = other.hash(this.algorithm, this.hashType);
34996
- var theirHash2 = crypto.createHash(this.algorithm).update(theirHash).digest("base64");
34996
+ var theirHash2 = crypto2.createHash(this.algorithm).update(theirHash).digest("base64");
34997
34997
  if (this.hash2 === void 0)
34998
- this.hash2 = crypto.createHash(this.algorithm).update(this.hash).digest("base64");
34998
+ this.hash2 = crypto2.createHash(this.algorithm).update(this.hash).digest("base64");
34999
34999
  return this.hash2 === theirHash2;
35000
35000
  };
35001
35001
  var base64RE = /^[A-Za-z0-9+\/=]+$/;
@@ -35120,7 +35120,7 @@ var require_key = __commonJS({
35120
35120
  module2.exports = Key;
35121
35121
  var assert2 = require_assert();
35122
35122
  var algs = require_algs();
35123
- var crypto = require("crypto");
35123
+ var crypto2 = require("crypto");
35124
35124
  var Fingerprint = require_fingerprint();
35125
35125
  var Signature = require_signature();
35126
35126
  var DiffieHellman = require_dhe().DiffieHellman;
@@ -35218,7 +35218,7 @@ var require_key = __commonJS({
35218
35218
  } else {
35219
35219
  throw new Error("Hash type " + type + " not supported");
35220
35220
  }
35221
- var hash = crypto.createHash(algo).update(buf).digest();
35221
+ var hash = crypto2.createHash(algo).update(buf).digest();
35222
35222
  this._hashCache[cacheKey] = hash;
35223
35223
  return hash;
35224
35224
  };
@@ -35266,14 +35266,14 @@ var require_key = __commonJS({
35266
35266
  var v, nm, err;
35267
35267
  try {
35268
35268
  nm = hashAlgo.toUpperCase();
35269
- v = crypto.createVerify(nm);
35269
+ v = crypto2.createVerify(nm);
35270
35270
  } catch (e) {
35271
35271
  err = e;
35272
35272
  }
35273
35273
  if (v === void 0 || err instanceof Error && err.message.match(/Unknown message digest/)) {
35274
35274
  nm = "RSA-";
35275
35275
  nm += hashAlgo.toUpperCase();
35276
- v = crypto.createVerify(nm);
35276
+ v = crypto2.createVerify(nm);
35277
35277
  }
35278
35278
  assert2.ok(v, "failed to create verifier");
35279
35279
  var oldVerify = v.verify.bind(v);
@@ -37068,7 +37068,7 @@ var require_jsprim = __commonJS({
37068
37068
  var require_signer = __commonJS({
37069
37069
  "../../node_modules/http-signature/lib/signer.js"(exports, module2) {
37070
37070
  var assert2 = require_assert();
37071
- var crypto = require("crypto");
37071
+ var crypto2 = require("crypto");
37072
37072
  var http2 = require("http");
37073
37073
  var util = require("util");
37074
37074
  var sshpk = require_lib2();
@@ -37105,7 +37105,7 @@ var require_signer = __commonJS({
37105
37105
  this.rs_keyId = options.keyId;
37106
37106
  if (typeof options.key !== "string" && !Buffer.isBuffer(options.key))
37107
37107
  throw new TypeError("options.key for HMAC must be a string or Buffer");
37108
- this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key);
37108
+ this.rs_signer = crypto2.createHmac(alg[1].toUpperCase(), options.key);
37109
37109
  this.rs_signer.sign = function() {
37110
37110
  var digest = this.digest("base64");
37111
37111
  return {
@@ -37323,7 +37323,7 @@ var require_signer = __commonJS({
37323
37323
  if (alg[0] === "hmac") {
37324
37324
  if (typeof options.key !== "string" && !Buffer.isBuffer(options.key))
37325
37325
  throw new TypeError("options.key must be a string or Buffer");
37326
- var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key);
37326
+ var hmac = crypto2.createHmac(alg[1].toUpperCase(), options.key);
37327
37327
  hmac.update(stringToSign);
37328
37328
  signature = hmac.digest("base64");
37329
37329
  } else {
@@ -37368,7 +37368,7 @@ var require_signer = __commonJS({
37368
37368
  var require_verify = __commonJS({
37369
37369
  "../../node_modules/http-signature/lib/verify.js"(exports, module2) {
37370
37370
  var assert2 = require_assert();
37371
- var crypto = require("crypto");
37371
+ var crypto2 = require("crypto");
37372
37372
  var sshpk = require_lib2();
37373
37373
  var utils = require_utils2();
37374
37374
  var HASH_ALGOS = utils.HASH_ALGOS;
@@ -37416,12 +37416,12 @@ var require_verify = __commonJS({
37416
37416
  if (alg[0] !== "hmac")
37417
37417
  return false;
37418
37418
  var hashAlg = alg[1].toUpperCase();
37419
- var hmac = crypto.createHmac(hashAlg, secret);
37419
+ var hmac = crypto2.createHmac(hashAlg, secret);
37420
37420
  hmac.update(parsedSignature.signingString);
37421
- var h1 = crypto.createHmac(hashAlg, secret);
37421
+ var h1 = crypto2.createHmac(hashAlg, secret);
37422
37422
  h1.update(hmac.digest());
37423
37423
  h1 = h1.digest();
37424
- var h2 = crypto.createHmac(hashAlg, secret);
37424
+ var h2 = crypto2.createHmac(hashAlg, secret);
37425
37425
  h2.update(new Buffer(parsedSignature.params.signature, "base64"));
37426
37426
  h2 = h2.digest();
37427
37427
  if (typeof h1 === "string")
@@ -55216,9 +55216,9 @@ var require_har2 = __commonJS({
55216
55216
  // ../../node_modules/uuid/lib/rng.js
55217
55217
  var require_rng = __commonJS({
55218
55218
  "../../node_modules/uuid/lib/rng.js"(exports, module2) {
55219
- var crypto = require("crypto");
55219
+ var crypto2 = require("crypto");
55220
55220
  module2.exports = function nodeRNG() {
55221
- return crypto.randomBytes(16);
55221
+ return crypto2.randomBytes(16);
55222
55222
  };
55223
55223
  }
55224
55224
  });
@@ -55424,12 +55424,12 @@ var require_auth = __commonJS({
55424
55424
  // ../../node_modules/oauth-sign/index.js
55425
55425
  var require_oauth_sign = __commonJS({
55426
55426
  "../../node_modules/oauth-sign/index.js"(exports) {
55427
- var crypto = require("crypto");
55427
+ var crypto2 = require("crypto");
55428
55428
  function sha(key, body, algorithm) {
55429
- return crypto.createHmac(algorithm, key).update(body).digest("base64");
55429
+ return crypto2.createHmac(algorithm, key).update(body).digest("base64");
55430
55430
  }
55431
55431
  function rsa(key, body) {
55432
- return crypto.createSign("RSA-SHA1").update(body).sign(key, "base64");
55432
+ return crypto2.createSign("RSA-SHA1").update(body).sign(key, "base64");
55433
55433
  }
55434
55434
  function rfc3986(str) {
55435
55435
  return encodeURIComponent(str).replace(/!/g, "%21").replace(/\*/g, "%2A").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/'/g, "%27");
@@ -55536,7 +55536,7 @@ var require_oauth = __commonJS({
55536
55536
  var caseless = require_caseless();
55537
55537
  var uuid = require_v4();
55538
55538
  var oauth = require_oauth_sign();
55539
- var crypto = require("crypto");
55539
+ var crypto2 = require("crypto");
55540
55540
  var Buffer2 = require_safe_buffer().Buffer;
55541
55541
  function OAuth(request) {
55542
55542
  this.request = request;
@@ -55588,7 +55588,7 @@ var require_oauth = __commonJS({
55588
55588
  if (["HMAC-SHA1", "RSA-SHA1"].indexOf(_oauth.signature_method || "HMAC-SHA1") < 0) {
55589
55589
  this.request.emit("error", new Error("oauth: " + _oauth.signature_method + " signature_method not supported with body_hash signing."));
55590
55590
  }
55591
- var shasum = crypto.createHash("sha1");
55591
+ var shasum = crypto2.createHash("sha1");
55592
55592
  shasum.update(body || "");
55593
55593
  var sha1 = shasum.digest("hex");
55594
55594
  return Buffer2.from(sha1, "hex").toString("base64");
@@ -55657,15 +55657,15 @@ var require_oauth = __commonJS({
55657
55657
  var require_hawk = __commonJS({
55658
55658
  "../../node_modules/request/lib/hawk.js"(exports) {
55659
55659
  "use strict";
55660
- var crypto = require("crypto");
55660
+ var crypto2 = require("crypto");
55661
55661
  function randomString(size) {
55662
55662
  var bits = (size + 1) * 6;
55663
- var buffer = crypto.randomBytes(Math.ceil(bits / 8));
55663
+ var buffer = crypto2.randomBytes(Math.ceil(bits / 8));
55664
55664
  var string = buffer.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
55665
55665
  return string.slice(0, size);
55666
55666
  }
55667
55667
  function calculatePayloadHash(payload, algorithm, contentType) {
55668
- var hash = crypto.createHash(algorithm);
55668
+ var hash = crypto2.createHash(algorithm);
55669
55669
  hash.update("hawk.1.payload\n");
55670
55670
  hash.update((contentType ? contentType.split(";")[0].trim().toLowerCase() : "") + "\n");
55671
55671
  hash.update(payload || "");
@@ -55681,7 +55681,7 @@ var require_hawk = __commonJS({
55681
55681
  if (opts.app) {
55682
55682
  normalized = normalized + opts.app + "\n" + (opts.dlg || "") + "\n";
55683
55683
  }
55684
- var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized);
55684
+ var hmac = crypto2.createHmac(credentials.algorithm, credentials.key).update(normalized);
55685
55685
  var digest = hmac.digest("base64");
55686
55686
  return digest;
55687
55687
  };
@@ -61998,6 +61998,7 @@ var src_exports = {};
61998
61998
  __export(src_exports, {
61999
61999
  Blob: () => Blob_,
62000
62000
  File: () => File_,
62001
+ installFilePolyfills: () => installFilePolyfills,
62001
62002
  makeNodeStream: () => makeNodeStream,
62002
62003
  nodeVersion: () => nodeVersion
62003
62004
  });
@@ -63710,6 +63711,30 @@ function getPixelsAsync(buffer, mimeType) {
63710
63711
  );
63711
63712
  }
63712
63713
 
63714
+ // ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts
63715
+ function concatenateArrayBuffers(...sources) {
63716
+ const sourceArrays = sources.map(
63717
+ (source2) => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2
63718
+ );
63719
+ const byteLength = sourceArrays.reduce((length, typedArray) => length + typedArray.byteLength, 0);
63720
+ const result = new Uint8Array(byteLength);
63721
+ let offset = 0;
63722
+ for (const sourceArray of sourceArrays) {
63723
+ result.set(sourceArray, offset);
63724
+ offset += sourceArray.byteLength;
63725
+ }
63726
+ return result.buffer;
63727
+ }
63728
+
63729
+ // ../loader-utils/src/lib/iterators/async-iteration.ts
63730
+ async function concatenateArrayBuffersAsync(asyncIterator) {
63731
+ const arrayBuffers = [];
63732
+ for await (const chunk of asyncIterator) {
63733
+ arrayBuffers.push(chunk);
63734
+ }
63735
+ return concatenateArrayBuffers(...arrayBuffers);
63736
+ }
63737
+
63713
63738
  // ../loader-utils/src/lib/path-utils/file-aliases.ts
63714
63739
  var pathPrefix = "";
63715
63740
  var fileAliases = {};
@@ -63841,12 +63866,12 @@ async function concatenateReadStream(readStream) {
63841
63866
  arrayBufferChunks.push(toArrayBuffer(chunk));
63842
63867
  });
63843
63868
  readStream.on("end", () => {
63844
- const arrayBuffer = concatenateArrayBuffers(arrayBufferChunks);
63869
+ const arrayBuffer = concatenateArrayBuffers2(arrayBufferChunks);
63845
63870
  resolve(arrayBuffer);
63846
63871
  });
63847
63872
  });
63848
63873
  }
63849
- function concatenateArrayBuffers(sources) {
63874
+ function concatenateArrayBuffers2(sources) {
63850
63875
  const sourceArrays = sources.map(
63851
63876
  (source2) => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2
63852
63877
  );
@@ -63974,6 +63999,77 @@ var NodeFileSystem = class {
63974
63999
  }
63975
64000
  };
63976
64001
 
64002
+ // ../crypto/src/lib/hash.ts
64003
+ var Hash = class {
64004
+ constructor(options = {}) {
64005
+ this.hashBatches = this.hashBatches.bind(this);
64006
+ }
64007
+ async preload() {
64008
+ return;
64009
+ }
64010
+ async *hashBatches(asyncIterator, encoding = "base64") {
64011
+ var _a, _b;
64012
+ const arrayBuffers = [];
64013
+ for await (const arrayBuffer of asyncIterator) {
64014
+ arrayBuffers.push(arrayBuffer);
64015
+ yield arrayBuffer;
64016
+ }
64017
+ const output = await this.concatenate(arrayBuffers);
64018
+ const hash = await this.hash(output, encoding);
64019
+ (_b = (_a = this.options.crypto) == null ? void 0 : _a.onEnd) == null ? void 0 : _b.call(_a, { hash });
64020
+ }
64021
+ // HELPERS
64022
+ async concatenate(asyncIterator) {
64023
+ return await concatenateArrayBuffersAsync(asyncIterator);
64024
+ }
64025
+ };
64026
+
64027
+ // src/crypto/node-hash.ts
64028
+ var crypto = __toESM(require("crypto"), 1);
64029
+ var NodeHash = class extends Hash {
64030
+ constructor(options) {
64031
+ var _a, _b;
64032
+ super();
64033
+ this.name = "crypto-node";
64034
+ this.options = options;
64035
+ if (!((_b = (_a = this.options) == null ? void 0 : _a.crypto) == null ? void 0 : _b.algorithm)) {
64036
+ throw new Error(this.name);
64037
+ }
64038
+ }
64039
+ /**
64040
+ * Atomic hash calculation
64041
+ * @returns base64 encoded hash
64042
+ */
64043
+ async hash(input, encoding) {
64044
+ var _a, _b, _c, _d;
64045
+ const algorithm = (_c = (_b = (_a = this.options) == null ? void 0 : _a.crypto) == null ? void 0 : _b.algorithm) == null ? void 0 : _c.toLowerCase();
64046
+ try {
64047
+ if (!crypto.createHash) {
64048
+ throw new Error("crypto.createHash not available");
64049
+ }
64050
+ const hash = (_d = crypto.createHash) == null ? void 0 : _d(algorithm);
64051
+ const inputArray = new Uint8Array(input);
64052
+ return hash.update(inputArray).digest("base64");
64053
+ } catch (error) {
64054
+ throw Error(`${algorithm} hash not available. ${error}`);
64055
+ }
64056
+ }
64057
+ async *hashBatches(asyncIterator, encoding = "base64") {
64058
+ var _a, _b, _c, _d, _e, _f, _g;
64059
+ if (!crypto.createHash) {
64060
+ throw new Error("crypto.createHash not available");
64061
+ }
64062
+ const hash = (_d = crypto.createHash) == null ? void 0 : _d((_c = (_b = (_a = this.options) == null ? void 0 : _a.crypto) == null ? void 0 : _b.algorithm) == null ? void 0 : _c.toLowerCase());
64063
+ for await (const chunk of asyncIterator) {
64064
+ const inputArray = new Uint8Array(chunk);
64065
+ hash.update(inputArray);
64066
+ yield chunk;
64067
+ }
64068
+ const digest = hash.digest(encoding);
64069
+ (_g = (_f = (_e = this.options) == null ? void 0 : _e.crypto) == null ? void 0 : _f.onEnd) == null ? void 0 : _g.call(_f, { hash: digest });
64070
+ }
64071
+ };
64072
+
63977
64073
  // src/index.ts
63978
64074
  var import_node_process = require("node:process");
63979
64075
 
@@ -64705,6 +64801,7 @@ globalThis.loaders.makeNodeStream = makeNodeStream;
64705
64801
  globalThis.loaders.NodeFile = NodeFile;
64706
64802
  globalThis.loaders.NodeFileSystem = NodeFileSystem;
64707
64803
  globalThis.loaders.fetchNode = fetchNode;
64804
+ globalThis.loaders.NodeHash = NodeHash;
64708
64805
  if (!globalThis.TextEncoder) {
64709
64806
  globalThis.TextEncoder = TextEncoder2;
64710
64807
  }
@@ -64741,6 +64838,7 @@ if (nodeVersion < 18) {
64741
64838
  0 && (module.exports = {
64742
64839
  Blob,
64743
64840
  File,
64841
+ installFilePolyfills,
64744
64842
  makeNodeStream,
64745
64843
  nodeVersion
64746
64844
  });