chunk-4NTX3REN.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. import {
  2. __commonJS,
  3. __require
  4. } from "./chunk-2LSFTFF7.js";
  5. // browser-external:crypto
  6. var require_crypto = __commonJS({
  7. "browser-external:crypto"(exports, module) {
  8. module.exports = Object.create(new Proxy({}, {
  9. get(_, key) {
  10. if (key !== "__esModule" && key !== "__proto__" && key !== "constructor" && key !== "splice") {
  11. console.warn(`Module "crypto" has been externalized for browser compatibility. Cannot access "crypto.${key}" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.`);
  12. }
  13. }
  14. }));
  15. }
  16. });
  17. // node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/core.js
  18. var require_core = __commonJS({
  19. "node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/core.js"(exports, module) {
  20. (function(root, factory) {
  21. if (typeof exports === "object") {
  22. module.exports = exports = factory();
  23. } else if (typeof define === "function" && define.amd) {
  24. define([], factory);
  25. } else {
  26. root.CryptoJS = factory();
  27. }
  28. })(exports, function() {
  29. var CryptoJS = CryptoJS || function(Math2, undefined) {
  30. var crypto;
  31. if (typeof window !== "undefined" && window.crypto) {
  32. crypto = window.crypto;
  33. }
  34. if (typeof self !== "undefined" && self.crypto) {
  35. crypto = self.crypto;
  36. }
  37. if (typeof globalThis !== "undefined" && globalThis.crypto) {
  38. crypto = globalThis.crypto;
  39. }
  40. if (!crypto && typeof window !== "undefined" && window.msCrypto) {
  41. crypto = window.msCrypto;
  42. }
  43. if (!crypto && typeof global !== "undefined" && global.crypto) {
  44. crypto = global.crypto;
  45. }
  46. if (!crypto && typeof __require === "function") {
  47. try {
  48. crypto = require_crypto();
  49. } catch (err) {
  50. }
  51. }
  52. var cryptoSecureRandomInt = function() {
  53. if (crypto) {
  54. if (typeof crypto.getRandomValues === "function") {
  55. try {
  56. return crypto.getRandomValues(new Uint32Array(1))[0];
  57. } catch (err) {
  58. }
  59. }
  60. if (typeof crypto.randomBytes === "function") {
  61. try {
  62. return crypto.randomBytes(4).readInt32LE();
  63. } catch (err) {
  64. }
  65. }
  66. }
  67. throw new Error("Native crypto module could not be used to get secure random number.");
  68. };
  69. var create = Object.create || function() {
  70. function F() {
  71. }
  72. return function(obj) {
  73. var subtype;
  74. F.prototype = obj;
  75. subtype = new F();
  76. F.prototype = null;
  77. return subtype;
  78. };
  79. }();
  80. var C = {};
  81. var C_lib = C.lib = {};
  82. var Base = C_lib.Base = function() {
  83. return {
  84. /**
  85. * Creates a new object that inherits from this object.
  86. *
  87. * @param {Object} overrides Properties to copy into the new object.
  88. *
  89. * @return {Object} The new object.
  90. *
  91. * @static
  92. *
  93. * @example
  94. *
  95. * var MyType = CryptoJS.lib.Base.extend({
  96. * field: 'value',
  97. *
  98. * method: function () {
  99. * }
  100. * });
  101. */
  102. extend: function(overrides) {
  103. var subtype = create(this);
  104. if (overrides) {
  105. subtype.mixIn(overrides);
  106. }
  107. if (!subtype.hasOwnProperty("init") || this.init === subtype.init) {
  108. subtype.init = function() {
  109. subtype.$super.init.apply(this, arguments);
  110. };
  111. }
  112. subtype.init.prototype = subtype;
  113. subtype.$super = this;
  114. return subtype;
  115. },
  116. /**
  117. * Extends this object and runs the init method.
  118. * Arguments to create() will be passed to init().
  119. *
  120. * @return {Object} The new object.
  121. *
  122. * @static
  123. *
  124. * @example
  125. *
  126. * var instance = MyType.create();
  127. */
  128. create: function() {
  129. var instance = this.extend();
  130. instance.init.apply(instance, arguments);
  131. return instance;
  132. },
  133. /**
  134. * Initializes a newly created object.
  135. * Override this method to add some logic when your objects are created.
  136. *
  137. * @example
  138. *
  139. * var MyType = CryptoJS.lib.Base.extend({
  140. * init: function () {
  141. * // ...
  142. * }
  143. * });
  144. */
  145. init: function() {
  146. },
  147. /**
  148. * Copies properties into this object.
  149. *
  150. * @param {Object} properties The properties to mix in.
  151. *
  152. * @example
  153. *
  154. * MyType.mixIn({
  155. * field: 'value'
  156. * });
  157. */
  158. mixIn: function(properties) {
  159. for (var propertyName in properties) {
  160. if (properties.hasOwnProperty(propertyName)) {
  161. this[propertyName] = properties[propertyName];
  162. }
  163. }
  164. if (properties.hasOwnProperty("toString")) {
  165. this.toString = properties.toString;
  166. }
  167. },
  168. /**
  169. * Creates a copy of this object.
  170. *
  171. * @return {Object} The clone.
  172. *
  173. * @example
  174. *
  175. * var clone = instance.clone();
  176. */
  177. clone: function() {
  178. return this.init.prototype.extend(this);
  179. }
  180. };
  181. }();
  182. var WordArray = C_lib.WordArray = Base.extend({
  183. /**
  184. * Initializes a newly created word array.
  185. *
  186. * @param {Array} words (Optional) An array of 32-bit words.
  187. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  188. *
  189. * @example
  190. *
  191. * var wordArray = CryptoJS.lib.WordArray.create();
  192. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
  193. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
  194. */
  195. init: function(words, sigBytes) {
  196. words = this.words = words || [];
  197. if (sigBytes != undefined) {
  198. this.sigBytes = sigBytes;
  199. } else {
  200. this.sigBytes = words.length * 4;
  201. }
  202. },
  203. /**
  204. * Converts this word array to a string.
  205. *
  206. * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
  207. *
  208. * @return {string} The stringified word array.
  209. *
  210. * @example
  211. *
  212. * var string = wordArray + '';
  213. * var string = wordArray.toString();
  214. * var string = wordArray.toString(CryptoJS.enc.Utf8);
  215. */
  216. toString: function(encoder) {
  217. return (encoder || Hex).stringify(this);
  218. },
  219. /**
  220. * Concatenates a word array to this word array.
  221. *
  222. * @param {WordArray} wordArray The word array to append.
  223. *
  224. * @return {WordArray} This word array.
  225. *
  226. * @example
  227. *
  228. * wordArray1.concat(wordArray2);
  229. */
  230. concat: function(wordArray) {
  231. var thisWords = this.words;
  232. var thatWords = wordArray.words;
  233. var thisSigBytes = this.sigBytes;
  234. var thatSigBytes = wordArray.sigBytes;
  235. this.clamp();
  236. if (thisSigBytes % 4) {
  237. for (var i = 0; i < thatSigBytes; i++) {
  238. var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  239. thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;
  240. }
  241. } else {
  242. for (var j = 0; j < thatSigBytes; j += 4) {
  243. thisWords[thisSigBytes + j >>> 2] = thatWords[j >>> 2];
  244. }
  245. }
  246. this.sigBytes += thatSigBytes;
  247. return this;
  248. },
  249. /**
  250. * Removes insignificant bits.
  251. *
  252. * @example
  253. *
  254. * wordArray.clamp();
  255. */
  256. clamp: function() {
  257. var words = this.words;
  258. var sigBytes = this.sigBytes;
  259. words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8;
  260. words.length = Math2.ceil(sigBytes / 4);
  261. },
  262. /**
  263. * Creates a copy of this word array.
  264. *
  265. * @return {WordArray} The clone.
  266. *
  267. * @example
  268. *
  269. * var clone = wordArray.clone();
  270. */
  271. clone: function() {
  272. var clone = Base.clone.call(this);
  273. clone.words = this.words.slice(0);
  274. return clone;
  275. },
  276. /**
  277. * Creates a word array filled with random bytes.
  278. *
  279. * @param {number} nBytes The number of random bytes to generate.
  280. *
  281. * @return {WordArray} The random word array.
  282. *
  283. * @static
  284. *
  285. * @example
  286. *
  287. * var wordArray = CryptoJS.lib.WordArray.random(16);
  288. */
  289. random: function(nBytes) {
  290. var words = [];
  291. for (var i = 0; i < nBytes; i += 4) {
  292. words.push(cryptoSecureRandomInt());
  293. }
  294. return new WordArray.init(words, nBytes);
  295. }
  296. });
  297. var C_enc = C.enc = {};
  298. var Hex = C_enc.Hex = {
  299. /**
  300. * Converts a word array to a hex string.
  301. *
  302. * @param {WordArray} wordArray The word array.
  303. *
  304. * @return {string} The hex string.
  305. *
  306. * @static
  307. *
  308. * @example
  309. *
  310. * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
  311. */
  312. stringify: function(wordArray) {
  313. var words = wordArray.words;
  314. var sigBytes = wordArray.sigBytes;
  315. var hexChars = [];
  316. for (var i = 0; i < sigBytes; i++) {
  317. var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  318. hexChars.push((bite >>> 4).toString(16));
  319. hexChars.push((bite & 15).toString(16));
  320. }
  321. return hexChars.join("");
  322. },
  323. /**
  324. * Converts a hex string to a word array.
  325. *
  326. * @param {string} hexStr The hex string.
  327. *
  328. * @return {WordArray} The word array.
  329. *
  330. * @static
  331. *
  332. * @example
  333. *
  334. * var wordArray = CryptoJS.enc.Hex.parse(hexString);
  335. */
  336. parse: function(hexStr) {
  337. var hexStrLength = hexStr.length;
  338. var words = [];
  339. for (var i = 0; i < hexStrLength; i += 2) {
  340. words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;
  341. }
  342. return new WordArray.init(words, hexStrLength / 2);
  343. }
  344. };
  345. var Latin1 = C_enc.Latin1 = {
  346. /**
  347. * Converts a word array to a Latin1 string.
  348. *
  349. * @param {WordArray} wordArray The word array.
  350. *
  351. * @return {string} The Latin1 string.
  352. *
  353. * @static
  354. *
  355. * @example
  356. *
  357. * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
  358. */
  359. stringify: function(wordArray) {
  360. var words = wordArray.words;
  361. var sigBytes = wordArray.sigBytes;
  362. var latin1Chars = [];
  363. for (var i = 0; i < sigBytes; i++) {
  364. var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  365. latin1Chars.push(String.fromCharCode(bite));
  366. }
  367. return latin1Chars.join("");
  368. },
  369. /**
  370. * Converts a Latin1 string to a word array.
  371. *
  372. * @param {string} latin1Str The Latin1 string.
  373. *
  374. * @return {WordArray} The word array.
  375. *
  376. * @static
  377. *
  378. * @example
  379. *
  380. * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
  381. */
  382. parse: function(latin1Str) {
  383. var latin1StrLength = latin1Str.length;
  384. var words = [];
  385. for (var i = 0; i < latin1StrLength; i++) {
  386. words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8;
  387. }
  388. return new WordArray.init(words, latin1StrLength);
  389. }
  390. };
  391. var Utf8 = C_enc.Utf8 = {
  392. /**
  393. * Converts a word array to a UTF-8 string.
  394. *
  395. * @param {WordArray} wordArray The word array.
  396. *
  397. * @return {string} The UTF-8 string.
  398. *
  399. * @static
  400. *
  401. * @example
  402. *
  403. * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
  404. */
  405. stringify: function(wordArray) {
  406. try {
  407. return decodeURIComponent(escape(Latin1.stringify(wordArray)));
  408. } catch (e) {
  409. throw new Error("Malformed UTF-8 data");
  410. }
  411. },
  412. /**
  413. * Converts a UTF-8 string to a word array.
  414. *
  415. * @param {string} utf8Str The UTF-8 string.
  416. *
  417. * @return {WordArray} The word array.
  418. *
  419. * @static
  420. *
  421. * @example
  422. *
  423. * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
  424. */
  425. parse: function(utf8Str) {
  426. return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
  427. }
  428. };
  429. var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
  430. /**
  431. * Resets this block algorithm's data buffer to its initial state.
  432. *
  433. * @example
  434. *
  435. * bufferedBlockAlgorithm.reset();
  436. */
  437. reset: function() {
  438. this._data = new WordArray.init();
  439. this._nDataBytes = 0;
  440. },
  441. /**
  442. * Adds new data to this block algorithm's buffer.
  443. *
  444. * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
  445. *
  446. * @example
  447. *
  448. * bufferedBlockAlgorithm._append('data');
  449. * bufferedBlockAlgorithm._append(wordArray);
  450. */
  451. _append: function(data) {
  452. if (typeof data == "string") {
  453. data = Utf8.parse(data);
  454. }
  455. this._data.concat(data);
  456. this._nDataBytes += data.sigBytes;
  457. },
  458. /**
  459. * Processes available data blocks.
  460. *
  461. * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
  462. *
  463. * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
  464. *
  465. * @return {WordArray} The processed data.
  466. *
  467. * @example
  468. *
  469. * var processedData = bufferedBlockAlgorithm._process();
  470. * var processedData = bufferedBlockAlgorithm._process(!!'flush');
  471. */
  472. _process: function(doFlush) {
  473. var processedWords;
  474. var data = this._data;
  475. var dataWords = data.words;
  476. var dataSigBytes = data.sigBytes;
  477. var blockSize = this.blockSize;
  478. var blockSizeBytes = blockSize * 4;
  479. var nBlocksReady = dataSigBytes / blockSizeBytes;
  480. if (doFlush) {
  481. nBlocksReady = Math2.ceil(nBlocksReady);
  482. } else {
  483. nBlocksReady = Math2.max((nBlocksReady | 0) - this._minBufferSize, 0);
  484. }
  485. var nWordsReady = nBlocksReady * blockSize;
  486. var nBytesReady = Math2.min(nWordsReady * 4, dataSigBytes);
  487. if (nWordsReady) {
  488. for (var offset = 0; offset < nWordsReady; offset += blockSize) {
  489. this._doProcessBlock(dataWords, offset);
  490. }
  491. processedWords = dataWords.splice(0, nWordsReady);
  492. data.sigBytes -= nBytesReady;
  493. }
  494. return new WordArray.init(processedWords, nBytesReady);
  495. },
  496. /**
  497. * Creates a copy of this object.
  498. *
  499. * @return {Object} The clone.
  500. *
  501. * @example
  502. *
  503. * var clone = bufferedBlockAlgorithm.clone();
  504. */
  505. clone: function() {
  506. var clone = Base.clone.call(this);
  507. clone._data = this._data.clone();
  508. return clone;
  509. },
  510. _minBufferSize: 0
  511. });
  512. var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
  513. /**
  514. * Configuration options.
  515. */
  516. cfg: Base.extend(),
  517. /**
  518. * Initializes a newly created hasher.
  519. *
  520. * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
  521. *
  522. * @example
  523. *
  524. * var hasher = CryptoJS.algo.SHA256.create();
  525. */
  526. init: function(cfg) {
  527. this.cfg = this.cfg.extend(cfg);
  528. this.reset();
  529. },
  530. /**
  531. * Resets this hasher to its initial state.
  532. *
  533. * @example
  534. *
  535. * hasher.reset();
  536. */
  537. reset: function() {
  538. BufferedBlockAlgorithm.reset.call(this);
  539. this._doReset();
  540. },
  541. /**
  542. * Updates this hasher with a message.
  543. *
  544. * @param {WordArray|string} messageUpdate The message to append.
  545. *
  546. * @return {Hasher} This hasher.
  547. *
  548. * @example
  549. *
  550. * hasher.update('message');
  551. * hasher.update(wordArray);
  552. */
  553. update: function(messageUpdate) {
  554. this._append(messageUpdate);
  555. this._process();
  556. return this;
  557. },
  558. /**
  559. * Finalizes the hash computation.
  560. * Note that the finalize operation is effectively a destructive, read-once operation.
  561. *
  562. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  563. *
  564. * @return {WordArray} The hash.
  565. *
  566. * @example
  567. *
  568. * var hash = hasher.finalize();
  569. * var hash = hasher.finalize('message');
  570. * var hash = hasher.finalize(wordArray);
  571. */
  572. finalize: function(messageUpdate) {
  573. if (messageUpdate) {
  574. this._append(messageUpdate);
  575. }
  576. var hash = this._doFinalize();
  577. return hash;
  578. },
  579. blockSize: 512 / 32,
  580. /**
  581. * Creates a shortcut function to a hasher's object interface.
  582. *
  583. * @param {Hasher} hasher The hasher to create a helper for.
  584. *
  585. * @return {Function} The shortcut function.
  586. *
  587. * @static
  588. *
  589. * @example
  590. *
  591. * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
  592. */
  593. _createHelper: function(hasher) {
  594. return function(message, cfg) {
  595. return new hasher.init(cfg).finalize(message);
  596. };
  597. },
  598. /**
  599. * Creates a shortcut function to the HMAC's object interface.
  600. *
  601. * @param {Hasher} hasher The hasher to use in this HMAC helper.
  602. *
  603. * @return {Function} The shortcut function.
  604. *
  605. * @static
  606. *
  607. * @example
  608. *
  609. * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
  610. */
  611. _createHmacHelper: function(hasher) {
  612. return function(message, key) {
  613. return new C_algo.HMAC.init(hasher, key).finalize(message);
  614. };
  615. }
  616. });
  617. var C_algo = C.algo = {};
  618. return C;
  619. }(Math);
  620. return CryptoJS;
  621. });
  622. }
  623. });
  624. export {
  625. require_core
  626. };
  627. //# sourceMappingURL=chunk-4NTX3REN.js.map