diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f2de0d..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = { - root: true, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "./tsconfig.json", - }, - ignorePatterns: ["*.txt", "/dist", "/test/dist", ".eslintrc.js"], - plugins: ["@typescript-eslint"], - overrides: [ - { - files: ["*.js", "*.mjs"], - rules: { - "@typescript-eslint/explicit-function-return-type": "off", - }, - }, - { - files: ["test/**"], - rules: { - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-return": "off", - }, - }, - ], - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - ], - rules: { - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/camelcase": "off", - "@typescript-eslint/class-name-casing": "off", - "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], - }, -}; diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 287a025..f05ee8e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: - node-version: 21 + node-version: "lts/*" - uses: browser-actions/setup-chrome@v1 - uses: browser-actions/setup-firefox@v1 - name: Install dependencies diff --git a/dist/sha.js b/dist/sha.js index 65dc584..83127c6 100644 --- a/dist/sha.js +++ b/dist/sha.js @@ -2,7 +2,7 @@ * A JavaScript implementation of the SHA family of hashes - defined in FIPS PUB 180-4, FIPS PUB 202, * and SP 800-185 - as well as the corresponding HMAC implementation as defined in FIPS PUB 198-1. * - * Copyright 2008-2023 Brian Turek, 1998-2009 Paul Johnston & Contributors + * Copyright 2008-2024 Brian Turek, 1998-2009 Paul Johnston & Contributors * Distributed under the BSD License * See http://caligatio.github.com/jsSHA/ for more information * @@ -14,9 +14,9 @@ * * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, * INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - * MERCHANTABLITY OR NON-INFRINGEMENT. + * MERCHANTABILITY OR NON-INFRINGEMENT. * * See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. */ -!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).jsSHA=r()}(this,(function(){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="ARRAYBUFFER not supported by this environment",t="UINT8ARRAY not supported by this environment";function e(n,r,t,e){var i,o,u,f=r||[0],s=(t=t||0)>>>3,w=-1===e?3:0;for(i=0;i>>2,f.length<=o&&f.push(0),f[o]|=n[i]<<8*(w+e*(u%4));return{value:f,binLen:8*n.length+t}}function i(i,o,u){switch(o){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(i){case"HEX":return function(n,r,t){return function(n,r,t,e){var i,o,u,f;if(0!=n.length%2)throw new Error("String of HEX type must be in byte increments");var s=r||[0],w=(t=t||0)>>>3,a=-1===e?3:0;for(i=0;i>>1)+w)>>>2;s.length<=u;)s.push(0);s[u]|=o<<8*(a+e*(f%4))}return{value:s,binLen:4*n.length+t}}(n,r,t,u)};case"TEXT":return function(n,r,t){return function(n,r,t,e,i){var o,u,f,s,w,a,h,c,v=0,A=t||[0],E=(e=e||0)>>>3;if("UTF8"===r)for(h=-1===i?3:0,f=0;f(o=n.charCodeAt(f))?u.push(o):2048>o?(u.push(192|o>>>6),u.push(128|63&o)):55296>o||57344<=o?u.push(224|o>>>12,128|o>>>6&63,128|63&o):(f+=1,o=65536+((1023&o)<<10|1023&n.charCodeAt(f)),u.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),s=0;s>>2;A.length<=w;)A.push(0);A[w]|=u[s]<<8*(h+i*(a%4)),v+=1}else for(h=-1===i?2:0,c="UTF16LE"===r&&1!==i||"UTF16LE"!==r&&1===i,f=0;f>>8),w=(a=v+E)>>>2;A.length<=w;)A.push(0);A[w]|=o<<8*(h+i*(a%4)),v+=2}return{value:A,binLen:8*v+e}}(n,o,r,t,u)};case"B64":return function(r,t,e){return function(r,t,e,i){var o,u,f,s,w,a,h=0,c=t||[0],v=(e=e||0)>>>3,A=-1===i?3:0,E=r.indexOf("=");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(r=r.replace(/=/g,""),-1!==E&&E>>2;c.length<=w;)c.push(0);c[w]|=(f>>>16-8*u&255)<<8*(A+i*(a%4)),h+=1}}return{value:c,binLen:8*h+e}}(r,t,e,u)};case"BYTES":return function(n,r,t){return function(n,r,t,e){var i,o,u,f,s=r||[0],w=(t=t||0)>>>3,a=-1===e?3:0;for(o=0;o>>2,s.length<=u&&s.push(0),s[u]|=i<<8*(a+e*(f%4));return{value:s,binLen:8*n.length+t}}(n,r,t,u)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(n){throw new Error(r)}return function(n,r,t){return function(n,r,t,i){return e(new Uint8Array(n),r,t,i)}(n,r,t,u)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(n){throw new Error(t)}return function(n,r,t){return e(n,r,t,u)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function o(e,i,o,u){switch(e){case"HEX":return function(n){return function(n,r,t,e){var i,o,u="0123456789abcdef",f="",s=r/8,w=-1===t?3:0;for(i=0;i>>2]>>>8*(w+t*(i%4)),f+=u.charAt(o>>>4&15)+u.charAt(15&o);return e.outputUpper?f.toUpperCase():f}(n,i,o,u)};case"B64":return function(r){return function(r,t,e,i){var o,u,f,s,w,a="",h=t/8,c=-1===e?3:0;for(o=0;o>>2]:0,w=o+2>>2]:0,f=(r[o>>>2]>>>8*(c+e*(o%4))&255)<<16|(s>>>8*(c+e*((o+1)%4))&255)<<8|w>>>8*(c+e*((o+2)%4))&255,u=0;u<4;u+=1)a+=8*o+6*u<=t?n.charAt(f>>>6*(3-u)&63):i.b64Pad;return a}(r,i,o,u)};case"BYTES":return function(n){return function(n,r,t){var e,i,o="",u=r/8,f=-1===t?3:0;for(e=0;e>>2]>>>8*(f+t*(e%4))&255,o+=String.fromCharCode(i);return o}(n,i,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(n){throw new Error(r)}return function(n){return function(n,r,t){var e,i=r/8,o=new ArrayBuffer(i),u=new Uint8Array(o),f=-1===t?3:0;for(e=0;e>>2]>>>8*(f+t*(e%4))&255;return o}(n,i,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(n){throw new Error(t)}return function(n){return function(n,r,t){var e,i=r/8,o=-1===t?3:0,u=new Uint8Array(i);for(e=0;e>>2]>>>8*(o+t*(e%4))&255;return u}(n,i,o)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var u=4294967296,f=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],w=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],a="Chosen SHA variant is not supported",h="Cannot set numRounds with MAC";function c(n,r){var t,e,i=n.binLen>>>3,o=r.binLen>>>3,u=i<<3,f=4-i<<3;if(i%4!=0){for(t=0;t>>2,n.value[e]|=r.value[t>>>2]<>>2]>>>f;return(n.value.length<<2)-4>=o+i&&n.value.pop(),{value:n.value,binLen:n.binLen+r.binLen}}return{value:n.value.concat(r.value),binLen:n.binLen+r.binLen}}function v(n){var r={outputUpper:!1,b64Pad:"=",outputLen:-1},t=n||{},e="Output length must be a multiple of 8";if(r.outputUpper=t.outputUpper||!1,t.b64Pad&&(r.b64Pad=t.b64Pad),t.outputLen){if(t.outputLen%8!=0)throw new Error(e);r.outputLen=t.outputLen}else if(t.shakeLen){if(t.shakeLen%8!=0)throw new Error(e);r.outputLen=t.shakeLen}if("boolean"!=typeof r.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof r.b64Pad)throw new Error("Invalid b64Pad formatting option");return r}function A(n,r,t,e){var o=n+" must include a value and format";if(!r){if(!e)throw new Error(o);return e}if(void 0===r.value||!r.format)throw new Error(o);return i(r.format,r.encoding||"UTF8",t)(r.value)}var E=function(){function n(n,r,t){var e=t||{};if(this.t=r,this.i=e.encoding||"UTF8",this.numRounds=e.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=n,this.u=[],this.h=0,this.v=!1,this.A=0,this.l=!1,this.S=[],this.H=[]}return n.prototype.update=function(n){var r,t=0,e=this.p>>>5,i=this.m(n,this.u,this.h),o=i.binLen,u=i.value,f=o>>>5;for(r=0;r>>5),this.h=o%this.p,this.v=!0,this},n.prototype.getHash=function(n,r){var t,e,i=this.T,u=v(r);if(this.C){if(-1===u.outputLen)throw new Error("Output length must be specified in options");i=u.outputLen}var f=o(n,i,this.F,u);if(this.l&&this.K)return f(this.K(u));for(e=this.L(this.u.slice(),this.h,this.A,this.B(this.U),i),t=1;t>>24-i%32),e=this.L(e,i,0,this.k(this.o),i);return f(e)},n.prototype.setHMACKey=function(n,r,t){if(!this.Y)throw new Error("Variant does not support HMAC");if(this.v)throw new Error("Cannot set MAC key after calling update");var e=i(r,(t||{}).encoding||"UTF8",this.F);this.N(e(n))},n.prototype.N=function(n){var r,t=this.p>>>3,e=t/4-1;if(1!==this.numRounds)throw new Error(h);if(this.l)throw new Error("MAC key already set");for(t>>32-r}function H(n,r){return n>>>r|n<<32-r}function p(n,r){return n>>>r}function d(n,r,t){return n^r^t}function y(n,r,t){return n&r^~n&t}function m(n,r,t){return n&r^n&t^r&t}function U(n){return H(n,2)^H(n,13)^H(n,22)}function R(n,r){var t=(65535&n)+(65535&r);return(65535&(n>>>16)+(r>>>16)+(t>>>16))<<16|65535&t}function T(n,r,t,e){var i=(65535&n)+(65535&r)+(65535&t)+(65535&e);return(65535&(n>>>16)+(r>>>16)+(t>>>16)+(e>>>16)+(i>>>16))<<16|65535&i}function C(n,r,t,e,i){var o=(65535&n)+(65535&r)+(65535&t)+(65535&e)+(65535&i);return(65535&(n>>>16)+(r>>>16)+(t>>>16)+(e>>>16)+(i>>>16)+(o>>>16))<<16|65535&o}function F(n){return H(n,17)^H(n,19)^p(n,10)}function K(n){return H(n,7)^H(n,18)^p(n,3)}function g(n){return H(n,6)^H(n,11)^H(n,25)}function L(n){return[1732584193,4023233417,2562383102,271733878,3285377520]}function B(n,r){var t,e,i,o,u,f,s,w=[];for(t=r[0],e=r[1],i=r[2],o=r[3],u=r[4],s=0;s<80;s+=1)w[s]=s<16?n[s]:S(w[s-3]^w[s-8]^w[s-14]^w[s-16],1),f=s<20?C(S(t,5),y(e,i,o),u,1518500249,w[s]):s<40?C(S(t,5),d(e,i,o),u,1859775393,w[s]):s<60?C(S(t,5),m(e,i,o),u,2400959708,w[s]):C(S(t,5),d(e,i,o),u,3395469782,w[s]),u=o,o=i,i=S(e,30),e=t,t=f;return r[0]=R(t,r[0]),r[1]=R(e,r[1]),r[2]=R(i,r[2]),r[3]=R(o,r[3]),r[4]=R(u,r[4]),r}function k(n,r,t,e){for(var i,o=15+(r+65>>>9<<4),f=r+t;n.length<=o;)n.push(0);for(n[r>>>5]|=128<<24-r%32,n[o]=4294967295&f,n[o-1]=f/u|0,i=0;i>>9<<4),s=r+t;n.length<=f;)n.push(0);for(n[r>>>5]|=128<<24-r%32,n[f]=4294967295&s,n[f-1]=s/u|0,o=0;o32?(t=64-r,new X(n.X<>>t,n.M<>>t)):0!==r?(t=32-r,new X(n.M<>>t,n.X<>>t)):n}function O(n,r){var t;return r<32?(t=32-r,new X(n.M>>>r|n.X<>>r|n.M<>>r|n.M<>>r|n.X<>>r,n.X>>>r|n.M<<32-r)}function _(n,r,t){return new X(n.M&r.M^~n.M&t.M,n.X&r.X^~n.X&t.X)}function x(n,r,t){return new X(n.M&r.M^n.M&t.M^r.M&t.M,n.X&r.X^n.X&t.X^r.X&t.X)}function P(n){var r=O(n,28),t=O(n,34),e=O(n,39);return new X(r.M^t.M^e.M,r.X^t.X^e.X)}function V(n,r){var t,e;t=(65535&n.X)+(65535&r.X);var i=(65535&(e=(n.X>>>16)+(r.X>>>16)+(t>>>16)))<<16|65535&t;return t=(65535&n.M)+(65535&r.M)+(e>>>16),e=(n.M>>>16)+(r.M>>>16)+(t>>>16),new X((65535&e)<<16|65535&t,i)}function Z(n,r,t,e){var i,o;i=(65535&n.X)+(65535&r.X)+(65535&t.X)+(65535&e.X);var u=(65535&(o=(n.X>>>16)+(r.X>>>16)+(t.X>>>16)+(e.X>>>16)+(i>>>16)))<<16|65535&i;return i=(65535&n.M)+(65535&r.M)+(65535&t.M)+(65535&e.M)+(o>>>16),o=(n.M>>>16)+(r.M>>>16)+(t.M>>>16)+(e.M>>>16)+(i>>>16),new X((65535&o)<<16|65535&i,u)}function q(n,r,t,e,i){var o,u;o=(65535&n.X)+(65535&r.X)+(65535&t.X)+(65535&e.X)+(65535&i.X);var f=(65535&(u=(n.X>>>16)+(r.X>>>16)+(t.X>>>16)+(e.X>>>16)+(i.X>>>16)+(o>>>16)))<<16|65535&o;return o=(65535&n.M)+(65535&r.M)+(65535&t.M)+(65535&e.M)+(65535&i.M)+(u>>>16),u=(n.M>>>16)+(r.M>>>16)+(t.M>>>16)+(e.M>>>16)+(i.M>>>16)+(o>>>16),new X((65535&u)<<16|65535&o,f)}function D(n,r){return new X(n.M^r.M,n.X^r.X)}function G(n,r,t,e,i){return new X(n.M^r.M^t.M^e.M^i.M,n.X^r.X^t.X^e.X^i.X)}function J(n){var r=O(n,19),t=O(n,61),e=j(n,6);return new X(r.M^t.M^e.M,r.X^t.X^e.X)}function Q(n){var r=O(n,1),t=O(n,8),e=j(n,7);return new X(r.M^t.M^e.M,r.X^t.X^e.X)}function W(n){var r=O(n,14),t=O(n,18),e=O(n,41);return new X(r.M^t.M^e.M,r.X^t.X^e.X)}var $=[new X(f[0],3609767458),new X(f[1],602891725),new X(f[2],3964484399),new X(f[3],2173295548),new X(f[4],4081628472),new X(f[5],3053834265),new X(f[6],2937671579),new X(f[7],3664609560),new X(f[8],2734883394),new X(f[9],1164996542),new X(f[10],1323610764),new X(f[11],3590304994),new X(f[12],4068182383),new X(f[13],991336113),new X(f[14],633803317),new X(f[15],3479774868),new X(f[16],2666613458),new X(f[17],944711139),new X(f[18],2341262773),new X(f[19],2007800933),new X(f[20],1495990901),new X(f[21],1856431235),new X(f[22],3175218132),new X(f[23],2198950837),new X(f[24],3999719339),new X(f[25],766784016),new X(f[26],2566594879),new X(f[27],3203337956),new X(f[28],1034457026),new X(f[29],2466948901),new X(f[30],3758326383),new X(f[31],168717936),new X(f[32],1188179964),new X(f[33],1546045734),new X(f[34],1522805485),new X(f[35],2643833823),new X(f[36],2343527390),new X(f[37],1014477480),new X(f[38],1206759142),new X(f[39],344077627),new X(f[40],1290863460),new X(f[41],3158454273),new X(f[42],3505952657),new X(f[43],106217008),new X(f[44],3606008344),new X(f[45],1432725776),new X(f[46],1467031594),new X(f[47],851169720),new X(f[48],3100823752),new X(f[49],1363258195),new X(f[50],3750685593),new X(f[51],3785050280),new X(f[52],3318307427),new X(f[53],3812723403),new X(f[54],2003034995),new X(f[55],3602036899),new X(f[56],1575990012),new X(f[57],1125592928),new X(f[58],2716904306),new X(f[59],442776044),new X(f[60],593698344),new X(f[61],3733110249),new X(f[62],2999351573),new X(f[63],3815920427),new X(3391569614,3928383900),new X(3515267271,566280711),new X(3940187606,3454069534),new X(4118630271,4000239992),new X(116418474,1914138554),new X(174292421,2731055270),new X(289380356,3203993006),new X(460393269,320620315),new X(685471733,587496836),new X(852142971,1086792851),new X(1017036298,365543100),new X(1126000580,2618297676),new X(1288033470,3409855158),new X(1501505948,4234509866),new X(1607167915,987167468),new X(1816402316,1246189591)];function nn(n){return"SHA-384"===n?[new X(3418070365,s[0]),new X(1654270250,s[1]),new X(2438529370,s[2]),new X(355462360,s[3]),new X(1731405415,s[4]),new X(41048885895,s[5]),new X(3675008525,s[6]),new X(1203062813,s[7])]:[new X(w[0],4089235720),new X(w[1],2227873595),new X(w[2],4271175723),new X(w[3],1595750129),new X(w[4],2917565137),new X(w[5],725511199),new X(w[6],4215389547),new X(w[7],327033209)]}function rn(n,r){var t,e,i,o,u,f,s,w,a,h,c,v,A=[];for(t=r[0],e=r[1],i=r[2],o=r[3],u=r[4],f=r[5],s=r[6],w=r[7],c=0;c<80;c+=1)c<16?(v=2*c,A[c]=new X(n[v],n[v+1])):A[c]=Z(J(A[c-2]),A[c-7],Q(A[c-15]),A[c-16]),a=q(w,W(u),_(u,f,s),$[c],A[c]),h=V(P(t),x(t,e,i)),w=s,s=f,f=u,u=V(o,a),o=i,i=e,e=t,t=V(a,h);return r[0]=V(t,r[0]),r[1]=V(e,r[1]),r[2]=V(i,r[2]),r[3]=V(o,r[3]),r[4]=V(u,r[4]),r[5]=V(f,r[5]),r[6]=V(s,r[6]),r[7]=V(w,r[7]),r}var tn=function(n){function r(r,t,e){var o=this;if("SHA-384"!==r&&"SHA-512"!==r)throw new Error(a);var f=e||{};return(o=n.call(this,r,t,e)||this).K=o.I,o.Y=!0,o.F=-1,o.m=i(o.t,o.i,o.F),o.R=rn,o.B=function(n){return n.slice()},o.k=nn,o.L=function(n,t,e,i){return function(n,r,t,e,i){for(var o,f=31+(r+129>>>10<<5),s=r+t;n.length<=f;)n.push(0);for(n[r>>>5]|=128<<24-r%32,n[f]=4294967295&s,n[f-1]=s/u|0,o=0;o>>1)%5][(e>>>1)/5|0]=D(r[(e>>>1)%5][(e>>>1)/5|0],new X(n[e+1],n[e]));for(t=0;t<24;t+=1){for(o=un(),e=0;e<5;e+=1)u[e]=G(r[e][0],r[e][1],r[e][2],r[e][3],r[e][4]);for(e=0;e<5;e+=1)f[e]=D(u[(e+4)%5],z(u[(e+1)%5],1));for(e=0;e<5;e+=1)for(i=0;i<5;i+=1)r[e][i]=D(r[e][i],f[e]);for(e=0;e<5;e+=1)for(i=0;i<5;i+=1)o[i][(2*e+3*i)%5]=z(r[e][i],on[e][i]);for(e=0;e<5;e+=1)for(i=0;i<5;i+=1)r[e][i]=D(o[e][i],new X(~o[(e+1)%5][i].M&o[(e+2)%5][i].M,~o[(e+1)%5][i].X&o[(e+2)%5][i].X));r[0][0]=D(r[0][0],en[t])}return r}function wn(n){var r,t,e=0,i=[0,0],o=[4294967295&n,n/u&2097151];for(r=6;r>=0;r--)0===(t=o[r>>2]>>>8*r&255)&&0===e||(i[e+1>>2]|=t<<8*(e+1),e+=1);return e=0!==e?e:1,i[0]|=e,{value:e+1>4?i:[i[0]],binLen:8+8*e}}function an(n){return c(wn(n.binLen),n)}function hn(n,r){var t,e=wn(r),i=r>>>2,o=(i-(e=c(e,n)).value.length%i)%i;for(t=0;t>>5,c=r>>>5;for(f=0;f=i;f+=h)e=sn(n.slice(f,f+h),e),r-=i;for(n=n.slice(f),r%=i;n.length>>3)>>2]^=o<=u));)a.push(s.M),0==64*(w+=1)%i&&(sn(null,e),w=0);return a}(n,r,0,e,f,u,i)},s.hmacKey&&o.N(A("hmacKey",s.hmacKey,o.F)),o}return b(r,n),r.prototype._=function(n,r){var t=function(n){var r=n||{};return{funcName:A("funcName",r.funcName,1,{value:[],binLen:0}),customization:A("Customization",r.customization,1,{value:[],binLen:0})}}(n||{});r&&(t.funcName=r);var e=c(an(t.funcName),an(t.customization));if(0!==t.customization.binLen||0!==t.funcName.binLen){for(var i=hn(e,this.p>>>3),o=0;o>>5)this.U=this.R(i.slice(o,o+(this.p>>>5)),this.U),this.A+=this.p;return 4}return 31},r.prototype.O=function(n){var r=function(n){var r=n||{};return{kmacKey:A("kmacKey",r.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:A("Customization",r.customization,1,{value:[],binLen:0})}}(n||{});this._(n,r.funcName);for(var t=hn(an(r.kmacKey),this.p>>>3),e=0;e>>5)this.U=this.R(t.slice(e,e+(this.p>>>5)),this.U),this.A+=this.p;this.l=!0},r.prototype.j=function(n){var r=c({value:this.u.slice(),binLen:this.h},function(n){var r,t,e=0,i=[0,0],o=[4294967295&n,n/u&2097151];for(r=6;r>=0;r--)0==(t=o[r>>2]>>>8*r&255)&&0===e||(i[e>>2]|=t<<8*e,e+=1);return i[(e=0!==e?e:1)>>2]|=e<<8*e,{value:e+1>4?i:[i[0]],binLen:8+8*e}}(n.outputLen));return this.L(r.value,r.binLen,this.A,this.B(this.U),n.outputLen)},r}(E);return function(){function n(n,r,t){if("SHA-1"==n)this.P=new Y(n,r,t);else if("SHA-224"==n||"SHA-256"==n)this.P=new M(n,r,t);else if("SHA-384"==n||"SHA-512"==n)this.P=new tn(n,r,t);else{if("SHA3-224"!=n&&"SHA3-256"!=n&&"SHA3-384"!=n&&"SHA3-512"!=n&&"SHAKE128"!=n&&"SHAKE256"!=n&&"CSHAKE128"!=n&&"CSHAKE256"!=n&&"KMAC128"!=n&&"KMAC256"!=n)throw new Error(a);this.P=new cn(n,r,t)}}return n.prototype.update=function(n){return this.P.update(n),this},n.prototype.getHash=function(n,r){return this.P.getHash(n,r)},n.prototype.setHMACKey=function(n,r,t){this.P.setHMACKey(n,r,t)},n.prototype.getHMAC=function(n,r){return this.P.getHMAC(n,r)},n}()}); //# sourceMappingURL=sha.js.map diff --git a/dist/sha.js.map b/dist/sha.js.map index 064cedf..62b3a5b 100644 --- a/dist/sha.js.map +++ b/dist/sha.js.map @@ -1 +1 @@ -{"version":3,"file":"sha.js","sources":["../src/converters.ts","../src/common.ts","../node_modules/tslib/tslib.es6.js","../src/primitives_32.ts","../src/sha1.ts","../src/sha256.ts","../src/primitives_64.ts","../src/sha512.ts","../src/sha3.ts","../src/sha.ts"],"sourcesContent":["import { packedValue, EncodingType, FormatType } from \"./custom_types\";\n/**\n * Return type for all the *2packed functions\n */\nconst b64Tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\nconst arraybuffer_error = \"ARRAYBUFFER not supported by this environment\";\nconst uint8array_error = \"UINT8ARRAY not supported by this environment\";\n\n/**\n * Convert a string to an array of words.\n *\n * There is a known bug with an odd number of existing bytes and using a UTF-16 encoding. However, this function is\n * used such that the existing bytes are always a result of a previous UTF-16 str2packed call and therefore there \n * should never be an odd number of existing bytes.\n\n * @param str Unicode string to be converted to binary representation.\n * @param utfType The Unicode type to use to encode the source string.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked`.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction str2packed(\n str: string,\n utfType: EncodingType,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let codePnt,\n codePntArr,\n byteCnt = 0,\n i,\n j,\n intOffset,\n byteOffset,\n shiftModifier,\n transposeBytes;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3;\n\n if (\"UTF8\" === utfType) {\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n codePntArr = [];\n\n if (0x80 > codePnt) {\n codePntArr.push(codePnt);\n } else if (0x800 > codePnt) {\n codePntArr.push(0xc0 | (codePnt >>> 6));\n codePntArr.push(0x80 | (codePnt & 0x3f));\n } else if (0xd800 > codePnt || 0xe000 <= codePnt) {\n codePntArr.push(0xe0 | (codePnt >>> 12), 0x80 | ((codePnt >>> 6) & 0x3f), 0x80 | (codePnt & 0x3f));\n } else {\n i += 1;\n codePnt = 0x10000 + (((codePnt & 0x3ff) << 10) | (str.charCodeAt(i) & 0x3ff));\n codePntArr.push(\n 0xf0 | (codePnt >>> 18),\n 0x80 | ((codePnt >>> 12) & 0x3f),\n 0x80 | ((codePnt >>> 6) & 0x3f),\n 0x80 | (codePnt & 0x3f)\n );\n }\n\n for (j = 0; j < codePntArr.length; j += 1) {\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n /* Known bug kicks in here */\n packed[intOffset] |= codePntArr[j] << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 1;\n }\n }\n } else {\n /* UTF16BE or UTF16LE */\n shiftModifier = bigEndianMod === -1 ? 2 : 0;\n /* Internally strings are UTF-16BE so transpose bytes under two conditions:\n * need LE and not switching endianness due to SHA-3\n * need BE and switching endianness due to SHA-3 */\n transposeBytes = (\"UTF16LE\" === utfType && bigEndianMod !== 1) || (\"UTF16LE\" !== utfType && bigEndianMod === 1);\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n if (transposeBytes === true) {\n j = codePnt & 0xff;\n codePnt = (j << 8) | (codePnt >>> 8);\n }\n\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= codePnt << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 2;\n }\n }\n return { value: packed, binLen: byteCnt * 8 + existingPackedLen };\n}\n\n/**\n * Convert a hex string to an array of words.\n *\n * @param str Hexadecimal string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction hex2packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let i, num, intOffset, byteOffset;\n\n if (0 !== str.length % 2) {\n throw new Error(\"String of HEX type must be in byte increments\");\n }\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < str.length; i += 2) {\n num = parseInt(str.substr(i, 2), 16);\n if (!isNaN(num)) {\n byteOffset = (i >>> 1) + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= num << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n } else {\n throw new Error(\"String of HEX type contains invalid characters\");\n }\n }\n\n return { value: packed, binLen: str.length * 4 + existingPackedLen };\n}\n\n/**\n * Convert a string of raw bytes to an array of words.\n *\n * @param str String of raw bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction bytes2packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let codePnt, i, intOffset, byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n\n byteOffset = i + existingByteLen;\n intOffset = byteOffset >>> 2;\n if (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= codePnt << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n }\n\n return { value: packed, binLen: str.length * 8 + existingPackedLen };\n}\n\n/**\n * Convert a base-64 string to an array of words.\n *\n * @param str Base64-encoded string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction b642packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let byteCnt = 0,\n index,\n i,\n j,\n tmpInt,\n strPart,\n intOffset,\n byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0,\n firstEqual = str.indexOf(\"=\");\n\n if (-1 === str.search(/^[a-zA-Z0-9=+/]+$/)) {\n throw new Error(\"Invalid character in base-64 string\");\n }\n\n str = str.replace(/=/g, \"\");\n if (-1 !== firstEqual && firstEqual < str.length) {\n throw new Error(\"Invalid '=' found in base-64 string\");\n }\n\n for (i = 0; i < str.length; i += 4) {\n strPart = str.substr(i, 4);\n tmpInt = 0;\n\n for (j = 0; j < strPart.length; j += 1) {\n index = b64Tab.indexOf(strPart.charAt(j));\n tmpInt |= index << (18 - 6 * j);\n }\n\n for (j = 0; j < strPart.length - 1; j += 1) {\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |=\n ((tmpInt >>> (16 - j * 8)) & 0xff) << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 1;\n }\n }\n\n return { value: packed, binLen: byteCnt * 8 + existingPackedLen };\n}\n\n/**\n * Convert an Uint8Array to an array of words.\n *\n * @param arr Uint8Array to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction uint8array2packed(\n arr: Uint8Array,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let i, intOffset, byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < arr.length; i += 1) {\n byteOffset = i + existingByteLen;\n intOffset = byteOffset >>> 2;\n if (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= arr[i] << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n }\n\n return { value: packed, binLen: arr.length * 8 + existingPackedLen };\n}\n\n/**\n * Convert an ArrayBuffer to an array of words\n *\n * @param arr ArrayBuffer to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction arraybuffer2packed(\n arr: ArrayBuffer,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n return uint8array2packed(new Uint8Array(arr), existingPacked, existingPackedLen, bigEndianMod);\n}\n\n/**\n * Function that takes an input format and UTF encoding and returns the appropriate function used to convert the input.\n *\n * @param format The format of the input to be converted\n * @param utfType The string encoding to use for TEXT inputs.\n * @param bigEndianMod Modifier for whether hash function is big or small endian\n * @returns Function that will convert an input to a packed int array.\n */\nexport function getStrConverter(\n format: FormatType,\n utfType: EncodingType,\n bigEndianMod: -1 | 1\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n): (input: any, existingBin?: number[], existingBinLen?: number) => packedValue {\n /* Validate encoding */\n switch (utfType) {\n case \"UTF8\":\n /* Fallthrough */\n case \"UTF16BE\":\n /* Fallthrough */\n case \"UTF16LE\":\n /* Fallthrough */\n break;\n default:\n throw new Error(\"encoding must be UTF8, UTF16BE, or UTF16LE\");\n }\n\n /* Map inputFormat to the appropriate converter */\n switch (format) {\n case \"HEX\":\n /**\n * @param str String of hexadecimal bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return hex2packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"TEXT\":\n /**\n * @param str Unicode string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return str2packed(str, utfType, existingBin, existingBinLen, bigEndianMod);\n };\n case \"B64\":\n /**\n * @param str Base64-encoded string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return b642packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"BYTES\":\n /**\n * @param str String of raw bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return bytes2packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"ARRAYBUFFER\":\n try {\n new ArrayBuffer(0);\n } catch (ignore) {\n throw new Error(arraybuffer_error);\n }\n /**\n * @param arr ArrayBuffer to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (arr: ArrayBuffer, existingBin?: number[], existingBinLen?: number): packedValue {\n return arraybuffer2packed(arr, existingBin, existingBinLen, bigEndianMod);\n };\n case \"UINT8ARRAY\":\n try {\n new Uint8Array(0);\n } catch (ignore) {\n throw new Error(uint8array_error);\n }\n /**\n * @param arr Uint8Array to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (arr: Uint8Array, existingBin?: number[], existingBinLen?: number): packedValue {\n return uint8array2packed(arr, existingBin, existingBinLen, bigEndianMod);\n };\n default:\n throw new Error(\"format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\");\n }\n}\n\n/**\n * Convert an array of words to a hexadecimal string.\n *\n * toString() won't work here because it removes preceding zeros (e.g. 0x00000001.toString === \"1\" rather than\n * \"00000001\" and 0.toString(16) === \"0\" rather than \"00\").\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param formatOpts Hashmap containing validated output formatting options.\n * @returns Hexadecimal representation of `packed`.\n */\nexport function packed2hex(\n packed: number[],\n outputLength: number,\n bigEndianMod: -1 | 1,\n formatOpts: { outputUpper: boolean; b64Pad: string }\n): string {\n const hex_tab = \"0123456789abcdef\";\n let str = \"\",\n i,\n srcByte;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n /* The below is more than a byte but it gets taken care of later */\n srcByte = packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)));\n str += hex_tab.charAt((srcByte >>> 4) & 0xf) + hex_tab.charAt(srcByte & 0xf);\n }\n\n return formatOpts[\"outputUpper\"] ? str.toUpperCase() : str;\n}\n\n/**\n * Convert an array of words to a base-64 string.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param formatOpts Hashmap containing validated output formatting options.\n * @returns Base64-encoded representation of `packed`.\n */\nexport function packed2b64(\n packed: number[],\n outputLength: number,\n bigEndianMod: -1 | 1,\n formatOpts: { outputUpper: boolean; b64Pad: string }\n): string {\n let str = \"\",\n i,\n j,\n triplet,\n int1,\n int2;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 3) {\n int1 = i + 1 < length ? packed[(i + 1) >>> 2] : 0;\n int2 = i + 2 < length ? packed[(i + 2) >>> 2] : 0;\n triplet =\n (((packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff) << 16) |\n (((int1 >>> (8 * (shiftModifier + bigEndianMod * ((i + 1) % 4)))) & 0xff) << 8) |\n ((int2 >>> (8 * (shiftModifier + bigEndianMod * ((i + 2) % 4)))) & 0xff);\n for (j = 0; j < 4; j += 1) {\n if (i * 8 + j * 6 <= outputLength) {\n str += b64Tab.charAt((triplet >>> (6 * (3 - j))) & 0x3f);\n } else {\n str += formatOpts[\"b64Pad\"];\n }\n }\n }\n return str;\n}\n\n/**\n * Convert an array of words to raw bytes string.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Raw bytes representation of `packed`.\n */\nexport function packed2bytes(packed: number[], outputLength: number, bigEndianMod: -1 | 1): string {\n let str = \"\",\n i,\n srcByte;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n srcByte = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n str += String.fromCharCode(srcByte);\n }\n\n return str;\n}\n\n/**\n * Convert an array of words to an ArrayBuffer.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns An ArrayBuffer containing bytes from `packed.\n */\nexport function packed2arraybuffer(packed: number[], outputLength: number, bigEndianMod: -1 | 1): ArrayBuffer {\n let i;\n const length = outputLength / 8,\n retVal = new ArrayBuffer(length),\n arrView = new Uint8Array(retVal),\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n arrView[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n }\n\n return retVal;\n}\n\n/**\n * Convert an array of words to an Uint8Array.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns An Uint8Array containing bytes from `packed.\n */\nexport function packed2uint8array(packed: number[], outputLength: number, bigEndianMod: -1 | 1): Uint8Array {\n let i;\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0,\n retVal = new Uint8Array(length);\n\n for (i = 0; i < length; i += 1) {\n retVal[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n }\n\n return retVal;\n}\n\n/**\n * Function that takes an output format and associated parameters and returns a function that converts packed integers\n * to that format.\n *\n * @param format The desired output formatting.\n * @param outputBinLen Output length in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param outputOptions Hashmap of output formatting options\n * @returns Function that will convert a packed integer array to desired format.\n */\nexport function getOutputConverter(\n format: \"HEX\" | \"B64\" | \"BYTES\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string }\n): (binarray: number[]) => string;\nexport function getOutputConverter(\n format: \"ARRAYBUFFER\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string }\n): (binarray: number[]) => ArrayBuffer;\nexport function getOutputConverter(\n format: \"UINT8ARRAY\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string }\n): (binarray: number[]) => Uint8Array;\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nexport function getOutputConverter(format: any, outputBinLen: any, bigEndianMod: any, outputOptions: any): any {\n switch (format) {\n case \"HEX\":\n return function (binarray: number[]): string {\n return packed2hex(binarray, outputBinLen, bigEndianMod, outputOptions);\n };\n case \"B64\":\n return function (binarray: number[]): string {\n return packed2b64(binarray, outputBinLen, bigEndianMod, outputOptions);\n };\n case \"BYTES\":\n return function (binarray: number[]): string {\n return packed2bytes(binarray, outputBinLen, bigEndianMod);\n };\n case \"ARRAYBUFFER\":\n try {\n /* Need to test ArrayBuffer support */\n new ArrayBuffer(0);\n } catch (ignore) {\n throw new Error(arraybuffer_error);\n }\n return function (binarray: number[]): ArrayBuffer {\n return packed2arraybuffer(binarray, outputBinLen, bigEndianMod);\n };\n case \"UINT8ARRAY\":\n try {\n /* Need to test Uint8Array support */\n new Uint8Array(0);\n } catch (ignore) {\n throw new Error(uint8array_error);\n }\n return function (binarray: number[]): Uint8Array {\n return packed2uint8array(binarray, outputBinLen, bigEndianMod);\n };\n default:\n throw new Error(\"format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\");\n }\n}\n","import { getStrConverter, getOutputConverter } from \"./converters\";\n\nimport {\n FormatType,\n EncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n packedValue,\n GenericInputType,\n} from \"./custom_types\";\n\nexport const TWO_PWR_32 = 4294967296;\n\n/* Constant used in SHA-2 families */\nexport const K_sha2 = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98,\n 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,\n 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8,\n 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,\n 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7,\n 0xc67178f2,\n];\n\n/* Constant used in SHA-2 families */\nexport const H_trunc = [0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4];\n\n/* Constant used in SHA-2 families */\nexport const H_full = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19];\n\nexport const sha_variant_error = \"Chosen SHA variant is not supported\";\nexport const mac_rounds_error = \"Cannot set numRounds with MAC\";\n\n/**\n * Concatenates 2 packed arrays. Clobbers array `a`.\n *\n * @param a First array to concatenate.\n * @param b Second array to concatenate.\n * @returns The concatentation of `a` + `b`.\n */\nexport function packedLEConcat(a: packedValue, b: packedValue): packedValue {\n let i, arrOffset;\n const aByteLen = a[\"binLen\"] >>> 3,\n bByteLen = b[\"binLen\"] >>> 3,\n leftShiftAmount = aByteLen << 3,\n rightShiftAmount = (4 - aByteLen) << 3;\n\n /* If a only contains \"full\" integers, we can just use concat which is so much easier */\n if (aByteLen % 4 !== 0) {\n for (i = 0; i < bByteLen; i += 4) {\n arrOffset = (aByteLen + i) >>> 2;\n /* Left shift chops off bits over 32-bits */\n a[\"value\"][arrOffset] |= b[\"value\"][i >>> 2] << leftShiftAmount;\n a[\"value\"].push(0);\n a[\"value\"][arrOffset + 1] |= b[\"value\"][i >>> 2] >>> rightShiftAmount;\n }\n\n /* Since an unconditional push was performed above, we may have pushed an extra value if it could have been\n encoded without it. Check if popping an int off (reducing total length by 4 bytes) is still bigger than the\n needed size. */\n if ((a[\"value\"].length << 2) - 4 >= bByteLen + aByteLen) {\n a[\"value\"].pop();\n }\n\n return { value: a[\"value\"], binLen: a[\"binLen\"] + b[\"binLen\"] };\n } else {\n return { value: a[\"value\"].concat(b[\"value\"]), binLen: a[\"binLen\"] + b[\"binLen\"] };\n }\n}\n\n/**\n * Validate hash list containing output formatting options, ensuring presence of every option or adding the default\n * value.\n *\n * @param options Hashmap of output formatting options from user.\n * @returns Validated hashmap containing output formatting options.\n */\nexport function getOutputOpts(options?: {\n outputUpper?: boolean;\n b64Pad?: string;\n shakeLen?: number;\n outputLen?: number;\n}): { outputUpper: boolean; b64Pad: string; outputLen: number } {\n const retVal = { outputUpper: false, b64Pad: \"=\", outputLen: -1 },\n outputOptions: { outputUpper?: boolean; b64Pad?: string; shakeLen?: number; outputLen?: number } = options || {},\n lenErrstr = \"Output length must be a multiple of 8\";\n\n retVal[\"outputUpper\"] = outputOptions[\"outputUpper\"] || false;\n\n if (outputOptions[\"b64Pad\"]) {\n retVal[\"b64Pad\"] = outputOptions[\"b64Pad\"];\n }\n\n if (outputOptions[\"outputLen\"]) {\n if (outputOptions[\"outputLen\"] % 8 !== 0) {\n throw new Error(lenErrstr);\n }\n retVal[\"outputLen\"] = outputOptions[\"outputLen\"];\n } else if (outputOptions[\"shakeLen\"]) {\n if (outputOptions[\"shakeLen\"] % 8 !== 0) {\n throw new Error(lenErrstr);\n }\n retVal[\"outputLen\"] = outputOptions[\"shakeLen\"];\n }\n\n if (\"boolean\" !== typeof retVal[\"outputUpper\"]) {\n throw new Error(\"Invalid outputUpper formatting option\");\n }\n\n if (\"string\" !== typeof retVal[\"b64Pad\"]) {\n throw new Error(\"Invalid b64Pad formatting option\");\n }\n\n return retVal;\n}\n\n/**\n * Parses an external constructor object and returns a packed number, if possible.\n *\n * @param key The human-friendly key name to prefix any errors with\n * @param value The input value object to parse\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param fallback Fallback value if `value` is undefined. If not present and `value` is undefined, an Error is thrown\n */\nexport function parseInputOption(\n key: string,\n value: GenericInputType | undefined,\n bigEndianMod: -1 | 1,\n fallback?: packedValue\n): packedValue {\n const errStr = key + \" must include a value and format\";\n if (!value) {\n if (!fallback) {\n throw new Error(errStr);\n }\n return fallback;\n }\n\n if (typeof value[\"value\"] === \"undefined\" || !value[\"format\"]) {\n throw new Error(errStr);\n }\n\n return getStrConverter(\n value[\"format\"],\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - the value of encoding gets value checked by getStrConverter\n value[\"encoding\"] || \"UTF8\",\n bigEndianMod\n )(value[\"value\"]);\n}\n\nexport abstract class jsSHABase {\n /**\n * @param variant The desired SHA variant.\n * @param inputFormat The input format to be used in future `update` calls.\n * @param options Hashmap of extra input options.\n */\n /* Needed inputs */\n protected readonly shaVariant: VariantT;\n protected readonly inputFormat: FormatType;\n protected readonly utfType: EncodingType;\n protected readonly numRounds: number;\n\n /* State */\n protected abstract intermediateState: StateT;\n protected keyWithIPad: number[];\n protected keyWithOPad: number[];\n protected remainder: number[];\n protected remainderLen: number;\n protected updateCalled: boolean;\n protected processedLen: number;\n protected macKeySet: boolean;\n\n /* Variant specifics */\n protected abstract readonly variantBlockSize: number;\n protected abstract readonly bigEndianMod: -1 | 1;\n protected abstract readonly outputBinLen: number;\n protected abstract readonly isVariableLen: boolean;\n protected abstract readonly HMACSupported: boolean;\n\n /* Functions */\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n protected abstract readonly converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n protected abstract readonly roundFunc: (block: number[], H: StateT) => StateT;\n protected abstract readonly finalizeFunc: (\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: StateT,\n outputLen: number\n ) => number[];\n protected abstract readonly stateCloneFunc: (state: StateT) => StateT;\n protected abstract readonly newStateFunc: (variant: VariantT) => StateT;\n protected abstract readonly getMAC: ((options: { outputLen: number }) => number[]) | null;\n\n protected constructor(variant: VariantT, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n protected constructor(variant: VariantT, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected constructor(variant: any, inputFormat: any, options?: any) {\n const inputOptions = options || {};\n this.inputFormat = inputFormat;\n\n this.utfType = inputOptions[\"encoding\"] || \"UTF8\";\n this.numRounds = inputOptions[\"numRounds\"] || 1;\n\n /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */\n // @ts-ignore - The spec actually says ToString is called on the first parseInt argument so it's OK to use it here\n // to check if an arugment is an integer. This cheat would break if it's used to get the value of the argument.\n if (isNaN(this.numRounds) || this.numRounds !== parseInt(this.numRounds, 10) || 1 > this.numRounds) {\n throw new Error(\"numRounds must a integer >= 1\");\n }\n\n this.shaVariant = variant;\n this.remainder = [];\n this.remainderLen = 0;\n this.updateCalled = false;\n this.processedLen = 0;\n this.macKeySet = false;\n this.keyWithIPad = [];\n this.keyWithOPad = [];\n }\n\n /**\n * Hashes as many blocks as possible. Stores the rest for either a future update or getHash call.\n *\n * @param srcString The input to be hashed.\n * @returns A reference to the object.\n */\n update(srcString: string | ArrayBuffer | Uint8Array): this {\n let i,\n updateProcessedLen = 0;\n const variantBlockIntInc = this.variantBlockSize >>> 5,\n convertRet = this.converterFunc(srcString, this.remainder, this.remainderLen),\n chunkBinLen = convertRet[\"binLen\"],\n chunk = convertRet[\"value\"],\n chunkIntLen = chunkBinLen >>> 5;\n\n for (i = 0; i < chunkIntLen; i += variantBlockIntInc) {\n if (updateProcessedLen + this.variantBlockSize <= chunkBinLen) {\n this.intermediateState = this.roundFunc(chunk.slice(i, i + variantBlockIntInc), this.intermediateState);\n updateProcessedLen += this.variantBlockSize;\n }\n }\n this.processedLen += updateProcessedLen;\n this.remainder = chunk.slice(updateProcessedLen >>> 5);\n this.remainderLen = chunkBinLen % this.variantBlockSize;\n this.updateCalled = true;\n\n return this;\n }\n\n /**\n * Returns the desired SHA hash of the input fed in via `update` calls.\n *\n * @param format The desired output formatting\n * @param options Hashmap of output formatting options. `outputLen` must be specified for variable length hashes.\n * `outputLen` replaces the now deprecated `shakeLen` key.\n * @returns The hash in the format specified.\n */\n getHash(format: \"HEX\", options?: { outputUpper?: boolean; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"B64\", options?: { b64Pad?: string; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"BYTES\", options?: { outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"UINT8ARRAY\", options?: { outputLen?: number; shakeLen?: number }): Uint8Array;\n getHash(format: \"ARRAYBUFFER\", options?: { outputLen?: number; shakeLen?: number }): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHash(format: any, options?: any): any {\n let i,\n finalizedState,\n outputBinLen = this.outputBinLen;\n\n const outputOptions = getOutputOpts(options);\n\n if (this.isVariableLen) {\n if (outputOptions[\"outputLen\"] === -1) {\n throw new Error(\"Output length must be specified in options\");\n }\n outputBinLen = outputOptions[\"outputLen\"];\n }\n\n const formatFunc = getOutputConverter(format, outputBinLen, this.bigEndianMod, outputOptions);\n if (this.macKeySet && this.getMAC) {\n return formatFunc(this.getMAC(outputOptions));\n }\n\n finalizedState = this.finalizeFunc(\n this.remainder.slice(),\n this.remainderLen,\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n outputBinLen\n );\n for (i = 1; i < this.numRounds; i += 1) {\n /* Need to mask out bits that should be zero due to output not being a multiple of 32 */\n if (this.isVariableLen && outputBinLen % 32 !== 0) {\n finalizedState[finalizedState.length - 1] &= 0x00ffffff >>> (24 - (outputBinLen % 32));\n }\n finalizedState = this.finalizeFunc(\n finalizedState,\n outputBinLen,\n 0,\n this.newStateFunc(this.shaVariant),\n outputBinLen\n );\n }\n\n return formatFunc(finalizedState);\n }\n\n /**\n * Sets the HMAC key for an eventual `getHMAC` call. Must be called immediately after jsSHA object instantiation.\n *\n * @param key The key used to calculate the HMAC\n * @param inputFormat The format of key.\n * @param options Hashmap of extra input options.\n */\n setHMACKey(key: string, inputFormat: \"TEXT\", options?: { encoding?: EncodingType }): void;\n setHMACKey(key: string, inputFormat: \"B64\" | \"HEX\" | \"BYTES\"): void;\n setHMACKey(key: ArrayBuffer, inputFormat: \"ARRAYBUFFER\"): void;\n setHMACKey(key: Uint8Array, inputFormat: \"UINT8ARRAY\"): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setHMACKey(key: any, inputFormat: any, options?: any): void {\n if (!this.HMACSupported) {\n throw new Error(\"Variant does not support HMAC\");\n }\n\n if (this.updateCalled) {\n throw new Error(\"Cannot set MAC key after calling update\");\n }\n\n const keyOptions = options || {},\n keyConverterFunc = getStrConverter(inputFormat, keyOptions[\"encoding\"] || \"UTF8\", this.bigEndianMod);\n\n this._setHMACKey(keyConverterFunc(key));\n }\n\n /**\n * Internal function that sets the MAC key.\n *\n * @param key The packed MAC key to use\n */\n protected _setHMACKey(key: packedValue): void {\n const blockByteSize = this.variantBlockSize >>> 3,\n lastArrayIndex = blockByteSize / 4 - 1;\n let i;\n if (this.numRounds !== 1) {\n throw new Error(mac_rounds_error);\n }\n\n if (this.macKeySet) {\n throw new Error(\"MAC key already set\");\n }\n\n /* Figure out what to do with the key based on its size relative to\n * the hash's block size */\n if (blockByteSize < key[\"binLen\"] / 8) {\n key[\"value\"] = this.finalizeFunc(\n key[\"value\"],\n key[\"binLen\"],\n 0,\n this.newStateFunc(this.shaVariant),\n this.outputBinLen\n );\n }\n while (key[\"value\"].length <= lastArrayIndex) {\n key[\"value\"].push(0);\n }\n /* Create ipad and opad */\n for (i = 0; i <= lastArrayIndex; i += 1) {\n this.keyWithIPad[i] = key[\"value\"][i] ^ 0x36363636;\n this.keyWithOPad[i] = key[\"value\"][i] ^ 0x5c5c5c5c;\n }\n\n this.intermediateState = this.roundFunc(this.keyWithIPad, this.intermediateState);\n this.processedLen = this.variantBlockSize;\n\n this.macKeySet = true;\n }\n\n /**\n * Returns the the HMAC in the specified format using the key given by a previous `setHMACKey` call.\n *\n * @param format The desired output formatting.\n * @param options Hashmap of extra outputs options.\n * @returns The HMAC in the format specified.\n */\n getHMAC(format: \"HEX\", options?: { outputUpper?: boolean }): string;\n getHMAC(format: \"B64\", options?: { b64Pad?: string }): string;\n getHMAC(format: \"BYTES\"): string;\n getHMAC(format: \"UINT8ARRAY\"): Uint8Array;\n getHMAC(format: \"ARRAYBUFFER\"): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHMAC(format: any, options?: any): any {\n const outputOptions = getOutputOpts(options),\n formatFunc = getOutputConverter(format, this.outputBinLen, this.bigEndianMod, outputOptions);\n\n return formatFunc(this._getHMAC());\n }\n\n /**\n * Internal function that returns the \"raw\" HMAC\n */\n protected _getHMAC(): number[] {\n let finalizedState;\n\n if (!this.macKeySet) {\n throw new Error(\"Cannot call getHMAC without first setting MAC key\");\n }\n\n const firstHash = this.finalizeFunc(\n this.remainder.slice(),\n this.remainderLen,\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n this.outputBinLen\n );\n finalizedState = this.roundFunc(this.keyWithOPad, this.newStateFunc(this.shaVariant));\n finalizedState = this.finalizeFunc(\n firstHash,\n this.outputBinLen,\n this.variantBlockSize,\n finalizedState,\n this.outputBinLen\n );\n\n return finalizedState;\n }\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","/*\n * Note 1: All the functions in this file guarantee only that the bottom 32-bits of the return value are correct.\n * JavaScript is flakey when it comes to bit operations and a '1' in the highest order bit of a 32-bit number causes\n * it to be interpreted as a negative number per two's complement.\n *\n * Note 2: Per the ECMAScript spec, all JavaScript operations mask the shift amount by 0x1F. This results in weird\n * cases like 1 << 32 == 1 and 1 << 33 === 1 << 1 === 2\n */\n\n/**\n * The 32-bit implementation of circular rotate left.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted left circularly by `n` bits\n */\nexport function rotl_32(x: number, n: number): number {\n return (x << n) | (x >>> (32 - n));\n}\n\n/**\n * The 32-bit implementation of circular rotate right.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right circularly by `n` bits\n */\nfunction rotr_32(x: number, n: number): number {\n return (x >>> n) | (x << (32 - n));\n}\n\n/**\n * The 32-bit implementation of shift right.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted by `n` bits.\n */\nfunction shr_32(x: number, n: number): number {\n return x >>> n;\n}\n\n/**\n * The 32-bit implementation of the NIST specified Parity function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function parity_32(x: number, y: number, z: number): number {\n return x ^ y ^ z;\n}\n\n/**\n * The 32-bit implementation of the NIST specified Ch function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function ch_32(x: number, y: number, z: number): number {\n return (x & y) ^ (~x & z);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Maj function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function maj_32(x: number, y: number, z: number): number {\n return (x & y) ^ (x & z) ^ (y & z);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Sigma0 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma0_32(x: number): number {\n return rotr_32(x, 2) ^ rotr_32(x, 13) ^ rotr_32(x, 22);\n}\n\n/**\n * Add two 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @returns The sum of `a` + `b`.\n */\nexport function safeAdd_32_2(a: number, b: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * Add four 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @param c The third 32-bit integer argument to be added.\n * @param d The fourth 32-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d`.\n */\nexport function safeAdd_32_4(a: number, b: number, c: number, d: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff) + (c & 0xffff) + (d & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * Add five 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @param c The third 32-bit integer argument to be added.\n * @param d The fourth 32-bit integer argument to be added.\n * @param e The fifth 32-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d` + `e`.\n */\nexport function safeAdd_32_5(a: number, b: number, c: number, d: number, e: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff) + (c & 0xffff) + (d & 0xffff) + (e & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (e >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Gamma1 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma1_32(x: number): number {\n return rotr_32(x, 17) ^ rotr_32(x, 19) ^ shr_32(x, 10);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Gamma0 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma0_32(x: number): number {\n return rotr_32(x, 7) ^ rotr_32(x, 18) ^ shr_32(x, 3);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Sigma1 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma1_32(x: number): number {\n return rotr_32(x, 6) ^ rotr_32(x, 11) ^ rotr_32(x, 25);\n}\n","import { jsSHABase, TWO_PWR_32, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport { ch_32, parity_32, maj_32, rotl_32, safeAdd_32_2, safeAdd_32_5 } from \"./primitives_32\";\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param _variant: Unused\n * @returns The initial state values.\n */\nfunction getNewState(_variant: \"SHA-1\"): number[] {\n return [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n}\n\n/**\n * Performs a round of SHA-1 hashing over a 512-byte block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA1(block: number[], H: number[]): number[] {\n let a, b, c, d, e, T, t;\n const W: number[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n\n for (t = 0; t < 80; t += 1) {\n if (t < 16) {\n W[t] = block[t];\n } else {\n W[t] = rotl_32(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n if (t < 20) {\n T = safeAdd_32_5(rotl_32(a, 5), ch_32(b, c, d), e, 0x5a827999, W[t]);\n } else if (t < 40) {\n T = safeAdd_32_5(rotl_32(a, 5), parity_32(b, c, d), e, 0x6ed9eba1, W[t]);\n } else if (t < 60) {\n T = safeAdd_32_5(rotl_32(a, 5), maj_32(b, c, d), e, 0x8f1bbcdc, W[t]);\n } else {\n T = safeAdd_32_5(rotl_32(a, 5), parity_32(b, c, d), e, 0xca62c1d6, W[t]);\n }\n\n e = d;\n d = c;\n c = rotl_32(b, 30);\n b = a;\n a = T;\n }\n\n H[0] = safeAdd_32_2(a, H[0]);\n H[1] = safeAdd_32_2(b, H[1]);\n H[2] = safeAdd_32_2(c, H[2]);\n H[3] = safeAdd_32_2(d, H[3]);\n H[4] = safeAdd_32_2(e, H[4]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-1 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @returns The array of integers representing the SHA-1 hash of message.\n */\nfunction finalizeSHA1(remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]): number[] {\n let i;\n\n /* The 65 addition is a hack but it works. The correct number is\n\t\tactually 72 (64 + 8) but the below math fails if\n\t\tremainderBinLen + 72 % 512 = 0. Since remainderBinLen % 8 = 0,\n\t\t\"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 65) >>> 9) << 4) + 15,\n totalLen = remainderBinLen + processedBinLen;\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n\n /* Append length of binary string in the position such that the new\n * length is a multiple of 512. Logic does not work for even multiples\n * of 512 but there can never be even multiples of 512. JavaScript\n * numbers are limited to 2^53 so it's \"safe\" to treat the totalLen as\n * a 64-bit integer. */\n remainder[offset] = totalLen & 0xffffffff;\n\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += 16) {\n H = roundSHA1(remainder.slice(i, i + 16), H);\n }\n\n return H;\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: number[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: number[]) => number[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]) => number[];\n stateCloneFunc: (state: number[]) => number[];\n newStateFunc: (variant: \"SHA-1\") => number[];\n getMAC: () => number[];\n\n constructor(variant: \"SHA-1\", inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: \"SHA-1\", inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (\"SHA-1\" !== variant) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA1;\n this.stateCloneFunc = function (state: number[]): number[] {\n return state.slice();\n };\n this.newStateFunc = getNewState;\n this.finalizeFunc = finalizeSHA1;\n\n this.intermediateState = getNewState(variant);\n this.variantBlockSize = 512;\n this.outputBinLen = 160;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","import { jsSHABase, TWO_PWR_32, H_full, H_trunc, K_sha2, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport {\n ch_32,\n gamma0_32,\n gamma1_32,\n maj_32,\n safeAdd_32_2,\n safeAdd_32_4,\n safeAdd_32_5,\n sigma0_32,\n sigma1_32,\n} from \"./primitives_32\";\n\ntype VariantType = \"SHA-224\" | \"SHA-256\";\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param variant: The SHA-256 family variant.\n * @returns The initial state values.\n */\nfunction getNewState256(variant: VariantType): number[] {\n let retVal;\n\n if (\"SHA-224\" == variant) {\n retVal = H_trunc.slice();\n } else {\n /* \"SHA-256\" */\n retVal = H_full.slice();\n }\n return retVal;\n}\n\n/**\n * Performs a round of SHA-256 hashing over a block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA256(block: number[], H: number[]): number[] {\n let a, b, c, d, e, f, g, h, T1, T2, t;\n\n const W: number[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n f = H[5];\n g = H[6];\n h = H[7];\n\n for (t = 0; t < 64; t += 1) {\n if (t < 16) {\n W[t] = block[t];\n } else {\n W[t] = safeAdd_32_4(gamma1_32(W[t - 2]), W[t - 7], gamma0_32(W[t - 15]), W[t - 16]);\n }\n T1 = safeAdd_32_5(h, sigma1_32(e), ch_32(e, f, g), K_sha2[t], W[t]);\n T2 = safeAdd_32_2(sigma0_32(a), maj_32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = safeAdd_32_2(d, T1);\n d = c;\n c = b;\n b = a;\n a = safeAdd_32_2(T1, T2);\n }\n\n H[0] = safeAdd_32_2(a, H[0]);\n H[1] = safeAdd_32_2(b, H[1]);\n H[2] = safeAdd_32_2(c, H[2]);\n H[3] = safeAdd_32_2(d, H[3]);\n H[4] = safeAdd_32_2(e, H[4]);\n H[5] = safeAdd_32_2(f, H[5]);\n H[6] = safeAdd_32_2(g, H[6]);\n H[7] = safeAdd_32_2(h, H[7]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-256 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @param variant The desired SHA-256 variant.\n * @returns The array of integers representing the SHA-2 hash of message.\n */\nfunction finalizeSHA256(\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: number[],\n variant: VariantType\n): number[] {\n let i, retVal;\n\n /* The 65 addition is a hack but it works. The correct number is\n actually 72 (64 + 8) but the below math fails if\n remainderBinLen + 72 % 512 = 0. Since remainderBinLen % 8 = 0,\n \"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 65) >>> 9) << 4) + 15,\n binaryStringInc = 16,\n totalLen = remainderBinLen + processedBinLen;\n\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n /* Append length of binary string in the position such that the new\n * length is correct. JavaScript numbers are limited to 2^53 so it's\n * \"safe\" to treat the totalLen as a 64-bit integer. */\n\n remainder[offset] = totalLen & 0xffffffff;\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += binaryStringInc) {\n H = roundSHA256(remainder.slice(i, i + binaryStringInc), H);\n }\n\n if (\"SHA-224\" === variant) {\n retVal = [H[0], H[1], H[2], H[3], H[4], H[5], H[6]];\n } else {\n /* \"SHA-256 */\n retVal = H;\n }\n\n return retVal;\n}\nexport default class jsSHA extends jsSHABase {\n intermediateState: number[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: number[]) => number[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]) => number[];\n stateCloneFunc: (state: number[]) => number[];\n newStateFunc: (variant: VariantType) => number[];\n getMAC: () => number[];\n\n constructor(variant: VariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: VariantType, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (!(\"SHA-224\" === variant || \"SHA-256\" === variant)) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.HMACSupported = true;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA256;\n this.stateCloneFunc = function (state): number[] {\n return state.slice();\n };\n\n this.newStateFunc = getNewState256;\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, H): number[] {\n return finalizeSHA256(remainder, remainderBinLen, processedBinLen, H, variant);\n };\n\n this.intermediateState = getNewState256(variant);\n this.variantBlockSize = 512;\n this.outputBinLen = \"SHA-224\" === variant ? 224 : 256;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","/*\n * Note 1: All the functions in this file guarantee only that the bottom 32-bits of the returned Int_64 are correct.\n * JavaScript is flakey when it comes to bit operations and a '1' in the highest order bit of a 32-bit number causes\n * it to be interpreted as a negative number per two's complement.\n *\n * Note 2: Per the ECMAScript spec, all JavaScript operations mask the shift amount by 0x1F. This results in weird\n * cases like 1 << 32 == 1 and 1 << 33 === 1 << 1 === 2\n */\n\n/**\n * Int_64 is a object for 2 32-bit numbers emulating a 64-bit number.\n */\nexport class Int_64 {\n /**\n * @param msint_32 The most significant 32-bits of a 64-bit number.\n * @param lsint_32 The least significant 32-bits of a 64-bit number.\n */\n readonly highOrder: number;\n readonly lowOrder: number;\n constructor(msint_32: number, lsint_32: number) {\n this.highOrder = msint_32;\n this.lowOrder = lsint_32;\n }\n}\n\n/**\n * The 64-bit implementation of circular rotate left.\n *\n * This does not work for n >= 64 or n == 32 but those are never done.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted left circularly by `n` bits.\n */\nexport function rotl_64(x: Int_64, n: number): Int_64 {\n let tmp;\n if (n > 32) {\n tmp = 64 - n;\n return new Int_64((x.lowOrder << n) | (x.highOrder >>> tmp), (x.highOrder << n) | (x.lowOrder >>> tmp));\n } else if (0 !== n) {\n tmp = 32 - n;\n return new Int_64((x.highOrder << n) | (x.lowOrder >>> tmp), (x.lowOrder << n) | (x.highOrder >>> tmp));\n } else {\n return x;\n }\n}\n\n/**\n * The 64-bit implementation of circular rotate right.\n *\n * This does not work for n >= 64, n == 32, or n == 0 but those are never done.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right circularly by `n` bits.\n */\nfunction rotr_64(x: Int_64, n: number): Int_64 {\n let tmp;\n if (n < 32) {\n tmp = 32 - n;\n return new Int_64((x.highOrder >>> n) | (x.lowOrder << tmp), (x.lowOrder >>> n) | (x.highOrder << tmp));\n } else {\n tmp = 64 - n;\n return new Int_64((x.lowOrder >>> n) | (x.highOrder << tmp), (x.highOrder >>> n) | (x.lowOrder << tmp));\n }\n}\n\n/**\n * The 64-bit implementation of shift right.\n *\n * This does not work for n >= 32 but is only called for n < 32.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right by `n` bits\n */\nfunction shr_64(x: Int_64, n: number): Int_64 {\n return new Int_64(x.highOrder >>> n, (x.lowOrder >>> n) | (x.highOrder << (32 - n)));\n}\n\n/**\n * The 64-bit implementation of the NIST specified Ch function.\n *\n * @param x The first 64-bit integer argument.\n * @param y The second 64-bit integer argument.\n * @param z The third 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function ch_64(x: Int_64, y: Int_64, z: Int_64): Int_64 {\n return new Int_64(\n (x.highOrder & y.highOrder) ^ (~x.highOrder & z.highOrder),\n (x.lowOrder & y.lowOrder) ^ (~x.lowOrder & z.lowOrder)\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Maj function.\n *\n * @param x The first 64-bit integer argument.\n * @param y The second 64-bit integer argument.\n * @param z The third 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function maj_64(x: Int_64, y: Int_64, z: Int_64): Int_64 {\n return new Int_64(\n (x.highOrder & y.highOrder) ^ (x.highOrder & z.highOrder) ^ (y.highOrder & z.highOrder),\n (x.lowOrder & y.lowOrder) ^ (x.lowOrder & z.lowOrder) ^ (y.lowOrder & z.lowOrder)\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Sigma0 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma0_64(x: Int_64): Int_64 {\n const rotr28 = rotr_64(x, 28),\n rotr34 = rotr_64(x, 34),\n rotr39 = rotr_64(x, 39);\n\n return new Int_64(\n rotr28.highOrder ^ rotr34.highOrder ^ rotr39.highOrder,\n rotr28.lowOrder ^ rotr34.lowOrder ^ rotr39.lowOrder\n );\n}\n\n/**\n * Add two 64-bit integers.\n *\n * @param x The first 64-bit integer argument to be added.\n * @param y The second 64-bit integer argument to be added.\n * @returns The sum of `x` + `y`.\n */\nexport function safeAdd_64_2(x: Int_64, y: Int_64): Int_64 {\n let lsw, msw;\n\n lsw = (x.lowOrder & 0xffff) + (y.lowOrder & 0xffff);\n msw = (x.lowOrder >>> 16) + (y.lowOrder >>> 16) + (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw = (x.highOrder & 0xffff) + (y.highOrder & 0xffff) + (msw >>> 16);\n msw = (x.highOrder >>> 16) + (y.highOrder >>> 16) + (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * Add four 64-bit integers.\n *\n * @param a The first 64-bit integer argument to be added.\n * @param b The second 64-bit integer argument to be added.\n * @param c The third 64-bit integer argument to be added.\n * @param d The fouth 64-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d`.\n */\nexport function safeAdd_64_4(a: Int_64, b: Int_64, c: Int_64, d: Int_64): Int_64 {\n let lsw, msw;\n\n lsw = (a.lowOrder & 0xffff) + (b.lowOrder & 0xffff) + (c.lowOrder & 0xffff) + (d.lowOrder & 0xffff);\n msw = (a.lowOrder >>> 16) + (b.lowOrder >>> 16) + (c.lowOrder >>> 16) + (d.lowOrder >>> 16) + (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw =\n (a.highOrder & 0xffff) + (b.highOrder & 0xffff) + (c.highOrder & 0xffff) + (d.highOrder & 0xffff) + (msw >>> 16);\n msw = (a.highOrder >>> 16) + (b.highOrder >>> 16) + (c.highOrder >>> 16) + (d.highOrder >>> 16) + (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * Add five 64-bit integers.\n *\n * @param a The first 64-bit integer argument to be added.\n * @param b The second 64-bit integer argument to be added.\n * @param c The third 64-bit integer argument to be added.\n * @param d The fouth 64-bit integer argument to be added.\n * @param e The fifth 64-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d` + `e`.\n */\nexport function safeAdd_64_5(a: Int_64, b: Int_64, c: Int_64, d: Int_64, e: Int_64): Int_64 {\n let lsw, msw;\n\n lsw =\n (a.lowOrder & 0xffff) +\n (b.lowOrder & 0xffff) +\n (c.lowOrder & 0xffff) +\n (d.lowOrder & 0xffff) +\n (e.lowOrder & 0xffff);\n msw =\n (a.lowOrder >>> 16) +\n (b.lowOrder >>> 16) +\n (c.lowOrder >>> 16) +\n (d.lowOrder >>> 16) +\n (e.lowOrder >>> 16) +\n (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw =\n (a.highOrder & 0xffff) +\n (b.highOrder & 0xffff) +\n (c.highOrder & 0xffff) +\n (d.highOrder & 0xffff) +\n (e.highOrder & 0xffff) +\n (msw >>> 16);\n msw =\n (a.highOrder >>> 16) +\n (b.highOrder >>> 16) +\n (c.highOrder >>> 16) +\n (d.highOrder >>> 16) +\n (e.highOrder >>> 16) +\n (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * XORs two given arguments.\n *\n * @param a The first argument to be XORed.\n * @param b The second argument to be XORed.\n * @returns The The XOR `a` and `b`\n */\nexport function xor_64_2(a: Int_64, b: Int_64): Int_64 {\n return new Int_64(a.highOrder ^ b.highOrder, a.lowOrder ^ b.lowOrder);\n}\n\n/**\n * XORs five given arguments.\n *\n * @param a The first argument to be XORed.\n * @param b The second argument to be XORed.\n * @param c The third argument to be XORed.\n * @param d The fourth argument to be XORed.\n * @param e The fifth argument to be XORed.\n * @returns The XOR of `a`, `b`, `c`, `d`, and `e`.\n */\nexport function xor_64_5(a: Int_64, b: Int_64, c: Int_64, d: Int_64, e: Int_64): Int_64 {\n return new Int_64(\n a.highOrder ^ b.highOrder ^ c.highOrder ^ d.highOrder ^ e.highOrder,\n a.lowOrder ^ b.lowOrder ^ c.lowOrder ^ d.lowOrder ^ e.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Gamma1 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma1_64(x: Int_64): Int_64 {\n const rotr19 = rotr_64(x, 19),\n rotr61 = rotr_64(x, 61),\n shr6 = shr_64(x, 6);\n\n return new Int_64(\n rotr19.highOrder ^ rotr61.highOrder ^ shr6.highOrder,\n rotr19.lowOrder ^ rotr61.lowOrder ^ shr6.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Gamma0 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma0_64(x: Int_64): Int_64 {\n const rotr1 = rotr_64(x, 1),\n rotr8 = rotr_64(x, 8),\n shr7 = shr_64(x, 7);\n\n return new Int_64(\n rotr1.highOrder ^ rotr8.highOrder ^ shr7.highOrder,\n rotr1.lowOrder ^ rotr8.lowOrder ^ shr7.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Sigma1 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma1_64(x: Int_64): Int_64 {\n const rotr14 = rotr_64(x, 14),\n rotr18 = rotr_64(x, 18),\n rotr41 = rotr_64(x, 41);\n\n return new Int_64(\n rotr14.highOrder ^ rotr18.highOrder ^ rotr41.highOrder,\n rotr14.lowOrder ^ rotr18.lowOrder ^ rotr41.lowOrder\n );\n}\n","import { jsSHABase, TWO_PWR_32, H_trunc, H_full, K_sha2, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport {\n ch_64,\n gamma0_64,\n gamma1_64,\n Int_64,\n maj_64,\n safeAdd_64_2,\n safeAdd_64_4,\n safeAdd_64_5,\n sigma0_64,\n sigma1_64,\n} from \"./primitives_64\";\n\ntype VariantType = \"SHA-384\" | \"SHA-512\";\n\nconst K_sha512 = [\n new Int_64(K_sha2[0], 0xd728ae22),\n new Int_64(K_sha2[1], 0x23ef65cd),\n new Int_64(K_sha2[2], 0xec4d3b2f),\n new Int_64(K_sha2[3], 0x8189dbbc),\n new Int_64(K_sha2[4], 0xf348b538),\n new Int_64(K_sha2[5], 0xb605d019),\n new Int_64(K_sha2[6], 0xaf194f9b),\n new Int_64(K_sha2[7], 0xda6d8118),\n new Int_64(K_sha2[8], 0xa3030242),\n new Int_64(K_sha2[9], 0x45706fbe),\n new Int_64(K_sha2[10], 0x4ee4b28c),\n new Int_64(K_sha2[11], 0xd5ffb4e2),\n new Int_64(K_sha2[12], 0xf27b896f),\n new Int_64(K_sha2[13], 0x3b1696b1),\n new Int_64(K_sha2[14], 0x25c71235),\n new Int_64(K_sha2[15], 0xcf692694),\n new Int_64(K_sha2[16], 0x9ef14ad2),\n new Int_64(K_sha2[17], 0x384f25e3),\n new Int_64(K_sha2[18], 0x8b8cd5b5),\n new Int_64(K_sha2[19], 0x77ac9c65),\n new Int_64(K_sha2[20], 0x592b0275),\n new Int_64(K_sha2[21], 0x6ea6e483),\n new Int_64(K_sha2[22], 0xbd41fbd4),\n new Int_64(K_sha2[23], 0x831153b5),\n new Int_64(K_sha2[24], 0xee66dfab),\n new Int_64(K_sha2[25], 0x2db43210),\n new Int_64(K_sha2[26], 0x98fb213f),\n new Int_64(K_sha2[27], 0xbeef0ee4),\n new Int_64(K_sha2[28], 0x3da88fc2),\n new Int_64(K_sha2[29], 0x930aa725),\n new Int_64(K_sha2[30], 0xe003826f),\n new Int_64(K_sha2[31], 0x0a0e6e70),\n new Int_64(K_sha2[32], 0x46d22ffc),\n new Int_64(K_sha2[33], 0x5c26c926),\n new Int_64(K_sha2[34], 0x5ac42aed),\n new Int_64(K_sha2[35], 0x9d95b3df),\n new Int_64(K_sha2[36], 0x8baf63de),\n new Int_64(K_sha2[37], 0x3c77b2a8),\n new Int_64(K_sha2[38], 0x47edaee6),\n new Int_64(K_sha2[39], 0x1482353b),\n new Int_64(K_sha2[40], 0x4cf10364),\n new Int_64(K_sha2[41], 0xbc423001),\n new Int_64(K_sha2[42], 0xd0f89791),\n new Int_64(K_sha2[43], 0x0654be30),\n new Int_64(K_sha2[44], 0xd6ef5218),\n new Int_64(K_sha2[45], 0x5565a910),\n new Int_64(K_sha2[46], 0x5771202a),\n new Int_64(K_sha2[47], 0x32bbd1b8),\n new Int_64(K_sha2[48], 0xb8d2d0c8),\n new Int_64(K_sha2[49], 0x5141ab53),\n new Int_64(K_sha2[50], 0xdf8eeb99),\n new Int_64(K_sha2[51], 0xe19b48a8),\n new Int_64(K_sha2[52], 0xc5c95a63),\n new Int_64(K_sha2[53], 0xe3418acb),\n new Int_64(K_sha2[54], 0x7763e373),\n new Int_64(K_sha2[55], 0xd6b2b8a3),\n new Int_64(K_sha2[56], 0x5defb2fc),\n new Int_64(K_sha2[57], 0x43172f60),\n new Int_64(K_sha2[58], 0xa1f0ab72),\n new Int_64(K_sha2[59], 0x1a6439ec),\n new Int_64(K_sha2[60], 0x23631e28),\n new Int_64(K_sha2[61], 0xde82bde9),\n new Int_64(K_sha2[62], 0xb2c67915),\n new Int_64(K_sha2[63], 0xe372532b),\n new Int_64(0xca273ece, 0xea26619c),\n new Int_64(0xd186b8c7, 0x21c0c207),\n new Int_64(0xeada7dd6, 0xcde0eb1e),\n new Int_64(0xf57d4f7f, 0xee6ed178),\n new Int_64(0x06f067aa, 0x72176fba),\n new Int_64(0x0a637dc5, 0xa2c898a6),\n new Int_64(0x113f9804, 0xbef90dae),\n new Int_64(0x1b710b35, 0x131c471b),\n new Int_64(0x28db77f5, 0x23047d84),\n new Int_64(0x32caab7b, 0x40c72493),\n new Int_64(0x3c9ebe0a, 0x15c9bebc),\n new Int_64(0x431d67c4, 0x9c100d4c),\n new Int_64(0x4cc5d4be, 0xcb3e42b6),\n new Int_64(0x597f299c, 0xfc657e2a),\n new Int_64(0x5fcb6fab, 0x3ad6faec),\n new Int_64(0x6c44198c, 0x4a475817),\n];\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param variant: The SHA-512 family variant.\n * @returns The initial state values.\n */\nfunction getNewState512(variant: VariantType): Int_64[] {\n if (\"SHA-384\" === variant) {\n return [\n new Int_64(0xcbbb9d5d, H_trunc[0]),\n new Int_64(0x0629a292a, H_trunc[1]),\n new Int_64(0x9159015a, H_trunc[2]),\n new Int_64(0x0152fecd8, H_trunc[3]),\n new Int_64(0x67332667, H_trunc[4]),\n new Int_64(0x98eb44a87, H_trunc[5]),\n new Int_64(0xdb0c2e0d, H_trunc[6]),\n new Int_64(0x047b5481d, H_trunc[7]),\n ];\n } else {\n /* SHA-512 */\n return [\n new Int_64(H_full[0], 0xf3bcc908),\n new Int_64(H_full[1], 0x84caa73b),\n new Int_64(H_full[2], 0xfe94f82b),\n new Int_64(H_full[3], 0x5f1d36f1),\n new Int_64(H_full[4], 0xade682d1),\n new Int_64(H_full[5], 0x2b3e6c1f),\n new Int_64(H_full[6], 0xfb41bd6b),\n new Int_64(H_full[7], 0x137e2179),\n ];\n }\n}\n\n/**\n * Performs a round of SHA-512 hashing over a block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA512(block: number[], H: Int_64[]): Int_64[] {\n let a, b, c, d, e, f, g, h, T1, T2, t, offset;\n\n const W: Int_64[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n f = H[5];\n g = H[6];\n h = H[7];\n\n for (t = 0; t < 80; t += 1) {\n if (t < 16) {\n offset = t * 2;\n W[t] = new Int_64(block[offset], block[offset + 1]);\n } else {\n W[t] = safeAdd_64_4(gamma1_64(W[t - 2]), W[t - 7], gamma0_64(W[t - 15]), W[t - 16]);\n }\n T1 = safeAdd_64_5(h, sigma1_64(e), ch_64(e, f, g), K_sha512[t], W[t]);\n T2 = safeAdd_64_2(sigma0_64(a), maj_64(a, b, c));\n h = g;\n g = f;\n f = e;\n e = safeAdd_64_2(d, T1);\n d = c;\n c = b;\n b = a;\n a = safeAdd_64_2(T1, T2);\n }\n\n H[0] = safeAdd_64_2(a, H[0]);\n H[1] = safeAdd_64_2(b, H[1]);\n H[2] = safeAdd_64_2(c, H[2]);\n H[3] = safeAdd_64_2(d, H[3]);\n H[4] = safeAdd_64_2(e, H[4]);\n H[5] = safeAdd_64_2(f, H[5]);\n H[6] = safeAdd_64_2(g, H[6]);\n H[7] = safeAdd_64_2(h, H[7]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-512 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @param variant The desired SHA-512 variant.\n * @returns The array of integers representing the SHA-512 hash of message.\n */\nfunction finalizeSHA512(\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: Int_64[],\n variant: VariantType\n): number[] {\n let i, retVal;\n\n /* The 129 addition is a hack but it works. The correct number is\n actually 136 (128 + 8) but the below math fails if\n remainderBinLen + 136 % 1024 = 0. Since remainderBinLen % 8 = 0,\n \"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 129) >>> 10) << 5) + 31,\n binaryStringInc = 32,\n totalLen = remainderBinLen + processedBinLen;\n\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n /* Append length of binary string in the position such that the new\n * length is correct. JavaScript numbers are limited to 2^53 so it's\n * \"safe\" to treat the totalLen as a 64-bit integer. */\n\n remainder[offset] = totalLen & 0xffffffff;\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += binaryStringInc) {\n H = roundSHA512(remainder.slice(i, i + binaryStringInc), H);\n }\n\n if (\"SHA-384\" === variant) {\n H = (H as unknown) as Int_64[];\n retVal = [\n H[0].highOrder,\n H[0].lowOrder,\n H[1].highOrder,\n H[1].lowOrder,\n H[2].highOrder,\n H[2].lowOrder,\n H[3].highOrder,\n H[3].lowOrder,\n H[4].highOrder,\n H[4].lowOrder,\n H[5].highOrder,\n H[5].lowOrder,\n ];\n } else {\n /* SHA-512 */\n retVal = [\n H[0].highOrder,\n H[0].lowOrder,\n H[1].highOrder,\n H[1].lowOrder,\n H[2].highOrder,\n H[2].lowOrder,\n H[3].highOrder,\n H[3].lowOrder,\n H[4].highOrder,\n H[4].lowOrder,\n H[5].highOrder,\n H[5].lowOrder,\n H[6].highOrder,\n H[6].lowOrder,\n H[7].highOrder,\n H[7].lowOrder,\n ];\n }\n return retVal;\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: Int_64[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: Int_64[]) => Int_64[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: Int_64[]) => number[];\n stateCloneFunc: (state: Int_64[]) => Int_64[];\n newStateFunc: (variant: VariantType) => Int_64[];\n getMAC: () => number[];\n\n constructor(variant: VariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: VariantType, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (!(\"SHA-384\" === variant || \"SHA-512\" === variant)) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.HMACSupported = true;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA512;\n this.stateCloneFunc = function (state): Int_64[] {\n return state.slice();\n };\n this.newStateFunc = getNewState512;\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, H): number[] {\n return finalizeSHA512(remainder, remainderBinLen, processedBinLen, H, variant);\n };\n\n this.intermediateState = getNewState512(variant);\n this.variantBlockSize = 1024;\n this.outputBinLen = \"SHA-384\" === variant ? 384 : 512;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","import { jsSHABase, packedLEConcat, sha_variant_error, mac_rounds_error, TWO_PWR_32, parseInputOption } from \"./common\";\nimport {\n packedValue,\n CSHAKEOptionsNoEncodingType,\n CSHAKEOptionsEncodingType,\n SHAKEOptionsNoEncodingType,\n SHAKEOptionsEncodingType,\n KMACOptionsNoEncodingType,\n KMACOptionsEncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n ResolvedCSHAKEOptionsNoEncodingType,\n ResolvedKMACOptionsNoEncodingType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport { Int_64, rotl_64, xor_64_2, xor_64_5 } from \"./primitives_64\";\n\ntype FixedLengthVariantType = \"SHA3-224\" | \"SHA3-256\" | \"SHA3-384\" | \"SHA3-512\" | \"SHAKE128\" | \"SHAKE256\";\n\ntype VariantType = FixedLengthVariantType | \"SHAKE128\" | \"SHAKE256\" | \"CSHAKE128\" | \"CSHAKE256\" | \"KMAC128\" | \"KMAC256\";\n\nconst rc_sha3 = [\n new Int_64(0x00000000, 0x00000001),\n new Int_64(0x00000000, 0x00008082),\n new Int_64(0x80000000, 0x0000808a),\n new Int_64(0x80000000, 0x80008000),\n new Int_64(0x00000000, 0x0000808b),\n new Int_64(0x00000000, 0x80000001),\n new Int_64(0x80000000, 0x80008081),\n new Int_64(0x80000000, 0x00008009),\n new Int_64(0x00000000, 0x0000008a),\n new Int_64(0x00000000, 0x00000088),\n new Int_64(0x00000000, 0x80008009),\n new Int_64(0x00000000, 0x8000000a),\n new Int_64(0x00000000, 0x8000808b),\n new Int_64(0x80000000, 0x0000008b),\n new Int_64(0x80000000, 0x00008089),\n new Int_64(0x80000000, 0x00008003),\n new Int_64(0x80000000, 0x00008002),\n new Int_64(0x80000000, 0x00000080),\n new Int_64(0x00000000, 0x0000800a),\n new Int_64(0x80000000, 0x8000000a),\n new Int_64(0x80000000, 0x80008081),\n new Int_64(0x80000000, 0x00008080),\n new Int_64(0x00000000, 0x80000001),\n new Int_64(0x80000000, 0x80008008),\n];\n\nconst r_sha3 = [\n [0, 36, 3, 41, 18],\n [1, 44, 10, 45, 2],\n [62, 6, 43, 15, 61],\n [28, 55, 25, 21, 56],\n [27, 20, 39, 8, 14],\n];\n\n/**\n * Gets the state values for the specified SHA-3 variant.\n *\n * @param _variant Unused for this family.\n * @returns The initial state values.\n */\nfunction getNewState(_variant: VariantType): Int_64[][] {\n let i;\n const retVal = [];\n\n for (i = 0; i < 5; i += 1) {\n retVal[i] = [new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0)];\n }\n\n return retVal;\n}\n\n/**\n * Returns a clone of the given SHA3 state.\n *\n * @param state The state to be cloned.\n * @returns The cloned state.\n */\nfunction cloneSHA3State(state: Int_64[][]): Int_64[][] {\n let i;\n const clone = [];\n for (i = 0; i < 5; i += 1) {\n clone[i] = state[i].slice();\n }\n\n return clone;\n}\n\n/**\n * Performs a round of SHA-3 hashing over a block. This clobbers `state`.\n *\n * @param block The binary array representation of the block to hash.\n * @param state Hash state from a previous round.\n * @returns The resulting state value.\n */\nfunction roundSHA3(block: number[] | null, state: Int_64[][]): Int_64[][] {\n let round, x, y, B;\n const C = [],\n D = [];\n\n if (null !== block) {\n for (x = 0; x < block.length; x += 2) {\n state[(x >>> 1) % 5][((x >>> 1) / 5) | 0] = xor_64_2(\n state[(x >>> 1) % 5][((x >>> 1) / 5) | 0],\n new Int_64(block[x + 1], block[x])\n );\n }\n }\n\n for (round = 0; round < 24; round += 1) {\n /* Any SHA-3 variant name will do here */\n B = getNewState(\"SHA3-384\");\n\n /* Perform theta step */\n for (x = 0; x < 5; x += 1) {\n C[x] = xor_64_5(state[x][0], state[x][1], state[x][2], state[x][3], state[x][4]);\n }\n for (x = 0; x < 5; x += 1) {\n D[x] = xor_64_2(C[(x + 4) % 5], rotl_64(C[(x + 1) % 5], 1));\n }\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n state[x][y] = xor_64_2(state[x][y], D[x]);\n }\n }\n\n /* Perform combined ro and pi steps */\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n B[y][(2 * x + 3 * y) % 5] = rotl_64(state[x][y], r_sha3[x][y]);\n }\n }\n\n /* Perform chi step */\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n state[x][y] = xor_64_2(\n B[x][y],\n new Int_64(\n ~B[(x + 1) % 5][y].highOrder & B[(x + 2) % 5][y].highOrder,\n ~B[(x + 1) % 5][y].lowOrder & B[(x + 2) % 5][y].lowOrder\n )\n );\n }\n }\n\n /* Perform iota step */\n state[0][0] = xor_64_2(state[0][0], rc_sha3[round]);\n }\n\n return state;\n}\n\n/**\n * Finalizes the SHA-3 hash. This clobbers `remainder` and `state`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param _processedBinLen Unused for this family.\n * @param state The state from a previous round.\n * @param blockSize The block size/rate of the variant in bits\n * @param delimiter The delimiter value for the variant\n * @param outputLen The output length for the variant in bits\n * @returns The array of integers representing the SHA-3 hash of message.\n */\nfunction finalizeSHA3(\n remainder: number[],\n remainderBinLen: number,\n _processedBinLen: number,\n state: Int_64[][],\n blockSize: number,\n delimiter: number,\n outputLen: number\n): number[] {\n let i,\n state_offset = 0,\n temp;\n const retVal = [],\n binaryStringInc = blockSize >>> 5,\n remainderIntLen = remainderBinLen >>> 5;\n\n /* Process as many blocks as possible, some may be here for multiple rounds\n\t\twith SHAKE\n\t*/\n for (i = 0; i < remainderIntLen && remainderBinLen >= blockSize; i += binaryStringInc) {\n state = roundSHA3(remainder.slice(i, i + binaryStringInc), state);\n remainderBinLen -= blockSize;\n }\n\n remainder = remainder.slice(i);\n remainderBinLen = remainderBinLen % blockSize;\n\n /* Pad out the remainder to a full block */\n while (remainder.length < binaryStringInc) {\n remainder.push(0);\n }\n\n /* Find the next \"empty\" byte for the 0x80 and append it via an xor */\n i = remainderBinLen >>> 3;\n remainder[i >> 2] ^= delimiter << (8 * (i % 4));\n\n remainder[binaryStringInc - 1] ^= 0x80000000;\n state = roundSHA3(remainder, state);\n\n while (retVal.length * 32 < outputLen) {\n temp = state[state_offset % 5][(state_offset / 5) | 0];\n retVal.push(temp.lowOrder);\n if (retVal.length * 32 >= outputLen) {\n break;\n }\n retVal.push(temp.highOrder);\n state_offset += 1;\n\n if (0 === (state_offset * 64) % blockSize) {\n roundSHA3(null, state);\n state_offset = 0;\n }\n }\n\n return retVal;\n}\n\n/**\n * Performs NIST left_encode function returned with no extra garbage bits. `x` is limited to <= 9007199254740991.\n *\n * @param x 32-bit number to to encode.\n * @returns The NIST specified output of the function.\n */\nfunction left_encode(x: number): packedValue {\n let byteOffset,\n byte,\n numEncodedBytes = 0;\n /* JavaScript numbers max out at 0x1FFFFFFFFFFFFF (7 bytes) so this will return a maximum of 7 + 1 = 8 bytes */\n const retVal = [0, 0],\n x_64 = [x & 0xffffffff, (x / TWO_PWR_32) & 0x1fffff];\n\n for (byteOffset = 6; byteOffset >= 0; byteOffset--) {\n /* This will surprisingly work for large shifts because JavaScript masks the shift amount by 0x1F */\n byte = (x_64[byteOffset >> 2] >>> (8 * byteOffset)) & 0xff;\n\n /* Starting from the most significant byte of a 64-bit number, start recording the first non-0 byte and then\n every byte thereafter */\n if (byte !== 0 || numEncodedBytes !== 0) {\n retVal[(numEncodedBytes + 1) >> 2] |= byte << ((numEncodedBytes + 1) * 8);\n numEncodedBytes += 1;\n }\n }\n numEncodedBytes = numEncodedBytes !== 0 ? numEncodedBytes : 1;\n retVal[0] |= numEncodedBytes;\n\n return { value: numEncodedBytes + 1 > 4 ? retVal : [retVal[0]], binLen: 8 + numEncodedBytes * 8 };\n}\n\n/**\n * Performs NIST right_encode function returned with no extra garbage bits. `x` is limited to <= 9007199254740991.\n *\n * @param x 32-bit number to to encode.\n * @returns The NIST specified output of the function.\n */\nfunction right_encode(x: number): packedValue {\n let byteOffset,\n byte,\n numEncodedBytes = 0;\n /* JavaScript numbers max out at 0x1FFFFFFFFFFFFF (7 bytes) so this will return a maximum of 7 + 1 = 8 bytes */\n const retVal = [0, 0],\n x_64 = [x & 0xffffffff, (x / TWO_PWR_32) & 0x1fffff];\n\n for (byteOffset = 6; byteOffset >= 0; byteOffset--) {\n /* This will surprisingly work for large shifts because JavaScript masks the shift amount by 0x1F */\n byte = (x_64[byteOffset >> 2] >>> (8 * byteOffset)) & 0xff;\n\n /* Starting from the most significant byte of a 64-bit number, start recording the first non-0 byte and then\n every byte thereafter */\n if (byte !== 0 || numEncodedBytes !== 0) {\n retVal[numEncodedBytes >> 2] |= byte << (numEncodedBytes * 8);\n numEncodedBytes += 1;\n }\n }\n numEncodedBytes = numEncodedBytes !== 0 ? numEncodedBytes : 1;\n retVal[numEncodedBytes >> 2] |= numEncodedBytes << (numEncodedBytes * 8);\n\n return { value: numEncodedBytes + 1 > 4 ? retVal : [retVal[0]], binLen: 8 + numEncodedBytes * 8 };\n}\n\n/**\n * Performs NIST encode_string function.\n *\n * @param input Packed array of integers.\n * @returns NIST encode_string output.\n */\nfunction encode_string(input: packedValue): packedValue {\n return packedLEConcat(left_encode(input[\"binLen\"]), input);\n}\n\n/**\n * Performs NIST byte_pad function.\n *\n * @param packed Packed array of integers.\n * @param outputByteLen Desired length of the output in bytes, assumed to be a multiple of 4.\n * @returns NIST byte_pad output.\n */\nfunction byte_pad(packed: packedValue, outputByteLen: number): number[] {\n let encodedLen = left_encode(outputByteLen),\n i;\n\n encodedLen = packedLEConcat(encodedLen, packed);\n const outputIntLen = outputByteLen >>> 2,\n intsToAppend = (outputIntLen - (encodedLen[\"value\"].length % outputIntLen)) % outputIntLen;\n\n for (i = 0; i < intsToAppend; i++) {\n encodedLen[\"value\"].push(0);\n }\n\n return encodedLen[\"value\"];\n}\n\n/**\n * Parses/validate constructor options for a CSHAKE variant\n *\n * @param options Option given to constructor\n */\nfunction resolveCSHAKEOptions(options: CSHAKEOptionsNoEncodingType): ResolvedCSHAKEOptionsNoEncodingType {\n const resolvedOptions = options || {};\n\n return {\n funcName: parseInputOption(\"funcName\", resolvedOptions[\"funcName\"], 1, { value: [], binLen: 0 }),\n customization: parseInputOption(\"Customization\", resolvedOptions[\"customization\"], 1, { value: [], binLen: 0 }),\n };\n}\n\n/**\n * Parses/validate constructor options for a KMAC variant\n *\n * @param options Option given to constructor\n */\nfunction resolveKMACOptions(options: KMACOptionsNoEncodingType): ResolvedKMACOptionsNoEncodingType {\n const resolvedOptions = options || {};\n\n return {\n kmacKey: parseInputOption(\"kmacKey\", resolvedOptions[\"kmacKey\"], 1),\n /* This is little-endian packed \"KMAC\" */\n funcName: { value: [0x43414d4b], binLen: 32 },\n customization: parseInputOption(\"Customization\", resolvedOptions[\"customization\"], 1, { value: [], binLen: 0 }),\n };\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: Int_64[][];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: Int_64[][]) => Int_64[][];\n finalizeFunc: (\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: Int_64[][],\n outputLen: number\n ) => number[];\n stateCloneFunc: (state: Int_64[][]) => Int_64[][];\n newStateFunc: (variant: VariantType) => Int_64[][];\n getMAC: ((options: { outputLen: number }) => number[]) | null;\n\n constructor(variant: FixedLengthVariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(\n variant: FixedLengthVariantType,\n inputFormat: FormatNoTextType,\n options?: FixedLengthOptionsNoEncodingType\n );\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: \"TEXT\", options?: SHAKEOptionsEncodingType);\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: FormatNoTextType, options?: SHAKEOptionsNoEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: \"TEXT\", options?: CSHAKEOptionsEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: FormatNoTextType, options?: CSHAKEOptionsNoEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: \"TEXT\", options: KMACOptionsEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: FormatNoTextType, options: KMACOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n let delimiter = 0x06,\n variantBlockSize = 0;\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n /* In other variants, this was done after variable initialization but need to do it earlier here becaue we want to\n avoid KMAC initialization */\n if (this.numRounds !== 1) {\n if (resolvedOptions[\"kmacKey\"] || resolvedOptions[\"hmacKey\"]) {\n throw new Error(mac_rounds_error);\n } else if (this.shaVariant === \"CSHAKE128\" || this.shaVariant === \"CSHAKE256\") {\n throw new Error(\"Cannot set numRounds for CSHAKE variants\");\n }\n }\n\n this.bigEndianMod = 1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA3;\n this.stateCloneFunc = cloneSHA3State;\n this.newStateFunc = getNewState;\n this.intermediateState = getNewState(variant);\n\n this.isVariableLen = false;\n switch (variant) {\n case \"SHA3-224\":\n this.variantBlockSize = variantBlockSize = 1152;\n this.outputBinLen = 224;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-256\":\n this.variantBlockSize = variantBlockSize = 1088;\n this.outputBinLen = 256;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-384\":\n this.variantBlockSize = variantBlockSize = 832;\n this.outputBinLen = 384;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-512\":\n this.variantBlockSize = variantBlockSize = 576;\n this.outputBinLen = 512;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHAKE128\":\n delimiter = 0x1f;\n this.variantBlockSize = variantBlockSize = 1344;\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"SHAKE256\":\n delimiter = 0x1f;\n this.variantBlockSize = variantBlockSize = 1088;\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"KMAC128\":\n delimiter = 0x4;\n this.variantBlockSize = variantBlockSize = 1344;\n this._initializeKMAC(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getKMAC;\n break;\n case \"KMAC256\":\n delimiter = 0x4;\n this.variantBlockSize = variantBlockSize = 1088;\n this._initializeKMAC(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getKMAC;\n break;\n case \"CSHAKE128\":\n this.variantBlockSize = variantBlockSize = 1344;\n delimiter = this._initializeCSHAKE(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"CSHAKE256\":\n this.variantBlockSize = variantBlockSize = 1088;\n delimiter = this._initializeCSHAKE(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n default:\n throw new Error(sha_variant_error);\n }\n\n /* This needs to be down here as CSHAKE can change its delimiter */\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, state, outputBinLen): number[] {\n return finalizeSHA3(\n remainder,\n remainderBinLen,\n processedBinLen,\n state,\n variantBlockSize,\n delimiter,\n outputBinLen\n );\n };\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n\n /**\n * Initialize CSHAKE variants.\n *\n * @param options Options containing CSHAKE params.\n * @param funcNameOverride Overrides any \"funcName\" present in `options` (used with KMAC)\n * @returns The delimiter to be used\n */\n protected _initializeCSHAKE(options?: CSHAKEOptionsNoEncodingType, funcNameOverride?: packedValue): number {\n const resolvedOptions = resolveCSHAKEOptions(options || {});\n if (funcNameOverride) {\n resolvedOptions[\"funcName\"] = funcNameOverride;\n }\n const packedParams = packedLEConcat(\n encode_string(resolvedOptions[\"funcName\"]),\n encode_string(resolvedOptions[\"customization\"])\n );\n\n /* CSHAKE is defined to be a call to SHAKE iff both the customization and function-name string are both empty. This\n can be accomplished by processing nothing in this step. */\n if (resolvedOptions[\"customization\"][\"binLen\"] !== 0 || resolvedOptions[\"funcName\"][\"binLen\"] !== 0) {\n const byte_pad_out = byte_pad(packedParams, this.variantBlockSize >>> 3);\n for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) {\n this.intermediateState = this.roundFunc(\n byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)),\n this.intermediateState\n );\n this.processedLen += this.variantBlockSize;\n }\n return 0x04;\n } else {\n return 0x1f;\n }\n }\n\n /**\n * Initialize KMAC variants.\n *\n * @param options Options containing KMAC params.\n */\n protected _initializeKMAC(options: KMACOptionsNoEncodingType): void {\n const resolvedOptions = resolveKMACOptions(options || {});\n\n this._initializeCSHAKE(options, resolvedOptions[\"funcName\"]);\n const byte_pad_out = byte_pad(encode_string(resolvedOptions[\"kmacKey\"]), this.variantBlockSize >>> 3);\n for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) {\n this.intermediateState = this.roundFunc(\n byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)),\n this.intermediateState\n );\n this.processedLen += this.variantBlockSize;\n }\n this.macKeySet = true;\n }\n\n /**\n * Returns the the KMAC in the specified format.\n *\n * @param options Hashmap of extra outputs options. `outputLen` must be specified.\n * @returns The KMAC in the format specified.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected _getKMAC(options: { outputLen: number }): number[] {\n const concatedRemainder = packedLEConcat(\n { value: this.remainder.slice(), binLen: this.remainderLen },\n right_encode(options[\"outputLen\"])\n );\n\n return this.finalizeFunc(\n concatedRemainder[\"value\"],\n concatedRemainder[\"binLen\"],\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n options[\"outputLen\"]\n );\n }\n}\n","import { sha_variant_error } from \"./common\";\nimport {\n CSHAKEOptionsEncodingType,\n CSHAKEOptionsNoEncodingType,\n SHAKEOptionsEncodingType,\n SHAKEOptionsNoEncodingType,\n EncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n KMACOptionsNoEncodingType,\n KMACOptionsEncodingType,\n} from \"./custom_types\";\nimport jsSHA1 from \"./sha1\";\nimport jsSHA256 from \"./sha256\";\nimport jsSHA512 from \"./sha512\";\nimport jsSHA3 from \"./sha3\";\n\ntype FixedLengthVariantType =\n | \"SHA-1\"\n | \"SHA-224\"\n | \"SHA-256\"\n | \"SHA-384\"\n | \"SHA-512\"\n | \"SHA3-224\"\n | \"SHA3-256\"\n | \"SHA3-384\"\n | \"SHA3-512\";\n\nexport default class jsSHA {\n private readonly shaObj: jsSHA1 | jsSHA256 | jsSHA512 | jsSHA3;\n /**\n * @param variant The desired SHA variant (SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-256,\n * SHA3-384, SHA3-512, SHAKE128, SHAKE256, CSHAKE128, CSHAKE256, KMAC128, or KMAC256) as a string.\n * @param inputFormat The input format to be used in future `update` calls (TEXT, HEX, B64, BYTES, ARRAYBUFFER,\n * or UINT8ARRAY) as a string.\n * @param options Options in the form of { encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE\"; numRounds?: number }.\n * `encoding` is for only TEXT input (defaults to UTF8) and `numRounds` defaults to 1.\n * `numRounds` is not valid for any of the MAC or CSHAKE variants.\n * * If the variant supports HMAC, `options` may have an additional `hmacKey` key which must be in the form of\n * {value: , format: , encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE\"} where takes the same\n * values as `inputFormat` and can be a `string | ArrayBuffer | Uint8Array` depending on .\n * Supplying this key switches to HMAC calculation and replaces the now deprecated call to `setHMACKey`.\n * * If the variant is CSHAKE128 or CSHAKE256, `options` may have two additional keys, `customization` and `funcName`,\n * which are the NIST customization and function-name strings. Both must be in the same form as `hmacKey`.\n * * If the variant is KMAC128 or KMAC256, `options` can include the `customization` key from CSHAKE variants and\n * *must* have a `kmacKey` key that takes the same form as the `customization` key.\n */\n constructor(variant: FixedLengthVariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(\n variant: FixedLengthVariantType,\n inputFormat: FormatNoTextType,\n options?: FixedLengthOptionsNoEncodingType\n );\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: \"TEXT\", options?: SHAKEOptionsEncodingType);\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: FormatNoTextType, options?: SHAKEOptionsNoEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: \"TEXT\", options?: CSHAKEOptionsEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: FormatNoTextType, options?: CSHAKEOptionsNoEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: \"TEXT\", options: KMACOptionsEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: FormatNoTextType, options: KMACOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (\"SHA-1\" == variant) {\n this.shaObj = new jsSHA1(variant, inputFormat, options);\n } else if (\"SHA-224\" == variant || \"SHA-256\" == variant) {\n this.shaObj = new jsSHA256(variant, inputFormat, options);\n } else if (\"SHA-384\" == variant || \"SHA-512\" == variant) {\n this.shaObj = new jsSHA512(variant, inputFormat, options);\n } else if (\n \"SHA3-224\" == variant ||\n \"SHA3-256\" == variant ||\n \"SHA3-384\" == variant ||\n \"SHA3-512\" == variant ||\n \"SHAKE128\" == variant ||\n \"SHAKE256\" == variant ||\n \"CSHAKE128\" == variant ||\n \"CSHAKE256\" == variant ||\n \"KMAC128\" == variant ||\n \"KMAC256\" == variant\n ) {\n this.shaObj = new jsSHA3(variant, inputFormat, options);\n } else {\n throw new Error(sha_variant_error);\n }\n }\n\n /**\n * Takes `input` and hashes as many blocks as possible. Stores the rest for either a future `update` or `getHash` call.\n *\n * @param input The input to be hashed.\n * @returns A reference to the object.\n */\n update(input: string | ArrayBuffer | Uint8Array): this {\n this.shaObj.update(input);\n\n return this;\n }\n\n /**\n * Returns the desired SHA or MAC (if a HMAC/KMAC key was specified) hash of the input fed in via `update` calls.\n *\n * @param format The desired output formatting (B64, HEX, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { outputUpper?: boolean; b64Pad?: string; outputLen?: number; }.\n * `outputLen` is required for variable length output variants (this option was previously called `shakeLen` which\n * is now deprecated).\n * `outputUpper` is only for HEX output (defaults to false) and b64pad is only for B64 output (defaults to \"=\").\n * @returns The hash in the format specified.\n */\n getHash(format: \"HEX\", options?: { outputUpper?: boolean; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"B64\", options?: { b64Pad?: string; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"BYTES\", options?: { outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"UINT8ARRAY\", options?: { outputLen?: number; shakeLen?: number }): Uint8Array;\n getHash(format: \"ARRAYBUFFER\", options?: { outputLen?: number; shakeLen?: number }): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHash(format: any, options?: any): any {\n return this.shaObj.getHash(format, options);\n }\n\n /**\n * Sets the HMAC key for an eventual `getHMAC` call. Must be called immediately after jsSHA object instantiation.\n * Now deprecated in favor of setting the `hmacKey` at object instantiation.\n *\n * @param key The key used to calculate the HMAC\n * @param inputFormat The format of key (HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE }. `encoding` is only for TEXT\n * and defaults to UTF8.\n */\n setHMACKey(key: string, inputFormat: \"TEXT\", options?: { encoding?: EncodingType }): void;\n setHMACKey(key: string, inputFormat: \"B64\" | \"HEX\" | \"BYTES\"): void;\n setHMACKey(key: ArrayBuffer, inputFormat: \"ARRAYBUFFER\"): void;\n setHMACKey(key: Uint8Array, inputFormat: \"UINT8ARRAY\"): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setHMACKey(key: any, inputFormat: any, options?: any): void {\n this.shaObj.setHMACKey(key, inputFormat, options);\n }\n\n /**\n * Returns the the HMAC in the specified format using the key given by a previous `setHMACKey` call. Now deprecated\n * in favor of just calling `getHash`.\n *\n * @param format The desired output formatting (B64, HEX, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { outputUpper?: boolean; b64Pad?: string }. `outputUpper` is only for HEX\n * output (defaults to false) and `b64pad` is only for B64 output (defaults to \"=\").\n * @returns The HMAC in the format specified.\n */\n getHMAC(format: \"HEX\", options?: { outputUpper?: boolean }): string;\n getHMAC(format: \"B64\", options?: { b64Pad?: string }): string;\n getHMAC(format: \"BYTES\"): string;\n getHMAC(format: \"UINT8ARRAY\"): Uint8Array;\n getHMAC(format: \"ARRAYBUFFER\"): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHMAC(format: any, options?: any): any {\n return this.shaObj.getHMAC(format, options);\n }\n}\n"],"names":["b64Tab","arraybuffer_error","uint8array_error","uint8array2packed","arr","existingPacked","existingPackedLen","bigEndianMod","i","intOffset","byteOffset","packed","existingByteLen","shiftModifier","length","push","value","binLen","getStrConverter","format","utfType","Error","str","existingBin","existingBinLen","num","parseInt","substr","isNaN","hex2packed","codePnt","codePntArr","j","transposeBytes","byteCnt","charCodeAt","str2packed","tmpInt","strPart","firstEqual","indexOf","search","replace","charAt","b642packed","bytes2packed","ArrayBuffer","ignore","Uint8Array","arraybuffer2packed","getOutputConverter","outputBinLen","outputOptions","binarray","outputLength","formatOpts","srcByte","hex_tab","toUpperCase","packed2hex","triplet","int1","int2","packed2b64","String","fromCharCode","packed2bytes","retVal","arrView","packed2arraybuffer","packed2uint8array","TWO_PWR_32","K_sha2","H_trunc","H_full","sha_variant_error","mac_rounds_error","packedLEConcat","a","b","arrOffset","aByteLen","bByteLen","leftShiftAmount","rightShiftAmount","pop","concat","getOutputOpts","options","outputUpper","b64Pad","outputLen","lenErrstr","parseInputOption","key","fallback","errStr","jsSHABase","variant","inputFormat","inputOptions","this","numRounds","shaVariant","remainder","remainderLen","updateCalled","processedLen","macKeySet","keyWithIPad","keyWithOPad","prototype","update","srcString","updateProcessedLen","variantBlockIntInc","variantBlockSize","convertRet","converterFunc","chunkBinLen","chunk","chunkIntLen","intermediateState","roundFunc","slice","getHash","finalizedState","isVariableLen","formatFunc","getMAC","finalizeFunc","stateCloneFunc","newStateFunc","setHMACKey","HMACSupported","keyConverterFunc","_setHMACKey","blockByteSize","lastArrayIndex","getHMAC","_getHMAC","firstHash","extendStatics","d","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","call","__extends","TypeError","__","constructor","create","rotl_32","x","n","rotr_32","shr_32","parity_32","y","z","ch_32","maj_32","sigma0_32","safeAdd_32_2","lsw","safeAdd_32_4","c","safeAdd_32_5","e","gamma0_32","sigma1_32","getNewState","_variant","roundSHA1","block","H","T","t","W","finalizeSHA1","remainderBinLen","processedBinLen","offset","totalLen","SuppressedError","jsSHA","_super","_this","resolvedOptions","state","getNewState256","roundSHA256","f","g","h","T1","T2","finalizeSHA256","Int_64","msint_32","lsint_32","highOrder","lowOrder","rotl_64","tmp","rotr_64","shr_64","ch_64","maj_64","sigma0_64","rotr28","rotr34","rotr39","safeAdd_64_2","msw","safeAdd_64_4","safeAdd_64_5","xor_64_2","gamma0_64","rotr1","rotr8","shr7","sigma1_64","rotr14","rotr18","rotr41","K_sha512","getNewState512","roundSHA512","rotr19","rotr61","shr6","finalizeSHA512","rc_sha3","r_sha3","cloneSHA3State","clone","roundSHA3","round","B","C","D","left_encode","byte","numEncodedBytes","x_64","encode_string","input","byte_pad","outputByteLen","encodedLen","outputIntLen","intsToAppend","delimiter","_initializeKMAC","_getKMAC","_initializeCSHAKE","_processedBinLen","blockSize","temp","state_offset","binaryStringInc","remainderIntLen","finalizeSHA3","funcNameOverride","funcName","customization","resolveCSHAKEOptions","packedParams","byte_pad_out","kmacKey","resolveKMACOptions","concatedRemainder","right_encode","shaObj","jsSHA1","jsSHA256","jsSHA512","jsSHA3"],"mappings":";;;;;;;;;;;;;;;;;;;;sOAIA,IAAMA,EAAS,mEAETC,EAAoB,gDACpBC,EAAmB,+CAyPzB,SAASC,EACPC,EACAC,EACAC,EACAC,GAEA,IAAIC,EAAGC,EAAWC,EAGZC,EAASN,GAAkB,CAAC,GAChCO,GAFFN,EAAoBA,GAAqB,KAEC,EACxCO,GAAkC,IAAlBN,EAAsB,EAAI,EAE5C,IAAKC,EAAI,EAAGA,EAAIJ,EAAIU,OAAQN,GAAK,EAE/BC,GADAC,EAAaF,EAAII,KACU,EACvBD,EAAOG,QAAUL,GACnBE,EAAOI,KAAK,GAEdJ,EAAOF,IAAcL,EAAII,IAAO,GAAKK,EAAgBN,GAAgBG,EAAa,IAGpF,MAAO,CAAEM,MAAOL,EAAQM,OAAqB,EAAbb,EAAIU,OAAaR,EACnD,UA4BgBY,EACdC,EACAC,EACAb,GAIA,OAAQa,GACN,IAAK,OAEL,IAAK,UAEL,IAAK,UAEH,MACF,QACE,MAAM,IAAIC,MAAM,8CAIpB,OAAQF,GACN,IAAK,MAOH,OAAO,SAAUG,EAAaC,EAAwBC,GACpD,OA9NR,SACEF,EACAjB,EACAC,EACAC,GAEA,IAAIC,EAAGiB,EAAKhB,EAAWC,EAEvB,GAAI,GAAMY,EAAIR,OAAS,EACrB,MAAM,IAAIO,MAAM,iDAIlB,IAAMV,EAASN,GAAkB,CAAC,GAChCO,GAFFN,EAAoBA,GAAqB,KAEC,EACxCO,GAAkC,IAAlBN,EAAsB,EAAI,EAE5C,IAAKC,EAAI,EAAGA,EAAIc,EAAIR,OAAQN,GAAK,EAAG,CAElC,GADAiB,EAAMC,SAASJ,EAAIK,OAAOnB,EAAG,GAAI,IAC5BoB,MAAMH,GA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L,EAAmB,YAGlC,OAAOa,KAAK6B,EACVkJ,EAAyB,MACzBA,EAA0B,OAC1B/K,KAAKM,EACLN,KAAK8B,EAAe9B,KAAKqB,GACzBlC,EAAmB,YAGxBqG,CAAD,CAnPA,CAAmC5F,UC/TnC,WAgCE,SAAA4F,EAAY3F,EAAcC,EAAkBX,GAC1C,GAAI,SAAWU,EACbG,KAAKiL,EAAS,IAAIC,EAAOrL,EAASC,EAAaX,QAC1C,GAAI,WAAaU,GAAW,WAAaA,EAC9CG,KAAKiL,EAAS,IAAIE,EAAStL,EAASC,EAAaX,QAC5C,GAAI,WAAaU,GAAW,WAAaA,EAC9CG,KAAKiL,EAAS,IAAIG,EAASvL,EAASC,EAAaX,OAC5C,IACL,YAAcU,GACd,YAAcA,GACd,YAAcA,GACd,YAAcA,GACd,YAAcA,GACd,YAAcA,GACd,aAAeA,GACf,aAAeA,GACf,WAAaA,GACb,WAAaA,EAIb,MAAM,IAAI7E,MAAMsD,GAFhB0B,KAAKiL,EAAS,IAAII,GAAOxL,EAASC,EAAaX,EAGhD,CACF,CAsEH,OA9DEqG,EAAM9E,UAAAC,OAAN,SAAO2I,GAGL,OAFAtJ,KAAKiL,EAAOtK,OAAO2I,GAEZtJ,MAmBTwF,EAAA9E,UAAAc,QAAA,SAAQ1G,EAAaqE,GACnB,OAAOa,KAAKiL,EAAOzJ,QAAQ1G,EAAQqE,IAiBrCqG,EAAA9E,UAAAsB,WAAA,SAAWvC,EAAUK,EAAkBX,GACrCa,KAAKiL,EAAOjJ,WAAWvC,EAAKK,EAAaX,IAkB3CqG,EAAA9E,UAAA4B,QAAA,SAAQxH,EAAaqE,GACnB,OAAOa,KAAKiL,EAAO3I,QAAQxH,EAAQqE,IAEtCqG,CAAD","x_google_ignoreList":[2]} \ No newline at end of file +{"version":3,"file":"sha.js","sources":["../src/converters.ts","../src/common.ts","../node_modules/tslib/tslib.es6.js","../src/primitives_32.ts","../src/sha1.ts","../src/sha256.ts","../src/primitives_64.ts","../src/sha512.ts","../src/sha3.ts","../src/sha.ts"],"sourcesContent":["import { packedValue, EncodingType, FormatType } from \"./custom_types\";\n/**\n * Return type for all the *2packed functions\n */\nconst b64Tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\nconst arraybuffer_error = \"ARRAYBUFFER not supported by this environment\";\nconst uint8array_error = \"UINT8ARRAY not supported by this environment\";\n\n/**\n * Convert a string to an array of words.\n *\n * There is a known bug with an odd number of existing bytes and using a UTF-16 encoding. However, this function is\n * used such that the existing bytes are always a result of a previous UTF-16 str2packed call and therefore there \n * should never be an odd number of existing bytes.\n\n * @param str Unicode string to be converted to binary representation.\n * @param utfType The Unicode type to use to encode the source string.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked`.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction str2packed(\n str: string,\n utfType: EncodingType,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let codePnt,\n codePntArr,\n byteCnt = 0,\n i,\n j,\n intOffset,\n byteOffset,\n shiftModifier,\n transposeBytes;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3;\n\n if (\"UTF8\" === utfType) {\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n codePntArr = [];\n\n if (0x80 > codePnt) {\n codePntArr.push(codePnt);\n } else if (0x800 > codePnt) {\n codePntArr.push(0xc0 | (codePnt >>> 6));\n codePntArr.push(0x80 | (codePnt & 0x3f));\n } else if (0xd800 > codePnt || 0xe000 <= codePnt) {\n codePntArr.push(0xe0 | (codePnt >>> 12), 0x80 | ((codePnt >>> 6) & 0x3f), 0x80 | (codePnt & 0x3f));\n } else {\n i += 1;\n codePnt = 0x10000 + (((codePnt & 0x3ff) << 10) | (str.charCodeAt(i) & 0x3ff));\n codePntArr.push(\n 0xf0 | (codePnt >>> 18),\n 0x80 | ((codePnt >>> 12) & 0x3f),\n 0x80 | ((codePnt >>> 6) & 0x3f),\n 0x80 | (codePnt & 0x3f),\n );\n }\n\n for (j = 0; j < codePntArr.length; j += 1) {\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n /* Known bug kicks in here */\n packed[intOffset] |= codePntArr[j] << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 1;\n }\n }\n } else {\n /* UTF16BE or UTF16LE */\n shiftModifier = bigEndianMod === -1 ? 2 : 0;\n /* Internally strings are UTF-16BE so transpose bytes under two conditions:\n * need LE and not switching endianness due to SHA-3\n * need BE and switching endianness due to SHA-3 */\n transposeBytes = (\"UTF16LE\" === utfType && bigEndianMod !== 1) || (\"UTF16LE\" !== utfType && bigEndianMod === 1);\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n if (transposeBytes === true) {\n j = codePnt & 0xff;\n codePnt = (j << 8) | (codePnt >>> 8);\n }\n\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= codePnt << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 2;\n }\n }\n return { value: packed, binLen: byteCnt * 8 + existingPackedLen };\n}\n\n/**\n * Convert a hex string to an array of words.\n *\n * @param str Hexadecimal string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction hex2packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let i, num, intOffset, byteOffset;\n\n if (0 !== str.length % 2) {\n throw new Error(\"String of HEX type must be in byte increments\");\n }\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < str.length; i += 2) {\n num = parseInt(str.substr(i, 2), 16);\n if (!isNaN(num)) {\n byteOffset = (i >>> 1) + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= num << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n } else {\n throw new Error(\"String of HEX type contains invalid characters\");\n }\n }\n\n return { value: packed, binLen: str.length * 4 + existingPackedLen };\n}\n\n/**\n * Convert a string of raw bytes to an array of words.\n *\n * @param str String of raw bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction bytes2packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let codePnt, i, intOffset, byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n\n byteOffset = i + existingByteLen;\n intOffset = byteOffset >>> 2;\n if (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= codePnt << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n }\n\n return { value: packed, binLen: str.length * 8 + existingPackedLen };\n}\n\n/**\n * Convert a base-64 string to an array of words.\n *\n * @param str Base64-encoded string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction b642packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let byteCnt = 0,\n index,\n i,\n j,\n tmpInt,\n strPart,\n intOffset,\n byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0,\n firstEqual = str.indexOf(\"=\");\n\n if (-1 === str.search(/^[a-zA-Z0-9=+/]+$/)) {\n throw new Error(\"Invalid character in base-64 string\");\n }\n\n str = str.replace(/=/g, \"\");\n if (-1 !== firstEqual && firstEqual < str.length) {\n throw new Error(\"Invalid '=' found in base-64 string\");\n }\n\n for (i = 0; i < str.length; i += 4) {\n strPart = str.substr(i, 4);\n tmpInt = 0;\n\n for (j = 0; j < strPart.length; j += 1) {\n index = b64Tab.indexOf(strPart.charAt(j));\n tmpInt |= index << (18 - 6 * j);\n }\n\n for (j = 0; j < strPart.length - 1; j += 1) {\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |=\n ((tmpInt >>> (16 - j * 8)) & 0xff) << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 1;\n }\n }\n\n return { value: packed, binLen: byteCnt * 8 + existingPackedLen };\n}\n\n/**\n * Convert an Uint8Array to an array of words.\n *\n * @param arr Uint8Array to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction uint8array2packed(\n arr: Uint8Array,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let i, intOffset, byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < arr.length; i += 1) {\n byteOffset = i + existingByteLen;\n intOffset = byteOffset >>> 2;\n if (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= arr[i] << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n }\n\n return { value: packed, binLen: arr.length * 8 + existingPackedLen };\n}\n\n/**\n * Convert an ArrayBuffer to an array of words\n *\n * @param arr ArrayBuffer to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction arraybuffer2packed(\n arr: ArrayBuffer,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n return uint8array2packed(new Uint8Array(arr), existingPacked, existingPackedLen, bigEndianMod);\n}\n\n/**\n * Function that takes an input format and UTF encoding and returns the appropriate function used to convert the input.\n *\n * @param format The format of the input to be converted\n * @param utfType The string encoding to use for TEXT inputs.\n * @param bigEndianMod Modifier for whether hash function is big or small endian\n * @returns Function that will convert an input to a packed int array.\n */\nexport function getStrConverter(\n format: FormatType,\n utfType: EncodingType,\n bigEndianMod: -1 | 1,\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n): (input: any, existingBin?: number[], existingBinLen?: number) => packedValue {\n /* Validate encoding */\n switch (utfType) {\n case \"UTF8\":\n /* Fallthrough */\n case \"UTF16BE\":\n /* Fallthrough */\n case \"UTF16LE\":\n /* Fallthrough */\n break;\n default:\n throw new Error(\"encoding must be UTF8, UTF16BE, or UTF16LE\");\n }\n\n /* Map inputFormat to the appropriate converter */\n switch (format) {\n case \"HEX\":\n /**\n * @param str String of hexadecimal bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return hex2packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"TEXT\":\n /**\n * @param str Unicode string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return str2packed(str, utfType, existingBin, existingBinLen, bigEndianMod);\n };\n case \"B64\":\n /**\n * @param str Base64-encoded string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return b642packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"BYTES\":\n /**\n * @param str String of raw bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return bytes2packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"ARRAYBUFFER\":\n try {\n new ArrayBuffer(0);\n } catch {\n throw new Error(arraybuffer_error);\n }\n /**\n * @param arr ArrayBuffer to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (arr: ArrayBuffer, existingBin?: number[], existingBinLen?: number): packedValue {\n return arraybuffer2packed(arr, existingBin, existingBinLen, bigEndianMod);\n };\n case \"UINT8ARRAY\":\n try {\n new Uint8Array(0);\n } catch {\n throw new Error(uint8array_error);\n }\n /**\n * @param arr Uint8Array to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (arr: Uint8Array, existingBin?: number[], existingBinLen?: number): packedValue {\n return uint8array2packed(arr, existingBin, existingBinLen, bigEndianMod);\n };\n default:\n throw new Error(\"format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\");\n }\n}\n\n/**\n * Convert an array of words to a hexadecimal string.\n *\n * toString() won't work here because it removes preceding zeros (e.g. 0x00000001.toString === \"1\" rather than\n * \"00000001\" and 0.toString(16) === \"0\" rather than \"00\").\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param formatOpts Hashmap containing validated output formatting options.\n * @returns Hexadecimal representation of `packed`.\n */\nexport function packed2hex(\n packed: number[],\n outputLength: number,\n bigEndianMod: -1 | 1,\n formatOpts: { outputUpper: boolean; b64Pad: string },\n): string {\n const hex_tab = \"0123456789abcdef\";\n let str = \"\",\n i,\n srcByte;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n /* The below is more than a byte but it gets taken care of later */\n srcByte = packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)));\n str += hex_tab.charAt((srcByte >>> 4) & 0xf) + hex_tab.charAt(srcByte & 0xf);\n }\n\n return formatOpts[\"outputUpper\"] ? str.toUpperCase() : str;\n}\n\n/**\n * Convert an array of words to a base-64 string.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param formatOpts Hashmap containing validated output formatting options.\n * @returns Base64-encoded representation of `packed`.\n */\nexport function packed2b64(\n packed: number[],\n outputLength: number,\n bigEndianMod: -1 | 1,\n formatOpts: { outputUpper: boolean; b64Pad: string },\n): string {\n let str = \"\",\n i,\n j,\n triplet,\n int1,\n int2;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 3) {\n int1 = i + 1 < length ? packed[(i + 1) >>> 2] : 0;\n int2 = i + 2 < length ? packed[(i + 2) >>> 2] : 0;\n triplet =\n (((packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff) << 16) |\n (((int1 >>> (8 * (shiftModifier + bigEndianMod * ((i + 1) % 4)))) & 0xff) << 8) |\n ((int2 >>> (8 * (shiftModifier + bigEndianMod * ((i + 2) % 4)))) & 0xff);\n for (j = 0; j < 4; j += 1) {\n if (i * 8 + j * 6 <= outputLength) {\n str += b64Tab.charAt((triplet >>> (6 * (3 - j))) & 0x3f);\n } else {\n str += formatOpts[\"b64Pad\"];\n }\n }\n }\n return str;\n}\n\n/**\n * Convert an array of words to raw bytes string.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Raw bytes representation of `packed`.\n */\nexport function packed2bytes(packed: number[], outputLength: number, bigEndianMod: -1 | 1): string {\n let str = \"\",\n i,\n srcByte;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n srcByte = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n str += String.fromCharCode(srcByte);\n }\n\n return str;\n}\n\n/**\n * Convert an array of words to an ArrayBuffer.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns An ArrayBuffer containing bytes from `packed.\n */\nexport function packed2arraybuffer(packed: number[], outputLength: number, bigEndianMod: -1 | 1): ArrayBuffer {\n let i;\n const length = outputLength / 8,\n retVal = new ArrayBuffer(length),\n arrView = new Uint8Array(retVal),\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n arrView[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n }\n\n return retVal;\n}\n\n/**\n * Convert an array of words to an Uint8Array.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns An Uint8Array containing bytes from `packed.\n */\nexport function packed2uint8array(packed: number[], outputLength: number, bigEndianMod: -1 | 1): Uint8Array {\n let i;\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0,\n retVal = new Uint8Array(length);\n\n for (i = 0; i < length; i += 1) {\n retVal[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n }\n\n return retVal;\n}\n\n/**\n * Function that takes an output format and associated parameters and returns a function that converts packed integers\n * to that format.\n *\n * @param format The desired output formatting.\n * @param outputBinLen Output length in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param outputOptions Hashmap of output formatting options\n * @returns Function that will convert a packed integer array to desired format.\n */\nexport function getOutputConverter(\n format: \"HEX\" | \"B64\" | \"BYTES\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string },\n): (binarray: number[]) => string;\nexport function getOutputConverter(\n format: \"ARRAYBUFFER\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string },\n): (binarray: number[]) => ArrayBuffer;\nexport function getOutputConverter(\n format: \"UINT8ARRAY\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string },\n): (binarray: number[]) => Uint8Array;\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nexport function getOutputConverter(format: any, outputBinLen: any, bigEndianMod: any, outputOptions: any): any {\n switch (format) {\n case \"HEX\":\n return function (binarray: number[]): string {\n return packed2hex(binarray, outputBinLen, bigEndianMod, outputOptions);\n };\n case \"B64\":\n return function (binarray: number[]): string {\n return packed2b64(binarray, outputBinLen, bigEndianMod, outputOptions);\n };\n case \"BYTES\":\n return function (binarray: number[]): string {\n return packed2bytes(binarray, outputBinLen, bigEndianMod);\n };\n case \"ARRAYBUFFER\":\n try {\n /* Need to test ArrayBuffer support */\n new ArrayBuffer(0);\n } catch {\n throw new Error(arraybuffer_error);\n }\n return function (binarray: number[]): ArrayBuffer {\n return packed2arraybuffer(binarray, outputBinLen, bigEndianMod);\n };\n case \"UINT8ARRAY\":\n try {\n /* Need to test Uint8Array support */\n new Uint8Array(0);\n } catch {\n throw new Error(uint8array_error);\n }\n return function (binarray: number[]): Uint8Array {\n return packed2uint8array(binarray, outputBinLen, bigEndianMod);\n };\n default:\n throw new Error(\"format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\");\n }\n}\n","import { getStrConverter, getOutputConverter } from \"./converters\";\n\nimport {\n FormatType,\n EncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n packedValue,\n GenericInputType,\n} from \"./custom_types\";\n\nexport const TWO_PWR_32 = 4294967296;\n\n/* Constant used in SHA-2 families */\nexport const K_sha2 = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98,\n 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,\n 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8,\n 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,\n 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7,\n 0xc67178f2,\n];\n\n/* Constant used in SHA-2 families */\nexport const H_trunc = [0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4];\n\n/* Constant used in SHA-2 families */\nexport const H_full = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19];\n\nexport const sha_variant_error = \"Chosen SHA variant is not supported\";\nexport const mac_rounds_error = \"Cannot set numRounds with MAC\";\n\n/**\n * Concatenates 2 packed arrays. Clobbers array `a`.\n *\n * @param a First array to concatenate.\n * @param b Second array to concatenate.\n * @returns The concatentation of `a` + `b`.\n */\nexport function packedLEConcat(a: packedValue, b: packedValue): packedValue {\n let i, arrOffset;\n const aByteLen = a[\"binLen\"] >>> 3,\n bByteLen = b[\"binLen\"] >>> 3,\n leftShiftAmount = aByteLen << 3,\n rightShiftAmount = (4 - aByteLen) << 3;\n\n /* If a only contains \"full\" integers, we can just use concat which is so much easier */\n if (aByteLen % 4 !== 0) {\n for (i = 0; i < bByteLen; i += 4) {\n arrOffset = (aByteLen + i) >>> 2;\n /* Left shift chops off bits over 32-bits */\n a[\"value\"][arrOffset] |= b[\"value\"][i >>> 2] << leftShiftAmount;\n a[\"value\"].push(0);\n a[\"value\"][arrOffset + 1] |= b[\"value\"][i >>> 2] >>> rightShiftAmount;\n }\n\n /* Since an unconditional push was performed above, we may have pushed an extra value if it could have been\n encoded without it. Check if popping an int off (reducing total length by 4 bytes) is still bigger than the\n needed size. */\n if ((a[\"value\"].length << 2) - 4 >= bByteLen + aByteLen) {\n a[\"value\"].pop();\n }\n\n return { value: a[\"value\"], binLen: a[\"binLen\"] + b[\"binLen\"] };\n } else {\n return { value: a[\"value\"].concat(b[\"value\"]), binLen: a[\"binLen\"] + b[\"binLen\"] };\n }\n}\n\n/**\n * Validate hash list containing output formatting options, ensuring presence of every option or adding the default\n * value.\n *\n * @param options Hashmap of output formatting options from user.\n * @returns Validated hashmap containing output formatting options.\n */\nexport function getOutputOpts(options?: {\n outputUpper?: boolean;\n b64Pad?: string;\n shakeLen?: number;\n outputLen?: number;\n}): { outputUpper: boolean; b64Pad: string; outputLen: number } {\n const retVal = { outputUpper: false, b64Pad: \"=\", outputLen: -1 },\n outputOptions: { outputUpper?: boolean; b64Pad?: string; shakeLen?: number; outputLen?: number } = options || {},\n lenErrstr = \"Output length must be a multiple of 8\";\n\n retVal[\"outputUpper\"] = outputOptions[\"outputUpper\"] || false;\n\n if (outputOptions[\"b64Pad\"]) {\n retVal[\"b64Pad\"] = outputOptions[\"b64Pad\"];\n }\n\n if (outputOptions[\"outputLen\"]) {\n if (outputOptions[\"outputLen\"] % 8 !== 0) {\n throw new Error(lenErrstr);\n }\n retVal[\"outputLen\"] = outputOptions[\"outputLen\"];\n } else if (outputOptions[\"shakeLen\"]) {\n if (outputOptions[\"shakeLen\"] % 8 !== 0) {\n throw new Error(lenErrstr);\n }\n retVal[\"outputLen\"] = outputOptions[\"shakeLen\"];\n }\n\n if (\"boolean\" !== typeof retVal[\"outputUpper\"]) {\n throw new Error(\"Invalid outputUpper formatting option\");\n }\n\n if (\"string\" !== typeof retVal[\"b64Pad\"]) {\n throw new Error(\"Invalid b64Pad formatting option\");\n }\n\n return retVal;\n}\n\n/**\n * Parses an external constructor object and returns a packed number, if possible.\n *\n * @param key The human-friendly key name to prefix any errors with\n * @param value The input value object to parse\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param fallback Fallback value if `value` is undefined. If not present and `value` is undefined, an Error is thrown\n */\nexport function parseInputOption(\n key: string,\n value: GenericInputType | undefined,\n bigEndianMod: -1 | 1,\n fallback?: packedValue,\n): packedValue {\n const errStr = key + \" must include a value and format\";\n if (!value) {\n if (!fallback) {\n throw new Error(errStr);\n }\n return fallback;\n }\n\n if (typeof value[\"value\"] === \"undefined\" || !value[\"format\"]) {\n throw new Error(errStr);\n }\n\n return getStrConverter(\n value[\"format\"],\n // @ts-ignore - the value of encoding gets value checked by getStrConverter\n value[\"encoding\"] || \"UTF8\",\n bigEndianMod,\n )(value[\"value\"]);\n}\n\nexport abstract class jsSHABase {\n /**\n * @param variant The desired SHA variant.\n * @param inputFormat The input format to be used in future `update` calls.\n * @param options Hashmap of extra input options.\n */\n /* Needed inputs */\n protected readonly shaVariant: VariantT;\n protected readonly inputFormat: FormatType;\n protected readonly utfType: EncodingType;\n protected readonly numRounds: number;\n\n /* State */\n protected abstract intermediateState: StateT;\n protected keyWithIPad: number[];\n protected keyWithOPad: number[];\n protected remainder: number[];\n protected remainderLen: number;\n protected updateCalled: boolean;\n protected processedLen: number;\n protected macKeySet: boolean;\n\n /* Variant specifics */\n protected abstract readonly variantBlockSize: number;\n protected abstract readonly bigEndianMod: -1 | 1;\n protected abstract readonly outputBinLen: number;\n protected abstract readonly isVariableLen: boolean;\n protected abstract readonly HMACSupported: boolean;\n\n /* Functions */\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n protected abstract readonly converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n protected abstract readonly roundFunc: (block: number[], H: StateT) => StateT;\n protected abstract readonly finalizeFunc: (\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: StateT,\n outputLen: number,\n ) => number[];\n protected abstract readonly stateCloneFunc: (state: StateT) => StateT;\n protected abstract readonly newStateFunc: (variant: VariantT) => StateT;\n protected abstract readonly getMAC: ((options: { outputLen: number }) => number[]) | null;\n\n protected constructor(variant: VariantT, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n protected constructor(variant: VariantT, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected constructor(variant: any, inputFormat: any, options?: any) {\n const inputOptions = options || {};\n this.inputFormat = inputFormat;\n\n this.utfType = inputOptions[\"encoding\"] || \"UTF8\";\n this.numRounds = inputOptions[\"numRounds\"] || 1;\n\n // @ts-ignore - The spec actually says ToString is called on the first parseInt argument so it's OK to use it here\n // to check if an arugment is an integer. This cheat would break if it's used to get the value of the argument.\n if (isNaN(this.numRounds) || this.numRounds !== parseInt(this.numRounds, 10) || 1 > this.numRounds) {\n throw new Error(\"numRounds must a integer >= 1\");\n }\n\n this.shaVariant = variant;\n this.remainder = [];\n this.remainderLen = 0;\n this.updateCalled = false;\n this.processedLen = 0;\n this.macKeySet = false;\n this.keyWithIPad = [];\n this.keyWithOPad = [];\n }\n\n /**\n * Hashes as many blocks as possible. Stores the rest for either a future update or getHash call.\n *\n * @param srcString The input to be hashed.\n * @returns A reference to the object.\n */\n update(srcString: string | ArrayBuffer | Uint8Array): this {\n let i,\n updateProcessedLen = 0;\n const variantBlockIntInc = this.variantBlockSize >>> 5,\n convertRet = this.converterFunc(srcString, this.remainder, this.remainderLen),\n chunkBinLen = convertRet[\"binLen\"],\n chunk = convertRet[\"value\"],\n chunkIntLen = chunkBinLen >>> 5;\n\n for (i = 0; i < chunkIntLen; i += variantBlockIntInc) {\n if (updateProcessedLen + this.variantBlockSize <= chunkBinLen) {\n this.intermediateState = this.roundFunc(chunk.slice(i, i + variantBlockIntInc), this.intermediateState);\n updateProcessedLen += this.variantBlockSize;\n }\n }\n this.processedLen += updateProcessedLen;\n this.remainder = chunk.slice(updateProcessedLen >>> 5);\n this.remainderLen = chunkBinLen % this.variantBlockSize;\n this.updateCalled = true;\n\n return this;\n }\n\n /**\n * Returns the desired SHA hash of the input fed in via `update` calls.\n *\n * @param format The desired output formatting\n * @param options Hashmap of output formatting options. `outputLen` must be specified for variable length hashes.\n * `outputLen` replaces the now deprecated `shakeLen` key.\n * @returns The hash in the format specified.\n */\n getHash(format: \"HEX\", options?: { outputUpper?: boolean; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"B64\", options?: { b64Pad?: string; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"BYTES\", options?: { outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"UINT8ARRAY\", options?: { outputLen?: number; shakeLen?: number }): Uint8Array;\n getHash(format: \"ARRAYBUFFER\", options?: { outputLen?: number; shakeLen?: number }): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHash(format: any, options?: any): any {\n let i,\n finalizedState,\n outputBinLen = this.outputBinLen;\n\n const outputOptions = getOutputOpts(options);\n\n if (this.isVariableLen) {\n if (outputOptions[\"outputLen\"] === -1) {\n throw new Error(\"Output length must be specified in options\");\n }\n outputBinLen = outputOptions[\"outputLen\"];\n }\n\n const formatFunc = getOutputConverter(format, outputBinLen, this.bigEndianMod, outputOptions);\n if (this.macKeySet && this.getMAC) {\n return formatFunc(this.getMAC(outputOptions));\n }\n\n finalizedState = this.finalizeFunc(\n this.remainder.slice(),\n this.remainderLen,\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n outputBinLen,\n );\n for (i = 1; i < this.numRounds; i += 1) {\n /* Need to mask out bits that should be zero due to output not being a multiple of 32 */\n if (this.isVariableLen && outputBinLen % 32 !== 0) {\n finalizedState[finalizedState.length - 1] &= 0x00ffffff >>> (24 - (outputBinLen % 32));\n }\n finalizedState = this.finalizeFunc(\n finalizedState,\n outputBinLen,\n 0,\n this.newStateFunc(this.shaVariant),\n outputBinLen,\n );\n }\n\n return formatFunc(finalizedState);\n }\n\n /**\n * Sets the HMAC key for an eventual `getHMAC` call. Must be called immediately after jsSHA object instantiation.\n *\n * @param key The key used to calculate the HMAC\n * @param inputFormat The format of key.\n * @param options Hashmap of extra input options.\n */\n setHMACKey(key: string, inputFormat: \"TEXT\", options?: { encoding?: EncodingType }): void;\n setHMACKey(key: string, inputFormat: \"B64\" | \"HEX\" | \"BYTES\"): void;\n setHMACKey(key: ArrayBuffer, inputFormat: \"ARRAYBUFFER\"): void;\n setHMACKey(key: Uint8Array, inputFormat: \"UINT8ARRAY\"): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setHMACKey(key: any, inputFormat: any, options?: any): void {\n if (!this.HMACSupported) {\n throw new Error(\"Variant does not support HMAC\");\n }\n\n if (this.updateCalled) {\n throw new Error(\"Cannot set MAC key after calling update\");\n }\n\n const keyOptions = options || {},\n keyConverterFunc = getStrConverter(inputFormat, keyOptions[\"encoding\"] || \"UTF8\", this.bigEndianMod);\n\n this._setHMACKey(keyConverterFunc(key));\n }\n\n /**\n * Internal function that sets the MAC key.\n *\n * @param key The packed MAC key to use\n */\n protected _setHMACKey(key: packedValue): void {\n const blockByteSize = this.variantBlockSize >>> 3,\n lastArrayIndex = blockByteSize / 4 - 1;\n let i;\n if (this.numRounds !== 1) {\n throw new Error(mac_rounds_error);\n }\n\n if (this.macKeySet) {\n throw new Error(\"MAC key already set\");\n }\n\n /* Figure out what to do with the key based on its size relative to\n * the hash's block size */\n if (blockByteSize < key[\"binLen\"] / 8) {\n key[\"value\"] = this.finalizeFunc(\n key[\"value\"],\n key[\"binLen\"],\n 0,\n this.newStateFunc(this.shaVariant),\n this.outputBinLen,\n );\n }\n while (key[\"value\"].length <= lastArrayIndex) {\n key[\"value\"].push(0);\n }\n /* Create ipad and opad */\n for (i = 0; i <= lastArrayIndex; i += 1) {\n this.keyWithIPad[i] = key[\"value\"][i] ^ 0x36363636;\n this.keyWithOPad[i] = key[\"value\"][i] ^ 0x5c5c5c5c;\n }\n\n this.intermediateState = this.roundFunc(this.keyWithIPad, this.intermediateState);\n this.processedLen = this.variantBlockSize;\n\n this.macKeySet = true;\n }\n\n /**\n * Returns the the HMAC in the specified format using the key given by a previous `setHMACKey` call.\n *\n * @param format The desired output formatting.\n * @param options Hashmap of extra outputs options.\n * @returns The HMAC in the format specified.\n */\n getHMAC(format: \"HEX\", options?: { outputUpper?: boolean }): string;\n getHMAC(format: \"B64\", options?: { b64Pad?: string }): string;\n getHMAC(format: \"BYTES\"): string;\n getHMAC(format: \"UINT8ARRAY\"): Uint8Array;\n getHMAC(format: \"ARRAYBUFFER\"): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHMAC(format: any, options?: any): any {\n const outputOptions = getOutputOpts(options),\n formatFunc = getOutputConverter(format, this.outputBinLen, this.bigEndianMod, outputOptions);\n\n return formatFunc(this._getHMAC());\n }\n\n /**\n * Internal function that returns the \"raw\" HMAC\n */\n protected _getHMAC(): number[] {\n let finalizedState;\n\n if (!this.macKeySet) {\n throw new Error(\"Cannot call getHMAC without first setting MAC key\");\n }\n\n const firstHash = this.finalizeFunc(\n this.remainder.slice(),\n this.remainderLen,\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n this.outputBinLen,\n );\n finalizedState = this.roundFunc(this.keyWithOPad, this.newStateFunc(this.shaVariant));\n finalizedState = this.finalizeFunc(\n firstHash,\n this.outputBinLen,\n this.variantBlockSize,\n finalizedState,\n this.outputBinLen,\n );\n\n return finalizedState;\n }\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/*\n * Note 1: All the functions in this file guarantee only that the bottom 32-bits of the return value are correct.\n * JavaScript is flakey when it comes to bit operations and a '1' in the highest order bit of a 32-bit number causes\n * it to be interpreted as a negative number per two's complement.\n *\n * Note 2: Per the ECMAScript spec, all JavaScript operations mask the shift amount by 0x1F. This results in weird\n * cases like 1 << 32 == 1 and 1 << 33 === 1 << 1 === 2\n */\n\n/**\n * The 32-bit implementation of circular rotate left.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted left circularly by `n` bits\n */\nexport function rotl_32(x: number, n: number): number {\n return (x << n) | (x >>> (32 - n));\n}\n\n/**\n * The 32-bit implementation of circular rotate right.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right circularly by `n` bits\n */\nfunction rotr_32(x: number, n: number): number {\n return (x >>> n) | (x << (32 - n));\n}\n\n/**\n * The 32-bit implementation of shift right.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted by `n` bits.\n */\nfunction shr_32(x: number, n: number): number {\n return x >>> n;\n}\n\n/**\n * The 32-bit implementation of the NIST specified Parity function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function parity_32(x: number, y: number, z: number): number {\n return x ^ y ^ z;\n}\n\n/**\n * The 32-bit implementation of the NIST specified Ch function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function ch_32(x: number, y: number, z: number): number {\n return (x & y) ^ (~x & z);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Maj function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function maj_32(x: number, y: number, z: number): number {\n return (x & y) ^ (x & z) ^ (y & z);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Sigma0 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma0_32(x: number): number {\n return rotr_32(x, 2) ^ rotr_32(x, 13) ^ rotr_32(x, 22);\n}\n\n/**\n * Add two 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @returns The sum of `a` + `b`.\n */\nexport function safeAdd_32_2(a: number, b: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * Add four 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @param c The third 32-bit integer argument to be added.\n * @param d The fourth 32-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d`.\n */\nexport function safeAdd_32_4(a: number, b: number, c: number, d: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff) + (c & 0xffff) + (d & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * Add five 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @param c The third 32-bit integer argument to be added.\n * @param d The fourth 32-bit integer argument to be added.\n * @param e The fifth 32-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d` + `e`.\n */\nexport function safeAdd_32_5(a: number, b: number, c: number, d: number, e: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff) + (c & 0xffff) + (d & 0xffff) + (e & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (e >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Gamma1 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma1_32(x: number): number {\n return rotr_32(x, 17) ^ rotr_32(x, 19) ^ shr_32(x, 10);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Gamma0 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma0_32(x: number): number {\n return rotr_32(x, 7) ^ rotr_32(x, 18) ^ shr_32(x, 3);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Sigma1 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma1_32(x: number): number {\n return rotr_32(x, 6) ^ rotr_32(x, 11) ^ rotr_32(x, 25);\n}\n","import { jsSHABase, TWO_PWR_32, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport { ch_32, parity_32, maj_32, rotl_32, safeAdd_32_2, safeAdd_32_5 } from \"./primitives_32\";\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param _variant: Unused\n * @returns The initial state values.\n */\nfunction getNewState(_variant: \"SHA-1\"): number[] {\n return [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n}\n\n/**\n * Performs a round of SHA-1 hashing over a 512-byte block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA1(block: number[], H: number[]): number[] {\n let a, b, c, d, e, T, t;\n const W: number[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n\n for (t = 0; t < 80; t += 1) {\n if (t < 16) {\n W[t] = block[t];\n } else {\n W[t] = rotl_32(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n if (t < 20) {\n T = safeAdd_32_5(rotl_32(a, 5), ch_32(b, c, d), e, 0x5a827999, W[t]);\n } else if (t < 40) {\n T = safeAdd_32_5(rotl_32(a, 5), parity_32(b, c, d), e, 0x6ed9eba1, W[t]);\n } else if (t < 60) {\n T = safeAdd_32_5(rotl_32(a, 5), maj_32(b, c, d), e, 0x8f1bbcdc, W[t]);\n } else {\n T = safeAdd_32_5(rotl_32(a, 5), parity_32(b, c, d), e, 0xca62c1d6, W[t]);\n }\n\n e = d;\n d = c;\n c = rotl_32(b, 30);\n b = a;\n a = T;\n }\n\n H[0] = safeAdd_32_2(a, H[0]);\n H[1] = safeAdd_32_2(b, H[1]);\n H[2] = safeAdd_32_2(c, H[2]);\n H[3] = safeAdd_32_2(d, H[3]);\n H[4] = safeAdd_32_2(e, H[4]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-1 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @returns The array of integers representing the SHA-1 hash of message.\n */\nfunction finalizeSHA1(remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]): number[] {\n let i;\n\n /* The 65 addition is a hack but it works. The correct number is\n\t\tactually 72 (64 + 8) but the below math fails if\n\t\tremainderBinLen + 72 % 512 = 0. Since remainderBinLen % 8 = 0,\n\t\t\"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 65) >>> 9) << 4) + 15,\n totalLen = remainderBinLen + processedBinLen;\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n\n /* Append length of binary string in the position such that the new\n * length is a multiple of 512. Logic does not work for even multiples\n * of 512 but there can never be even multiples of 512. JavaScript\n * numbers are limited to 2^53 so it's \"safe\" to treat the totalLen as\n * a 64-bit integer. */\n remainder[offset] = totalLen & 0xffffffff;\n\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += 16) {\n H = roundSHA1(remainder.slice(i, i + 16), H);\n }\n\n return H;\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: number[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: number[]) => number[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]) => number[];\n stateCloneFunc: (state: number[]) => number[];\n newStateFunc: (variant: \"SHA-1\") => number[];\n getMAC: () => number[];\n\n constructor(variant: \"SHA-1\", inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: \"SHA-1\", inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (\"SHA-1\" !== variant) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA1;\n this.stateCloneFunc = function (state: number[]): number[] {\n return state.slice();\n };\n this.newStateFunc = getNewState;\n this.finalizeFunc = finalizeSHA1;\n\n this.intermediateState = getNewState(variant);\n this.variantBlockSize = 512;\n this.outputBinLen = 160;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","import { jsSHABase, TWO_PWR_32, H_full, H_trunc, K_sha2, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport {\n ch_32,\n gamma0_32,\n gamma1_32,\n maj_32,\n safeAdd_32_2,\n safeAdd_32_4,\n safeAdd_32_5,\n sigma0_32,\n sigma1_32,\n} from \"./primitives_32\";\n\ntype VariantType = \"SHA-224\" | \"SHA-256\";\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param variant: The SHA-256 family variant.\n * @returns The initial state values.\n */\nfunction getNewState256(variant: VariantType): number[] {\n let retVal;\n\n if (\"SHA-224\" == variant) {\n retVal = H_trunc.slice();\n } else {\n /* \"SHA-256\" */\n retVal = H_full.slice();\n }\n return retVal;\n}\n\n/**\n * Performs a round of SHA-256 hashing over a block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA256(block: number[], H: number[]): number[] {\n let a, b, c, d, e, f, g, h, T1, T2, t;\n\n const W: number[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n f = H[5];\n g = H[6];\n h = H[7];\n\n for (t = 0; t < 64; t += 1) {\n if (t < 16) {\n W[t] = block[t];\n } else {\n W[t] = safeAdd_32_4(gamma1_32(W[t - 2]), W[t - 7], gamma0_32(W[t - 15]), W[t - 16]);\n }\n T1 = safeAdd_32_5(h, sigma1_32(e), ch_32(e, f, g), K_sha2[t], W[t]);\n T2 = safeAdd_32_2(sigma0_32(a), maj_32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = safeAdd_32_2(d, T1);\n d = c;\n c = b;\n b = a;\n a = safeAdd_32_2(T1, T2);\n }\n\n H[0] = safeAdd_32_2(a, H[0]);\n H[1] = safeAdd_32_2(b, H[1]);\n H[2] = safeAdd_32_2(c, H[2]);\n H[3] = safeAdd_32_2(d, H[3]);\n H[4] = safeAdd_32_2(e, H[4]);\n H[5] = safeAdd_32_2(f, H[5]);\n H[6] = safeAdd_32_2(g, H[6]);\n H[7] = safeAdd_32_2(h, H[7]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-256 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @param variant The desired SHA-256 variant.\n * @returns The array of integers representing the SHA-2 hash of message.\n */\nfunction finalizeSHA256(\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: number[],\n variant: VariantType\n): number[] {\n let i, retVal;\n\n /* The 65 addition is a hack but it works. The correct number is\n actually 72 (64 + 8) but the below math fails if\n remainderBinLen + 72 % 512 = 0. Since remainderBinLen % 8 = 0,\n \"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 65) >>> 9) << 4) + 15,\n binaryStringInc = 16,\n totalLen = remainderBinLen + processedBinLen;\n\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n /* Append length of binary string in the position such that the new\n * length is correct. JavaScript numbers are limited to 2^53 so it's\n * \"safe\" to treat the totalLen as a 64-bit integer. */\n\n remainder[offset] = totalLen & 0xffffffff;\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += binaryStringInc) {\n H = roundSHA256(remainder.slice(i, i + binaryStringInc), H);\n }\n\n if (\"SHA-224\" === variant) {\n retVal = [H[0], H[1], H[2], H[3], H[4], H[5], H[6]];\n } else {\n /* \"SHA-256 */\n retVal = H;\n }\n\n return retVal;\n}\nexport default class jsSHA extends jsSHABase {\n intermediateState: number[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: number[]) => number[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]) => number[];\n stateCloneFunc: (state: number[]) => number[];\n newStateFunc: (variant: VariantType) => number[];\n getMAC: () => number[];\n\n constructor(variant: VariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: VariantType, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (!(\"SHA-224\" === variant || \"SHA-256\" === variant)) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.HMACSupported = true;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA256;\n this.stateCloneFunc = function (state): number[] {\n return state.slice();\n };\n\n this.newStateFunc = getNewState256;\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, H): number[] {\n return finalizeSHA256(remainder, remainderBinLen, processedBinLen, H, variant);\n };\n\n this.intermediateState = getNewState256(variant);\n this.variantBlockSize = 512;\n this.outputBinLen = \"SHA-224\" === variant ? 224 : 256;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","/*\n * Note 1: All the functions in this file guarantee only that the bottom 32-bits of the returned Int_64 are correct.\n * JavaScript is flakey when it comes to bit operations and a '1' in the highest order bit of a 32-bit number causes\n * it to be interpreted as a negative number per two's complement.\n *\n * Note 2: Per the ECMAScript spec, all JavaScript operations mask the shift amount by 0x1F. This results in weird\n * cases like 1 << 32 == 1 and 1 << 33 === 1 << 1 === 2\n */\n\n/**\n * Int_64 is a object for 2 32-bit numbers emulating a 64-bit number.\n */\nexport class Int_64 {\n /**\n * @param msint_32 The most significant 32-bits of a 64-bit number.\n * @param lsint_32 The least significant 32-bits of a 64-bit number.\n */\n readonly highOrder: number;\n readonly lowOrder: number;\n constructor(msint_32: number, lsint_32: number) {\n this.highOrder = msint_32;\n this.lowOrder = lsint_32;\n }\n}\n\n/**\n * The 64-bit implementation of circular rotate left.\n *\n * This does not work for n >= 64 or n == 32 but those are never done.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted left circularly by `n` bits.\n */\nexport function rotl_64(x: Int_64, n: number): Int_64 {\n let tmp;\n if (n > 32) {\n tmp = 64 - n;\n return new Int_64((x.lowOrder << n) | (x.highOrder >>> tmp), (x.highOrder << n) | (x.lowOrder >>> tmp));\n } else if (0 !== n) {\n tmp = 32 - n;\n return new Int_64((x.highOrder << n) | (x.lowOrder >>> tmp), (x.lowOrder << n) | (x.highOrder >>> tmp));\n } else {\n return x;\n }\n}\n\n/**\n * The 64-bit implementation of circular rotate right.\n *\n * This does not work for n >= 64, n == 32, or n == 0 but those are never done.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right circularly by `n` bits.\n */\nfunction rotr_64(x: Int_64, n: number): Int_64 {\n let tmp;\n if (n < 32) {\n tmp = 32 - n;\n return new Int_64((x.highOrder >>> n) | (x.lowOrder << tmp), (x.lowOrder >>> n) | (x.highOrder << tmp));\n } else {\n tmp = 64 - n;\n return new Int_64((x.lowOrder >>> n) | (x.highOrder << tmp), (x.highOrder >>> n) | (x.lowOrder << tmp));\n }\n}\n\n/**\n * The 64-bit implementation of shift right.\n *\n * This does not work for n >= 32 but is only called for n < 32.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right by `n` bits\n */\nfunction shr_64(x: Int_64, n: number): Int_64 {\n return new Int_64(x.highOrder >>> n, (x.lowOrder >>> n) | (x.highOrder << (32 - n)));\n}\n\n/**\n * The 64-bit implementation of the NIST specified Ch function.\n *\n * @param x The first 64-bit integer argument.\n * @param y The second 64-bit integer argument.\n * @param z The third 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function ch_64(x: Int_64, y: Int_64, z: Int_64): Int_64 {\n return new Int_64(\n (x.highOrder & y.highOrder) ^ (~x.highOrder & z.highOrder),\n (x.lowOrder & y.lowOrder) ^ (~x.lowOrder & z.lowOrder)\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Maj function.\n *\n * @param x The first 64-bit integer argument.\n * @param y The second 64-bit integer argument.\n * @param z The third 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function maj_64(x: Int_64, y: Int_64, z: Int_64): Int_64 {\n return new Int_64(\n (x.highOrder & y.highOrder) ^ (x.highOrder & z.highOrder) ^ (y.highOrder & z.highOrder),\n (x.lowOrder & y.lowOrder) ^ (x.lowOrder & z.lowOrder) ^ (y.lowOrder & z.lowOrder)\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Sigma0 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma0_64(x: Int_64): Int_64 {\n const rotr28 = rotr_64(x, 28),\n rotr34 = rotr_64(x, 34),\n rotr39 = rotr_64(x, 39);\n\n return new Int_64(\n rotr28.highOrder ^ rotr34.highOrder ^ rotr39.highOrder,\n rotr28.lowOrder ^ rotr34.lowOrder ^ rotr39.lowOrder\n );\n}\n\n/**\n * Add two 64-bit integers.\n *\n * @param x The first 64-bit integer argument to be added.\n * @param y The second 64-bit integer argument to be added.\n * @returns The sum of `x` + `y`.\n */\nexport function safeAdd_64_2(x: Int_64, y: Int_64): Int_64 {\n let lsw, msw;\n\n lsw = (x.lowOrder & 0xffff) + (y.lowOrder & 0xffff);\n msw = (x.lowOrder >>> 16) + (y.lowOrder >>> 16) + (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw = (x.highOrder & 0xffff) + (y.highOrder & 0xffff) + (msw >>> 16);\n msw = (x.highOrder >>> 16) + (y.highOrder >>> 16) + (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * Add four 64-bit integers.\n *\n * @param a The first 64-bit integer argument to be added.\n * @param b The second 64-bit integer argument to be added.\n * @param c The third 64-bit integer argument to be added.\n * @param d The fouth 64-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d`.\n */\nexport function safeAdd_64_4(a: Int_64, b: Int_64, c: Int_64, d: Int_64): Int_64 {\n let lsw, msw;\n\n lsw = (a.lowOrder & 0xffff) + (b.lowOrder & 0xffff) + (c.lowOrder & 0xffff) + (d.lowOrder & 0xffff);\n msw = (a.lowOrder >>> 16) + (b.lowOrder >>> 16) + (c.lowOrder >>> 16) + (d.lowOrder >>> 16) + (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw =\n (a.highOrder & 0xffff) + (b.highOrder & 0xffff) + (c.highOrder & 0xffff) + (d.highOrder & 0xffff) + (msw >>> 16);\n msw = (a.highOrder >>> 16) + (b.highOrder >>> 16) + (c.highOrder >>> 16) + (d.highOrder >>> 16) + (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * Add five 64-bit integers.\n *\n * @param a The first 64-bit integer argument to be added.\n * @param b The second 64-bit integer argument to be added.\n * @param c The third 64-bit integer argument to be added.\n * @param d The fouth 64-bit integer argument to be added.\n * @param e The fifth 64-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d` + `e`.\n */\nexport function safeAdd_64_5(a: Int_64, b: Int_64, c: Int_64, d: Int_64, e: Int_64): Int_64 {\n let lsw, msw;\n\n lsw =\n (a.lowOrder & 0xffff) +\n (b.lowOrder & 0xffff) +\n (c.lowOrder & 0xffff) +\n (d.lowOrder & 0xffff) +\n (e.lowOrder & 0xffff);\n msw =\n (a.lowOrder >>> 16) +\n (b.lowOrder >>> 16) +\n (c.lowOrder >>> 16) +\n (d.lowOrder >>> 16) +\n (e.lowOrder >>> 16) +\n (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw =\n (a.highOrder & 0xffff) +\n (b.highOrder & 0xffff) +\n (c.highOrder & 0xffff) +\n (d.highOrder & 0xffff) +\n (e.highOrder & 0xffff) +\n (msw >>> 16);\n msw =\n (a.highOrder >>> 16) +\n (b.highOrder >>> 16) +\n (c.highOrder >>> 16) +\n (d.highOrder >>> 16) +\n (e.highOrder >>> 16) +\n (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * XORs two given arguments.\n *\n * @param a The first argument to be XORed.\n * @param b The second argument to be XORed.\n * @returns The The XOR `a` and `b`\n */\nexport function xor_64_2(a: Int_64, b: Int_64): Int_64 {\n return new Int_64(a.highOrder ^ b.highOrder, a.lowOrder ^ b.lowOrder);\n}\n\n/**\n * XORs five given arguments.\n *\n * @param a The first argument to be XORed.\n * @param b The second argument to be XORed.\n * @param c The third argument to be XORed.\n * @param d The fourth argument to be XORed.\n * @param e The fifth argument to be XORed.\n * @returns The XOR of `a`, `b`, `c`, `d`, and `e`.\n */\nexport function xor_64_5(a: Int_64, b: Int_64, c: Int_64, d: Int_64, e: Int_64): Int_64 {\n return new Int_64(\n a.highOrder ^ b.highOrder ^ c.highOrder ^ d.highOrder ^ e.highOrder,\n a.lowOrder ^ b.lowOrder ^ c.lowOrder ^ d.lowOrder ^ e.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Gamma1 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma1_64(x: Int_64): Int_64 {\n const rotr19 = rotr_64(x, 19),\n rotr61 = rotr_64(x, 61),\n shr6 = shr_64(x, 6);\n\n return new Int_64(\n rotr19.highOrder ^ rotr61.highOrder ^ shr6.highOrder,\n rotr19.lowOrder ^ rotr61.lowOrder ^ shr6.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Gamma0 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma0_64(x: Int_64): Int_64 {\n const rotr1 = rotr_64(x, 1),\n rotr8 = rotr_64(x, 8),\n shr7 = shr_64(x, 7);\n\n return new Int_64(\n rotr1.highOrder ^ rotr8.highOrder ^ shr7.highOrder,\n rotr1.lowOrder ^ rotr8.lowOrder ^ shr7.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Sigma1 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma1_64(x: Int_64): Int_64 {\n const rotr14 = rotr_64(x, 14),\n rotr18 = rotr_64(x, 18),\n rotr41 = rotr_64(x, 41);\n\n return new Int_64(\n rotr14.highOrder ^ rotr18.highOrder ^ rotr41.highOrder,\n rotr14.lowOrder ^ rotr18.lowOrder ^ rotr41.lowOrder\n );\n}\n","import { jsSHABase, TWO_PWR_32, H_trunc, H_full, K_sha2, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport {\n ch_64,\n gamma0_64,\n gamma1_64,\n Int_64,\n maj_64,\n safeAdd_64_2,\n safeAdd_64_4,\n safeAdd_64_5,\n sigma0_64,\n sigma1_64,\n} from \"./primitives_64\";\n\ntype VariantType = \"SHA-384\" | \"SHA-512\";\n\nconst K_sha512 = [\n new Int_64(K_sha2[0], 0xd728ae22),\n new Int_64(K_sha2[1], 0x23ef65cd),\n new Int_64(K_sha2[2], 0xec4d3b2f),\n new Int_64(K_sha2[3], 0x8189dbbc),\n new Int_64(K_sha2[4], 0xf348b538),\n new Int_64(K_sha2[5], 0xb605d019),\n new Int_64(K_sha2[6], 0xaf194f9b),\n new Int_64(K_sha2[7], 0xda6d8118),\n new Int_64(K_sha2[8], 0xa3030242),\n new Int_64(K_sha2[9], 0x45706fbe),\n new Int_64(K_sha2[10], 0x4ee4b28c),\n new Int_64(K_sha2[11], 0xd5ffb4e2),\n new Int_64(K_sha2[12], 0xf27b896f),\n new Int_64(K_sha2[13], 0x3b1696b1),\n new Int_64(K_sha2[14], 0x25c71235),\n new Int_64(K_sha2[15], 0xcf692694),\n new Int_64(K_sha2[16], 0x9ef14ad2),\n new Int_64(K_sha2[17], 0x384f25e3),\n new Int_64(K_sha2[18], 0x8b8cd5b5),\n new Int_64(K_sha2[19], 0x77ac9c65),\n new Int_64(K_sha2[20], 0x592b0275),\n new Int_64(K_sha2[21], 0x6ea6e483),\n new Int_64(K_sha2[22], 0xbd41fbd4),\n new Int_64(K_sha2[23], 0x831153b5),\n new Int_64(K_sha2[24], 0xee66dfab),\n new Int_64(K_sha2[25], 0x2db43210),\n new Int_64(K_sha2[26], 0x98fb213f),\n new Int_64(K_sha2[27], 0xbeef0ee4),\n new Int_64(K_sha2[28], 0x3da88fc2),\n new Int_64(K_sha2[29], 0x930aa725),\n new Int_64(K_sha2[30], 0xe003826f),\n new Int_64(K_sha2[31], 0x0a0e6e70),\n new Int_64(K_sha2[32], 0x46d22ffc),\n new Int_64(K_sha2[33], 0x5c26c926),\n new Int_64(K_sha2[34], 0x5ac42aed),\n new Int_64(K_sha2[35], 0x9d95b3df),\n new Int_64(K_sha2[36], 0x8baf63de),\n new Int_64(K_sha2[37], 0x3c77b2a8),\n new Int_64(K_sha2[38], 0x47edaee6),\n new Int_64(K_sha2[39], 0x1482353b),\n new Int_64(K_sha2[40], 0x4cf10364),\n new Int_64(K_sha2[41], 0xbc423001),\n new Int_64(K_sha2[42], 0xd0f89791),\n new Int_64(K_sha2[43], 0x0654be30),\n new Int_64(K_sha2[44], 0xd6ef5218),\n new Int_64(K_sha2[45], 0x5565a910),\n new Int_64(K_sha2[46], 0x5771202a),\n new Int_64(K_sha2[47], 0x32bbd1b8),\n new Int_64(K_sha2[48], 0xb8d2d0c8),\n new Int_64(K_sha2[49], 0x5141ab53),\n new Int_64(K_sha2[50], 0xdf8eeb99),\n new Int_64(K_sha2[51], 0xe19b48a8),\n new Int_64(K_sha2[52], 0xc5c95a63),\n new Int_64(K_sha2[53], 0xe3418acb),\n new Int_64(K_sha2[54], 0x7763e373),\n new Int_64(K_sha2[55], 0xd6b2b8a3),\n new Int_64(K_sha2[56], 0x5defb2fc),\n new Int_64(K_sha2[57], 0x43172f60),\n new Int_64(K_sha2[58], 0xa1f0ab72),\n new Int_64(K_sha2[59], 0x1a6439ec),\n new Int_64(K_sha2[60], 0x23631e28),\n new Int_64(K_sha2[61], 0xde82bde9),\n new Int_64(K_sha2[62], 0xb2c67915),\n new Int_64(K_sha2[63], 0xe372532b),\n new Int_64(0xca273ece, 0xea26619c),\n new Int_64(0xd186b8c7, 0x21c0c207),\n new Int_64(0xeada7dd6, 0xcde0eb1e),\n new Int_64(0xf57d4f7f, 0xee6ed178),\n new Int_64(0x06f067aa, 0x72176fba),\n new Int_64(0x0a637dc5, 0xa2c898a6),\n new Int_64(0x113f9804, 0xbef90dae),\n new Int_64(0x1b710b35, 0x131c471b),\n new Int_64(0x28db77f5, 0x23047d84),\n new Int_64(0x32caab7b, 0x40c72493),\n new Int_64(0x3c9ebe0a, 0x15c9bebc),\n new Int_64(0x431d67c4, 0x9c100d4c),\n new Int_64(0x4cc5d4be, 0xcb3e42b6),\n new Int_64(0x597f299c, 0xfc657e2a),\n new Int_64(0x5fcb6fab, 0x3ad6faec),\n new Int_64(0x6c44198c, 0x4a475817),\n];\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param variant: The SHA-512 family variant.\n * @returns The initial state values.\n */\nfunction getNewState512(variant: VariantType): Int_64[] {\n if (\"SHA-384\" === variant) {\n return [\n new Int_64(0xcbbb9d5d, H_trunc[0]),\n new Int_64(0x0629a292a, H_trunc[1]),\n new Int_64(0x9159015a, H_trunc[2]),\n new Int_64(0x0152fecd8, H_trunc[3]),\n new Int_64(0x67332667, H_trunc[4]),\n new Int_64(0x98eb44a87, H_trunc[5]),\n new Int_64(0xdb0c2e0d, H_trunc[6]),\n new Int_64(0x047b5481d, H_trunc[7]),\n ];\n } else {\n /* SHA-512 */\n return [\n new Int_64(H_full[0], 0xf3bcc908),\n new Int_64(H_full[1], 0x84caa73b),\n new Int_64(H_full[2], 0xfe94f82b),\n new Int_64(H_full[3], 0x5f1d36f1),\n new Int_64(H_full[4], 0xade682d1),\n new Int_64(H_full[5], 0x2b3e6c1f),\n new Int_64(H_full[6], 0xfb41bd6b),\n new Int_64(H_full[7], 0x137e2179),\n ];\n }\n}\n\n/**\n * Performs a round of SHA-512 hashing over a block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA512(block: number[], H: Int_64[]): Int_64[] {\n let a, b, c, d, e, f, g, h, T1, T2, t, offset;\n\n const W: Int_64[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n f = H[5];\n g = H[6];\n h = H[7];\n\n for (t = 0; t < 80; t += 1) {\n if (t < 16) {\n offset = t * 2;\n W[t] = new Int_64(block[offset], block[offset + 1]);\n } else {\n W[t] = safeAdd_64_4(gamma1_64(W[t - 2]), W[t - 7], gamma0_64(W[t - 15]), W[t - 16]);\n }\n T1 = safeAdd_64_5(h, sigma1_64(e), ch_64(e, f, g), K_sha512[t], W[t]);\n T2 = safeAdd_64_2(sigma0_64(a), maj_64(a, b, c));\n h = g;\n g = f;\n f = e;\n e = safeAdd_64_2(d, T1);\n d = c;\n c = b;\n b = a;\n a = safeAdd_64_2(T1, T2);\n }\n\n H[0] = safeAdd_64_2(a, H[0]);\n H[1] = safeAdd_64_2(b, H[1]);\n H[2] = safeAdd_64_2(c, H[2]);\n H[3] = safeAdd_64_2(d, H[3]);\n H[4] = safeAdd_64_2(e, H[4]);\n H[5] = safeAdd_64_2(f, H[5]);\n H[6] = safeAdd_64_2(g, H[6]);\n H[7] = safeAdd_64_2(h, H[7]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-512 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @param variant The desired SHA-512 variant.\n * @returns The array of integers representing the SHA-512 hash of message.\n */\nfunction finalizeSHA512(\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: Int_64[],\n variant: VariantType,\n): number[] {\n let i, retVal;\n\n /* The 129 addition is a hack but it works. The correct number is\n actually 136 (128 + 8) but the below math fails if\n remainderBinLen + 136 % 1024 = 0. Since remainderBinLen % 8 = 0,\n \"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 129) >>> 10) << 5) + 31,\n binaryStringInc = 32,\n totalLen = remainderBinLen + processedBinLen;\n\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n /* Append length of binary string in the position such that the new\n * length is correct. JavaScript numbers are limited to 2^53 so it's\n * \"safe\" to treat the totalLen as a 64-bit integer. */\n\n remainder[offset] = totalLen & 0xffffffff;\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += binaryStringInc) {\n H = roundSHA512(remainder.slice(i, i + binaryStringInc), H);\n }\n\n if (\"SHA-384\" === variant) {\n retVal = [\n H[0].highOrder,\n H[0].lowOrder,\n H[1].highOrder,\n H[1].lowOrder,\n H[2].highOrder,\n H[2].lowOrder,\n H[3].highOrder,\n H[3].lowOrder,\n H[4].highOrder,\n H[4].lowOrder,\n H[5].highOrder,\n H[5].lowOrder,\n ];\n } else {\n /* SHA-512 */\n retVal = [\n H[0].highOrder,\n H[0].lowOrder,\n H[1].highOrder,\n H[1].lowOrder,\n H[2].highOrder,\n H[2].lowOrder,\n H[3].highOrder,\n H[3].lowOrder,\n H[4].highOrder,\n H[4].lowOrder,\n H[5].highOrder,\n H[5].lowOrder,\n H[6].highOrder,\n H[6].lowOrder,\n H[7].highOrder,\n H[7].lowOrder,\n ];\n }\n return retVal;\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: Int_64[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: Int_64[]) => Int_64[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: Int_64[]) => number[];\n stateCloneFunc: (state: Int_64[]) => Int_64[];\n newStateFunc: (variant: VariantType) => Int_64[];\n getMAC: () => number[];\n\n constructor(variant: VariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: VariantType, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (!(\"SHA-384\" === variant || \"SHA-512\" === variant)) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.HMACSupported = true;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA512;\n this.stateCloneFunc = function (state): Int_64[] {\n return state.slice();\n };\n this.newStateFunc = getNewState512;\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, H): number[] {\n return finalizeSHA512(remainder, remainderBinLen, processedBinLen, H, variant);\n };\n\n this.intermediateState = getNewState512(variant);\n this.variantBlockSize = 1024;\n this.outputBinLen = \"SHA-384\" === variant ? 384 : 512;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","import { jsSHABase, packedLEConcat, sha_variant_error, mac_rounds_error, TWO_PWR_32, parseInputOption } from \"./common\";\nimport {\n packedValue,\n CSHAKEOptionsNoEncodingType,\n CSHAKEOptionsEncodingType,\n SHAKEOptionsNoEncodingType,\n SHAKEOptionsEncodingType,\n KMACOptionsNoEncodingType,\n KMACOptionsEncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n ResolvedCSHAKEOptionsNoEncodingType,\n ResolvedKMACOptionsNoEncodingType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport { Int_64, rotl_64, xor_64_2, xor_64_5 } from \"./primitives_64\";\n\ntype FixedLengthVariantType = \"SHA3-224\" | \"SHA3-256\" | \"SHA3-384\" | \"SHA3-512\" | \"SHAKE128\" | \"SHAKE256\";\n\ntype VariantType = FixedLengthVariantType | \"SHAKE128\" | \"SHAKE256\" | \"CSHAKE128\" | \"CSHAKE256\" | \"KMAC128\" | \"KMAC256\";\n\nconst rc_sha3 = [\n new Int_64(0x00000000, 0x00000001),\n new Int_64(0x00000000, 0x00008082),\n new Int_64(0x80000000, 0x0000808a),\n new Int_64(0x80000000, 0x80008000),\n new Int_64(0x00000000, 0x0000808b),\n new Int_64(0x00000000, 0x80000001),\n new Int_64(0x80000000, 0x80008081),\n new Int_64(0x80000000, 0x00008009),\n new Int_64(0x00000000, 0x0000008a),\n new Int_64(0x00000000, 0x00000088),\n new Int_64(0x00000000, 0x80008009),\n new Int_64(0x00000000, 0x8000000a),\n new Int_64(0x00000000, 0x8000808b),\n new Int_64(0x80000000, 0x0000008b),\n new Int_64(0x80000000, 0x00008089),\n new Int_64(0x80000000, 0x00008003),\n new Int_64(0x80000000, 0x00008002),\n new Int_64(0x80000000, 0x00000080),\n new Int_64(0x00000000, 0x0000800a),\n new Int_64(0x80000000, 0x8000000a),\n new Int_64(0x80000000, 0x80008081),\n new Int_64(0x80000000, 0x00008080),\n new Int_64(0x00000000, 0x80000001),\n new Int_64(0x80000000, 0x80008008),\n];\n\nconst r_sha3 = [\n [0, 36, 3, 41, 18],\n [1, 44, 10, 45, 2],\n [62, 6, 43, 15, 61],\n [28, 55, 25, 21, 56],\n [27, 20, 39, 8, 14],\n];\n\n/**\n * Gets the state values for the specified SHA-3 variant.\n *\n * @param _variant Unused for this family.\n * @returns The initial state values.\n */\nfunction getNewState(_variant: VariantType): Int_64[][] {\n let i;\n const retVal = [];\n\n for (i = 0; i < 5; i += 1) {\n retVal[i] = [new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0)];\n }\n\n return retVal;\n}\n\n/**\n * Returns a clone of the given SHA3 state.\n *\n * @param state The state to be cloned.\n * @returns The cloned state.\n */\nfunction cloneSHA3State(state: Int_64[][]): Int_64[][] {\n let i;\n const clone = [];\n for (i = 0; i < 5; i += 1) {\n clone[i] = state[i].slice();\n }\n\n return clone;\n}\n\n/**\n * Performs a round of SHA-3 hashing over a block. This clobbers `state`.\n *\n * @param block The binary array representation of the block to hash.\n * @param state Hash state from a previous round.\n * @returns The resulting state value.\n */\nfunction roundSHA3(block: number[] | null, state: Int_64[][]): Int_64[][] {\n let round, x, y, B;\n const C = [],\n D = [];\n\n if (null !== block) {\n for (x = 0; x < block.length; x += 2) {\n state[(x >>> 1) % 5][((x >>> 1) / 5) | 0] = xor_64_2(\n state[(x >>> 1) % 5][((x >>> 1) / 5) | 0],\n new Int_64(block[x + 1], block[x]),\n );\n }\n }\n\n for (round = 0; round < 24; round += 1) {\n /* Any SHA-3 variant name will do here */\n B = getNewState(\"SHA3-384\");\n\n /* Perform theta step */\n for (x = 0; x < 5; x += 1) {\n C[x] = xor_64_5(state[x][0], state[x][1], state[x][2], state[x][3], state[x][4]);\n }\n for (x = 0; x < 5; x += 1) {\n D[x] = xor_64_2(C[(x + 4) % 5], rotl_64(C[(x + 1) % 5], 1));\n }\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n state[x][y] = xor_64_2(state[x][y], D[x]);\n }\n }\n\n /* Perform combined ro and pi steps */\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n B[y][(2 * x + 3 * y) % 5] = rotl_64(state[x][y], r_sha3[x][y]);\n }\n }\n\n /* Perform chi step */\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n state[x][y] = xor_64_2(\n B[x][y],\n new Int_64(\n ~B[(x + 1) % 5][y].highOrder & B[(x + 2) % 5][y].highOrder,\n ~B[(x + 1) % 5][y].lowOrder & B[(x + 2) % 5][y].lowOrder,\n ),\n );\n }\n }\n\n /* Perform iota step */\n state[0][0] = xor_64_2(state[0][0], rc_sha3[round]);\n }\n\n return state;\n}\n\n/**\n * Finalizes the SHA-3 hash. This clobbers `remainder` and `state`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param _processedBinLen Unused for this family.\n * @param state The state from a previous round.\n * @param blockSize The block size/rate of the variant in bits\n * @param delimiter The delimiter value for the variant\n * @param outputLen The output length for the variant in bits\n * @returns The array of integers representing the SHA-3 hash of message.\n */\nfunction finalizeSHA3(\n remainder: number[],\n remainderBinLen: number,\n _processedBinLen: number,\n state: Int_64[][],\n blockSize: number,\n delimiter: number,\n outputLen: number,\n): number[] {\n let i,\n state_offset = 0,\n temp;\n const retVal = [],\n binaryStringInc = blockSize >>> 5,\n remainderIntLen = remainderBinLen >>> 5;\n\n /* Process as many blocks as possible, some may be here for multiple rounds\n\t\twith SHAKE\n\t*/\n for (i = 0; i < remainderIntLen && remainderBinLen >= blockSize; i += binaryStringInc) {\n state = roundSHA3(remainder.slice(i, i + binaryStringInc), state);\n remainderBinLen -= blockSize;\n }\n\n remainder = remainder.slice(i);\n remainderBinLen = remainderBinLen % blockSize;\n\n /* Pad out the remainder to a full block */\n while (remainder.length < binaryStringInc) {\n remainder.push(0);\n }\n\n /* Find the next \"empty\" byte for the 0x80 and append it via an xor */\n i = remainderBinLen >>> 3;\n remainder[i >> 2] ^= delimiter << (8 * (i % 4));\n\n remainder[binaryStringInc - 1] ^= 0x80000000;\n state = roundSHA3(remainder, state);\n\n while (retVal.length * 32 < outputLen) {\n temp = state[state_offset % 5][(state_offset / 5) | 0];\n retVal.push(temp.lowOrder);\n if (retVal.length * 32 >= outputLen) {\n break;\n }\n retVal.push(temp.highOrder);\n state_offset += 1;\n\n if (0 === (state_offset * 64) % blockSize) {\n roundSHA3(null, state);\n state_offset = 0;\n }\n }\n\n return retVal;\n}\n\n/**\n * Performs NIST left_encode function returned with no extra garbage bits. `x` is limited to <= 9007199254740991.\n *\n * @param x 32-bit number to to encode.\n * @returns The NIST specified output of the function.\n */\nfunction left_encode(x: number): packedValue {\n let byteOffset,\n byte,\n numEncodedBytes = 0;\n /* JavaScript numbers max out at 0x1FFFFFFFFFFFFF (7 bytes) so this will return a maximum of 7 + 1 = 8 bytes */\n const retVal = [0, 0],\n x_64 = [x & 0xffffffff, (x / TWO_PWR_32) & 0x1fffff];\n\n for (byteOffset = 6; byteOffset >= 0; byteOffset--) {\n /* This will surprisingly work for large shifts because JavaScript masks the shift amount by 0x1F */\n byte = (x_64[byteOffset >> 2] >>> (8 * byteOffset)) & 0xff;\n\n /* Starting from the most significant byte of a 64-bit number, start recording the first non-0 byte and then\n every byte thereafter */\n if (byte !== 0 || numEncodedBytes !== 0) {\n retVal[(numEncodedBytes + 1) >> 2] |= byte << ((numEncodedBytes + 1) * 8);\n numEncodedBytes += 1;\n }\n }\n numEncodedBytes = numEncodedBytes !== 0 ? numEncodedBytes : 1;\n retVal[0] |= numEncodedBytes;\n\n return { value: numEncodedBytes + 1 > 4 ? retVal : [retVal[0]], binLen: 8 + numEncodedBytes * 8 };\n}\n\n/**\n * Performs NIST right_encode function returned with no extra garbage bits. `x` is limited to <= 9007199254740991.\n *\n * @param x 32-bit number to to encode.\n * @returns The NIST specified output of the function.\n */\nfunction right_encode(x: number): packedValue {\n let byteOffset,\n byte,\n numEncodedBytes = 0;\n /* JavaScript numbers max out at 0x1FFFFFFFFFFFFF (7 bytes) so this will return a maximum of 7 + 1 = 8 bytes */\n const retVal = [0, 0],\n x_64 = [x & 0xffffffff, (x / TWO_PWR_32) & 0x1fffff];\n\n for (byteOffset = 6; byteOffset >= 0; byteOffset--) {\n /* This will surprisingly work for large shifts because JavaScript masks the shift amount by 0x1F */\n byte = (x_64[byteOffset >> 2] >>> (8 * byteOffset)) & 0xff;\n\n /* Starting from the most significant byte of a 64-bit number, start recording the first non-0 byte and then\n every byte thereafter */\n if (byte !== 0 || numEncodedBytes !== 0) {\n retVal[numEncodedBytes >> 2] |= byte << (numEncodedBytes * 8);\n numEncodedBytes += 1;\n }\n }\n numEncodedBytes = numEncodedBytes !== 0 ? numEncodedBytes : 1;\n retVal[numEncodedBytes >> 2] |= numEncodedBytes << (numEncodedBytes * 8);\n\n return { value: numEncodedBytes + 1 > 4 ? retVal : [retVal[0]], binLen: 8 + numEncodedBytes * 8 };\n}\n\n/**\n * Performs NIST encode_string function.\n *\n * @param input Packed array of integers.\n * @returns NIST encode_string output.\n */\nfunction encode_string(input: packedValue): packedValue {\n return packedLEConcat(left_encode(input[\"binLen\"]), input);\n}\n\n/**\n * Performs NIST byte_pad function.\n *\n * @param packed Packed array of integers.\n * @param outputByteLen Desired length of the output in bytes, assumed to be a multiple of 4.\n * @returns NIST byte_pad output.\n */\nfunction byte_pad(packed: packedValue, outputByteLen: number): number[] {\n let encodedLen = left_encode(outputByteLen),\n i;\n\n encodedLen = packedLEConcat(encodedLen, packed);\n const outputIntLen = outputByteLen >>> 2,\n intsToAppend = (outputIntLen - (encodedLen[\"value\"].length % outputIntLen)) % outputIntLen;\n\n for (i = 0; i < intsToAppend; i++) {\n encodedLen[\"value\"].push(0);\n }\n\n return encodedLen[\"value\"];\n}\n\n/**\n * Parses/validate constructor options for a CSHAKE variant\n *\n * @param options Option given to constructor\n */\nfunction resolveCSHAKEOptions(options: CSHAKEOptionsNoEncodingType): ResolvedCSHAKEOptionsNoEncodingType {\n const resolvedOptions = options || {};\n\n return {\n funcName: parseInputOption(\"funcName\", resolvedOptions[\"funcName\"], 1, { value: [], binLen: 0 }),\n customization: parseInputOption(\"Customization\", resolvedOptions[\"customization\"], 1, { value: [], binLen: 0 }),\n };\n}\n\n/**\n * Parses/validate constructor options for a KMAC variant\n *\n * @param options Option given to constructor\n */\nfunction resolveKMACOptions(options: KMACOptionsNoEncodingType): ResolvedKMACOptionsNoEncodingType {\n const resolvedOptions = options || {};\n\n return {\n kmacKey: parseInputOption(\"kmacKey\", resolvedOptions[\"kmacKey\"], 1),\n /* This is little-endian packed \"KMAC\" */\n funcName: { value: [0x43414d4b], binLen: 32 },\n customization: parseInputOption(\"Customization\", resolvedOptions[\"customization\"], 1, { value: [], binLen: 0 }),\n };\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: Int_64[][];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: Int_64[][]) => Int_64[][];\n finalizeFunc: (\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: Int_64[][],\n outputLen: number,\n ) => number[];\n stateCloneFunc: (state: Int_64[][]) => Int_64[][];\n newStateFunc: (variant: VariantType) => Int_64[][];\n getMAC: ((options: { outputLen: number }) => number[]) | null;\n\n constructor(variant: FixedLengthVariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(\n variant: FixedLengthVariantType,\n inputFormat: FormatNoTextType,\n options?: FixedLengthOptionsNoEncodingType,\n );\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: \"TEXT\", options?: SHAKEOptionsEncodingType);\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: FormatNoTextType, options?: SHAKEOptionsNoEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: \"TEXT\", options?: CSHAKEOptionsEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: FormatNoTextType, options?: CSHAKEOptionsNoEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: \"TEXT\", options: KMACOptionsEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: FormatNoTextType, options: KMACOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n let delimiter = 0x06,\n variantBlockSize = 0;\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n /* In other variants, this was done after variable initialization but need to do it earlier here becaue we want to\n avoid KMAC initialization */\n if (this.numRounds !== 1) {\n if (resolvedOptions[\"kmacKey\"] || resolvedOptions[\"hmacKey\"]) {\n throw new Error(mac_rounds_error);\n } else if (this.shaVariant === \"CSHAKE128\" || this.shaVariant === \"CSHAKE256\") {\n throw new Error(\"Cannot set numRounds for CSHAKE variants\");\n }\n }\n\n this.bigEndianMod = 1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA3;\n this.stateCloneFunc = cloneSHA3State;\n this.newStateFunc = getNewState;\n this.intermediateState = getNewState(variant);\n\n this.isVariableLen = false;\n switch (variant) {\n case \"SHA3-224\":\n this.variantBlockSize = variantBlockSize = 1152;\n this.outputBinLen = 224;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-256\":\n this.variantBlockSize = variantBlockSize = 1088;\n this.outputBinLen = 256;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-384\":\n this.variantBlockSize = variantBlockSize = 832;\n this.outputBinLen = 384;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-512\":\n this.variantBlockSize = variantBlockSize = 576;\n this.outputBinLen = 512;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHAKE128\":\n delimiter = 0x1f;\n this.variantBlockSize = variantBlockSize = 1344;\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"SHAKE256\":\n delimiter = 0x1f;\n this.variantBlockSize = variantBlockSize = 1088;\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"KMAC128\":\n delimiter = 0x4;\n this.variantBlockSize = variantBlockSize = 1344;\n this._initializeKMAC(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getKMAC;\n break;\n case \"KMAC256\":\n delimiter = 0x4;\n this.variantBlockSize = variantBlockSize = 1088;\n this._initializeKMAC(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getKMAC;\n break;\n case \"CSHAKE128\":\n this.variantBlockSize = variantBlockSize = 1344;\n delimiter = this._initializeCSHAKE(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"CSHAKE256\":\n this.variantBlockSize = variantBlockSize = 1088;\n delimiter = this._initializeCSHAKE(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n default:\n throw new Error(sha_variant_error);\n }\n\n /* This needs to be down here as CSHAKE can change its delimiter */\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, state, outputBinLen): number[] {\n return finalizeSHA3(\n remainder,\n remainderBinLen,\n processedBinLen,\n state,\n variantBlockSize,\n delimiter,\n outputBinLen,\n );\n };\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n\n /**\n * Initialize CSHAKE variants.\n *\n * @param options Options containing CSHAKE params.\n * @param funcNameOverride Overrides any \"funcName\" present in `options` (used with KMAC)\n * @returns The delimiter to be used\n */\n protected _initializeCSHAKE(options?: CSHAKEOptionsNoEncodingType, funcNameOverride?: packedValue): number {\n const resolvedOptions = resolveCSHAKEOptions(options || {});\n if (funcNameOverride) {\n resolvedOptions[\"funcName\"] = funcNameOverride;\n }\n const packedParams = packedLEConcat(\n encode_string(resolvedOptions[\"funcName\"]),\n encode_string(resolvedOptions[\"customization\"]),\n );\n\n /* CSHAKE is defined to be a call to SHAKE iff both the customization and function-name string are both empty. This\n can be accomplished by processing nothing in this step. */\n if (resolvedOptions[\"customization\"][\"binLen\"] !== 0 || resolvedOptions[\"funcName\"][\"binLen\"] !== 0) {\n const byte_pad_out = byte_pad(packedParams, this.variantBlockSize >>> 3);\n for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) {\n this.intermediateState = this.roundFunc(\n byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)),\n this.intermediateState,\n );\n this.processedLen += this.variantBlockSize;\n }\n return 0x04;\n } else {\n return 0x1f;\n }\n }\n\n /**\n * Initialize KMAC variants.\n *\n * @param options Options containing KMAC params.\n */\n protected _initializeKMAC(options: KMACOptionsNoEncodingType): void {\n const resolvedOptions = resolveKMACOptions(options || {});\n\n this._initializeCSHAKE(options, resolvedOptions[\"funcName\"]);\n const byte_pad_out = byte_pad(encode_string(resolvedOptions[\"kmacKey\"]), this.variantBlockSize >>> 3);\n for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) {\n this.intermediateState = this.roundFunc(\n byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)),\n this.intermediateState,\n );\n this.processedLen += this.variantBlockSize;\n }\n this.macKeySet = true;\n }\n\n /**\n * Returns the the KMAC in the specified format.\n *\n * @param options Hashmap of extra outputs options. `outputLen` must be specified.\n * @returns The KMAC in the format specified.\n */\n protected _getKMAC(options: { outputLen: number }): number[] {\n const concatedRemainder = packedLEConcat(\n { value: this.remainder.slice(), binLen: this.remainderLen },\n right_encode(options[\"outputLen\"]),\n );\n\n return this.finalizeFunc(\n concatedRemainder[\"value\"],\n concatedRemainder[\"binLen\"],\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n options[\"outputLen\"],\n );\n }\n}\n","import { sha_variant_error } from \"./common\";\nimport {\n CSHAKEOptionsEncodingType,\n CSHAKEOptionsNoEncodingType,\n SHAKEOptionsEncodingType,\n SHAKEOptionsNoEncodingType,\n EncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n KMACOptionsNoEncodingType,\n KMACOptionsEncodingType,\n} from \"./custom_types\";\nimport jsSHA1 from \"./sha1\";\nimport jsSHA256 from \"./sha256\";\nimport jsSHA512 from \"./sha512\";\nimport jsSHA3 from \"./sha3\";\n\ntype FixedLengthVariantType =\n | \"SHA-1\"\n | \"SHA-224\"\n | \"SHA-256\"\n | \"SHA-384\"\n | \"SHA-512\"\n | \"SHA3-224\"\n | \"SHA3-256\"\n | \"SHA3-384\"\n | \"SHA3-512\";\n\nexport default class jsSHA {\n private readonly shaObj: jsSHA1 | jsSHA256 | jsSHA512 | jsSHA3;\n /**\n * @param variant The desired SHA variant (SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-256,\n * SHA3-384, SHA3-512, SHAKE128, SHAKE256, CSHAKE128, CSHAKE256, KMAC128, or KMAC256) as a string.\n * @param inputFormat The input format to be used in future `update` calls (TEXT, HEX, B64, BYTES, ARRAYBUFFER,\n * or UINT8ARRAY) as a string.\n * @param options Options in the form of { encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE\"; numRounds?: number }.\n * `encoding` is for only TEXT input (defaults to UTF8) and `numRounds` defaults to 1.\n * `numRounds` is not valid for any of the MAC or CSHAKE variants.\n * * If the variant supports HMAC, `options` may have an additional `hmacKey` key which must be in the form of\n * {value: , format: , encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE\"} where takes the same\n * values as `inputFormat` and can be a `string | ArrayBuffer | Uint8Array` depending on .\n * Supplying this key switches to HMAC calculation and replaces the now deprecated call to `setHMACKey`.\n * * If the variant is CSHAKE128 or CSHAKE256, `options` may have two additional keys, `customization` and `funcName`,\n * which are the NIST customization and function-name strings. Both must be in the same form as `hmacKey`.\n * * If the variant is KMAC128 or KMAC256, `options` can include the `customization` key from CSHAKE variants and\n * *must* have a `kmacKey` key that takes the same form as the `customization` key.\n */\n constructor(variant: FixedLengthVariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(\n variant: FixedLengthVariantType,\n inputFormat: FormatNoTextType,\n options?: FixedLengthOptionsNoEncodingType\n );\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: \"TEXT\", options?: SHAKEOptionsEncodingType);\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: FormatNoTextType, options?: SHAKEOptionsNoEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: \"TEXT\", options?: CSHAKEOptionsEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: FormatNoTextType, options?: CSHAKEOptionsNoEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: \"TEXT\", options: KMACOptionsEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: FormatNoTextType, options: KMACOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (\"SHA-1\" == variant) {\n this.shaObj = new jsSHA1(variant, inputFormat, options);\n } else if (\"SHA-224\" == variant || \"SHA-256\" == variant) {\n this.shaObj = new jsSHA256(variant, inputFormat, options);\n } else if (\"SHA-384\" == variant || \"SHA-512\" == variant) {\n this.shaObj = new jsSHA512(variant, inputFormat, options);\n } else if (\n \"SHA3-224\" == variant ||\n \"SHA3-256\" == variant ||\n \"SHA3-384\" == variant ||\n \"SHA3-512\" == variant ||\n \"SHAKE128\" == variant ||\n \"SHAKE256\" == variant ||\n \"CSHAKE128\" == variant ||\n \"CSHAKE256\" == variant ||\n \"KMAC128\" == variant ||\n \"KMAC256\" == variant\n ) {\n this.shaObj = new jsSHA3(variant, inputFormat, options);\n } else {\n throw new Error(sha_variant_error);\n }\n }\n\n /**\n * Takes `input` and hashes as many blocks as possible. Stores the rest for either a future `update` or `getHash` call.\n *\n * @param input The input to be hashed.\n * @returns A reference to the object.\n */\n update(input: string | ArrayBuffer | Uint8Array): this {\n this.shaObj.update(input);\n\n return this;\n }\n\n /**\n * Returns the desired SHA or MAC (if a HMAC/KMAC key was specified) hash of the input fed in via `update` calls.\n *\n * @param format The desired output formatting (B64, HEX, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { outputUpper?: boolean; b64Pad?: string; outputLen?: number; }.\n * `outputLen` is required for variable length output variants (this option was previously called `shakeLen` which\n * is now deprecated).\n * `outputUpper` is only for HEX output (defaults to false) and b64pad is only for B64 output (defaults to \"=\").\n * @returns The hash in the format specified.\n */\n getHash(format: \"HEX\", options?: { outputUpper?: boolean; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"B64\", options?: { b64Pad?: string; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"BYTES\", options?: { outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"UINT8ARRAY\", options?: { outputLen?: number; shakeLen?: number }): Uint8Array;\n getHash(format: \"ARRAYBUFFER\", options?: { outputLen?: number; shakeLen?: number }): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHash(format: any, options?: any): any {\n return this.shaObj.getHash(format, options);\n }\n\n /**\n * Sets the HMAC key for an eventual `getHMAC` call. Must be called immediately after jsSHA object instantiation.\n * Now deprecated in favor of setting the `hmacKey` at object instantiation.\n *\n * @param key The key used to calculate the HMAC\n * @param inputFormat The format of key (HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE }. `encoding` is only for TEXT\n * and defaults to UTF8.\n */\n setHMACKey(key: string, inputFormat: \"TEXT\", options?: { encoding?: EncodingType }): void;\n setHMACKey(key: string, inputFormat: \"B64\" | \"HEX\" | \"BYTES\"): void;\n setHMACKey(key: ArrayBuffer, inputFormat: \"ARRAYBUFFER\"): void;\n setHMACKey(key: Uint8Array, inputFormat: \"UINT8ARRAY\"): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setHMACKey(key: any, inputFormat: any, options?: any): void {\n this.shaObj.setHMACKey(key, inputFormat, options);\n }\n\n /**\n * Returns the the HMAC in the specified format using the key given by a previous `setHMACKey` call. Now deprecated\n * in favor of just calling `getHash`.\n *\n * @param format The desired output formatting (B64, HEX, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { outputUpper?: boolean; b64Pad?: string }. `outputUpper` is only for HEX\n * output (defaults to false) and `b64pad` is only for B64 output (defaults to \"=\").\n * @returns The HMAC in the format specified.\n */\n getHMAC(format: \"HEX\", options?: { outputUpper?: boolean }): string;\n getHMAC(format: \"B64\", options?: { b64Pad?: string }): string;\n getHMAC(format: \"BYTES\"): string;\n getHMAC(format: \"UINT8ARRAY\"): Uint8Array;\n getHMAC(format: \"ARRAYBUFFER\"): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHMAC(format: any, options?: any): any {\n return this.shaObj.getHMAC(format, options);\n }\n}\n"],"names":["b64Tab","arraybuffer_error","uint8array_error","uint8array2packed","arr","existingPacked","existingPackedLen","bigEndianMod","i","intOffset","byteOffset","packed","existingByteLen","shiftModifier","length","push","value","binLen","getStrConverter","format","utfType","Error","str","existingBin","existingBinLen","num","parseInt","substr","isNaN","hex2packed","codePnt","codePntArr","j","transposeBytes","byteCnt","charCodeAt","str2packed","tmpInt","strPart","firstEqual","indexOf","search","replace","charAt","b642packed","bytes2packed","ArrayBuffer","_a","Uint8Array","arraybuffer2packed","_b","getOutputConverter","outputBinLen","outputOptions","binarray","outputLength","formatOpts","srcByte","hex_tab","toUpperCase","packed2hex","triplet","int1","int2","packed2b64","String","fromCharCode","packed2bytes","retVal","arrView","packed2arraybuffer","packed2uint8array","TWO_PWR_32","K_sha2","H_trunc","H_full","sha_variant_error","mac_rounds_error","packedLEConcat","a","b","arrOffset","aByteLen","bByteLen","leftShiftAmount","rightShiftAmount","pop","concat","getOutputOpts","options","outputUpper","b64Pad","outputLen","lenErrstr","parseInputOption","key","fallback","errStr","jsSHABase","variant","inputFormat","inputOptions","this","numRounds","shaVariant","remainder","remainderLen","updateCalled","processedLen","macKeySet","keyWithIPad","keyWithOPad","prototype","update","srcString","updateProcessedLen","variantBlockIntInc","variantBlockSize","convertRet","converterFunc","chunkBinLen","chunk","chunkIntLen","intermediateState","roundFunc","slice","getHash","finalizedState","isVariableLen","formatFunc","getMAC","finalizeFunc","stateCloneFunc","newStateFunc","setHMACKey","HMACSupported","keyConverterFunc","_setHMACKey","blockByteSize","lastArrayIndex","getHMAC","_getHMAC","firstHash","extendStatics","d","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","call","__extends","TypeError","__","constructor","create","rotl_32","x","n","rotr_32","shr_32","parity_32","y","z","ch_32","maj_32","sigma0_32","safeAdd_32_2","lsw","safeAdd_32_4","c","safeAdd_32_5","e","gamma1_32","gamma0_32","sigma1_32","getNewState","_variant","roundSHA1","block","H","T","t","W","finalizeSHA1","remainderBinLen","processedBinLen","offset","totalLen","SuppressedError","jsSHA","_super","_this","resolvedOptions","state","getNewState256","roundSHA256","f","g","h","T1","T2","finalizeSHA256","Int_64","msint_32","lsint_32","highOrder","lowOrder","rotl_64","tmp","rotr_64","shr_64","ch_64","maj_64","sigma0_64","rotr28","rotr34","rotr39","safeAdd_64_2","msw","safeAdd_64_4","safeAdd_64_5","xor_64_2","xor_64_5","gamma1_64","rotr19","rotr61","shr6","gamma0_64","rotr1","rotr8","shr7","sigma1_64","rotr14","rotr18","rotr41","K_sha512","getNewState512","roundSHA512","finalizeSHA512","rc_sha3","r_sha3","cloneSHA3State","clone","roundSHA3","round","B","C","D","left_encode","byte","numEncodedBytes","x_64","encode_string","input","byte_pad","outputByteLen","encodedLen","outputIntLen","intsToAppend","delimiter","_initializeKMAC","_getKMAC","_initializeCSHAKE","_processedBinLen","blockSize","temp","state_offset","binaryStringInc","remainderIntLen","finalizeSHA3","funcNameOverride","funcName","customization","resolveCSHAKEOptions","packedParams","byte_pad_out","kmacKey","resolveKMACOptions","concatedRemainder","right_encode","shaObj","jsSHA1","jsSHA256","jsSHA512","jsSHA3"],"mappings":";;;;;;;;;;;;;;;;;;;;qOAIA,IAAMA,EAAS,mEAETC,EAAoB,gDACpBC,EAAmB,+CAyPzB,SAASC,EACPC,EACAC,EACAC,EACAC,GAEA,IAAIC,EAAGC,EAAWC,EAGZC,EAASN,GAAkB,CAAC,GAChCO,GAFFN,EAAoBA,GAAqB,KAEC,EACxCO,GAAiC,IAAjBN,EAAsB,EAAI,EAE5C,IAAKC,EAAI,EAAGA,EAAIJ,EAAIU,OAAQN,GAAK,EAE/BC,GADAC,EAAaF,EAAII,KACU,EACvBD,EAAOG,QAAUL,GACnBE,EAAOI,KAAK,GAEdJ,EAAOF,IAAcL,EAAII,IAAO,GAAKK,EAAgBN,GAAgBG,EAAa,IAGpF,MAAO,CAAEM,MAAOL,EAAQM,OAAqB,EAAbb,EAAIU,OAAaR,EACnD,UA4BgBY,EACdC,EACAC,EACAb,GAIA,OAAQa,GACN,IAAK,OAEL,IAAK,UAEL,IAAK,UA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WAAA,SAAWvC,EAAUK,EAAkBX,GACrCa,KAAKoL,EAAOpJ,WAAWvC,EAAKK,EAAaX,EAC3C,EAiBAsG,EAAA/E,UAAA4B,QAAA,SAAQzH,EAAasE,GACnB,OAAOa,KAAKoL,EAAO9I,QAAQzH,EAAQsE,EACrC,EACFsG,CAAA","x_google_ignoreList":[2]} \ No newline at end of file diff --git a/dist/sha.mjs b/dist/sha.mjs index f772628..17d0374 100644 --- a/dist/sha.mjs +++ b/dist/sha.mjs @@ -2,9 +2,9 @@ * A JavaScript implementation of the SHA family of hashes - defined in FIPS PUB 180-4, FIPS PUB 202, * and SP 800-185 - as well as the corresponding HMAC implementation as defined in FIPS PUB 198-1. * - * Copyright 2008-2023 Brian Turek, 1998-2009 Paul Johnston & Contributors + * Copyright 2008-2024 Brian Turek, 1998-2009 Paul Johnston & Contributors * Distributed under the BSD License * See http://caligatio.github.com/jsSHA/ for more information */ -const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="ARRAYBUFFER not supported by this environment",e="UINT8ARRAY not supported by this environment";function r(t,n,e,r){let i,s,o;const h=n||[0],u=(e=e||0)>>>3,w=-1===r?3:0;for(i=0;i>>2,h.length<=s&&h.push(0),h[s]|=t[i]<<8*(w+r*(o%4));return{value:h,binLen:8*t.length+e}}function i(i,s,o){switch(s){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(i){case"HEX":return function(t,n,e){return function(t,n,e,r){let i,s,o,h;if(0!=t.length%2)throw new Error("String of HEX type must be in byte increments");const u=n||[0],w=(e=e||0)>>>3,c=-1===r?3:0;for(i=0;i>>1)+w,o=h>>>2;u.length<=o;)u.push(0);u[o]|=s<<8*(c+r*(h%4))}return{value:u,binLen:4*t.length+e}}(t,n,e,o)};case"TEXT":return function(t,n,e){return function(t,n,e,r,i){let s,o,h,u,w,c,f,a,l=0;const A=e||[0],E=(r=r||0)>>>3;if("UTF8"===n)for(f=-1===i?3:0,h=0;hs?o.push(s):2048>s?(o.push(192|s>>>6),o.push(128|63&s)):55296>s||57344<=s?o.push(224|s>>>12,128|s>>>6&63,128|63&s):(h+=1,s=65536+((1023&s)<<10|1023&t.charCodeAt(h)),o.push(240|s>>>18,128|s>>>12&63,128|s>>>6&63,128|63&s)),u=0;u>>2;A.length<=w;)A.push(0);A[w]|=o[u]<<8*(f+i*(c%4)),l+=1}else for(f=-1===i?2:0,a="UTF16LE"===n&&1!==i||"UTF16LE"!==n&&1===i,h=0;h>>8),c=l+E,w=c>>>2;A.length<=w;)A.push(0);A[w]|=s<<8*(f+i*(c%4)),l+=2}return{value:A,binLen:8*l+r}}(t,s,n,e,o)};case"B64":return function(n,e,r){return function(n,e,r,i){let s,o,h,u,w,c,f,a=0;const l=e||[0],A=(r=r||0)>>>3,E=-1===i?3:0,H=n.indexOf("=");if(-1===n.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(n=n.replace(/=/g,""),-1!==H&&H>>2;l.length<=c;)l.push(0);l[c]|=(u>>>16-8*h&255)<<8*(E+i*(f%4)),a+=1}}return{value:l,binLen:8*a+r}}(n,e,r,o)};case"BYTES":return function(t,n,e){return function(t,n,e,r){let i,s,o,h;const u=n||[0],w=(e=e||0)>>>3,c=-1===r?3:0;for(s=0;s>>2,u.length<=o&&u.push(0),u[o]|=i<<8*(c+r*(h%4));return{value:u,binLen:8*t.length+e}}(t,n,e,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(n)}return function(t,n,e){return function(t,n,e,i){return r(new Uint8Array(t),n,e,i)}(t,n,e,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(e)}return function(t,n,e){return r(t,n,e,o)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function s(r,i,s,o){switch(r){case"HEX":return function(t){return function(t,n,e,r){const i="0123456789abcdef";let s,o,h="";const u=n/8,w=-1===e?3:0;for(s=0;s>>2]>>>8*(w+e*(s%4)),h+=i.charAt(o>>>4&15)+i.charAt(15&o);return r.outputUpper?h.toUpperCase():h}(t,i,s,o)};case"B64":return function(n){return function(n,e,r,i){let s,o,h,u,w,c="";const f=e/8,a=-1===r?3:0;for(s=0;s>>2]:0,w=s+2>>2]:0,h=(n[s>>>2]>>>8*(a+r*(s%4))&255)<<16|(u>>>8*(a+r*((s+1)%4))&255)<<8|w>>>8*(a+r*((s+2)%4))&255,o=0;o<4;o+=1)c+=8*s+6*o<=e?t.charAt(h>>>6*(3-o)&63):i.b64Pad;return c}(n,i,s,o)};case"BYTES":return function(t){return function(t,n,e){let r,i,s="";const o=n/8,h=-1===e?3:0;for(r=0;r>>2]>>>8*(h+e*(r%4))&255,s+=String.fromCharCode(i);return s}(t,i,s)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(n)}return function(t){return function(t,n,e){let r;const i=n/8,s=new ArrayBuffer(i),o=new Uint8Array(s),h=-1===e?3:0;for(r=0;r>>2]>>>8*(h+e*(r%4))&255;return s}(t,i,s)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(e)}return function(t){return function(t,n,e){let r;const i=n/8,s=-1===e?3:0,o=new Uint8Array(i);for(r=0;r>>2]>>>8*(s+e*(r%4))&255;return o}(t,i,s)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}const o=4294967296,h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],u=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],w=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],c="Chosen SHA variant is not supported",f="Cannot set numRounds with MAC";function a(t,n){let e,r;const i=t.binLen>>>3,s=n.binLen>>>3,o=i<<3,h=4-i<<3;if(i%4!=0){for(e=0;e>>2,t.value[r]|=n.value[e>>>2]<>>2]>>>h;return(t.value.length<<2)-4>=s+i&&t.value.pop(),{value:t.value,binLen:t.binLen+n.binLen}}return{value:t.value.concat(n.value),binLen:t.binLen+n.binLen}}function l(t){const n={outputUpper:!1,b64Pad:"=",outputLen:-1},e=t||{},r="Output length must be a multiple of 8";if(n.outputUpper=e.outputUpper||!1,e.b64Pad&&(n.b64Pad=e.b64Pad),e.outputLen){if(e.outputLen%8!=0)throw new Error(r);n.outputLen=e.outputLen}else if(e.shakeLen){if(e.shakeLen%8!=0)throw new Error(r);n.outputLen=e.shakeLen}if("boolean"!=typeof n.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof n.b64Pad)throw new Error("Invalid b64Pad formatting option");return n}function A(t,n,e,r){const s=t+" must include a value and format";if(!n){if(!r)throw new Error(s);return r}if(void 0===n.value||!n.format)throw new Error(s);return i(n.format,n.encoding||"UTF8",e)(n.value)}class E{constructor(t,n,e){const r=e||{};if(this.t=n,this.i=r.encoding||"UTF8",this.numRounds=r.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(t){let n,e=0;const r=this.m>>>5,i=this.C(t,this.h,this.u),s=i.binLen,o=i.value,h=s>>>5;for(n=0;n>>5),this.u=s%this.m,this.l=!0,this}getHash(t,n){let e,r,i=this.K;const o=l(n);if(this.v){if(-1===o.outputLen)throw new Error("Output length must be specified in options");i=o.outputLen}const h=s(t,i,this.T,o);if(this.H&&this.F)return h(this.F(o));for(r=this.L(this.h.slice(),this.u,this.A,this.B(this.U),i),e=1;e>>24-i%32),r=this.L(r,i,0,this.M(this.o),i);return h(r)}setHMACKey(t,n,e){if(!this.k)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const r=i(n,(e||{}).encoding||"UTF8",this.T);this.Y(r(t))}Y(t){const n=this.m>>>3,e=n/4-1;let r;if(1!==this.numRounds)throw new Error(f);if(this.H)throw new Error("MAC key already set");for(n>>32-n}function S(t,n){return t>>>n|t<<32-n}function b(t,n){return t>>>n}function p(t,n,e){return t^n^e}function d(t,n,e){return t&n^~t&e}function m(t,n,e){return t&n^t&e^n&e}function C(t){return S(t,2)^S(t,13)^S(t,22)}function y(t,n){const e=(65535&t)+(65535&n);return(65535&(t>>>16)+(n>>>16)+(e>>>16))<<16|65535&e}function U(t,n,e,r){const i=(65535&t)+(65535&n)+(65535&e)+(65535&r);return(65535&(t>>>16)+(n>>>16)+(e>>>16)+(r>>>16)+(i>>>16))<<16|65535&i}function R(t,n,e,r,i){const s=(65535&t)+(65535&n)+(65535&e)+(65535&r)+(65535&i);return(65535&(t>>>16)+(n>>>16)+(e>>>16)+(r>>>16)+(i>>>16)+(s>>>16))<<16|65535&s}function K(t){return S(t,17)^S(t,19)^b(t,10)}function v(t){return S(t,7)^S(t,18)^b(t,3)}function T(t){return S(t,6)^S(t,11)^S(t,25)}function g(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function F(t,n){let e,r,i,s,o,h,u;const w=[];for(e=n[0],r=n[1],i=n[2],s=n[3],o=n[4],u=0;u<80;u+=1)w[u]=u<16?t[u]:H(w[u-3]^w[u-8]^w[u-14]^w[u-16],1),h=u<20?R(H(e,5),d(r,i,s),o,1518500249,w[u]):u<40?R(H(e,5),p(r,i,s),o,1859775393,w[u]):u<60?R(H(e,5),m(r,i,s),o,2400959708,w[u]):R(H(e,5),p(r,i,s),o,3395469782,w[u]),o=s,s=i,i=H(r,30),r=e,e=h;return n[0]=y(e,n[0]),n[1]=y(r,n[1]),n[2]=y(i,n[2]),n[3]=y(s,n[3]),n[4]=y(o,n[4]),n}function L(t,n,e,r){let i;const s=15+(n+65>>>9<<4),h=n+e;for(;t.length<=s;)t.push(0);for(t[n>>>5]|=128<<24-n%32,t[s]=4294967295&h,t[s-1]=h/o|0,i=0;i>>9<<4),w=n+e;for(;t.length<=u;)t.push(0);for(t[n>>>5]|=128<<24-n%32,t[u]=4294967295&w,t[u-1]=w/o|0,s=0;s32?(e=64-n,new N(t.X<>>e,t.I<>>e)):0!==n?(e=32-n,new N(t.I<>>e,t.X<>>e)):t}function X(t,n){let e;return n<32?(e=32-n,new N(t.I>>>n|t.X<>>n|t.I<>>n|t.I<>>n|t.X<>>n,t.X>>>n|t.I<<32-n)}function x(t,n,e){return new N(t.I&n.I^~t.I&e.I,t.X&n.X^~t.X&e.X)}function _(t,n,e){return new N(t.I&n.I^t.I&e.I^n.I&e.I,t.X&n.X^t.X&e.X^n.X&e.X)}function O(t){const n=X(t,28),e=X(t,34),r=X(t,39);return new N(n.I^e.I^r.I,n.X^e.X^r.X)}function P(t,n){let e,r;e=(65535&t.X)+(65535&n.X),r=(t.X>>>16)+(n.X>>>16)+(e>>>16);const i=(65535&r)<<16|65535&e;e=(65535&t.I)+(65535&n.I)+(r>>>16),r=(t.I>>>16)+(n.I>>>16)+(e>>>16);return new N((65535&r)<<16|65535&e,i)}function V(t,n,e,r){let i,s;i=(65535&t.X)+(65535&n.X)+(65535&e.X)+(65535&r.X),s=(t.X>>>16)+(n.X>>>16)+(e.X>>>16)+(r.X>>>16)+(i>>>16);const o=(65535&s)<<16|65535&i;i=(65535&t.I)+(65535&n.I)+(65535&e.I)+(65535&r.I)+(s>>>16),s=(t.I>>>16)+(n.I>>>16)+(e.I>>>16)+(r.I>>>16)+(i>>>16);return new N((65535&s)<<16|65535&i,o)}function Z(t,n,e,r,i){let s,o;s=(65535&t.X)+(65535&n.X)+(65535&e.X)+(65535&r.X)+(65535&i.X),o=(t.X>>>16)+(n.X>>>16)+(e.X>>>16)+(r.X>>>16)+(i.X>>>16)+(s>>>16);const h=(65535&o)<<16|65535&s;s=(65535&t.I)+(65535&n.I)+(65535&e.I)+(65535&r.I)+(65535&i.I)+(o>>>16),o=(t.I>>>16)+(n.I>>>16)+(e.I>>>16)+(r.I>>>16)+(i.I>>>16)+(s>>>16);return new N((65535&o)<<16|65535&s,h)}function j(t,n){return new N(t.I^n.I,t.X^n.X)}function q(t,n,e,r,i){return new N(t.I^n.I^e.I^r.I^i.I,t.X^n.X^e.X^r.X^i.X)}function D(t){const n=X(t,19),e=X(t,61),r=z(t,6);return new N(n.I^e.I^r.I,n.X^e.X^r.X)}function G(t){const n=X(t,1),e=X(t,8),r=z(t,7);return new N(n.I^e.I^r.I,n.X^e.X^r.X)}function J(t){const n=X(t,14),e=X(t,18),r=X(t,41);return new N(n.I^e.I^r.I,n.X^e.X^r.X)}const Q=[new N(h[0],3609767458),new N(h[1],602891725),new N(h[2],3964484399),new N(h[3],2173295548),new N(h[4],4081628472),new N(h[5],3053834265),new N(h[6],2937671579),new N(h[7],3664609560),new N(h[8],2734883394),new N(h[9],1164996542),new N(h[10],1323610764),new N(h[11],3590304994),new N(h[12],4068182383),new N(h[13],991336113),new N(h[14],633803317),new N(h[15],3479774868),new N(h[16],2666613458),new N(h[17],944711139),new N(h[18],2341262773),new N(h[19],2007800933),new N(h[20],1495990901),new N(h[21],1856431235),new N(h[22],3175218132),new N(h[23],2198950837),new N(h[24],3999719339),new N(h[25],766784016),new N(h[26],2566594879),new N(h[27],3203337956),new N(h[28],1034457026),new N(h[29],2466948901),new N(h[30],3758326383),new N(h[31],168717936),new N(h[32],1188179964),new N(h[33],1546045734),new N(h[34],1522805485),new N(h[35],2643833823),new N(h[36],2343527390),new N(h[37],1014477480),new N(h[38],1206759142),new N(h[39],344077627),new N(h[40],1290863460),new N(h[41],3158454273),new N(h[42],3505952657),new N(h[43],106217008),new N(h[44],3606008344),new N(h[45],1432725776),new N(h[46],1467031594),new N(h[47],851169720),new N(h[48],3100823752),new N(h[49],1363258195),new N(h[50],3750685593),new N(h[51],3785050280),new N(h[52],3318307427),new N(h[53],3812723403),new N(h[54],2003034995),new N(h[55],3602036899),new N(h[56],1575990012),new N(h[57],1125592928),new N(h[58],2716904306),new N(h[59],442776044),new N(h[60],593698344),new N(h[61],3733110249),new N(h[62],2999351573),new N(h[63],3815920427),new N(3391569614,3928383900),new N(3515267271,566280711),new N(3940187606,3454069534),new N(4118630271,4000239992),new N(116418474,1914138554),new N(174292421,2731055270),new N(289380356,3203993006),new N(460393269,320620315),new N(685471733,587496836),new N(852142971,1086792851),new N(1017036298,365543100),new N(1126000580,2618297676),new N(1288033470,3409855158),new N(1501505948,4234509866),new N(1607167915,987167468),new N(1816402316,1246189591)];function W(t){return"SHA-384"===t?[new N(3418070365,u[0]),new N(1654270250,u[1]),new N(2438529370,u[2]),new N(355462360,u[3]),new N(1731405415,u[4]),new N(41048885895,u[5]),new N(3675008525,u[6]),new N(1203062813,u[7])]:[new N(w[0],4089235720),new N(w[1],2227873595),new N(w[2],4271175723),new N(w[3],1595750129),new N(w[4],2917565137),new N(w[5],725511199),new N(w[6],4215389547),new N(w[7],327033209)]}function $(t,n){let e,r,i,s,o,h,u,w,c,f,a,l;const A=[];for(e=n[0],r=n[1],i=n[2],s=n[3],o=n[4],h=n[5],u=n[6],w=n[7],a=0;a<80;a+=1)a<16?(l=2*a,A[a]=new N(t[l],t[l+1])):A[a]=V(D(A[a-2]),A[a-7],G(A[a-15]),A[a-16]),c=Z(w,J(o),x(o,h,u),Q[a],A[a]),f=P(O(e),_(e,r,i)),w=u,u=h,h=o,o=P(s,c),s=i,i=r,r=e,e=P(c,f);return n[0]=P(e,n[0]),n[1]=P(r,n[1]),n[2]=P(i,n[2]),n[3]=P(s,n[3]),n[4]=P(o,n[4]),n[5]=P(h,n[5]),n[6]=P(u,n[6]),n[7]=P(w,n[7]),n}let tt=class extends E{constructor(t,n,e){if("SHA-384"!==t&&"SHA-512"!==t)throw new Error(c);super(t,n,e);const r=e||{};this.F=this.N,this.k=!0,this.T=-1,this.C=i(this.t,this.i,this.T),this.R=$,this.B=function(t){return t.slice()},this.M=W,this.L=function(n,e,r,i){return function(t,n,e,r,i){let s,h;const u=31+(n+129>>>10<<5),w=n+e;for(;t.length<=u;)t.push(0);for(t[n>>>5]|=128<<24-n%32,t[u]=4294967295&w,t[u-1]=w/o|0,s=0;s>>1)%5][(r>>>1)/5|0]=j(n[(r>>>1)%5][(r>>>1)/5|0],new N(t[r+1],t[r]));for(e=0;e<24;e+=1){for(s=rt(),r=0;r<5;r+=1)o[r]=q(n[r][0],n[r][1],n[r][2],n[r][3],n[r][4]);for(r=0;r<5;r+=1)h[r]=j(o[(r+4)%5],I(o[(r+1)%5],1));for(r=0;r<5;r+=1)for(i=0;i<5;i+=1)n[r][i]=j(n[r][i],h[r]);for(r=0;r<5;r+=1)for(i=0;i<5;i+=1)s[i][(2*r+3*i)%5]=I(n[r][i],et[r][i]);for(r=0;r<5;r+=1)for(i=0;i<5;i+=1)n[r][i]=j(s[r][i],new N(~s[(r+1)%5][i].I&s[(r+2)%5][i].I,~s[(r+1)%5][i].X&s[(r+2)%5][i].X));n[0][0]=j(n[0][0],nt[e])}return n}function ot(t){let n,e,r=0;const i=[0,0],s=[4294967295&t,t/o&2097151];for(n=6;n>=0;n--)e=s[n>>2]>>>8*n&255,0===e&&0===r||(i[r+1>>2]|=e<<8*(r+1),r+=1);return r=0!==r?r:1,i[0]|=r,{value:r+1>4?i:[i[0]],binLen:8+8*r}}function ht(t){return a(ot(t.binLen),t)}function ut(t,n){let e,r=ot(n);r=a(r,t);const i=n>>>2,s=(i-r.value.length%i)%i;for(e=0;e>>5,a=n>>>5;for(h=0;h=i;h+=f)r=st(t.slice(h,h+f),r),n-=i;for(t=t.slice(h),n%=i;t.length>>3,t[h>>2]^=s<=o));)c.push(u.I),w+=1,0==64*w%i&&(st(null,r),w=0);return c}(t,n,0,i,s,r,o)},o.hmacKey&&this.Y(A("hmacKey",o.hmacKey,this.T))}P(t,n){const e=function(t){const n=t||{};return{funcName:A("funcName",n.funcName,1,{value:[],binLen:0}),customization:A("Customization",n.customization,1,{value:[],binLen:0})}}(t||{});n&&(e.funcName=n);const r=a(ht(e.funcName),ht(e.customization));if(0!==e.customization.binLen||0!==e.funcName.binLen){const t=ut(r,this.m>>>3);for(let n=0;n>>5)this.U=this.R(t.slice(n,n+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}_(t){const n=function(t){const n=t||{};return{kmacKey:A("kmacKey",n.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:A("Customization",n.customization,1,{value:[],binLen:0})}}(t||{});this.P(t,n.funcName);const e=ut(ht(n.kmacKey),this.m>>>3);for(let t=0;t>>5)this.U=this.R(e.slice(t,t+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}O(t){const n=a({value:this.h.slice(),binLen:this.u},function(t){let n,e,r=0;const i=[0,0],s=[4294967295&t,t/o&2097151];for(n=6;n>=0;n--)e=s[n>>2]>>>8*n&255,0===e&&0===r||(i[r>>2]|=e<<8*r,r+=1);return r=0!==r?r:1,i[r>>2]|=r<<8*r,{value:r+1>4?i:[i[0]],binLen:8+8*r}}(t.outputLen));return this.L(n.value,n.binLen,this.A,this.B(this.U),t.outputLen)}};class ct{constructor(t,n,e){if("SHA-1"==t)this.V=new B(t,n,e);else if("SHA-224"==t||"SHA-256"==t)this.V=new Y(t,n,e);else if("SHA-384"==t||"SHA-512"==t)this.V=new tt(t,n,e);else{if("SHA3-224"!=t&&"SHA3-256"!=t&&"SHA3-384"!=t&&"SHA3-512"!=t&&"SHAKE128"!=t&&"SHAKE256"!=t&&"CSHAKE128"!=t&&"CSHAKE256"!=t&&"KMAC128"!=t&&"KMAC256"!=t)throw new Error(c);this.V=new wt(t,n,e)}}update(t){return this.V.update(t),this}getHash(t,n){return this.V.getHash(t,n)}setHMACKey(t,n,e){this.V.setHMACKey(t,n,e)}getHMAC(t,n){return this.V.getHMAC(t,n)}}export{ct as default}; //# sourceMappingURL=sha.mjs.map diff --git a/dist/sha.mjs.map b/dist/sha.mjs.map index c6f17aa..5573d19 100644 --- a/dist/sha.mjs.map +++ b/dist/sha.mjs.map @@ -1 +1 @@ -{"version":3,"file":"sha.mjs","sources":["../src/converters.ts","../src/common.ts","../src/primitives_32.ts","../src/sha1.ts","../src/sha256.ts","../src/primitives_64.ts","../src/sha512.ts","../src/sha3.ts","../src/sha.ts"],"sourcesContent":["import { packedValue, EncodingType, FormatType } from \"./custom_types\";\n/**\n * Return type for all the *2packed functions\n */\nconst b64Tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\nconst arraybuffer_error = \"ARRAYBUFFER not supported by this environment\";\nconst uint8array_error = \"UINT8ARRAY not supported by this environment\";\n\n/**\n * Convert a string to an array of words.\n *\n * There is a known bug with an odd number of existing bytes and using a UTF-16 encoding. However, this function is\n * used such that the existing bytes are always a result of a previous UTF-16 str2packed call and therefore there \n * should never be an odd number of existing bytes.\n\n * @param str Unicode string to be converted to binary representation.\n * @param utfType The Unicode type to use to encode the source string.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked`.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction str2packed(\n str: string,\n utfType: EncodingType,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let codePnt,\n codePntArr,\n byteCnt = 0,\n i,\n j,\n intOffset,\n byteOffset,\n shiftModifier,\n transposeBytes;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3;\n\n if (\"UTF8\" === utfType) {\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n codePntArr = [];\n\n if (0x80 > codePnt) {\n codePntArr.push(codePnt);\n } else if (0x800 > codePnt) {\n codePntArr.push(0xc0 | (codePnt >>> 6));\n codePntArr.push(0x80 | (codePnt & 0x3f));\n } else if (0xd800 > codePnt || 0xe000 <= codePnt) {\n codePntArr.push(0xe0 | (codePnt >>> 12), 0x80 | ((codePnt >>> 6) & 0x3f), 0x80 | (codePnt & 0x3f));\n } else {\n i += 1;\n codePnt = 0x10000 + (((codePnt & 0x3ff) << 10) | (str.charCodeAt(i) & 0x3ff));\n codePntArr.push(\n 0xf0 | (codePnt >>> 18),\n 0x80 | ((codePnt >>> 12) & 0x3f),\n 0x80 | ((codePnt >>> 6) & 0x3f),\n 0x80 | (codePnt & 0x3f)\n );\n }\n\n for (j = 0; j < codePntArr.length; j += 1) {\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n /* Known bug kicks in here */\n packed[intOffset] |= codePntArr[j] << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 1;\n }\n }\n } else {\n /* UTF16BE or UTF16LE */\n shiftModifier = bigEndianMod === -1 ? 2 : 0;\n /* Internally strings are UTF-16BE so transpose bytes under two conditions:\n * need LE and not switching endianness due to SHA-3\n * need BE and switching endianness due to SHA-3 */\n transposeBytes = (\"UTF16LE\" === utfType && bigEndianMod !== 1) || (\"UTF16LE\" !== utfType && bigEndianMod === 1);\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n if (transposeBytes === true) {\n j = codePnt & 0xff;\n codePnt = (j << 8) | (codePnt >>> 8);\n }\n\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= codePnt << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 2;\n }\n }\n return { value: packed, binLen: byteCnt * 8 + existingPackedLen };\n}\n\n/**\n * Convert a hex string to an array of words.\n *\n * @param str Hexadecimal string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction hex2packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let i, num, intOffset, byteOffset;\n\n if (0 !== str.length % 2) {\n throw new Error(\"String of HEX type must be in byte increments\");\n }\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < str.length; i += 2) {\n num = parseInt(str.substr(i, 2), 16);\n if (!isNaN(num)) {\n byteOffset = (i >>> 1) + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= num << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n } else {\n throw new Error(\"String of HEX type contains invalid characters\");\n }\n }\n\n return { value: packed, binLen: str.length * 4 + existingPackedLen };\n}\n\n/**\n * Convert a string of raw bytes to an array of words.\n *\n * @param str String of raw bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction bytes2packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let codePnt, i, intOffset, byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n\n byteOffset = i + existingByteLen;\n intOffset = byteOffset >>> 2;\n if (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= codePnt << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n }\n\n return { value: packed, binLen: str.length * 8 + existingPackedLen };\n}\n\n/**\n * Convert a base-64 string to an array of words.\n *\n * @param str Base64-encoded string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction b642packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let byteCnt = 0,\n index,\n i,\n j,\n tmpInt,\n strPart,\n intOffset,\n byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0,\n firstEqual = str.indexOf(\"=\");\n\n if (-1 === str.search(/^[a-zA-Z0-9=+/]+$/)) {\n throw new Error(\"Invalid character in base-64 string\");\n }\n\n str = str.replace(/=/g, \"\");\n if (-1 !== firstEqual && firstEqual < str.length) {\n throw new Error(\"Invalid '=' found in base-64 string\");\n }\n\n for (i = 0; i < str.length; i += 4) {\n strPart = str.substr(i, 4);\n tmpInt = 0;\n\n for (j = 0; j < strPart.length; j += 1) {\n index = b64Tab.indexOf(strPart.charAt(j));\n tmpInt |= index << (18 - 6 * j);\n }\n\n for (j = 0; j < strPart.length - 1; j += 1) {\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |=\n ((tmpInt >>> (16 - j * 8)) & 0xff) << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 1;\n }\n }\n\n return { value: packed, binLen: byteCnt * 8 + existingPackedLen };\n}\n\n/**\n * Convert an Uint8Array to an array of words.\n *\n * @param arr Uint8Array to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction uint8array2packed(\n arr: Uint8Array,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n let i, intOffset, byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < arr.length; i += 1) {\n byteOffset = i + existingByteLen;\n intOffset = byteOffset >>> 2;\n if (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= arr[i] << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n }\n\n return { value: packed, binLen: arr.length * 8 + existingPackedLen };\n}\n\n/**\n * Convert an ArrayBuffer to an array of words\n *\n * @param arr ArrayBuffer to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction arraybuffer2packed(\n arr: ArrayBuffer,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1\n): packedValue {\n return uint8array2packed(new Uint8Array(arr), existingPacked, existingPackedLen, bigEndianMod);\n}\n\n/**\n * Function that takes an input format and UTF encoding and returns the appropriate function used to convert the input.\n *\n * @param format The format of the input to be converted\n * @param utfType The string encoding to use for TEXT inputs.\n * @param bigEndianMod Modifier for whether hash function is big or small endian\n * @returns Function that will convert an input to a packed int array.\n */\nexport function getStrConverter(\n format: FormatType,\n utfType: EncodingType,\n bigEndianMod: -1 | 1\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n): (input: any, existingBin?: number[], existingBinLen?: number) => packedValue {\n /* Validate encoding */\n switch (utfType) {\n case \"UTF8\":\n /* Fallthrough */\n case \"UTF16BE\":\n /* Fallthrough */\n case \"UTF16LE\":\n /* Fallthrough */\n break;\n default:\n throw new Error(\"encoding must be UTF8, UTF16BE, or UTF16LE\");\n }\n\n /* Map inputFormat to the appropriate converter */\n switch (format) {\n case \"HEX\":\n /**\n * @param str String of hexadecimal bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return hex2packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"TEXT\":\n /**\n * @param str Unicode string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return str2packed(str, utfType, existingBin, existingBinLen, bigEndianMod);\n };\n case \"B64\":\n /**\n * @param str Base64-encoded string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return b642packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"BYTES\":\n /**\n * @param str String of raw bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return bytes2packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"ARRAYBUFFER\":\n try {\n new ArrayBuffer(0);\n } catch (ignore) {\n throw new Error(arraybuffer_error);\n }\n /**\n * @param arr ArrayBuffer to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (arr: ArrayBuffer, existingBin?: number[], existingBinLen?: number): packedValue {\n return arraybuffer2packed(arr, existingBin, existingBinLen, bigEndianMod);\n };\n case \"UINT8ARRAY\":\n try {\n new Uint8Array(0);\n } catch (ignore) {\n throw new Error(uint8array_error);\n }\n /**\n * @param arr Uint8Array to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (arr: Uint8Array, existingBin?: number[], existingBinLen?: number): packedValue {\n return uint8array2packed(arr, existingBin, existingBinLen, bigEndianMod);\n };\n default:\n throw new Error(\"format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\");\n }\n}\n\n/**\n * Convert an array of words to a hexadecimal string.\n *\n * toString() won't work here because it removes preceding zeros (e.g. 0x00000001.toString === \"1\" rather than\n * \"00000001\" and 0.toString(16) === \"0\" rather than \"00\").\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param formatOpts Hashmap containing validated output formatting options.\n * @returns Hexadecimal representation of `packed`.\n */\nexport function packed2hex(\n packed: number[],\n outputLength: number,\n bigEndianMod: -1 | 1,\n formatOpts: { outputUpper: boolean; b64Pad: string }\n): string {\n const hex_tab = \"0123456789abcdef\";\n let str = \"\",\n i,\n srcByte;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n /* The below is more than a byte but it gets taken care of later */\n srcByte = packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)));\n str += hex_tab.charAt((srcByte >>> 4) & 0xf) + hex_tab.charAt(srcByte & 0xf);\n }\n\n return formatOpts[\"outputUpper\"] ? str.toUpperCase() : str;\n}\n\n/**\n * Convert an array of words to a base-64 string.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param formatOpts Hashmap containing validated output formatting options.\n * @returns Base64-encoded representation of `packed`.\n */\nexport function packed2b64(\n packed: number[],\n outputLength: number,\n bigEndianMod: -1 | 1,\n formatOpts: { outputUpper: boolean; b64Pad: string }\n): string {\n let str = \"\",\n i,\n j,\n triplet,\n int1,\n int2;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 3) {\n int1 = i + 1 < length ? packed[(i + 1) >>> 2] : 0;\n int2 = i + 2 < length ? packed[(i + 2) >>> 2] : 0;\n triplet =\n (((packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff) << 16) |\n (((int1 >>> (8 * (shiftModifier + bigEndianMod * ((i + 1) % 4)))) & 0xff) << 8) |\n ((int2 >>> (8 * (shiftModifier + bigEndianMod * ((i + 2) % 4)))) & 0xff);\n for (j = 0; j < 4; j += 1) {\n if (i * 8 + j * 6 <= outputLength) {\n str += b64Tab.charAt((triplet >>> (6 * (3 - j))) & 0x3f);\n } else {\n str += formatOpts[\"b64Pad\"];\n }\n }\n }\n return str;\n}\n\n/**\n * Convert an array of words to raw bytes string.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Raw bytes representation of `packed`.\n */\nexport function packed2bytes(packed: number[], outputLength: number, bigEndianMod: -1 | 1): string {\n let str = \"\",\n i,\n srcByte;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n srcByte = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n str += String.fromCharCode(srcByte);\n }\n\n return str;\n}\n\n/**\n * Convert an array of words to an ArrayBuffer.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns An ArrayBuffer containing bytes from `packed.\n */\nexport function packed2arraybuffer(packed: number[], outputLength: number, bigEndianMod: -1 | 1): ArrayBuffer {\n let i;\n const length = outputLength / 8,\n retVal = new ArrayBuffer(length),\n arrView = new Uint8Array(retVal),\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n arrView[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n }\n\n return retVal;\n}\n\n/**\n * Convert an array of words to an Uint8Array.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns An Uint8Array containing bytes from `packed.\n */\nexport function packed2uint8array(packed: number[], outputLength: number, bigEndianMod: -1 | 1): Uint8Array {\n let i;\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0,\n retVal = new Uint8Array(length);\n\n for (i = 0; i < length; i += 1) {\n retVal[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n }\n\n return retVal;\n}\n\n/**\n * Function that takes an output format and associated parameters and returns a function that converts packed integers\n * to that format.\n *\n * @param format The desired output formatting.\n * @param outputBinLen Output length in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param outputOptions Hashmap of output formatting options\n * @returns Function that will convert a packed integer array to desired format.\n */\nexport function getOutputConverter(\n format: \"HEX\" | \"B64\" | \"BYTES\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string }\n): (binarray: number[]) => string;\nexport function getOutputConverter(\n format: \"ARRAYBUFFER\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string }\n): (binarray: number[]) => ArrayBuffer;\nexport function getOutputConverter(\n format: \"UINT8ARRAY\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string }\n): (binarray: number[]) => Uint8Array;\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nexport function getOutputConverter(format: any, outputBinLen: any, bigEndianMod: any, outputOptions: any): any {\n switch (format) {\n case \"HEX\":\n return function (binarray: number[]): string {\n return packed2hex(binarray, outputBinLen, bigEndianMod, outputOptions);\n };\n case \"B64\":\n return function (binarray: number[]): string {\n return packed2b64(binarray, outputBinLen, bigEndianMod, outputOptions);\n };\n case \"BYTES\":\n return function (binarray: number[]): string {\n return packed2bytes(binarray, outputBinLen, bigEndianMod);\n };\n case \"ARRAYBUFFER\":\n try {\n /* Need to test ArrayBuffer support */\n new ArrayBuffer(0);\n } catch (ignore) {\n throw new Error(arraybuffer_error);\n }\n return function (binarray: number[]): ArrayBuffer {\n return packed2arraybuffer(binarray, outputBinLen, bigEndianMod);\n };\n case \"UINT8ARRAY\":\n try {\n /* Need to test Uint8Array support */\n new Uint8Array(0);\n } catch (ignore) {\n throw new Error(uint8array_error);\n }\n return function (binarray: number[]): Uint8Array {\n return packed2uint8array(binarray, outputBinLen, bigEndianMod);\n };\n default:\n throw new Error(\"format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\");\n }\n}\n","import { getStrConverter, getOutputConverter } from \"./converters\";\n\nimport {\n FormatType,\n EncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n packedValue,\n GenericInputType,\n} from \"./custom_types\";\n\nexport const TWO_PWR_32 = 4294967296;\n\n/* Constant used in SHA-2 families */\nexport const K_sha2 = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98,\n 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,\n 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8,\n 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,\n 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7,\n 0xc67178f2,\n];\n\n/* Constant used in SHA-2 families */\nexport const H_trunc = [0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4];\n\n/* Constant used in SHA-2 families */\nexport const H_full = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19];\n\nexport const sha_variant_error = \"Chosen SHA variant is not supported\";\nexport const mac_rounds_error = \"Cannot set numRounds with MAC\";\n\n/**\n * Concatenates 2 packed arrays. Clobbers array `a`.\n *\n * @param a First array to concatenate.\n * @param b Second array to concatenate.\n * @returns The concatentation of `a` + `b`.\n */\nexport function packedLEConcat(a: packedValue, b: packedValue): packedValue {\n let i, arrOffset;\n const aByteLen = a[\"binLen\"] >>> 3,\n bByteLen = b[\"binLen\"] >>> 3,\n leftShiftAmount = aByteLen << 3,\n rightShiftAmount = (4 - aByteLen) << 3;\n\n /* If a only contains \"full\" integers, we can just use concat which is so much easier */\n if (aByteLen % 4 !== 0) {\n for (i = 0; i < bByteLen; i += 4) {\n arrOffset = (aByteLen + i) >>> 2;\n /* Left shift chops off bits over 32-bits */\n a[\"value\"][arrOffset] |= b[\"value\"][i >>> 2] << leftShiftAmount;\n a[\"value\"].push(0);\n a[\"value\"][arrOffset + 1] |= b[\"value\"][i >>> 2] >>> rightShiftAmount;\n }\n\n /* Since an unconditional push was performed above, we may have pushed an extra value if it could have been\n encoded without it. Check if popping an int off (reducing total length by 4 bytes) is still bigger than the\n needed size. */\n if ((a[\"value\"].length << 2) - 4 >= bByteLen + aByteLen) {\n a[\"value\"].pop();\n }\n\n return { value: a[\"value\"], binLen: a[\"binLen\"] + b[\"binLen\"] };\n } else {\n return { value: a[\"value\"].concat(b[\"value\"]), binLen: a[\"binLen\"] + b[\"binLen\"] };\n }\n}\n\n/**\n * Validate hash list containing output formatting options, ensuring presence of every option or adding the default\n * value.\n *\n * @param options Hashmap of output formatting options from user.\n * @returns Validated hashmap containing output formatting options.\n */\nexport function getOutputOpts(options?: {\n outputUpper?: boolean;\n b64Pad?: string;\n shakeLen?: number;\n outputLen?: number;\n}): { outputUpper: boolean; b64Pad: string; outputLen: number } {\n const retVal = { outputUpper: false, b64Pad: \"=\", outputLen: -1 },\n outputOptions: { outputUpper?: boolean; b64Pad?: string; shakeLen?: number; outputLen?: number } = options || {},\n lenErrstr = \"Output length must be a multiple of 8\";\n\n retVal[\"outputUpper\"] = outputOptions[\"outputUpper\"] || false;\n\n if (outputOptions[\"b64Pad\"]) {\n retVal[\"b64Pad\"] = outputOptions[\"b64Pad\"];\n }\n\n if (outputOptions[\"outputLen\"]) {\n if (outputOptions[\"outputLen\"] % 8 !== 0) {\n throw new Error(lenErrstr);\n }\n retVal[\"outputLen\"] = outputOptions[\"outputLen\"];\n } else if (outputOptions[\"shakeLen\"]) {\n if (outputOptions[\"shakeLen\"] % 8 !== 0) {\n throw new Error(lenErrstr);\n }\n retVal[\"outputLen\"] = outputOptions[\"shakeLen\"];\n }\n\n if (\"boolean\" !== typeof retVal[\"outputUpper\"]) {\n throw new Error(\"Invalid outputUpper formatting option\");\n }\n\n if (\"string\" !== typeof retVal[\"b64Pad\"]) {\n throw new Error(\"Invalid b64Pad formatting option\");\n }\n\n return retVal;\n}\n\n/**\n * Parses an external constructor object and returns a packed number, if possible.\n *\n * @param key The human-friendly key name to prefix any errors with\n * @param value The input value object to parse\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param fallback Fallback value if `value` is undefined. If not present and `value` is undefined, an Error is thrown\n */\nexport function parseInputOption(\n key: string,\n value: GenericInputType | undefined,\n bigEndianMod: -1 | 1,\n fallback?: packedValue\n): packedValue {\n const errStr = key + \" must include a value and format\";\n if (!value) {\n if (!fallback) {\n throw new Error(errStr);\n }\n return fallback;\n }\n\n if (typeof value[\"value\"] === \"undefined\" || !value[\"format\"]) {\n throw new Error(errStr);\n }\n\n return getStrConverter(\n value[\"format\"],\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - the value of encoding gets value checked by getStrConverter\n value[\"encoding\"] || \"UTF8\",\n bigEndianMod\n )(value[\"value\"]);\n}\n\nexport abstract class jsSHABase {\n /**\n * @param variant The desired SHA variant.\n * @param inputFormat The input format to be used in future `update` calls.\n * @param options Hashmap of extra input options.\n */\n /* Needed inputs */\n protected readonly shaVariant: VariantT;\n protected readonly inputFormat: FormatType;\n protected readonly utfType: EncodingType;\n protected readonly numRounds: number;\n\n /* State */\n protected abstract intermediateState: StateT;\n protected keyWithIPad: number[];\n protected keyWithOPad: number[];\n protected remainder: number[];\n protected remainderLen: number;\n protected updateCalled: boolean;\n protected processedLen: number;\n protected macKeySet: boolean;\n\n /* Variant specifics */\n protected abstract readonly variantBlockSize: number;\n protected abstract readonly bigEndianMod: -1 | 1;\n protected abstract readonly outputBinLen: number;\n protected abstract readonly isVariableLen: boolean;\n protected abstract readonly HMACSupported: boolean;\n\n /* Functions */\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n protected abstract readonly converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n protected abstract readonly roundFunc: (block: number[], H: StateT) => StateT;\n protected abstract readonly finalizeFunc: (\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: StateT,\n outputLen: number\n ) => number[];\n protected abstract readonly stateCloneFunc: (state: StateT) => StateT;\n protected abstract readonly newStateFunc: (variant: VariantT) => StateT;\n protected abstract readonly getMAC: ((options: { outputLen: number }) => number[]) | null;\n\n protected constructor(variant: VariantT, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n protected constructor(variant: VariantT, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected constructor(variant: any, inputFormat: any, options?: any) {\n const inputOptions = options || {};\n this.inputFormat = inputFormat;\n\n this.utfType = inputOptions[\"encoding\"] || \"UTF8\";\n this.numRounds = inputOptions[\"numRounds\"] || 1;\n\n /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */\n // @ts-ignore - The spec actually says ToString is called on the first parseInt argument so it's OK to use it here\n // to check if an arugment is an integer. This cheat would break if it's used to get the value of the argument.\n if (isNaN(this.numRounds) || this.numRounds !== parseInt(this.numRounds, 10) || 1 > this.numRounds) {\n throw new Error(\"numRounds must a integer >= 1\");\n }\n\n this.shaVariant = variant;\n this.remainder = [];\n this.remainderLen = 0;\n this.updateCalled = false;\n this.processedLen = 0;\n this.macKeySet = false;\n this.keyWithIPad = [];\n this.keyWithOPad = [];\n }\n\n /**\n * Hashes as many blocks as possible. Stores the rest for either a future update or getHash call.\n *\n * @param srcString The input to be hashed.\n * @returns A reference to the object.\n */\n update(srcString: string | ArrayBuffer | Uint8Array): this {\n let i,\n updateProcessedLen = 0;\n const variantBlockIntInc = this.variantBlockSize >>> 5,\n convertRet = this.converterFunc(srcString, this.remainder, this.remainderLen),\n chunkBinLen = convertRet[\"binLen\"],\n chunk = convertRet[\"value\"],\n chunkIntLen = chunkBinLen >>> 5;\n\n for (i = 0; i < chunkIntLen; i += variantBlockIntInc) {\n if (updateProcessedLen + this.variantBlockSize <= chunkBinLen) {\n this.intermediateState = this.roundFunc(chunk.slice(i, i + variantBlockIntInc), this.intermediateState);\n updateProcessedLen += this.variantBlockSize;\n }\n }\n this.processedLen += updateProcessedLen;\n this.remainder = chunk.slice(updateProcessedLen >>> 5);\n this.remainderLen = chunkBinLen % this.variantBlockSize;\n this.updateCalled = true;\n\n return this;\n }\n\n /**\n * Returns the desired SHA hash of the input fed in via `update` calls.\n *\n * @param format The desired output formatting\n * @param options Hashmap of output formatting options. `outputLen` must be specified for variable length hashes.\n * `outputLen` replaces the now deprecated `shakeLen` key.\n * @returns The hash in the format specified.\n */\n getHash(format: \"HEX\", options?: { outputUpper?: boolean; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"B64\", options?: { b64Pad?: string; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"BYTES\", options?: { outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"UINT8ARRAY\", options?: { outputLen?: number; shakeLen?: number }): Uint8Array;\n getHash(format: \"ARRAYBUFFER\", options?: { outputLen?: number; shakeLen?: number }): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHash(format: any, options?: any): any {\n let i,\n finalizedState,\n outputBinLen = this.outputBinLen;\n\n const outputOptions = getOutputOpts(options);\n\n if (this.isVariableLen) {\n if (outputOptions[\"outputLen\"] === -1) {\n throw new Error(\"Output length must be specified in options\");\n }\n outputBinLen = outputOptions[\"outputLen\"];\n }\n\n const formatFunc = getOutputConverter(format, outputBinLen, this.bigEndianMod, outputOptions);\n if (this.macKeySet && this.getMAC) {\n return formatFunc(this.getMAC(outputOptions));\n }\n\n finalizedState = this.finalizeFunc(\n this.remainder.slice(),\n this.remainderLen,\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n outputBinLen\n );\n for (i = 1; i < this.numRounds; i += 1) {\n /* Need to mask out bits that should be zero due to output not being a multiple of 32 */\n if (this.isVariableLen && outputBinLen % 32 !== 0) {\n finalizedState[finalizedState.length - 1] &= 0x00ffffff >>> (24 - (outputBinLen % 32));\n }\n finalizedState = this.finalizeFunc(\n finalizedState,\n outputBinLen,\n 0,\n this.newStateFunc(this.shaVariant),\n outputBinLen\n );\n }\n\n return formatFunc(finalizedState);\n }\n\n /**\n * Sets the HMAC key for an eventual `getHMAC` call. Must be called immediately after jsSHA object instantiation.\n *\n * @param key The key used to calculate the HMAC\n * @param inputFormat The format of key.\n * @param options Hashmap of extra input options.\n */\n setHMACKey(key: string, inputFormat: \"TEXT\", options?: { encoding?: EncodingType }): void;\n setHMACKey(key: string, inputFormat: \"B64\" | \"HEX\" | \"BYTES\"): void;\n setHMACKey(key: ArrayBuffer, inputFormat: \"ARRAYBUFFER\"): void;\n setHMACKey(key: Uint8Array, inputFormat: \"UINT8ARRAY\"): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setHMACKey(key: any, inputFormat: any, options?: any): void {\n if (!this.HMACSupported) {\n throw new Error(\"Variant does not support HMAC\");\n }\n\n if (this.updateCalled) {\n throw new Error(\"Cannot set MAC key after calling update\");\n }\n\n const keyOptions = options || {},\n keyConverterFunc = getStrConverter(inputFormat, keyOptions[\"encoding\"] || \"UTF8\", this.bigEndianMod);\n\n this._setHMACKey(keyConverterFunc(key));\n }\n\n /**\n * Internal function that sets the MAC key.\n *\n * @param key The packed MAC key to use\n */\n protected _setHMACKey(key: packedValue): void {\n const blockByteSize = this.variantBlockSize >>> 3,\n lastArrayIndex = blockByteSize / 4 - 1;\n let i;\n if (this.numRounds !== 1) {\n throw new Error(mac_rounds_error);\n }\n\n if (this.macKeySet) {\n throw new Error(\"MAC key already set\");\n }\n\n /* Figure out what to do with the key based on its size relative to\n * the hash's block size */\n if (blockByteSize < key[\"binLen\"] / 8) {\n key[\"value\"] = this.finalizeFunc(\n key[\"value\"],\n key[\"binLen\"],\n 0,\n this.newStateFunc(this.shaVariant),\n this.outputBinLen\n );\n }\n while (key[\"value\"].length <= lastArrayIndex) {\n key[\"value\"].push(0);\n }\n /* Create ipad and opad */\n for (i = 0; i <= lastArrayIndex; i += 1) {\n this.keyWithIPad[i] = key[\"value\"][i] ^ 0x36363636;\n this.keyWithOPad[i] = key[\"value\"][i] ^ 0x5c5c5c5c;\n }\n\n this.intermediateState = this.roundFunc(this.keyWithIPad, this.intermediateState);\n this.processedLen = this.variantBlockSize;\n\n this.macKeySet = true;\n }\n\n /**\n * Returns the the HMAC in the specified format using the key given by a previous `setHMACKey` call.\n *\n * @param format The desired output formatting.\n * @param options Hashmap of extra outputs options.\n * @returns The HMAC in the format specified.\n */\n getHMAC(format: \"HEX\", options?: { outputUpper?: boolean }): string;\n getHMAC(format: \"B64\", options?: { b64Pad?: string }): string;\n getHMAC(format: \"BYTES\"): string;\n getHMAC(format: \"UINT8ARRAY\"): Uint8Array;\n getHMAC(format: \"ARRAYBUFFER\"): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHMAC(format: any, options?: any): any {\n const outputOptions = getOutputOpts(options),\n formatFunc = getOutputConverter(format, this.outputBinLen, this.bigEndianMod, outputOptions);\n\n return formatFunc(this._getHMAC());\n }\n\n /**\n * Internal function that returns the \"raw\" HMAC\n */\n protected _getHMAC(): number[] {\n let finalizedState;\n\n if (!this.macKeySet) {\n throw new Error(\"Cannot call getHMAC without first setting MAC key\");\n }\n\n const firstHash = this.finalizeFunc(\n this.remainder.slice(),\n this.remainderLen,\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n this.outputBinLen\n );\n finalizedState = this.roundFunc(this.keyWithOPad, this.newStateFunc(this.shaVariant));\n finalizedState = this.finalizeFunc(\n firstHash,\n this.outputBinLen,\n this.variantBlockSize,\n finalizedState,\n this.outputBinLen\n );\n\n return finalizedState;\n }\n}\n","/*\n * Note 1: All the functions in this file guarantee only that the bottom 32-bits of the return value are correct.\n * JavaScript is flakey when it comes to bit operations and a '1' in the highest order bit of a 32-bit number causes\n * it to be interpreted as a negative number per two's complement.\n *\n * Note 2: Per the ECMAScript spec, all JavaScript operations mask the shift amount by 0x1F. This results in weird\n * cases like 1 << 32 == 1 and 1 << 33 === 1 << 1 === 2\n */\n\n/**\n * The 32-bit implementation of circular rotate left.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted left circularly by `n` bits\n */\nexport function rotl_32(x: number, n: number): number {\n return (x << n) | (x >>> (32 - n));\n}\n\n/**\n * The 32-bit implementation of circular rotate right.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right circularly by `n` bits\n */\nfunction rotr_32(x: number, n: number): number {\n return (x >>> n) | (x << (32 - n));\n}\n\n/**\n * The 32-bit implementation of shift right.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted by `n` bits.\n */\nfunction shr_32(x: number, n: number): number {\n return x >>> n;\n}\n\n/**\n * The 32-bit implementation of the NIST specified Parity function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function parity_32(x: number, y: number, z: number): number {\n return x ^ y ^ z;\n}\n\n/**\n * The 32-bit implementation of the NIST specified Ch function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function ch_32(x: number, y: number, z: number): number {\n return (x & y) ^ (~x & z);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Maj function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function maj_32(x: number, y: number, z: number): number {\n return (x & y) ^ (x & z) ^ (y & z);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Sigma0 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma0_32(x: number): number {\n return rotr_32(x, 2) ^ rotr_32(x, 13) ^ rotr_32(x, 22);\n}\n\n/**\n * Add two 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @returns The sum of `a` + `b`.\n */\nexport function safeAdd_32_2(a: number, b: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * Add four 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @param c The third 32-bit integer argument to be added.\n * @param d The fourth 32-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d`.\n */\nexport function safeAdd_32_4(a: number, b: number, c: number, d: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff) + (c & 0xffff) + (d & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * Add five 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @param c The third 32-bit integer argument to be added.\n * @param d The fourth 32-bit integer argument to be added.\n * @param e The fifth 32-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d` + `e`.\n */\nexport function safeAdd_32_5(a: number, b: number, c: number, d: number, e: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff) + (c & 0xffff) + (d & 0xffff) + (e & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (e >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Gamma1 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma1_32(x: number): number {\n return rotr_32(x, 17) ^ rotr_32(x, 19) ^ shr_32(x, 10);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Gamma0 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma0_32(x: number): number {\n return rotr_32(x, 7) ^ rotr_32(x, 18) ^ shr_32(x, 3);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Sigma1 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma1_32(x: number): number {\n return rotr_32(x, 6) ^ rotr_32(x, 11) ^ rotr_32(x, 25);\n}\n","import { jsSHABase, TWO_PWR_32, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport { ch_32, parity_32, maj_32, rotl_32, safeAdd_32_2, safeAdd_32_5 } from \"./primitives_32\";\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param _variant: Unused\n * @returns The initial state values.\n */\nfunction getNewState(_variant: \"SHA-1\"): number[] {\n return [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n}\n\n/**\n * Performs a round of SHA-1 hashing over a 512-byte block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA1(block: number[], H: number[]): number[] {\n let a, b, c, d, e, T, t;\n const W: number[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n\n for (t = 0; t < 80; t += 1) {\n if (t < 16) {\n W[t] = block[t];\n } else {\n W[t] = rotl_32(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n if (t < 20) {\n T = safeAdd_32_5(rotl_32(a, 5), ch_32(b, c, d), e, 0x5a827999, W[t]);\n } else if (t < 40) {\n T = safeAdd_32_5(rotl_32(a, 5), parity_32(b, c, d), e, 0x6ed9eba1, W[t]);\n } else if (t < 60) {\n T = safeAdd_32_5(rotl_32(a, 5), maj_32(b, c, d), e, 0x8f1bbcdc, W[t]);\n } else {\n T = safeAdd_32_5(rotl_32(a, 5), parity_32(b, c, d), e, 0xca62c1d6, W[t]);\n }\n\n e = d;\n d = c;\n c = rotl_32(b, 30);\n b = a;\n a = T;\n }\n\n H[0] = safeAdd_32_2(a, H[0]);\n H[1] = safeAdd_32_2(b, H[1]);\n H[2] = safeAdd_32_2(c, H[2]);\n H[3] = safeAdd_32_2(d, H[3]);\n H[4] = safeAdd_32_2(e, H[4]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-1 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @returns The array of integers representing the SHA-1 hash of message.\n */\nfunction finalizeSHA1(remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]): number[] {\n let i;\n\n /* The 65 addition is a hack but it works. The correct number is\n\t\tactually 72 (64 + 8) but the below math fails if\n\t\tremainderBinLen + 72 % 512 = 0. Since remainderBinLen % 8 = 0,\n\t\t\"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 65) >>> 9) << 4) + 15,\n totalLen = remainderBinLen + processedBinLen;\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n\n /* Append length of binary string in the position such that the new\n * length is a multiple of 512. Logic does not work for even multiples\n * of 512 but there can never be even multiples of 512. JavaScript\n * numbers are limited to 2^53 so it's \"safe\" to treat the totalLen as\n * a 64-bit integer. */\n remainder[offset] = totalLen & 0xffffffff;\n\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += 16) {\n H = roundSHA1(remainder.slice(i, i + 16), H);\n }\n\n return H;\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: number[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: number[]) => number[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]) => number[];\n stateCloneFunc: (state: number[]) => number[];\n newStateFunc: (variant: \"SHA-1\") => number[];\n getMAC: () => number[];\n\n constructor(variant: \"SHA-1\", inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: \"SHA-1\", inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (\"SHA-1\" !== variant) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA1;\n this.stateCloneFunc = function (state: number[]): number[] {\n return state.slice();\n };\n this.newStateFunc = getNewState;\n this.finalizeFunc = finalizeSHA1;\n\n this.intermediateState = getNewState(variant);\n this.variantBlockSize = 512;\n this.outputBinLen = 160;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","import { jsSHABase, TWO_PWR_32, H_full, H_trunc, K_sha2, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport {\n ch_32,\n gamma0_32,\n gamma1_32,\n maj_32,\n safeAdd_32_2,\n safeAdd_32_4,\n safeAdd_32_5,\n sigma0_32,\n sigma1_32,\n} from \"./primitives_32\";\n\ntype VariantType = \"SHA-224\" | \"SHA-256\";\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param variant: The SHA-256 family variant.\n * @returns The initial state values.\n */\nfunction getNewState256(variant: VariantType): number[] {\n let retVal;\n\n if (\"SHA-224\" == variant) {\n retVal = H_trunc.slice();\n } else {\n /* \"SHA-256\" */\n retVal = H_full.slice();\n }\n return retVal;\n}\n\n/**\n * Performs a round of SHA-256 hashing over a block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA256(block: number[], H: number[]): number[] {\n let a, b, c, d, e, f, g, h, T1, T2, t;\n\n const W: number[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n f = H[5];\n g = H[6];\n h = H[7];\n\n for (t = 0; t < 64; t += 1) {\n if (t < 16) {\n W[t] = block[t];\n } else {\n W[t] = safeAdd_32_4(gamma1_32(W[t - 2]), W[t - 7], gamma0_32(W[t - 15]), W[t - 16]);\n }\n T1 = safeAdd_32_5(h, sigma1_32(e), ch_32(e, f, g), K_sha2[t], W[t]);\n T2 = safeAdd_32_2(sigma0_32(a), maj_32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = safeAdd_32_2(d, T1);\n d = c;\n c = b;\n b = a;\n a = safeAdd_32_2(T1, T2);\n }\n\n H[0] = safeAdd_32_2(a, H[0]);\n H[1] = safeAdd_32_2(b, H[1]);\n H[2] = safeAdd_32_2(c, H[2]);\n H[3] = safeAdd_32_2(d, H[3]);\n H[4] = safeAdd_32_2(e, H[4]);\n H[5] = safeAdd_32_2(f, H[5]);\n H[6] = safeAdd_32_2(g, H[6]);\n H[7] = safeAdd_32_2(h, H[7]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-256 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @param variant The desired SHA-256 variant.\n * @returns The array of integers representing the SHA-2 hash of message.\n */\nfunction finalizeSHA256(\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: number[],\n variant: VariantType\n): number[] {\n let i, retVal;\n\n /* The 65 addition is a hack but it works. The correct number is\n actually 72 (64 + 8) but the below math fails if\n remainderBinLen + 72 % 512 = 0. Since remainderBinLen % 8 = 0,\n \"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 65) >>> 9) << 4) + 15,\n binaryStringInc = 16,\n totalLen = remainderBinLen + processedBinLen;\n\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n /* Append length of binary string in the position such that the new\n * length is correct. JavaScript numbers are limited to 2^53 so it's\n * \"safe\" to treat the totalLen as a 64-bit integer. */\n\n remainder[offset] = totalLen & 0xffffffff;\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += binaryStringInc) {\n H = roundSHA256(remainder.slice(i, i + binaryStringInc), H);\n }\n\n if (\"SHA-224\" === variant) {\n retVal = [H[0], H[1], H[2], H[3], H[4], H[5], H[6]];\n } else {\n /* \"SHA-256 */\n retVal = H;\n }\n\n return retVal;\n}\nexport default class jsSHA extends jsSHABase {\n intermediateState: number[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: number[]) => number[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]) => number[];\n stateCloneFunc: (state: number[]) => number[];\n newStateFunc: (variant: VariantType) => number[];\n getMAC: () => number[];\n\n constructor(variant: VariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: VariantType, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (!(\"SHA-224\" === variant || \"SHA-256\" === variant)) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.HMACSupported = true;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA256;\n this.stateCloneFunc = function (state): number[] {\n return state.slice();\n };\n\n this.newStateFunc = getNewState256;\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, H): number[] {\n return finalizeSHA256(remainder, remainderBinLen, processedBinLen, H, variant);\n };\n\n this.intermediateState = getNewState256(variant);\n this.variantBlockSize = 512;\n this.outputBinLen = \"SHA-224\" === variant ? 224 : 256;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","/*\n * Note 1: All the functions in this file guarantee only that the bottom 32-bits of the returned Int_64 are correct.\n * JavaScript is flakey when it comes to bit operations and a '1' in the highest order bit of a 32-bit number causes\n * it to be interpreted as a negative number per two's complement.\n *\n * Note 2: Per the ECMAScript spec, all JavaScript operations mask the shift amount by 0x1F. This results in weird\n * cases like 1 << 32 == 1 and 1 << 33 === 1 << 1 === 2\n */\n\n/**\n * Int_64 is a object for 2 32-bit numbers emulating a 64-bit number.\n */\nexport class Int_64 {\n /**\n * @param msint_32 The most significant 32-bits of a 64-bit number.\n * @param lsint_32 The least significant 32-bits of a 64-bit number.\n */\n readonly highOrder: number;\n readonly lowOrder: number;\n constructor(msint_32: number, lsint_32: number) {\n this.highOrder = msint_32;\n this.lowOrder = lsint_32;\n }\n}\n\n/**\n * The 64-bit implementation of circular rotate left.\n *\n * This does not work for n >= 64 or n == 32 but those are never done.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted left circularly by `n` bits.\n */\nexport function rotl_64(x: Int_64, n: number): Int_64 {\n let tmp;\n if (n > 32) {\n tmp = 64 - n;\n return new Int_64((x.lowOrder << n) | (x.highOrder >>> tmp), (x.highOrder << n) | (x.lowOrder >>> tmp));\n } else if (0 !== n) {\n tmp = 32 - n;\n return new Int_64((x.highOrder << n) | (x.lowOrder >>> tmp), (x.lowOrder << n) | (x.highOrder >>> tmp));\n } else {\n return x;\n }\n}\n\n/**\n * The 64-bit implementation of circular rotate right.\n *\n * This does not work for n >= 64, n == 32, or n == 0 but those are never done.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right circularly by `n` bits.\n */\nfunction rotr_64(x: Int_64, n: number): Int_64 {\n let tmp;\n if (n < 32) {\n tmp = 32 - n;\n return new Int_64((x.highOrder >>> n) | (x.lowOrder << tmp), (x.lowOrder >>> n) | (x.highOrder << tmp));\n } else {\n tmp = 64 - n;\n return new Int_64((x.lowOrder >>> n) | (x.highOrder << tmp), (x.highOrder >>> n) | (x.lowOrder << tmp));\n }\n}\n\n/**\n * The 64-bit implementation of shift right.\n *\n * This does not work for n >= 32 but is only called for n < 32.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right by `n` bits\n */\nfunction shr_64(x: Int_64, n: number): Int_64 {\n return new Int_64(x.highOrder >>> n, (x.lowOrder >>> n) | (x.highOrder << (32 - n)));\n}\n\n/**\n * The 64-bit implementation of the NIST specified Ch function.\n *\n * @param x The first 64-bit integer argument.\n * @param y The second 64-bit integer argument.\n * @param z The third 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function ch_64(x: Int_64, y: Int_64, z: Int_64): Int_64 {\n return new Int_64(\n (x.highOrder & y.highOrder) ^ (~x.highOrder & z.highOrder),\n (x.lowOrder & y.lowOrder) ^ (~x.lowOrder & z.lowOrder)\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Maj function.\n *\n * @param x The first 64-bit integer argument.\n * @param y The second 64-bit integer argument.\n * @param z The third 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function maj_64(x: Int_64, y: Int_64, z: Int_64): Int_64 {\n return new Int_64(\n (x.highOrder & y.highOrder) ^ (x.highOrder & z.highOrder) ^ (y.highOrder & z.highOrder),\n (x.lowOrder & y.lowOrder) ^ (x.lowOrder & z.lowOrder) ^ (y.lowOrder & z.lowOrder)\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Sigma0 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma0_64(x: Int_64): Int_64 {\n const rotr28 = rotr_64(x, 28),\n rotr34 = rotr_64(x, 34),\n rotr39 = rotr_64(x, 39);\n\n return new Int_64(\n rotr28.highOrder ^ rotr34.highOrder ^ rotr39.highOrder,\n rotr28.lowOrder ^ rotr34.lowOrder ^ rotr39.lowOrder\n );\n}\n\n/**\n * Add two 64-bit integers.\n *\n * @param x The first 64-bit integer argument to be added.\n * @param y The second 64-bit integer argument to be added.\n * @returns The sum of `x` + `y`.\n */\nexport function safeAdd_64_2(x: Int_64, y: Int_64): Int_64 {\n let lsw, msw;\n\n lsw = (x.lowOrder & 0xffff) + (y.lowOrder & 0xffff);\n msw = (x.lowOrder >>> 16) + (y.lowOrder >>> 16) + (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw = (x.highOrder & 0xffff) + (y.highOrder & 0xffff) + (msw >>> 16);\n msw = (x.highOrder >>> 16) + (y.highOrder >>> 16) + (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * Add four 64-bit integers.\n *\n * @param a The first 64-bit integer argument to be added.\n * @param b The second 64-bit integer argument to be added.\n * @param c The third 64-bit integer argument to be added.\n * @param d The fouth 64-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d`.\n */\nexport function safeAdd_64_4(a: Int_64, b: Int_64, c: Int_64, d: Int_64): Int_64 {\n let lsw, msw;\n\n lsw = (a.lowOrder & 0xffff) + (b.lowOrder & 0xffff) + (c.lowOrder & 0xffff) + (d.lowOrder & 0xffff);\n msw = (a.lowOrder >>> 16) + (b.lowOrder >>> 16) + (c.lowOrder >>> 16) + (d.lowOrder >>> 16) + (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw =\n (a.highOrder & 0xffff) + (b.highOrder & 0xffff) + (c.highOrder & 0xffff) + (d.highOrder & 0xffff) + (msw >>> 16);\n msw = (a.highOrder >>> 16) + (b.highOrder >>> 16) + (c.highOrder >>> 16) + (d.highOrder >>> 16) + (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * Add five 64-bit integers.\n *\n * @param a The first 64-bit integer argument to be added.\n * @param b The second 64-bit integer argument to be added.\n * @param c The third 64-bit integer argument to be added.\n * @param d The fouth 64-bit integer argument to be added.\n * @param e The fifth 64-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d` + `e`.\n */\nexport function safeAdd_64_5(a: Int_64, b: Int_64, c: Int_64, d: Int_64, e: Int_64): Int_64 {\n let lsw, msw;\n\n lsw =\n (a.lowOrder & 0xffff) +\n (b.lowOrder & 0xffff) +\n (c.lowOrder & 0xffff) +\n (d.lowOrder & 0xffff) +\n (e.lowOrder & 0xffff);\n msw =\n (a.lowOrder >>> 16) +\n (b.lowOrder >>> 16) +\n (c.lowOrder >>> 16) +\n (d.lowOrder >>> 16) +\n (e.lowOrder >>> 16) +\n (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw =\n (a.highOrder & 0xffff) +\n (b.highOrder & 0xffff) +\n (c.highOrder & 0xffff) +\n (d.highOrder & 0xffff) +\n (e.highOrder & 0xffff) +\n (msw >>> 16);\n msw =\n (a.highOrder >>> 16) +\n (b.highOrder >>> 16) +\n (c.highOrder >>> 16) +\n (d.highOrder >>> 16) +\n (e.highOrder >>> 16) +\n (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * XORs two given arguments.\n *\n * @param a The first argument to be XORed.\n * @param b The second argument to be XORed.\n * @returns The The XOR `a` and `b`\n */\nexport function xor_64_2(a: Int_64, b: Int_64): Int_64 {\n return new Int_64(a.highOrder ^ b.highOrder, a.lowOrder ^ b.lowOrder);\n}\n\n/**\n * XORs five given arguments.\n *\n * @param a The first argument to be XORed.\n * @param b The second argument to be XORed.\n * @param c The third argument to be XORed.\n * @param d The fourth argument to be XORed.\n * @param e The fifth argument to be XORed.\n * @returns The XOR of `a`, `b`, `c`, `d`, and `e`.\n */\nexport function xor_64_5(a: Int_64, b: Int_64, c: Int_64, d: Int_64, e: Int_64): Int_64 {\n return new Int_64(\n a.highOrder ^ b.highOrder ^ c.highOrder ^ d.highOrder ^ e.highOrder,\n a.lowOrder ^ b.lowOrder ^ c.lowOrder ^ d.lowOrder ^ e.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Gamma1 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma1_64(x: Int_64): Int_64 {\n const rotr19 = rotr_64(x, 19),\n rotr61 = rotr_64(x, 61),\n shr6 = shr_64(x, 6);\n\n return new Int_64(\n rotr19.highOrder ^ rotr61.highOrder ^ shr6.highOrder,\n rotr19.lowOrder ^ rotr61.lowOrder ^ shr6.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Gamma0 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma0_64(x: Int_64): Int_64 {\n const rotr1 = rotr_64(x, 1),\n rotr8 = rotr_64(x, 8),\n shr7 = shr_64(x, 7);\n\n return new Int_64(\n rotr1.highOrder ^ rotr8.highOrder ^ shr7.highOrder,\n rotr1.lowOrder ^ rotr8.lowOrder ^ shr7.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Sigma1 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma1_64(x: Int_64): Int_64 {\n const rotr14 = rotr_64(x, 14),\n rotr18 = rotr_64(x, 18),\n rotr41 = rotr_64(x, 41);\n\n return new Int_64(\n rotr14.highOrder ^ rotr18.highOrder ^ rotr41.highOrder,\n rotr14.lowOrder ^ rotr18.lowOrder ^ rotr41.lowOrder\n );\n}\n","import { jsSHABase, TWO_PWR_32, H_trunc, H_full, K_sha2, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport {\n ch_64,\n gamma0_64,\n gamma1_64,\n Int_64,\n maj_64,\n safeAdd_64_2,\n safeAdd_64_4,\n safeAdd_64_5,\n sigma0_64,\n sigma1_64,\n} from \"./primitives_64\";\n\ntype VariantType = \"SHA-384\" | \"SHA-512\";\n\nconst K_sha512 = [\n new Int_64(K_sha2[0], 0xd728ae22),\n new Int_64(K_sha2[1], 0x23ef65cd),\n new Int_64(K_sha2[2], 0xec4d3b2f),\n new Int_64(K_sha2[3], 0x8189dbbc),\n new Int_64(K_sha2[4], 0xf348b538),\n new Int_64(K_sha2[5], 0xb605d019),\n new Int_64(K_sha2[6], 0xaf194f9b),\n new Int_64(K_sha2[7], 0xda6d8118),\n new Int_64(K_sha2[8], 0xa3030242),\n new Int_64(K_sha2[9], 0x45706fbe),\n new Int_64(K_sha2[10], 0x4ee4b28c),\n new Int_64(K_sha2[11], 0xd5ffb4e2),\n new Int_64(K_sha2[12], 0xf27b896f),\n new Int_64(K_sha2[13], 0x3b1696b1),\n new Int_64(K_sha2[14], 0x25c71235),\n new Int_64(K_sha2[15], 0xcf692694),\n new Int_64(K_sha2[16], 0x9ef14ad2),\n new Int_64(K_sha2[17], 0x384f25e3),\n new Int_64(K_sha2[18], 0x8b8cd5b5),\n new Int_64(K_sha2[19], 0x77ac9c65),\n new Int_64(K_sha2[20], 0x592b0275),\n new Int_64(K_sha2[21], 0x6ea6e483),\n new Int_64(K_sha2[22], 0xbd41fbd4),\n new Int_64(K_sha2[23], 0x831153b5),\n new Int_64(K_sha2[24], 0xee66dfab),\n new Int_64(K_sha2[25], 0x2db43210),\n new Int_64(K_sha2[26], 0x98fb213f),\n new Int_64(K_sha2[27], 0xbeef0ee4),\n new Int_64(K_sha2[28], 0x3da88fc2),\n new Int_64(K_sha2[29], 0x930aa725),\n new Int_64(K_sha2[30], 0xe003826f),\n new Int_64(K_sha2[31], 0x0a0e6e70),\n new Int_64(K_sha2[32], 0x46d22ffc),\n new Int_64(K_sha2[33], 0x5c26c926),\n new Int_64(K_sha2[34], 0x5ac42aed),\n new Int_64(K_sha2[35], 0x9d95b3df),\n new Int_64(K_sha2[36], 0x8baf63de),\n new Int_64(K_sha2[37], 0x3c77b2a8),\n new Int_64(K_sha2[38], 0x47edaee6),\n new Int_64(K_sha2[39], 0x1482353b),\n new Int_64(K_sha2[40], 0x4cf10364),\n new Int_64(K_sha2[41], 0xbc423001),\n new Int_64(K_sha2[42], 0xd0f89791),\n new Int_64(K_sha2[43], 0x0654be30),\n new Int_64(K_sha2[44], 0xd6ef5218),\n new Int_64(K_sha2[45], 0x5565a910),\n new Int_64(K_sha2[46], 0x5771202a),\n new Int_64(K_sha2[47], 0x32bbd1b8),\n new Int_64(K_sha2[48], 0xb8d2d0c8),\n new Int_64(K_sha2[49], 0x5141ab53),\n new Int_64(K_sha2[50], 0xdf8eeb99),\n new Int_64(K_sha2[51], 0xe19b48a8),\n new Int_64(K_sha2[52], 0xc5c95a63),\n new Int_64(K_sha2[53], 0xe3418acb),\n new Int_64(K_sha2[54], 0x7763e373),\n new Int_64(K_sha2[55], 0xd6b2b8a3),\n new Int_64(K_sha2[56], 0x5defb2fc),\n new Int_64(K_sha2[57], 0x43172f60),\n new Int_64(K_sha2[58], 0xa1f0ab72),\n new Int_64(K_sha2[59], 0x1a6439ec),\n new Int_64(K_sha2[60], 0x23631e28),\n new Int_64(K_sha2[61], 0xde82bde9),\n new Int_64(K_sha2[62], 0xb2c67915),\n new Int_64(K_sha2[63], 0xe372532b),\n new Int_64(0xca273ece, 0xea26619c),\n new Int_64(0xd186b8c7, 0x21c0c207),\n new Int_64(0xeada7dd6, 0xcde0eb1e),\n new Int_64(0xf57d4f7f, 0xee6ed178),\n new Int_64(0x06f067aa, 0x72176fba),\n new Int_64(0x0a637dc5, 0xa2c898a6),\n new Int_64(0x113f9804, 0xbef90dae),\n new Int_64(0x1b710b35, 0x131c471b),\n new Int_64(0x28db77f5, 0x23047d84),\n new Int_64(0x32caab7b, 0x40c72493),\n new Int_64(0x3c9ebe0a, 0x15c9bebc),\n new Int_64(0x431d67c4, 0x9c100d4c),\n new Int_64(0x4cc5d4be, 0xcb3e42b6),\n new Int_64(0x597f299c, 0xfc657e2a),\n new Int_64(0x5fcb6fab, 0x3ad6faec),\n new Int_64(0x6c44198c, 0x4a475817),\n];\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param variant: The SHA-512 family variant.\n * @returns The initial state values.\n */\nfunction getNewState512(variant: VariantType): Int_64[] {\n if (\"SHA-384\" === variant) {\n return [\n new Int_64(0xcbbb9d5d, H_trunc[0]),\n new Int_64(0x0629a292a, H_trunc[1]),\n new Int_64(0x9159015a, H_trunc[2]),\n new Int_64(0x0152fecd8, H_trunc[3]),\n new Int_64(0x67332667, H_trunc[4]),\n new Int_64(0x98eb44a87, H_trunc[5]),\n new Int_64(0xdb0c2e0d, H_trunc[6]),\n new Int_64(0x047b5481d, H_trunc[7]),\n ];\n } else {\n /* SHA-512 */\n return [\n new Int_64(H_full[0], 0xf3bcc908),\n new Int_64(H_full[1], 0x84caa73b),\n new Int_64(H_full[2], 0xfe94f82b),\n new Int_64(H_full[3], 0x5f1d36f1),\n new Int_64(H_full[4], 0xade682d1),\n new Int_64(H_full[5], 0x2b3e6c1f),\n new Int_64(H_full[6], 0xfb41bd6b),\n new Int_64(H_full[7], 0x137e2179),\n ];\n }\n}\n\n/**\n * Performs a round of SHA-512 hashing over a block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA512(block: number[], H: Int_64[]): Int_64[] {\n let a, b, c, d, e, f, g, h, T1, T2, t, offset;\n\n const W: Int_64[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n f = H[5];\n g = H[6];\n h = H[7];\n\n for (t = 0; t < 80; t += 1) {\n if (t < 16) {\n offset = t * 2;\n W[t] = new Int_64(block[offset], block[offset + 1]);\n } else {\n W[t] = safeAdd_64_4(gamma1_64(W[t - 2]), W[t - 7], gamma0_64(W[t - 15]), W[t - 16]);\n }\n T1 = safeAdd_64_5(h, sigma1_64(e), ch_64(e, f, g), K_sha512[t], W[t]);\n T2 = safeAdd_64_2(sigma0_64(a), maj_64(a, b, c));\n h = g;\n g = f;\n f = e;\n e = safeAdd_64_2(d, T1);\n d = c;\n c = b;\n b = a;\n a = safeAdd_64_2(T1, T2);\n }\n\n H[0] = safeAdd_64_2(a, H[0]);\n H[1] = safeAdd_64_2(b, H[1]);\n H[2] = safeAdd_64_2(c, H[2]);\n H[3] = safeAdd_64_2(d, H[3]);\n H[4] = safeAdd_64_2(e, H[4]);\n H[5] = safeAdd_64_2(f, H[5]);\n H[6] = safeAdd_64_2(g, H[6]);\n H[7] = safeAdd_64_2(h, H[7]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-512 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @param variant The desired SHA-512 variant.\n * @returns The array of integers representing the SHA-512 hash of message.\n */\nfunction finalizeSHA512(\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: Int_64[],\n variant: VariantType\n): number[] {\n let i, retVal;\n\n /* The 129 addition is a hack but it works. The correct number is\n actually 136 (128 + 8) but the below math fails if\n remainderBinLen + 136 % 1024 = 0. Since remainderBinLen % 8 = 0,\n \"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 129) >>> 10) << 5) + 31,\n binaryStringInc = 32,\n totalLen = remainderBinLen + processedBinLen;\n\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n /* Append length of binary string in the position such that the new\n * length is correct. JavaScript numbers are limited to 2^53 so it's\n * \"safe\" to treat the totalLen as a 64-bit integer. */\n\n remainder[offset] = totalLen & 0xffffffff;\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += binaryStringInc) {\n H = roundSHA512(remainder.slice(i, i + binaryStringInc), H);\n }\n\n if (\"SHA-384\" === variant) {\n H = (H as unknown) as Int_64[];\n retVal = [\n H[0].highOrder,\n H[0].lowOrder,\n H[1].highOrder,\n H[1].lowOrder,\n H[2].highOrder,\n H[2].lowOrder,\n H[3].highOrder,\n H[3].lowOrder,\n H[4].highOrder,\n H[4].lowOrder,\n H[5].highOrder,\n H[5].lowOrder,\n ];\n } else {\n /* SHA-512 */\n retVal = [\n H[0].highOrder,\n H[0].lowOrder,\n H[1].highOrder,\n H[1].lowOrder,\n H[2].highOrder,\n H[2].lowOrder,\n H[3].highOrder,\n H[3].lowOrder,\n H[4].highOrder,\n H[4].lowOrder,\n H[5].highOrder,\n H[5].lowOrder,\n H[6].highOrder,\n H[6].lowOrder,\n H[7].highOrder,\n H[7].lowOrder,\n ];\n }\n return retVal;\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: Int_64[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: Int_64[]) => Int_64[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: Int_64[]) => number[];\n stateCloneFunc: (state: Int_64[]) => Int_64[];\n newStateFunc: (variant: VariantType) => Int_64[];\n getMAC: () => number[];\n\n constructor(variant: VariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: VariantType, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (!(\"SHA-384\" === variant || \"SHA-512\" === variant)) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.HMACSupported = true;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA512;\n this.stateCloneFunc = function (state): Int_64[] {\n return state.slice();\n };\n this.newStateFunc = getNewState512;\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, H): number[] {\n return finalizeSHA512(remainder, remainderBinLen, processedBinLen, H, variant);\n };\n\n this.intermediateState = getNewState512(variant);\n this.variantBlockSize = 1024;\n this.outputBinLen = \"SHA-384\" === variant ? 384 : 512;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","import { jsSHABase, packedLEConcat, sha_variant_error, mac_rounds_error, TWO_PWR_32, parseInputOption } from \"./common\";\nimport {\n packedValue,\n CSHAKEOptionsNoEncodingType,\n CSHAKEOptionsEncodingType,\n SHAKEOptionsNoEncodingType,\n SHAKEOptionsEncodingType,\n KMACOptionsNoEncodingType,\n KMACOptionsEncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n ResolvedCSHAKEOptionsNoEncodingType,\n ResolvedKMACOptionsNoEncodingType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport { Int_64, rotl_64, xor_64_2, xor_64_5 } from \"./primitives_64\";\n\ntype FixedLengthVariantType = \"SHA3-224\" | \"SHA3-256\" | \"SHA3-384\" | \"SHA3-512\" | \"SHAKE128\" | \"SHAKE256\";\n\ntype VariantType = FixedLengthVariantType | \"SHAKE128\" | \"SHAKE256\" | \"CSHAKE128\" | \"CSHAKE256\" | \"KMAC128\" | \"KMAC256\";\n\nconst rc_sha3 = [\n new Int_64(0x00000000, 0x00000001),\n new Int_64(0x00000000, 0x00008082),\n new Int_64(0x80000000, 0x0000808a),\n new Int_64(0x80000000, 0x80008000),\n new Int_64(0x00000000, 0x0000808b),\n new Int_64(0x00000000, 0x80000001),\n new Int_64(0x80000000, 0x80008081),\n new Int_64(0x80000000, 0x00008009),\n new Int_64(0x00000000, 0x0000008a),\n new Int_64(0x00000000, 0x00000088),\n new Int_64(0x00000000, 0x80008009),\n new Int_64(0x00000000, 0x8000000a),\n new Int_64(0x00000000, 0x8000808b),\n new Int_64(0x80000000, 0x0000008b),\n new Int_64(0x80000000, 0x00008089),\n new Int_64(0x80000000, 0x00008003),\n new Int_64(0x80000000, 0x00008002),\n new Int_64(0x80000000, 0x00000080),\n new Int_64(0x00000000, 0x0000800a),\n new Int_64(0x80000000, 0x8000000a),\n new Int_64(0x80000000, 0x80008081),\n new Int_64(0x80000000, 0x00008080),\n new Int_64(0x00000000, 0x80000001),\n new Int_64(0x80000000, 0x80008008),\n];\n\nconst r_sha3 = [\n [0, 36, 3, 41, 18],\n [1, 44, 10, 45, 2],\n [62, 6, 43, 15, 61],\n [28, 55, 25, 21, 56],\n [27, 20, 39, 8, 14],\n];\n\n/**\n * Gets the state values for the specified SHA-3 variant.\n *\n * @param _variant Unused for this family.\n * @returns The initial state values.\n */\nfunction getNewState(_variant: VariantType): Int_64[][] {\n let i;\n const retVal = [];\n\n for (i = 0; i < 5; i += 1) {\n retVal[i] = [new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0)];\n }\n\n return retVal;\n}\n\n/**\n * Returns a clone of the given SHA3 state.\n *\n * @param state The state to be cloned.\n * @returns The cloned state.\n */\nfunction cloneSHA3State(state: Int_64[][]): Int_64[][] {\n let i;\n const clone = [];\n for (i = 0; i < 5; i += 1) {\n clone[i] = state[i].slice();\n }\n\n return clone;\n}\n\n/**\n * Performs a round of SHA-3 hashing over a block. This clobbers `state`.\n *\n * @param block The binary array representation of the block to hash.\n * @param state Hash state from a previous round.\n * @returns The resulting state value.\n */\nfunction roundSHA3(block: number[] | null, state: Int_64[][]): Int_64[][] {\n let round, x, y, B;\n const C = [],\n D = [];\n\n if (null !== block) {\n for (x = 0; x < block.length; x += 2) {\n state[(x >>> 1) % 5][((x >>> 1) / 5) | 0] = xor_64_2(\n state[(x >>> 1) % 5][((x >>> 1) / 5) | 0],\n new Int_64(block[x + 1], block[x])\n );\n }\n }\n\n for (round = 0; round < 24; round += 1) {\n /* Any SHA-3 variant name will do here */\n B = getNewState(\"SHA3-384\");\n\n /* Perform theta step */\n for (x = 0; x < 5; x += 1) {\n C[x] = xor_64_5(state[x][0], state[x][1], state[x][2], state[x][3], state[x][4]);\n }\n for (x = 0; x < 5; x += 1) {\n D[x] = xor_64_2(C[(x + 4) % 5], rotl_64(C[(x + 1) % 5], 1));\n }\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n state[x][y] = xor_64_2(state[x][y], D[x]);\n }\n }\n\n /* Perform combined ro and pi steps */\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n B[y][(2 * x + 3 * y) % 5] = rotl_64(state[x][y], r_sha3[x][y]);\n }\n }\n\n /* Perform chi step */\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n state[x][y] = xor_64_2(\n B[x][y],\n new Int_64(\n ~B[(x + 1) % 5][y].highOrder & B[(x + 2) % 5][y].highOrder,\n ~B[(x + 1) % 5][y].lowOrder & B[(x + 2) % 5][y].lowOrder\n )\n );\n }\n }\n\n /* Perform iota step */\n state[0][0] = xor_64_2(state[0][0], rc_sha3[round]);\n }\n\n return state;\n}\n\n/**\n * Finalizes the SHA-3 hash. This clobbers `remainder` and `state`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param _processedBinLen Unused for this family.\n * @param state The state from a previous round.\n * @param blockSize The block size/rate of the variant in bits\n * @param delimiter The delimiter value for the variant\n * @param outputLen The output length for the variant in bits\n * @returns The array of integers representing the SHA-3 hash of message.\n */\nfunction finalizeSHA3(\n remainder: number[],\n remainderBinLen: number,\n _processedBinLen: number,\n state: Int_64[][],\n blockSize: number,\n delimiter: number,\n outputLen: number\n): number[] {\n let i,\n state_offset = 0,\n temp;\n const retVal = [],\n binaryStringInc = blockSize >>> 5,\n remainderIntLen = remainderBinLen >>> 5;\n\n /* Process as many blocks as possible, some may be here for multiple rounds\n\t\twith SHAKE\n\t*/\n for (i = 0; i < remainderIntLen && remainderBinLen >= blockSize; i += binaryStringInc) {\n state = roundSHA3(remainder.slice(i, i + binaryStringInc), state);\n remainderBinLen -= blockSize;\n }\n\n remainder = remainder.slice(i);\n remainderBinLen = remainderBinLen % blockSize;\n\n /* Pad out the remainder to a full block */\n while (remainder.length < binaryStringInc) {\n remainder.push(0);\n }\n\n /* Find the next \"empty\" byte for the 0x80 and append it via an xor */\n i = remainderBinLen >>> 3;\n remainder[i >> 2] ^= delimiter << (8 * (i % 4));\n\n remainder[binaryStringInc - 1] ^= 0x80000000;\n state = roundSHA3(remainder, state);\n\n while (retVal.length * 32 < outputLen) {\n temp = state[state_offset % 5][(state_offset / 5) | 0];\n retVal.push(temp.lowOrder);\n if (retVal.length * 32 >= outputLen) {\n break;\n }\n retVal.push(temp.highOrder);\n state_offset += 1;\n\n if (0 === (state_offset * 64) % blockSize) {\n roundSHA3(null, state);\n state_offset = 0;\n }\n }\n\n return retVal;\n}\n\n/**\n * Performs NIST left_encode function returned with no extra garbage bits. `x` is limited to <= 9007199254740991.\n *\n * @param x 32-bit number to to encode.\n * @returns The NIST specified output of the function.\n */\nfunction left_encode(x: number): packedValue {\n let byteOffset,\n byte,\n numEncodedBytes = 0;\n /* JavaScript numbers max out at 0x1FFFFFFFFFFFFF (7 bytes) so this will return a maximum of 7 + 1 = 8 bytes */\n const retVal = [0, 0],\n x_64 = [x & 0xffffffff, (x / TWO_PWR_32) & 0x1fffff];\n\n for (byteOffset = 6; byteOffset >= 0; byteOffset--) {\n /* This will surprisingly work for large shifts because JavaScript masks the shift amount by 0x1F */\n byte = (x_64[byteOffset >> 2] >>> (8 * byteOffset)) & 0xff;\n\n /* Starting from the most significant byte of a 64-bit number, start recording the first non-0 byte and then\n every byte thereafter */\n if (byte !== 0 || numEncodedBytes !== 0) {\n retVal[(numEncodedBytes + 1) >> 2] |= byte << ((numEncodedBytes + 1) * 8);\n numEncodedBytes += 1;\n }\n }\n numEncodedBytes = numEncodedBytes !== 0 ? numEncodedBytes : 1;\n retVal[0] |= numEncodedBytes;\n\n return { value: numEncodedBytes + 1 > 4 ? retVal : [retVal[0]], binLen: 8 + numEncodedBytes * 8 };\n}\n\n/**\n * Performs NIST right_encode function returned with no extra garbage bits. `x` is limited to <= 9007199254740991.\n *\n * @param x 32-bit number to to encode.\n * @returns The NIST specified output of the function.\n */\nfunction right_encode(x: number): packedValue {\n let byteOffset,\n byte,\n numEncodedBytes = 0;\n /* JavaScript numbers max out at 0x1FFFFFFFFFFFFF (7 bytes) so this will return a maximum of 7 + 1 = 8 bytes */\n const retVal = [0, 0],\n x_64 = [x & 0xffffffff, (x / TWO_PWR_32) & 0x1fffff];\n\n for (byteOffset = 6; byteOffset >= 0; byteOffset--) {\n /* This will surprisingly work for large shifts because JavaScript masks the shift amount by 0x1F */\n byte = (x_64[byteOffset >> 2] >>> (8 * byteOffset)) & 0xff;\n\n /* Starting from the most significant byte of a 64-bit number, start recording the first non-0 byte and then\n every byte thereafter */\n if (byte !== 0 || numEncodedBytes !== 0) {\n retVal[numEncodedBytes >> 2] |= byte << (numEncodedBytes * 8);\n numEncodedBytes += 1;\n }\n }\n numEncodedBytes = numEncodedBytes !== 0 ? numEncodedBytes : 1;\n retVal[numEncodedBytes >> 2] |= numEncodedBytes << (numEncodedBytes * 8);\n\n return { value: numEncodedBytes + 1 > 4 ? retVal : [retVal[0]], binLen: 8 + numEncodedBytes * 8 };\n}\n\n/**\n * Performs NIST encode_string function.\n *\n * @param input Packed array of integers.\n * @returns NIST encode_string output.\n */\nfunction encode_string(input: packedValue): packedValue {\n return packedLEConcat(left_encode(input[\"binLen\"]), input);\n}\n\n/**\n * Performs NIST byte_pad function.\n *\n * @param packed Packed array of integers.\n * @param outputByteLen Desired length of the output in bytes, assumed to be a multiple of 4.\n * @returns NIST byte_pad output.\n */\nfunction byte_pad(packed: packedValue, outputByteLen: number): number[] {\n let encodedLen = left_encode(outputByteLen),\n i;\n\n encodedLen = packedLEConcat(encodedLen, packed);\n const outputIntLen = outputByteLen >>> 2,\n intsToAppend = (outputIntLen - (encodedLen[\"value\"].length % outputIntLen)) % outputIntLen;\n\n for (i = 0; i < intsToAppend; i++) {\n encodedLen[\"value\"].push(0);\n }\n\n return encodedLen[\"value\"];\n}\n\n/**\n * Parses/validate constructor options for a CSHAKE variant\n *\n * @param options Option given to constructor\n */\nfunction resolveCSHAKEOptions(options: CSHAKEOptionsNoEncodingType): ResolvedCSHAKEOptionsNoEncodingType {\n const resolvedOptions = options || {};\n\n return {\n funcName: parseInputOption(\"funcName\", resolvedOptions[\"funcName\"], 1, { value: [], binLen: 0 }),\n customization: parseInputOption(\"Customization\", resolvedOptions[\"customization\"], 1, { value: [], binLen: 0 }),\n };\n}\n\n/**\n * Parses/validate constructor options for a KMAC variant\n *\n * @param options Option given to constructor\n */\nfunction resolveKMACOptions(options: KMACOptionsNoEncodingType): ResolvedKMACOptionsNoEncodingType {\n const resolvedOptions = options || {};\n\n return {\n kmacKey: parseInputOption(\"kmacKey\", resolvedOptions[\"kmacKey\"], 1),\n /* This is little-endian packed \"KMAC\" */\n funcName: { value: [0x43414d4b], binLen: 32 },\n customization: parseInputOption(\"Customization\", resolvedOptions[\"customization\"], 1, { value: [], binLen: 0 }),\n };\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: Int_64[][];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: Int_64[][]) => Int_64[][];\n finalizeFunc: (\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: Int_64[][],\n outputLen: number\n ) => number[];\n stateCloneFunc: (state: Int_64[][]) => Int_64[][];\n newStateFunc: (variant: VariantType) => Int_64[][];\n getMAC: ((options: { outputLen: number }) => number[]) | null;\n\n constructor(variant: FixedLengthVariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(\n variant: FixedLengthVariantType,\n inputFormat: FormatNoTextType,\n options?: FixedLengthOptionsNoEncodingType\n );\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: \"TEXT\", options?: SHAKEOptionsEncodingType);\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: FormatNoTextType, options?: SHAKEOptionsNoEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: \"TEXT\", options?: CSHAKEOptionsEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: FormatNoTextType, options?: CSHAKEOptionsNoEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: \"TEXT\", options: KMACOptionsEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: FormatNoTextType, options: KMACOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n let delimiter = 0x06,\n variantBlockSize = 0;\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n /* In other variants, this was done after variable initialization but need to do it earlier here becaue we want to\n avoid KMAC initialization */\n if (this.numRounds !== 1) {\n if (resolvedOptions[\"kmacKey\"] || resolvedOptions[\"hmacKey\"]) {\n throw new Error(mac_rounds_error);\n } else if (this.shaVariant === \"CSHAKE128\" || this.shaVariant === \"CSHAKE256\") {\n throw new Error(\"Cannot set numRounds for CSHAKE variants\");\n }\n }\n\n this.bigEndianMod = 1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA3;\n this.stateCloneFunc = cloneSHA3State;\n this.newStateFunc = getNewState;\n this.intermediateState = getNewState(variant);\n\n this.isVariableLen = false;\n switch (variant) {\n case \"SHA3-224\":\n this.variantBlockSize = variantBlockSize = 1152;\n this.outputBinLen = 224;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-256\":\n this.variantBlockSize = variantBlockSize = 1088;\n this.outputBinLen = 256;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-384\":\n this.variantBlockSize = variantBlockSize = 832;\n this.outputBinLen = 384;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-512\":\n this.variantBlockSize = variantBlockSize = 576;\n this.outputBinLen = 512;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHAKE128\":\n delimiter = 0x1f;\n this.variantBlockSize = variantBlockSize = 1344;\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"SHAKE256\":\n delimiter = 0x1f;\n this.variantBlockSize = variantBlockSize = 1088;\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"KMAC128\":\n delimiter = 0x4;\n this.variantBlockSize = variantBlockSize = 1344;\n this._initializeKMAC(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getKMAC;\n break;\n case \"KMAC256\":\n delimiter = 0x4;\n this.variantBlockSize = variantBlockSize = 1088;\n this._initializeKMAC(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getKMAC;\n break;\n case \"CSHAKE128\":\n this.variantBlockSize = variantBlockSize = 1344;\n delimiter = this._initializeCSHAKE(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"CSHAKE256\":\n this.variantBlockSize = variantBlockSize = 1088;\n delimiter = this._initializeCSHAKE(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n default:\n throw new Error(sha_variant_error);\n }\n\n /* This needs to be down here as CSHAKE can change its delimiter */\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, state, outputBinLen): number[] {\n return finalizeSHA3(\n remainder,\n remainderBinLen,\n processedBinLen,\n state,\n variantBlockSize,\n delimiter,\n outputBinLen\n );\n };\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n\n /**\n * Initialize CSHAKE variants.\n *\n * @param options Options containing CSHAKE params.\n * @param funcNameOverride Overrides any \"funcName\" present in `options` (used with KMAC)\n * @returns The delimiter to be used\n */\n protected _initializeCSHAKE(options?: CSHAKEOptionsNoEncodingType, funcNameOverride?: packedValue): number {\n const resolvedOptions = resolveCSHAKEOptions(options || {});\n if (funcNameOverride) {\n resolvedOptions[\"funcName\"] = funcNameOverride;\n }\n const packedParams = packedLEConcat(\n encode_string(resolvedOptions[\"funcName\"]),\n encode_string(resolvedOptions[\"customization\"])\n );\n\n /* CSHAKE is defined to be a call to SHAKE iff both the customization and function-name string are both empty. This\n can be accomplished by processing nothing in this step. */\n if (resolvedOptions[\"customization\"][\"binLen\"] !== 0 || resolvedOptions[\"funcName\"][\"binLen\"] !== 0) {\n const byte_pad_out = byte_pad(packedParams, this.variantBlockSize >>> 3);\n for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) {\n this.intermediateState = this.roundFunc(\n byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)),\n this.intermediateState\n );\n this.processedLen += this.variantBlockSize;\n }\n return 0x04;\n } else {\n return 0x1f;\n }\n }\n\n /**\n * Initialize KMAC variants.\n *\n * @param options Options containing KMAC params.\n */\n protected _initializeKMAC(options: KMACOptionsNoEncodingType): void {\n const resolvedOptions = resolveKMACOptions(options || {});\n\n this._initializeCSHAKE(options, resolvedOptions[\"funcName\"]);\n const byte_pad_out = byte_pad(encode_string(resolvedOptions[\"kmacKey\"]), this.variantBlockSize >>> 3);\n for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) {\n this.intermediateState = this.roundFunc(\n byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)),\n this.intermediateState\n );\n this.processedLen += this.variantBlockSize;\n }\n this.macKeySet = true;\n }\n\n /**\n * Returns the the KMAC in the specified format.\n *\n * @param options Hashmap of extra outputs options. `outputLen` must be specified.\n * @returns The KMAC in the format specified.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected _getKMAC(options: { outputLen: number }): number[] {\n const concatedRemainder = packedLEConcat(\n { value: this.remainder.slice(), binLen: this.remainderLen },\n right_encode(options[\"outputLen\"])\n );\n\n return this.finalizeFunc(\n concatedRemainder[\"value\"],\n concatedRemainder[\"binLen\"],\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n options[\"outputLen\"]\n );\n }\n}\n","import { sha_variant_error } from \"./common\";\nimport {\n CSHAKEOptionsEncodingType,\n CSHAKEOptionsNoEncodingType,\n SHAKEOptionsEncodingType,\n SHAKEOptionsNoEncodingType,\n EncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n KMACOptionsNoEncodingType,\n KMACOptionsEncodingType,\n} from \"./custom_types\";\nimport jsSHA1 from \"./sha1\";\nimport jsSHA256 from \"./sha256\";\nimport jsSHA512 from \"./sha512\";\nimport jsSHA3 from \"./sha3\";\n\ntype FixedLengthVariantType =\n | \"SHA-1\"\n | \"SHA-224\"\n | \"SHA-256\"\n | \"SHA-384\"\n | \"SHA-512\"\n | \"SHA3-224\"\n | \"SHA3-256\"\n | \"SHA3-384\"\n | \"SHA3-512\";\n\nexport default class jsSHA {\n private readonly shaObj: jsSHA1 | jsSHA256 | jsSHA512 | jsSHA3;\n /**\n * @param variant The desired SHA variant (SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-256,\n * SHA3-384, SHA3-512, SHAKE128, SHAKE256, CSHAKE128, CSHAKE256, KMAC128, or KMAC256) as a string.\n * @param inputFormat The input format to be used in future `update` calls (TEXT, HEX, B64, BYTES, ARRAYBUFFER,\n * or UINT8ARRAY) as a string.\n * @param options Options in the form of { encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE\"; numRounds?: number }.\n * `encoding` is for only TEXT input (defaults to UTF8) and `numRounds` defaults to 1.\n * `numRounds` is not valid for any of the MAC or CSHAKE variants.\n * * If the variant supports HMAC, `options` may have an additional `hmacKey` key which must be in the form of\n * {value: , format: , encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE\"} where takes the same\n * values as `inputFormat` and can be a `string | ArrayBuffer | Uint8Array` depending on .\n * Supplying this key switches to HMAC calculation and replaces the now deprecated call to `setHMACKey`.\n * * If the variant is CSHAKE128 or CSHAKE256, `options` may have two additional keys, `customization` and `funcName`,\n * which are the NIST customization and function-name strings. Both must be in the same form as `hmacKey`.\n * * If the variant is KMAC128 or KMAC256, `options` can include the `customization` key from CSHAKE variants and\n * *must* have a `kmacKey` key that takes the same form as the `customization` key.\n */\n constructor(variant: FixedLengthVariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(\n variant: FixedLengthVariantType,\n inputFormat: FormatNoTextType,\n options?: FixedLengthOptionsNoEncodingType\n );\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: \"TEXT\", options?: SHAKEOptionsEncodingType);\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: FormatNoTextType, options?: SHAKEOptionsNoEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: \"TEXT\", options?: CSHAKEOptionsEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: FormatNoTextType, options?: CSHAKEOptionsNoEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: \"TEXT\", options: KMACOptionsEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: FormatNoTextType, options: KMACOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (\"SHA-1\" == variant) {\n this.shaObj = new jsSHA1(variant, inputFormat, options);\n } else if (\"SHA-224\" == variant || \"SHA-256\" == variant) {\n this.shaObj = new jsSHA256(variant, inputFormat, options);\n } else if (\"SHA-384\" == variant || \"SHA-512\" == variant) {\n this.shaObj = new jsSHA512(variant, inputFormat, options);\n } else if (\n \"SHA3-224\" == variant ||\n \"SHA3-256\" == variant ||\n \"SHA3-384\" == variant ||\n \"SHA3-512\" == variant ||\n \"SHAKE128\" == variant ||\n \"SHAKE256\" == variant ||\n \"CSHAKE128\" == variant ||\n \"CSHAKE256\" == variant ||\n \"KMAC128\" == variant ||\n \"KMAC256\" == variant\n ) {\n this.shaObj = new jsSHA3(variant, inputFormat, options);\n } else {\n throw new Error(sha_variant_error);\n }\n }\n\n /**\n * Takes `input` and hashes as many blocks as possible. Stores the rest for either a future `update` or `getHash` call.\n *\n * @param input The input to be hashed.\n * @returns A reference to the object.\n */\n update(input: string | ArrayBuffer | Uint8Array): this {\n this.shaObj.update(input);\n\n return this;\n }\n\n /**\n * Returns the desired SHA or MAC (if a HMAC/KMAC key was specified) hash of the input fed in via `update` calls.\n *\n * @param format The desired output formatting (B64, HEX, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { outputUpper?: boolean; b64Pad?: string; outputLen?: number; }.\n * `outputLen` is required for variable length output variants (this option was previously called `shakeLen` which\n * is now deprecated).\n * `outputUpper` is only for HEX output (defaults to false) and b64pad is only for B64 output (defaults to \"=\").\n * @returns The hash in the format specified.\n */\n getHash(format: \"HEX\", options?: { outputUpper?: boolean; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"B64\", options?: { b64Pad?: string; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"BYTES\", options?: { outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"UINT8ARRAY\", options?: { outputLen?: number; shakeLen?: number }): Uint8Array;\n getHash(format: \"ARRAYBUFFER\", options?: { outputLen?: number; shakeLen?: number }): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHash(format: any, options?: any): any {\n return this.shaObj.getHash(format, options);\n }\n\n /**\n * Sets the HMAC key for an eventual `getHMAC` call. Must be called immediately after jsSHA object instantiation.\n * Now deprecated in favor of setting the `hmacKey` at object instantiation.\n *\n * @param key The key used to calculate the HMAC\n * @param inputFormat The format of key (HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE }. `encoding` is only for TEXT\n * and defaults to UTF8.\n */\n setHMACKey(key: string, inputFormat: \"TEXT\", options?: { encoding?: EncodingType }): void;\n setHMACKey(key: string, inputFormat: \"B64\" | \"HEX\" | \"BYTES\"): void;\n setHMACKey(key: ArrayBuffer, inputFormat: \"ARRAYBUFFER\"): void;\n setHMACKey(key: Uint8Array, inputFormat: \"UINT8ARRAY\"): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setHMACKey(key: any, inputFormat: any, options?: any): void {\n this.shaObj.setHMACKey(key, inputFormat, options);\n }\n\n /**\n * Returns the the HMAC in the specified format using the key given by a previous `setHMACKey` call. Now deprecated\n * in favor of just calling `getHash`.\n *\n * @param format The desired output formatting (B64, HEX, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { outputUpper?: boolean; b64Pad?: string }. `outputUpper` is only for HEX\n * output (defaults to false) and `b64pad` is only for B64 output (defaults to \"=\").\n * @returns The HMAC in the format specified.\n */\n getHMAC(format: \"HEX\", options?: { outputUpper?: boolean }): string;\n getHMAC(format: \"B64\", options?: { b64Pad?: string }): string;\n getHMAC(format: \"BYTES\"): string;\n getHMAC(format: \"UINT8ARRAY\"): Uint8Array;\n getHMAC(format: \"ARRAYBUFFER\"): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHMAC(format: any, options?: any): any {\n return this.shaObj.getHMAC(format, options);\n }\n}\n"],"names":["b64Tab","arraybuffer_error","uint8array_error","uint8array2packed","arr","existingPacked","existingPackedLen","bigEndianMod","i","intOffset","byteOffset","packed","existingByteLen","shiftModifier","length","push","value","binLen","getStrConverter","format","utfType","Error","str","existingBin","existingBinLen","num","parseInt","substr","isNaN","hex2packed","codePnt","codePntArr","j","transposeBytes","byteCnt","charCodeAt","str2packed","index","tmpInt","strPart","firstEqual","indexOf","search","replace","charAt","b642packed","bytes2packed","ArrayBuffer","ignore","Uint8Array","arraybuffer2packed","getOutputConverter","outputBinLen","outputOptions","binarray","outputLength","formatOpts","hex_tab","srcByte","toUpperCase","packed2hex","triplet","int1","int2","packed2b64","String","fromCharCode","packed2bytes","retVal","arrView","packed2arraybuffer","packed2uint8array","TWO_PWR_32","K_sha2","H_trunc","H_full","sha_variant_error","mac_rounds_error","packedLEConcat","a","b","arrOffset","aByteLen","bByteLen","leftShiftAmount","rightShiftAmount","pop","concat","getOutputOpts","options","outputUpper","b64Pad","outputLen","lenErrstr","parseInputOption","key","fallback","errStr","jsSHABase","constructor","variant","inputFormat","inputOptions","this","numRounds","shaVariant","remainder","remainderLen","updateCalled","processedLen","macKeySet","keyWithIPad","keyWithOPad","update","srcString","updateProcessedLen","variantBlockIntInc","variantBlockSize","convertRet","converterFunc","chunkBinLen","chunk","chunkIntLen","intermediateState","roundFunc","slice","getHash","finalizedState","isVariableLen","formatFunc","getMAC","finalizeFunc","stateCloneFunc","newStateFunc","setHMACKey","HMACSupported","keyConverterFunc","_setHMACKey","blockByteSize","lastArrayIndex","getHMAC","_getHMAC","firstHash","rotl_32","x","n","rotr_32","shr_32","parity_32","y","z","ch_32","maj_32","sigma0_32","safeAdd_32_2","lsw","safeAdd_32_4","c","d","safeAdd_32_5","e","gamma0_32","sigma1_32","getNewState","_variant","roundSHA1","block","H","T","t","W","finalizeSHA1","remainderBinLen","processedBinLen","offset","totalLen","super","resolvedOptions","state","getNewState256","roundSHA256","f","g","h","T1","T2","finalizeSHA256","Int_64","msint_32","lsint_32","highOrder","lowOrder","rotl_64","tmp","rotr_64","shr_64","maj_64","sigma0_64","rotr28","rotr34","rotr39","safeAdd_64_2","msw","safeAdd_64_4","safeAdd_64_5","xor_64_2","gamma1_64","rotr19","rotr61","shr6","gamma0_64","rotr1","rotr8","shr7","sigma1_64","rotr14","rotr18","rotr41","K_sha512","getNewState512","roundSHA512","finalizeSHA512","rc_sha3","r_sha3","cloneSHA3State","clone","roundSHA3","round","B","C","D","left_encode","byte","numEncodedBytes","x_64","encode_string","input","byte_pad","outputByteLen","encodedLen","outputIntLen","intsToAppend","delimiter","_initializeKMAC","_getKMAC","_initializeCSHAKE","_processedBinLen","blockSize","temp","state_offset","binaryStringInc","remainderIntLen","finalizeSHA3","funcNameOverride","funcName","customization","resolveCSHAKEOptions","packedParams","byte_pad_out","kmacKey","resolveKMACOptions","concatedRemainder","right_encode","jsSHA","shaObj","jsSHA1","jsSHA256","jsSHA512","jsSHA3"],"mappings":";;;;;;;;AAIA,MAAMA,EAAS,mEAETC,EAAoB,gDACpBC,EAAmB,+CAyPzB,SAASC,EACPC,EACAC,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AAIrK,EAAS,CAACA,EAAO,IAAKnD,OAAQ,EAAsB,EAAlBwN,EAC9E,CAwSM6B,CAAa7K,EAAmB,YAGlC,OAAOc,KAAK4B,EACVkI,EAAyB,MACzBA,EAA0B,OAC1B9J,KAAKM,EACLN,KAAK6B,EAAe7B,KAAKoB,GACzBlC,EAAmB,UAEtB,GCjjBW,MAAO8K,GAgCnB,WAAApK,CAAYC,EAAcC,EAAkBZ,GAC1C,GAAI,SAAWW,EACbG,KAAKiK,EAAS,IAAIC,EAAOrK,EAASC,EAAaZ,QAC1C,GAAI,WAAaW,GAAW,WAAaA,EAC9CG,KAAKiK,EAAS,IAAIE,EAAStK,EAASC,EAAaZ,QAC5C,GAAI,WAAaW,GAAW,WAAaA,EAC9CG,KAAKiK,EAAS,IAAIG,EAASvK,EAASC,EAAaZ,OAC5C,IACL,YAAcW,GACd,YAAcA,GACd,YAAcA,GACd,YAAcA,GACd,YAAcA,GACd,YAAcA,GACd,aAAeA,GACf,aAAeA,GACf,WAAaA,GACb,WAAaA,EAIb,MAAM,IAAI/E,MAAMuD,GAFhB2B,KAAKiK,EAAS,IAAII,GAAOxK,EAASC,EAAaZ,EAGhD,CACF,CAQD,MAAAwB,CAAO2H,GAGL,OAFArI,KAAKiK,EAAOvJ,OAAO2H,GAEZrI,IACR,CAkBD,OAAAuB,CAAQ3G,EAAasE,GACnB,OAAOc,KAAKiK,EAAO1I,QAAQ3G,EAAQsE,EACpC,CAgBD,UAAA6C,CAAWvC,EAAUM,EAAkBZ,GACrCc,KAAKiK,EAAOlI,WAAWvC,EAAKM,EAAaZ,EAC1C,CAiBD,OAAAmD,CAAQzH,EAAasE,GACnB,OAAOc,KAAKiK,EAAO5H,QAAQzH,EAAQsE,EACpC"} \ No newline at end of file +{"version":3,"file":"sha.mjs","sources":["../src/converters.ts","../src/common.ts","../src/primitives_32.ts","../src/sha1.ts","../src/sha256.ts","../src/primitives_64.ts","../src/sha512.ts","../src/sha3.ts","../src/sha.ts"],"sourcesContent":["import { packedValue, EncodingType, FormatType } from \"./custom_types\";\n/**\n * Return type for all the *2packed functions\n */\nconst b64Tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\nconst arraybuffer_error = \"ARRAYBUFFER not supported by this environment\";\nconst uint8array_error = \"UINT8ARRAY not supported by this environment\";\n\n/**\n * Convert a string to an array of words.\n *\n * There is a known bug with an odd number of existing bytes and using a UTF-16 encoding. However, this function is\n * used such that the existing bytes are always a result of a previous UTF-16 str2packed call and therefore there \n * should never be an odd number of existing bytes.\n\n * @param str Unicode string to be converted to binary representation.\n * @param utfType The Unicode type to use to encode the source string.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked`.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction str2packed(\n str: string,\n utfType: EncodingType,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let codePnt,\n codePntArr,\n byteCnt = 0,\n i,\n j,\n intOffset,\n byteOffset,\n shiftModifier,\n transposeBytes;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3;\n\n if (\"UTF8\" === utfType) {\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n codePntArr = [];\n\n if (0x80 > codePnt) {\n codePntArr.push(codePnt);\n } else if (0x800 > codePnt) {\n codePntArr.push(0xc0 | (codePnt >>> 6));\n codePntArr.push(0x80 | (codePnt & 0x3f));\n } else if (0xd800 > codePnt || 0xe000 <= codePnt) {\n codePntArr.push(0xe0 | (codePnt >>> 12), 0x80 | ((codePnt >>> 6) & 0x3f), 0x80 | (codePnt & 0x3f));\n } else {\n i += 1;\n codePnt = 0x10000 + (((codePnt & 0x3ff) << 10) | (str.charCodeAt(i) & 0x3ff));\n codePntArr.push(\n 0xf0 | (codePnt >>> 18),\n 0x80 | ((codePnt >>> 12) & 0x3f),\n 0x80 | ((codePnt >>> 6) & 0x3f),\n 0x80 | (codePnt & 0x3f),\n );\n }\n\n for (j = 0; j < codePntArr.length; j += 1) {\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n /* Known bug kicks in here */\n packed[intOffset] |= codePntArr[j] << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 1;\n }\n }\n } else {\n /* UTF16BE or UTF16LE */\n shiftModifier = bigEndianMod === -1 ? 2 : 0;\n /* Internally strings are UTF-16BE so transpose bytes under two conditions:\n * need LE and not switching endianness due to SHA-3\n * need BE and switching endianness due to SHA-3 */\n transposeBytes = (\"UTF16LE\" === utfType && bigEndianMod !== 1) || (\"UTF16LE\" !== utfType && bigEndianMod === 1);\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n if (transposeBytes === true) {\n j = codePnt & 0xff;\n codePnt = (j << 8) | (codePnt >>> 8);\n }\n\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= codePnt << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 2;\n }\n }\n return { value: packed, binLen: byteCnt * 8 + existingPackedLen };\n}\n\n/**\n * Convert a hex string to an array of words.\n *\n * @param str Hexadecimal string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction hex2packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let i, num, intOffset, byteOffset;\n\n if (0 !== str.length % 2) {\n throw new Error(\"String of HEX type must be in byte increments\");\n }\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < str.length; i += 2) {\n num = parseInt(str.substr(i, 2), 16);\n if (!isNaN(num)) {\n byteOffset = (i >>> 1) + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= num << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n } else {\n throw new Error(\"String of HEX type contains invalid characters\");\n }\n }\n\n return { value: packed, binLen: str.length * 4 + existingPackedLen };\n}\n\n/**\n * Convert a string of raw bytes to an array of words.\n *\n * @param str String of raw bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction bytes2packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let codePnt, i, intOffset, byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < str.length; i += 1) {\n codePnt = str.charCodeAt(i);\n\n byteOffset = i + existingByteLen;\n intOffset = byteOffset >>> 2;\n if (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= codePnt << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n }\n\n return { value: packed, binLen: str.length * 8 + existingPackedLen };\n}\n\n/**\n * Convert a base-64 string to an array of words.\n *\n * @param str Base64-encoded string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction b642packed(\n str: string,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let byteCnt = 0,\n index,\n i,\n j,\n tmpInt,\n strPart,\n intOffset,\n byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0,\n firstEqual = str.indexOf(\"=\");\n\n if (-1 === str.search(/^[a-zA-Z0-9=+/]+$/)) {\n throw new Error(\"Invalid character in base-64 string\");\n }\n\n str = str.replace(/=/g, \"\");\n if (-1 !== firstEqual && firstEqual < str.length) {\n throw new Error(\"Invalid '=' found in base-64 string\");\n }\n\n for (i = 0; i < str.length; i += 4) {\n strPart = str.substr(i, 4);\n tmpInt = 0;\n\n for (j = 0; j < strPart.length; j += 1) {\n index = b64Tab.indexOf(strPart.charAt(j));\n tmpInt |= index << (18 - 6 * j);\n }\n\n for (j = 0; j < strPart.length - 1; j += 1) {\n byteOffset = byteCnt + existingByteLen;\n intOffset = byteOffset >>> 2;\n while (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |=\n ((tmpInt >>> (16 - j * 8)) & 0xff) << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n byteCnt += 1;\n }\n }\n\n return { value: packed, binLen: byteCnt * 8 + existingPackedLen };\n}\n\n/**\n * Convert an Uint8Array to an array of words.\n *\n * @param arr Uint8Array to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction uint8array2packed(\n arr: Uint8Array,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n let i, intOffset, byteOffset;\n\n existingPackedLen = existingPackedLen || 0;\n const packed = existingPacked || [0],\n existingByteLen = existingPackedLen >>> 3,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < arr.length; i += 1) {\n byteOffset = i + existingByteLen;\n intOffset = byteOffset >>> 2;\n if (packed.length <= intOffset) {\n packed.push(0);\n }\n packed[intOffset] |= arr[i] << (8 * (shiftModifier + bigEndianMod * (byteOffset % 4)));\n }\n\n return { value: packed, binLen: arr.length * 8 + existingPackedLen };\n}\n\n/**\n * Convert an ArrayBuffer to an array of words\n *\n * @param arr ArrayBuffer to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Hashmap of the packed values.\n */\nfunction arraybuffer2packed(\n arr: ArrayBuffer,\n existingPacked: number[] | undefined,\n existingPackedLen: number | undefined,\n bigEndianMod: -1 | 1,\n): packedValue {\n return uint8array2packed(new Uint8Array(arr), existingPacked, existingPackedLen, bigEndianMod);\n}\n\n/**\n * Function that takes an input format and UTF encoding and returns the appropriate function used to convert the input.\n *\n * @param format The format of the input to be converted\n * @param utfType The string encoding to use for TEXT inputs.\n * @param bigEndianMod Modifier for whether hash function is big or small endian\n * @returns Function that will convert an input to a packed int array.\n */\nexport function getStrConverter(\n format: FormatType,\n utfType: EncodingType,\n bigEndianMod: -1 | 1,\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n): (input: any, existingBin?: number[], existingBinLen?: number) => packedValue {\n /* Validate encoding */\n switch (utfType) {\n case \"UTF8\":\n /* Fallthrough */\n case \"UTF16BE\":\n /* Fallthrough */\n case \"UTF16LE\":\n /* Fallthrough */\n break;\n default:\n throw new Error(\"encoding must be UTF8, UTF16BE, or UTF16LE\");\n }\n\n /* Map inputFormat to the appropriate converter */\n switch (format) {\n case \"HEX\":\n /**\n * @param str String of hexadecimal bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return hex2packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"TEXT\":\n /**\n * @param str Unicode string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return str2packed(str, utfType, existingBin, existingBinLen, bigEndianMod);\n };\n case \"B64\":\n /**\n * @param str Base64-encoded string to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return b642packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"BYTES\":\n /**\n * @param str String of raw bytes to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (str: string, existingBin?: number[], existingBinLen?: number): packedValue {\n return bytes2packed(str, existingBin, existingBinLen, bigEndianMod);\n };\n case \"ARRAYBUFFER\":\n try {\n new ArrayBuffer(0);\n } catch {\n throw new Error(arraybuffer_error);\n }\n /**\n * @param arr ArrayBuffer to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (arr: ArrayBuffer, existingBin?: number[], existingBinLen?: number): packedValue {\n return arraybuffer2packed(arr, existingBin, existingBinLen, bigEndianMod);\n };\n case \"UINT8ARRAY\":\n try {\n new Uint8Array(0);\n } catch {\n throw new Error(uint8array_error);\n }\n /**\n * @param arr Uint8Array to be converted to binary representation.\n * @param existingPacked A packed int array of bytes to append the results to.\n * @param existingPackedLen The number of bits in `existingPacked` array.\n * @returns Hashmap of the packed values.\n */\n return function (arr: Uint8Array, existingBin?: number[], existingBinLen?: number): packedValue {\n return uint8array2packed(arr, existingBin, existingBinLen, bigEndianMod);\n };\n default:\n throw new Error(\"format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\");\n }\n}\n\n/**\n * Convert an array of words to a hexadecimal string.\n *\n * toString() won't work here because it removes preceding zeros (e.g. 0x00000001.toString === \"1\" rather than\n * \"00000001\" and 0.toString(16) === \"0\" rather than \"00\").\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param formatOpts Hashmap containing validated output formatting options.\n * @returns Hexadecimal representation of `packed`.\n */\nexport function packed2hex(\n packed: number[],\n outputLength: number,\n bigEndianMod: -1 | 1,\n formatOpts: { outputUpper: boolean; b64Pad: string },\n): string {\n const hex_tab = \"0123456789abcdef\";\n let str = \"\",\n i,\n srcByte;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n /* The below is more than a byte but it gets taken care of later */\n srcByte = packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)));\n str += hex_tab.charAt((srcByte >>> 4) & 0xf) + hex_tab.charAt(srcByte & 0xf);\n }\n\n return formatOpts[\"outputUpper\"] ? str.toUpperCase() : str;\n}\n\n/**\n * Convert an array of words to a base-64 string.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param formatOpts Hashmap containing validated output formatting options.\n * @returns Base64-encoded representation of `packed`.\n */\nexport function packed2b64(\n packed: number[],\n outputLength: number,\n bigEndianMod: -1 | 1,\n formatOpts: { outputUpper: boolean; b64Pad: string },\n): string {\n let str = \"\",\n i,\n j,\n triplet,\n int1,\n int2;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 3) {\n int1 = i + 1 < length ? packed[(i + 1) >>> 2] : 0;\n int2 = i + 2 < length ? packed[(i + 2) >>> 2] : 0;\n triplet =\n (((packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff) << 16) |\n (((int1 >>> (8 * (shiftModifier + bigEndianMod * ((i + 1) % 4)))) & 0xff) << 8) |\n ((int2 >>> (8 * (shiftModifier + bigEndianMod * ((i + 2) % 4)))) & 0xff);\n for (j = 0; j < 4; j += 1) {\n if (i * 8 + j * 6 <= outputLength) {\n str += b64Tab.charAt((triplet >>> (6 * (3 - j))) & 0x3f);\n } else {\n str += formatOpts[\"b64Pad\"];\n }\n }\n }\n return str;\n}\n\n/**\n * Convert an array of words to raw bytes string.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns Raw bytes representation of `packed`.\n */\nexport function packed2bytes(packed: number[], outputLength: number, bigEndianMod: -1 | 1): string {\n let str = \"\",\n i,\n srcByte;\n\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n srcByte = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n str += String.fromCharCode(srcByte);\n }\n\n return str;\n}\n\n/**\n * Convert an array of words to an ArrayBuffer.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns An ArrayBuffer containing bytes from `packed.\n */\nexport function packed2arraybuffer(packed: number[], outputLength: number, bigEndianMod: -1 | 1): ArrayBuffer {\n let i;\n const length = outputLength / 8,\n retVal = new ArrayBuffer(length),\n arrView = new Uint8Array(retVal),\n shiftModifier = bigEndianMod === -1 ? 3 : 0;\n\n for (i = 0; i < length; i += 1) {\n arrView[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n }\n\n return retVal;\n}\n\n/**\n * Convert an array of words to an Uint8Array.\n *\n * @param packed Array of integers to be converted.\n * @param outputLength Length of output in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @returns An Uint8Array containing bytes from `packed.\n */\nexport function packed2uint8array(packed: number[], outputLength: number, bigEndianMod: -1 | 1): Uint8Array {\n let i;\n const length = outputLength / 8,\n shiftModifier = bigEndianMod === -1 ? 3 : 0,\n retVal = new Uint8Array(length);\n\n for (i = 0; i < length; i += 1) {\n retVal[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xff;\n }\n\n return retVal;\n}\n\n/**\n * Function that takes an output format and associated parameters and returns a function that converts packed integers\n * to that format.\n *\n * @param format The desired output formatting.\n * @param outputBinLen Output length in bits.\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param outputOptions Hashmap of output formatting options\n * @returns Function that will convert a packed integer array to desired format.\n */\nexport function getOutputConverter(\n format: \"HEX\" | \"B64\" | \"BYTES\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string },\n): (binarray: number[]) => string;\nexport function getOutputConverter(\n format: \"ARRAYBUFFER\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string },\n): (binarray: number[]) => ArrayBuffer;\nexport function getOutputConverter(\n format: \"UINT8ARRAY\",\n outputBinLen: number,\n bigEndianMod: -1 | 1,\n outputOptions: { outputUpper: boolean; b64Pad: string },\n): (binarray: number[]) => Uint8Array;\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nexport function getOutputConverter(format: any, outputBinLen: any, bigEndianMod: any, outputOptions: any): any {\n switch (format) {\n case \"HEX\":\n return function (binarray: number[]): string {\n return packed2hex(binarray, outputBinLen, bigEndianMod, outputOptions);\n };\n case \"B64\":\n return function (binarray: number[]): string {\n return packed2b64(binarray, outputBinLen, bigEndianMod, outputOptions);\n };\n case \"BYTES\":\n return function (binarray: number[]): string {\n return packed2bytes(binarray, outputBinLen, bigEndianMod);\n };\n case \"ARRAYBUFFER\":\n try {\n /* Need to test ArrayBuffer support */\n new ArrayBuffer(0);\n } catch {\n throw new Error(arraybuffer_error);\n }\n return function (binarray: number[]): ArrayBuffer {\n return packed2arraybuffer(binarray, outputBinLen, bigEndianMod);\n };\n case \"UINT8ARRAY\":\n try {\n /* Need to test Uint8Array support */\n new Uint8Array(0);\n } catch {\n throw new Error(uint8array_error);\n }\n return function (binarray: number[]): Uint8Array {\n return packed2uint8array(binarray, outputBinLen, bigEndianMod);\n };\n default:\n throw new Error(\"format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\");\n }\n}\n","import { getStrConverter, getOutputConverter } from \"./converters\";\n\nimport {\n FormatType,\n EncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n packedValue,\n GenericInputType,\n} from \"./custom_types\";\n\nexport const TWO_PWR_32 = 4294967296;\n\n/* Constant used in SHA-2 families */\nexport const K_sha2 = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98,\n 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,\n 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8,\n 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,\n 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7,\n 0xc67178f2,\n];\n\n/* Constant used in SHA-2 families */\nexport const H_trunc = [0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4];\n\n/* Constant used in SHA-2 families */\nexport const H_full = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19];\n\nexport const sha_variant_error = \"Chosen SHA variant is not supported\";\nexport const mac_rounds_error = \"Cannot set numRounds with MAC\";\n\n/**\n * Concatenates 2 packed arrays. Clobbers array `a`.\n *\n * @param a First array to concatenate.\n * @param b Second array to concatenate.\n * @returns The concatentation of `a` + `b`.\n */\nexport function packedLEConcat(a: packedValue, b: packedValue): packedValue {\n let i, arrOffset;\n const aByteLen = a[\"binLen\"] >>> 3,\n bByteLen = b[\"binLen\"] >>> 3,\n leftShiftAmount = aByteLen << 3,\n rightShiftAmount = (4 - aByteLen) << 3;\n\n /* If a only contains \"full\" integers, we can just use concat which is so much easier */\n if (aByteLen % 4 !== 0) {\n for (i = 0; i < bByteLen; i += 4) {\n arrOffset = (aByteLen + i) >>> 2;\n /* Left shift chops off bits over 32-bits */\n a[\"value\"][arrOffset] |= b[\"value\"][i >>> 2] << leftShiftAmount;\n a[\"value\"].push(0);\n a[\"value\"][arrOffset + 1] |= b[\"value\"][i >>> 2] >>> rightShiftAmount;\n }\n\n /* Since an unconditional push was performed above, we may have pushed an extra value if it could have been\n encoded without it. Check if popping an int off (reducing total length by 4 bytes) is still bigger than the\n needed size. */\n if ((a[\"value\"].length << 2) - 4 >= bByteLen + aByteLen) {\n a[\"value\"].pop();\n }\n\n return { value: a[\"value\"], binLen: a[\"binLen\"] + b[\"binLen\"] };\n } else {\n return { value: a[\"value\"].concat(b[\"value\"]), binLen: a[\"binLen\"] + b[\"binLen\"] };\n }\n}\n\n/**\n * Validate hash list containing output formatting options, ensuring presence of every option or adding the default\n * value.\n *\n * @param options Hashmap of output formatting options from user.\n * @returns Validated hashmap containing output formatting options.\n */\nexport function getOutputOpts(options?: {\n outputUpper?: boolean;\n b64Pad?: string;\n shakeLen?: number;\n outputLen?: number;\n}): { outputUpper: boolean; b64Pad: string; outputLen: number } {\n const retVal = { outputUpper: false, b64Pad: \"=\", outputLen: -1 },\n outputOptions: { outputUpper?: boolean; b64Pad?: string; shakeLen?: number; outputLen?: number } = options || {},\n lenErrstr = \"Output length must be a multiple of 8\";\n\n retVal[\"outputUpper\"] = outputOptions[\"outputUpper\"] || false;\n\n if (outputOptions[\"b64Pad\"]) {\n retVal[\"b64Pad\"] = outputOptions[\"b64Pad\"];\n }\n\n if (outputOptions[\"outputLen\"]) {\n if (outputOptions[\"outputLen\"] % 8 !== 0) {\n throw new Error(lenErrstr);\n }\n retVal[\"outputLen\"] = outputOptions[\"outputLen\"];\n } else if (outputOptions[\"shakeLen\"]) {\n if (outputOptions[\"shakeLen\"] % 8 !== 0) {\n throw new Error(lenErrstr);\n }\n retVal[\"outputLen\"] = outputOptions[\"shakeLen\"];\n }\n\n if (\"boolean\" !== typeof retVal[\"outputUpper\"]) {\n throw new Error(\"Invalid outputUpper formatting option\");\n }\n\n if (\"string\" !== typeof retVal[\"b64Pad\"]) {\n throw new Error(\"Invalid b64Pad formatting option\");\n }\n\n return retVal;\n}\n\n/**\n * Parses an external constructor object and returns a packed number, if possible.\n *\n * @param key The human-friendly key name to prefix any errors with\n * @param value The input value object to parse\n * @param bigEndianMod Modifier for whether hash function is big or small endian.\n * @param fallback Fallback value if `value` is undefined. If not present and `value` is undefined, an Error is thrown\n */\nexport function parseInputOption(\n key: string,\n value: GenericInputType | undefined,\n bigEndianMod: -1 | 1,\n fallback?: packedValue,\n): packedValue {\n const errStr = key + \" must include a value and format\";\n if (!value) {\n if (!fallback) {\n throw new Error(errStr);\n }\n return fallback;\n }\n\n if (typeof value[\"value\"] === \"undefined\" || !value[\"format\"]) {\n throw new Error(errStr);\n }\n\n return getStrConverter(\n value[\"format\"],\n // @ts-ignore - the value of encoding gets value checked by getStrConverter\n value[\"encoding\"] || \"UTF8\",\n bigEndianMod,\n )(value[\"value\"]);\n}\n\nexport abstract class jsSHABase {\n /**\n * @param variant The desired SHA variant.\n * @param inputFormat The input format to be used in future `update` calls.\n * @param options Hashmap of extra input options.\n */\n /* Needed inputs */\n protected readonly shaVariant: VariantT;\n protected readonly inputFormat: FormatType;\n protected readonly utfType: EncodingType;\n protected readonly numRounds: number;\n\n /* State */\n protected abstract intermediateState: StateT;\n protected keyWithIPad: number[];\n protected keyWithOPad: number[];\n protected remainder: number[];\n protected remainderLen: number;\n protected updateCalled: boolean;\n protected processedLen: number;\n protected macKeySet: boolean;\n\n /* Variant specifics */\n protected abstract readonly variantBlockSize: number;\n protected abstract readonly bigEndianMod: -1 | 1;\n protected abstract readonly outputBinLen: number;\n protected abstract readonly isVariableLen: boolean;\n protected abstract readonly HMACSupported: boolean;\n\n /* Functions */\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n protected abstract readonly converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n protected abstract readonly roundFunc: (block: number[], H: StateT) => StateT;\n protected abstract readonly finalizeFunc: (\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: StateT,\n outputLen: number,\n ) => number[];\n protected abstract readonly stateCloneFunc: (state: StateT) => StateT;\n protected abstract readonly newStateFunc: (variant: VariantT) => StateT;\n protected abstract readonly getMAC: ((options: { outputLen: number }) => number[]) | null;\n\n protected constructor(variant: VariantT, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n protected constructor(variant: VariantT, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected constructor(variant: any, inputFormat: any, options?: any) {\n const inputOptions = options || {};\n this.inputFormat = inputFormat;\n\n this.utfType = inputOptions[\"encoding\"] || \"UTF8\";\n this.numRounds = inputOptions[\"numRounds\"] || 1;\n\n // @ts-ignore - The spec actually says ToString is called on the first parseInt argument so it's OK to use it here\n // to check if an arugment is an integer. This cheat would break if it's used to get the value of the argument.\n if (isNaN(this.numRounds) || this.numRounds !== parseInt(this.numRounds, 10) || 1 > this.numRounds) {\n throw new Error(\"numRounds must a integer >= 1\");\n }\n\n this.shaVariant = variant;\n this.remainder = [];\n this.remainderLen = 0;\n this.updateCalled = false;\n this.processedLen = 0;\n this.macKeySet = false;\n this.keyWithIPad = [];\n this.keyWithOPad = [];\n }\n\n /**\n * Hashes as many blocks as possible. Stores the rest for either a future update or getHash call.\n *\n * @param srcString The input to be hashed.\n * @returns A reference to the object.\n */\n update(srcString: string | ArrayBuffer | Uint8Array): this {\n let i,\n updateProcessedLen = 0;\n const variantBlockIntInc = this.variantBlockSize >>> 5,\n convertRet = this.converterFunc(srcString, this.remainder, this.remainderLen),\n chunkBinLen = convertRet[\"binLen\"],\n chunk = convertRet[\"value\"],\n chunkIntLen = chunkBinLen >>> 5;\n\n for (i = 0; i < chunkIntLen; i += variantBlockIntInc) {\n if (updateProcessedLen + this.variantBlockSize <= chunkBinLen) {\n this.intermediateState = this.roundFunc(chunk.slice(i, i + variantBlockIntInc), this.intermediateState);\n updateProcessedLen += this.variantBlockSize;\n }\n }\n this.processedLen += updateProcessedLen;\n this.remainder = chunk.slice(updateProcessedLen >>> 5);\n this.remainderLen = chunkBinLen % this.variantBlockSize;\n this.updateCalled = true;\n\n return this;\n }\n\n /**\n * Returns the desired SHA hash of the input fed in via `update` calls.\n *\n * @param format The desired output formatting\n * @param options Hashmap of output formatting options. `outputLen` must be specified for variable length hashes.\n * `outputLen` replaces the now deprecated `shakeLen` key.\n * @returns The hash in the format specified.\n */\n getHash(format: \"HEX\", options?: { outputUpper?: boolean; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"B64\", options?: { b64Pad?: string; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"BYTES\", options?: { outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"UINT8ARRAY\", options?: { outputLen?: number; shakeLen?: number }): Uint8Array;\n getHash(format: \"ARRAYBUFFER\", options?: { outputLen?: number; shakeLen?: number }): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHash(format: any, options?: any): any {\n let i,\n finalizedState,\n outputBinLen = this.outputBinLen;\n\n const outputOptions = getOutputOpts(options);\n\n if (this.isVariableLen) {\n if (outputOptions[\"outputLen\"] === -1) {\n throw new Error(\"Output length must be specified in options\");\n }\n outputBinLen = outputOptions[\"outputLen\"];\n }\n\n const formatFunc = getOutputConverter(format, outputBinLen, this.bigEndianMod, outputOptions);\n if (this.macKeySet && this.getMAC) {\n return formatFunc(this.getMAC(outputOptions));\n }\n\n finalizedState = this.finalizeFunc(\n this.remainder.slice(),\n this.remainderLen,\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n outputBinLen,\n );\n for (i = 1; i < this.numRounds; i += 1) {\n /* Need to mask out bits that should be zero due to output not being a multiple of 32 */\n if (this.isVariableLen && outputBinLen % 32 !== 0) {\n finalizedState[finalizedState.length - 1] &= 0x00ffffff >>> (24 - (outputBinLen % 32));\n }\n finalizedState = this.finalizeFunc(\n finalizedState,\n outputBinLen,\n 0,\n this.newStateFunc(this.shaVariant),\n outputBinLen,\n );\n }\n\n return formatFunc(finalizedState);\n }\n\n /**\n * Sets the HMAC key for an eventual `getHMAC` call. Must be called immediately after jsSHA object instantiation.\n *\n * @param key The key used to calculate the HMAC\n * @param inputFormat The format of key.\n * @param options Hashmap of extra input options.\n */\n setHMACKey(key: string, inputFormat: \"TEXT\", options?: { encoding?: EncodingType }): void;\n setHMACKey(key: string, inputFormat: \"B64\" | \"HEX\" | \"BYTES\"): void;\n setHMACKey(key: ArrayBuffer, inputFormat: \"ARRAYBUFFER\"): void;\n setHMACKey(key: Uint8Array, inputFormat: \"UINT8ARRAY\"): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setHMACKey(key: any, inputFormat: any, options?: any): void {\n if (!this.HMACSupported) {\n throw new Error(\"Variant does not support HMAC\");\n }\n\n if (this.updateCalled) {\n throw new Error(\"Cannot set MAC key after calling update\");\n }\n\n const keyOptions = options || {},\n keyConverterFunc = getStrConverter(inputFormat, keyOptions[\"encoding\"] || \"UTF8\", this.bigEndianMod);\n\n this._setHMACKey(keyConverterFunc(key));\n }\n\n /**\n * Internal function that sets the MAC key.\n *\n * @param key The packed MAC key to use\n */\n protected _setHMACKey(key: packedValue): void {\n const blockByteSize = this.variantBlockSize >>> 3,\n lastArrayIndex = blockByteSize / 4 - 1;\n let i;\n if (this.numRounds !== 1) {\n throw new Error(mac_rounds_error);\n }\n\n if (this.macKeySet) {\n throw new Error(\"MAC key already set\");\n }\n\n /* Figure out what to do with the key based on its size relative to\n * the hash's block size */\n if (blockByteSize < key[\"binLen\"] / 8) {\n key[\"value\"] = this.finalizeFunc(\n key[\"value\"],\n key[\"binLen\"],\n 0,\n this.newStateFunc(this.shaVariant),\n this.outputBinLen,\n );\n }\n while (key[\"value\"].length <= lastArrayIndex) {\n key[\"value\"].push(0);\n }\n /* Create ipad and opad */\n for (i = 0; i <= lastArrayIndex; i += 1) {\n this.keyWithIPad[i] = key[\"value\"][i] ^ 0x36363636;\n this.keyWithOPad[i] = key[\"value\"][i] ^ 0x5c5c5c5c;\n }\n\n this.intermediateState = this.roundFunc(this.keyWithIPad, this.intermediateState);\n this.processedLen = this.variantBlockSize;\n\n this.macKeySet = true;\n }\n\n /**\n * Returns the the HMAC in the specified format using the key given by a previous `setHMACKey` call.\n *\n * @param format The desired output formatting.\n * @param options Hashmap of extra outputs options.\n * @returns The HMAC in the format specified.\n */\n getHMAC(format: \"HEX\", options?: { outputUpper?: boolean }): string;\n getHMAC(format: \"B64\", options?: { b64Pad?: string }): string;\n getHMAC(format: \"BYTES\"): string;\n getHMAC(format: \"UINT8ARRAY\"): Uint8Array;\n getHMAC(format: \"ARRAYBUFFER\"): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHMAC(format: any, options?: any): any {\n const outputOptions = getOutputOpts(options),\n formatFunc = getOutputConverter(format, this.outputBinLen, this.bigEndianMod, outputOptions);\n\n return formatFunc(this._getHMAC());\n }\n\n /**\n * Internal function that returns the \"raw\" HMAC\n */\n protected _getHMAC(): number[] {\n let finalizedState;\n\n if (!this.macKeySet) {\n throw new Error(\"Cannot call getHMAC without first setting MAC key\");\n }\n\n const firstHash = this.finalizeFunc(\n this.remainder.slice(),\n this.remainderLen,\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n this.outputBinLen,\n );\n finalizedState = this.roundFunc(this.keyWithOPad, this.newStateFunc(this.shaVariant));\n finalizedState = this.finalizeFunc(\n firstHash,\n this.outputBinLen,\n this.variantBlockSize,\n finalizedState,\n this.outputBinLen,\n );\n\n return finalizedState;\n }\n}\n","/*\n * Note 1: All the functions in this file guarantee only that the bottom 32-bits of the return value are correct.\n * JavaScript is flakey when it comes to bit operations and a '1' in the highest order bit of a 32-bit number causes\n * it to be interpreted as a negative number per two's complement.\n *\n * Note 2: Per the ECMAScript spec, all JavaScript operations mask the shift amount by 0x1F. This results in weird\n * cases like 1 << 32 == 1 and 1 << 33 === 1 << 1 === 2\n */\n\n/**\n * The 32-bit implementation of circular rotate left.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted left circularly by `n` bits\n */\nexport function rotl_32(x: number, n: number): number {\n return (x << n) | (x >>> (32 - n));\n}\n\n/**\n * The 32-bit implementation of circular rotate right.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right circularly by `n` bits\n */\nfunction rotr_32(x: number, n: number): number {\n return (x >>> n) | (x << (32 - n));\n}\n\n/**\n * The 32-bit implementation of shift right.\n *\n * @param x The 32-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted by `n` bits.\n */\nfunction shr_32(x: number, n: number): number {\n return x >>> n;\n}\n\n/**\n * The 32-bit implementation of the NIST specified Parity function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function parity_32(x: number, y: number, z: number): number {\n return x ^ y ^ z;\n}\n\n/**\n * The 32-bit implementation of the NIST specified Ch function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function ch_32(x: number, y: number, z: number): number {\n return (x & y) ^ (~x & z);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Maj function.\n *\n * @param x The first 32-bit integer argument.\n * @param y The second 32-bit integer argument.\n * @param z The third 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function maj_32(x: number, y: number, z: number): number {\n return (x & y) ^ (x & z) ^ (y & z);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Sigma0 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma0_32(x: number): number {\n return rotr_32(x, 2) ^ rotr_32(x, 13) ^ rotr_32(x, 22);\n}\n\n/**\n * Add two 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @returns The sum of `a` + `b`.\n */\nexport function safeAdd_32_2(a: number, b: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * Add four 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @param c The third 32-bit integer argument to be added.\n * @param d The fourth 32-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d`.\n */\nexport function safeAdd_32_4(a: number, b: number, c: number, d: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff) + (c & 0xffff) + (d & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * Add five 32-bit integers.\n *\n * This uses 16-bit operations internally to work around sign problems due to JavaScript's lack of uint32 support.\n *\n * @param a The first 32-bit integer argument to be added.\n * @param b The second 32-bit integer argument to be added.\n * @param c The third 32-bit integer argument to be added.\n * @param d The fourth 32-bit integer argument to be added.\n * @param e The fifth 32-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d` + `e`.\n */\nexport function safeAdd_32_5(a: number, b: number, c: number, d: number, e: number): number {\n const lsw = (a & 0xffff) + (b & 0xffff) + (c & 0xffff) + (d & 0xffff) + (e & 0xffff),\n msw = (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (e >>> 16) + (lsw >>> 16);\n\n return ((msw & 0xffff) << 16) | (lsw & 0xffff);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Gamma1 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma1_32(x: number): number {\n return rotr_32(x, 17) ^ rotr_32(x, 19) ^ shr_32(x, 10);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Gamma0 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma0_32(x: number): number {\n return rotr_32(x, 7) ^ rotr_32(x, 18) ^ shr_32(x, 3);\n}\n\n/**\n * The 32-bit implementation of the NIST specified Sigma1 function.\n *\n * @param x The 32-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma1_32(x: number): number {\n return rotr_32(x, 6) ^ rotr_32(x, 11) ^ rotr_32(x, 25);\n}\n","import { jsSHABase, TWO_PWR_32, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport { ch_32, parity_32, maj_32, rotl_32, safeAdd_32_2, safeAdd_32_5 } from \"./primitives_32\";\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param _variant: Unused\n * @returns The initial state values.\n */\nfunction getNewState(_variant: \"SHA-1\"): number[] {\n return [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n}\n\n/**\n * Performs a round of SHA-1 hashing over a 512-byte block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA1(block: number[], H: number[]): number[] {\n let a, b, c, d, e, T, t;\n const W: number[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n\n for (t = 0; t < 80; t += 1) {\n if (t < 16) {\n W[t] = block[t];\n } else {\n W[t] = rotl_32(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n if (t < 20) {\n T = safeAdd_32_5(rotl_32(a, 5), ch_32(b, c, d), e, 0x5a827999, W[t]);\n } else if (t < 40) {\n T = safeAdd_32_5(rotl_32(a, 5), parity_32(b, c, d), e, 0x6ed9eba1, W[t]);\n } else if (t < 60) {\n T = safeAdd_32_5(rotl_32(a, 5), maj_32(b, c, d), e, 0x8f1bbcdc, W[t]);\n } else {\n T = safeAdd_32_5(rotl_32(a, 5), parity_32(b, c, d), e, 0xca62c1d6, W[t]);\n }\n\n e = d;\n d = c;\n c = rotl_32(b, 30);\n b = a;\n a = T;\n }\n\n H[0] = safeAdd_32_2(a, H[0]);\n H[1] = safeAdd_32_2(b, H[1]);\n H[2] = safeAdd_32_2(c, H[2]);\n H[3] = safeAdd_32_2(d, H[3]);\n H[4] = safeAdd_32_2(e, H[4]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-1 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @returns The array of integers representing the SHA-1 hash of message.\n */\nfunction finalizeSHA1(remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]): number[] {\n let i;\n\n /* The 65 addition is a hack but it works. The correct number is\n\t\tactually 72 (64 + 8) but the below math fails if\n\t\tremainderBinLen + 72 % 512 = 0. Since remainderBinLen % 8 = 0,\n\t\t\"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 65) >>> 9) << 4) + 15,\n totalLen = remainderBinLen + processedBinLen;\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n\n /* Append length of binary string in the position such that the new\n * length is a multiple of 512. Logic does not work for even multiples\n * of 512 but there can never be even multiples of 512. JavaScript\n * numbers are limited to 2^53 so it's \"safe\" to treat the totalLen as\n * a 64-bit integer. */\n remainder[offset] = totalLen & 0xffffffff;\n\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += 16) {\n H = roundSHA1(remainder.slice(i, i + 16), H);\n }\n\n return H;\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: number[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: number[]) => number[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]) => number[];\n stateCloneFunc: (state: number[]) => number[];\n newStateFunc: (variant: \"SHA-1\") => number[];\n getMAC: () => number[];\n\n constructor(variant: \"SHA-1\", inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: \"SHA-1\", inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (\"SHA-1\" !== variant) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA1;\n this.stateCloneFunc = function (state: number[]): number[] {\n return state.slice();\n };\n this.newStateFunc = getNewState;\n this.finalizeFunc = finalizeSHA1;\n\n this.intermediateState = getNewState(variant);\n this.variantBlockSize = 512;\n this.outputBinLen = 160;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","import { jsSHABase, TWO_PWR_32, H_full, H_trunc, K_sha2, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport {\n ch_32,\n gamma0_32,\n gamma1_32,\n maj_32,\n safeAdd_32_2,\n safeAdd_32_4,\n safeAdd_32_5,\n sigma0_32,\n sigma1_32,\n} from \"./primitives_32\";\n\ntype VariantType = \"SHA-224\" | \"SHA-256\";\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param variant: The SHA-256 family variant.\n * @returns The initial state values.\n */\nfunction getNewState256(variant: VariantType): number[] {\n let retVal;\n\n if (\"SHA-224\" == variant) {\n retVal = H_trunc.slice();\n } else {\n /* \"SHA-256\" */\n retVal = H_full.slice();\n }\n return retVal;\n}\n\n/**\n * Performs a round of SHA-256 hashing over a block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA256(block: number[], H: number[]): number[] {\n let a, b, c, d, e, f, g, h, T1, T2, t;\n\n const W: number[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n f = H[5];\n g = H[6];\n h = H[7];\n\n for (t = 0; t < 64; t += 1) {\n if (t < 16) {\n W[t] = block[t];\n } else {\n W[t] = safeAdd_32_4(gamma1_32(W[t - 2]), W[t - 7], gamma0_32(W[t - 15]), W[t - 16]);\n }\n T1 = safeAdd_32_5(h, sigma1_32(e), ch_32(e, f, g), K_sha2[t], W[t]);\n T2 = safeAdd_32_2(sigma0_32(a), maj_32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = safeAdd_32_2(d, T1);\n d = c;\n c = b;\n b = a;\n a = safeAdd_32_2(T1, T2);\n }\n\n H[0] = safeAdd_32_2(a, H[0]);\n H[1] = safeAdd_32_2(b, H[1]);\n H[2] = safeAdd_32_2(c, H[2]);\n H[3] = safeAdd_32_2(d, H[3]);\n H[4] = safeAdd_32_2(e, H[4]);\n H[5] = safeAdd_32_2(f, H[5]);\n H[6] = safeAdd_32_2(g, H[6]);\n H[7] = safeAdd_32_2(h, H[7]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-256 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @param variant The desired SHA-256 variant.\n * @returns The array of integers representing the SHA-2 hash of message.\n */\nfunction finalizeSHA256(\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: number[],\n variant: VariantType\n): number[] {\n let i, retVal;\n\n /* The 65 addition is a hack but it works. The correct number is\n actually 72 (64 + 8) but the below math fails if\n remainderBinLen + 72 % 512 = 0. Since remainderBinLen % 8 = 0,\n \"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 65) >>> 9) << 4) + 15,\n binaryStringInc = 16,\n totalLen = remainderBinLen + processedBinLen;\n\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n /* Append length of binary string in the position such that the new\n * length is correct. JavaScript numbers are limited to 2^53 so it's\n * \"safe\" to treat the totalLen as a 64-bit integer. */\n\n remainder[offset] = totalLen & 0xffffffff;\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += binaryStringInc) {\n H = roundSHA256(remainder.slice(i, i + binaryStringInc), H);\n }\n\n if (\"SHA-224\" === variant) {\n retVal = [H[0], H[1], H[2], H[3], H[4], H[5], H[6]];\n } else {\n /* \"SHA-256 */\n retVal = H;\n }\n\n return retVal;\n}\nexport default class jsSHA extends jsSHABase {\n intermediateState: number[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: number[]) => number[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: number[]) => number[];\n stateCloneFunc: (state: number[]) => number[];\n newStateFunc: (variant: VariantType) => number[];\n getMAC: () => number[];\n\n constructor(variant: VariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: VariantType, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (!(\"SHA-224\" === variant || \"SHA-256\" === variant)) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.HMACSupported = true;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA256;\n this.stateCloneFunc = function (state): number[] {\n return state.slice();\n };\n\n this.newStateFunc = getNewState256;\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, H): number[] {\n return finalizeSHA256(remainder, remainderBinLen, processedBinLen, H, variant);\n };\n\n this.intermediateState = getNewState256(variant);\n this.variantBlockSize = 512;\n this.outputBinLen = \"SHA-224\" === variant ? 224 : 256;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","/*\n * Note 1: All the functions in this file guarantee only that the bottom 32-bits of the returned Int_64 are correct.\n * JavaScript is flakey when it comes to bit operations and a '1' in the highest order bit of a 32-bit number causes\n * it to be interpreted as a negative number per two's complement.\n *\n * Note 2: Per the ECMAScript spec, all JavaScript operations mask the shift amount by 0x1F. This results in weird\n * cases like 1 << 32 == 1 and 1 << 33 === 1 << 1 === 2\n */\n\n/**\n * Int_64 is a object for 2 32-bit numbers emulating a 64-bit number.\n */\nexport class Int_64 {\n /**\n * @param msint_32 The most significant 32-bits of a 64-bit number.\n * @param lsint_32 The least significant 32-bits of a 64-bit number.\n */\n readonly highOrder: number;\n readonly lowOrder: number;\n constructor(msint_32: number, lsint_32: number) {\n this.highOrder = msint_32;\n this.lowOrder = lsint_32;\n }\n}\n\n/**\n * The 64-bit implementation of circular rotate left.\n *\n * This does not work for n >= 64 or n == 32 but those are never done.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted left circularly by `n` bits.\n */\nexport function rotl_64(x: Int_64, n: number): Int_64 {\n let tmp;\n if (n > 32) {\n tmp = 64 - n;\n return new Int_64((x.lowOrder << n) | (x.highOrder >>> tmp), (x.highOrder << n) | (x.lowOrder >>> tmp));\n } else if (0 !== n) {\n tmp = 32 - n;\n return new Int_64((x.highOrder << n) | (x.lowOrder >>> tmp), (x.lowOrder << n) | (x.highOrder >>> tmp));\n } else {\n return x;\n }\n}\n\n/**\n * The 64-bit implementation of circular rotate right.\n *\n * This does not work for n >= 64, n == 32, or n == 0 but those are never done.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right circularly by `n` bits.\n */\nfunction rotr_64(x: Int_64, n: number): Int_64 {\n let tmp;\n if (n < 32) {\n tmp = 32 - n;\n return new Int_64((x.highOrder >>> n) | (x.lowOrder << tmp), (x.lowOrder >>> n) | (x.highOrder << tmp));\n } else {\n tmp = 64 - n;\n return new Int_64((x.lowOrder >>> n) | (x.highOrder << tmp), (x.highOrder >>> n) | (x.lowOrder << tmp));\n }\n}\n\n/**\n * The 64-bit implementation of shift right.\n *\n * This does not work for n >= 32 but is only called for n < 32.\n *\n * @param x The 64-bit integer argument.\n * @param n The number of bits to shift.\n * @returns `x` shifted right by `n` bits\n */\nfunction shr_64(x: Int_64, n: number): Int_64 {\n return new Int_64(x.highOrder >>> n, (x.lowOrder >>> n) | (x.highOrder << (32 - n)));\n}\n\n/**\n * The 64-bit implementation of the NIST specified Ch function.\n *\n * @param x The first 64-bit integer argument.\n * @param y The second 64-bit integer argument.\n * @param z The third 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function ch_64(x: Int_64, y: Int_64, z: Int_64): Int_64 {\n return new Int_64(\n (x.highOrder & y.highOrder) ^ (~x.highOrder & z.highOrder),\n (x.lowOrder & y.lowOrder) ^ (~x.lowOrder & z.lowOrder)\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Maj function.\n *\n * @param x The first 64-bit integer argument.\n * @param y The second 64-bit integer argument.\n * @param z The third 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function maj_64(x: Int_64, y: Int_64, z: Int_64): Int_64 {\n return new Int_64(\n (x.highOrder & y.highOrder) ^ (x.highOrder & z.highOrder) ^ (y.highOrder & z.highOrder),\n (x.lowOrder & y.lowOrder) ^ (x.lowOrder & z.lowOrder) ^ (y.lowOrder & z.lowOrder)\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Sigma0 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma0_64(x: Int_64): Int_64 {\n const rotr28 = rotr_64(x, 28),\n rotr34 = rotr_64(x, 34),\n rotr39 = rotr_64(x, 39);\n\n return new Int_64(\n rotr28.highOrder ^ rotr34.highOrder ^ rotr39.highOrder,\n rotr28.lowOrder ^ rotr34.lowOrder ^ rotr39.lowOrder\n );\n}\n\n/**\n * Add two 64-bit integers.\n *\n * @param x The first 64-bit integer argument to be added.\n * @param y The second 64-bit integer argument to be added.\n * @returns The sum of `x` + `y`.\n */\nexport function safeAdd_64_2(x: Int_64, y: Int_64): Int_64 {\n let lsw, msw;\n\n lsw = (x.lowOrder & 0xffff) + (y.lowOrder & 0xffff);\n msw = (x.lowOrder >>> 16) + (y.lowOrder >>> 16) + (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw = (x.highOrder & 0xffff) + (y.highOrder & 0xffff) + (msw >>> 16);\n msw = (x.highOrder >>> 16) + (y.highOrder >>> 16) + (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * Add four 64-bit integers.\n *\n * @param a The first 64-bit integer argument to be added.\n * @param b The second 64-bit integer argument to be added.\n * @param c The third 64-bit integer argument to be added.\n * @param d The fouth 64-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d`.\n */\nexport function safeAdd_64_4(a: Int_64, b: Int_64, c: Int_64, d: Int_64): Int_64 {\n let lsw, msw;\n\n lsw = (a.lowOrder & 0xffff) + (b.lowOrder & 0xffff) + (c.lowOrder & 0xffff) + (d.lowOrder & 0xffff);\n msw = (a.lowOrder >>> 16) + (b.lowOrder >>> 16) + (c.lowOrder >>> 16) + (d.lowOrder >>> 16) + (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw =\n (a.highOrder & 0xffff) + (b.highOrder & 0xffff) + (c.highOrder & 0xffff) + (d.highOrder & 0xffff) + (msw >>> 16);\n msw = (a.highOrder >>> 16) + (b.highOrder >>> 16) + (c.highOrder >>> 16) + (d.highOrder >>> 16) + (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * Add five 64-bit integers.\n *\n * @param a The first 64-bit integer argument to be added.\n * @param b The second 64-bit integer argument to be added.\n * @param c The third 64-bit integer argument to be added.\n * @param d The fouth 64-bit integer argument to be added.\n * @param e The fifth 64-bit integer argument to be added.\n * @returns The sum of `a` + `b` + `c` + `d` + `e`.\n */\nexport function safeAdd_64_5(a: Int_64, b: Int_64, c: Int_64, d: Int_64, e: Int_64): Int_64 {\n let lsw, msw;\n\n lsw =\n (a.lowOrder & 0xffff) +\n (b.lowOrder & 0xffff) +\n (c.lowOrder & 0xffff) +\n (d.lowOrder & 0xffff) +\n (e.lowOrder & 0xffff);\n msw =\n (a.lowOrder >>> 16) +\n (b.lowOrder >>> 16) +\n (c.lowOrder >>> 16) +\n (d.lowOrder >>> 16) +\n (e.lowOrder >>> 16) +\n (lsw >>> 16);\n const lowOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n lsw =\n (a.highOrder & 0xffff) +\n (b.highOrder & 0xffff) +\n (c.highOrder & 0xffff) +\n (d.highOrder & 0xffff) +\n (e.highOrder & 0xffff) +\n (msw >>> 16);\n msw =\n (a.highOrder >>> 16) +\n (b.highOrder >>> 16) +\n (c.highOrder >>> 16) +\n (d.highOrder >>> 16) +\n (e.highOrder >>> 16) +\n (lsw >>> 16);\n const highOrder = ((msw & 0xffff) << 16) | (lsw & 0xffff);\n\n return new Int_64(highOrder, lowOrder);\n}\n\n/**\n * XORs two given arguments.\n *\n * @param a The first argument to be XORed.\n * @param b The second argument to be XORed.\n * @returns The The XOR `a` and `b`\n */\nexport function xor_64_2(a: Int_64, b: Int_64): Int_64 {\n return new Int_64(a.highOrder ^ b.highOrder, a.lowOrder ^ b.lowOrder);\n}\n\n/**\n * XORs five given arguments.\n *\n * @param a The first argument to be XORed.\n * @param b The second argument to be XORed.\n * @param c The third argument to be XORed.\n * @param d The fourth argument to be XORed.\n * @param e The fifth argument to be XORed.\n * @returns The XOR of `a`, `b`, `c`, `d`, and `e`.\n */\nexport function xor_64_5(a: Int_64, b: Int_64, c: Int_64, d: Int_64, e: Int_64): Int_64 {\n return new Int_64(\n a.highOrder ^ b.highOrder ^ c.highOrder ^ d.highOrder ^ e.highOrder,\n a.lowOrder ^ b.lowOrder ^ c.lowOrder ^ d.lowOrder ^ e.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Gamma1 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma1_64(x: Int_64): Int_64 {\n const rotr19 = rotr_64(x, 19),\n rotr61 = rotr_64(x, 61),\n shr6 = shr_64(x, 6);\n\n return new Int_64(\n rotr19.highOrder ^ rotr61.highOrder ^ shr6.highOrder,\n rotr19.lowOrder ^ rotr61.lowOrder ^ shr6.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Gamma0 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function gamma0_64(x: Int_64): Int_64 {\n const rotr1 = rotr_64(x, 1),\n rotr8 = rotr_64(x, 8),\n shr7 = shr_64(x, 7);\n\n return new Int_64(\n rotr1.highOrder ^ rotr8.highOrder ^ shr7.highOrder,\n rotr1.lowOrder ^ rotr8.lowOrder ^ shr7.lowOrder\n );\n}\n\n/**\n * The 64-bit implementation of the NIST specified Sigma1 function.\n *\n * @param x The 64-bit integer argument.\n * @returns The NIST specified output of the function.\n */\nexport function sigma1_64(x: Int_64): Int_64 {\n const rotr14 = rotr_64(x, 14),\n rotr18 = rotr_64(x, 18),\n rotr41 = rotr_64(x, 41);\n\n return new Int_64(\n rotr14.highOrder ^ rotr18.highOrder ^ rotr41.highOrder,\n rotr14.lowOrder ^ rotr18.lowOrder ^ rotr41.lowOrder\n );\n}\n","import { jsSHABase, TWO_PWR_32, H_trunc, H_full, K_sha2, sha_variant_error, parseInputOption } from \"./common\";\nimport {\n packedValue,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport {\n ch_64,\n gamma0_64,\n gamma1_64,\n Int_64,\n maj_64,\n safeAdd_64_2,\n safeAdd_64_4,\n safeAdd_64_5,\n sigma0_64,\n sigma1_64,\n} from \"./primitives_64\";\n\ntype VariantType = \"SHA-384\" | \"SHA-512\";\n\nconst K_sha512 = [\n new Int_64(K_sha2[0], 0xd728ae22),\n new Int_64(K_sha2[1], 0x23ef65cd),\n new Int_64(K_sha2[2], 0xec4d3b2f),\n new Int_64(K_sha2[3], 0x8189dbbc),\n new Int_64(K_sha2[4], 0xf348b538),\n new Int_64(K_sha2[5], 0xb605d019),\n new Int_64(K_sha2[6], 0xaf194f9b),\n new Int_64(K_sha2[7], 0xda6d8118),\n new Int_64(K_sha2[8], 0xa3030242),\n new Int_64(K_sha2[9], 0x45706fbe),\n new Int_64(K_sha2[10], 0x4ee4b28c),\n new Int_64(K_sha2[11], 0xd5ffb4e2),\n new Int_64(K_sha2[12], 0xf27b896f),\n new Int_64(K_sha2[13], 0x3b1696b1),\n new Int_64(K_sha2[14], 0x25c71235),\n new Int_64(K_sha2[15], 0xcf692694),\n new Int_64(K_sha2[16], 0x9ef14ad2),\n new Int_64(K_sha2[17], 0x384f25e3),\n new Int_64(K_sha2[18], 0x8b8cd5b5),\n new Int_64(K_sha2[19], 0x77ac9c65),\n new Int_64(K_sha2[20], 0x592b0275),\n new Int_64(K_sha2[21], 0x6ea6e483),\n new Int_64(K_sha2[22], 0xbd41fbd4),\n new Int_64(K_sha2[23], 0x831153b5),\n new Int_64(K_sha2[24], 0xee66dfab),\n new Int_64(K_sha2[25], 0x2db43210),\n new Int_64(K_sha2[26], 0x98fb213f),\n new Int_64(K_sha2[27], 0xbeef0ee4),\n new Int_64(K_sha2[28], 0x3da88fc2),\n new Int_64(K_sha2[29], 0x930aa725),\n new Int_64(K_sha2[30], 0xe003826f),\n new Int_64(K_sha2[31], 0x0a0e6e70),\n new Int_64(K_sha2[32], 0x46d22ffc),\n new Int_64(K_sha2[33], 0x5c26c926),\n new Int_64(K_sha2[34], 0x5ac42aed),\n new Int_64(K_sha2[35], 0x9d95b3df),\n new Int_64(K_sha2[36], 0x8baf63de),\n new Int_64(K_sha2[37], 0x3c77b2a8),\n new Int_64(K_sha2[38], 0x47edaee6),\n new Int_64(K_sha2[39], 0x1482353b),\n new Int_64(K_sha2[40], 0x4cf10364),\n new Int_64(K_sha2[41], 0xbc423001),\n new Int_64(K_sha2[42], 0xd0f89791),\n new Int_64(K_sha2[43], 0x0654be30),\n new Int_64(K_sha2[44], 0xd6ef5218),\n new Int_64(K_sha2[45], 0x5565a910),\n new Int_64(K_sha2[46], 0x5771202a),\n new Int_64(K_sha2[47], 0x32bbd1b8),\n new Int_64(K_sha2[48], 0xb8d2d0c8),\n new Int_64(K_sha2[49], 0x5141ab53),\n new Int_64(K_sha2[50], 0xdf8eeb99),\n new Int_64(K_sha2[51], 0xe19b48a8),\n new Int_64(K_sha2[52], 0xc5c95a63),\n new Int_64(K_sha2[53], 0xe3418acb),\n new Int_64(K_sha2[54], 0x7763e373),\n new Int_64(K_sha2[55], 0xd6b2b8a3),\n new Int_64(K_sha2[56], 0x5defb2fc),\n new Int_64(K_sha2[57], 0x43172f60),\n new Int_64(K_sha2[58], 0xa1f0ab72),\n new Int_64(K_sha2[59], 0x1a6439ec),\n new Int_64(K_sha2[60], 0x23631e28),\n new Int_64(K_sha2[61], 0xde82bde9),\n new Int_64(K_sha2[62], 0xb2c67915),\n new Int_64(K_sha2[63], 0xe372532b),\n new Int_64(0xca273ece, 0xea26619c),\n new Int_64(0xd186b8c7, 0x21c0c207),\n new Int_64(0xeada7dd6, 0xcde0eb1e),\n new Int_64(0xf57d4f7f, 0xee6ed178),\n new Int_64(0x06f067aa, 0x72176fba),\n new Int_64(0x0a637dc5, 0xa2c898a6),\n new Int_64(0x113f9804, 0xbef90dae),\n new Int_64(0x1b710b35, 0x131c471b),\n new Int_64(0x28db77f5, 0x23047d84),\n new Int_64(0x32caab7b, 0x40c72493),\n new Int_64(0x3c9ebe0a, 0x15c9bebc),\n new Int_64(0x431d67c4, 0x9c100d4c),\n new Int_64(0x4cc5d4be, 0xcb3e42b6),\n new Int_64(0x597f299c, 0xfc657e2a),\n new Int_64(0x5fcb6fab, 0x3ad6faec),\n new Int_64(0x6c44198c, 0x4a475817),\n];\n\n/**\n * Gets the state values for the specified SHA variant.\n *\n * @param variant: The SHA-512 family variant.\n * @returns The initial state values.\n */\nfunction getNewState512(variant: VariantType): Int_64[] {\n if (\"SHA-384\" === variant) {\n return [\n new Int_64(0xcbbb9d5d, H_trunc[0]),\n new Int_64(0x0629a292a, H_trunc[1]),\n new Int_64(0x9159015a, H_trunc[2]),\n new Int_64(0x0152fecd8, H_trunc[3]),\n new Int_64(0x67332667, H_trunc[4]),\n new Int_64(0x98eb44a87, H_trunc[5]),\n new Int_64(0xdb0c2e0d, H_trunc[6]),\n new Int_64(0x047b5481d, H_trunc[7]),\n ];\n } else {\n /* SHA-512 */\n return [\n new Int_64(H_full[0], 0xf3bcc908),\n new Int_64(H_full[1], 0x84caa73b),\n new Int_64(H_full[2], 0xfe94f82b),\n new Int_64(H_full[3], 0x5f1d36f1),\n new Int_64(H_full[4], 0xade682d1),\n new Int_64(H_full[5], 0x2b3e6c1f),\n new Int_64(H_full[6], 0xfb41bd6b),\n new Int_64(H_full[7], 0x137e2179),\n ];\n }\n}\n\n/**\n * Performs a round of SHA-512 hashing over a block. This clobbers `H`.\n *\n * @param block The binary array representation of the block to hash.\n * @param H The intermediate H values from a previous round.\n * @returns The resulting H values.\n */\nfunction roundSHA512(block: number[], H: Int_64[]): Int_64[] {\n let a, b, c, d, e, f, g, h, T1, T2, t, offset;\n\n const W: Int_64[] = [];\n\n a = H[0];\n b = H[1];\n c = H[2];\n d = H[3];\n e = H[4];\n f = H[5];\n g = H[6];\n h = H[7];\n\n for (t = 0; t < 80; t += 1) {\n if (t < 16) {\n offset = t * 2;\n W[t] = new Int_64(block[offset], block[offset + 1]);\n } else {\n W[t] = safeAdd_64_4(gamma1_64(W[t - 2]), W[t - 7], gamma0_64(W[t - 15]), W[t - 16]);\n }\n T1 = safeAdd_64_5(h, sigma1_64(e), ch_64(e, f, g), K_sha512[t], W[t]);\n T2 = safeAdd_64_2(sigma0_64(a), maj_64(a, b, c));\n h = g;\n g = f;\n f = e;\n e = safeAdd_64_2(d, T1);\n d = c;\n c = b;\n b = a;\n a = safeAdd_64_2(T1, T2);\n }\n\n H[0] = safeAdd_64_2(a, H[0]);\n H[1] = safeAdd_64_2(b, H[1]);\n H[2] = safeAdd_64_2(c, H[2]);\n H[3] = safeAdd_64_2(d, H[3]);\n H[4] = safeAdd_64_2(e, H[4]);\n H[5] = safeAdd_64_2(f, H[5]);\n H[6] = safeAdd_64_2(g, H[6]);\n H[7] = safeAdd_64_2(h, H[7]);\n\n return H;\n}\n\n/**\n * Finalizes the SHA-512 hash. This clobbers `remainder` and `H`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param processedBinLen The number of bits already processed.\n * @param H The intermediate H values from a previous round.\n * @param variant The desired SHA-512 variant.\n * @returns The array of integers representing the SHA-512 hash of message.\n */\nfunction finalizeSHA512(\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: Int_64[],\n variant: VariantType,\n): number[] {\n let i, retVal;\n\n /* The 129 addition is a hack but it works. The correct number is\n actually 136 (128 + 8) but the below math fails if\n remainderBinLen + 136 % 1024 = 0. Since remainderBinLen % 8 = 0,\n \"shorting\" the addition is OK. */\n const offset = (((remainderBinLen + 129) >>> 10) << 5) + 31,\n binaryStringInc = 32,\n totalLen = remainderBinLen + processedBinLen;\n\n while (remainder.length <= offset) {\n remainder.push(0);\n }\n /* Append '1' at the end of the binary string */\n remainder[remainderBinLen >>> 5] |= 0x80 << (24 - (remainderBinLen % 32));\n /* Append length of binary string in the position such that the new\n * length is correct. JavaScript numbers are limited to 2^53 so it's\n * \"safe\" to treat the totalLen as a 64-bit integer. */\n\n remainder[offset] = totalLen & 0xffffffff;\n /* Bitwise operators treat the operand as a 32-bit number so need to\n * use hacky division and round to get access to upper 32-ish bits */\n remainder[offset - 1] = (totalLen / TWO_PWR_32) | 0;\n\n /* This will always be at least 1 full chunk */\n for (i = 0; i < remainder.length; i += binaryStringInc) {\n H = roundSHA512(remainder.slice(i, i + binaryStringInc), H);\n }\n\n if (\"SHA-384\" === variant) {\n retVal = [\n H[0].highOrder,\n H[0].lowOrder,\n H[1].highOrder,\n H[1].lowOrder,\n H[2].highOrder,\n H[2].lowOrder,\n H[3].highOrder,\n H[3].lowOrder,\n H[4].highOrder,\n H[4].lowOrder,\n H[5].highOrder,\n H[5].lowOrder,\n ];\n } else {\n /* SHA-512 */\n retVal = [\n H[0].highOrder,\n H[0].lowOrder,\n H[1].highOrder,\n H[1].lowOrder,\n H[2].highOrder,\n H[2].lowOrder,\n H[3].highOrder,\n H[3].lowOrder,\n H[4].highOrder,\n H[4].lowOrder,\n H[5].highOrder,\n H[5].lowOrder,\n H[6].highOrder,\n H[6].lowOrder,\n H[7].highOrder,\n H[7].lowOrder,\n ];\n }\n return retVal;\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: Int_64[];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: Int_64[]) => Int_64[];\n finalizeFunc: (remainder: number[], remainderBinLen: number, processedBinLen: number, H: Int_64[]) => number[];\n stateCloneFunc: (state: Int_64[]) => Int_64[];\n newStateFunc: (variant: VariantType) => Int_64[];\n getMAC: () => number[];\n\n constructor(variant: VariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(variant: VariantType, inputFormat: FormatNoTextType, options?: FixedLengthOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (!(\"SHA-384\" === variant || \"SHA-512\" === variant)) {\n throw new Error(sha_variant_error);\n }\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n this.HMACSupported = true;\n this.bigEndianMod = -1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA512;\n this.stateCloneFunc = function (state): Int_64[] {\n return state.slice();\n };\n this.newStateFunc = getNewState512;\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, H): number[] {\n return finalizeSHA512(remainder, remainderBinLen, processedBinLen, H, variant);\n };\n\n this.intermediateState = getNewState512(variant);\n this.variantBlockSize = 1024;\n this.outputBinLen = \"SHA-384\" === variant ? 384 : 512;\n this.isVariableLen = false;\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n}\n","import { jsSHABase, packedLEConcat, sha_variant_error, mac_rounds_error, TWO_PWR_32, parseInputOption } from \"./common\";\nimport {\n packedValue,\n CSHAKEOptionsNoEncodingType,\n CSHAKEOptionsEncodingType,\n SHAKEOptionsNoEncodingType,\n SHAKEOptionsEncodingType,\n KMACOptionsNoEncodingType,\n KMACOptionsEncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n ResolvedCSHAKEOptionsNoEncodingType,\n ResolvedKMACOptionsNoEncodingType,\n} from \"./custom_types\";\nimport { getStrConverter } from \"./converters\";\nimport { Int_64, rotl_64, xor_64_2, xor_64_5 } from \"./primitives_64\";\n\ntype FixedLengthVariantType = \"SHA3-224\" | \"SHA3-256\" | \"SHA3-384\" | \"SHA3-512\" | \"SHAKE128\" | \"SHAKE256\";\n\ntype VariantType = FixedLengthVariantType | \"SHAKE128\" | \"SHAKE256\" | \"CSHAKE128\" | \"CSHAKE256\" | \"KMAC128\" | \"KMAC256\";\n\nconst rc_sha3 = [\n new Int_64(0x00000000, 0x00000001),\n new Int_64(0x00000000, 0x00008082),\n new Int_64(0x80000000, 0x0000808a),\n new Int_64(0x80000000, 0x80008000),\n new Int_64(0x00000000, 0x0000808b),\n new Int_64(0x00000000, 0x80000001),\n new Int_64(0x80000000, 0x80008081),\n new Int_64(0x80000000, 0x00008009),\n new Int_64(0x00000000, 0x0000008a),\n new Int_64(0x00000000, 0x00000088),\n new Int_64(0x00000000, 0x80008009),\n new Int_64(0x00000000, 0x8000000a),\n new Int_64(0x00000000, 0x8000808b),\n new Int_64(0x80000000, 0x0000008b),\n new Int_64(0x80000000, 0x00008089),\n new Int_64(0x80000000, 0x00008003),\n new Int_64(0x80000000, 0x00008002),\n new Int_64(0x80000000, 0x00000080),\n new Int_64(0x00000000, 0x0000800a),\n new Int_64(0x80000000, 0x8000000a),\n new Int_64(0x80000000, 0x80008081),\n new Int_64(0x80000000, 0x00008080),\n new Int_64(0x00000000, 0x80000001),\n new Int_64(0x80000000, 0x80008008),\n];\n\nconst r_sha3 = [\n [0, 36, 3, 41, 18],\n [1, 44, 10, 45, 2],\n [62, 6, 43, 15, 61],\n [28, 55, 25, 21, 56],\n [27, 20, 39, 8, 14],\n];\n\n/**\n * Gets the state values for the specified SHA-3 variant.\n *\n * @param _variant Unused for this family.\n * @returns The initial state values.\n */\nfunction getNewState(_variant: VariantType): Int_64[][] {\n let i;\n const retVal = [];\n\n for (i = 0; i < 5; i += 1) {\n retVal[i] = [new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0), new Int_64(0, 0)];\n }\n\n return retVal;\n}\n\n/**\n * Returns a clone of the given SHA3 state.\n *\n * @param state The state to be cloned.\n * @returns The cloned state.\n */\nfunction cloneSHA3State(state: Int_64[][]): Int_64[][] {\n let i;\n const clone = [];\n for (i = 0; i < 5; i += 1) {\n clone[i] = state[i].slice();\n }\n\n return clone;\n}\n\n/**\n * Performs a round of SHA-3 hashing over a block. This clobbers `state`.\n *\n * @param block The binary array representation of the block to hash.\n * @param state Hash state from a previous round.\n * @returns The resulting state value.\n */\nfunction roundSHA3(block: number[] | null, state: Int_64[][]): Int_64[][] {\n let round, x, y, B;\n const C = [],\n D = [];\n\n if (null !== block) {\n for (x = 0; x < block.length; x += 2) {\n state[(x >>> 1) % 5][((x >>> 1) / 5) | 0] = xor_64_2(\n state[(x >>> 1) % 5][((x >>> 1) / 5) | 0],\n new Int_64(block[x + 1], block[x]),\n );\n }\n }\n\n for (round = 0; round < 24; round += 1) {\n /* Any SHA-3 variant name will do here */\n B = getNewState(\"SHA3-384\");\n\n /* Perform theta step */\n for (x = 0; x < 5; x += 1) {\n C[x] = xor_64_5(state[x][0], state[x][1], state[x][2], state[x][3], state[x][4]);\n }\n for (x = 0; x < 5; x += 1) {\n D[x] = xor_64_2(C[(x + 4) % 5], rotl_64(C[(x + 1) % 5], 1));\n }\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n state[x][y] = xor_64_2(state[x][y], D[x]);\n }\n }\n\n /* Perform combined ro and pi steps */\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n B[y][(2 * x + 3 * y) % 5] = rotl_64(state[x][y], r_sha3[x][y]);\n }\n }\n\n /* Perform chi step */\n for (x = 0; x < 5; x += 1) {\n for (y = 0; y < 5; y += 1) {\n state[x][y] = xor_64_2(\n B[x][y],\n new Int_64(\n ~B[(x + 1) % 5][y].highOrder & B[(x + 2) % 5][y].highOrder,\n ~B[(x + 1) % 5][y].lowOrder & B[(x + 2) % 5][y].lowOrder,\n ),\n );\n }\n }\n\n /* Perform iota step */\n state[0][0] = xor_64_2(state[0][0], rc_sha3[round]);\n }\n\n return state;\n}\n\n/**\n * Finalizes the SHA-3 hash. This clobbers `remainder` and `state`.\n *\n * @param remainder Any leftover unprocessed packed ints that still need to be processed.\n * @param remainderBinLen The number of bits in `remainder`.\n * @param _processedBinLen Unused for this family.\n * @param state The state from a previous round.\n * @param blockSize The block size/rate of the variant in bits\n * @param delimiter The delimiter value for the variant\n * @param outputLen The output length for the variant in bits\n * @returns The array of integers representing the SHA-3 hash of message.\n */\nfunction finalizeSHA3(\n remainder: number[],\n remainderBinLen: number,\n _processedBinLen: number,\n state: Int_64[][],\n blockSize: number,\n delimiter: number,\n outputLen: number,\n): number[] {\n let i,\n state_offset = 0,\n temp;\n const retVal = [],\n binaryStringInc = blockSize >>> 5,\n remainderIntLen = remainderBinLen >>> 5;\n\n /* Process as many blocks as possible, some may be here for multiple rounds\n\t\twith SHAKE\n\t*/\n for (i = 0; i < remainderIntLen && remainderBinLen >= blockSize; i += binaryStringInc) {\n state = roundSHA3(remainder.slice(i, i + binaryStringInc), state);\n remainderBinLen -= blockSize;\n }\n\n remainder = remainder.slice(i);\n remainderBinLen = remainderBinLen % blockSize;\n\n /* Pad out the remainder to a full block */\n while (remainder.length < binaryStringInc) {\n remainder.push(0);\n }\n\n /* Find the next \"empty\" byte for the 0x80 and append it via an xor */\n i = remainderBinLen >>> 3;\n remainder[i >> 2] ^= delimiter << (8 * (i % 4));\n\n remainder[binaryStringInc - 1] ^= 0x80000000;\n state = roundSHA3(remainder, state);\n\n while (retVal.length * 32 < outputLen) {\n temp = state[state_offset % 5][(state_offset / 5) | 0];\n retVal.push(temp.lowOrder);\n if (retVal.length * 32 >= outputLen) {\n break;\n }\n retVal.push(temp.highOrder);\n state_offset += 1;\n\n if (0 === (state_offset * 64) % blockSize) {\n roundSHA3(null, state);\n state_offset = 0;\n }\n }\n\n return retVal;\n}\n\n/**\n * Performs NIST left_encode function returned with no extra garbage bits. `x` is limited to <= 9007199254740991.\n *\n * @param x 32-bit number to to encode.\n * @returns The NIST specified output of the function.\n */\nfunction left_encode(x: number): packedValue {\n let byteOffset,\n byte,\n numEncodedBytes = 0;\n /* JavaScript numbers max out at 0x1FFFFFFFFFFFFF (7 bytes) so this will return a maximum of 7 + 1 = 8 bytes */\n const retVal = [0, 0],\n x_64 = [x & 0xffffffff, (x / TWO_PWR_32) & 0x1fffff];\n\n for (byteOffset = 6; byteOffset >= 0; byteOffset--) {\n /* This will surprisingly work for large shifts because JavaScript masks the shift amount by 0x1F */\n byte = (x_64[byteOffset >> 2] >>> (8 * byteOffset)) & 0xff;\n\n /* Starting from the most significant byte of a 64-bit number, start recording the first non-0 byte and then\n every byte thereafter */\n if (byte !== 0 || numEncodedBytes !== 0) {\n retVal[(numEncodedBytes + 1) >> 2] |= byte << ((numEncodedBytes + 1) * 8);\n numEncodedBytes += 1;\n }\n }\n numEncodedBytes = numEncodedBytes !== 0 ? numEncodedBytes : 1;\n retVal[0] |= numEncodedBytes;\n\n return { value: numEncodedBytes + 1 > 4 ? retVal : [retVal[0]], binLen: 8 + numEncodedBytes * 8 };\n}\n\n/**\n * Performs NIST right_encode function returned with no extra garbage bits. `x` is limited to <= 9007199254740991.\n *\n * @param x 32-bit number to to encode.\n * @returns The NIST specified output of the function.\n */\nfunction right_encode(x: number): packedValue {\n let byteOffset,\n byte,\n numEncodedBytes = 0;\n /* JavaScript numbers max out at 0x1FFFFFFFFFFFFF (7 bytes) so this will return a maximum of 7 + 1 = 8 bytes */\n const retVal = [0, 0],\n x_64 = [x & 0xffffffff, (x / TWO_PWR_32) & 0x1fffff];\n\n for (byteOffset = 6; byteOffset >= 0; byteOffset--) {\n /* This will surprisingly work for large shifts because JavaScript masks the shift amount by 0x1F */\n byte = (x_64[byteOffset >> 2] >>> (8 * byteOffset)) & 0xff;\n\n /* Starting from the most significant byte of a 64-bit number, start recording the first non-0 byte and then\n every byte thereafter */\n if (byte !== 0 || numEncodedBytes !== 0) {\n retVal[numEncodedBytes >> 2] |= byte << (numEncodedBytes * 8);\n numEncodedBytes += 1;\n }\n }\n numEncodedBytes = numEncodedBytes !== 0 ? numEncodedBytes : 1;\n retVal[numEncodedBytes >> 2] |= numEncodedBytes << (numEncodedBytes * 8);\n\n return { value: numEncodedBytes + 1 > 4 ? retVal : [retVal[0]], binLen: 8 + numEncodedBytes * 8 };\n}\n\n/**\n * Performs NIST encode_string function.\n *\n * @param input Packed array of integers.\n * @returns NIST encode_string output.\n */\nfunction encode_string(input: packedValue): packedValue {\n return packedLEConcat(left_encode(input[\"binLen\"]), input);\n}\n\n/**\n * Performs NIST byte_pad function.\n *\n * @param packed Packed array of integers.\n * @param outputByteLen Desired length of the output in bytes, assumed to be a multiple of 4.\n * @returns NIST byte_pad output.\n */\nfunction byte_pad(packed: packedValue, outputByteLen: number): number[] {\n let encodedLen = left_encode(outputByteLen),\n i;\n\n encodedLen = packedLEConcat(encodedLen, packed);\n const outputIntLen = outputByteLen >>> 2,\n intsToAppend = (outputIntLen - (encodedLen[\"value\"].length % outputIntLen)) % outputIntLen;\n\n for (i = 0; i < intsToAppend; i++) {\n encodedLen[\"value\"].push(0);\n }\n\n return encodedLen[\"value\"];\n}\n\n/**\n * Parses/validate constructor options for a CSHAKE variant\n *\n * @param options Option given to constructor\n */\nfunction resolveCSHAKEOptions(options: CSHAKEOptionsNoEncodingType): ResolvedCSHAKEOptionsNoEncodingType {\n const resolvedOptions = options || {};\n\n return {\n funcName: parseInputOption(\"funcName\", resolvedOptions[\"funcName\"], 1, { value: [], binLen: 0 }),\n customization: parseInputOption(\"Customization\", resolvedOptions[\"customization\"], 1, { value: [], binLen: 0 }),\n };\n}\n\n/**\n * Parses/validate constructor options for a KMAC variant\n *\n * @param options Option given to constructor\n */\nfunction resolveKMACOptions(options: KMACOptionsNoEncodingType): ResolvedKMACOptionsNoEncodingType {\n const resolvedOptions = options || {};\n\n return {\n kmacKey: parseInputOption(\"kmacKey\", resolvedOptions[\"kmacKey\"], 1),\n /* This is little-endian packed \"KMAC\" */\n funcName: { value: [0x43414d4b], binLen: 32 },\n customization: parseInputOption(\"Customization\", resolvedOptions[\"customization\"], 1, { value: [], binLen: 0 }),\n };\n}\n\nexport default class jsSHA extends jsSHABase {\n intermediateState: Int_64[][];\n variantBlockSize: number;\n bigEndianMod: -1 | 1;\n outputBinLen: number;\n isVariableLen: boolean;\n HMACSupported: boolean;\n\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n converterFunc: (input: any, existingBin: number[], existingBinLen: number) => packedValue;\n roundFunc: (block: number[], H: Int_64[][]) => Int_64[][];\n finalizeFunc: (\n remainder: number[],\n remainderBinLen: number,\n processedBinLen: number,\n H: Int_64[][],\n outputLen: number,\n ) => number[];\n stateCloneFunc: (state: Int_64[][]) => Int_64[][];\n newStateFunc: (variant: VariantType) => Int_64[][];\n getMAC: ((options: { outputLen: number }) => number[]) | null;\n\n constructor(variant: FixedLengthVariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(\n variant: FixedLengthVariantType,\n inputFormat: FormatNoTextType,\n options?: FixedLengthOptionsNoEncodingType,\n );\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: \"TEXT\", options?: SHAKEOptionsEncodingType);\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: FormatNoTextType, options?: SHAKEOptionsNoEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: \"TEXT\", options?: CSHAKEOptionsEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: FormatNoTextType, options?: CSHAKEOptionsNoEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: \"TEXT\", options: KMACOptionsEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: FormatNoTextType, options: KMACOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n let delimiter = 0x06,\n variantBlockSize = 0;\n super(variant, inputFormat, options);\n const resolvedOptions = options || {};\n\n /* In other variants, this was done after variable initialization but need to do it earlier here becaue we want to\n avoid KMAC initialization */\n if (this.numRounds !== 1) {\n if (resolvedOptions[\"kmacKey\"] || resolvedOptions[\"hmacKey\"]) {\n throw new Error(mac_rounds_error);\n } else if (this.shaVariant === \"CSHAKE128\" || this.shaVariant === \"CSHAKE256\") {\n throw new Error(\"Cannot set numRounds for CSHAKE variants\");\n }\n }\n\n this.bigEndianMod = 1;\n this.converterFunc = getStrConverter(this.inputFormat, this.utfType, this.bigEndianMod);\n this.roundFunc = roundSHA3;\n this.stateCloneFunc = cloneSHA3State;\n this.newStateFunc = getNewState;\n this.intermediateState = getNewState(variant);\n\n this.isVariableLen = false;\n switch (variant) {\n case \"SHA3-224\":\n this.variantBlockSize = variantBlockSize = 1152;\n this.outputBinLen = 224;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-256\":\n this.variantBlockSize = variantBlockSize = 1088;\n this.outputBinLen = 256;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-384\":\n this.variantBlockSize = variantBlockSize = 832;\n this.outputBinLen = 384;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHA3-512\":\n this.variantBlockSize = variantBlockSize = 576;\n this.outputBinLen = 512;\n this.HMACSupported = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getHMAC;\n break;\n case \"SHAKE128\":\n delimiter = 0x1f;\n this.variantBlockSize = variantBlockSize = 1344;\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"SHAKE256\":\n delimiter = 0x1f;\n this.variantBlockSize = variantBlockSize = 1088;\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"KMAC128\":\n delimiter = 0x4;\n this.variantBlockSize = variantBlockSize = 1344;\n this._initializeKMAC(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getKMAC;\n break;\n case \"KMAC256\":\n delimiter = 0x4;\n this.variantBlockSize = variantBlockSize = 1088;\n this._initializeKMAC(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.getMAC = this._getKMAC;\n break;\n case \"CSHAKE128\":\n this.variantBlockSize = variantBlockSize = 1344;\n delimiter = this._initializeCSHAKE(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n case \"CSHAKE256\":\n this.variantBlockSize = variantBlockSize = 1088;\n delimiter = this._initializeCSHAKE(options);\n /* This will be set in getHash */\n this.outputBinLen = -1;\n this.isVariableLen = true;\n this.HMACSupported = false;\n this.getMAC = null;\n break;\n default:\n throw new Error(sha_variant_error);\n }\n\n /* This needs to be down here as CSHAKE can change its delimiter */\n this.finalizeFunc = function (remainder, remainderBinLen, processedBinLen, state, outputBinLen): number[] {\n return finalizeSHA3(\n remainder,\n remainderBinLen,\n processedBinLen,\n state,\n variantBlockSize,\n delimiter,\n outputBinLen,\n );\n };\n\n if (resolvedOptions[\"hmacKey\"]) {\n this._setHMACKey(parseInputOption(\"hmacKey\", resolvedOptions[\"hmacKey\"], this.bigEndianMod));\n }\n }\n\n /**\n * Initialize CSHAKE variants.\n *\n * @param options Options containing CSHAKE params.\n * @param funcNameOverride Overrides any \"funcName\" present in `options` (used with KMAC)\n * @returns The delimiter to be used\n */\n protected _initializeCSHAKE(options?: CSHAKEOptionsNoEncodingType, funcNameOverride?: packedValue): number {\n const resolvedOptions = resolveCSHAKEOptions(options || {});\n if (funcNameOverride) {\n resolvedOptions[\"funcName\"] = funcNameOverride;\n }\n const packedParams = packedLEConcat(\n encode_string(resolvedOptions[\"funcName\"]),\n encode_string(resolvedOptions[\"customization\"]),\n );\n\n /* CSHAKE is defined to be a call to SHAKE iff both the customization and function-name string are both empty. This\n can be accomplished by processing nothing in this step. */\n if (resolvedOptions[\"customization\"][\"binLen\"] !== 0 || resolvedOptions[\"funcName\"][\"binLen\"] !== 0) {\n const byte_pad_out = byte_pad(packedParams, this.variantBlockSize >>> 3);\n for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) {\n this.intermediateState = this.roundFunc(\n byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)),\n this.intermediateState,\n );\n this.processedLen += this.variantBlockSize;\n }\n return 0x04;\n } else {\n return 0x1f;\n }\n }\n\n /**\n * Initialize KMAC variants.\n *\n * @param options Options containing KMAC params.\n */\n protected _initializeKMAC(options: KMACOptionsNoEncodingType): void {\n const resolvedOptions = resolveKMACOptions(options || {});\n\n this._initializeCSHAKE(options, resolvedOptions[\"funcName\"]);\n const byte_pad_out = byte_pad(encode_string(resolvedOptions[\"kmacKey\"]), this.variantBlockSize >>> 3);\n for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) {\n this.intermediateState = this.roundFunc(\n byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)),\n this.intermediateState,\n );\n this.processedLen += this.variantBlockSize;\n }\n this.macKeySet = true;\n }\n\n /**\n * Returns the the KMAC in the specified format.\n *\n * @param options Hashmap of extra outputs options. `outputLen` must be specified.\n * @returns The KMAC in the format specified.\n */\n protected _getKMAC(options: { outputLen: number }): number[] {\n const concatedRemainder = packedLEConcat(\n { value: this.remainder.slice(), binLen: this.remainderLen },\n right_encode(options[\"outputLen\"]),\n );\n\n return this.finalizeFunc(\n concatedRemainder[\"value\"],\n concatedRemainder[\"binLen\"],\n this.processedLen,\n this.stateCloneFunc(this.intermediateState),\n options[\"outputLen\"],\n );\n }\n}\n","import { sha_variant_error } from \"./common\";\nimport {\n CSHAKEOptionsEncodingType,\n CSHAKEOptionsNoEncodingType,\n SHAKEOptionsEncodingType,\n SHAKEOptionsNoEncodingType,\n EncodingType,\n FixedLengthOptionsEncodingType,\n FixedLengthOptionsNoEncodingType,\n FormatNoTextType,\n KMACOptionsNoEncodingType,\n KMACOptionsEncodingType,\n} from \"./custom_types\";\nimport jsSHA1 from \"./sha1\";\nimport jsSHA256 from \"./sha256\";\nimport jsSHA512 from \"./sha512\";\nimport jsSHA3 from \"./sha3\";\n\ntype FixedLengthVariantType =\n | \"SHA-1\"\n | \"SHA-224\"\n | \"SHA-256\"\n | \"SHA-384\"\n | \"SHA-512\"\n | \"SHA3-224\"\n | \"SHA3-256\"\n | \"SHA3-384\"\n | \"SHA3-512\";\n\nexport default class jsSHA {\n private readonly shaObj: jsSHA1 | jsSHA256 | jsSHA512 | jsSHA3;\n /**\n * @param variant The desired SHA variant (SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-256,\n * SHA3-384, SHA3-512, SHAKE128, SHAKE256, CSHAKE128, CSHAKE256, KMAC128, or KMAC256) as a string.\n * @param inputFormat The input format to be used in future `update` calls (TEXT, HEX, B64, BYTES, ARRAYBUFFER,\n * or UINT8ARRAY) as a string.\n * @param options Options in the form of { encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE\"; numRounds?: number }.\n * `encoding` is for only TEXT input (defaults to UTF8) and `numRounds` defaults to 1.\n * `numRounds` is not valid for any of the MAC or CSHAKE variants.\n * * If the variant supports HMAC, `options` may have an additional `hmacKey` key which must be in the form of\n * {value: , format: , encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE\"} where takes the same\n * values as `inputFormat` and can be a `string | ArrayBuffer | Uint8Array` depending on .\n * Supplying this key switches to HMAC calculation and replaces the now deprecated call to `setHMACKey`.\n * * If the variant is CSHAKE128 or CSHAKE256, `options` may have two additional keys, `customization` and `funcName`,\n * which are the NIST customization and function-name strings. Both must be in the same form as `hmacKey`.\n * * If the variant is KMAC128 or KMAC256, `options` can include the `customization` key from CSHAKE variants and\n * *must* have a `kmacKey` key that takes the same form as the `customization` key.\n */\n constructor(variant: FixedLengthVariantType, inputFormat: \"TEXT\", options?: FixedLengthOptionsEncodingType);\n constructor(\n variant: FixedLengthVariantType,\n inputFormat: FormatNoTextType,\n options?: FixedLengthOptionsNoEncodingType\n );\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: \"TEXT\", options?: SHAKEOptionsEncodingType);\n constructor(variant: \"SHAKE128\" | \"SHAKE256\", inputFormat: FormatNoTextType, options?: SHAKEOptionsNoEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: \"TEXT\", options?: CSHAKEOptionsEncodingType);\n constructor(variant: \"CSHAKE128\" | \"CSHAKE256\", inputFormat: FormatNoTextType, options?: CSHAKEOptionsNoEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: \"TEXT\", options: KMACOptionsEncodingType);\n constructor(variant: \"KMAC128\" | \"KMAC256\", inputFormat: FormatNoTextType, options: KMACOptionsNoEncodingType);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(variant: any, inputFormat: any, options?: any) {\n if (\"SHA-1\" == variant) {\n this.shaObj = new jsSHA1(variant, inputFormat, options);\n } else if (\"SHA-224\" == variant || \"SHA-256\" == variant) {\n this.shaObj = new jsSHA256(variant, inputFormat, options);\n } else if (\"SHA-384\" == variant || \"SHA-512\" == variant) {\n this.shaObj = new jsSHA512(variant, inputFormat, options);\n } else if (\n \"SHA3-224\" == variant ||\n \"SHA3-256\" == variant ||\n \"SHA3-384\" == variant ||\n \"SHA3-512\" == variant ||\n \"SHAKE128\" == variant ||\n \"SHAKE256\" == variant ||\n \"CSHAKE128\" == variant ||\n \"CSHAKE256\" == variant ||\n \"KMAC128\" == variant ||\n \"KMAC256\" == variant\n ) {\n this.shaObj = new jsSHA3(variant, inputFormat, options);\n } else {\n throw new Error(sha_variant_error);\n }\n }\n\n /**\n * Takes `input` and hashes as many blocks as possible. Stores the rest for either a future `update` or `getHash` call.\n *\n * @param input The input to be hashed.\n * @returns A reference to the object.\n */\n update(input: string | ArrayBuffer | Uint8Array): this {\n this.shaObj.update(input);\n\n return this;\n }\n\n /**\n * Returns the desired SHA or MAC (if a HMAC/KMAC key was specified) hash of the input fed in via `update` calls.\n *\n * @param format The desired output formatting (B64, HEX, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { outputUpper?: boolean; b64Pad?: string; outputLen?: number; }.\n * `outputLen` is required for variable length output variants (this option was previously called `shakeLen` which\n * is now deprecated).\n * `outputUpper` is only for HEX output (defaults to false) and b64pad is only for B64 output (defaults to \"=\").\n * @returns The hash in the format specified.\n */\n getHash(format: \"HEX\", options?: { outputUpper?: boolean; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"B64\", options?: { b64Pad?: string; outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"BYTES\", options?: { outputLen?: number; shakeLen?: number }): string;\n getHash(format: \"UINT8ARRAY\", options?: { outputLen?: number; shakeLen?: number }): Uint8Array;\n getHash(format: \"ARRAYBUFFER\", options?: { outputLen?: number; shakeLen?: number }): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHash(format: any, options?: any): any {\n return this.shaObj.getHash(format, options);\n }\n\n /**\n * Sets the HMAC key for an eventual `getHMAC` call. Must be called immediately after jsSHA object instantiation.\n * Now deprecated in favor of setting the `hmacKey` at object instantiation.\n *\n * @param key The key used to calculate the HMAC\n * @param inputFormat The format of key (HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { encoding?: \"UTF8\" | \"UTF16BE\" | \"UTF16LE }. `encoding` is only for TEXT\n * and defaults to UTF8.\n */\n setHMACKey(key: string, inputFormat: \"TEXT\", options?: { encoding?: EncodingType }): void;\n setHMACKey(key: string, inputFormat: \"B64\" | \"HEX\" | \"BYTES\"): void;\n setHMACKey(key: ArrayBuffer, inputFormat: \"ARRAYBUFFER\"): void;\n setHMACKey(key: Uint8Array, inputFormat: \"UINT8ARRAY\"): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setHMACKey(key: any, inputFormat: any, options?: any): void {\n this.shaObj.setHMACKey(key, inputFormat, options);\n }\n\n /**\n * Returns the the HMAC in the specified format using the key given by a previous `setHMACKey` call. Now deprecated\n * in favor of just calling `getHash`.\n *\n * @param format The desired output formatting (B64, HEX, BYTES, ARRAYBUFFER, or UINT8ARRAY) as a string.\n * @param options Options in the form of { outputUpper?: boolean; b64Pad?: string }. `outputUpper` is only for HEX\n * output (defaults to false) and `b64pad` is only for B64 output (defaults to \"=\").\n * @returns The HMAC in the format specified.\n */\n getHMAC(format: \"HEX\", options?: { outputUpper?: boolean }): string;\n getHMAC(format: \"B64\", options?: { b64Pad?: string }): string;\n getHMAC(format: \"BYTES\"): string;\n getHMAC(format: \"UINT8ARRAY\"): Uint8Array;\n getHMAC(format: \"ARRAYBUFFER\"): ArrayBuffer;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getHMAC(format: any, options?: any): any {\n return this.shaObj.getHMAC(format, options);\n }\n}\n"],"names":["b64Tab","arraybuffer_error","uint8array_error","uint8array2packed","arr","existingPacked","existingPackedLen","bigEndianMod","i","intOffset","byteOffset","packed","existingByteLen","shiftModifier","length","push","value","binLen","getStrConverter","format","utfType","Error","str","existingBin","existingBinLen","num","parseInt","substr","isNaN","hex2packed","codePnt","codePntArr","j","transposeBytes","byteCnt","charCodeAt","str2packed","index","tmpInt","strPart","firstEqual","indexOf","search","replace","charAt","b642packed","bytes2packed","ArrayBuffer","_a","Uint8Array","arraybuffer2packed","_b","getOutputConverter","outputBinLen","outputOptions","binarray","outputLength","formatOpts","hex_tab","srcByte","toUpperCase","packed2hex","triplet","int1","int2","packed2b64","String","fromCharCode","packed2bytes","retVal","arrView","packed2arraybuffer","packed2uint8array","TWO_PWR_32","K_sha2","H_trunc","H_full","sha_variant_error","mac_rounds_error","packedLEConcat","a","b","arrOffset","aByteLen","bByteLen","leftShiftAmount","rightShiftAmount","pop","concat","getOutputOpts","options","outputUpper","b64Pad","outputLen","lenErrstr","parseInputOption","key","fallback","errStr","jsSHABase","constructor","variant","inputFormat","inputOptions","this","numRounds","shaVariant","remainder","remainderLen","updateCalled","processedLen","macKeySet","keyWithIPad","keyWithOPad","update","srcString","updateProcessedLen","variantBlockIntInc","variantBlockSize","convertRet","converterFunc","chunkBinLen","chunk","chunkIntLen","intermediateState","roundFunc","slice","getHash","finalizedState","isVariableLen","formatFunc","getMAC","finalizeFunc","stateCloneFunc","newStateFunc","setHMACKey","HMACSupported","keyConverterFunc","_setHMACKey","blockByteSize","lastArrayIndex","getHMAC","_getHMAC","firstHash","rotl_32","x","n","rotr_32","shr_32","parity_32","y","z","ch_32","maj_32","sigma0_32","safeAdd_32_2","lsw","safeAdd_32_4","c","d","safeAdd_32_5","e","gamma1_32","gamma0_32","sigma1_32","getNewState","_variant","roundSHA1","block","H","T","t","W","finalizeSHA1","remainderBinLen","processedBinLen","offset","totalLen","super","resolvedOptions","state","getNewState256","roundSHA256","f","g","h","T1","T2","finalizeSHA256","Int_64","msint_32","lsint_32","highOrder","lowOrder","rotl_64","tmp","rotr_64","shr_64","ch_64","maj_64","sigma0_64","rotr28","rotr34","rotr39","safeAdd_64_2","msw","safeAdd_64_4","safeAdd_64_5","xor_64_2","xor_64_5","gamma1_64","rotr19","rotr61","shr6","gamma0_64","rotr1","rotr8","shr7","sigma1_64","rotr14","rotr18","rotr41","K_sha512","getNewState512","roundSHA512","finalizeSHA512","rc_sha3","r_sha3","cloneSHA3State","clone","roundSHA3","round","B","C","D","left_encode","byte","numEncodedBytes","x_64","encode_string","input","byte_pad","outputByteLen","encodedLen","outputIntLen","intsToAppend","delimiter","_initializeKMAC","_getKMAC","_initializeCSHAKE","_processedBinLen","blockSize","temp","state_offset","binaryStringInc","remainderIntLen","finalizeSHA3","funcNameOverride","funcName","customization","resolveCSHAKEOptions","packedParams","byte_pad_out","kmacKey","resolveKMACOptions","concatedRemainder","right_encode","jsSHA","shaObj","jsSHA1","jsSHA256","jsSHA512","jsSHA3"],"mappings":";;;;;;;;AAIA,MAAMA,EAAS,mEAETC,EAAoB,gDACpBC,EAAmB,+CAyPzB,SAASC,EACPC,EACAC,EACAC,EACAC,GAEA,IAAIC,EAAGC,EAAWC,EAGlB,MAAMC,EAASN,GAAkB,CAAC,GAChCO,GAFFN,EAAoBA,GAAqB,KAEC,EACxCO,GAAiC,IAAjBN,EAAsB,EAAI,EAE5C,IAAKC,EAAI,EAAGA,EAAIJ,EAAIU,OAAQN,GAAK,EAC/BE,EAAaF,EAAII,EACjBH,EAAYC,IAAe,EACvBC,EAAOG,QAAUL,GACnBE,EAAOI,KAAK,GAEdJ,EAAOF,IAAcL,EAAII,IAAO,GAAKK,EAAgBN,GAAgBG,EAAa,IAGpF,MAAO,CAAEM,MAAOL,EAAQM,OAAqB,EAAbb,EAAIU,OAAaR,EACnD,UA4BgBY,EACdC,EACAC,EACAb,GAIA,OAAQa,GAC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A,GACd,YAAcA,GACd,aAAeA,GACf,aAAeA,GACf,WAAaA,GACb,WAAaA,EAIb,MAAM,IAAIhF,MAAMwD,GAFhB2B,KAAKoK,EAAS,IAAII,GAAO3K,EAASC,EAAaZ,EAGjD,CACF,CAQA,MAAAwB,CAAO8H,GAGL,OAFAxI,KAAKoK,EAAO1J,OAAO8H,GAEZxI,IACT,CAkBA,OAAAuB,CAAQ5G,EAAauE,GACnB,OAAOc,KAAKoK,EAAO7I,QAAQ5G,EAAQuE,EACrC,CAgBA,UAAA6C,CAAWvC,EAAUM,EAAkBZ,GACrCc,KAAKoK,EAAOrI,WAAWvC,EAAKM,EAAaZ,EAC3C,CAiBA,OAAAmD,CAAQ1H,EAAauE,GACnB,OAAOc,KAAKoK,EAAO/H,QAAQ1H,EAAQuE,EACrC"} \ No newline at end of file diff --git a/dist/sha1.js b/dist/sha1.js index 3088db9..6664249 100644 --- a/dist/sha1.js +++ b/dist/sha1.js @@ -2,7 +2,7 @@ * A JavaScript implementation of the SHA family of hashes - defined in FIPS PUB 180-4, FIPS PUB 202, * and SP 800-185 - as well as the corresponding HMAC implementation as defined in FIPS PUB 198-1. * - * Copyright 2008-2023 Brian Turek, 1998-2009 Paul Johnston & Contributors + * Copyright 2008-2024 Brian Turek, 1998-2009 Paul Johnston & Contributors * Distributed under the BSD License * See http://caligatio.github.com/jsSHA/ for more information * @@ -14,8 +14,8 @@ * * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, * INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - * MERCHANTABLITY OR NON-INFRINGEMENT. + * MERCHANTABILITY OR NON-INFRINGEMENT. * * See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. */ -!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(r="undefined"!=typeof globalThis?globalThis:r||self).jsSHA=t()}(this,(function(){"use strict";var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])},r(t,n)};"function"==typeof SuppressedError&&SuppressedError;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="ARRAYBUFFER not supported by this environment",i="UINT8ARRAY not supported by this environment";function e(r,t,n,i){var e,o,u,s=t||[0],f=(n=n||0)>>>3,h=-1===i?3:0;for(e=0;e>>2,s.length<=o&&s.push(0),s[o]|=r[e]<<8*(h+i*(u%4));return{value:s,binLen:8*r.length+n}}function o(r,o,u){switch(o){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(r,t,n){return function(r,t,n,i){var e,o,u,s;if(0!=r.length%2)throw new Error("String of HEX type must be in byte increments");var f=t||[0],h=(n=n||0)>>>3,a=-1===i?3:0;for(e=0;e>>1)+h)>>>2;f.length<=u;)f.push(0);f[u]|=o<<8*(a+i*(s%4))}return{value:f,binLen:4*r.length+n}}(r,t,n,u)};case"TEXT":return function(r,t,n){return function(r,t,n,i,e){var o,u,s,f,h,a,c,w,E=0,v=n||[0],l=(i=i||0)>>>3;if("UTF8"===t)for(c=-1===e?3:0,s=0;s(o=r.charCodeAt(s))?u.push(o):2048>o?(u.push(192|o>>>6),u.push(128|63&o)):55296>o||57344<=o?u.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&r.charCodeAt(s)),u.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),f=0;f>>2;v.length<=h;)v.push(0);v[h]|=u[f]<<8*(c+e*(a%4)),E+=1}else for(c=-1===e?2:0,w="UTF16LE"===t&&1!==e||"UTF16LE"!==t&&1===e,s=0;s>>8),h=(a=E+l)>>>2;v.length<=h;)v.push(0);v[h]|=o<<8*(c+e*(a%4)),E+=2}return{value:v,binLen:8*E+i}}(r,o,t,n,u)};case"B64":return function(r,n,i){return function(r,n,i,e){var o,u,s,f,h,a,c=0,w=n||[0],E=(i=i||0)>>>3,v=-1===e?3:0,l=r.indexOf("=");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(r=r.replace(/=/g,""),-1!==l&&l>>2;w.length<=h;)w.push(0);w[h]|=(s>>>16-8*u&255)<<8*(v+e*(a%4)),c+=1}}return{value:w,binLen:8*c+i}}(r,n,i,u)};case"BYTES":return function(r,t,n){return function(r,t,n,i){var e,o,u,s,f=t||[0],h=(n=n||0)>>>3,a=-1===i?3:0;for(o=0;o>>2,f.length<=u&&f.push(0),f[u]|=e<<8*(a+i*(s%4));return{value:f,binLen:8*r.length+n}}(r,t,n,u)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(r){throw new Error(n)}return function(r,t,n){return function(r,t,n,i){return e(new Uint8Array(r),t,n,i)}(r,t,n,u)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(r){throw new Error(i)}return function(r,t,n){return e(r,t,n,u)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function u(r,e,o,u){switch(r){case"HEX":return function(r){return function(r,t,n,i){var e,o,u="0123456789abcdef",s="",f=t/8,h=-1===n?3:0;for(e=0;e>>2]>>>8*(h+n*(e%4)),s+=u.charAt(o>>>4&15)+u.charAt(15&o);return i.outputUpper?s.toUpperCase():s}(r,e,o,u)};case"B64":return function(r){return function(r,n,i,e){var o,u,s,f,h,a="",c=n/8,w=-1===i?3:0;for(o=0;o>>2]:0,h=o+2>>2]:0,s=(r[o>>>2]>>>8*(w+i*(o%4))&255)<<16|(f>>>8*(w+i*((o+1)%4))&255)<<8|h>>>8*(w+i*((o+2)%4))&255,u=0;u<4;u+=1)a+=8*o+6*u<=n?t.charAt(s>>>6*(3-u)&63):e.b64Pad;return a}(r,e,o,u)};case"BYTES":return function(r){return function(r,t,n){var i,e,o="",u=t/8,s=-1===n?3:0;for(i=0;i>>2]>>>8*(s+n*(i%4))&255,o+=String.fromCharCode(e);return o}(r,e,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(r){throw new Error(n)}return function(r){return function(r,t,n){var i,e=t/8,o=new ArrayBuffer(e),u=new Uint8Array(o),s=-1===n?3:0;for(i=0;i>>2]>>>8*(s+n*(i%4))&255;return o}(r,e,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(r){throw new Error(i)}return function(r){return function(r,t,n){var i,e=t/8,o=-1===n?3:0,u=new Uint8Array(e);for(i=0;i>>2]>>>8*(o+n*(i%4))&255;return u}(r,e,o)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function s(r){var t={outputUpper:!1,b64Pad:"=",outputLen:-1},n=r||{},i="Output length must be a multiple of 8";if(t.outputUpper=n.outputUpper||!1,n.b64Pad&&(t.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(i);t.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(i);t.outputLen=n.shakeLen}if("boolean"!=typeof t.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw new Error("Invalid b64Pad formatting option");return t}function f(r,t){return r<>>32-t}function h(r,t,n){return r^t^n}function a(r,t,n){return r&t^~r&n}function c(r,t,n){return r&t^r&n^t&n}function w(r,t){var n=(65535&r)+(65535&t);return(65535&(r>>>16)+(t>>>16)+(n>>>16))<<16|65535&n}function E(r,t,n,i,e){var o=(65535&r)+(65535&t)+(65535&n)+(65535&i)+(65535&e);return(65535&(r>>>16)+(t>>>16)+(n>>>16)+(i>>>16)+(e>>>16)+(o>>>16))<<16|65535&o}function v(r){return[1732584193,4023233417,2562383102,271733878,3285377520]}function l(r,t){var n,i,e,o,u,s,v,l=[];for(n=t[0],i=t[1],e=t[2],o=t[3],u=t[4],v=0;v<80;v+=1)l[v]=v<16?r[v]:f(l[v-3]^l[v-8]^l[v-14]^l[v-16],1),s=v<20?E(f(n,5),a(i,e,o),u,1518500249,l[v]):v<40?E(f(n,5),h(i,e,o),u,1859775393,l[v]):v<60?E(f(n,5),c(i,e,o),u,2400959708,l[v]):E(f(n,5),h(i,e,o),u,3395469782,l[v]),u=o,o=e,e=f(i,30),i=n,n=s;return t[0]=w(n,t[0]),t[1]=w(i,t[1]),t[2]=w(e,t[2]),t[3]=w(o,t[3]),t[4]=w(u,t[4]),t}function p(r,t,n,i){for(var e,o=15+(t+65>>>9<<4),u=t+n;r.length<=o;)r.push(0);for(r[t>>>5]|=128<<24-t%32,r[o]=4294967295&u,r[o-1]=u/4294967296|0,e=0;ethis.numRounds)throw new Error("numRounds must a integer >= 1");this.S=r,this.C=[],this.I=0,this.H=!1,this.L=0,this.N=!1,this.X=[],this.M=[]}return r.prototype.update=function(r){var t,n=0,i=this.m>>>5,e=this.h(r,this.C,this.I),o=e.binLen,u=e.value,s=o>>>5;for(t=0;t>>5),this.I=o%this.m,this.H=!0,this},r.prototype.getHash=function(r,t){var n,i,e=this.F,o=s(t);if(this.B){if(-1===o.outputLen)throw new Error("Output length must be specified in options");e=o.outputLen}var f=u(r,e,this.u,o);if(this.N&&this.i)return f(this.i(o));for(i=this.T(this.C.slice(),this.I,this.L,this.A(this.R),e),n=1;n>>24-e%32),i=this.T(i,e,0,this.U(this.S),e);return f(i)},r.prototype.setHMACKey=function(r,t,n){if(!this.t)throw new Error("Variant does not support HMAC");if(this.H)throw new Error("Cannot set MAC key after calling update");var i=o(t,(n||{}).encoding||"UTF8",this.u);this.Y(i(r))},r.prototype.Y=function(r){var t,n=this.m>>>3,i=n/4-1;if(1!==this.numRounds)throw new Error("Cannot set numRounds with MAC");if(this.N)throw new Error("MAC key already set");for(n>>3,f=-1===i?3:0;for(e=0;e>>2,h.length<=s&&h.push(0),h[s]|=t[e]<<8*(f+i*(o%4));return{value:h,binLen:8*t.length+n}}function e(e,s,o){switch(s){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;if(0!=t.length%2)throw new Error("String of HEX type must be in byte increments");const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(e=0;e>>1)+f,o=h>>>2;u.length<=o;)u.push(0);u[o]|=s<<8*(c+i*(h%4))}return{value:u,binLen:4*t.length+n}}(t,r,n,o)};case"TEXT":return function(t,r,n){return function(t,r,n,i,e){let s,o,h,u,f,c,a,w,E=0;const l=n||[0],A=(i=i||0)>>>3;if("UTF8"===r)for(a=-1===e?3:0,h=0;hs?o.push(s):2048>s?(o.push(192|s>>>6),o.push(128|63&s)):55296>s||57344<=s?o.push(224|s>>>12,128|s>>>6&63,128|63&s):(h+=1,s=65536+((1023&s)<<10|1023&t.charCodeAt(h)),o.push(240|s>>>18,128|s>>>12&63,128|s>>>6&63,128|63&s)),u=0;u>>2;l.length<=f;)l.push(0);l[f]|=o[u]<<8*(a+e*(c%4)),E+=1}else for(a=-1===e?2:0,w="UTF16LE"===r&&1!==e||"UTF16LE"!==r&&1===e,h=0;h>>8),c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=s<<8*(a+e*(c%4)),E+=2}return{value:l,binLen:8*E+i}}(t,s,r,n,o)};case"B64":return function(r,n,i){return function(r,n,i,e){let s,o,h,u,f,c,a,w=0;const E=n||[0],l=(i=i||0)>>>3,A=-1===e?3:0,p=r.indexOf("=");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(r=r.replace(/=/g,""),-1!==p&&p>>2;E.length<=c;)E.push(0);E[c]|=(u>>>16-8*h&255)<<8*(A+e*(a%4)),w+=1}}return{value:E,binLen:8*w+i}}(r,n,i,o)};case"BYTES":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(s=0;s>>2,u.length<=o&&u.push(0),u[o]|=e<<8*(c+i*(h%4));return{value:u,binLen:8*t.length+n}}(t,r,n,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t,r,n){return function(t,r,n,e){return i(new Uint8Array(t),r,n,e)}(t,r,n,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t,r,n){return i(t,r,n,o)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function s(i,e,s,o){switch(i){case"HEX":return function(t){return function(t,r,n,i){const e="0123456789abcdef";let s,o,h="";const u=r/8,f=-1===n?3:0;for(s=0;s>>2]>>>8*(f+n*(s%4)),h+=e.charAt(o>>>4&15)+e.charAt(15&o);return i.outputUpper?h.toUpperCase():h}(t,e,s,o)};case"B64":return function(r){return function(r,n,i,e){let s,o,h,u,f,c="";const a=n/8,w=-1===i?3:0;for(s=0;s>>2]:0,f=s+2>>2]:0,h=(r[s>>>2]>>>8*(w+i*(s%4))&255)<<16|(u>>>8*(w+i*((s+1)%4))&255)<<8|f>>>8*(w+i*((s+2)%4))&255,o=0;o<4;o+=1)c+=8*s+6*o<=n?t.charAt(h>>>6*(3-o)&63):e.b64Pad;return c}(r,e,s,o)};case"BYTES":return function(t){return function(t,r,n){let i,e,s="";const o=r/8,h=-1===n?3:0;for(i=0;i>>2]>>>8*(h+n*(i%4))&255,s+=String.fromCharCode(e);return s}(t,e,s)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t){return function(t,r,n){let i;const e=r/8,s=new ArrayBuffer(e),o=new Uint8Array(s),h=-1===n?3:0;for(i=0;i>>2]>>>8*(h+n*(i%4))&255;return s}(t,e,s)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t){return function(t,r,n){let i;const e=r/8,s=-1===n?3:0,o=new Uint8Array(e);for(i=0;i>>2]>>>8*(s+n*(i%4))&255;return o}(t,e,s)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function o(t){const r={outputUpper:!1,b64Pad:"=",outputLen:-1},n=t||{},i="Output length must be a multiple of 8";if(r.outputUpper=n.outputUpper||!1,n.b64Pad&&(r.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(i);r.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(i);r.outputLen=n.shakeLen}if("boolean"!=typeof r.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof r.b64Pad)throw new Error("Invalid b64Pad formatting option");return r}class h{constructor(t,r,n){const i=n||{};if(this.t=r,this.i=i.encoding||"UTF8",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(t){let r,n=0;const i=this.T>>>5,e=this.F(t,this.h,this.u),s=e.binLen,o=e.value,h=s>>>5;for(r=0;r>>5),this.u=s%this.T,this.l=!0,this}getHash(t,r){let n,i,e=this.v;const h=o(r);if(this.H){if(-1===h.outputLen)throw new Error("Output length must be specified in options");e=h.outputLen}const u=s(t,e,this.C,h);if(this.p&&this.Y)return u(this.Y(h));for(i=this.I(this.h.slice(),this.u,this.A,this.L(this.m),e),n=1;n>>24-e%32),i=this.I(i,e,0,this.M(this.o),e);return u(i)}setHMACKey(t,r,n){if(!this.N)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const i=e(r,(n||{}).encoding||"UTF8",this.C);this.S(i(t))}S(t){const r=this.T>>>3,n=r/4-1;let i;if(1!==this.numRounds)throw new Error("Cannot set numRounds with MAC");if(this.p)throw new Error("MAC key already set");for(r>>32-r}function f(t,r,n){return t^r^n}function c(t,r,n){return t&r^~t&n}function a(t,r,n){return t&r^t&n^r&n}function w(t,r){const n=(65535&t)+(65535&r);return(65535&(t>>>16)+(r>>>16)+(n>>>16))<<16|65535&n}function E(t,r,n,i,e){const s=(65535&t)+(65535&r)+(65535&n)+(65535&i)+(65535&e);return(65535&(t>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(e>>>16)+(s>>>16))<<16|65535&s}function l(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function A(t,r){let n,i,e,s,o,h,l;const A=[];for(n=r[0],i=r[1],e=r[2],s=r[3],o=r[4],l=0;l<80;l+=1)A[l]=l<16?t[l]:u(A[l-3]^A[l-8]^A[l-14]^A[l-16],1),h=l<20?E(u(n,5),c(i,e,s),o,1518500249,A[l]):l<40?E(u(n,5),f(i,e,s),o,1859775393,A[l]):l<60?E(u(n,5),a(i,e,s),o,2400959708,A[l]):E(u(n,5),f(i,e,s),o,3395469782,A[l]),o=s,s=e,e=u(i,30),i=n,n=h;return r[0]=w(n,r[0]),r[1]=w(i,r[1]),r[2]=w(e,r[2]),r[3]=w(s,r[3]),r[4]=w(o,r[4]),r}function p(t,r,n,i){let e;const s=15+(r+65>>>9<<4),o=r+n;for(;t.length<=s;)t.push(0);for(t[r>>>5]|=128<<24-r%32,t[s]=4294967295&o,t[s-1]=o/4294967296|0,e=0;e>>3,h=-1===i?3:0;for(e=0;e>>2,s.length<=o&&s.push(0),s[o]|=r[e]<<8*(h+i*(u%4));return{value:s,binLen:8*r.length+n}}function o(r,o,u){switch(o){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(r,t,n){return function(r,t,n,i){var e,o,u,s;if(0!=r.length%2)throw new Error("String of HEX type must be in byte increments");var f=t||[0],h=(n=n||0)>>>3,a=-1===i?3:0;for(e=0;e>>1)+h)>>>2;f.length<=u;)f.push(0);f[u]|=o<<8*(a+i*(s%4))}return{value:f,binLen:4*r.length+n}}(r,t,n,u)};case"TEXT":return function(r,t,n){return function(r,t,n,i,e){var o,u,s,f,h,a,c,w,E=0,v=n||[0],l=(i=i||0)>>>3;if("UTF8"===t)for(c=-1===e?3:0,s=0;s(o=r.charCodeAt(s))?u.push(o):2048>o?(u.push(192|o>>>6),u.push(128|63&o)):55296>o||57344<=o?u.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&r.charCodeAt(s)),u.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),f=0;f>>2;v.length<=h;)v.push(0);v[h]|=u[f]<<8*(c+e*(a%4)),E+=1}else for(c=-1===e?2:0,w="UTF16LE"===t&&1!==e||"UTF16LE"!==t&&1===e,s=0;s>>8),h=(a=E+l)>>>2;v.length<=h;)v.push(0);v[h]|=o<<8*(c+e*(a%4)),E+=2}return{value:v,binLen:8*E+i}}(r,o,t,n,u)};case"B64":return function(r,n,i){return function(r,n,i,e){var o,u,s,f,h,a,c=0,w=n||[0],E=(i=i||0)>>>3,v=-1===e?3:0,l=r.indexOf("=");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(r=r.replace(/=/g,""),-1!==l&&l>>2;w.length<=h;)w.push(0);w[h]|=(s>>>16-8*u&255)<<8*(v+e*(a%4)),c+=1}}return{value:w,binLen:8*c+i}}(r,n,i,u)};case"BYTES":return function(r,t,n){return function(r,t,n,i){var e,o,u,s,f=t||[0],h=(n=n||0)>>>3,a=-1===i?3:0;for(o=0;o>>2,f.length<=u&&f.push(0),f[u]|=e<<8*(a+i*(s%4));return{value:f,binLen:8*r.length+n}}(r,t,n,u)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(r){throw new Error(n)}return function(r,t,n){return function(r,t,n,i){return e(new Uint8Array(r),t,n,i)}(r,t,n,u)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(r){throw new Error(i)}return function(r,t,n){return e(r,t,n,u)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function u(r,e,o,u){switch(r){case"HEX":return function(r){return function(r,t,n,i){var e,o,u="0123456789abcdef",s="",f=t/8,h=-1===n?3:0;for(e=0;e>>2]>>>8*(h+n*(e%4)),s+=u.charAt(o>>>4&15)+u.charAt(15&o);return i.outputUpper?s.toUpperCase():s}(r,e,o,u)};case"B64":return function(r){return function(r,n,i,e){var o,u,s,f,h,a="",c=n/8,w=-1===i?3:0;for(o=0;o>>2]:0,h=o+2>>2]:0,s=(r[o>>>2]>>>8*(w+i*(o%4))&255)<<16|(f>>>8*(w+i*((o+1)%4))&255)<<8|h>>>8*(w+i*((o+2)%4))&255,u=0;u<4;u+=1)a+=8*o+6*u<=n?t.charAt(s>>>6*(3-u)&63):e.b64Pad;return a}(r,e,o,u)};case"BYTES":return function(r){return function(r,t,n){var i,e,o="",u=t/8,s=-1===n?3:0;for(i=0;i>>2]>>>8*(s+n*(i%4))&255,o+=String.fromCharCode(e);return o}(r,e,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(r){throw new Error(n)}return function(r){return function(r,t,n){var i,e=t/8,o=new ArrayBuffer(e),u=new Uint8Array(o),s=-1===n?3:0;for(i=0;i>>2]>>>8*(s+n*(i%4))&255;return o}(r,e,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(r){throw new Error(i)}return function(r){return function(r,t,n){var i,e=t/8,o=-1===n?3:0,u=new Uint8Array(e);for(i=0;i>>2]>>>8*(o+n*(i%4))&255;return u}(r,e,o)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function a(r){var t={outputUpper:!1,b64Pad:"=",outputLen:-1},n=r||{},i="Output length must be a multiple of 8";if(t.outputUpper=n.outputUpper||!1,n.b64Pad&&(t.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(i);t.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(i);t.outputLen=n.shakeLen}if("boolean"!=typeof t.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw new Error("Invalid b64Pad formatting option");return t}function c(r,t){return r>>>t|r<<32-t}function w(r,t){return r>>>t}function E(r,t,n){return r&t^~r&n}function v(r,t,n){return r&t^r&n^t&n}function l(r){return c(r,2)^c(r,13)^c(r,22)}function p(r,t){var n=(65535&r)+(65535&t);return(65535&(r>>>16)+(t>>>16)+(n>>>16))<<16|65535&n}function A(r,t,n,i){var e=(65535&r)+(65535&t)+(65535&n)+(65535&i);return(65535&(r>>>16)+(t>>>16)+(n>>>16)+(i>>>16)+(e>>>16))<<16|65535&e}function d(r,t,n,i,e){var o=(65535&r)+(65535&t)+(65535&n)+(65535&i)+(65535&e);return(65535&(r>>>16)+(t>>>16)+(n>>>16)+(i>>>16)+(e>>>16)+(o>>>16))<<16|65535&o}function y(r){return c(r,17)^c(r,19)^w(r,10)}function U(r){return c(r,7)^c(r,18)^w(r,3)}function T(r){return c(r,6)^c(r,11)^c(r,25)}function b(r){return"SHA-224"==r?f.slice():h.slice()}function R(r,t){var n,i,e,o,u,f,h,a,c,w,b,R=[];for(n=t[0],i=t[1],e=t[2],o=t[3],u=t[4],f=t[5],h=t[6],a=t[7],b=0;b<64;b+=1)R[b]=b<16?r[b]:A(y(R[b-2]),R[b-7],U(R[b-15]),R[b-16]),c=d(a,T(u),E(u,f,h),s[b],R[b]),w=p(l(n),v(n,i,e)),a=h,h=f,f=u,u=p(o,c),o=e,e=i,i=n,n=p(c,w);return t[0]=p(n,t[0]),t[1]=p(i,t[1]),t[2]=p(e,t[2]),t[3]=p(o,t[3]),t[4]=p(u,t[4]),t[5]=p(f,t[5]),t[6]=p(h,t[6]),t[7]=p(a,t[7]),t}return function(t){function n(r,n,i){var e=this;if("SHA-224"!==r&&"SHA-256"!==r)throw new Error("Chosen SHA variant is not supported");var u=i||{};return(e=t.call(this,r,n,i)||this).t=e.i,e.o=!0,e.u=-1,e.h=o(e.v,e.l,e.u),e.p=R,e.A=function(r){return r.slice()},e.U=b,e.T=function(t,n,i,e){return function(r,t,n,i,e){for(var o,u=15+(t+65>>>9<<4),s=t+n;r.length<=u;)r.push(0);for(r[t>>>5]|=128<<24-t%32,r[u]=4294967295&s,r[u-1]=s/4294967296|0,o=0;othis.numRounds)throw new Error("numRounds must a integer >= 1");this.H=r,this.Y=[],this.C=0,this.I=!1,this.L=0,this.N=!1,this.X=[],this.M=[]}return r.prototype.update=function(r){var t,n=0,i=this.m>>>5,e=this.h(r,this.Y,this.C),o=e.binLen,u=e.value,s=o>>>5;for(t=0;t>>5),this.C=o%this.m,this.I=!0,this},r.prototype.getHash=function(r,t){var n,i,e=this.F,o=a(t);if(this.B){if(-1===o.outputLen)throw new Error("Output length must be specified in options");e=o.outputLen}var s=u(r,e,this.u,o);if(this.N&&this.t)return s(this.t(o));for(i=this.T(this.Y.slice(),this.C,this.L,this.A(this.R),e),n=1;n>>24-e%32),i=this.T(i,e,0,this.U(this.H),e);return s(i)},r.prototype.setHMACKey=function(r,t,n){if(!this.o)throw new Error("Variant does not support HMAC");if(this.I)throw new Error("Cannot set MAC key after calling update");var i=o(t,(n||{}).encoding||"UTF8",this.u);this.S(i(r))},r.prototype.S=function(r){var t,n=this.m>>>3,i=n/4-1;if(1!==this.numRounds)throw new Error("Cannot set numRounds with MAC");if(this.N)throw new Error("MAC key already set");for(n>>3,f=-1===i?3:0;for(e=0;e>>2,h.length<=s&&h.push(0),h[s]|=t[e]<<8*(f+i*(o%4));return{value:h,binLen:8*t.length+n}}function e(e,s,o){switch(s){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;if(0!=t.length%2)throw new Error("String of HEX type must be in byte increments");const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(e=0;e>>1)+f,o=h>>>2;u.length<=o;)u.push(0);u[o]|=s<<8*(c+i*(h%4))}return{value:u,binLen:4*t.length+n}}(t,r,n,o)};case"TEXT":return function(t,r,n){return function(t,r,n,i,e){let s,o,h,u,f,c,a,w,E=0;const l=n||[0],A=(i=i||0)>>>3;if("UTF8"===r)for(a=-1===e?3:0,h=0;hs?o.push(s):2048>s?(o.push(192|s>>>6),o.push(128|63&s)):55296>s||57344<=s?o.push(224|s>>>12,128|s>>>6&63,128|63&s):(h+=1,s=65536+((1023&s)<<10|1023&t.charCodeAt(h)),o.push(240|s>>>18,128|s>>>12&63,128|s>>>6&63,128|63&s)),u=0;u>>2;l.length<=f;)l.push(0);l[f]|=o[u]<<8*(a+e*(c%4)),E+=1}else for(a=-1===e?2:0,w="UTF16LE"===r&&1!==e||"UTF16LE"!==r&&1===e,h=0;h>>8),c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=s<<8*(a+e*(c%4)),E+=2}return{value:l,binLen:8*E+i}}(t,s,r,n,o)};case"B64":return function(r,n,i){return function(r,n,i,e){let s,o,h,u,f,c,a,w=0;const E=n||[0],l=(i=i||0)>>>3,A=-1===e?3:0,p=r.indexOf("=");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(r=r.replace(/=/g,""),-1!==p&&p>>2;E.length<=c;)E.push(0);E[c]|=(u>>>16-8*h&255)<<8*(A+e*(a%4)),w+=1}}return{value:E,binLen:8*w+i}}(r,n,i,o)};case"BYTES":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(s=0;s>>2,u.length<=o&&u.push(0),u[o]|=e<<8*(c+i*(h%4));return{value:u,binLen:8*t.length+n}}(t,r,n,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t,r,n){return function(t,r,n,e){return i(new Uint8Array(t),r,n,e)}(t,r,n,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t,r,n){return i(t,r,n,o)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function s(i,e,s,o){switch(i){case"HEX":return function(t){return function(t,r,n,i){const e="0123456789abcdef";let s,o,h="";const u=r/8,f=-1===n?3:0;for(s=0;s>>2]>>>8*(f+n*(s%4)),h+=e.charAt(o>>>4&15)+e.charAt(15&o);return i.outputUpper?h.toUpperCase():h}(t,e,s,o)};case"B64":return function(r){return function(r,n,i,e){let s,o,h,u,f,c="";const a=n/8,w=-1===i?3:0;for(s=0;s>>2]:0,f=s+2>>2]:0,h=(r[s>>>2]>>>8*(w+i*(s%4))&255)<<16|(u>>>8*(w+i*((s+1)%4))&255)<<8|f>>>8*(w+i*((s+2)%4))&255,o=0;o<4;o+=1)c+=8*s+6*o<=n?t.charAt(h>>>6*(3-o)&63):e.b64Pad;return c}(r,e,s,o)};case"BYTES":return function(t){return function(t,r,n){let i,e,s="";const o=r/8,h=-1===n?3:0;for(i=0;i>>2]>>>8*(h+n*(i%4))&255,s+=String.fromCharCode(e);return s}(t,e,s)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t){return function(t,r,n){let i;const e=r/8,s=new ArrayBuffer(e),o=new Uint8Array(s),h=-1===n?3:0;for(i=0;i>>2]>>>8*(h+n*(i%4))&255;return s}(t,e,s)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t){return function(t,r,n){let i;const e=r/8,s=-1===n?3:0,o=new Uint8Array(e);for(i=0;i>>2]>>>8*(s+n*(i%4))&255;return o}(t,e,s)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}const o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],u=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function f(t){const r={outputUpper:!1,b64Pad:"=",outputLen:-1},n=t||{},i="Output length must be a multiple of 8";if(r.outputUpper=n.outputUpper||!1,n.b64Pad&&(r.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(i);r.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(i);r.outputLen=n.shakeLen}if("boolean"!=typeof r.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof r.b64Pad)throw new Error("Invalid b64Pad formatting option");return r}class c{constructor(t,r,n){const i=n||{};if(this.t=r,this.i=i.encoding||"UTF8",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(t){let r,n=0;const i=this.T>>>5,e=this.F(t,this.h,this.u),s=e.binLen,o=e.value,h=s>>>5;for(r=0;r>>5),this.u=s%this.T,this.l=!0,this}getHash(t,r){let n,i,e=this.B;const o=f(r);if(this.v){if(-1===o.outputLen)throw new Error("Output length must be specified in options");e=o.outputLen}const h=s(t,e,this.C,o);if(this.p&&this.Y)return h(this.Y(o));for(i=this.S(this.h.slice(),this.u,this.A,this.I(this.m),e),n=1;n>>24-e%32),i=this.S(i,e,0,this.L(this.o),e);return h(i)}setHMACKey(t,r,n){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const i=e(r,(n||{}).encoding||"UTF8",this.C);this.N(i(t))}N(t){const r=this.T>>>3,n=r/4-1;let i;if(1!==this.numRounds)throw new Error("Cannot set numRounds with MAC");if(this.p)throw new Error("MAC key already set");for(r>>r|t<<32-r}function w(t,r){return t>>>r}function E(t,r,n){return t&r^~t&n}function l(t,r,n){return t&r^t&n^r&n}function A(t){return a(t,2)^a(t,13)^a(t,22)}function p(t,r){const n=(65535&t)+(65535&r);return(65535&(t>>>16)+(r>>>16)+(n>>>16))<<16|65535&n}function U(t,r,n,i){const e=(65535&t)+(65535&r)+(65535&n)+(65535&i);return(65535&(t>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(e>>>16))<<16|65535&e}function d(t,r,n,i,e){const s=(65535&t)+(65535&r)+(65535&n)+(65535&i)+(65535&e);return(65535&(t>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(e>>>16)+(s>>>16))<<16|65535&s}function R(t){return a(t,17)^a(t,19)^w(t,10)}function y(t){return a(t,7)^a(t,18)^w(t,3)}function T(t){return a(t,6)^a(t,11)^a(t,25)}function F(t){let r;return r="SHA-224"==t?h.slice():u.slice(),r}function b(t,r){let n,i,e,s,h,u,f,c,a,w,F;const b=[];for(n=r[0],i=r[1],e=r[2],s=r[3],h=r[4],u=r[5],f=r[6],c=r[7],F=0;F<64;F+=1)b[F]=F<16?t[F]:U(R(b[F-2]),b[F-7],y(b[F-15]),b[F-16]),a=d(c,T(h),E(h,u,f),o[F],b[F]),w=p(A(n),l(n,i,e)),c=f,f=u,u=h,h=p(s,a),s=e,e=i,i=n,n=p(a,w);return r[0]=p(n,r[0]),r[1]=p(i,r[1]),r[2]=p(e,r[2]),r[3]=p(s,r[3]),r[4]=p(h,r[4]),r[5]=p(u,r[5]),r[6]=p(f,r[6]),r[7]=p(c,r[7]),r}class m extends c{constructor(t,r,n){if("SHA-224"!==t&&"SHA-256"!==t)throw new Error("Chosen SHA variant is not supported");super(t,r,n);const i=n||{};this.Y=this.X,this.M=!0,this.C=-1,this.F=e(this.t,this.i,this.C),this.H=b,this.I=function(t){return t.slice()},this.L=F,this.S=function(r,n,i,e){return function(t,r,n,i,e){let s,o;const h=15+(r+65>>>9<<4),u=r+n;for(;t.length<=h;)t.push(0);for(t[r>>>5]|=128<<24-r%32,t[h]=4294967295&u,t[h-1]=u/4294967296|0,s=0;s>>3,a=-1===e?3:0;for(i=0;i>>2,u.length<=o&&u.push(0),u[o]|=r[i]<<8*(a+e*(s%4));return{value:u,binLen:8*r.length+n}}function o(r,o,s){switch(o){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(r,t,n){return function(r,t,n,e){var i,o,s,u;if(0!=r.length%2)throw new Error("String of HEX type must be in byte increments");var f=t||[0],a=(n=n||0)>>>3,h=-1===e?3:0;for(i=0;i>>1)+a)>>>2;f.length<=s;)f.push(0);f[s]|=o<<8*(h+e*(u%4))}return{value:f,binLen:4*r.length+n}}(r,t,n,s)};case"TEXT":return function(r,t,n){return function(r,t,n,e,i){var o,s,u,f,a,h,c,w,v=0,l=n||[0],E=(e=e||0)>>>3;if("UTF8"===t)for(c=-1===i?3:0,u=0;u(o=r.charCodeAt(u))?s.push(o):2048>o?(s.push(192|o>>>6),s.push(128|63&o)):55296>o||57344<=o?s.push(224|o>>>12,128|o>>>6&63,128|63&o):(u+=1,o=65536+((1023&o)<<10|1023&r.charCodeAt(u)),s.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),f=0;f>>2;l.length<=a;)l.push(0);l[a]|=s[f]<<8*(c+i*(h%4)),v+=1}else for(c=-1===i?2:0,w="UTF16LE"===t&&1!==i||"UTF16LE"!==t&&1===i,u=0;u>>8),a=(h=v+E)>>>2;l.length<=a;)l.push(0);l[a]|=o<<8*(c+i*(h%4)),v+=2}return{value:l,binLen:8*v+e}}(r,o,t,n,s)};case"B64":return function(r,n,e){return function(r,n,e,i){var o,s,u,f,a,h,c=0,w=n||[0],v=(e=e||0)>>>3,l=-1===i?3:0,E=r.indexOf("=");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(r=r.replace(/=/g,""),-1!==E&&E>>2;w.length<=a;)w.push(0);w[a]|=(s>>>16-8*u&255)<<8*(l+i*(h%4)),c+=1}}return{value:w,binLen:8*c+e}}(r,n,e,u)};case"BYTES":return function(r,t,n){return function(r,t,n,e){var i,o,u,s,f=t||[0],a=(n=n||0)>>>3,h=-1===e?3:0;for(o=0;o>>2,f.length<=u&&f.push(0),f[u]|=i<<8*(h+e*(s%4));return{value:f,binLen:8*r.length+n}}(r,t,n,u)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(r){throw new Error(n)}return function(r,t,n){return function(r,t,n,e){return i(new Uint8Array(r),t,n,e)}(r,t,n,u)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(r){throw new Error(e)}return function(r,t,n){return i(r,t,n,u)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function u(r,i,o,u){switch(r){case"HEX":return function(r){return function(r,t,n,e){var i,o,u="0123456789abcdef",s="",f=t/8,a=-1===n?3:0;for(i=0;i>>2]>>>8*(a+n*(i%4)),s+=u.charAt(o>>>4&15)+u.charAt(15&o);return e.outputUpper?s.toUpperCase():s}(r,i,o,u)};case"B64":return function(r){return function(r,n,e,i){var o,u,s,f,a,h="",c=n/8,w=-1===e?3:0;for(o=0;o>>2]:0,a=o+2>>2]:0,s=(r[o>>>2]>>>8*(w+e*(o%4))&255)<<16|(f>>>8*(w+e*((o+1)%4))&255)<<8|a>>>8*(w+e*((o+2)%4))&255,u=0;u<4;u+=1)h+=8*o+6*u<=n?t.charAt(s>>>6*(3-u)&63):i.b64Pad;return h}(r,i,o,u)};case"BYTES":return function(r){return function(r,t,n){var e,i,o="",u=t/8,s=-1===n?3:0;for(e=0;e>>2]>>>8*(s+n*(e%4))&255,o+=String.fromCharCode(i);return o}(r,i,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(r){throw new Error(n)}return function(r){return function(r,t,n){var e,i=t/8,o=new ArrayBuffer(i),u=new Uint8Array(o),s=-1===n?3:0;for(e=0;e>>2]>>>8*(s+n*(e%4))&255;return o}(r,i,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(r){throw new Error(e)}return function(r){return function(r,t,n){var e,i=t/8,o=-1===n?3:0,u=new Uint8Array(i);for(e=0;e>>2]>>>8*(o+n*(e%4))&255;return u}(r,i,o)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var s=4294967296,f="Cannot set numRounds with MAC";function a(r,t){var n,e,i=r.binLen>>>3,o=t.binLen>>>3,u=i<<3,s=4-i<<3;if(i%4!=0){for(n=0;n>>2,r.value[e]|=t.value[n>>>2]<>>2]>>>s;return(r.value.length<<2)-4>=o+i&&r.value.pop(),{value:r.value,binLen:r.binLen+t.binLen}}return{value:r.value.concat(t.value),binLen:r.binLen+t.binLen}}function h(r){var t={outputUpper:!1,b64Pad:"=",outputLen:-1},n=r||{},e="Output length must be a multiple of 8";if(t.outputUpper=n.outputUpper||!1,n.b64Pad&&(t.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(e);t.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(e);t.outputLen=n.shakeLen}if("boolean"!=typeof t.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw new Error("Invalid b64Pad formatting option");return t}function c(r,t,n,e){var i=r+" must include a value and format";if(!t){if(!e)throw new Error(i);return e}if(void 0===t.value||!t.format)throw new Error(i);return o(t.format,t.encoding||"UTF8",n)(t.value)}var w=function(){function r(r,t,n){var e=n||{};if(this.t=t,this.i=e.encoding||"UTF8",this.numRounds=e.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=r,this.u=[],this.h=0,this.v=!1,this.l=0,this.A=!1,this.p=[],this.m=[]}return r.prototype.update=function(r){var t,n=0,e=this.U>>>5,i=this.R(r,this.u,this.h),o=i.binLen,u=i.value,s=o>>>5;for(t=0;t>>5),this.h=o%this.U,this.v=!0,this},r.prototype.getHash=function(r,t){var n,e,i=this.S,o=h(t);if(this.C){if(-1===o.outputLen)throw new Error("Output length must be specified in options");i=o.outputLen}var s=u(r,i,this.H,o);if(this.A&&this.L)return s(this.L(o));for(e=this.B(this.u.slice(),this.h,this.l,this.k(this.T),i),n=1;n>>24-i%32),e=this.B(e,i,0,this.Y(this.o),i);return s(e)},r.prototype.setHMACKey=function(r,t,n){if(!this.K)throw new Error("Variant does not support HMAC");if(this.v)throw new Error("Cannot set MAC key after calling update");var e=o(t,(n||{}).encoding||"UTF8",this.H);this.N(e(r))},r.prototype.N=function(r){var t,n=this.U>>>3,e=n/4-1;if(1!==this.numRounds)throw new Error(f);if(this.A)throw new Error("MAC key already set");for(n32?(n=64-t,new v(r.X<>>n,r.M<>>n)):0!==t?(n=32-t,new v(r.M<>>n,r.X<>>n)):r}function E(r,t){return new v(r.M^t.M,r.X^t.X)}function A(r,t,n,e,i){return new v(r.M^t.M^n.M^e.M^i.M,r.X^t.X^n.X^e.X^i.X)}var b=[new v(0,1),new v(0,32898),new v(2147483648,32906),new v(2147483648,2147516416),new v(0,32907),new v(0,2147483649),new v(2147483648,2147516545),new v(2147483648,32777),new v(0,138),new v(0,136),new v(0,2147516425),new v(0,2147483658),new v(0,2147516555),new v(2147483648,139),new v(2147483648,32905),new v(2147483648,32771),new v(2147483648,32770),new v(2147483648,128),new v(0,32778),new v(2147483648,2147483658),new v(2147483648,2147516545),new v(2147483648,32896),new v(0,2147483649),new v(2147483648,2147516424)],p=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]];function d(r){var t,n=[];for(t=0;t<5;t+=1)n[t]=[new v(0,0),new v(0,0),new v(0,0),new v(0,0),new v(0,0)];return n}function y(r){var t,n=[];for(t=0;t<5;t+=1)n[t]=r[t].slice();return n}function m(r,t){var n,e,i,o,u=[],s=[];if(null!==r)for(e=0;e>>1)%5][(e>>>1)/5|0]=E(t[(e>>>1)%5][(e>>>1)/5|0],new v(r[e+1],r[e]));for(n=0;n<24;n+=1){for(o=d(),e=0;e<5;e+=1)u[e]=A(t[e][0],t[e][1],t[e][2],t[e][3],t[e][4]);for(e=0;e<5;e+=1)s[e]=E(u[(e+4)%5],l(u[(e+1)%5],1));for(e=0;e<5;e+=1)for(i=0;i<5;i+=1)t[e][i]=E(t[e][i],s[e]);for(e=0;e<5;e+=1)for(i=0;i<5;i+=1)o[i][(2*e+3*i)%5]=l(t[e][i],p[e][i]);for(e=0;e<5;e+=1)for(i=0;i<5;i+=1)t[e][i]=E(o[e][i],new v(~o[(e+1)%5][i].M&o[(e+2)%5][i].M,~o[(e+1)%5][i].X&o[(e+2)%5][i].X));t[0][0]=E(t[0][0],b[n])}return t}function U(r){var t,n,e=0,i=[0,0],o=[4294967295&r,r/s&2097151];for(t=6;t>=0;t--)0===(n=o[t>>2]>>>8*t&255)&&0===e||(i[e+1>>2]|=n<<8*(e+1),e+=1);return e=0!==e?e:1,i[0]|=e,{value:e+1>4?i:[i[0]],binLen:8+8*e}}function R(r){return a(U(r.binLen),r)}function T(r,t){var n,e=U(t),i=t>>>2,o=(i-(e=a(e,r)).value.length%i)%i;for(n=0;n>>5,w=t>>>5;for(s=0;s=i;s+=c)e=m(r.slice(s,s+c),e),t-=i;for(r=r.slice(s),t%=i;r.length>>3)>>2]^=o<=u));)h.push(f.M),0==64*(a+=1)%i&&(m(null,e),a=0);return h}(r,t,0,e,s,u,i)},a.hmacKey&&i.N(c("hmacKey",a.hmacKey,i.H)),i}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(n,t),n.prototype._=function(r,t){var n=function(r){var t=r||{};return{funcName:c("funcName",t.funcName,1,{value:[],binLen:0}),customization:c("Customization",t.customization,1,{value:[],binLen:0})}}(r||{});t&&(n.funcName=t);var e=a(R(n.funcName),R(n.customization));if(0!==n.customization.binLen||0!==n.funcName.binLen){for(var i=T(e,this.U>>>3),o=0;o>>5)this.T=this.F(i.slice(o,o+(this.U>>>5)),this.T),this.l+=this.U;return 4}return 31},n.prototype.O=function(r){var t=function(r){var t=r||{};return{kmacKey:c("kmacKey",t.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:c("Customization",t.customization,1,{value:[],binLen:0})}}(r||{});this._(r,t.funcName);for(var n=T(R(t.kmacKey),this.U>>>3),e=0;e>>5)this.T=this.F(n.slice(e,e+(this.U>>>5)),this.T),this.l+=this.U;this.A=!0},n.prototype.j=function(r){var t=a({value:this.u.slice(),binLen:this.h},function(r){var t,n,e=0,i=[0,0],o=[4294967295&r,r/s&2097151];for(t=6;t>=0;t--)0==(n=o[t>>2]>>>8*t&255)&&0===e||(i[e>>2]|=n<<8*e,e+=1);return i[(e=0!==e?e:1)>>2]|=e<<8*e,{value:e+1>4?i:[i[0]],binLen:8+8*e}}(r.outputLen));return this.B(t.value,t.binLen,this.l,this.k(this.T),r.outputLen)},n}(w)}); diff --git a/dist/sha3.mjs b/dist/sha3.mjs index 6b2b704..93dcde1 100644 --- a/dist/sha3.mjs +++ b/dist/sha3.mjs @@ -2,8 +2,8 @@ * A JavaScript implementation of the SHA family of hashes - defined in FIPS PUB 180-4, FIPS PUB 202, * and SP 800-185 - as well as the corresponding HMAC implementation as defined in FIPS PUB 198-1. * - * Copyright 2008-2023 Brian Turek, 1998-2009 Paul Johnston & Contributors + * Copyright 2008-2024 Brian Turek, 1998-2009 Paul Johnston & Contributors * Distributed under the BSD License * See http://caligatio.github.com/jsSHA/ for more information */ -const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="ARRAYBUFFER not supported by this environment",r="UINT8ARRAY not supported by this environment";function i(t,n,r,i){let s,e,o;const h=n||[0],u=(r=r||0)>>>3,c=-1===i?3:0;for(s=0;s>>2,h.length<=e&&h.push(0),h[e]|=t[s]<<8*(c+i*(o%4));return{value:h,binLen:8*t.length+r}}function s(s,e,o){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(s){case"HEX":return function(t,n,r){return function(t,n,r,i){let s,e,o,h;if(0!=t.length%2)throw new Error("String of HEX type must be in byte increments");const u=n||[0],c=(r=r||0)>>>3,f=-1===i?3:0;for(s=0;s>>1)+c,o=h>>>2;u.length<=o;)u.push(0);u[o]|=e<<8*(f+i*(h%4))}return{value:u,binLen:4*t.length+r}}(t,n,r,o)};case"TEXT":return function(t,n,r){return function(t,n,r,i,s){let e,o,h,u,c,f,a,w,l=0;const E=r||[0],A=(i=i||0)>>>3;if("UTF8"===n)for(a=-1===s?3:0,h=0;he?o.push(e):2048>e?(o.push(192|e>>>6),o.push(128|63&e)):55296>e||57344<=e?o.push(224|e>>>12,128|e>>>6&63,128|63&e):(h+=1,e=65536+((1023&e)<<10|1023&t.charCodeAt(h)),o.push(240|e>>>18,128|e>>>12&63,128|e>>>6&63,128|63&e)),u=0;u>>2;E.length<=c;)E.push(0);E[c]|=o[u]<<8*(a+s*(f%4)),l+=1}else for(a=-1===s?2:0,w="UTF16LE"===n&&1!==s||"UTF16LE"!==n&&1===s,h=0;h>>8),f=l+A,c=f>>>2;E.length<=c;)E.push(0);E[c]|=e<<8*(a+s*(f%4)),l+=2}return{value:E,binLen:8*l+i}}(t,e,n,r,o)};case"B64":return function(n,r,i){return function(n,r,i,s){let e,o,h,u,c,f,a,w=0;const l=r||[0],E=(i=i||0)>>>3,A=-1===s?3:0,b=n.indexOf("=");if(-1===n.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(n=n.replace(/=/g,""),-1!==b&&b>>2;l.length<=f;)l.push(0);l[f]|=(u>>>16-8*h&255)<<8*(A+s*(a%4)),w+=1}}return{value:l,binLen:8*w+i}}(n,r,i,o)};case"BYTES":return function(t,n,r){return function(t,n,r,i){let s,e,o,h;const u=n||[0],c=(r=r||0)>>>3,f=-1===i?3:0;for(e=0;e>>2,u.length<=o&&u.push(0),u[o]|=s<<8*(f+i*(h%4));return{value:u,binLen:8*t.length+r}}(t,n,r,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(n)}return function(t,n,r){return function(t,n,r,s){return i(new Uint8Array(t),n,r,s)}(t,n,r,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(r)}return function(t,n,r){return i(t,n,r,o)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function e(i,s,e,o){switch(i){case"HEX":return function(t){return function(t,n,r,i){const s="0123456789abcdef";let e,o,h="";const u=n/8,c=-1===r?3:0;for(e=0;e>>2]>>>8*(c+r*(e%4)),h+=s.charAt(o>>>4&15)+s.charAt(15&o);return i.outputUpper?h.toUpperCase():h}(t,s,e,o)};case"B64":return function(n){return function(n,r,i,s){let e,o,h,u,c,f="";const a=r/8,w=-1===i?3:0;for(e=0;e>>2]:0,c=e+2>>2]:0,h=(n[e>>>2]>>>8*(w+i*(e%4))&255)<<16|(u>>>8*(w+i*((e+1)%4))&255)<<8|c>>>8*(w+i*((e+2)%4))&255,o=0;o<4;o+=1)f+=8*e+6*o<=r?t.charAt(h>>>6*(3-o)&63):s.b64Pad;return f}(n,s,e,o)};case"BYTES":return function(t){return function(t,n,r){let i,s,e="";const o=n/8,h=-1===r?3:0;for(i=0;i>>2]>>>8*(h+r*(i%4))&255,e+=String.fromCharCode(s);return e}(t,s,e)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(n)}return function(t){return function(t,n,r){let i;const s=n/8,e=new ArrayBuffer(s),o=new Uint8Array(e),h=-1===r?3:0;for(i=0;i>>2]>>>8*(h+r*(i%4))&255;return e}(t,s,e)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(r)}return function(t){return function(t,n,r){let i;const s=n/8,e=-1===r?3:0,o=new Uint8Array(s);for(i=0;i>>2]>>>8*(e+r*(i%4))&255;return o}(t,s,e)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}const o=4294967296,h="Cannot set numRounds with MAC";function u(t,n){let r,i;const s=t.binLen>>>3,e=n.binLen>>>3,o=s<<3,h=4-s<<3;if(s%4!=0){for(r=0;r>>2,t.value[i]|=n.value[r>>>2]<>>2]>>>h;return(t.value.length<<2)-4>=e+s&&t.value.pop(),{value:t.value,binLen:t.binLen+n.binLen}}return{value:t.value.concat(n.value),binLen:t.binLen+n.binLen}}function c(t){const n={outputUpper:!1,b64Pad:"=",outputLen:-1},r=t||{},i="Output length must be a multiple of 8";if(n.outputUpper=r.outputUpper||!1,r.b64Pad&&(n.b64Pad=r.b64Pad),r.outputLen){if(r.outputLen%8!=0)throw new Error(i);n.outputLen=r.outputLen}else if(r.shakeLen){if(r.shakeLen%8!=0)throw new Error(i);n.outputLen=r.shakeLen}if("boolean"!=typeof n.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof n.b64Pad)throw new Error("Invalid b64Pad formatting option");return n}function f(t,n,r,i){const e=t+" must include a value and format";if(!n){if(!i)throw new Error(e);return i}if(void 0===n.value||!n.format)throw new Error(e);return s(n.format,n.encoding||"UTF8",r)(n.value)}class a{constructor(t,n,r){const i=r||{};if(this.t=n,this.i=i.encoding||"UTF8",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.m=[],this.U=[]}update(t){let n,r=0;const i=this.R>>>5,s=this.C(t,this.h,this.u),e=s.binLen,o=s.value,h=e>>>5;for(n=0;n>>5),this.u=e%this.R,this.l=!0,this}getHash(t,n){let r,i,s=this.T;const o=c(n);if(this.F){if(-1===o.outputLen)throw new Error("Output length must be specified in options");s=o.outputLen}const h=e(t,s,this.S,o);if(this.p&&this.L)return h(this.L(o));for(i=this.B(this.h.slice(),this.u,this.A,this.K(this.H),s),r=1;r>>24-s%32),i=this.B(i,s,0,this.k(this.o),s);return h(i)}setHMACKey(t,n,r){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const i=s(n,(r||{}).encoding||"UTF8",this.S);this.Y(i(t))}Y(t){const n=this.R>>>3,r=n/4-1;let i;if(1!==this.numRounds)throw new Error(h);if(this.p)throw new Error("MAC key already set");for(n32?(r=64-n,new w(t.X<>>r,t.I<>>r)):0!==n?(r=32-n,new w(t.I<>>r,t.X<>>r)):t}function E(t,n){return new w(t.I^n.I,t.X^n.X)}function A(t,n,r,i,s){return new w(t.I^n.I^r.I^i.I^s.I,t.X^n.X^r.X^i.X^s.X)}const b=[new w(0,1),new w(0,32898),new w(2147483648,32906),new w(2147483648,2147516416),new w(0,32907),new w(0,2147483649),new w(2147483648,2147516545),new w(2147483648,32777),new w(0,138),new w(0,136),new w(0,2147516425),new w(0,2147483658),new w(0,2147516555),new w(2147483648,139),new w(2147483648,32905),new w(2147483648,32771),new w(2147483648,32770),new w(2147483648,128),new w(0,32778),new w(2147483648,2147483658),new w(2147483648,2147516545),new w(2147483648,32896),new w(0,2147483649),new w(2147483648,2147516424)],p=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]];function d(t){let n;const r=[];for(n=0;n<5;n+=1)r[n]=[new w(0,0),new w(0,0),new w(0,0),new w(0,0),new w(0,0)];return r}function m(t){let n;const r=[];for(n=0;n<5;n+=1)r[n]=t[n].slice();return r}function U(t,n){let r,i,s,e;const o=[],h=[];if(null!==t)for(i=0;i>>1)%5][(i>>>1)/5|0]=E(n[(i>>>1)%5][(i>>>1)/5|0],new w(t[i+1],t[i]));for(r=0;r<24;r+=1){for(e=d(),i=0;i<5;i+=1)o[i]=A(n[i][0],n[i][1],n[i][2],n[i][3],n[i][4]);for(i=0;i<5;i+=1)h[i]=E(o[(i+4)%5],l(o[(i+1)%5],1));for(i=0;i<5;i+=1)for(s=0;s<5;s+=1)n[i][s]=E(n[i][s],h[i]);for(i=0;i<5;i+=1)for(s=0;s<5;s+=1)e[s][(2*i+3*s)%5]=l(n[i][s],p[i][s]);for(i=0;i<5;i+=1)for(s=0;s<5;s+=1)n[i][s]=E(e[i][s],new w(~e[(i+1)%5][s].I&e[(i+2)%5][s].I,~e[(i+1)%5][s].X&e[(i+2)%5][s].X));n[0][0]=E(n[0][0],b[r])}return n}function y(t){let n,r,i=0;const s=[0,0],e=[4294967295&t,t/o&2097151];for(n=6;n>=0;n--)r=e[n>>2]>>>8*n&255,0===r&&0===i||(s[i+1>>2]|=r<<8*(i+1),i+=1);return i=0!==i?i:1,s[0]|=i,{value:i+1>4?s:[s[0]],binLen:8+8*i}}function R(t){return u(y(t.binLen),t)}function C(t,n){let r,i=y(n);i=u(i,t);const s=n>>>2,e=(s-i.value.length%s)%s;for(r=0;r>>5,w=n>>>5;for(h=0;h=s;h+=a)i=U(t.slice(h,h+a),i),n-=s;for(t=t.slice(h),n%=s;t.length>>3,t[h>>2]^=e<=o));)f.push(u.I),c+=1,0==64*c%s&&(U(null,i),c=0);return f}(t,n,0,s,e,i,o)},o.hmacKey&&this.Y(f("hmacKey",o.hmacKey,this.S))}P(t,n){const r=function(t){const n=t||{};return{funcName:f("funcName",n.funcName,1,{value:[],binLen:0}),customization:f("Customization",n.customization,1,{value:[],binLen:0})}}(t||{});n&&(r.funcName=n);const i=u(R(r.funcName),R(r.customization));if(0!==r.customization.binLen||0!==r.funcName.binLen){const t=C(i,this.R>>>3);for(let n=0;n>>5)this.H=this.v(t.slice(n,n+(this.R>>>5)),this.H),this.A+=this.R;return 4}return 31}_(t){const n=function(t){const n=t||{};return{kmacKey:f("kmacKey",n.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:f("Customization",n.customization,1,{value:[],binLen:0})}}(t||{});this.P(t,n.funcName);const r=C(R(n.kmacKey),this.R>>>3);for(let t=0;t>>5)this.H=this.v(r.slice(t,t+(this.R>>>5)),this.H),this.A+=this.R;this.p=!0}O(t){const n=u({value:this.h.slice(),binLen:this.u},function(t){let n,r,i=0;const s=[0,0],e=[4294967295&t,t/o&2097151];for(n=6;n>=0;n--)r=e[n>>2]>>>8*n&255,0===r&&0===i||(s[i>>2]|=r<<8*i,i+=1);return i=0!==i?i:1,s[i>>2]|=i<<8*i,{value:i+1>4?s:[s[0]],binLen:8+8*i}}(t.outputLen));return this.B(n.value,n.binLen,this.A,this.K(this.H),t.outputLen)}}export{H as default}; diff --git a/dist/sha512.js b/dist/sha512.js index 0cdb85b..8078733 100644 --- a/dist/sha512.js +++ b/dist/sha512.js @@ -2,7 +2,7 @@ * A JavaScript implementation of the SHA family of hashes - defined in FIPS PUB 180-4, FIPS PUB 202, * and SP 800-185 - as well as the corresponding HMAC implementation as defined in FIPS PUB 198-1. * - * Copyright 2008-2023 Brian Turek, 1998-2009 Paul Johnston & Contributors + * Copyright 2008-2024 Brian Turek, 1998-2009 Paul Johnston & Contributors * Distributed under the BSD License * See http://caligatio.github.com/jsSHA/ for more information * @@ -14,8 +14,8 @@ * * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, * INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - * MERCHANTABLITY OR NON-INFRINGEMENT. + * MERCHANTABILITY OR NON-INFRINGEMENT. * * See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. */ -!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).jsSHA=r()}(this,(function(){"use strict";var n=function(r,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])},n(r,t)};"function"==typeof SuppressedError&&SuppressedError;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="ARRAYBUFFER not supported by this environment",e="UINT8ARRAY not supported by this environment";function i(n,r,t,e){var i,o,u,w=r||[0],s=(t=t||0)>>>3,f=-1===e?3:0;for(i=0;i>>2,w.length<=o&&w.push(0),w[o]|=n[i]<<8*(f+e*(u%4));return{value:w,binLen:8*n.length+t}}function o(n,o,u){switch(o){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(n){case"HEX":return function(n,r,t){return function(n,r,t,e){var i,o,u,w;if(0!=n.length%2)throw new Error("String of HEX type must be in byte increments");var s=r||[0],f=(t=t||0)>>>3,h=-1===e?3:0;for(i=0;i>>1)+f)>>>2;s.length<=u;)s.push(0);s[u]|=o<<8*(h+e*(w%4))}return{value:s,binLen:4*n.length+t}}(n,r,t,u)};case"TEXT":return function(n,r,t){return function(n,r,t,e,i){var o,u,w,s,f,h,a,c,v=0,E=t||[0],l=(e=e||0)>>>3;if("UTF8"===r)for(a=-1===i?3:0,w=0;w(o=n.charCodeAt(w))?u.push(o):2048>o?(u.push(192|o>>>6),u.push(128|63&o)):55296>o||57344<=o?u.push(224|o>>>12,128|o>>>6&63,128|63&o):(w+=1,o=65536+((1023&o)<<10|1023&n.charCodeAt(w)),u.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),s=0;s>>2;E.length<=f;)E.push(0);E[f]|=u[s]<<8*(a+i*(h%4)),v+=1}else for(a=-1===i?2:0,c="UTF16LE"===r&&1!==i||"UTF16LE"!==r&&1===i,w=0;w>>8),f=(h=v+l)>>>2;E.length<=f;)E.push(0);E[f]|=o<<8*(a+i*(h%4)),v+=2}return{value:E,binLen:8*v+e}}(n,o,r,t,u)};case"B64":return function(n,t,e){return function(n,t,e,i){var o,u,w,s,f,h,a=0,c=t||[0],v=(e=e||0)>>>3,E=-1===i?3:0,l=n.indexOf("=");if(-1===n.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(n=n.replace(/=/g,""),-1!==l&&l>>2;c.length<=f;)c.push(0);c[f]|=(w>>>16-8*u&255)<<8*(E+i*(h%4)),a+=1}}return{value:c,binLen:8*a+e}}(n,t,e,u)};case"BYTES":return function(n,r,t){return function(n,r,t,e){var i,o,u,w,s=r||[0],f=(t=t||0)>>>3,h=-1===e?3:0;for(o=0;o>>2,s.length<=u&&s.push(0),s[u]|=i<<8*(h+e*(w%4));return{value:s,binLen:8*n.length+t}}(n,r,t,u)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(n){throw new Error(t)}return function(n,r,t){return function(n,r,t,e){return i(new Uint8Array(n),r,t,e)}(n,r,t,u)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(n){throw new Error(e)}return function(n,r,t){return i(n,r,t,u)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function u(n,i,o,u){switch(n){case"HEX":return function(n){return function(n,r,t,e){var i,o,u="0123456789abcdef",w="",s=r/8,f=-1===t?3:0;for(i=0;i>>2]>>>8*(f+t*(i%4)),w+=u.charAt(o>>>4&15)+u.charAt(15&o);return e.outputUpper?w.toUpperCase():w}(n,i,o,u)};case"B64":return function(n){return function(n,t,e,i){var o,u,w,s,f,h="",a=t/8,c=-1===e?3:0;for(o=0;o>>2]:0,f=o+2>>2]:0,w=(n[o>>>2]>>>8*(c+e*(o%4))&255)<<16|(s>>>8*(c+e*((o+1)%4))&255)<<8|f>>>8*(c+e*((o+2)%4))&255,u=0;u<4;u+=1)h+=8*o+6*u<=t?r.charAt(w>>>6*(3-u)&63):i.b64Pad;return h}(n,i,o,u)};case"BYTES":return function(n){return function(n,r,t){var e,i,o="",u=r/8,w=-1===t?3:0;for(e=0;e>>2]>>>8*(w+t*(e%4))&255,o+=String.fromCharCode(i);return o}(n,i,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(n){throw new Error(t)}return function(n){return function(n,r,t){var e,i=r/8,o=new ArrayBuffer(i),u=new Uint8Array(o),w=-1===t?3:0;for(e=0;e>>2]>>>8*(w+t*(e%4))&255;return o}(n,i,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(n){throw new Error(e)}return function(n){return function(n,r,t){var e,i=r/8,o=-1===t?3:0,u=new Uint8Array(i);for(e=0;e>>2]>>>8*(o+t*(e%4))&255;return u}(n,i,o)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],f=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function h(n){var r={outputUpper:!1,b64Pad:"=",outputLen:-1},t=n||{},e="Output length must be a multiple of 8";if(r.outputUpper=t.outputUpper||!1,t.b64Pad&&(r.b64Pad=t.b64Pad),t.outputLen){if(t.outputLen%8!=0)throw new Error(e);r.outputLen=t.outputLen}else if(t.shakeLen){if(t.shakeLen%8!=0)throw new Error(e);r.outputLen=t.shakeLen}if("boolean"!=typeof r.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof r.b64Pad)throw new Error("Invalid b64Pad formatting option");return r}var a=function(){function n(n,r,t){var e=t||{};if(this.t=r,this.i=e.encoding||"UTF8",this.numRounds=e.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=n,this.u=[],this.h=0,this.v=!1,this.l=0,this.p=!1,this.A=[],this.U=[]}return n.prototype.update=function(n){var r,t=0,e=this.T>>>5,i=this.R(n,this.u,this.h),o=i.binLen,u=i.value,w=o>>>5;for(r=0;r>>5),this.h=o%this.T,this.v=!0,this},n.prototype.getHash=function(n,r){var t,e,i=this.B,o=h(r);if(this.S){if(-1===o.outputLen)throw new Error("Output length must be specified in options");i=o.outputLen}var w=u(n,i,this.H,o);if(this.p&&this.Y)return w(this.Y(o));for(e=this.C(this.u.slice(),this.h,this.l,this.I(this.m),i),t=1;t>>24-i%32),e=this.C(e,i,0,this.L(this.o),i);return w(e)},n.prototype.setHMACKey=function(n,r,t){if(!this.N)throw new Error("Variant does not support HMAC");if(this.v)throw new Error("Cannot set MAC key after calling update");var e=o(r,(t||{}).encoding||"UTF8",this.H);this.X(e(n))},n.prototype.X=function(n){var r,t=this.T>>>3,e=t/4-1;if(1!==this.numRounds)throw new Error("Cannot set numRounds with MAC");if(this.p)throw new Error("MAC key already set");for(t>>r|n.j<>>r|n.O<>>r|n.O<>>r|n.j<>>r,n.j>>>r|n.O<<32-r)}function l(n,r,t){return new c(n.O&r.O^~n.O&t.O,n.j&r.j^~n.j&t.j)}function p(n,r,t){return new c(n.O&r.O^n.O&t.O^r.O&t.O,n.j&r.j^n.j&t.j^r.j&t.j)}function A(n){var r=v(n,28),t=v(n,34),e=v(n,39);return new c(r.O^t.O^e.O,r.j^t.j^e.j)}function d(n,r){var t,e;t=(65535&n.j)+(65535&r.j);var i=(65535&(e=(n.j>>>16)+(r.j>>>16)+(t>>>16)))<<16|65535&t;return t=(65535&n.O)+(65535&r.O)+(e>>>16),e=(n.O>>>16)+(r.O>>>16)+(t>>>16),new c((65535&e)<<16|65535&t,i)}function y(n,r,t,e){var i,o;i=(65535&n.j)+(65535&r.j)+(65535&t.j)+(65535&e.j);var u=(65535&(o=(n.j>>>16)+(r.j>>>16)+(t.j>>>16)+(e.j>>>16)+(i>>>16)))<<16|65535&i;return i=(65535&n.O)+(65535&r.O)+(65535&t.O)+(65535&e.O)+(o>>>16),o=(n.O>>>16)+(r.O>>>16)+(t.O>>>16)+(e.O>>>16)+(i>>>16),new c((65535&o)<<16|65535&i,u)}function U(n,r,t,e,i){var o,u;o=(65535&n.j)+(65535&r.j)+(65535&t.j)+(65535&e.j)+(65535&i.j);var w=(65535&(u=(n.j>>>16)+(r.j>>>16)+(t.j>>>16)+(e.j>>>16)+(i.j>>>16)+(o>>>16)))<<16|65535&o;return o=(65535&n.O)+(65535&r.O)+(65535&t.O)+(65535&e.O)+(65535&i.O)+(u>>>16),u=(n.O>>>16)+(r.O>>>16)+(t.O>>>16)+(e.O>>>16)+(i.O>>>16)+(o>>>16),new c((65535&u)<<16|65535&o,w)}function T(n){var r=v(n,19),t=v(n,61),e=E(n,6);return new c(r.O^t.O^e.O,r.j^t.j^e.j)}function b(n){var r=v(n,1),t=v(n,8),e=E(n,7);return new c(r.O^t.O^e.O,r.j^t.j^e.j)}function R(n){var r=v(n,14),t=v(n,18),e=v(n,41);return new c(r.O^t.O^e.O,r.j^t.j^e.j)}var m=[new c(w[0],3609767458),new c(w[1],602891725),new c(w[2],3964484399),new c(w[3],2173295548),new c(w[4],4081628472),new c(w[5],3053834265),new c(w[6],2937671579),new c(w[7],3664609560),new c(w[8],2734883394),new c(w[9],1164996542),new c(w[10],1323610764),new c(w[11],3590304994),new c(w[12],4068182383),new c(w[13],991336113),new c(w[14],633803317),new c(w[15],3479774868),new c(w[16],2666613458),new c(w[17],944711139),new c(w[18],2341262773),new c(w[19],2007800933),new c(w[20],1495990901),new c(w[21],1856431235),new c(w[22],3175218132),new c(w[23],2198950837),new c(w[24],3999719339),new c(w[25],766784016),new c(w[26],2566594879),new c(w[27],3203337956),new c(w[28],1034457026),new c(w[29],2466948901),new c(w[30],3758326383),new c(w[31],168717936),new c(w[32],1188179964),new c(w[33],1546045734),new c(w[34],1522805485),new c(w[35],2643833823),new c(w[36],2343527390),new c(w[37],1014477480),new c(w[38],1206759142),new c(w[39],344077627),new c(w[40],1290863460),new c(w[41],3158454273),new c(w[42],3505952657),new c(w[43],106217008),new c(w[44],3606008344),new c(w[45],1432725776),new c(w[46],1467031594),new c(w[47],851169720),new c(w[48],3100823752),new c(w[49],1363258195),new c(w[50],3750685593),new c(w[51],3785050280),new c(w[52],3318307427),new c(w[53],3812723403),new c(w[54],2003034995),new c(w[55],3602036899),new c(w[56],1575990012),new c(w[57],1125592928),new c(w[58],2716904306),new c(w[59],442776044),new c(w[60],593698344),new c(w[61],3733110249),new c(w[62],2999351573),new c(w[63],3815920427),new c(3391569614,3928383900),new c(3515267271,566280711),new c(3940187606,3454069534),new c(4118630271,4000239992),new c(116418474,1914138554),new c(174292421,2731055270),new c(289380356,3203993006),new c(460393269,320620315),new c(685471733,587496836),new c(852142971,1086792851),new c(1017036298,365543100),new c(1126000580,2618297676),new c(1288033470,3409855158),new c(1501505948,4234509866),new c(1607167915,987167468),new c(1816402316,1246189591)];function F(n){return"SHA-384"===n?[new c(3418070365,s[0]),new c(1654270250,s[1]),new c(2438529370,s[2]),new c(355462360,s[3]),new c(1731405415,s[4]),new c(41048885895,s[5]),new c(3675008525,s[6]),new c(1203062813,s[7])]:[new c(f[0],4089235720),new c(f[1],2227873595),new c(f[2],4271175723),new c(f[3],1595750129),new c(f[4],2917565137),new c(f[5],725511199),new c(f[6],4215389547),new c(f[7],327033209)]}function g(n,r){var t,e,i,o,u,w,s,f,h,a,v,E,F=[];for(t=r[0],e=r[1],i=r[2],o=r[3],u=r[4],w=r[5],s=r[6],f=r[7],v=0;v<80;v+=1)v<16?(E=2*v,F[v]=new c(n[E],n[E+1])):F[v]=y(T(F[v-2]),F[v-7],b(F[v-15]),F[v-16]),h=U(f,R(u),l(u,w,s),m[v],F[v]),a=d(A(t),p(t,e,i)),f=s,s=w,w=u,u=d(o,h),o=i,i=e,e=t,t=d(h,a);return r[0]=d(t,r[0]),r[1]=d(e,r[1]),r[2]=d(i,r[2]),r[3]=d(o,r[3]),r[4]=d(u,r[4]),r[5]=d(w,r[5]),r[6]=d(s,r[6]),r[7]=d(f,r[7]),r}return function(r){function t(n,t,e){var i=this;if("SHA-384"!==n&&"SHA-512"!==n)throw new Error("Chosen SHA variant is not supported");var u=e||{};return(i=r.call(this,n,t,e)||this).Y=i.M,i.N=!0,i.H=-1,i.R=o(i.t,i.i,i.H),i.F=g,i.I=function(n){return n.slice()},i.L=F,i.C=function(r,t,e,i){return function(n,r,t,e,i){for(var o,u=31+(r+129>>>10<<5),w=r+t;n.length<=u;)n.push(0);for(n[r>>>5]|=128<<24-r%32,n[u]=4294967295&w,n[u-1]=w/4294967296|0,o=0;o>>3,u=-1===r?3:0;for(i=0;i>>2,w.length<=s&&w.push(0),w[s]|=n[i]<<8*(u+r*(o%4));return{value:w,binLen:8*n.length+e}}function i(i,s,o){switch(s){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(i){case"HEX":return function(n,t,e){return function(n,t,e,r){let i,s,o,w;if(0!=n.length%2)throw new Error("String of HEX type must be in byte increments");const h=t||[0],u=(e=e||0)>>>3,c=-1===r?3:0;for(i=0;i>>1)+u,o=w>>>2;h.length<=o;)h.push(0);h[o]|=s<<8*(c+r*(w%4))}return{value:h,binLen:4*n.length+e}}(n,t,e,o)};case"TEXT":return function(n,t,e){return function(n,t,e,r,i){let s,o,w,h,u,c,f,a,l=0;const E=e||[0],A=(r=r||0)>>>3;if("UTF8"===t)for(f=-1===i?3:0,w=0;ws?o.push(s):2048>s?(o.push(192|s>>>6),o.push(128|63&s)):55296>s||57344<=s?o.push(224|s>>>12,128|s>>>6&63,128|63&s):(w+=1,s=65536+((1023&s)<<10|1023&n.charCodeAt(w)),o.push(240|s>>>18,128|s>>>12&63,128|s>>>6&63,128|63&s)),h=0;h>>2;E.length<=u;)E.push(0);E[u]|=o[h]<<8*(f+i*(c%4)),l+=1}else for(f=-1===i?2:0,a="UTF16LE"===t&&1!==i||"UTF16LE"!==t&&1===i,w=0;w>>8),c=l+A,u=c>>>2;E.length<=u;)E.push(0);E[u]|=s<<8*(f+i*(c%4)),l+=2}return{value:E,binLen:8*l+r}}(n,s,t,e,o)};case"B64":return function(t,e,r){return function(t,e,r,i){let s,o,w,h,u,c,f,a=0;const l=e||[0],E=(r=r||0)>>>3,A=-1===i?3:0,p=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==p&&p>>2;l.length<=c;)l.push(0);l[c]|=(h>>>16-8*w&255)<<8*(A+i*(f%4)),a+=1}}return{value:l,binLen:8*a+r}}(t,e,r,o)};case"BYTES":return function(n,t,e){return function(n,t,e,r){let i,s,o,w;const h=t||[0],u=(e=e||0)>>>3,c=-1===r?3:0;for(s=0;s>>2,h.length<=o&&h.push(0),h[o]|=i<<8*(c+r*(w%4));return{value:h,binLen:8*n.length+e}}(n,t,e,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(n){throw new Error(t)}return function(n,t,e){return function(n,t,e,i){return r(new Uint8Array(n),t,e,i)}(n,t,e,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(n){throw new Error(e)}return function(n,t,e){return r(n,t,e,o)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function s(r,i,s,o){switch(r){case"HEX":return function(n){return function(n,t,e,r){const i="0123456789abcdef";let s,o,w="";const h=t/8,u=-1===e?3:0;for(s=0;s>>2]>>>8*(u+e*(s%4)),w+=i.charAt(o>>>4&15)+i.charAt(15&o);return r.outputUpper?w.toUpperCase():w}(n,i,s,o)};case"B64":return function(t){return function(t,e,r,i){let s,o,w,h,u,c="";const f=e/8,a=-1===r?3:0;for(s=0;s>>2]:0,u=s+2>>2]:0,w=(t[s>>>2]>>>8*(a+r*(s%4))&255)<<16|(h>>>8*(a+r*((s+1)%4))&255)<<8|u>>>8*(a+r*((s+2)%4))&255,o=0;o<4;o+=1)c+=8*s+6*o<=e?n.charAt(w>>>6*(3-o)&63):i.b64Pad;return c}(t,i,s,o)};case"BYTES":return function(n){return function(n,t,e){let r,i,s="";const o=t/8,w=-1===e?3:0;for(r=0;r>>2]>>>8*(w+e*(r%4))&255,s+=String.fromCharCode(i);return s}(n,i,s)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(n){throw new Error(t)}return function(n){return function(n,t,e){let r;const i=t/8,s=new ArrayBuffer(i),o=new Uint8Array(s),w=-1===e?3:0;for(r=0;r>>2]>>>8*(w+e*(r%4))&255;return s}(n,i,s)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(n){throw new Error(e)}return function(n){return function(n,t,e){let r;const i=t/8,s=-1===e?3:0,o=new Uint8Array(i);for(r=0;r>>2]>>>8*(s+e*(r%4))&255;return o}(n,i,s)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}const o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],w=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function u(n){const t={outputUpper:!1,b64Pad:"=",outputLen:-1},e=n||{},r="Output length must be a multiple of 8";if(t.outputUpper=e.outputUpper||!1,e.b64Pad&&(t.b64Pad=e.b64Pad),e.outputLen){if(e.outputLen%8!=0)throw new Error(r);t.outputLen=e.outputLen}else if(e.shakeLen){if(e.shakeLen%8!=0)throw new Error(r);t.outputLen=e.shakeLen}if("boolean"!=typeof t.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw new Error("Invalid b64Pad formatting option");return t}class c{constructor(n,t,e){const r=e||{};if(this.t=t,this.i=r.encoding||"UTF8",this.numRounds=r.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=n,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(n){let t,e=0;const r=this.T>>>5,i=this.F(n,this.h,this.u),s=i.binLen,o=i.value,w=s>>>5;for(t=0;t>>5),this.u=s%this.T,this.l=!0,this}getHash(n,t){let e,r,i=this.B;const o=u(t);if(this.v){if(-1===o.outputLen)throw new Error("Output length must be specified in options");i=o.outputLen}const w=s(n,i,this.C,o);if(this.p&&this.Y)return w(this.Y(o));for(r=this.S(this.h.slice(),this.u,this.A,this.I(this.m),i),e=1;e>>24-i%32),r=this.S(r,i,0,this.L(this.o),i);return w(r)}setHMACKey(n,t,e){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const r=i(t,(e||{}).encoding||"UTF8",this.C);this.N(r(n))}N(n){const t=this.T>>>3,e=t/4-1;let r;if(1!==this.numRounds)throw new Error("Cannot set numRounds with MAC");if(this.p)throw new Error("MAC key already set");for(t>>t|n.K<>>t|n.k<>>t|n.k<>>t|n.K<>>t,n.K>>>t|n.k<<32-t)}function E(n,t,e){return new f(n.k&t.k^~n.k&e.k,n.K&t.K^~n.K&e.K)}function A(n,t,e){return new f(n.k&t.k^n.k&e.k^t.k&e.k,n.K&t.K^n.K&e.K^t.K&e.K)}function p(n){const t=a(n,28),e=a(n,34),r=a(n,39);return new f(t.k^e.k^r.k,t.K^e.K^r.K)}function U(n,t){let e,r;e=(65535&n.K)+(65535&t.K),r=(n.K>>>16)+(t.K>>>16)+(e>>>16);const i=(65535&r)<<16|65535&e;e=(65535&n.k)+(65535&t.k)+(r>>>16),r=(n.k>>>16)+(t.k>>>16)+(e>>>16);return new f((65535&r)<<16|65535&e,i)}function d(n,t,e,r){let i,s;i=(65535&n.K)+(65535&t.K)+(65535&e.K)+(65535&r.K),s=(n.K>>>16)+(t.K>>>16)+(e.K>>>16)+(r.K>>>16)+(i>>>16);const o=(65535&s)<<16|65535&i;i=(65535&n.k)+(65535&t.k)+(65535&e.k)+(65535&r.k)+(s>>>16),s=(n.k>>>16)+(t.k>>>16)+(e.k>>>16)+(r.k>>>16)+(i>>>16);return new f((65535&s)<<16|65535&i,o)}function R(n,t,e,r,i){let s,o;s=(65535&n.K)+(65535&t.K)+(65535&e.K)+(65535&r.K)+(65535&i.K),o=(n.K>>>16)+(t.K>>>16)+(e.K>>>16)+(r.K>>>16)+(i.K>>>16)+(s>>>16);const w=(65535&o)<<16|65535&s;s=(65535&n.k)+(65535&t.k)+(65535&e.k)+(65535&r.k)+(65535&i.k)+(o>>>16),o=(n.k>>>16)+(t.k>>>16)+(e.k>>>16)+(r.k>>>16)+(i.k>>>16)+(s>>>16);return new f((65535&o)<<16|65535&s,w)}function y(n){const t=a(n,19),e=a(n,61),r=l(n,6);return new f(t.k^e.k^r.k,t.K^e.K^r.K)}function T(n){const t=a(n,1),e=a(n,8),r=l(n,7);return new f(t.k^e.k^r.k,t.K^e.K^r.K)}function F(n){const t=a(n,14),e=a(n,18),r=a(n,41);return new f(t.k^e.k^r.k,t.K^e.K^r.K)}const b=[new f(o[0],3609767458),new f(o[1],602891725),new f(o[2],3964484399),new f(o[3],2173295548),new f(o[4],4081628472),new f(o[5],3053834265),new f(o[6],2937671579),new f(o[7],3664609560),new f(o[8],2734883394),new f(o[9],1164996542),new f(o[10],1323610764),new f(o[11],3590304994),new f(o[12],4068182383),new f(o[13],991336113),new f(o[14],633803317),new f(o[15],3479774868),new f(o[16],2666613458),new f(o[17],944711139),new f(o[18],2341262773),new f(o[19],2007800933),new f(o[20],1495990901),new f(o[21],1856431235),new f(o[22],3175218132),new f(o[23],2198950837),new f(o[24],3999719339),new f(o[25],766784016),new f(o[26],2566594879),new f(o[27],3203337956),new f(o[28],1034457026),new f(o[29],2466948901),new f(o[30],3758326383),new f(o[31],168717936),new f(o[32],1188179964),new f(o[33],1546045734),new f(o[34],1522805485),new f(o[35],2643833823),new f(o[36],2343527390),new f(o[37],1014477480),new f(o[38],1206759142),new f(o[39],344077627),new f(o[40],1290863460),new f(o[41],3158454273),new f(o[42],3505952657),new f(o[43],106217008),new f(o[44],3606008344),new f(o[45],1432725776),new f(o[46],1467031594),new f(o[47],851169720),new f(o[48],3100823752),new f(o[49],1363258195),new f(o[50],3750685593),new f(o[51],3785050280),new f(o[52],3318307427),new f(o[53],3812723403),new f(o[54],2003034995),new f(o[55],3602036899),new f(o[56],1575990012),new f(o[57],1125592928),new f(o[58],2716904306),new f(o[59],442776044),new f(o[60],593698344),new f(o[61],3733110249),new f(o[62],2999351573),new f(o[63],3815920427),new f(3391569614,3928383900),new f(3515267271,566280711),new f(3940187606,3454069534),new f(4118630271,4000239992),new f(116418474,1914138554),new f(174292421,2731055270),new f(289380356,3203993006),new f(460393269,320620315),new f(685471733,587496836),new f(852142971,1086792851),new f(1017036298,365543100),new f(1126000580,2618297676),new f(1288033470,3409855158),new f(1501505948,4234509866),new f(1607167915,987167468),new f(1816402316,1246189591)];function m(n){return"SHA-384"===n?[new f(3418070365,w[0]),new f(1654270250,w[1]),new f(2438529370,w[2]),new f(355462360,w[3]),new f(1731405415,w[4]),new f(41048885895,w[5]),new f(3675008525,w[6]),new f(1203062813,w[7])]:[new f(h[0],4089235720),new f(h[1],2227873595),new f(h[2],4271175723),new f(h[3],1595750129),new f(h[4],2917565137),new f(h[5],725511199),new f(h[6],4215389547),new f(h[7],327033209)]}function g(n,t){let e,r,i,s,o,w,h,u,c,a,l,m;const g=[];for(e=t[0],r=t[1],i=t[2],s=t[3],o=t[4],w=t[5],h=t[6],u=t[7],l=0;l<80;l+=1)l<16?(m=2*l,g[l]=new f(n[m],n[m+1])):g[l]=d(y(g[l-2]),g[l-7],T(g[l-15]),g[l-16]),c=R(u,F(o),E(o,w,h),b[l],g[l]),a=U(p(e),A(e,r,i)),u=h,h=w,w=o,o=U(s,c),s=i,i=r,r=e,e=U(c,a);return t[0]=U(e,t[0]),t[1]=U(r,t[1]),t[2]=U(i,t[2]),t[3]=U(s,t[3]),t[4]=U(o,t[4]),t[5]=U(w,t[5]),t[6]=U(h,t[6]),t[7]=U(u,t[7]),t}class H extends c{constructor(n,t,e){if("SHA-384"!==n&&"SHA-512"!==n)throw new Error("Chosen SHA variant is not supported");super(n,t,e);const r=e||{};this.Y=this.X,this.M=!0,this.C=-1,this.F=i(this.t,this.i,this.C),this.H=g,this.I=function(n){return n.slice()},this.L=m,this.S=function(t,e,r,i){return function(n,t,e,r,i){let s,o;const w=31+(t+129>>>10<<5),h=t+e;for(;n.length<=w;)n.push(0);for(n[t>>>5]|=128<<24-t%32,n[w]=4294967295&h,n[w-1]=h/4294967296|0,s=0;s=0.10.0" - } - }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/compat-data": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", - "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.0.tgz", - "integrity": "sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.24.0", - "@babel/parser": "^7.24.0", - "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.0", - "@babel/types": "^7.24.0", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -190,41 +101,46 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/generator": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", - "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", - "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.23.5", - "@babel/helper-validator-option": "^7.23.5", - "browserslist": "^4.22.2", + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -237,67 +153,45 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", "dev": true, - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", - "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.22.15" + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", - "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.20" + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -306,161 +200,59 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", - "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", - "dev": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", - "dev": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", - "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.0.tgz", - "integrity": "sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==", - "dev": true, - "dependencies": { - "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.0", - "@babel/types": "^7.24.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@babel/parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", "dev": true, + "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "@babel/types": "^7.29.7" }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/parser": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", - "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", - "dev": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -469,58 +261,48 @@ } }, "node_modules/@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz", - "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0", - "debug": "^4.3.1", - "globals": "^11.1.0" + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", + "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/types": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", - "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -531,6 +313,7 @@ "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.1.90" } @@ -540,6 +323,7 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -552,91 +336,174 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, + "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, + "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^10.2.4" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.6.0.tgz", + "integrity": "sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", "dev": true, + "license": "MIT", "dependencies": { - "ajv": "^6.12.4", + "ajv": "^6.14.0", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "node_modules/@eslint/eslintrc/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "node_modules/@eslint/eslintrc/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/@eslint/eslintrc/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "argparse": "^2.0.1" + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -645,48 +512,86 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", "dev": true, + "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "node_modules/@eslint/plugin-kit": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", + "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" }, "engines": { - "node": ">=10.10.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "brace-expansion": "^1.1.7" + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" }, "engines": { - "node": "*" + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" } }, "node_modules/@humanwhocodes/module-importer": { @@ -694,6 +599,7 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=12.22" }, @@ -702,17 +608,100 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", - "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", - "dev": true + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, + "license": "ISC", "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", @@ -724,11 +713,22 @@ "node": ">=8" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -737,11 +737,26 @@ "node": ">=8" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -754,6 +769,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, + "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -769,6 +785,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -776,36 +793,36 @@ "node": ">=8" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/@istanbuljs/schema": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz", + "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, - "engines": { - "node": ">=8" + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { @@ -813,92 +830,64 @@ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, + "license": "MIT", + "optional": true, "engines": { - "node": ">= 8" + "node": ">=14" } }, "node_modules/@rollup/plugin-terser": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", - "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-1.0.0.tgz", + "integrity": "sha512-FnCxhTBx6bMOYQrar6C8h3scPt8/JwIzw3+AJ2K++6guogH5fYaIFia+zZuhqv0eo1RN7W1Pz630SyvLbDjhtQ==", "dev": true, + "license": "MIT", "dependencies": { - "serialize-javascript": "^6.0.1", + "serialize-javascript": "^7.0.3", "smob": "^1.0.0", "terser": "^5.17.4" }, "engines": { - "node": ">=14.0.0" + "node": ">=20.0.0" }, "peerDependencies": { "rollup": "^2.0.0||^3.0.0||^4.0.0" @@ -910,10 +899,11 @@ } }, "node_modules/@rollup/plugin-typescript": { - "version": "11.1.6", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.6.tgz", - "integrity": "sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==", + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.3.0.tgz", + "integrity": "sha512-7DP0/p7y3t67+NabT9f8oTBFE6gGkto4SA6Np2oudYmZE/m1dt8RB0SjL1msMxFpLo631qjRCcBlAbq1ml/Big==", "dev": true, + "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.1.0", "resolve": "^1.22.1" @@ -935,291 +925,748 @@ } } }, - "node_modules/@rollup/pluginutils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", - "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "node_modules/@rollup/pluginutils": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.4.0.tgz", + "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.0.tgz", + "integrity": "sha512-IPIQ55ythEHkfEd9jMEi32OQ7SxURsGA43JI22lj01OLZNt2NUbJX8YUHxkVWyQ6daHPNn0truF5nSj3DQp6YQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.0.tgz", + "integrity": "sha512-M6s9cr10MibETyo8JsOkq+Lo1+lU6hcvb1MApnUql5qte/5hMEgzlN8/ReIKNfRV8rrqX50W1BX9zoUhC192RA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.0.tgz", + "integrity": "sha512-BqCoMoIbn0keKys+dEAdBa70EtOwV1bEsQCUgU9FdiZmmMge/Zk7LlkYGqbrdHR+Frnt0E1FOanly+rlwvvQzw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.0.tgz", + "integrity": "sha512-SIMzST3VFNXDAbeIWDWiFCNM5qncUBDWaEV7NfE7oZbDt2mgfW4MvbKdbYiGOLoM32gbTv608UMd0XktEYSD7w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.0.tgz", + "integrity": "sha512-ezjfSQMP7ArdUsbBwbQIfwAlhE84I2iVnzQNCFSveqV42q+BmKlzVpf7mxv5EchLcoWU4y6/heFzVg1F+hodUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.0.tgz", + "integrity": "sha512-9+qTWGW9AZRhnUgwtTwzNwcPlL87ngkeN0LA+q1bADvmY9aNvWaF2TFW8BZgnQPYxpDI7+rMVLivcd4V737TAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.0.tgz", + "integrity": "sha512-T1dMEQhXA/jkJ/jyMIw9IovK8bSUq7A8kLIlvZTb/6YIVsp2zLavr4F3oyllHWo7eIVJRyE5n3tUjQJEbE1IuQ==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.0.tgz", + "integrity": "sha512-2as0LgT7qQpyceQq6VUJYnumUMUrgGQCWIiDIN9DE0/tglsk6o66uCB4f3djRawAltvfCNLyZZrsqbPA6inCsA==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.0.tgz", + "integrity": "sha512-bVURMg+6eNN9C/yc0aVjooZcwTTtYF4YW3xta5pP0//r3o1V8gXEHXWCndj47w/HhwsFroZrFhR+6uQP5T0n0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.0.tgz", + "integrity": "sha512-Ful8pM/2yYI83PViWdFdpZhdI8HJ5qsXANe5atypbHDf+KIBBDsZsbyy8hbXnULVvW9NsTh5DHwbcBftyLTfiw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.0.tgz", + "integrity": "sha512-9Gp/DgrkzfUBmNPVTyPTvay+4xEP7M/clXpj3efXBcm6uTIVIgDg4rqUpqKXvLEuFRVuEpSAOkhgNeecvaZ4Cg==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.0.tgz", + "integrity": "sha512-m9tsJz54LUXkSYM8+8PG81B9IKK5r+2T0clMq4QrS16xFosufU7firBDAZEsDheDs7wTlP7h3++S7lMsU955HA==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.0.tgz", + "integrity": "sha512-3UvJ5PNVU16aJf6M3tFI24pWzAl2/ynfbyRN3ICyQajK1lSkrnVYNnLz3v04J32qKa0FczJc22zeToc0lr2A3w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.0.tgz", + "integrity": "sha512-vRWUAbYLGHBZS6Q8Msb2sfnf1fvJf+47t8l/TwOerM2qArzy+IeNMTHrYLHXh95h8MoatPHI5hhSZNs+mGXKPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.0.tgz", + "integrity": "sha512-c00T5SYENHAt86cfW47URaP3Us5vLC/4QO7GYud1G5VNRffCwwCuBspwqYrriuJB+5m0WFzClCn9wed0FBjKvg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.0.tgz", + "integrity": "sha512-krrCDilhXOwFkSkO3Wm9I/f9H0L92XHHwy2fwxjukxIbh0dem8gZqOW5Y8BsHrpJv5qwlRBV+Wl4ZFyRWhUpwg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.0.tgz", + "integrity": "sha512-7pfYFSTc4/rUC/FtAI0Qp6QthDBCIi6/AuP1xYqFk5vanI6KnL5dWKP60OM/05LOsbwTmIcvr6eXC4CJuJ75IA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.0.tgz", + "integrity": "sha512-7SDIalKeIpG0Ifogbbdn58HmSotYMlf23K3dCJEmiVd9Fg36Vmni82iPQec27N3wY4Bvbxftkxz6vSx9OcouTg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.0.tgz", + "integrity": "sha512-eRZevouTH2i1HeAVLqJuLnt256krQkGY0TN6WsTmsIhuzbh457HuWDMakKwmi0Cjadux983CoSr8Lim2QhUIFw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.0.tgz", + "integrity": "sha512-3oVS7FLGa4U1qcvao9ylGxrjXZyUQqR8UwxEcnUEyPX53O/C/mKDZegNXTdHCP+h3e6ta/f1EN38Yif1mmZHYg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.0.tgz", + "integrity": "sha512-yTB9TgfWj5wHe5QgktAgXTLLot1gvEjl1NiPPAUiCs4oPrIWFl5V4nC3GrkNdj9LaAU4s94nVrGbGOCqUpyWsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.0.tgz", + "integrity": "sha512-5LOhoaesY3doG1c+ac/2JtgREpKoJr5bUHH8tKY0V8di7+uSV6BwLs2PlR0/yzefGOkR+wE7ZolZphHCsyG5Rw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.0.tgz", + "integrity": "sha512-yYkWHhmbhRTWTnWos5HC4GcPQfjlzzCNbM9e/+GXrLuaBXYA3qSDR9f0Vgufd5S8yX81U8jPKp7ZnAjZFMtRnw==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.0.tgz", + "integrity": "sha512-SoTb6lPg25xZlA2ibwQ++ahCCnH+FP0qmEuafMJ4gznZKOlXioKEAeJLgCrqjM98ACziXM9V1amFjICVL4IFoA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.0.tgz", + "integrity": "sha512-5L+T1fMX4RIEBoZzT0+sQ0PhTS36NULFmMXtl1TZo44TMAROIMHbZufSOjVWt/Y622BtxgxtaNOokbTDvfsrZA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "type-detect": "4.0.8" } }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "node_modules/@sinonjs/commons/node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0" + "license": "MIT", + "engines": { + "node": ">=4" } }, - "node_modules/@sinonjs/samsam": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.0.tgz", - "integrity": "sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==", + "node_modules/@sinonjs/fake-timers": { + "version": "15.4.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.4.0.tgz", + "integrity": "sha512-DsG+8/LscQIQg68J6Ef3dv10u6nVyetYn923s3/sus5eaGfTo1of5WMZSLf0UJc9KDuKPilPH0UDJCjvNbDNCA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^2.0.0", - "lodash.get": "^4.4.2", - "type-detect": "^4.0.8" + "@sinonjs/commons": "^3.0.1" } }, - "node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "node_modules/@sinonjs/samsam": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-10.0.2.tgz", + "integrity": "sha512-8lVwD1Df1BmzoaOLhMcGGcz/Jyr5QY2KSB75/YK1QgKzoabTeLdIVyhXNZK9ojfSKSdirbXqdbsXXqP9/Ve8+A==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "type-detect": "4.0.8" + "@sinonjs/commons": "^3.0.1", + "type-detect": "^4.1.0" } }, - "node_modules/@sinonjs/text-encoding": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz", - "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", - "dev": true - }, "node_modules/@socket.io/component-emitter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", - "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", - "dev": true + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/chai": { - "version": "4.3.12", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.12.tgz", - "integrity": "sha512-zNKDHG/1yxm8Il6uCCVsm+dRdEsJlFoDu73X17y09bId6UwoYww+vFBsAcRzl8knM1sab3Dp1VRikFQwDOtDDw==", - "dev": true - }, - "node_modules/@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "dev": true + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } }, "node_modules/@types/cors": { - "version": "2.8.17", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", - "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", + "version": "2.8.19", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", + "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/mocha": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", - "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", - "dev": true + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", + "version": "25.9.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.3.tgz", + "integrity": "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg==", "dev": true, + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": ">=7.24.0 <7.24.7" } }, "node_modules/@types/rewire": { "version": "2.5.30", "resolved": "https://registry.npmjs.org/@types/rewire/-/rewire-2.5.30.tgz", "integrity": "sha512-CSyzr7TF1EUm85as2noToMtLaBBN/rKKlo5ZDdXedQ64cUiHT25LCNo1J1cI4QghBlGmTymElW/2h3TiWYOsZw==", - "dev": true - }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/sinon": { - "version": "10.0.20", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.20.tgz", - "integrity": "sha512-2APKKruFNCAZgx3daAyACGzWuJ028VVCUDk6o2rw/Z4PXT0ogwdV4KUegW0MwVs0Zu59auPXbbuBJHF12Sx1Eg==", + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-21.0.1.tgz", + "integrity": "sha512-5yoJSqLbjH8T9V2bksgRayuhpZy+723/z6wBOR+Soe4ZlXC0eW8Na71TeaZPUWDQvM7LYKa9UGFc6LRqxiR5fQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/sinonjs__fake-timers": "*" } }, "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", - "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", - "dev": true + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-15.0.1.tgz", + "integrity": "sha512-Ko2tjWJq8oozHzHV+reuvS5KYIRAokHnGbDwGh/J64LntgpbuylF74ipEL24HCyRjf9FOlBiBHWBR1RlVKsI1w==", + "dev": true, + "license": "MIT" }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/type-utils": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4", - "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "@types/node": "*" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.61.0.tgz", + "integrity": "sha512-bFNvl9ZczlVb+wR2Akszf3gHfKVj/8WanXaGJ3UstTA7brNKg0cNdk6X1Psu5V7MZ2oQtzZKOEzIUehaoxbDGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.61.0", + "@typescript-eslint/type-utils": "8.61.0", + "@typescript-eslint/utils": "8.61.0", + "@typescript-eslint/visitor-keys": "8.61.0", + "ignore": "^7.0.5", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^2.5.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "@typescript-eslint/parser": "^8.61.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" } }, "node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.61.0.tgz", + "integrity": "sha512-5B7PfA2e1NQGCnDHd/0lW7W3gvp3d59Ryw54FYO8Uswxo9f6ikw3AZV+Xj/TvpImmpsiYyUqAfhC6kJID1jF6w==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4" + "@typescript-eslint/scope-manager": "8.61.0", + "@typescript-eslint/types": "8.61.0", + "@typescript-eslint/typescript-estree": "8.61.0", + "@typescript-eslint/visitor-keys": "8.61.0", + "debug": "^4.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.61.0.tgz", + "integrity": "sha512-DV42F7MLJO6Rax7SK1yg43tcnEfGUrurSpSxKuVX+a3RCTzBlH3fuxprrOJXKCJGAaw82xXocikJ0uQaqwXgGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.61.0", + "@typescript-eslint/types": "^8.61.0", + "debug": "^4.4.3" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.61.0.tgz", + "integrity": "sha512-IWdXFHFSb6mlC3HPc7QsLDm5zYEbUla6trDEHf32D3/dnuUyXd87plScSNXSbm0/RxMvObpI17sv/EDTGrGZkA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "8.61.0", + "@typescript-eslint/visitor-keys": "8.61.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.61.0.tgz", + "integrity": "sha512-O5Amvdv9ztMpxpf+vmFULGG78IE6Qwdr3bCGvqwG4nwc9H2qXkOYJJnRbRHyMkQTjv1d03olqwwwzHLMqpFePQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.61.0.tgz", + "integrity": "sha512-TuBiQYIkd97yBfInHCTKVYMbX4kvEmpOEuixIuzCU9p8BGT1SfyyO0d0IfDMbPIHcjn/hWnusUX5e8v5Xg+X8A==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "@typescript-eslint/types": "8.61.0", + "@typescript-eslint/typescript-estree": "8.61.0", + "@typescript-eslint/utils": "8.61.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.61.0.tgz", + "integrity": "sha512-9QTQpZ5Iin4CdIodfbDQFSeiSJKidgYJYug1P9CC2xWgUTvlmixViqDZNciMjwLBZyJnG4tGmPl97rVAFb1AJg==", "dev": true, + "license": "MIT", "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1227,86 +1674,81 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.61.0.tgz", + "integrity": "sha512-42zatd5qSvvcV1JdDBCLxYRznvP4eIHpPoZXdkPFnAmanA4FuZ5dibSnCBggY8hQnqajPpoGjXFdZ7fIJKQnlA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "@typescript-eslint/project-service": "8.61.0", + "@typescript-eslint/tsconfig-utils": "8.61.0", + "@typescript-eslint/types": "8.61.0", + "@typescript-eslint/visitor-keys": "8.61.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.61.0.tgz", + "integrity": "sha512-3bzFt7ImFMW/jVYwJamDoe/dMOdFLSC6pom6rRjdh4SZJEYupyMzem8e7vKZLclLfpHjlwSAXOUxtKxGXUiLqA==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "semver": "^7.5.4" + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.61.0", + "@typescript-eslint/types": "8.61.0", + "@typescript-eslint/typescript-estree": "8.61.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.61.0.tgz", + "integrity": "sha512-QVLZu3ZPQEE+HICQyAMZ2yLQhxf0meY/wx6Hx14YcTNj13JB3qHlX3lJ02L3fLGHgERRH71kvYDwiXIguT3AjQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "8.61.0", + "eslint-visitor-keys": "^5.0.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true - }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, + "license": "MIT", "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -1316,10 +1758,11 @@ } }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -1332,15 +1775,20 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, "engines": { "node": ">=0.4.0" } @@ -1350,6 +1798,7 @@ "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, + "license": "MIT", "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -1359,10 +1808,11 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1374,49 +1824,33 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", + "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", "dev": true, + "license": "MIT", "dependencies": { - "type-fest": "^1.0.2" + "environment": "^1.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { @@ -1424,6 +1858,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -1439,6 +1874,7 @@ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, + "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -1447,11 +1883,25 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, + "license": "MIT", "dependencies": { "default-require-extensions": "^3.0.0" }, @@ -1463,92 +1913,98 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "license": "MIT" }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "Python-2.0" }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, + "license": "MIT", "engines": { - "node": "*" + "node": ">=12" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": "18 || 20 || >=22" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, "node_modules/base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true, + "license": "MIT", "engines": { "node": "^4.5.0 || >= 5.9" } }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.37", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.37.tgz", + "integrity": "sha512-girxaJ7WZssDOFhzCGZTDKoTa1gk6A1TbflaYTpykLJ4UU9Fz9kx1aREM8JCuoVHbL8X8T/mJg7w2oYSq72Oig==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.5", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.5.tgz", + "integrity": "sha512-3grm+/2tUOvu2cjJkvsIxrv/wVpfXQW4PsQHYm7yk4vfpu7Ekl6nEsYBoJUL6qDwZUx8wUhQ8tR2qz+ad9c9OA==", "dev": true, + "license": "MIT", "dependencies": { - "bytes": "3.1.2", + "bytes": "~3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.2", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.15.1", + "raw-body": "~2.5.3", "type-is": "~1.6.18", - "unpipe": "1.0.0" + "unpipe": "~1.0.0" }, "engines": { "node": ">= 0.8", @@ -1560,6 +2016,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -1568,24 +2025,30 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, + "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1595,12 +2058,13 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.28.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", + "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", "dev": true, "funding": [ { @@ -1616,11 +2080,13 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "baseline-browser-mapping": "^2.10.12", + "caniuse-lite": "^1.0.30001782", + "electron-to-chromium": "^1.5.328", + "node-releases": "^2.0.36", + "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" @@ -1633,13 +2099,15 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -1649,6 +2117,7 @@ "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, + "license": "MIT", "dependencies": { "hasha": "^5.0.0", "make-dir": "^3.0.0", @@ -1659,17 +2128,29 @@ "node": ">=8" } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, + "license": "MIT", "dependencies": { - "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { "node": ">= 0.4" @@ -1683,6 +2164,7 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -1692,14 +2174,15 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/caniuse-lite": { - "version": "1.0.30001596", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001596.tgz", - "integrity": "sha512-zpkZ+kEr6We7w63ORkoJ2pOfBwBkY/bJrG/UZ90qNb45Isblu8wzDgevEOrRL1r9dWayHjYiiyCMEXPn4DweGQ==", + "version": "1.0.30001799", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001799.tgz", + "integrity": "sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==", "dev": true, "funding": [ { @@ -1714,13 +2197,15 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", "dev": true, + "license": "MIT", "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.3", @@ -1728,17 +2213,28 @@ "get-func-name": "^2.0.2", "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "type-detect": "^4.1.0" }, "engines": { "node": ">=4" } }, + "node_modules/chai/node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1750,11 +2246,25 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/check-error": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, + "license": "MIT", "dependencies": { "get-func-name": "^2.0.2" }, @@ -1767,6 +2277,7 @@ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, + "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -1791,6 +2302,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -1803,36 +2315,39 @@ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", "dev": true, + "license": "MIT", "dependencies": { - "restore-cursor": "^4.0.0" + "restore-cursor": "^5.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-truncate": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", + "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", "dev": true, + "license": "MIT", "dependencies": { - "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" + "slice-ansi": "^8.0.0", + "string-width": "^8.2.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1843,23 +2358,29 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } }, "node_modules/cliui/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1869,6 +2390,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -1878,11 +2400,25 @@ "node": ">=8" } }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -1900,6 +2436,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -1911,40 +2448,36 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, - "engines": { - "node": ">=16" - } + "license": "MIT" }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", "dev": true, + "license": "MIT", "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.2", @@ -1960,6 +2493,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -1968,13 +2502,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/content-type": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -1983,41 +2519,50 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", "dev": true, + "license": "MIT", "dependencies": { "object-assign": "^4", "vary": "^1" }, "engines": { "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2031,24 +2576,27 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/date-format": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.0" } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -2064,15 +2612,17 @@ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", "dev": true, + "license": "MIT", "dependencies": { "type-detect": "^4.0.0" }, @@ -2084,13 +2634,15 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/default-require-extensions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", "dev": true, + "license": "MIT", "dependencies": { "strip-bom": "^4.0.0" }, @@ -2101,28 +2653,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -2132,6 +2668,7 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" @@ -2141,46 +2678,25 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", "integrity": "sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/dom-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", "integrity": "sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ==", "dev": true, + "license": "MIT", "dependencies": { "custom-event": "~1.0.0", "ent": "~2.2.0", @@ -2188,96 +2704,126 @@ "void-elements": "^2.0.0" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.4.699", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.699.tgz", - "integrity": "sha512-I7q3BbQi6e4tJJN5CRcyvxhK0iJb34TV8eJQcgh+fR2fQ8miMgZcEInckCo1U9exDHbfz7DLDnFn8oqH/VcRKw==", - "dev": true + "version": "1.5.372", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.372.tgz", + "integrity": "sha512-M3yhbAlilnwqC8D21t28UCDGHyitShTmmLRU/H+b74P6Ski16Nb9HONYEaVpMj/pwC7BEo5B95FpjODLCWbtfA==", + "dev": true, + "license": "ISC" }, "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/engine.io": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.4.tgz", - "integrity": "sha512-KdVSDKhVKyOi+r5uEabrDLZw2qXStVvCsEB/LN3mw4WFi6Gx50jTyuxYVCwAAC0U46FdnzP/ScKRBTXb/NiEOg==", + "version": "6.6.8", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.8.tgz", + "integrity": "sha512-2agL3ueZhqxoVrfmntO8yuVj+uNSlIOnhykYHk3Cq0ShYPdUjjUiSJrQvXjq01I9jAuI0Zl2YO8Evv5Mqytm5g==", "dev": true, + "license": "MIT", "dependencies": { - "@types/cookie": "^0.4.1", "@types/cors": "^2.8.12", "@types/node": ">=10.0.0", + "@types/ws": "^8.5.12", "accepts": "~1.3.4", "base64id": "2.0.0", - "cookie": "~0.4.1", + "cookie": "~0.7.2", "cors": "~2.8.5", - "debug": "~4.3.1", + "debug": "~4.4.1", "engine.io-parser": "~5.2.1", - "ws": "~8.11.0" + "ws": "~8.20.1" }, "engines": { "node": ">=10.2.0" } }, "node_modules/engine.io-parser": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.2.tgz", - "integrity": "sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" } }, - "node_modules/enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "node_modules/ent": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.2.tgz", + "integrity": "sha512-kKvD1tO6BM+oK9HzCPpUdRb4vKFQY/FPTFmurMvh6LlN68VMrdj77w8yp51/kDbpkFOS9J8w5W6zIzgM2H8/hw==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "punycode": "^1.4.1", + "safe-regex-test": "^1.1.0" }, "engines": { - "node": ">=8.6" + "node": ">= 0.4" } }, - "node_modules/ent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==", - "dev": true + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -2287,6 +2833,20 @@ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, "engines": { "node": ">= 0.4" } @@ -2295,13 +2855,15 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -2310,13 +2872,15 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -2325,164 +2889,109 @@ } }, "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.5.0.tgz", + "integrity": "sha512-1y+7C+vi12bUK1IpZeaV3gsH9fHLBmPvYmPx42pvT/E9yG0IC8g3PUZZgp0+JLJl7ZDK0flc2gc+Aw9dpCvIsQ==", "dev": true, + "license": "MIT", + "workspaces": [ + "packages/*" + ], "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.5", + "@eslint/config-helpers": "^0.6.0", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.2", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", + "minimatch": "^10.2.4", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, + "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/eslint/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.16.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^5.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" @@ -2493,6 +3002,7 @@ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, + "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -2502,10 +3012,11 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -2518,6 +3029,7 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -2530,6 +3042,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -2538,13 +3051,15 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -2553,109 +3068,74 @@ "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "node_modules/execa": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", - "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^4.3.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^14.18.0 || ^16.14.0 || >=18.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } + "license": "MIT" }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } + "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "license": "MIT" }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dev": true, - "dependencies": { - "reusify": "^1.0.4" + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2668,6 +3148,7 @@ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "dev": true, + "license": "MIT", "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -2686,6 +3167,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -2694,13 +3176,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/finalhandler/node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", "dev": true, + "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -2713,6 +3197,7 @@ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, + "license": "MIT", "dependencies": { "commondir": "^1.0.1", "make-dir": "^3.0.2", @@ -2730,6 +3215,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -2746,34 +3232,36 @@ "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, + "license": "BSD-3-Clause", "bin": { "flat": "cli.js" } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, + "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "dev": true + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", "dev": true, "funding": [ { @@ -2781,6 +3269,7 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -2790,17 +3279,34 @@ } } }, - "node_modules/foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - }, + "license": "ISC", "engines": { - "node": ">=8.0.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/fromentries": { @@ -2821,13 +3327,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -2841,7 +3349,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/fsevents": { "version": "2.3.3", @@ -2849,6 +3358,7 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -2862,21 +3372,17 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -2886,30 +3392,51 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-func-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, + "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -2923,27 +3450,32 @@ "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.0.0" } }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, - "engines": { - "node": ">=10" + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">= 0.4" } }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2964,6 +3496,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -2971,21 +3504,30 @@ "node": ">=10.13.0" } }, + "node_modules/glob/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -2994,47 +3536,26 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" + "license": "MIT", + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3044,40 +3565,25 @@ "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -3085,11 +3591,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, "engines": { "node": ">= 0.4" }, @@ -3102,6 +3612,7 @@ "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, + "license": "MIT", "dependencies": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" @@ -3113,32 +3624,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/hasha/node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hasha/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "dev": true, + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -3151,6 +3642,7 @@ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, + "license": "MIT", "bin": { "he": "bin/he" } @@ -3159,29 +3651,36 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "dev": true, + "license": "MIT", "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" }, "engines": { "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/http-errors/node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -3191,6 +3690,7 @@ "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, + "license": "MIT", "dependencies": { "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", @@ -3200,25 +3700,17 @@ "node": ">=8.0.0" } }, - "node_modules/human-signals": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", - "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", - "dev": true, - "engines": { - "node": ">=14.18.0" - } - }, "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true, + "license": "MIT", "bin": { - "husky": "lib/bin.js" + "husky": "bin.js" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -3229,6 +3721,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -3237,19 +3730,21 @@ } }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -3261,11 +3756,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -3275,6 +3781,7 @@ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -3283,7 +3790,9 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -3293,13 +3802,15 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, + "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -3308,12 +3819,16 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", "dev": true, + "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3324,6 +3839,7 @@ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, + "license": "MIT", "bin": { "is-docker": "cli.js" }, @@ -3339,17 +3855,22 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3360,6 +3881,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -3372,6 +3894,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -3381,6 +3904,7 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -3390,17 +3914,38 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, + "license": "MIT", "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3410,13 +3955,15 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -3429,6 +3976,7 @@ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -3438,6 +3986,7 @@ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, + "license": "MIT", "dependencies": { "is-docker": "^2.0.0" }, @@ -3450,6 +3999,7 @@ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8.0.0" }, @@ -3461,13 +4011,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=8" } @@ -3477,6 +4029,7 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "append-transform": "^2.0.0" }, @@ -3485,44 +4038,75 @@ } }, "node_modules/istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" }, "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node": ">=10" } }, "node_modules/istanbul-lib-processinfo": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", - "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-3.0.1.tgz", + "integrity": "sha512-s3mX05h5wGZeScG6XnOanygPh4SJu5ujMc9YbvpnLGXWy1cRiGbp0NdVcjHxgoZt3WfQppfBsa0y+gWdYJ2pGQ==", "dev": true, + "license": "ISC", "dependencies": { "archy": "^1.0.0", "cross-spawn": "^7.0.3", "istanbul-lib-coverage": "^3.2.0", "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^8.3.2" + "rimraf": "^6.1.3" }, "engines": { - "node": ">=8" + "node": "20 || >=22" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/rimraf": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "glob": "^13.0.3", + "package-json-from-dist": "^1.0.1" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/istanbul-lib-report": { @@ -3530,6 +4114,7 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -3544,6 +4129,7 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^7.5.3" }, @@ -3554,11 +4140,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", @@ -3569,10 +4169,11 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -3581,60 +4182,92 @@ "node": ">=8" } }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -3647,21 +4280,17 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "dev": true, + "license": "MIT", "optionalDependencies": { "graceful-fs": "^4.1.6" } }, - "node_modules/just-extend": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", - "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", - "dev": true - }, "node_modules/karma": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.3.tgz", - "integrity": "sha512-LuucC/RE92tJ8mlCwqEoRWXP38UMAqpnq98vktmS9SznSoUPPUJQbc91dHcxcunROvfQjdORVA/YFviH+Xci9Q==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.4.tgz", + "integrity": "sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==", "dev": true, + "license": "MIT", "dependencies": { "@colors/colors": "1.5.0", "body-parser": "^1.19.0", @@ -3700,6 +4329,7 @@ "resolved": "https://registry.npmjs.org/karma-chai/-/karma-chai-0.1.0.tgz", "integrity": "sha512-mqKCkHwzPMhgTYca10S90aCEX9+HjVjjrBFAsw36Zj7BlQNbokXXCAe6Ji04VUMsxcY5RLP7YphpfO06XOubdg==", "dev": true, + "license": "MIT", "peerDependencies": { "chai": "*", "karma": ">=0.10.9" @@ -3710,6 +4340,7 @@ "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.2.0.tgz", "integrity": "sha512-rE9RkUPI7I9mAxByQWkGJFXfFD6lE4gC5nPuZdobf/QdTEJI6EU4yIay/cfU/xV4ZxlM5JiTv7zWYgA64NpS5Q==", "dev": true, + "license": "MIT", "dependencies": { "which": "^1.2.1" } @@ -3719,6 +4350,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -3731,6 +4363,7 @@ "resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-2.1.3.tgz", "integrity": "sha512-LMM2bseebLbYjODBOVt7TCPP9OI2vZIXCavIXhkO9m+10Uj5l7u/SKoeRmYx8FYHTVGZSpk6peX+3BMHC1WwNw==", "dev": true, + "license": "MIT", "dependencies": { "is-wsl": "^2.2.0", "which": "^3.0.0" @@ -3741,6 +4374,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -3756,25 +4390,35 @@ "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", "integrity": "sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.3" } }, + "node_modules/karma/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/karma/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/karma/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -3787,6 +4431,7 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -3796,6 +4441,7 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -3804,90 +4450,61 @@ "node": ">= 0.8.0" } }, - "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/lint-staged": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.3.0.tgz", - "integrity": "sha512-mPRtrYnipYYv1FEE134ufbWpeggNTo+O/UPzngoaKzbzHAthvR55am+8GfHTnqNRQVRRrYQLGW9ZyUoD7DsBHQ==", - "dev": true, - "dependencies": { - "chalk": "5.3.0", - "commander": "11.0.0", - "debug": "4.3.4", - "execa": "7.2.0", - "lilconfig": "2.1.0", - "listr2": "6.6.1", - "micromatch": "4.0.5", - "pidtree": "0.6.0", - "string-argv": "0.3.2", - "yaml": "2.3.1" + "version": "17.0.7", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.0.7.tgz", + "integrity": "sha512-JrSobt+tW3rH8IOMi8tDZd3foorM5yPEkLD/V2NxobgHrFfHWGee4MOLVuZeScgxftEwbHrPHIFA/ZL+nUJeuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "listr2": "^10.2.1", + "picomatch": "^4.0.4", + "string-argv": "^0.3.2", + "tinyexec": "^1.2.4" }, "bin": { "lint-staged": "bin/lint-staged.js" }, "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": ">=22.22.1" }, "funding": { "url": "https://opencollective.com/lint-staged" - } - }, - "node_modules/lint-staged/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "optionalDependencies": { + "yaml": "^2.9.0" } }, "node_modules/listr2": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-6.6.1.tgz", - "integrity": "sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-10.2.1.tgz", + "integrity": "sha512-7I5knELsJKTUjXG+A6BkKAiGkW1i25fNa/xlUl9hFtk15WbE9jndA89xu5FzQKrY5llajE1hfZZFMILXkDHk/Q==", "dev": true, + "license": "MIT", "dependencies": { - "cli-truncate": "^3.1.0", - "colorette": "^2.0.20", - "eventemitter3": "^5.0.1", - "log-update": "^5.0.1", - "rfdc": "^1.3.0", - "wrap-ansi": "^8.1.0" + "cli-truncate": "^5.2.0", + "eventemitter3": "^5.0.4", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^10.0.0" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "enquirer": ">= 2.3.0 < 3" - }, - "peerDependenciesMeta": { - "enquirer": { - "optional": true - } + "node": ">=22.13.0" } }, "node_modules/listr2/node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "dev": true, + "license": "MIT" }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -3899,40 +4516,32 @@ } }, "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "dev": true, + "license": "MIT" }, "node_modules/lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", - "dev": true - }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -3945,49 +4554,96 @@ } }, "node_modules/log-update": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", - "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-escapes": "^5.0.0", - "cli-cursor": "^4.0.0", - "slice-ansi": "^5.0.0", - "strip-ansi": "^7.0.1", - "wrap-ansi": "^8.0.1" + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-update/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/log-update/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/log4js": { @@ -3995,6 +4651,7 @@ "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz", "integrity": "sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==", "dev": true, + "license": "Apache-2.0", "dependencies": { "date-format": "^4.0.14", "debug": "^4.3.4", @@ -4011,6 +4668,7 @@ "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", "dev": true, + "license": "MIT", "dependencies": { "get-func-name": "^2.0.1" } @@ -4020,20 +4678,19 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/magic-string": { - "version": "0.30.8", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", - "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" + "@jridgewell/sourcemap-codec": "^1.5.5" } }, "node_modules/make-dir": { @@ -4041,6 +4698,7 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^6.0.0" }, @@ -4056,6 +4714,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -4064,43 +4723,27 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "license": "ISC" }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, + "license": "MIT", "engines": { - "node": ">= 8" + "node": ">= 0.4" } }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, + "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">= 0.6" } }, "node_modules/mime": { @@ -4108,6 +4751,7 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", "dev": true, + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -4120,6 +4764,7 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -4129,6 +4774,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -4136,28 +4782,30 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^5.0.5" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4168,15 +4816,27 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.6" }, @@ -4185,199 +4845,283 @@ } }, "node_modules/mocha": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.3.0.tgz", - "integrity": "sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==", - "dev": true, - "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "8.1.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "version": "11.7.6", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.6.tgz", + "integrity": "sha512-nS9xOGbw2I3cjCpxwZAEJ9xK9lmJ08vEkQvLtz4du9ZrF9UrjRpeJGiIgl2Z+Qs++pmB4ecDe48Fwsh+j+j7xA==", + "dev": true, + "license": "MIT", + "dependencies": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^9.0.5", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^9.2.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" }, "bin": { "_mocha": "bin/_mocha", "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 14.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/mocha/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "node_modules/mocha/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/brace-expansion": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", + "integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } }, "node_modules/mocha/node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], + "license": "MIT", "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "^4.0.1" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 14.16.0" }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/mocha/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "node_modules/mocha/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, + "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { "node": ">=12" + } + }, + "node_modules/mocha/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/mocha/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, + "license": "MIT", "engines": { - "node": ">= 6" + "node": ">=8" } }, - "node_modules/mocha/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/mocha/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/mocha/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, + "license": "ISC", "dependencies": { - "argparse": "^2.0.1" + "brace-expansion": "^2.0.2" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "node_modules/mocha/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^2.0.1" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "node_modules/mocha/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } }, "node_modules/mocha/node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "node_modules/mocha/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/nise": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.9.tgz", - "integrity": "sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^11.2.2", - "@sinonjs/text-encoding": "^0.7.2", - "just-extend": "^6.2.0", - "path-to-regexp": "^6.2.1" - } - }, - "node_modules/nise/node_modules/@sinonjs/fake-timers": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", - "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0" + "license": "MIT", + "engines": { + "node": ">= 0.6" } }, "node_modules/node-preload": { @@ -4385,6 +5129,7 @@ "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, + "license": "MIT", "dependencies": { "process-on-spawn": "^1.0.0" }, @@ -4393,52 +5138,31 @@ } }, "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", - "dev": true + "version": "2.0.47", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.47.tgz", + "integrity": "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/nyc": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", - "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-18.0.0.tgz", + "integrity": "sha512-G5UyHinFkB1BxqGTrmZdB6uIYH0+v7ZnVssuflUDi+J+RhKWyAhRT1RCehBSI6jLFLuUUgFDyLt49mUtdO1XeQ==", "dev": true, + "license": "ISC", "dependencies": { "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.2", @@ -4447,13 +5171,13 @@ "decamelize": "^1.2.0", "find-cache-dir": "^3.2.0", "find-up": "^4.1.0", - "foreground-child": "^2.0.0", + "foreground-child": "^3.3.0", "get-package-type": "^0.1.0", - "glob": "^7.1.6", + "glob": "^13.0.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^3.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", @@ -4462,17 +5186,27 @@ "p-map": "^3.0.0", "process-on-spawn": "^1.0.0", "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", + "rimraf": "^6.1.3", "signal-exit": "^3.0.2", - "spawn-wrap": "^2.0.0", - "test-exclude": "^6.0.0", + "spawn-wrap": "^3.0.0", + "test-exclude": "^8.0.0", "yargs": "^15.0.2" }, "bin": { "nyc": "bin/nyc.js" }, "engines": { - "node": ">=8.9" + "node": "20 || >=22" + } + }, + "node_modules/nyc/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" } }, "node_modules/nyc/node_modules/cliui": { @@ -4480,23 +5214,19 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, - "node_modules/nyc/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "node_modules/nyc/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -4505,11 +5235,30 @@ "node": ">=8" } }, + "node_modules/nyc/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/nyc/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4519,6 +5268,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -4531,6 +5281,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, + "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -4546,6 +5297,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -4553,13 +5305,24 @@ "node": ">=8" } }, - "node_modules/nyc/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/nyc/node_modules/rimraf": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "glob": "^13.0.3", + "package-json-from-dist": "^1.0.1" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, "engines": { - "node": ">=8" + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/nyc/node_modules/string-width": { @@ -4567,6 +5330,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4576,11 +5340,25 @@ "node": ">=8" } }, + "node_modules/nyc/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/nyc/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -4594,13 +5372,15 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/nyc/node_modules/yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", @@ -4623,6 +5403,7 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, + "license": "ISC", "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -4636,15 +5417,20 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4654,6 +5440,7 @@ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, + "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -4666,37 +5453,40 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, + "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", "dev": true, + "license": "MIT", "dependencies": { - "mimic-fn": "^4.0.0" + "mimic-function": "^5.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, + "license": "MIT", "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -4707,6 +5497,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -4722,6 +5513,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -4737,6 +5529,7 @@ "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, + "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0" }, @@ -4749,6 +5542,7 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -4758,6 +5552,7 @@ "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, + "license": "ISC", "dependencies": { "graceful-fs": "^4.1.15", "hasha": "^5.0.0", @@ -4768,11 +5563,19 @@ "node": ">=8" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -4785,6 +5588,7 @@ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -4794,6 +5598,7 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4803,6 +5608,7 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4812,6 +5618,7 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4820,21 +5627,34 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "dev": true, + "license": "MIT" }, - "node_modules/path-to-regexp": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", - "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==", - "dev": true + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "11.5.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz", + "integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==", "dev": true, + "license": "BlueOak-1.0.0", "engines": { - "node": ">=8" + "node": "20 || >=22" } }, "node_modules/pathval": { @@ -4842,38 +5662,39 @@ "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pidtree": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", - "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, - "bin": { - "pidtree": "bin/pidtree.js" - }, + "license": "MIT", "engines": { - "node": ">=0.10" + "node": ">= 6" } }, "node_modules/pkg-dir": { @@ -4881,6 +5702,7 @@ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^4.0.0" }, @@ -4893,6 +5715,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -4906,6 +5729,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -4918,6 +5742,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, + "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -4933,6 +5758,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -4945,15 +5771,17 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz", + "integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -4965,10 +5793,11 @@ } }, "node_modules/process-on-spawn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", + "integrity": "sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==", "dev": true, + "license": "MIT", "dependencies": { "fromentries": "^1.2.0" }, @@ -4976,40 +5805,31 @@ "node": ">=8" } }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", "dev": true, - "engines": { - "node": ">=6" - } + "license": "MIT" }, "node_modules/qjobs": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.9" } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.15.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz", + "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.1.0" }, "engines": { "node": ">=0.6" @@ -5018,31 +5838,12 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } @@ -5052,20 +5853,22 @@ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", "dev": true, + "license": "MIT", "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" }, "engines": { "node": ">= 0.8" @@ -5076,6 +5879,7 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, + "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -5083,16 +5887,17 @@ "node": ">=8.10.0" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "node_modules/readdirp/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=8.6" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/release-zalgo": { @@ -5100,6 +5905,7 @@ "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", "dev": true, + "license": "ISC", "dependencies": { "es6-error": "^4.0.1" }, @@ -5112,15 +5918,7 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -5129,307 +5927,299 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.12", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", + "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", "dev": true, + "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", + "es-errors": "^1.3.0", + "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", "dev": true, + "license": "MIT", "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/restore-cursor/node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/restore-cursor/node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, + "license": "ISC", "engines": { - "node": ">=6" + "node": ">=14" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rewire": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-6.0.0.tgz", - "integrity": "sha512-7sZdz5dptqBCapJYocw9EcppLU62KMEqDLIILJnNET2iqzXHaQfaVP5SOJ06XvjX+dNIDJbzjw0ZWzrgDhtjYg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/rewire/-/rewire-9.0.1.tgz", + "integrity": "sha512-dnbLeTwHpXvWJjswC6CshXUUnnpE5AVhlayVRvDJhJx5ejbO4nbj1IXqN2urErgB7TpHUAMpf6iPDhQIxeSQOQ==", "dev": true, + "license": "MIT", "dependencies": { - "eslint": "^7.32.0" + "eslint": "^9.30", + "pirates": "^4.0.7" } }, - "node_modules/rewire/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "node_modules/rewire/node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@babel/highlight": "^7.10.4" + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/rewire/node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "node_modules/rewire/node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" + "@eslint/core": "^0.17.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/rewire/node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "node_modules/rewire/node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@types/json-schema": "^7.0.15" }, "engines": { - "node": ">=10.10.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/rewire/node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "node_modules/rewire/node_modules/@eslint/js": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } }, - "node_modules/rewire/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "node_modules/rewire/node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "dev": true, - "bin": { - "acorn": "bin/acorn" + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/rewire/node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" }, "engines": { - "node": ">=0.4.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/rewire/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/rewire/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/rewire/node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.5", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/rewire/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/rewire/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/rewire/node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/rewire/node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, + "estraverse": "^5.2.0" + }, "engines": { - "node": ">=4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/rewire/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "node_modules/rewire/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, + "license": "Apache-2.0", "engines": { - "node": ">=4.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/rewire/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/rewire/node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "is-glob": "^4.0.1" + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/rewire/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/rewire/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5438,16 +6228,19 @@ } }, "node_modules/rfdc": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", - "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", - "dev": true + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true, + "license": "MIT" }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -5459,65 +6252,82 @@ } }, "node_modules/rollup": { - "version": "3.29.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", - "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", + "version": "4.62.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.0.tgz", + "integrity": "sha512-nc72Wgq62I7rtDV4izT5/aaS0zxy3kttkinf9586ApknY3jZO9NYsmtc24fUckA0X7Q2v+ML4a15pdUlV5V/jA==", "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, "bin": { "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=14.18.0", + "node": ">=18.0.0", "npm": ">=8.0.0" }, "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.62.0", + "@rollup/rollup-android-arm64": "4.62.0", + "@rollup/rollup-darwin-arm64": "4.62.0", + "@rollup/rollup-darwin-x64": "4.62.0", + "@rollup/rollup-freebsd-arm64": "4.62.0", + "@rollup/rollup-freebsd-x64": "4.62.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.62.0", + "@rollup/rollup-linux-arm-musleabihf": "4.62.0", + "@rollup/rollup-linux-arm64-gnu": "4.62.0", + "@rollup/rollup-linux-arm64-musl": "4.62.0", + "@rollup/rollup-linux-loong64-gnu": "4.62.0", + "@rollup/rollup-linux-loong64-musl": "4.62.0", + "@rollup/rollup-linux-ppc64-gnu": "4.62.0", + "@rollup/rollup-linux-ppc64-musl": "4.62.0", + "@rollup/rollup-linux-riscv64-gnu": "4.62.0", + "@rollup/rollup-linux-riscv64-musl": "4.62.0", + "@rollup/rollup-linux-s390x-gnu": "4.62.0", + "@rollup/rollup-linux-x64-gnu": "4.62.0", + "@rollup/rollup-linux-x64-musl": "4.62.0", + "@rollup/rollup-openbsd-x64": "4.62.0", + "@rollup/rollup-openharmony-arm64": "4.62.0", + "@rollup/rollup-win32-arm64-msvc": "4.62.0", + "@rollup/rollup-win32-ia32-msvc": "4.62.0", + "@rollup/rollup-win32-x64-gnu": "4.62.0", + "@rollup/rollup-win32-x64-msvc": "4.62.0", "fsevents": "~2.3.2" } }, "node_modules/rollup-plugin-dts": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-5.3.1.tgz", - "integrity": "sha512-gusMi+Z4gY/JaEQeXnB0RUdU82h1kF0WYzCWgVmV4p3hWXqelaKuCvcJawfeg+EKn2T1Ie+YWF2OiN1/L8bTVg==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-6.4.1.tgz", + "integrity": "sha512-l//F3Zf7ID5GoOfLfD8kroBjQKEKpy1qfhtAdnpibFZMffPaylrg1CoDC2vGkPeTeyxUe4bVFCln2EFuL7IGGg==", "dev": true, + "license": "LGPL-3.0-only", "dependencies": { - "magic-string": "^0.30.2" + "@jridgewell/remapping": "^2.3.5", + "@jridgewell/sourcemap-codec": "^1.5.5", + "convert-source-map": "^2.0.0", + "magic-string": "^0.30.21" }, "engines": { - "node": ">=v14.21.3" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/Swatinem" }, "optionalDependencies": { - "@babel/code-frame": "^7.22.5" + "@babel/code-frame": "^7.29.0" }, "peerDependencies": { - "rollup": "^3.0", - "typescript": "^4.1 || ^5.0" + "rollup": "^3.29.4 || ^4", + "typescript": "^4.5 || ^5.0 || ^6.0" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "node_modules/rollup-plugin-dts/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } + "license": "MIT" }, "node_modules/safe-buffer": { "version": "5.2.1", @@ -5537,22 +6347,40 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz", + "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -5560,67 +6388,36 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.0.5.tgz", + "integrity": "sha512-F4LcB0UqUl1zErq+1nYEEzSHJnIwb3AF2XWB94b+afhrekOUijwooAYqFyRbjYkm2PAKBabx6oYv/xDxNi8IBw==", "dev": true, - "dependencies": { - "randombytes": "^2.1.0" + "license": "BSD-3-Clause", + "engines": { + "node": ">=20.0.0" } }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } + "license": "ISC" }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -5633,20 +6430,79 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -5659,21 +6515,20 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/sinon": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.2.0.tgz", - "integrity": "sha512-nPS85arNqwBXaIsFCkolHjGIkFo+Oxu9vbgmBJizLAhqe6P2o3Qmj3KCUoRkfhHtvgDhZdWD3risLHAUJ8npjw==", - "deprecated": "16.1.1", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-22.0.0.tgz", + "integrity": "sha512-sq/6DpdXOrLyfbKlXLg/Usc7xu8YXPeLkOFZRvA3bNUSA2lhbrZ06yuXbH1fkzBPCbz9O10+7hznzUsjaYNm0Q==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^10.3.0", - "@sinonjs/samsam": "^8.0.0", - "diff": "^5.1.0", - "nise": "^5.1.4", - "supports-color": "^7.2.0" + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^15.4.0", + "@sinonjs/samsam": "^10.0.2", + "diff": "^9.0.0" }, "funding": { "type": "opencollective", @@ -5681,44 +6536,38 @@ } }, "node_modules/sinon/node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz", + "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/slice-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", + "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" + "ansi-styles": "^6.2.3", + "is-fullwidth-code-point": "^5.1.0" }, "engines": { - "node": ">=12" + "node": ">=20" }, "funding": { "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -5727,22 +6576,27 @@ } }, "node_modules/smob": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.1.tgz", - "integrity": "sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==", - "dev": true + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.6.2.tgz", + "integrity": "sha512-RQsvleCbF8cVHEv+xuDGaA4pOizFqJ0GgjtMSRo6oP8pnN7WsigHgVGey6aILRBKv4W2YOMHLqbKdnB6hpB9fw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } }, "node_modules/socket.io": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.4.tgz", - "integrity": "sha512-DcotgfP1Zg9iP/dH9zvAQcWrE0TtbMVwXmlV4T4mqsvY+gw+LqUGPfx2AoVyRk0FLME+GQhufDMyacFmw7ksqw==", + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.3.tgz", + "integrity": "sha512-2Dd78bqzzjE6KPkD5fHZmDAKRNe3J15q+YHDrIsy9WEkqttc7GY+kT9OBLSMaPbQaEd0x1BjcmtMtXkfpc+T5A==", "dev": true, + "license": "MIT", "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", "cors": "~2.8.5", - "debug": "~4.3.2", - "engine.io": "~6.5.2", + "debug": "~4.4.1", + "engine.io": "~6.6.0", "socket.io-adapter": "~2.5.2", "socket.io-parser": "~4.2.4" }, @@ -5751,23 +6605,25 @@ } }, "node_modules/socket.io-adapter": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.4.tgz", - "integrity": "sha512-wDNHGXGewWAjQPt3pyeYBtpWSq9cLE5UW1ZUPL/2eGK9jtse/FpXib7epSTsz0Q0m+6sg6Y4KtcFTlah1bdOVg==", + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.7.tgz", + "integrity": "sha512-e0LyK91f3cUxTmv95/KzoLg47+zF+s/sbxRGDNsyG4dmIP8ZSX8ax6byOxfJXeNNtS/8AZlfD+uP7gBeR7DLlg==", "dev": true, + "license": "MIT", "dependencies": { - "debug": "~4.3.4", - "ws": "~8.11.0" + "debug": "~4.4.1", + "ws": "~8.20.1" } }, "node_modules/socket.io-parser": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", - "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.6.tgz", + "integrity": "sha512-asJqbVBDsBCJx0pTqw3WfesSY0iRX+2xzWEWzrpcH7L6fLzrhyF8WPI8UaeM4YCuDfpwA/cgsdugMsmtz8EJeg==", "dev": true, + "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" + "debug": "~4.4.1" }, "engines": { "node": ">=10.0.0" @@ -5778,6 +6634,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -5787,21 +6644,24 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "node_modules/spawn-wrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-3.0.0.tgz", + "integrity": "sha512-z+s5vv4KzFPJVddGab0xX2n7kQPGMdNUX5l9T8EJqsXdKTWpcxmAqWHpsgHEXoC1taGBCc7b79bi62M5kdbrxQ==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { + "cross-spawn": "^7.0.6", "foreground-child": "^2.0.0", "is-windows": "^1.0.2", "make-dir": "^3.0.0", - "rimraf": "^3.0.0", + "rimraf": "^6.1.3", "signal-exit": "^3.0.2", "which": "^2.0.1" }, @@ -5809,17 +6669,71 @@ "node": ">=8" } }, + "node_modules/spawn-wrap/node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/spawn-wrap/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/spawn-wrap/node_modules/rimraf": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "glob": "^13.0.3", + "package-json-from-dist": "^1.0.1" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -5829,6 +6743,7 @@ "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz", "integrity": "sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==", "dev": true, + "license": "MIT", "dependencies": { "date-format": "^4.0.14", "debug": "^4.3.4", @@ -5843,46 +6758,85 @@ "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6.19" } }, "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz", + "integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==", "dev": true, + "license": "MIT", "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" }, "engines": { - "node": ">=12" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=12" + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "engines": { + "node": ">=8" } }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^6.2.2" }, "engines": { "node": ">=12" @@ -5891,11 +6845,13 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/strip-ansi": { + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5903,25 +6859,24 @@ "node": ">=8" } }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" } }, "node_modules/strip-json-comments": { @@ -5929,6 +6884,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -5937,15 +6893,19 @@ } }, "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/supports-preserve-symlinks-flag": { @@ -5953,6 +6913,7 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -5960,98 +6921,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/table/node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/table/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/terser": { - "version": "5.29.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.29.1.tgz", - "integrity": "sha512-lZQ/fyaIGxsbGxApKmoPTODIzELy3++mXhS5hOqaAWZjQtpq/hFHAc+rm29NND1rYRxRWKcjuARNwULNXa5RtQ==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.48.0.tgz", + "integrity": "sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", + "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -6062,70 +6940,74 @@ "node": ">=10" } }, - "node_modules/terser/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-8.0.0.tgz", + "integrity": "sha512-ZOffsNrXYggvU1mDGHk54I96r26P8SyMjO5slMKSc7+IWmtB/MQKnEC2fP51imB3/pT6YK5cT5E8f+Dd9KdyOQ==", "dev": true, + "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "glob": "^13.0.6", + "minimatch": "^10.2.2" }, "engines": { - "node": ">=8" + "node": "20 || >=22" } }, - "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/test-exclude/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/tinyexec": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, + "license": "MIT", "engines": { - "node": "*" + "node": ">=18" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "node_modules/tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, "engines": { - "node": ">=14.14" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "node_modules/tmp": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.7.tgz", + "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==", "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=14.14" } }, "node_modules/to-regex-range": { @@ -6133,6 +7015,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -6145,20 +7028,22 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=16" + "node": ">=18.12" }, "peerDependencies": { - "typescript": ">=4.2.0" + "typescript": ">=4.8.4" } }, "node_modules/ts-node": { @@ -6166,6 +7051,7 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, + "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -6205,25 +7091,28 @@ } }, "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -6232,24 +7121,23 @@ } }, "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/type-is": { @@ -6257,6 +7145,7 @@ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, + "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -6270,15 +7159,17 @@ "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, + "license": "MIT", "dependencies": { "is-typedarray": "^1.0.0" } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6287,10 +7178,34 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.61.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.61.0.tgz", + "integrity": "sha512-8y31Rd0eGTrDKqhy6vT0HtzhN+YLjQizwX3aA3hPXP/ynSfnrBXcQY5IzsP9/DM7+klX4IUncZZjkchP0z+rUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.61.0", + "@typescript-eslint/parser": "8.61.0", + "@typescript-eslint/typescript-estree": "8.61.0", + "@typescript-eslint/utils": "8.61.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, "node_modules/ua-parser-js": { - "version": "0.7.37", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.37.tgz", - "integrity": "sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA==", + "version": "0.7.41", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.41.tgz", + "integrity": "sha512-O3oYyCMPYgNNHuO7Jjk3uacJWZF8loBgwrfd/5LE/HyZ3lUIOdniQ7DNXJcIgZbwioZxk0fLfI4EVnetdiX5jg==", "dev": true, "funding": [ { @@ -6306,21 +7221,27 @@ "url": "https://github.com/sponsors/faisalman" } ], + "license": "MIT", + "bin": { + "ua-parser-js": "script/cli.js" + }, "engines": { "node": "*" } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "dev": true, + "license": "MIT" }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4.0.0" } @@ -6330,14 +7251,15 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", "dev": true, "funding": [ { @@ -6353,9 +7275,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -6369,45 +7292,44 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, + "node_modules/uri-js/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4.0" } }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", - "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", - "dev": true - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -6417,6 +7339,7 @@ "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -6426,6 +7349,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -6440,81 +7364,137 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", - "dev": true + "dev": true, + "license": "ISC" + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", + "dev": true, + "license": "Apache-2.0" }, "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-10.0.0.tgz", + "integrity": "sha512-SGcvg80f0wUy2/fXES19feHMz8E0JoXv2uNgHOu4Dgi2OrCy1lqwFYEJz1BLbDI0exjPMe/ZdzZ/YpGECBG/aQ==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^6.2.3", + "string-width": "^8.2.0", + "strip-ansi": "^7.1.2" }, "engines": { - "node": ">=12" + "node": ">=20" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=12" + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "engines": { + "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^5.0.1" }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, + "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", @@ -6523,16 +7503,17 @@ } }, "node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "version": "8.20.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz", + "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -6548,6 +7529,7 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -6556,15 +7538,24 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/yaml": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", - "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "yaml": "bin.mjs" + }, "engines": { - "node": ">= 14" + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" } }, "node_modules/yargs": { @@ -6572,6 +7563,7 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -6586,12 +7578,13 @@ } }, "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, + "license": "ISC", "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-unparser": { @@ -6599,6 +7592,7 @@ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, + "license": "MIT", "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", @@ -6614,6 +7608,7 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -6626,6 +7621,7 @@ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -6633,17 +7629,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } }, "node_modules/yargs/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -6653,6 +7654,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6662,11 +7664,35 @@ "node": ">=8" } }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -6676,6 +7702,7 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index e8b003c..e9f108d 100644 --- a/package.json +++ b/package.json @@ -105,45 +105,48 @@ }, "homepage": "https://github.com/Caligatio/jsSHA", "devDependencies": { - "@rollup/plugin-terser": "^0.4.3", - "@rollup/plugin-typescript": "^11.1.2", - "@types/chai": "^4.3.5", - "@types/mocha": "^10.0.1", - "@types/rewire": "^2.5.28", - "@types/sinon": "^10.0.16", - "@typescript-eslint/eslint-plugin": "^6.2.1", - "@typescript-eslint/parser": "^6.2.1", - "chai": "^4.3.7", - "eslint": "^8.46.0", - "husky": "^8.0.3", - "karma": "^6.4.2", + "@eslint/js": "^10.0.1", + "@rollup/plugin-terser": "^1.0.0", + "@rollup/plugin-typescript": "^12.3.0", + "@types/chai": "^5.2.3", + "@types/mocha": "^10.0.10", + "@types/rewire": "^2.5.30", + "@types/sinon": "^21.0.1", + "chai": "^4.5.0", + "eslint": "^10.5.0", + "husky": "^9.1.7", + "karma": "^6.4.4", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^3.2.0", - "karma-firefox-launcher": "^2.1.2", + "karma-firefox-launcher": "^2.1.3", "karma-mocha": "^2.0.1", - "lint-staged": "^13.2.3", - "mocha": "^10.2.0", - "nyc": "^15.1.0", - "prettier": "^3.0.1", - "rewire": "^6.0.0", - "rollup": "^3.27.2", - "rollup-plugin-dts": "^5.3.1", - "sinon": "^15.2.0", - "ts-node": "^10.9.1", - "tslib": "^2.6.1", - "typescript": "<5.5" + "lint-staged": "^17.0.7", + "mocha": "^11.7.6", + "nyc": "^18.0.0", + "prettier": "^3.8.4", + "rewire": "^9.0.1", + "rollup": "^4.62.0", + "rollup-plugin-dts": "^6.4.1", + "sinon": "^22.0.0", + "ts-node": "^10.9.2", + "tslib": "^2.8.1", + "typescript": "<5.5", + "typescript-eslint": "^8.61.0" }, "scripts": { "build": "rollup -c", "test": "nyc --reporter=html --reporter=text mocha test/src/*.ts", "test_dist": "mocha test/dist/ && karma start karma.conf.js --file-variant sha && karma start karma.conf.js --file-variant sha1 && karma start karma.conf.js --file-variant sha256 && karma start karma.conf.js --file-variant sha512 && karma start karma.conf.js --file-variant sha3", - "prepare": "husky install" + "prepare": "husky" }, "mocha": { "require": [ "ts-node/register" ], - "timeout": 10000 + "timeout": 10000, + "node-option": [ + "no-experimental-strip-types" + ] }, "nyc": { "require": [ diff --git a/src/common.ts b/src/common.ts index 63f6de2..7249494 100644 --- a/src/common.ts +++ b/src/common.ts @@ -128,7 +128,7 @@ export function parseInputOption( key: string, value: GenericInputType | undefined, bigEndianMod: -1 | 1, - fallback?: packedValue + fallback?: packedValue, ): packedValue { const errStr = key + " must include a value and format"; if (!value) { @@ -144,10 +144,9 @@ export function parseInputOption( return getStrConverter( value["format"], - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - the value of encoding gets value checked by getStrConverter value["encoding"] || "UTF8", - bigEndianMod + bigEndianMod, )(value["value"]); } @@ -189,7 +188,7 @@ export abstract class jsSHABase { remainderBinLen: number, processedBinLen: number, H: StateT, - outputLen: number + outputLen: number, ) => number[]; protected abstract readonly stateCloneFunc: (state: StateT) => StateT; protected abstract readonly newStateFunc: (variant: VariantT) => StateT; @@ -205,7 +204,6 @@ export abstract class jsSHABase { this.utfType = inputOptions["encoding"] || "UTF8"; this.numRounds = inputOptions["numRounds"] || 1; - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ // @ts-ignore - The spec actually says ToString is called on the first parseInt argument so it's OK to use it here // to check if an arugment is an integer. This cheat would break if it's used to get the value of the argument. if (isNaN(this.numRounds) || this.numRounds !== parseInt(this.numRounds, 10) || 1 > this.numRounds) { @@ -289,7 +287,7 @@ export abstract class jsSHABase { this.remainderLen, this.processedLen, this.stateCloneFunc(this.intermediateState), - outputBinLen + outputBinLen, ); for (i = 1; i < this.numRounds; i += 1) { /* Need to mask out bits that should be zero due to output not being a multiple of 32 */ @@ -301,7 +299,7 @@ export abstract class jsSHABase { outputBinLen, 0, this.newStateFunc(this.shaVariant), - outputBinLen + outputBinLen, ); } @@ -360,7 +358,7 @@ export abstract class jsSHABase { key["binLen"], 0, this.newStateFunc(this.shaVariant), - this.outputBinLen + this.outputBinLen, ); } while (key["value"].length <= lastArrayIndex) { @@ -413,7 +411,7 @@ export abstract class jsSHABase { this.remainderLen, this.processedLen, this.stateCloneFunc(this.intermediateState), - this.outputBinLen + this.outputBinLen, ); finalizedState = this.roundFunc(this.keyWithOPad, this.newStateFunc(this.shaVariant)); finalizedState = this.finalizeFunc( @@ -421,7 +419,7 @@ export abstract class jsSHABase { this.outputBinLen, this.variantBlockSize, finalizedState, - this.outputBinLen + this.outputBinLen, ); return finalizedState; diff --git a/src/converters.ts b/src/converters.ts index 43260fe..d088b60 100644 --- a/src/converters.ts +++ b/src/converters.ts @@ -26,7 +26,7 @@ function str2packed( utfType: EncodingType, existingPacked: number[] | undefined, existingPackedLen: number | undefined, - bigEndianMod: -1 | 1 + bigEndianMod: -1 | 1, ): packedValue { let codePnt, codePntArr, @@ -62,7 +62,7 @@ function str2packed( 0xf0 | (codePnt >>> 18), 0x80 | ((codePnt >>> 12) & 0x3f), 0x80 | ((codePnt >>> 6) & 0x3f), - 0x80 | (codePnt & 0x3f) + 0x80 | (codePnt & 0x3f), ); } @@ -116,7 +116,7 @@ function hex2packed( str: string, existingPacked: number[] | undefined, existingPackedLen: number | undefined, - bigEndianMod: -1 | 1 + bigEndianMod: -1 | 1, ): packedValue { let i, num, intOffset, byteOffset; @@ -159,7 +159,7 @@ function bytes2packed( str: string, existingPacked: number[] | undefined, existingPackedLen: number | undefined, - bigEndianMod: -1 | 1 + bigEndianMod: -1 | 1, ): packedValue { let codePnt, i, intOffset, byteOffset; @@ -195,7 +195,7 @@ function b642packed( str: string, existingPacked: number[] | undefined, existingPackedLen: number | undefined, - bigEndianMod: -1 | 1 + bigEndianMod: -1 | 1, ): packedValue { let byteCnt = 0, index, @@ -258,7 +258,7 @@ function uint8array2packed( arr: Uint8Array, existingPacked: number[] | undefined, existingPackedLen: number | undefined, - bigEndianMod: -1 | 1 + bigEndianMod: -1 | 1, ): packedValue { let i, intOffset, byteOffset; @@ -292,7 +292,7 @@ function arraybuffer2packed( arr: ArrayBuffer, existingPacked: number[] | undefined, existingPackedLen: number | undefined, - bigEndianMod: -1 | 1 + bigEndianMod: -1 | 1, ): packedValue { return uint8array2packed(new Uint8Array(arr), existingPacked, existingPackedLen, bigEndianMod); } @@ -308,7 +308,7 @@ function arraybuffer2packed( export function getStrConverter( format: FormatType, utfType: EncodingType, - bigEndianMod: -1 | 1 + bigEndianMod: -1 | 1, /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ ): (input: any, existingBin?: number[], existingBinLen?: number) => packedValue { /* Validate encoding */ @@ -369,7 +369,7 @@ export function getStrConverter( case "ARRAYBUFFER": try { new ArrayBuffer(0); - } catch (ignore) { + } catch { throw new Error(arraybuffer_error); } /** @@ -384,7 +384,7 @@ export function getStrConverter( case "UINT8ARRAY": try { new Uint8Array(0); - } catch (ignore) { + } catch { throw new Error(uint8array_error); } /** @@ -417,7 +417,7 @@ export function packed2hex( packed: number[], outputLength: number, bigEndianMod: -1 | 1, - formatOpts: { outputUpper: boolean; b64Pad: string } + formatOpts: { outputUpper: boolean; b64Pad: string }, ): string { const hex_tab = "0123456789abcdef"; let str = "", @@ -449,7 +449,7 @@ export function packed2b64( packed: number[], outputLength: number, bigEndianMod: -1 | 1, - formatOpts: { outputUpper: boolean; b64Pad: string } + formatOpts: { outputUpper: boolean; b64Pad: string }, ): string { let str = "", i, @@ -560,19 +560,19 @@ export function getOutputConverter( format: "HEX" | "B64" | "BYTES", outputBinLen: number, bigEndianMod: -1 | 1, - outputOptions: { outputUpper: boolean; b64Pad: string } + outputOptions: { outputUpper: boolean; b64Pad: string }, ): (binarray: number[]) => string; export function getOutputConverter( format: "ARRAYBUFFER", outputBinLen: number, bigEndianMod: -1 | 1, - outputOptions: { outputUpper: boolean; b64Pad: string } + outputOptions: { outputUpper: boolean; b64Pad: string }, ): (binarray: number[]) => ArrayBuffer; export function getOutputConverter( format: "UINT8ARRAY", outputBinLen: number, bigEndianMod: -1 | 1, - outputOptions: { outputUpper: boolean; b64Pad: string } + outputOptions: { outputUpper: boolean; b64Pad: string }, ): (binarray: number[]) => Uint8Array; /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ export function getOutputConverter(format: any, outputBinLen: any, bigEndianMod: any, outputOptions: any): any { @@ -593,7 +593,7 @@ export function getOutputConverter(format: any, outputBinLen: any, bigEndianMod: try { /* Need to test ArrayBuffer support */ new ArrayBuffer(0); - } catch (ignore) { + } catch { throw new Error(arraybuffer_error); } return function (binarray: number[]): ArrayBuffer { @@ -603,7 +603,7 @@ export function getOutputConverter(format: any, outputBinLen: any, bigEndianMod: try { /* Need to test Uint8Array support */ new Uint8Array(0); - } catch (ignore) { + } catch { throw new Error(uint8array_error); } return function (binarray: number[]): Uint8Array { diff --git a/src/sha3.ts b/src/sha3.ts index 280158b..79fea52 100644 --- a/src/sha3.ts +++ b/src/sha3.ts @@ -104,7 +104,7 @@ function roundSHA3(block: number[] | null, state: Int_64[][]): Int_64[][] { for (x = 0; x < block.length; x += 2) { state[(x >>> 1) % 5][((x >>> 1) / 5) | 0] = xor_64_2( state[(x >>> 1) % 5][((x >>> 1) / 5) | 0], - new Int_64(block[x + 1], block[x]) + new Int_64(block[x + 1], block[x]), ); } } @@ -140,8 +140,8 @@ function roundSHA3(block: number[] | null, state: Int_64[][]): Int_64[][] { B[x][y], new Int_64( ~B[(x + 1) % 5][y].highOrder & B[(x + 2) % 5][y].highOrder, - ~B[(x + 1) % 5][y].lowOrder & B[(x + 2) % 5][y].lowOrder - ) + ~B[(x + 1) % 5][y].lowOrder & B[(x + 2) % 5][y].lowOrder, + ), ); } } @@ -172,7 +172,7 @@ function finalizeSHA3( state: Int_64[][], blockSize: number, delimiter: number, - outputLen: number + outputLen: number, ): number[] { let i, state_offset = 0, @@ -362,7 +362,7 @@ export default class jsSHA extends jsSHABase { remainderBinLen: number, processedBinLen: number, H: Int_64[][], - outputLen: number + outputLen: number, ) => number[]; stateCloneFunc: (state: Int_64[][]) => Int_64[][]; newStateFunc: (variant: VariantType) => Int_64[][]; @@ -372,7 +372,7 @@ export default class jsSHA extends jsSHABase { constructor( variant: FixedLengthVariantType, inputFormat: FormatNoTextType, - options?: FixedLengthOptionsNoEncodingType + options?: FixedLengthOptionsNoEncodingType, ); constructor(variant: "SHAKE128" | "SHAKE256", inputFormat: "TEXT", options?: SHAKEOptionsEncodingType); constructor(variant: "SHAKE128" | "SHAKE256", inputFormat: FormatNoTextType, options?: SHAKEOptionsNoEncodingType); @@ -505,7 +505,7 @@ export default class jsSHA extends jsSHABase { state, variantBlockSize, delimiter, - outputBinLen + outputBinLen, ); }; @@ -528,7 +528,7 @@ export default class jsSHA extends jsSHABase { } const packedParams = packedLEConcat( encode_string(resolvedOptions["funcName"]), - encode_string(resolvedOptions["customization"]) + encode_string(resolvedOptions["customization"]), ); /* CSHAKE is defined to be a call to SHAKE iff both the customization and function-name string are both empty. This @@ -538,7 +538,7 @@ export default class jsSHA extends jsSHABase { for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) { this.intermediateState = this.roundFunc( byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)), - this.intermediateState + this.intermediateState, ); this.processedLen += this.variantBlockSize; } @@ -561,7 +561,7 @@ export default class jsSHA extends jsSHABase { for (let i = 0; i < byte_pad_out.length; i += this.variantBlockSize >>> 5) { this.intermediateState = this.roundFunc( byte_pad_out.slice(i, i + (this.variantBlockSize >>> 5)), - this.intermediateState + this.intermediateState, ); this.processedLen += this.variantBlockSize; } @@ -574,11 +574,10 @@ export default class jsSHA extends jsSHABase { * @param options Hashmap of extra outputs options. `outputLen` must be specified. * @returns The KMAC in the format specified. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any protected _getKMAC(options: { outputLen: number }): number[] { const concatedRemainder = packedLEConcat( { value: this.remainder.slice(), binLen: this.remainderLen }, - right_encode(options["outputLen"]) + right_encode(options["outputLen"]), ); return this.finalizeFunc( @@ -586,7 +585,7 @@ export default class jsSHA extends jsSHABase { concatedRemainder["binLen"], this.processedLen, this.stateCloneFunc(this.intermediateState), - options["outputLen"] + options["outputLen"], ); } } diff --git a/src/sha512.ts b/src/sha512.ts index 4156618..718a96f 100644 --- a/src/sha512.ts +++ b/src/sha512.ts @@ -204,7 +204,7 @@ function finalizeSHA512( remainderBinLen: number, processedBinLen: number, H: Int_64[], - variant: VariantType + variant: VariantType, ): number[] { let i, retVal; @@ -236,7 +236,6 @@ function finalizeSHA512( } if ("SHA-384" === variant) { - H = (H as unknown) as Int_64[]; retVal = [ H[0].highOrder, H[0].lowOrder, diff --git a/test/dist/test_esm.mjs b/test/dist/test_esm.mjs index 98c747e..435bb2e 100644 --- a/test/dist/test_esm.mjs +++ b/test/dist/test_esm.mjs @@ -1,7 +1,7 @@ import jsSHA from "../../dist/sha.mjs"; import hashData from "../hash_data.js"; import mocha from "mocha"; -import chai from "chai"; +import { assert } from "chai"; function testVariant(variant) { let success = true; @@ -16,7 +16,7 @@ function testVariant(variant) { mocha.it(test.name + " - Old Style", () => { hashObj.setHMACKey(test.hmacKey.value, test.hmacKey.format); hashObj.update(test.input.value); - chai.assert.equal(hashObj.getHMAC(output.format), output.value); + assert.equal(hashObj.getHMAC(output.format), output.value); }); } const hashObj = new jsSHA(variant, test.input.format, { @@ -27,7 +27,7 @@ function testVariant(variant) { }); mocha.it(test.name, () => { hashObj.update(test.input.value); - chai.assert.equal(hashObj.getHash(output.format, { outputLen: output.outputLen || 8 }), output.value); + assert.equal(hashObj.getHash(output.format, { outputLen: output.outputLen || 8 }), output.value); }); }); }); diff --git a/test/hash_data.js b/test/hash_data.js index 3141037..41f0882 100644 --- a/test/hash_data.js +++ b/test/hash_data.js @@ -1,10 +1,11 @@ /* globals module, define, self */ (function (global, factory) { + /* eslint-disable-next-line @typescript-eslint/no-unused-expressions */ typeof exports === "object" && typeof module !== "undefined" ? (module.exports = factory()) : typeof define === "function" && define.amd - ? define(factory) - : ((global = global || self), (global.hashData = factory())); + ? define(factory) + : ((global = global || self), (global.hashData = factory())); })(this, function () { "use strict"; diff --git a/test/src/common.ts b/test/src/common.ts index bc26c7d..a4529f2 100644 --- a/test/src/common.ts +++ b/test/src/common.ts @@ -20,7 +20,7 @@ export function runHashTests( | "KMAC128" | "KMAC256", // eslint-disable-next-line @typescript-eslint/no-explicit-any - jsSHA: any + jsSHA: any, ): void { describe(`Test jsSHA(${variant}) Using NIST Tests`, () => { hashData[variant].forEach((test) => { @@ -28,7 +28,6 @@ export function runHashTests( if (test.hmacKey) { it(test.name + " - Old Style", () => { const hashObj = new jsSHA(variant, test.input.format); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore hashObj.setHMACKey(test.hmacKey.value, test.hmacKey.format); hashObj.update(test.input.value); diff --git a/test/src/test_common.ts b/test/src/test_common.ts index 889ce71..187b61e 100644 --- a/test/src/test_common.ts +++ b/test/src/test_common.ts @@ -56,7 +56,6 @@ describe("Test parseInputOption", () => { it("For Value Missing value Key", () => { assert.throws(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberately bad value for test parseInputOption("kmacKey", { format: "HEX" }, 1); }, "kmacKey must include a value and format"); @@ -64,7 +63,6 @@ describe("Test parseInputOption", () => { it("For Value Missing binLen Key", () => { assert.throws(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberately bad value for test parseInputOption("kmacKey", { value: "TEST" }, 1); }, "kmacKey must include a value and format"); @@ -102,7 +100,6 @@ describe("Test getOutputOpts", () => { it("Invalid b64Pad", () => { assert.throws(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberate bad b64Pad value to test exceptions getOutputOpts({ b64Pad: 1 }); }, "Invalid b64Pad formatting option"); @@ -110,7 +107,6 @@ describe("Test getOutputOpts", () => { it("Invalid outputUpper", () => { assert.throws(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberate bad outputUpper value to test exceptions getOutputOpts({ outputUpper: 1 }); }, "Invalid outputUpper formatting option"); @@ -154,7 +150,7 @@ describe("Test jsSHABase", () => { this.converterFunc = stubbedStrConverter; this.roundFunc = stubbedRound; this.stateCloneFunc = stubbedStateClone; - this.newStateFunc = stubbedNewState as unknown as (variant: "SHA-TEST") => number[]; + this.newStateFunc = stubbedNewState; this.finalizeFunc = stubbedFinalize; // eslint-disable-next-line @typescript-eslint/unbound-method this.getMAC = this._getHMAC; @@ -171,7 +167,6 @@ describe("Test jsSHABase", () => { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any getter(propName: string): any { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Override "any" ban as this is only used in testing return this[propName]; } @@ -181,7 +176,6 @@ describe("Test jsSHABase", () => { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any setter(propName: string, value: any): void { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Override "any" ban as this is only used in testing this[propName] = value; } @@ -303,8 +297,8 @@ describe("Test jsSHABase", () => { 32, 64, [dummyVals[2], dummyVals[3]], - stubbedJsSHA.getter("outputBinLen") - ) + stubbedJsSHA.getter("outputBinLen"), + ), ); }); @@ -391,7 +385,7 @@ describe("Test jsSHABase", () => { stubbedJsSHA.getter("keyWithIPad"), [0x41424344, 0].map((val) => { return val ^ 0x36363636; - }) + }), ); // Check #2 @@ -399,7 +393,7 @@ describe("Test jsSHABase", () => { stubbedJsSHA.getter("keyWithOPad"), [0x41424344, 0].map((val) => { return val ^ 0x5c5c5c5c; - }) + }), ); // Check #3 @@ -408,8 +402,8 @@ describe("Test jsSHABase", () => { [0x41424344, 0].map((val) => { return val ^ 0x36363636; }), - [0, 0] - ) + [0, 0], + ), ); assert.deepEqual(stubbedJsSHA.getter("intermediateState"), [dummyVals[0], dummyVals[1]]); @@ -446,8 +440,8 @@ describe("Test jsSHABase", () => { 96, 0, [dummyVals[4], dummyVals[5]], - stubbedJsSHA.getter("outputBinLen") - ) + stubbedJsSHA.getter("outputBinLen"), + ), ); // Check #2 @@ -455,7 +449,7 @@ describe("Test jsSHABase", () => { stubbedJsSHA.getter("keyWithIPad"), [dummyVals[0], dummyVals[1]].map((val) => { return val ^ 0x36363636; - }) + }), ); // Check #3 @@ -463,7 +457,7 @@ describe("Test jsSHABase", () => { stubbedJsSHA.getter("keyWithOPad"), [dummyVals[0], dummyVals[1]].map((val) => { return val ^ 0x5c5c5c5c; - }) + }), ); // Check #4 @@ -472,8 +466,8 @@ describe("Test jsSHABase", () => { [dummyVals[0], dummyVals[1]].map((val) => { return val ^ 0x36363636; }), - [0, 0] - ) + [0, 0], + ), ); assert.deepEqual(stubbedJsSHA.getter("intermediateState"), [dummyVals[2], dummyVals[3]]); }); @@ -563,7 +557,7 @@ describe("Test jsSHABase", () => { 32, stubbedJsSHA.getter("outputBinLen"), clonedState, - stubbedJsSHA.getter("outputBinLen") + stubbedJsSHA.getter("outputBinLen"), ); // Check #3 @@ -577,7 +571,7 @@ describe("Test jsSHABase", () => { stubbedJsSHA.getter("outputBinLen"), stubbedJsSHA.getter("variantBlockSize"), [dummyVals[4], dummyVals[5]], - stubbedJsSHA.getter("outputBinLen") + stubbedJsSHA.getter("outputBinLen"), ); // Check #5 diff --git a/test/src/test_converters.ts b/test/src/test_converters.ts index 539a934..d43f17e 100644 --- a/test/src/test_converters.ts +++ b/test/src/test_converters.ts @@ -43,9 +43,9 @@ function toPackedTestsBuilder( input: any, existingBin: number[] | undefined, existingBinLen: number | undefined, - bigEndianMod: -1 | 1 + bigEndianMod: -1 | 1, ) => packedValue, - inputType: "hex" | "b64" | "arrayBuffer" | "uint8Array" + inputType: "hex" | "b64" | "arrayBuffer" | "uint8Array", ): void { toPackedTests.forEach((test) => { it(`${test.name} - No Existing Input`, () => { @@ -60,7 +60,7 @@ function toPackedTestsBuilder( { value: test.outputs.existing, binLen: test.outputs.length + test.inputs.lengthExisting, - } + }, ); }); it(`${test.name} - No Existing Input with Endian Modifier`, () => { @@ -75,7 +75,7 @@ function toPackedTestsBuilder( { value: test.outputs.existingMod, binLen: test.outputs.length + test.inputs.lengthExisting, - } + }, ); }); }); @@ -311,7 +311,7 @@ describe("Test str2packed", () => { { value: test.outputs.utf8Existing, binLen: test.outputs.lengthUtf8 + test.inputs.lengthExisting, - } + }, ); }); }); @@ -341,7 +341,7 @@ describe("Test str2packed", () => { { value: test.outputs.utf16leExisting, binLen: test.outputs.lengthUtf16 + test.inputs.lengthExisting, - } + }, ); }); }); @@ -371,7 +371,7 @@ describe("Test str2packed", () => { { value: test.outputs.utf16beExisting, binLen: test.outputs.lengthUtf16 + test.inputs.lengthExisting, - } + }, ); }); }); @@ -449,7 +449,7 @@ describe("Test packed2arraybuffer", () => { it("64-bit Input", () => { assert.deepEqual( packed2arraybuffer(packedToInput, 64, -1), - newArrayBuffer([0, 0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc, 0xdd]) + newArrayBuffer([0, 0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc, 0xdd]), ); }); it("16-bit Input with Endian Modifier", () => { @@ -458,7 +458,7 @@ describe("Test packed2arraybuffer", () => { it("64-bit with Endian Modifier", () => { assert.deepEqual( packed2arraybuffer(packedToInput, 64, 1), - newArrayBuffer([0x33, 0x22, 0x11, 0, 0xdd, 0xcc, 0xbb, 0xaa]) + newArrayBuffer([0x33, 0x22, 0x11, 0, 0xdd, 0xcc, 0xbb, 0xaa]), ); }); }); @@ -472,7 +472,7 @@ describe("Test packed2uint8array", () => { it("64-bit Input", () => { assert.deepEqual( packed2uint8array(packedToInput, 64, -1), - Uint8Array.from([0, 0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc, 0xdd]) + Uint8Array.from([0, 0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc, 0xdd]), ); }); it("16-bit Input with Endian Modifier", () => { @@ -481,7 +481,7 @@ describe("Test packed2uint8array", () => { it("64-bit with Endian Modifier", () => { assert.deepEqual( packed2uint8array(packedToInput, 64, 1), - Uint8Array.from([0x33, 0x22, 0x11, 0, 0xdd, 0xcc, 0xbb, 0xaa]) + Uint8Array.from([0x33, 0x22, 0x11, 0, 0xdd, 0xcc, 0xbb, 0xaa]), ); }); }); @@ -495,7 +495,7 @@ describe("Test packed2uint8array", () => { it("64-bit Input", () => { assert.deepEqual( packed2uint8array(packedToInput, 64, -1), - Uint8Array.from([0, 0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc, 0xdd]) + Uint8Array.from([0, 0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc, 0xdd]), ); }); it("16-bit Input with Endian Modifier", () => { @@ -504,7 +504,7 @@ describe("Test packed2uint8array", () => { it("64-bit with Endian Modifier", () => { assert.deepEqual( packed2uint8array(packedToInput, 64, 1), - Uint8Array.from([0x33, 0x22, 0x11, 0, 0xdd, 0xcc, 0xbb, 0xaa]) + Uint8Array.from([0x33, 0x22, 0x11, 0, 0xdd, 0xcc, 0xbb, 0xaa]), ); }); }); @@ -545,7 +545,6 @@ describe("Test getStrConverter", () => { it("Invalid UTF Exception", () => { assert.throws(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberate bad UTF value to test exceptions getStrConverter("HEX", "UTF32", -1); }, "encoding must be UTF8, UTF16BE, or UTF16LE"); diff --git a/test/src/test_sha.ts b/test/src/test_sha.ts index 26567fb..4b54c17 100644 --- a/test/src/test_sha.ts +++ b/test/src/test_sha.ts @@ -17,14 +17,12 @@ import { runHashTests } from "./common"; "SHAKE128", "SHAKE256", ].forEach((variant) => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Typescript doesn't understand the above array contains only valid values runHashTests(variant, jsSHA); }); describe("Test jsSHA Constructor", () => { it("Invalid Variant", () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberate bad variant value assert.throws(() => new jsSHA("SHA-TEST", "HEX"), "Chosen SHA variant is not supported"); }); diff --git a/test/src/test_sha1.ts b/test/src/test_sha1.ts index cf00c30..a5772d6 100644 --- a/test/src/test_sha1.ts +++ b/test/src/test_sha1.ts @@ -62,7 +62,6 @@ describe("Test jsSHA(SHA-1)", () => { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any getter(propName: string): any { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Override "any" ban as this is only used in testing return this[propName]; } @@ -107,7 +106,6 @@ describe("Test jsSHA(SHA-1)", () => { }); it("With Invalid Variant", () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberate bad variant value to test exceptions assert.throws(() => new jsSHA("SHA-TEST", "HEX"), "Chosen SHA variant is not supported"); }); diff --git a/test/src/test_sha256.ts b/test/src/test_sha256.ts index 7c04761..eabb6cf 100644 --- a/test/src/test_sha256.ts +++ b/test/src/test_sha256.ts @@ -83,7 +83,7 @@ describe("Test jsSHA(SHA-256)", () => { constructor( variant: "SHA-224" | "SHA-256", inputFormat: FormatNoTextType, - options?: FixedLengthOptionsNoEncodingType + options?: FixedLengthOptionsNoEncodingType, ); // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(variant: any, inputFormat: any, options?: any) { @@ -95,7 +95,6 @@ describe("Test jsSHA(SHA-256)", () => { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any getter(propName: string): any { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Override "any" ban as this is only used in testing return this[propName]; } @@ -118,7 +117,6 @@ describe("Test jsSHA(SHA-256)", () => { newStateFuncSpy = sinon.spy(); sha256.__with__({ roundSHA256: roundFuncSpy, finalizeSHA256: finalizeFuncSpy, getNewState256: newStateFuncSpy })( () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const hash = new jsSHAATest(test.variant, "HEX"); @@ -143,13 +141,12 @@ describe("Test jsSHA(SHA-256)", () => { hash.getter("finalizeFunc")([0xdeadbeef], 32, 0, [0xfacefeed]); assert.isTrue(finalizeFuncSpy.lastCall.calledWithExactly([0xdeadbeef], 32, 0, [0xfacefeed], test.variant)); - } + }, ); }); }); it("With Invalid Variant", () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberate bad variant value to test exceptions assert.throws(() => new jsSHA("SHA-TEST", "HEX"), "Chosen SHA variant is not supported"); }); diff --git a/test/src/test_sha3.ts b/test/src/test_sha3.ts index d9e1906..0c04850 100644 --- a/test/src/test_sha3.ts +++ b/test/src/test_sha3.ts @@ -195,7 +195,7 @@ describe("Test resolveKMACOptions", () => { funcName: { value: [0x43414d4b], binLen: 32 }, customization: { value: [0x33221100], binLen: 32 }, kmacKey: { value: [0x77665544], binLen: 32 }, - } + }, ); }); @@ -209,7 +209,7 @@ describe("Test resolveKMACOptions", () => { funcName: { value: [0x43414d4b], binLen: 32 }, customization: { value: [], binLen: 0 }, kmacKey: { value: [0x77665544], binLen: 32 }, - } + }, ); }); }); @@ -255,9 +255,9 @@ describe("Test finalizeSHA3", () => { getNewState(), 1152, 0x06, - 224 + 224, ), - [0x6a817693, 0x723f50ba, 0xebe76cf9, 0x5d09ac65, 0x4bbee3ee, 0xa1c2bbf9, 0xe0117ecb] + [0x6a817693, 0x723f50ba, 0xebe76cf9, 0x5d09ac65, 0x4bbee3ee, 0xa1c2bbf9, 0xe0117ecb], ); }); }); @@ -272,9 +272,9 @@ describe("Test finalizeSHA3", () => { getNewState(), 1344, 0x1f, - 2048 + 2048, ), - SHAKE128Len2048Out + SHAKE128Len2048Out, ); }); }); @@ -286,13 +286,13 @@ describe("Test jsSHA(SHA3)", () => { constructor( variant: VariantNoCSHAKEType, inputFormat: FormatNoTextType, - options?: FixedLengthOptionsNoEncodingType + options?: FixedLengthOptionsNoEncodingType, ); constructor(variant: "CSHAKE128" | "CSHAKE256", inputFormat: "TEXT", options?: CSHAKEOptionsEncodingType); constructor( variant: "CSHAKE128" | "CSHAKE256", inputFormat: FormatNoTextType, - options?: CSHAKEOptionsNoEncodingType + options?: CSHAKEOptionsNoEncodingType, ); constructor(variant: "KMAC128" | "KMAC256", inputFormat: "TEXT", options: KMACOptionsEncodingType); constructor(variant: "KMAC128" | "KMAC256", inputFormat: FormatNoTextType, options: KMACOptionsNoEncodingType); @@ -306,7 +306,6 @@ describe("Test jsSHA(SHA3)", () => { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any getter(propName: string): any { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Override "any" ban as this is only used in testing return this[propName]; } @@ -315,7 +314,6 @@ describe("Test jsSHA(SHA3)", () => { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any setter(propName: string, value: any): void { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Override "any" ban as this is only used in testing this[propName] = value; } @@ -439,7 +437,6 @@ describe("Test jsSHA(SHA3)", () => { finalizeFuncSpy = sinon.spy(), newStateFuncSpy = sinon.spy(); sha3.__with__({ roundSHA3: roundFuncSpy, finalizeSHA3: finalizeFuncSpy, getNewState: newStateFuncSpy })(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const hash = new jsSHAATest(test.variant, "HEX", { customization: test.customization, kmacKey: test.kmacKey }); @@ -472,8 +469,8 @@ describe("Test jsSHA(SHA3)", () => { [[0xfacefeed]], test.variantBlockSize, test.delimiter, - test.outputBinLen - ) + test.outputBinLen, + ), ); }); }); @@ -521,7 +518,6 @@ describe("Test jsSHA(SHA3)", () => { }); it("With Invalid Variant", () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberate bad variant value to test exceptions assert.throws(() => new jsSHA("SHA-TEST", "HEX"), "Chosen SHA variant is not supported"); }); @@ -533,14 +529,14 @@ describe("Test jsSHA(SHA3)", () => { it("CSHAKE Without Customization Value", () => { assert.throws( () => new jsSHA("CSHAKE128", "HEX", { customization: { format: "TEXT" } }), - "Customization must include a value and format" + "Customization must include a value and format", ); }); it("CSHAKE Without Customization Format", () => { assert.throws( () => new jsSHA("CSHAKE128", "HEX", { customization: { value: "abc" } }), - "Customization must include a value and format" + "Customization must include a value and format", ); }); @@ -548,7 +544,7 @@ describe("Test jsSHA(SHA3)", () => { assert.throws( () => new jsSHA("CSHAKE128", "HEX", { customization: { value: "abc", format: "TEXT" }, funcName: { value: "A" } }), - "funcName must include a value and format" + "funcName must include a value and format", ); }); @@ -559,14 +555,14 @@ describe("Test jsSHA(SHA3)", () => { customization: { value: "abc", format: "TEXT" }, funcName: { format: "TEXT" }, }), - "funcName must include a value and format" + "funcName must include a value and format", ); }); it("KMAC128 With numRounds", () => { assert.throws( () => new jsSHA("KMAC128", "HEX", { numRounds: 2, kmacKey: { value: "TEST", format: "TEXT" } }), - "Cannot set numRounds with MAC" + "Cannot set numRounds with MAC", ); }); @@ -577,14 +573,14 @@ describe("Test jsSHA(SHA3)", () => { it("KMAC128 With kmacKey Missing Value", () => { assert.throws( () => new jsSHA("KMAC128", "HEX", { kmacKey: { format: "HEX" } }), - "kmacKey must include a value and format" + "kmacKey must include a value and format", ); }); it("KMAC128 With kmacKey Missing Format", () => { assert.throws( () => new jsSHA("KMAC128", "HEX", { kmacKey: { value: "AA" } }), - "kmacKey must include a value and format" + "kmacKey must include a value and format", ); }); diff --git a/test/src/test_sha512.ts b/test/src/test_sha512.ts index 779c1a5..03f0c1c 100644 --- a/test/src/test_sha512.ts +++ b/test/src/test_sha512.ts @@ -115,7 +115,7 @@ describe("Test jsSHA(SHA-512)", () => { constructor( variant: "SHA-384" | "SHA-512", inputFormat: FormatNoTextType, - options?: FixedLengthOptionsNoEncodingType + options?: FixedLengthOptionsNoEncodingType, ); // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(variant: any, inputFormat: any, options?: any) { @@ -127,7 +127,6 @@ describe("Test jsSHA(SHA-512)", () => { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any getter(propName: string): any { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Override "any" ban as this is only used in testing return this[propName]; } @@ -153,7 +152,6 @@ describe("Test jsSHA(SHA-512)", () => { finalizeSHA512: finalizeFuncSpy, getNewState512: newStateFuncSpy, })(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const hash = new jsSHAATest(test.variant, "HEX"); @@ -178,14 +176,13 @@ describe("Test jsSHA(SHA-512)", () => { hash.getter("finalizeFunc")([0xdeadbeef], 32, 0, [new Int_64(0xfacefeed, 0)]); assert.isTrue( - finalizeFuncSpy.lastCall.calledWithExactly([0xdeadbeef], 32, 0, [new Int_64(0xfacefeed, 0)], test.variant) + finalizeFuncSpy.lastCall.calledWithExactly([0xdeadbeef], 32, 0, [new Int_64(0xfacefeed, 0)], test.variant), ); }); }); }); it("With Invalid Variant", () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Deliberate bad variant value to test exceptions assert.throws(() => new jsSHA("SHA-TEST", "HEX"), "Chosen SHA variant is not supported"); });