@seven.io/client
Version:
Official API client for seven
1 lines • 874 kB
JavaScript
(function(pe,ce){typeof exports=="object"&&typeof module<"u"?ce(exports):typeof define=="function"&&define.amd?define(["exports"],ce):(pe=typeof globalThis<"u"?globalThis:pe||self,ce(pe.SevenClient={}))})(this,(function(exports){"use strict";function _mergeNamespaces(pe,ce){for(var we=0;we<ce.length;we++){const le=ce[we];if(typeof le!="string"&&!Array.isArray(le)){for(const _e in le)if(_e!=="default"&&!(_e in pe)){const ae=Object.getOwnPropertyDescriptor(le,_e);ae&&Object.defineProperty(pe,_e,ae.get?ae:{enumerable:!0,get:()=>le[_e]})}}}return Object.freeze(Object.defineProperty(pe,Symbol.toStringTag,{value:"Module"}))}const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="ARRAYBUFFER not supported by this environment",e="UINT8ARRAY not supported by this environment";function r(pe,ce,we,le){let _e,ae,Me;const ye=ce||[0],me=(we=we||0)>>>3,ge=le===-1?3:0;for(_e=0;_e<pe.length;_e+=1)Me=_e+me,ae=Me>>>2,ye.length<=ae&&ye.push(0),ye[ae]|=pe[_e]<<8*(ge+le*(Me%4));return{value:ye,binLen:8*pe.length+we}}function i$1(pe,ce,we){switch(ce){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(pe){case"HEX":return function(le,_e,ae){return(function(Me,ye,me,ge){let de,be,Se,Be;if(Me.length%2!=0)throw new Error("String of HEX type must be in byte increments");const qe=ye||[0],Re=(me=me||0)>>>3,$e=ge===-1?3:0;for(de=0;de<Me.length;de+=2){if(be=parseInt(Me.substr(de,2),16),isNaN(be))throw new Error("String of HEX type contains invalid characters");for(Be=(de>>>1)+Re,Se=Be>>>2;qe.length<=Se;)qe.push(0);qe[Se]|=be<<8*($e+ge*(Be%4))}return{value:qe,binLen:4*Me.length+me}})(le,_e,ae,we)};case"TEXT":return function(le,_e,ae){return(function(Me,ye,me,ge,de){let be,Se,Be,qe,Re,$e,Pe,ke,Ue=0;const Oe=me||[0],Ye=(ge=ge||0)>>>3;if(ye==="UTF8")for(Pe=de===-1?3:0,Be=0;Be<Me.length;Be+=1)for(be=Me.charCodeAt(Be),Se=[],128>be?Se.push(be):2048>be?(Se.push(192|be>>>6),Se.push(128|63&be)):55296>be||57344<=be?Se.push(224|be>>>12,128|be>>>6&63,128|63&be):(Be+=1,be=65536+((1023&be)<<10|1023&Me.charCodeAt(Be)),Se.push(240|be>>>18,128|be>>>12&63,128|be>>>6&63,128|63&be)),qe=0;qe<Se.length;qe+=1){for($e=Ue+Ye,Re=$e>>>2;Oe.length<=Re;)Oe.push(0);Oe[Re]|=Se[qe]<<8*(Pe+de*($e%4)),Ue+=1}else for(Pe=de===-1?2:0,ke=ye==="UTF16LE"&&de!==1||ye!=="UTF16LE"&&de===1,Be=0;Be<Me.length;Be+=1){for(be=Me.charCodeAt(Be),ke===!0&&(qe=255&be,be=qe<<8|be>>>8),$e=Ue+Ye,Re=$e>>>2;Oe.length<=Re;)Oe.push(0);Oe[Re]|=be<<8*(Pe+de*($e%4)),Ue+=2}return{value:Oe,binLen:8*Ue+ge}})(le,ce,_e,ae,we)};case"B64":return function(le,_e,ae){return(function(Me,ye,me,ge){let de,be,Se,Be,qe,Re,$e,Pe=0;const ke=ye||[0],Ue=(me=me||0)>>>3,Oe=ge===-1?3:0,Ye=Me.indexOf("=");if(Me.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(Me=Me.replace(/=/g,""),Ye!==-1&&Ye<Me.length)throw new Error("Invalid '=' found in base-64 string");for(be=0;be<Me.length;be+=4){for(qe=Me.substr(be,4),Be=0,Se=0;Se<qe.length;Se+=1)de=t.indexOf(qe.charAt(Se)),Be|=de<<18-6*Se;for(Se=0;Se<qe.length-1;Se+=1){for($e=Pe+Ue,Re=$e>>>2;ke.length<=Re;)ke.push(0);ke[Re]|=(Be>>>16-8*Se&255)<<8*(Oe+ge*($e%4)),Pe+=1}}return{value:ke,binLen:8*Pe+me}})(le,_e,ae,we)};case"BYTES":return function(le,_e,ae){return(function(Me,ye,me,ge){let de,be,Se,Be;const qe=ye||[0],Re=(me=me||0)>>>3,$e=ge===-1?3:0;for(be=0;be<Me.length;be+=1)de=Me.charCodeAt(be),Be=be+Re,Se=Be>>>2,qe.length<=Se&&qe.push(0),qe[Se]|=de<<8*($e+ge*(Be%4));return{value:qe,binLen:8*Me.length+me}})(le,_e,ae,we)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error(n)}return function(le,_e,ae){return(function(Me,ye,me,ge){return r(new Uint8Array(Me),ye,me,ge)})(le,_e,ae,we)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error(e)}return function(le,_e,ae){return r(le,_e,ae,we)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function s(pe,ce,we,le){switch(pe){case"HEX":return function(_e){return(function(ae,Me,ye,me){const ge="0123456789abcdef";let de,be,Se="";const Be=Me/8,qe=ye===-1?3:0;for(de=0;de<Be;de+=1)be=ae[de>>>2]>>>8*(qe+ye*(de%4)),Se+=ge.charAt(be>>>4&15)+ge.charAt(15&be);return me.outputUpper?Se.toUpperCase():Se})(_e,ce,we,le)};case"B64":return function(_e){return(function(ae,Me,ye,me){let ge,de,be,Se,Be,qe="";const Re=Me/8,$e=ye===-1?3:0;for(ge=0;ge<Re;ge+=3)for(Se=ge+1<Re?ae[ge+1>>>2]:0,Be=ge+2<Re?ae[ge+2>>>2]:0,be=(ae[ge>>>2]>>>8*($e+ye*(ge%4))&255)<<16|(Se>>>8*($e+ye*((ge+1)%4))&255)<<8|Be>>>8*($e+ye*((ge+2)%4))&255,de=0;de<4;de+=1)qe+=8*ge+6*de<=Me?t.charAt(be>>>6*(3-de)&63):me.b64Pad;return qe})(_e,ce,we,le)};case"BYTES":return function(_e){return(function(ae,Me,ye){let me,ge,de="";const be=Me/8,Se=ye===-1?3:0;for(me=0;me<be;me+=1)ge=ae[me>>>2]>>>8*(Se+ye*(me%4))&255,de+=String.fromCharCode(ge);return de})(_e,ce,we)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error(n)}return function(_e){return(function(ae,Me,ye){let me;const ge=Me/8,de=new ArrayBuffer(ge),be=new Uint8Array(de),Se=ye===-1?3:0;for(me=0;me<ge;me+=1)be[me]=ae[me>>>2]>>>8*(Se+ye*(me%4))&255;return de})(_e,ce,we)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error(e)}return function(_e){return(function(ae,Me,ye){let me;const ge=Me/8,de=ye===-1?3:0,be=new Uint8Array(ge);for(me=0;me<ge;me+=1)be[me]=ae[me>>>2]>>>8*(de+ye*(me%4))&255;return be})(_e,ce,we)};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(pe,ce){let we,le;const _e=pe.binLen>>>3,ae=ce.binLen>>>3,Me=_e<<3,ye=4-_e<<3;if(_e%4!=0){for(we=0;we<ae;we+=4)le=_e+we>>>2,pe.value[le]|=ce.value[we>>>2]<<Me,pe.value.push(0),pe.value[le+1]|=ce.value[we>>>2]>>>ye;return(pe.value.length<<2)-4>=ae+_e&&pe.value.pop(),{value:pe.value,binLen:pe.binLen+ce.binLen}}return{value:pe.value.concat(ce.value),binLen:pe.binLen+ce.binLen}}function l(pe){const ce={outputUpper:!1,b64Pad:"=",outputLen:-1},we=pe||{},le="Output length must be a multiple of 8";if(ce.outputUpper=we.outputUpper||!1,we.b64Pad&&(ce.b64Pad=we.b64Pad),we.outputLen){if(we.outputLen%8!=0)throw new Error(le);ce.outputLen=we.outputLen}else if(we.shakeLen){if(we.shakeLen%8!=0)throw new Error(le);ce.outputLen=we.shakeLen}if(typeof ce.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof ce.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return ce}function A(pe,ce,we,le){const _e=pe+" must include a value and format";if(!ce){if(!le)throw new Error(_e);return le}if(ce.value===void 0||!ce.format)throw new Error(_e);return i$1(ce.format,ce.encoding||"UTF8",we)(ce.value)}class E{constructor(ce,we,le){const _e=le||{};if(this.t=we,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=ce,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(ce){let we,le=0;const _e=this.m>>>5,ae=this.C(ce,this.h,this.u),Me=ae.binLen,ye=ae.value,me=Me>>>5;for(we=0;we<me;we+=_e)le+this.m<=Me&&(this.U=this.v(ye.slice(we,we+_e),this.U),le+=this.m);return this.A+=le,this.h=ye.slice(le>>>5),this.u=Me%this.m,this.l=!0,this}getHash(ce,we){let le,_e,ae=this.R;const Me=l(we);if(this.K){if(Me.outputLen===-1)throw new Error("Output length must be specified in options");ae=Me.outputLen}const ye=s(ce,ae,this.T,Me);if(this.H&&this.g)return ye(this.g(Me));for(_e=this.F(this.h.slice(),this.u,this.A,this.L(this.U),ae),le=1;le<this.numRounds;le+=1)this.K&&ae%32!=0&&(_e[_e.length-1]&=16777215>>>24-ae%32),_e=this.F(_e,ae,0,this.B(this.o),ae);return ye(_e)}setHMACKey(ce,we,le){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 _e=i$1(we,(le||{}).encoding||"UTF8",this.T);this.k(_e(ce))}k(ce){const we=this.m>>>3,le=we/4-1;let _e;if(this.numRounds!==1)throw new Error(f);if(this.H)throw new Error("MAC key already set");for(we<ce.binLen/8&&(ce.value=this.F(ce.value,ce.binLen,0,this.B(this.o),this.R));ce.value.length<=le;)ce.value.push(0);for(_e=0;_e<=le;_e+=1)this.S[_e]=909522486^ce.value[_e],this.p[_e]=1549556828^ce.value[_e];this.U=this.v(this.S,this.U),this.A=this.m,this.H=!0}getHMAC(ce,we){const le=l(we);return s(ce,this.R,this.T,le)(this.Y())}Y(){let ce;if(!this.H)throw new Error("Cannot call getHMAC without first setting MAC key");const we=this.F(this.h.slice(),this.u,this.A,this.L(this.U),this.R);return ce=this.v(this.p,this.B(this.o)),ce=this.F(we,this.R,this.m,ce,this.R),ce}}function H(pe,ce){return pe<<ce|pe>>>32-ce}function S(pe,ce){return pe>>>ce|pe<<32-ce}function b(pe,ce){return pe>>>ce}function p(pe,ce,we){return pe^ce^we}function d(pe,ce,we){return pe&ce^~pe&we}function m(pe,ce,we){return pe&ce^pe&we^ce&we}function C(pe){return S(pe,2)^S(pe,13)^S(pe,22)}function y(pe,ce){const we=(65535&pe)+(65535&ce);return(65535&(pe>>>16)+(ce>>>16)+(we>>>16))<<16|65535&we}function U(pe,ce,we,le){const _e=(65535&pe)+(65535&ce)+(65535&we)+(65535&le);return(65535&(pe>>>16)+(ce>>>16)+(we>>>16)+(le>>>16)+(_e>>>16))<<16|65535&_e}function v(pe,ce,we,le,_e){const ae=(65535&pe)+(65535&ce)+(65535&we)+(65535&le)+(65535&_e);return(65535&(pe>>>16)+(ce>>>16)+(we>>>16)+(le>>>16)+(_e>>>16)+(ae>>>16))<<16|65535&ae}function R(pe){return S(pe,7)^S(pe,18)^b(pe,3)}function K(pe){return S(pe,6)^S(pe,11)^S(pe,25)}function T(pe){return[1732584193,4023233417,2562383102,271733878,3285377520]}function g(pe,ce){let we,le,_e,ae,Me,ye,me;const ge=[];for(we=ce[0],le=ce[1],_e=ce[2],ae=ce[3],Me=ce[4],me=0;me<80;me+=1)ge[me]=me<16?pe[me]:H(ge[me-3]^ge[me-8]^ge[me-14]^ge[me-16],1),ye=me<20?v(H(we,5),d(le,_e,ae),Me,1518500249,ge[me]):me<40?v(H(we,5),p(le,_e,ae),Me,1859775393,ge[me]):me<60?v(H(we,5),m(le,_e,ae),Me,2400959708,ge[me]):v(H(we,5),p(le,_e,ae),Me,3395469782,ge[me]),Me=ae,ae=_e,_e=H(le,30),le=we,we=ye;return ce[0]=y(we,ce[0]),ce[1]=y(le,ce[1]),ce[2]=y(_e,ce[2]),ce[3]=y(ae,ce[3]),ce[4]=y(Me,ce[4]),ce}function F(pe,ce,we,le){let _e;const ae=15+(ce+65>>>9<<4),Me=ce+we;for(;pe.length<=ae;)pe.push(0);for(pe[ce>>>5]|=128<<24-ce%32,pe[ae]=4294967295&Me,pe[ae-1]=Me/o|0,_e=0;_e<pe.length;_e+=16)le=g(pe.slice(_e,_e+16),le);return le}let L=class extends E{constructor(pe,ce,we){if(pe!=="SHA-1")throw new Error(c);super(pe,ce,we);const le=we||{};this.M=!0,this.g=this.Y,this.T=-1,this.C=i$1(this.t,this.i,this.T),this.v=g,this.L=function(_e){return _e.slice()},this.B=T,this.F=F,this.U=[1732584193,4023233417,2562383102,271733878,3285377520],this.m=512,this.R=160,this.K=!1,le.hmacKey&&this.k(A("hmacKey",le.hmacKey,this.T))}};function B(pe){let ce;return ce=pe=="SHA-224"?u.slice():w.slice(),ce}function M(pe,ce){let we,le,_e,ae,Me,ye,me,ge,de,be,Se;const Be=[];for(we=ce[0],le=ce[1],_e=ce[2],ae=ce[3],Me=ce[4],ye=ce[5],me=ce[6],ge=ce[7],Se=0;Se<64;Se+=1)Be[Se]=Se<16?pe[Se]:U(S(qe=Be[Se-2],17)^S(qe,19)^b(qe,10),Be[Se-7],R(Be[Se-15]),Be[Se-16]),de=v(ge,K(Me),d(Me,ye,me),h[Se],Be[Se]),be=y(C(we),m(we,le,_e)),ge=me,me=ye,ye=Me,Me=y(ae,de),ae=_e,_e=le,le=we,we=y(de,be);var qe;return ce[0]=y(we,ce[0]),ce[1]=y(le,ce[1]),ce[2]=y(_e,ce[2]),ce[3]=y(ae,ce[3]),ce[4]=y(Me,ce[4]),ce[5]=y(ye,ce[5]),ce[6]=y(me,ce[6]),ce[7]=y(ge,ce[7]),ce}let k=class extends E{constructor(pe,ce,we){if(pe!=="SHA-224"&&pe!=="SHA-256")throw new Error(c);super(pe,ce,we);const le=we||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=i$1(this.t,this.i,this.T),this.v=M,this.L=function(_e){return _e.slice()},this.B=B,this.F=function(_e,ae,Me,ye){return(function(me,ge,de,be,Se){let Be,qe;const Re=15+(ge+65>>>9<<4),$e=ge+de;for(;me.length<=Re;)me.push(0);for(me[ge>>>5]|=128<<24-ge%32,me[Re]=4294967295&$e,me[Re-1]=$e/o|0,Be=0;Be<me.length;Be+=16)be=M(me.slice(Be,Be+16),be);return qe=Se==="SHA-224"?[be[0],be[1],be[2],be[3],be[4],be[5],be[6]]:be,qe})(_e,ae,Me,ye,pe)},this.U=B(pe),this.m=512,this.R=pe==="SHA-224"?224:256,this.K=!1,le.hmacKey&&this.k(A("hmacKey",le.hmacKey,this.T))}};class Y{constructor(ce,we){this.N=ce,this.I=we}}function N(pe,ce){let we;return ce>32?(we=64-ce,new Y(pe.I<<ce|pe.N>>>we,pe.N<<ce|pe.I>>>we)):ce!==0?(we=32-ce,new Y(pe.N<<ce|pe.I>>>we,pe.I<<ce|pe.N>>>we)):pe}function I(pe,ce){let we;return ce<32?(we=32-ce,new Y(pe.N>>>ce|pe.I<<we,pe.I>>>ce|pe.N<<we)):(we=64-ce,new Y(pe.I>>>ce|pe.N<<we,pe.N>>>ce|pe.I<<we))}function X(pe,ce){return new Y(pe.N>>>ce,pe.I>>>ce|pe.N<<32-ce)}function z(pe,ce,we){return new Y(pe.N&ce.N^pe.N&we.N^ce.N&we.N,pe.I&ce.I^pe.I&we.I^ce.I&we.I)}function x(pe){const ce=I(pe,28),we=I(pe,34),le=I(pe,39);return new Y(ce.N^we.N^le.N,ce.I^we.I^le.I)}function _(pe,ce){let we,le;we=(65535&pe.I)+(65535&ce.I),le=(pe.I>>>16)+(ce.I>>>16)+(we>>>16);const _e=(65535&le)<<16|65535&we;return we=(65535&pe.N)+(65535&ce.N)+(le>>>16),le=(pe.N>>>16)+(ce.N>>>16)+(we>>>16),new Y((65535&le)<<16|65535&we,_e)}function O(pe,ce,we,le){let _e,ae;_e=(65535&pe.I)+(65535&ce.I)+(65535&we.I)+(65535&le.I),ae=(pe.I>>>16)+(ce.I>>>16)+(we.I>>>16)+(le.I>>>16)+(_e>>>16);const Me=(65535&ae)<<16|65535&_e;return _e=(65535&pe.N)+(65535&ce.N)+(65535&we.N)+(65535&le.N)+(ae>>>16),ae=(pe.N>>>16)+(ce.N>>>16)+(we.N>>>16)+(le.N>>>16)+(_e>>>16),new Y((65535&ae)<<16|65535&_e,Me)}function P(pe,ce,we,le,_e){let ae,Me;ae=(65535&pe.I)+(65535&ce.I)+(65535&we.I)+(65535&le.I)+(65535&_e.I),Me=(pe.I>>>16)+(ce.I>>>16)+(we.I>>>16)+(le.I>>>16)+(_e.I>>>16)+(ae>>>16);const ye=(65535&Me)<<16|65535&ae;return ae=(65535&pe.N)+(65535&ce.N)+(65535&we.N)+(65535&le.N)+(65535&_e.N)+(Me>>>16),Me=(pe.N>>>16)+(ce.N>>>16)+(we.N>>>16)+(le.N>>>16)+(_e.N>>>16)+(ae>>>16),new Y((65535&Me)<<16|65535&ae,ye)}function V(pe,ce){return new Y(pe.N^ce.N,pe.I^ce.I)}function Z(pe){const ce=I(pe,19),we=I(pe,61),le=X(pe,6);return new Y(ce.N^we.N^le.N,ce.I^we.I^le.I)}function j(pe){const ce=I(pe,1),we=I(pe,8),le=X(pe,7);return new Y(ce.N^we.N^le.N,ce.I^we.I^le.I)}function q(pe){const ce=I(pe,14),we=I(pe,18),le=I(pe,41);return new Y(ce.N^we.N^le.N,ce.I^we.I^le.I)}const D=[new Y(h[0],3609767458),new Y(h[1],602891725),new Y(h[2],3964484399),new Y(h[3],2173295548),new Y(h[4],4081628472),new Y(h[5],3053834265),new Y(h[6],2937671579),new Y(h[7],3664609560),new Y(h[8],2734883394),new Y(h[9],1164996542),new Y(h[10],1323610764),new Y(h[11],3590304994),new Y(h[12],4068182383),new Y(h[13],991336113),new Y(h[14],633803317),new Y(h[15],3479774868),new Y(h[16],2666613458),new Y(h[17],944711139),new Y(h[18],2341262773),new Y(h[19],2007800933),new Y(h[20],1495990901),new Y(h[21],1856431235),new Y(h[22],3175218132),new Y(h[23],2198950837),new Y(h[24],3999719339),new Y(h[25],766784016),new Y(h[26],2566594879),new Y(h[27],3203337956),new Y(h[28],1034457026),new Y(h[29],2466948901),new Y(h[30],3758326383),new Y(h[31],168717936),new Y(h[32],1188179964),new Y(h[33],1546045734),new Y(h[34],1522805485),new Y(h[35],2643833823),new Y(h[36],2343527390),new Y(h[37],1014477480),new Y(h[38],1206759142),new Y(h[39],344077627),new Y(h[40],1290863460),new Y(h[41],3158454273),new Y(h[42],3505952657),new Y(h[43],106217008),new Y(h[44],3606008344),new Y(h[45],1432725776),new Y(h[46],1467031594),new Y(h[47],851169720),new Y(h[48],3100823752),new Y(h[49],1363258195),new Y(h[50],3750685593),new Y(h[51],3785050280),new Y(h[52],3318307427),new Y(h[53],3812723403),new Y(h[54],2003034995),new Y(h[55],3602036899),new Y(h[56],1575990012),new Y(h[57],1125592928),new Y(h[58],2716904306),new Y(h[59],442776044),new Y(h[60],593698344),new Y(h[61],3733110249),new Y(h[62],2999351573),new Y(h[63],3815920427),new Y(3391569614,3928383900),new Y(3515267271,566280711),new Y(3940187606,3454069534),new Y(4118630271,4000239992),new Y(116418474,1914138554),new Y(174292421,2731055270),new Y(289380356,3203993006),new Y(460393269,320620315),new Y(685471733,587496836),new Y(852142971,1086792851),new Y(1017036298,365543100),new Y(1126000580,2618297676),new Y(1288033470,3409855158),new Y(1501505948,4234509866),new Y(1607167915,987167468),new Y(1816402316,1246189591)];function G(pe){return pe==="SHA-384"?[new Y(3418070365,u[0]),new Y(1654270250,u[1]),new Y(2438529370,u[2]),new Y(355462360,u[3]),new Y(1731405415,u[4]),new Y(41048885895,u[5]),new Y(3675008525,u[6]),new Y(1203062813,u[7])]:[new Y(w[0],4089235720),new Y(w[1],2227873595),new Y(w[2],4271175723),new Y(w[3],1595750129),new Y(w[4],2917565137),new Y(w[5],725511199),new Y(w[6],4215389547),new Y(w[7],327033209)]}function J(pe,ce){let we,le,_e,ae,Me,ye,me,ge,de,be,Se,Be;const qe=[];for(we=ce[0],le=ce[1],_e=ce[2],ae=ce[3],Me=ce[4],ye=ce[5],me=ce[6],ge=ce[7],Se=0;Se<80;Se+=1)Se<16?(Be=2*Se,qe[Se]=new Y(pe[Be],pe[Be+1])):qe[Se]=O(Z(qe[Se-2]),qe[Se-7],j(qe[Se-15]),qe[Se-16]),de=P(ge,q(Me),($e=ye,Pe=me,new Y((Re=Me).N&$e.N^~Re.N&Pe.N,Re.I&$e.I^~Re.I&Pe.I)),D[Se],qe[Se]),be=_(x(we),z(we,le,_e)),ge=me,me=ye,ye=Me,Me=_(ae,de),ae=_e,_e=le,le=we,we=_(de,be);var Re,$e,Pe;return ce[0]=_(we,ce[0]),ce[1]=_(le,ce[1]),ce[2]=_(_e,ce[2]),ce[3]=_(ae,ce[3]),ce[4]=_(Me,ce[4]),ce[5]=_(ye,ce[5]),ce[6]=_(me,ce[6]),ce[7]=_(ge,ce[7]),ce}let Q=class extends E{constructor(pe,ce,we){if(pe!=="SHA-384"&&pe!=="SHA-512")throw new Error(c);super(pe,ce,we);const le=we||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=i$1(this.t,this.i,this.T),this.v=J,this.L=function(_e){return _e.slice()},this.B=G,this.F=function(_e,ae,Me,ye){return(function(me,ge,de,be,Se){let Be,qe;const Re=31+(ge+129>>>10<<5),$e=ge+de;for(;me.length<=Re;)me.push(0);for(me[ge>>>5]|=128<<24-ge%32,me[Re]=4294967295&$e,me[Re-1]=$e/o|0,Be=0;Be<me.length;Be+=32)be=J(me.slice(Be,Be+32),be);return qe=Se==="SHA-384"?[be[0].N,be[0].I,be[1].N,be[1].I,be[2].N,be[2].I,be[3].N,be[3].I,be[4].N,be[4].I,be[5].N,be[5].I]:[be[0].N,be[0].I,be[1].N,be[1].I,be[2].N,be[2].I,be[3].N,be[3].I,be[4].N,be[4].I,be[5].N,be[5].I,be[6].N,be[6].I,be[7].N,be[7].I],qe})(_e,ae,Me,ye,pe)},this.U=G(pe),this.m=1024,this.R=pe==="SHA-384"?384:512,this.K=!1,le.hmacKey&&this.k(A("hmacKey",le.hmacKey,this.T))}};const W=[new Y(0,1),new Y(0,32898),new Y(2147483648,32906),new Y(2147483648,2147516416),new Y(0,32907),new Y(0,2147483649),new Y(2147483648,2147516545),new Y(2147483648,32777),new Y(0,138),new Y(0,136),new Y(0,2147516425),new Y(0,2147483658),new Y(0,2147516555),new Y(2147483648,139),new Y(2147483648,32905),new Y(2147483648,32771),new Y(2147483648,32770),new Y(2147483648,128),new Y(0,32778),new Y(2147483648,2147483658),new Y(2147483648,2147516545),new Y(2147483648,32896),new Y(0,2147483649),new Y(2147483648,2147516424)],$=[[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 tt(pe){let ce;const we=[];for(ce=0;ce<5;ce+=1)we[ce]=[new Y(0,0),new Y(0,0),new Y(0,0),new Y(0,0),new Y(0,0)];return we}function nt(pe){let ce;const we=[];for(ce=0;ce<5;ce+=1)we[ce]=pe[ce].slice();return we}function et(pe,ce){let we,le,_e,ae;const Me=[],ye=[];if(pe!==null)for(le=0;le<pe.length;le+=2)ce[(le>>>1)%5][(le>>>1)/5|0]=V(ce[(le>>>1)%5][(le>>>1)/5|0],new Y(pe[le+1],pe[le]));for(we=0;we<24;we+=1){for(ae=tt(),le=0;le<5;le+=1)Me[le]=(me=ce[le][0],ge=ce[le][1],de=ce[le][2],be=ce[le][3],Se=ce[le][4],new Y(me.N^ge.N^de.N^be.N^Se.N,me.I^ge.I^de.I^be.I^Se.I));for(le=0;le<5;le+=1)ye[le]=V(Me[(le+4)%5],N(Me[(le+1)%5],1));for(le=0;le<5;le+=1)for(_e=0;_e<5;_e+=1)ce[le][_e]=V(ce[le][_e],ye[le]);for(le=0;le<5;le+=1)for(_e=0;_e<5;_e+=1)ae[_e][(2*le+3*_e)%5]=N(ce[le][_e],$[le][_e]);for(le=0;le<5;le+=1)for(_e=0;_e<5;_e+=1)ce[le][_e]=V(ae[le][_e],new Y(~ae[(le+1)%5][_e].N&ae[(le+2)%5][_e].N,~ae[(le+1)%5][_e].I&ae[(le+2)%5][_e].I));ce[0][0]=V(ce[0][0],W[we])}var me,ge,de,be,Se;return ce}function rt(pe){let ce,we,le=0;const _e=[0,0],ae=[4294967295&pe,pe/o&2097151];for(ce=6;ce>=0;ce--)we=ae[ce>>2]>>>8*ce&255,we===0&&le===0||(_e[le+1>>2]|=we<<8*(le+1),le+=1);return le=le!==0?le:1,_e[0]|=le,{value:le+1>4?_e:[_e[0]],binLen:8+8*le}}function it(pe){return a(rt(pe.binLen),pe)}function st(pe,ce){let we,le=rt(ce);le=a(le,pe);const _e=ce>>>2,ae=(_e-le.value.length%_e)%_e;for(we=0;we<ae;we++)le.value.push(0);return le.value}let ot=class extends E{constructor(pe,ce,we){let le=6,_e=0;super(pe,ce,we);const ae=we||{};if(this.numRounds!==1){if(ae.kmacKey||ae.hmacKey)throw new Error(f);if(this.o==="CSHAKE128"||this.o==="CSHAKE256")throw new Error("Cannot set numRounds for CSHAKE variants")}switch(this.T=1,this.C=i$1(this.t,this.i,this.T),this.v=et,this.L=nt,this.B=tt,this.U=tt(),this.K=!1,pe){case"SHA3-224":this.m=_e=1152,this.R=224,this.M=!0,this.g=this.Y;break;case"SHA3-256":this.m=_e=1088,this.R=256,this.M=!0,this.g=this.Y;break;case"SHA3-384":this.m=_e=832,this.R=384,this.M=!0,this.g=this.Y;break;case"SHA3-512":this.m=_e=576,this.R=512,this.M=!0,this.g=this.Y;break;case"SHAKE128":le=31,this.m=_e=1344,this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"SHAKE256":le=31,this.m=_e=1088,this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"KMAC128":le=4,this.m=_e=1344,this.X(we),this.R=-1,this.K=!0,this.M=!1,this.g=this._;break;case"KMAC256":le=4,this.m=_e=1088,this.X(we),this.R=-1,this.K=!0,this.M=!1,this.g=this._;break;case"CSHAKE128":this.m=_e=1344,le=this.O(we),this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"CSHAKE256":this.m=_e=1088,le=this.O(we),this.R=-1,this.K=!0,this.M=!1,this.g=null;break;default:throw new Error(c)}this.F=function(Me,ye,me,ge,de){return(function(be,Se,Be,qe,Re,$e,Pe){let ke,Ue,Oe=0;const Ye=[],Qe=Re>>>5,lt=Se>>>5;for(ke=0;ke<lt&&Se>=Re;ke+=Qe)qe=et(be.slice(ke,ke+Qe),qe),Se-=Re;for(be=be.slice(ke),Se%=Re;be.length<Qe;)be.push(0);for(ke=Se>>>3,be[ke>>2]^=$e<<ke%4*8,be[Qe-1]^=2147483648,qe=et(be,qe);32*Ye.length<Pe&&(Ue=qe[Oe%5][Oe/5|0],Ye.push(Ue.I),!(32*Ye.length>=Pe));)Ye.push(Ue.N),Oe+=1,64*Oe%Re==0&&(et(null,qe),Oe=0);return Ye})(Me,ye,0,ge,_e,le,de)},ae.hmacKey&&this.k(A("hmacKey",ae.hmacKey,this.T))}O(pe,ce){const we=(function(_e){const ae=_e||{};return{funcName:A("funcName",ae.funcName,1,{value:[],binLen:0}),customization:A("Customization",ae.customization,1,{value:[],binLen:0})}})(pe||{});ce&&(we.funcName=ce);const le=a(it(we.funcName),it(we.customization));if(we.customization.binLen!==0||we.funcName.binLen!==0){const _e=st(le,this.m>>>3);for(let ae=0;ae<_e.length;ae+=this.m>>>5)this.U=this.v(_e.slice(ae,ae+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}X(pe){const ce=(function(le){const _e=le||{};return{kmacKey:A("kmacKey",_e.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:A("Customization",_e.customization,1,{value:[],binLen:0})}})(pe||{});this.O(pe,ce.funcName);const we=st(it(ce.kmacKey),this.m>>>3);for(let le=0;le<we.length;le+=this.m>>>5)this.U=this.v(we.slice(le,le+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}_(pe){const ce=a({value:this.h.slice(),binLen:this.u},(function(we){let le,_e,ae=0;const Me=[0,0],ye=[4294967295&we,we/o&2097151];for(le=6;le>=0;le--)_e=ye[le>>2]>>>8*le&255,_e===0&&ae===0||(Me[ae>>2]|=_e<<8*ae,ae+=1);return ae=ae!==0?ae:1,Me[ae>>2]|=ae<<8*ae,{value:ae+1>4?Me:[Me[0]],binLen:8+8*ae}})(pe.outputLen));return this.F(ce.value,ce.binLen,this.A,this.L(this.U),pe.outputLen)}};class ht{constructor(ce,we,le){if(ce=="SHA-1")this.P=new L(ce,we,le);else if(ce=="SHA-224"||ce=="SHA-256")this.P=new k(ce,we,le);else if(ce=="SHA-384"||ce=="SHA-512")this.P=new Q(ce,we,le);else{if(ce!="SHA3-224"&&ce!="SHA3-256"&&ce!="SHA3-384"&&ce!="SHA3-512"&&ce!="SHAKE128"&&ce!="SHAKE256"&&ce!="CSHAKE128"&&ce!="CSHAKE256"&&ce!="KMAC128"&&ce!="KMAC256")throw new Error(c);this.P=new ot(ce,we,le)}}update(ce){return this.P.update(ce),this}getHash(ce,we){return this.P.getHash(ce,we)}setHMACKey(ce,we,le){this.P.setHMACKey(ce,we,le)}getHMAC(ce,we){return this.P.getHMAC(ce,we)}}function getDefaultExportFromCjs(pe){return pe&&pe.__esModule&&Object.prototype.hasOwnProperty.call(pe,"default")?pe.default:pe}var browser$c={exports:{}},process=browser$c.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(pe){if(cachedSetTimeout===setTimeout)return setTimeout(pe,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(pe,0);try{return cachedSetTimeout(pe,0)}catch{try{return cachedSetTimeout.call(null,pe,0)}catch{return cachedSetTimeout.call(this,pe,0)}}}function runClearTimeout(pe){if(cachedClearTimeout===clearTimeout)return clearTimeout(pe);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(pe);try{return cachedClearTimeout(pe)}catch{try{return cachedClearTimeout.call(null,pe)}catch{return cachedClearTimeout.call(this,pe)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var pe=runTimeout(cleanUpNextTick);draining=!0;for(var ce=queue.length;ce;){for(currentQueue=queue,queue=[];++queueIndex<ce;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,ce=queue.length}currentQueue=null,draining=!1,runClearTimeout(pe)}}process.nextTick=function(pe){var ce=new Array(arguments.length-1);if(arguments.length>1)for(var we=1;we<arguments.length;we++)ce[we-1]=arguments[we];queue.push(new Item(pe,ce)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(pe,ce){this.fun=pe,this.array=ce}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop(){}process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(pe){return[]},process.binding=function(pe){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(pe){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser$c.exports;const process$1=getDefaultExportFromCjs(browserExports);var isBrowser=typeof window<"u"&&typeof window.document<"u";typeof process$1<"u"&&process$1.versions!=null&&process$1.versions.node!=null,typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&"userAgent"in navigator&&typeof navigator.userAgent=="string"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",typeof process$1<"u"&&process$1.versions!=null&&process$1.versions.bun!=null;var ErrorCode=(pe=>(pe[pe.InvalidCountryCode=201]="InvalidCountryCode",pe[pe.InvalidRecipientNumber=202]="InvalidRecipientNumber",pe[pe.MissingAuthentication=300]="MissingAuthentication",pe[pe.MissingParameterTo=301]="MissingParameterTo",pe[pe.MissingParameterType=304]="MissingParameterType",pe[pe.MissingParameterText=305]="MissingParameterText",pe[pe.InvalidSender=306]="InvalidSender",pe[pe.MissingParameterUrl=307]="MissingParameterUrl",pe[pe.InvalidType=400]="InvalidType",pe[pe.ParameterLongExceedsCharLimit=401]="ParameterLongExceedsCharLimit",pe[pe.PreventedByReloadLock=402]="PreventedByReloadLock",pe[pe.DailyLimitReachedForNumber=403]="DailyLimitReachedForNumber",pe[pe.InsufficientCredits=500]="InsufficientCredits",pe[pe.CarrierFailed=600]="CarrierFailed",pe[pe.UnknownError=700]="UnknownError",pe[pe.MissingLogoFile=801]="MissingLogoFile",pe[pe.NonExistingLogoFile=802]="NonExistingLogoFile",pe[pe.MissingRingTone=803]="MissingRingTone",pe[pe.InvalidApiKey=900]="InvalidApiKey",pe[pe.InvalidMessageId=901]="InvalidMessageId",pe[pe.DeactivatedApi=902]="DeactivatedApi",pe[pe.DisallowedIp=903]="DisallowedIp",pe))(ErrorCode||{}),buffer$1={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62,revLookup[95]=63;function getLens(pe){var ce=pe.length;if(ce%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var we=pe.indexOf("=");we===-1&&(we=ce);var le=we===ce?0:4-we%4;return[we,le]}function byteLength(pe){var ce=getLens(pe),we=ce[0],le=ce[1];return(we+le)*3/4-le}function _byteLength(pe,ce,we){return(ce+we)*3/4-we}function toByteArray(pe){var ce,we=getLens(pe),le=we[0],_e=we[1],ae=new Arr(_byteLength(pe,le,_e)),Me=0,ye=_e>0?le-4:le,me;for(me=0;me<ye;me+=4)ce=revLookup[pe.charCodeAt(me)]<<18|revLookup[pe.charCodeAt(me+1)]<<12|revLookup[pe.charCodeAt(me+2)]<<6|revLookup[pe.charCodeAt(me+3)],ae[Me++]=ce>>16&255,ae[Me++]=ce>>8&255,ae[Me++]=ce&255;return _e===2&&(ce=revLookup[pe.charCodeAt(me)]<<2|revLookup[pe.charCodeAt(me+1)]>>4,ae[Me++]=ce&255),_e===1&&(ce=revLookup[pe.charCodeAt(me)]<<10|revLookup[pe.charCodeAt(me+1)]<<4|revLookup[pe.charCodeAt(me+2)]>>2,ae[Me++]=ce>>8&255,ae[Me++]=ce&255),ae}function tripletToBase64(pe){return lookup[pe>>18&63]+lookup[pe>>12&63]+lookup[pe>>6&63]+lookup[pe&63]}function encodeChunk(pe,ce,we){for(var le,_e=[],ae=ce;ae<we;ae+=3)le=(pe[ae]<<16&16711680)+(pe[ae+1]<<8&65280)+(pe[ae+2]&255),_e.push(tripletToBase64(le));return _e.join("")}function fromByteArray(pe){for(var ce,we=pe.length,le=we%3,_e=[],ae=16383,Me=0,ye=we-le;Me<ye;Me+=ae)_e.push(encodeChunk(pe,Me,Me+ae>ye?ye:Me+ae));return le===1?(ce=pe[we-1],_e.push(lookup[ce>>2]+lookup[ce<<4&63]+"==")):le===2&&(ce=(pe[we-2]<<8)+pe[we-1],_e.push(lookup[ce>>10]+lookup[ce>>4&63]+lookup[ce<<2&63]+"=")),_e.join("")}var ieee754={};ieee754.read=function(pe,ce,we,le,_e){var ae,Me,ye=_e*8-le-1,me=(1<<ye)-1,ge=me>>1,de=-7,be=we?_e-1:0,Se=we?-1:1,Be=pe[ce+be];for(be+=Se,ae=Be&(1<<-de)-1,Be>>=-de,de+=ye;de>0;ae=ae*256+pe[ce+be],be+=Se,de-=8);for(Me=ae&(1<<-de)-1,ae>>=-de,de+=le;de>0;Me=Me*256+pe[ce+be],be+=Se,de-=8);if(ae===0)ae=1-ge;else{if(ae===me)return Me?NaN:(Be?-1:1)*(1/0);Me=Me+Math.pow(2,le),ae=ae-ge}return(Be?-1:1)*Me*Math.pow(2,ae-le)},ieee754.write=function(pe,ce,we,le,_e,ae){var Me,ye,me,ge=ae*8-_e-1,de=(1<<ge)-1,be=de>>1,Se=_e===23?Math.pow(2,-24)-Math.pow(2,-77):0,Be=le?0:ae-1,qe=le?1:-1,Re=ce<0||ce===0&&1/ce<0?1:0;for(ce=Math.abs(ce),isNaN(ce)||ce===1/0?(ye=isNaN(ce)?1:0,Me=de):(Me=Math.floor(Math.log(ce)/Math.LN2),ce*(me=Math.pow(2,-Me))<1&&(Me--,me*=2),Me+be>=1?ce+=Se/me:ce+=Se*Math.pow(2,1-be),ce*me>=2&&(Me++,me/=2),Me+be>=de?(ye=0,Me=de):Me+be>=1?(ye=(ce*me-1)*Math.pow(2,_e),Me=Me+be):(ye=ce*Math.pow(2,be-1)*Math.pow(2,_e),Me=0));_e>=8;pe[we+Be]=ye&255,Be+=qe,ye/=256,_e-=8);for(Me=Me<<_e|ye,ge+=_e;ge>0;pe[we+Be]=Me&255,Be+=qe,Me/=256,ge-=8);pe[we+Be-qe]|=Re*128};(function(pe){const ce=base64Js,we=ieee754,le=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;pe.Buffer=de,pe.SlowBuffer=Ye,pe.INSPECT_MAX_BYTES=50;const _e=2147483647;pe.kMaxLength=_e;const{Uint8Array:ae,ArrayBuffer:Me,SharedArrayBuffer:ye}=globalThis;de.TYPED_ARRAY_SUPPORT=me(),!de.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function me(){try{const He=new ae(1),Ie={foo:function(){return 42}};return Object.setPrototypeOf(Ie,ae.prototype),Object.setPrototypeOf(He,Ie),He.foo()===42}catch{return!1}}Object.defineProperty(de.prototype,"parent",{enumerable:!0,get:function(){if(de.isBuffer(this))return this.buffer}}),Object.defineProperty(de.prototype,"offset",{enumerable:!0,get:function(){if(de.isBuffer(this))return this.byteOffset}});function ge(He){if(He>_e)throw new RangeError('The value "'+He+'" is invalid for option "size"');const Ie=new ae(He);return Object.setPrototypeOf(Ie,de.prototype),Ie}function de(He,Ie,De){if(typeof He=="number"){if(typeof Ie=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return qe(He)}return be(He,Ie,De)}de.poolSize=8192;function be(He,Ie,De){if(typeof He=="string")return Re(He,Ie);if(Me.isView(He))return Pe(He);if(He==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof He);if(Et(He,Me)||He&&Et(He.buffer,Me)||typeof ye<"u"&&(Et(He,ye)||He&&Et(He.buffer,ye)))return ke(He,Ie,De);if(typeof He=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Ke=He.valueOf&&He.valueOf();if(Ke!=null&&Ke!==He)return de.from(Ke,Ie,De);const ft=Ue(He);if(ft)return ft;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof He[Symbol.toPrimitive]=="function")return de.from(He[Symbol.toPrimitive]("string"),Ie,De);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof He)}de.from=function(He,Ie,De){return be(He,Ie,De)},Object.setPrototypeOf(de.prototype,ae.prototype),Object.setPrototypeOf(de,ae);function Se(He){if(typeof He!="number")throw new TypeError('"size" argument must be of type number');if(He<0)throw new RangeError('The value "'+He+'" is invalid for option "size"')}function Be(He,Ie,De){return Se(He),He<=0?ge(He):Ie!==void 0?typeof De=="string"?ge(He).fill(Ie,De):ge(He).fill(Ie):ge(He)}de.alloc=function(He,Ie,De){return Be(He,Ie,De)};function qe(He){return Se(He),ge(He<0?0:Oe(He)|0)}de.allocUnsafe=function(He){return qe(He)},de.allocUnsafeSlow=function(He){return qe(He)};function Re(He,Ie){if((typeof Ie!="string"||Ie==="")&&(Ie="utf8"),!de.isEncoding(Ie))throw new TypeError("Unknown encoding: "+Ie);const De=Qe(He,Ie)|0;let Ke=ge(De);const ft=Ke.write(He,Ie);return ft!==De&&(Ke=Ke.slice(0,ft)),Ke}function $e(He){const Ie=He.length<0?0:Oe(He.length)|0,De=ge(Ie);for(let Ke=0;Ke<Ie;Ke+=1)De[Ke]=He[Ke]&255;return De}function Pe(He){if(Et(He,ae)){const Ie=new ae(He);return ke(Ie.buffer,Ie.byteOffset,Ie.byteLength)}return $e(He)}function ke(He,Ie,De){if(Ie<0||He.byteLength<Ie)throw new RangeError('"offset" is outside of buffer bounds');if(He.byteLength<Ie+(De||0))throw new RangeError('"length" is outside of buffer bounds');let Ke;return Ie===void 0&&De===void 0?Ke=new ae(He):De===void 0?Ke=new ae(He,Ie):Ke=new ae(He,Ie,De),Object.setPrototypeOf(Ke,de.prototype),Ke}function Ue(He){if(de.isBuffer(He)){const Ie=Oe(He.length)|0,De=ge(Ie);return De.length===0||He.copy(De,0,0,Ie),De}if(He.length!==void 0)return typeof He.length!="number"||Gt(He.length)?ge(0):$e(He);if(He.type==="Buffer"&&Array.isArray(He.data))return $e(He.data)}function Oe(He){if(He>=_e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_e.toString(16)+" bytes");return He|0}function Ye(He){return+He!=He&&(He=0),de.alloc(+He)}de.isBuffer=function(Ie){return Ie!=null&&Ie._isBuffer===!0&&Ie!==de.prototype},de.compare=function(Ie,De){if(Et(Ie,ae)&&(Ie=de.from(Ie,Ie.offset,Ie.byteLength)),Et(De,ae)&&(De=de.from(De,De.offset,De.byteLength)),!de.isBuffer(Ie)||!de.isBuffer(De))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Ie===De)return 0;let Ke=Ie.length,ft=De.length;for(let wt=0,ct=Math.min(Ke,ft);wt<ct;++wt)if(Ie[wt]!==De[wt]){Ke=Ie[wt],ft=De[wt];break}return Ke<ft?-1:ft<Ke?1:0},de.isEncoding=function(Ie){switch(String(Ie).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},de.concat=function(Ie,De){if(!Array.isArray(Ie))throw new TypeError('"list" argument must be an Array of Buffers');if(Ie.length===0)return de.alloc(0);let Ke;if(De===void 0)for(De=0,Ke=0;Ke<Ie.length;++Ke)De+=Ie[Ke].length;const ft=de.allocUnsafe(De);let wt=0;for(Ke=0;Ke<Ie.length;++Ke){let ct=Ie[Ke];if(Et(ct,ae))wt+ct.length>ft.length?(de.isBuffer(ct)||(ct=de.from(ct)),ct.copy(ft,wt)):ae.prototype.set.call(ft,ct,wt);else if(de.isBuffer(ct))ct.copy(ft,wt);else throw new TypeError('"list" argument must be an Array of Buffers');wt+=ct.length}return ft};function Qe(He,Ie){if(de.isBuffer(He))return He.length;if(Me.isView(He)||Et(He,Me))return He.byteLength;if(typeof He!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof He);const De=He.length,Ke=arguments.length>2&&arguments[2]===!0;if(!Ke&&De===0)return 0;let ft=!1;for(;;)switch(Ie){case"ascii":case"latin1":case"binary":return De;case"utf8":case"utf-8":return jt(He).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return De*2;case"hex":return De>>>1;case"base64":return Ht(He).length;default:if(ft)return Ke?-1:jt(He).length;Ie=(""+Ie).toLowerCase(),ft=!0}}de.byteLength=Qe;function lt(He,Ie,De){let Ke=!1;if((Ie===void 0||Ie<0)&&(Ie=0),Ie>this.length||((De===void 0||De>this.length)&&(De=this.length),De<=0)||(De>>>=0,Ie>>>=0,De<=Ie))return"";for(He||(He="utf8");;)switch(He){case"hex":return xe(this,Ie,De);case"utf8":case"utf-8":return he(this,Ie,De);case"ascii":return te(this,Ie,De);case"latin1":case"binary":return se(this,Ie,De);case"base64":return oe(this,Ie,De);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee(this,Ie,De);default:if(Ke)throw new TypeError("Unknown encoding: "+He);He=(He+"").toLowerCase(),Ke=!0}}de.prototype._isBuffer=!0;function dt(He,Ie,De){const Ke=He[Ie];He[Ie]=He[De],He[De]=Ke}de.prototype.swap16=function(){const Ie=this.length;if(Ie%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let De=0;De<Ie;De+=2)dt(this,De,De+1);return this},de.prototype.swap32=function(){const Ie=this.length;if(Ie%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let De=0;De<Ie;De+=4)dt(this,De,De+3),dt(this,De+1,De+2);return this},de.prototype.swap64=function(){const Ie=this.length;if(Ie%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let De=0;De<Ie;De+=8)dt(this,De,De+7),dt(this,De+1,De+6),dt(this,De+2,De+5),dt(this,De+3,De+4);return this},de.prototype.toString=function(){const Ie=this.length;return Ie===0?"":arguments.length===0?he(this,0,Ie):lt.apply(this,arguments)},de.prototype.toLocaleString=de.prototype.toString,de.prototype.equals=function(Ie){if(!de.isBuffer(Ie))throw new TypeError("Argument must be a Buffer");return this===Ie?!0:de.compare(this,Ie)===0},de.prototype.inspect=function(){let Ie="";const De=pe.INSPECT_MAX_BYTES;return Ie=this.toString("hex",0,De).replace(/(.{2})/g,"$1 ").trim(),this.length>De&&(Ie+=" ... "),"<Buffer "+Ie+">"},le&&(de.prototype[le]=de.prototype.inspect),de.prototype.compare=function(Ie,De,Ke,ft,wt){if(Et(Ie,ae)&&(Ie=de.from(Ie,Ie.offset,Ie.byteLength)),!de.isBuffer(Ie))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Ie);if(De===void 0&&(De=0),Ke===void 0&&(Ke=Ie?Ie.length:0),ft===void 0&&(ft=0),wt===void 0&&(wt=this.length),De<0||Ke>Ie.length||ft<0||wt>this.length)throw new RangeError("out of range index");if(ft>=wt&&De>=Ke)return 0;if(ft>=wt)return-1;if(De>=Ke)return 1;if(De>>>=0,Ke>>>=0,ft>>>=0,wt>>>=0,this===Ie)return 0;let ct=wt-ft,Rt=Ke-De;const Yt=Math.min(ct,Rt),Bt=this.slice(ft,wt),Tt=Ie.slice(De,Ke);for(let zt=0;zt<Yt;++zt)if(Bt[zt]!==Tt[zt]){ct=Bt[zt],Rt=Tt[zt];break}return ct<Rt?-1:Rt<ct?1:0};function Je(He,Ie,De,Ke,ft){if(He.length===0)return-1;if(typeof De=="string"?(Ke=De,De=0):De>2147483647?De=2147483647:De<-2147483648&&(De=-2147483648),De=+De,Gt(De)&&(De=ft?0:He.length-1),De<0&&(De=He.length+De),De>=He.length){if(ft)return-1;De=He.length-1}else if(De<0)if(ft)De=0;else return-1;if(typeof Ie=="string"&&(Ie=de.from(Ie,Ke)),de.isBuffer(Ie))return Ie.length===0?-1:bt(He,Ie,De,Ke,ft);if(typeof Ie=="number")return Ie=Ie&255,typeof ae.prototype.indexOf=="function"?ft?ae.prototype.indexOf.call(He,Ie,De):ae.prototype.lastIndexOf.call(He,Ie,De):bt(He,[Ie],De,Ke,ft);throw new TypeError("val must be string, number or Buffer")}function bt(He,Ie,De,Ke,ft){let wt=1,ct=He.length,Rt=Ie.length;if(Ke!==void 0&&(Ke=String(Ke).toLowerCase(),Ke==="ucs2"||Ke==="ucs-2"||Ke==="utf16le"||Ke==="utf-16le")){if(He.length<2||Ie.length<2)return-1;wt=2,ct/=2,Rt/=2,De/=2}function Yt(Tt,zt){return wt===1?Tt[zt]:Tt.readUInt16BE(zt*wt)}let Bt;if(ft){let Tt=-1;for(Bt=De;Bt<ct;Bt++)if(Yt(He,Bt)===Yt(Ie,Tt===-1?0:Bt-Tt)){if(Tt===-1&&(Tt=Bt),Bt-Tt+1===Rt)return Tt*wt}else Tt!==-1&&(Bt-=Bt-Tt),Tt=-1}else for(De+Rt>ct&&(De=ct-Rt),Bt=De;Bt>=0;Bt--){let Tt=!0;for(let zt=0;zt<Rt;zt++)if(Yt(He,Bt+zt)!==Yt(Ie,zt)){Tt=!1;break}if(Tt)return Bt}return-1}de.prototype.includes=function(Ie,De,Ke){return this.indexOf(Ie,De,Ke)!==-1},de.prototype.indexOf=function(Ie,De,Ke){return Je(this,Ie,De,Ke,!0)},de.prototype.lastIndexOf=function(Ie,De,Ke){return Je(this,Ie,De,Ke,!1)};function ve(He,Ie,De,Ke){De=Number(De)||0;const ft=He.length-De;Ke?(Ke=Number(Ke),Ke>ft&&(Ke=ft)):Ke=ft;const wt=Ie.length;Ke>wt/2&&(Ke=wt/2);let ct;for(ct=0;ct<Ke;++ct){const Rt=parseInt(Ie.substr(ct*2,2),16);if(Gt(Rt))return ct;He[De+ct]=Rt}return ct}function ee(He,Ie,De,Ke){return Mt(jt(Ie,He.length-De),He,De,Ke)}function re(He,Ie,De,Ke){return Mt(gt(Ie),He,De,Ke)}function ie(He,Ie,De,Ke){return Mt(Ht(Ie),He,De,Ke)}function ne(He,Ie,De,Ke){return Mt(St(Ie,He.length-De),He,De,Ke)}de.prototype.write=function(Ie,De,Ke,ft){if(De===void 0)ft="utf8",Ke=this.length,De=0;else if(Ke===void 0&&typeof De=="string")ft=De,Ke=this.length,De=0;else if(isFinite(De))De=De>>>0,isFinite(Ke)?(Ke=Ke>>>0,ft===void 0&&(ft="utf8")):(ft=Ke,Ke=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const wt=this.length-De;if((Ke===void 0||Ke>wt)&&(Ke=wt),Ie.length>0&&(Ke<0||De<0)||De>this.length)throw new RangeError("Attempt to write outside buffer bounds");ft||(ft="utf8");let ct=!1;for(;;)switch(ft){case"hex":return ve(this,Ie,De,Ke);case"utf8":case"utf-8":return ee(this,Ie,De,Ke);case"ascii":case"latin1":case"binary":return re(this,Ie,De,Ke);case"base64":return ie(this,Ie,De,Ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,Ie,De,Ke);default:if(ct)throw new TypeError("Unknown encoding: "+ft);ft=(""+ft).toLowerCase(),ct=!0}},de.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function oe(He,Ie,De){return Ie===0&&De===He.length?ce.fromByteArray(He):ce.fromByteArray(He.slice(Ie,De))}function he(He,Ie,De){De=Math.min(He.length,De);const Ke=[];let ft=Ie;for(;ft<De;){const wt=He[ft];let ct=null,Rt=wt>239?4:wt>223?3:wt>191?2:1;if(ft+Rt<=De){let Yt,Bt,Tt,zt;switch(Rt){case 1:wt<128&&(ct=wt);break;case 2:Yt=He[ft+1],(Yt&192)===128&&(zt=(wt&31)<<6|Yt&63,zt>127&&(ct=zt));break;case 3:Yt=He[ft+1],Bt=He[ft+2],(Yt&192)===128&&(Bt&192)===128&&(zt=(wt&15)<<12|(Yt&63)<<6|Bt&63,zt>2047&&(zt<55296||zt>57343)&&(ct=zt));break;case 4:Yt=He[ft+1],Bt=He[ft+2],Tt=He[ft+3],(Yt&192)===128&&(Bt&192)===128&&(Tt&192)===128&&(zt=(wt&15)<<18|(Yt&63)<<12|(Bt&63)<<6|Tt&63,zt>65535&&zt<1114112&&(ct=zt))}}ct===null?(ct=65533,Rt=1):ct>65535&&(ct-=65536,Ke.push(ct>>>10&1023|55296),ct=56320|ct&1023),Ke.push(ct),ft+=Rt}return fe(Ke)}const ue=4096;function fe(He){const Ie=He.length;if(Ie<=ue)return String.fromCharCode.apply(String,He);let De="",Ke=0;for(;Ke<Ie;)De+=String.fromCharCode.apply(String,He.slice(Ke,Ke+=ue));return De}function te(He,Ie,De){let Ke="";De=Math.min(He.length,De);for(let ft=Ie;ft<De;++ft)Ke+=String.fromCharCode(He[ft]&127);return Ke}function se(He,Ie,De){let Ke="";De=Math.min(He.length,De);for(let ft=Ie;ft<De;++ft)Ke+=String.fromCharCode(He[ft]);return Ke}function xe(He,Ie,De){const Ke=He.length;(!Ie||Ie<0)&&(Ie=0),(!De||De<0||De>Ke)&&(De=Ke);let ft="";for(let wt=Ie;wt<De;++wt)ft+=It[He[wt]];return ft}function Ee(He,Ie,De){const Ke=He.slice(Ie,De);let ft="";for(let wt=0;wt<Ke.length-1;wt+=2)ft+=String.fromCharCode(Ke[wt]+Ke[wt+1]*256);return ft}de.prototype.slice=function(Ie,De){const Ke=this.length;Ie=~~Ie,De=De===void 0?Ke:~~De,Ie<0?(Ie+=Ke,Ie<0&&(Ie=0)):Ie>Ke&&(Ie=Ke),De<0?(De+=Ke,De<0&&(De=0)):De>Ke&&(De=Ke),De<Ie&&(De=Ie);const ft=this.subarray(Ie,De);return Object.setPrototypeOf(ft,de.prototype),ft};function Ne(He,Ie,De){if(He%1!==0||He<0)throw new RangeError("offset is not uint");if(He+Ie>De)throw new RangeError("Trying to access beyond buffer length")}de.prototype.readUintLE=de.prototype.readUIntLE=function(Ie,De,Ke){Ie=Ie>>>0,De=De>>>0,Ke||Ne(Ie,De,this.length);let ft=this[Ie],wt=1,ct=0;for(;++ct<De&&(wt*=256);)ft+=this[Ie+ct]*wt;return ft},de.prototype.readUintBE=de.prototype.readUIntBE=function(Ie,De,Ke){Ie=Ie>>>0,De=De>>>0,Ke||Ne(Ie,De,this.length);let ft=this[Ie+--De],wt=1;for(;De>0&&(wt*=256);)ft+=this[Ie+--De]*wt;return ft},de.prototype.readUint8=de.prototype.readUInt8=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,1,this.length),this[Ie]},de.prototype.readUint16LE=de.prototype.readUInt16LE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,2,this.length),this[Ie]|this[Ie+1]<<8},de.prototype.readUint16BE=de.prototype.readUInt16BE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,2,this.length),this[Ie]<<8|this[Ie+1]},de.prototype.readUint32LE=de.prototype.readUInt32LE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,4,this.length),(this[Ie]|this[Ie+1]<<8|this[Ie+2]<<16)+this[Ie+3]*16777216},de.prototype.readUint32BE=de.prototype.readUInt32BE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,4,this.length),this[Ie]*16777216+(this[Ie+1]<<16|this[Ie+2]<<8|this[Ie+3])},de.prototype.readBigUInt64LE=$t(function(Ie){Ie=Ie>>>0,mt(Ie,"offset");const De=this[Ie],Ke=this[Ie+7];(De===void 0||Ke===void 0)&&Ut(Ie,this.length-8);const ft=De+this[++Ie]*2**8+this[++Ie]*2**16+this[++Ie]*2**24,wt=this[++Ie]+this[++Ie]*2**8+this[++Ie]*2**16+Ke*2**24;return BigInt(ft)+(BigInt(wt)<<BigInt(32))}),de.prototype.readBigUInt64BE=$t(function(Ie){Ie=Ie>>>0,mt(Ie,"offset");const De=this[Ie],Ke=this[Ie+7];(De===void 0||Ke===void 0)&&Ut(Ie,this.length-8);const ft=De*2**24+this[++Ie]*2**16+this[++Ie]*2**8+this[++Ie],wt=this[++Ie]*2**24+this[++Ie]*2**16+this[++Ie]*2**8+Ke;return(BigInt(ft)<<BigInt(32))+BigInt(wt)}),de.prototype.readIntLE=function(Ie,De,Ke){Ie=Ie>>>0,De=De>>>0,Ke||Ne(Ie,De,this.length);let ft=this[Ie],wt=1,ct=0;for(;++ct<De&&(wt*=256);)ft+=this[Ie+ct]*wt;return wt*=128,ft>=wt&&(ft-=Math.pow(2,8*De)),ft},de.prototype.readIntBE=function(Ie,De,Ke){Ie=Ie>>>0,De=De>>>0,Ke||Ne(Ie,De,this.length);let ft=De,wt=1,ct=this[Ie+--ft];for(;ft>0&&(wt*=256);)ct+=this[Ie+--ft]*wt;return wt*=128,ct>=wt&&(ct-=Math.pow(2,8*De)),ct},de.prototype.readInt8=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,1,this.length),this[Ie]&128?(255-this[Ie]+1)*-1:this[Ie]},de.prototype.readInt16LE=function(Ie,De){Ie=Ie>>>0,De||Ne(Ie,2,this.length);const Ke=this[Ie]|this[Ie+1]<<8;return Ke&32768?Ke|4294901760:Ke},de.prototype.readInt16BE=function(Ie,De){Ie=Ie>>>0,De||Ne(Ie,2,this.length);const Ke=this[Ie+1]|this[Ie]<<8;return Ke&32768?Ke|4294901760:Ke},de.prototype.readInt32LE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,4,this.length),this[Ie]|this[Ie+1]<<8|this[Ie+2]<<16|this[Ie+3]<<24},de.prototype.readInt32BE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,4,this.length),this[Ie]<<24|this[Ie+1]<<16|this[Ie+2]<<8|this[Ie+3]},de.prototype.readBigInt64LE=$t(function(Ie){Ie=Ie>>>0,mt(Ie,"offset");const De=this[Ie],Ke=this[Ie+7];(De===void 0||Ke===void 0)&&Ut(Ie,this.length-8);const ft=this[Ie+4]+this[Ie+5]*2**8+this[Ie+6]*2**16+(Ke<<24);return(BigInt(ft)<<BigInt(32))+BigInt(De+this[++Ie]*2**8+this[++Ie]*2**16+this[++Ie]*2**24)}),de.prototype.readBigInt64BE=$t(function(Ie){Ie=Ie>>>0,mt(Ie,"offset");const De=this[Ie],Ke=this[Ie+7];(De===void 0||Ke===void 0)&&Ut(Ie,this.length-8);const ft=(De<<24)+this[++Ie]*2**16+this[++Ie]*2**8+this[++Ie];return(BigInt(ft)<<BigInt(32))+BigInt(this[++Ie]*2**24+this[++Ie]*2**16+this[++Ie]*2**8+Ke)}),de.prototype.readFloatLE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,4,this.length),we.read(this,Ie,!0,23,4)},de.prototype.readFloatBE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,4,this.length),we.read(this,Ie,!1,23,4)},de.prototype.readDoubleLE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,8,this.length),we.read(this,Ie,!0,52,8)},de.prototype.readDoubleBE=function(Ie,De){return Ie=Ie>>>0,De||Ne(Ie,8,this.length),we.read(this,Ie,!1,52,8)};function Xe(He,Ie,De,Ke,ft,wt){if(!de.isBuffer(He))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ie>ft||Ie<wt)throw new RangeError('"value" argument is out of bounds');if(De+Ke>He.length)throw new RangeError("Index out of range")}de.prototype.writeUintLE=de.prototype.writeUIntLE=function(Ie,De,Ke,ft){if(Ie=+Ie,De=De>>>0,Ke=Ke>>>0,!ft){const Rt=Math.pow(2,8*Ke)-1;Xe(this,Ie,De,Ke,Rt,0)}let wt=1,ct=0;for(this[De]=Ie&255;++ct<Ke&&(wt*=256);)this[De+ct]=Ie/wt&255;return De+Ke},de.prototype.writeUintBE=de.prototype.writeUIntBE=function(Ie,De,Ke,ft