fixparser-plugin-mcp 9.3.1-ed12fa06 → 9.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9336,7 +9336,7 @@ Format is HH:MM:SS where HH = 00-23 hours, MM = 00-59 minutes, SS = 00-59 second
9336
9336
  `),p.push($d(a,r)),p.push(ld(e)),c&&p.push("=",Zd(c)),p.push(`-----END PGP SIGNATURE-----
9337
9337
  `);break}return I.concat(p)}var mt=BigInt(0),Bi=BigInt(1);function ae(t){let e="0123456789ABCDEF",d="";return t.forEach(i=>{d+=e[i>>4]+e[i&15]}),BigInt("0x0"+d)}function le(t,e){let d=t%e;return d<mt?d+e:d}function We(t,e,d){if(d===mt)throw Error("Modulo cannot be zero");if(d===Bi)return BigInt(0);if(e<mt)throw Error("Unsopported negative exponent");let i=e,a=t;a%=d;let n=BigInt(1);for(;i>mt;){let r=i&Bi;i>>=Bi;let o=n*a%d;n=r?o:n,a=a*a%d}return n}function ps(t){return t>=mt?t:-t}function Mm(t,e){let d=BigInt(0),i=BigInt(1),a=BigInt(1),n=BigInt(0),r=ps(t),o=ps(e),s=t<mt,c=e<mt;for(;o!==mt;){let p=r/o,u=d;d=a-p*d,a=u,u=i,i=n-p*i,n=u,u=o,o=r%o,r=u}return{x:s?-a:a,y:c?-n:n,gcd:r}}function Vi(t,e){let{gcd:d,x:i}=Mm(t,e);if(d!==Bi)throw new Error("Inverse does not exist");return le(i+e,e)}function xm(t,e){let d=t,i=e;for(;i!==mt;){let a=i;i=d%i,d=a}return d}function Or(t){let e=Number(t);if(e>Number.MAX_SAFE_INTEGER)throw new Error("Number can only safely store up to 53 bits");return e}function Lm(t,e){return(t>>BigInt(e)&Bi)===mt?0:1}function ea(t){let e=t<mt?BigInt(-1):mt,d=1,i=t;for(;(i>>=Bi)!==e;)d++;return d}function yt(t){let e=t<mt?BigInt(-1):mt,d=BigInt(8),i=1,a=t;for(;(a>>=d)!==e;)i++;return i}function Oe(t,e="be",d){let i=t.toString(16);i.length%2===1&&(i="0"+i);let a=i.length/2,n=new Uint8Array(d||a),r=d?d-a:0,o=0;for(;o<a;)n[o+r]=parseInt(i.slice(2*o,2*o+2),16),o++;return e!=="be"&&n.reverse(),n}var Om=I.getNodeCrypto();function Je(t){let e=typeof crypto<"u"?crypto:Om?.webcrypto;if(e?.getRandomValues){let d=new Uint8Array(t);return e.getRandomValues(d)}else throw new Error("No secure random number generator available.")}function zd(t,e){if(e<t)throw new Error("Illegal parameter value: max <= min");let d=e-t,i=yt(d),a=ae(Je(i+8));return le(a,d)+t}var Vt=BigInt(1);function ls(t,e,d){let i=BigInt(30),a=Vt<<BigInt(t-1),n=[1,6,5,4,3,2,1,4,3,2,1,2,1,4,3,2,1,2,1,4,3,2,1,6,5,4,3,2,1,2],r=zd(a,a<<Vt),o=Or(le(r,i));do r+=BigInt(n[o]),o=(o+n[o])%n.length,ea(r)>t&&(r=le(r,a<<Vt),r+=a,o=Or(le(r,i)));while(!_c(r,e,d));return r}function _c(t,e,d){return!(e&&xm(t-Vt,e)!==Vt||!km(t)||!Um(t)||!Bm(t,d))}function Um(t,e=BigInt(2)){return We(e,t-Vt,t)===Vt}function km(t){let e=BigInt(0);return qm.every(d=>le(t,d)!==e)}var qm=[7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999,3001,3011,3019,3023,3037,3041,3049,3061,3067,3079,3083,3089,3109,3119,3121,3137,3163,3167,3169,3181,3187,3191,3203,3209,3217,3221,3229,3251,3253,3257,3259,3271,3299,3301,3307,3313,3319,3323,3329,3331,3343,3347,3359,3361,3371,3373,3389,3391,3407,3413,3433,3449,3457,3461,3463,3467,3469,3491,3499,3511,3517,3527,3529,3533,3539,3541,3547,3557,3559,3571,3581,3583,3593,3607,3613,3617,3623,3631,3637,3643,3659,3671,3673,3677,3691,3697,3701,3709,3719,3727,3733,3739,3761,3767,3769,3779,3793,3797,3803,3821,3823,3833,3847,3851,3853,3863,3877,3881,3889,3907,3911,3917,3919,3923,3929,3931,3943,3947,3967,3989,4001,4003,4007,4013,4019,4021,4027,4049,4051,4057,4073,4079,4091,4093,4099,4111,4127,4129,4133,4139,4153,4157,4159,4177,4201,4211,4217,4219,4229,4231,4241,4243,4253,4259,4261,4271,4273,4283,4289,4297,4327,4337,4339,4349,4357,4363,4373,4391,4397,4409,4421,4423,4441,4447,4451,4457,4463,4481,4483,4493,4507,4513,4517,4519,4523,4547,4549,4561,4567,4583,4591,4597,4603,4621,4637,4639,4643,4649,4651,4657,4663,4673,4679,4691,4703,4721,4723,4729,4733,4751,4759,4783,4787,4789,4793,4799,4801,4813,4817,4831,4861,4871,4877,4889,4903,4909,4919,4931,4933,4937,4943,4951,4957,4967,4969,4973,4987,4993,4999].map(t=>BigInt(t));function Bm(t,e,d){let i=ea(t);e||(e=Math.max(1,i/48|0));let a=t-Vt,n=0;for(;!Lm(a,n);)n++;let r=t>>BigInt(n);for(;e>0;e--){let o=zd(BigInt(2),a),s=We(o,r,t);if(s===Vt||s===a)continue;let c;for(c=1;c<n;c++){if(s=le(s*s,t),s===Vt)return!1;if(s===a)break}if(c===n)return!1}return!0}var us=I.getWebCrypto(),bn=I.getNodeCrypto(),jm=bn&&bn.getHashes();function hd(t){if(!(!bn||!jm.includes(t)))return async function(e){let d=bn.createHash(t);return xe(e,i=>{d.update(i)},()=>new Uint8Array(d.digest()))}}function fd(t,e){let d=async()=>{let{nobleHashes:i}=await Promise.resolve().then(function(){return lP}),a=i.get(t);if(!a)throw new Error("Unsupported hash");return a};return async function(i){if(qe(i)&&(i=await Ve(i)),I.isStream(i)){let a=(await d()).create();return xe(i,n=>{a.update(n)},()=>a.digest())}else return us&&e?new Uint8Array(await us.digest(e,i)):(await d())(i)}}var Gm=hd("md5")||fd("md5"),Qm=hd("sha1")||fd("sha1","SHA-1"),Vm=hd("sha224")||fd("sha224"),zm=hd("sha256")||fd("sha256","SHA-256"),Hm=hd("sha384")||fd("sha384","SHA-384"),Wm=hd("sha512")||fd("sha512","SHA-512"),Km=hd("ripemd160")||fd("ripemd160"),Ym=hd("sha3-256")||fd("sha3_256"),_m=hd("sha3-512")||fd("sha3_512");function Yt(t,e){switch(t){case l.hash.md5:return Gm(e);case l.hash.sha1:return Qm(e);case l.hash.ripemd:return Km(e);case l.hash.sha256:return zm(e);case l.hash.sha384:return Hm(e);case l.hash.sha512:return Wm(e);case l.hash.sha224:return Vm(e);case l.hash.sha3_256:return Ym(e);case l.hash.sha3_512:return _m(e);default:throw new Error("Unsupported hash function")}}function je(t){switch(t){case l.hash.md5:return 16;case l.hash.sha1:case l.hash.ripemd:return 20;case l.hash.sha256:return 32;case l.hash.sha384:return 48;case l.hash.sha512:return 64;case l.hash.sha224:return 28;case l.hash.sha3_256:return 32;case l.hash.sha3_512:return 64;default:throw new Error("Invalid hash algorithm.")}}var zt=[];zt[1]=[48,32,48,12,6,8,42,134,72,134,247,13,2,5,5,0,4,16];zt[2]=[48,33,48,9,6,5,43,14,3,2,26,5,0,4,20];zt[3]=[48,33,48,9,6,5,43,36,3,2,1,5,0,4,20];zt[8]=[48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32];zt[9]=[48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48];zt[10]=[48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64];zt[11]=[48,45,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28];function Jm(t){let e=new Uint8Array(t),d=0;for(;d<t;){let i=Je(t-d);for(let a=0;a<i.length;a++)i[a]!==0&&(e[d++]=i[a])}return e}function Jc(t,e){let d=t.length;if(d>e-11)throw new Error("Message too long");let i=Jm(e-d-3),a=new Uint8Array(e);return a[1]=2,a.set(i,2),a.set(t,e-d),a}function $c(t,e){let d=2,i=1;for(let o=d;o<t.length;o++)i&=t[o]!==0,d+=i;let a=d-2,n=t.subarray(d+1),r=t[0]===0&t[1]===2&a>=8&!i;if(e)return I.selectUint8Array(r,n,e);if(r)return n;throw new Error("Decryption error")}function Zc(t,e,d){let i;if(e.length!==je(t))throw new Error("Invalid hash length");let a=new Uint8Array(zt[t].length);for(i=0;i<zt[t].length;i++)a[i]=zt[t][i];let n=a.length+e.length;if(d<n+11)throw new Error("Intended encoded message length too short");let r=new Uint8Array(d-n-3).fill(255),o=new Uint8Array(d);return o[1]=1,o.set(r,2),o.set(a,d-n),o.set(e,d-e.length),o}var zi=I.getWebCrypto(),ui=I.getNodeCrypto(),kd=BigInt(1);async function $m(t,e,d,i,a,n,r,o,s){if(je(t)>=d.length)throw new Error("Digest size cannot exceed key modulus size");if(e&&!I.isStream(e)){if(I.getWebCrypto())try{return await ny(l.read(l.webHash,t),e,d,i,a,n,r,o)}catch(c){I.printDebugError(c)}else if(I.getNodeCrypto())return ry(t,e,d,i,a,n,r,o)}return ay(t,d,a,s)}async function Zm(t,e,d,i,a,n){if(e&&!I.isStream(e)){if(I.getWebCrypto())try{return await sy(l.read(l.webHash,t),e,d,i,a)}catch(r){I.printDebugError(r)}else if(I.getNodeCrypto())return cy(t,e,d,i,a)}return oy(t,d,i,a,n)}async function ey(t,e,d){return I.getNodeCrypto()?py(t,e,d):ly(t,e,d)}async function ty(t,e,d,i,a,n,r,o){if(I.getNodeCrypto()&&!o)try{return await uy(t,e,d,i,a,n,r)}catch(s){I.printDebugError(s)}return my(t,e,d,i,a,n,r,o)}async function dy(t,e){if(e=BigInt(e),I.getWebCrypto()){let r={name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Oe(e),hash:{name:"SHA-1"}},o=await zi.generateKey(r,!0,["sign","verify"]),s=await zi.exportKey("jwk",o.privateKey);return ms(s,e)}else if(I.getNodeCrypto()){let r={modulusLength:t,publicExponent:Or(e),publicKeyEncoding:{type:"pkcs1",format:"jwk"},privateKeyEncoding:{type:"pkcs1",format:"jwk"}},o=await new Promise((s,c)=>{ui.generateKeyPair("rsa",r,(p,u,m)=>{p?c(p):s(m)})});return ms(o,e)}let d,i,a;do i=ls(t-(t>>1),e,40),d=ls(t>>1,e,40),a=d*i;while(ea(a)!==t);let n=(d-kd)*(i-kd);return i<d&&([d,i]=[i,d]),{n:Oe(a),e:Oe(e),d:Oe(Vi(e,n)),p:Oe(d),q:Oe(i),u:Oe(Vi(d,i))}}async function iy(t,e,d,i,a,n){if(t=ae(t),i=ae(i),a=ae(a),i*a!==t)return!1;let r=BigInt(2);if(n=ae(n),le(i*n,a)!==BigInt(1))return!1;e=ae(e),d=ae(d);let o=BigInt(Math.floor(ea(t)/3)),s=zd(r,r<<o),c=s*d*e;return le(c,i-kd)===s&&le(c,a-kd)===s}async function ay(t,e,d,i){e=ae(e);let a=ae(Zc(t,i,yt(e)));return d=ae(d),Oe(We(a,d,e),"be",yt(e))}async function ny(t,e,d,i,a,n,r,o){let s=await fo(d,i,a,n,r,o),c={name:"RSASSA-PKCS1-v1_5",hash:{name:t}},p=await zi.importKey("jwk",s,c,!1,["sign"]);return new Uint8Array(await zi.sign("RSASSA-PKCS1-v1_5",p,e))}async function ry(t,e,d,i,a,n,r,o){let s=ui.createSign(l.read(l.hash,t));s.write(e),s.end();let c=await fo(d,i,a,n,r,o);return new Uint8Array(s.sign({key:c,format:"jwk",type:"pkcs1"}))}async function oy(t,e,d,i,a){if(d=ae(d),e=ae(e),i=ae(i),e>=d)throw new Error("Signature size cannot exceed modulus size");let n=Oe(We(e,i,d),"be",yt(d)),r=Zc(t,a,yt(d));return I.equalsUint8Array(n,r)}async function sy(t,e,d,i,a){let n=Io(i,a),r=await zi.importKey("jwk",n,{name:"RSASSA-PKCS1-v1_5",hash:{name:t}},!1,["verify"]);return zi.verify("RSASSA-PKCS1-v1_5",r,d,e)}async function cy(t,e,d,i,a){let n={key:Io(i,a),format:"jwk",type:"pkcs1"},r=ui.createVerify(l.read(l.hash,t));r.write(e),r.end();try{return r.verify(n,d)}catch{return!1}}async function py(t,e,d){let i={key:Io(e,d),format:"jwk",type:"pkcs1",padding:ui.constants.RSA_PKCS1_PADDING};return new Uint8Array(ui.publicEncrypt(i,t))}async function ly(t,e,d){if(e=ae(e),t=ae(Jc(t,yt(e))),d=ae(d),t>=e)throw new Error("Message size cannot exceed modulus size");return Oe(We(t,d,e),"be",yt(e))}async function uy(t,e,d,i,a,n,r){let o={key:await fo(e,d,i,a,n,r),format:"jwk",type:"pkcs1",padding:ui.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(ui.privateDecrypt(o,t))}catch{throw new Error("Decryption error")}}async function my(t,e,d,i,a,n,r,o){if(t=ae(t),e=ae(e),d=ae(d),i=ae(i),a=ae(a),n=ae(n),r=ae(r),t>=e)throw new Error("Data too large.");let s=le(i,n-kd),c=le(i,a-kd),p=zd(BigInt(2),e),u=We(Vi(p,e),d,e);t=le(t*u,e);let m=We(t,c,a),S=We(t,s,n),g=le(r*(S-m),n)*a+m;return g=le(g*p,e),$c(Oe(g,"be",yt(e)),o)}async function fo(t,e,d,i,a,n){let r=ae(i),o=ae(a),s=ae(d),c=le(s,o-kd),p=le(s,r-kd);return p=Oe(p),c=Oe(c),{kty:"RSA",n:at(t),e:at(e),d:at(d),p:at(a),q:at(i),dp:at(c),dq:at(p),qi:at(n),ext:!0}}function Io(t,e){return{kty:"RSA",n:at(t),e:at(e),ext:!0}}function ms(t,e){return{n:At(t.n),e:Oe(e),d:At(t.d),p:At(t.q),q:At(t.p),u:At(t.qi)}}var wd=BigInt(1);async function yy(t,e,d,i){e=ae(e),d=ae(d),i=ae(i);let a=Jc(t,yt(e)),n=ae(a),r=zd(wd,e-wd);return{c1:Oe(We(d,r,e)),c2:Oe(le(We(i,r,e)*n,e))}}async function Sy(t,e,d,i,a){t=ae(t),e=ae(e),d=ae(d),i=ae(i);let n=le(Vi(We(t,i,d),d)*e,d);return $c(Oe(n,"be",yt(d)),a)}async function Py(t,e,d,i){if(t=ae(t),e=ae(e),d=ae(d),e<=wd||e>=t)return!1;let a=BigInt(ea(t)),n=BigInt(1023);if(a<n||We(e,t-wd,t)!==wd)return!1;let r=e,o=BigInt(1),s=BigInt(2),c=s<<BigInt(17);for(;o<c;){if(r=le(r*e,t),r===wd)return!1;o++}i=ae(i);let p=zd(s<<a-wd,s<<a),u=(t-wd)*p+i;return d===We(e,u,t)}var or=typeof et=="object"&&"crypto"in et?et.crypto:void 0,De={},ie=function(t){var e,d=new Float64Array(16);if(t)for(e=0;e<t.length;e++)d[e]=t[e];return d},bo=function(){throw new Error("no PRNG")},ep=new Uint8Array(32);ep[0]=9;var Ur=ie(),Fn=ie([1]),gy=ie([56129,1]),hy=ie([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),fy=ie([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),ys=ie([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Ss=ie([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Iy=ie([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ps(t,e,d,i){t[e]=d>>24&255,t[e+1]=d>>16&255,t[e+2]=d>>8&255,t[e+3]=d&255,t[e+4]=i>>24&255,t[e+5]=i>>16&255,t[e+6]=i>>8&255,t[e+7]=i&255}function by(t,e,d,i,a){var n,r=0;for(n=0;n<a;n++)r|=t[e+n]^d[i+n];return(1&r-1>>>8)-1}function tp(t,e,d,i){return by(t,e,d,i,32)}function Md(t,e){var d;for(d=0;d<16;d++)t[d]=e[d]|0}function sr(t){var e,d,i=1;for(e=0;e<16;e++)d=t[e]+i+65535,i=Math.floor(d/65536),t[e]=d-i*65536;t[0]+=i-1+37*(i-1)}function Oi(t,e,d){for(var i,a=~(d-1),n=0;n<16;n++)i=a&(t[n]^e[n]),t[n]^=i,e[n]^=i}function Ea(t,e){var d,i,a,n=ie(),r=ie();for(d=0;d<16;d++)r[d]=e[d];for(sr(r),sr(r),sr(r),i=0;i<2;i++){for(n[0]=r[0]-65517,d=1;d<15;d++)n[d]=r[d]-65535-(n[d-1]>>16&1),n[d-1]&=65535;n[15]=r[15]-32767-(n[14]>>16&1),a=n[15]>>16&1,n[14]&=65535,Oi(r,n,1-a)}for(d=0;d<16;d++)t[2*d]=r[d]&255,t[2*d+1]=r[d]>>8}function gs(t,e){var d=new Uint8Array(32),i=new Uint8Array(32);return Ea(d,t),Ea(i,e),tp(d,0,i,0)}function dp(t){var e=new Uint8Array(32);return Ea(e,t),e[0]&1}function ip(t,e){var d;for(d=0;d<16;d++)t[d]=e[2*d]+(e[2*d+1]<<8);t[15]&=32767}function Bt(t,e,d){for(var i=0;i<16;i++)t[i]=e[i]+d[i]}function Gt(t,e,d){for(var i=0;i<16;i++)t[i]=e[i]-d[i]}function ue(t,e,d){var i,a,n=0,r=0,o=0,s=0,c=0,p=0,u=0,m=0,S=0,g=0,y=0,P=0,f=0,E=0,v=0,F=0,D=0,h=0,X=0,b=0,T=0,C=0,R=0,M=0,x=0,N=0,w=0,A=0,U=0,L=0,j=0,B=d[0],H=d[1],Y=d[2],Q=d[3],W=d[4],G=d[5],K=d[6],te=d[7],_=d[8],Z=d[9],de=d[10],oe=d[11],pe=d[12],fe=d[13],me=d[14],Pe=d[15];i=e[0],n+=i*B,r+=i*H,o+=i*Y,s+=i*Q,c+=i*W,p+=i*G,u+=i*K,m+=i*te,S+=i*_,g+=i*Z,y+=i*de,P+=i*oe,f+=i*pe,E+=i*fe,v+=i*me,F+=i*Pe,i=e[1],r+=i*B,o+=i*H,s+=i*Y,c+=i*Q,p+=i*W,u+=i*G,m+=i*K,S+=i*te,g+=i*_,y+=i*Z,P+=i*de,f+=i*oe,E+=i*pe,v+=i*fe,F+=i*me,D+=i*Pe,i=e[2],o+=i*B,s+=i*H,c+=i*Y,p+=i*Q,u+=i*W,m+=i*G,S+=i*K,g+=i*te,y+=i*_,P+=i*Z,f+=i*de,E+=i*oe,v+=i*pe,F+=i*fe,D+=i*me,h+=i*Pe,i=e[3],s+=i*B,c+=i*H,p+=i*Y,u+=i*Q,m+=i*W,S+=i*G,g+=i*K,y+=i*te,P+=i*_,f+=i*Z,E+=i*de,v+=i*oe,F+=i*pe,D+=i*fe,h+=i*me,X+=i*Pe,i=e[4],c+=i*B,p+=i*H,u+=i*Y,m+=i*Q,S+=i*W,g+=i*G,y+=i*K,P+=i*te,f+=i*_,E+=i*Z,v+=i*de,F+=i*oe,D+=i*pe,h+=i*fe,X+=i*me,b+=i*Pe,i=e[5],p+=i*B,u+=i*H,m+=i*Y,S+=i*Q,g+=i*W,y+=i*G,P+=i*K,f+=i*te,E+=i*_,v+=i*Z,F+=i*de,D+=i*oe,h+=i*pe,X+=i*fe,b+=i*me,T+=i*Pe,i=e[6],u+=i*B,m+=i*H,S+=i*Y,g+=i*Q,y+=i*W,P+=i*G,f+=i*K,E+=i*te,v+=i*_,F+=i*Z,D+=i*de,h+=i*oe,X+=i*pe,b+=i*fe,T+=i*me,C+=i*Pe,i=e[7],m+=i*B,S+=i*H,g+=i*Y,y+=i*Q,P+=i*W,f+=i*G,E+=i*K,v+=i*te,F+=i*_,D+=i*Z,h+=i*de,X+=i*oe,b+=i*pe,T+=i*fe,C+=i*me,R+=i*Pe,i=e[8],S+=i*B,g+=i*H,y+=i*Y,P+=i*Q,f+=i*W,E+=i*G,v+=i*K,F+=i*te,D+=i*_,h+=i*Z,X+=i*de,b+=i*oe,T+=i*pe,C+=i*fe,R+=i*me,M+=i*Pe,i=e[9],g+=i*B,y+=i*H,P+=i*Y,f+=i*Q,E+=i*W,v+=i*G,F+=i*K,D+=i*te,h+=i*_,X+=i*Z,b+=i*de,T+=i*oe,C+=i*pe,R+=i*fe,M+=i*me,x+=i*Pe,i=e[10],y+=i*B,P+=i*H,f+=i*Y,E+=i*Q,v+=i*W,F+=i*G,D+=i*K,h+=i*te,X+=i*_,b+=i*Z,T+=i*de,C+=i*oe,R+=i*pe,M+=i*fe,x+=i*me,N+=i*Pe,i=e[11],P+=i*B,f+=i*H,E+=i*Y,v+=i*Q,F+=i*W,D+=i*G,h+=i*K,X+=i*te,b+=i*_,T+=i*Z,C+=i*de,R+=i*oe,M+=i*pe,x+=i*fe,N+=i*me,w+=i*Pe,i=e[12],f+=i*B,E+=i*H,v+=i*Y,F+=i*Q,D+=i*W,h+=i*G,X+=i*K,b+=i*te,T+=i*_,C+=i*Z,R+=i*de,M+=i*oe,x+=i*pe,N+=i*fe,w+=i*me,A+=i*Pe,i=e[13],E+=i*B,v+=i*H,F+=i*Y,D+=i*Q,h+=i*W,X+=i*G,b+=i*K,T+=i*te,C+=i*_,R+=i*Z,M+=i*de,x+=i*oe,N+=i*pe,w+=i*fe,A+=i*me,U+=i*Pe,i=e[14],v+=i*B,F+=i*H,D+=i*Y,h+=i*Q,X+=i*W,b+=i*G,T+=i*K,C+=i*te,R+=i*_,M+=i*Z,x+=i*de,N+=i*oe,w+=i*pe,A+=i*fe,U+=i*me,L+=i*Pe,i=e[15],F+=i*B,D+=i*H,h+=i*Y,X+=i*Q,b+=i*W,T+=i*G,C+=i*K,R+=i*te,M+=i*_,x+=i*Z,N+=i*de,w+=i*oe,A+=i*pe,U+=i*fe,L+=i*me,j+=i*Pe,n+=38*D,r+=38*h,o+=38*X,s+=38*b,c+=38*T,p+=38*C,u+=38*R,m+=38*M,S+=38*x,g+=38*N,y+=38*w,P+=38*A,f+=38*U,E+=38*L,v+=38*j,a=1,i=n+a+65535,a=Math.floor(i/65536),n=i-a*65536,i=r+a+65535,a=Math.floor(i/65536),r=i-a*65536,i=o+a+65535,a=Math.floor(i/65536),o=i-a*65536,i=s+a+65535,a=Math.floor(i/65536),s=i-a*65536,i=c+a+65535,a=Math.floor(i/65536),c=i-a*65536,i=p+a+65535,a=Math.floor(i/65536),p=i-a*65536,i=u+a+65535,a=Math.floor(i/65536),u=i-a*65536,i=m+a+65535,a=Math.floor(i/65536),m=i-a*65536,i=S+a+65535,a=Math.floor(i/65536),S=i-a*65536,i=g+a+65535,a=Math.floor(i/65536),g=i-a*65536,i=y+a+65535,a=Math.floor(i/65536),y=i-a*65536,i=P+a+65535,a=Math.floor(i/65536),P=i-a*65536,i=f+a+65535,a=Math.floor(i/65536),f=i-a*65536,i=E+a+65535,a=Math.floor(i/65536),E=i-a*65536,i=v+a+65535,a=Math.floor(i/65536),v=i-a*65536,i=F+a+65535,a=Math.floor(i/65536),F=i-a*65536,n+=a-1+37*(a-1),a=1,i=n+a+65535,a=Math.floor(i/65536),n=i-a*65536,i=r+a+65535,a=Math.floor(i/65536),r=i-a*65536,i=o+a+65535,a=Math.floor(i/65536),o=i-a*65536,i=s+a+65535,a=Math.floor(i/65536),s=i-a*65536,i=c+a+65535,a=Math.floor(i/65536),c=i-a*65536,i=p+a+65535,a=Math.floor(i/65536),p=i-a*65536,i=u+a+65535,a=Math.floor(i/65536),u=i-a*65536,i=m+a+65535,a=Math.floor(i/65536),m=i-a*65536,i=S+a+65535,a=Math.floor(i/65536),S=i-a*65536,i=g+a+65535,a=Math.floor(i/65536),g=i-a*65536,i=y+a+65535,a=Math.floor(i/65536),y=i-a*65536,i=P+a+65535,a=Math.floor(i/65536),P=i-a*65536,i=f+a+65535,a=Math.floor(i/65536),f=i-a*65536,i=E+a+65535,a=Math.floor(i/65536),E=i-a*65536,i=v+a+65535,a=Math.floor(i/65536),v=i-a*65536,i=F+a+65535,a=Math.floor(i/65536),F=i-a*65536,n+=a-1+37*(a-1),t[0]=n,t[1]=r,t[2]=o,t[3]=s,t[4]=c,t[5]=p,t[6]=u,t[7]=m,t[8]=S,t[9]=g,t[10]=y,t[11]=P,t[12]=f,t[13]=E,t[14]=v,t[15]=F}function wt(t,e){ue(t,e,e)}function ap(t,e){var d=ie(),i;for(i=0;i<16;i++)d[i]=e[i];for(i=253;i>=0;i--)wt(d,d),i!==2&&i!==4&&ue(d,d,e);for(i=0;i<16;i++)t[i]=d[i]}function Fy(t,e){var d=ie(),i;for(i=0;i<16;i++)d[i]=e[i];for(i=250;i>=0;i--)wt(d,d),i!==1&&ue(d,d,e);for(i=0;i<16;i++)t[i]=d[i]}function np(t,e,d){var i=new Uint8Array(32),a=new Float64Array(80),n,r,o=ie(),s=ie(),c=ie(),p=ie(),u=ie(),m=ie();for(r=0;r<31;r++)i[r]=e[r];for(i[31]=e[31]&127|64,i[0]&=248,ip(a,d),r=0;r<16;r++)s[r]=a[r],p[r]=o[r]=c[r]=0;for(o[0]=p[0]=1,r=254;r>=0;--r)n=i[r>>>3]>>>(r&7)&1,Oi(o,s,n),Oi(c,p,n),Bt(u,o,c),Gt(o,o,c),Bt(c,s,p),Gt(s,s,p),wt(p,u),wt(m,o),ue(o,c,o),ue(c,s,u),Bt(u,o,c),Gt(o,o,c),wt(s,o),Gt(c,p,m),ue(o,c,gy),Bt(o,o,p),ue(c,c,o),ue(o,p,m),ue(p,s,a),wt(s,u),Oi(o,s,n),Oi(c,p,n);for(r=0;r<16;r++)a[r+16]=o[r],a[r+32]=c[r],a[r+48]=s[r],a[r+64]=p[r];var S=a.subarray(32),g=a.subarray(16);return ap(S,S),ue(g,g,S),Ea(t,g),0}function rp(t,e){return np(t,e,ep)}function Ey(t,e){return bo(e,32),rp(t,e)}var hs=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function fs(t,e,d,i){for(var a=new Int32Array(16),n=new Int32Array(16),r,o,s,c,p,u,m,S,g,y,P,f,E,v,F,D,h,X,b,T,C,R,M,x,N,w,A=t[0],U=t[1],L=t[2],j=t[3],B=t[4],H=t[5],Y=t[6],Q=t[7],W=e[0],G=e[1],K=e[2],te=e[3],_=e[4],Z=e[5],de=e[6],oe=e[7],pe=0;i>=128;){for(b=0;b<16;b++)T=8*b+pe,a[b]=d[T+0]<<24|d[T+1]<<16|d[T+2]<<8|d[T+3],n[b]=d[T+4]<<24|d[T+5]<<16|d[T+6]<<8|d[T+7];for(b=0;b<80;b++)if(r=A,o=U,s=L,c=j,p=B,u=H,m=Y,S=Q,g=W,y=G,P=K,f=te,E=_,v=Z,F=de,D=oe,C=Q,R=oe,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=(B>>>14|_<<18)^(B>>>18|_<<14)^(_>>>9|B<<23),R=(_>>>14|B<<18)^(_>>>18|B<<14)^(B>>>9|_<<23),M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,C=B&H^~B&Y,R=_&Z^~_&de,M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,C=hs[b*2],R=hs[b*2+1],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,C=a[b%16],R=n[b%16],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,h=N&65535|w<<16,X=M&65535|x<<16,C=h,R=X,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=(A>>>28|W<<4)^(W>>>2|A<<30)^(W>>>7|A<<25),R=(W>>>28|A<<4)^(A>>>2|W<<30)^(A>>>7|W<<25),M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,C=A&U^A&L^U&L,R=W&G^W&K^G&K,M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,S=N&65535|w<<16,D=M&65535|x<<16,C=c,R=f,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=h,R=X,M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,c=N&65535|w<<16,f=M&65535|x<<16,U=r,L=o,j=s,B=c,H=p,Y=u,Q=m,A=S,G=g,K=y,te=P,_=f,Z=E,de=v,oe=F,W=D,b%16===15)for(T=0;T<16;T++)C=a[T],R=n[T],M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=a[(T+9)%16],R=n[(T+9)%16],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,h=a[(T+1)%16],X=n[(T+1)%16],C=(h>>>1|X<<31)^(h>>>8|X<<24)^h>>>7,R=(X>>>1|h<<31)^(X>>>8|h<<24)^(X>>>7|h<<25),M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,h=a[(T+14)%16],X=n[(T+14)%16],C=(h>>>19|X<<13)^(X>>>29|h<<3)^h>>>6,R=(X>>>19|h<<13)^(h>>>29|X<<3)^(X>>>6|h<<26),M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,a[T]=N&65535|w<<16,n[T]=M&65535|x<<16;C=A,R=W,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=t[0],R=e[0],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,t[0]=A=N&65535|w<<16,e[0]=W=M&65535|x<<16,C=U,R=G,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=t[1],R=e[1],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,t[1]=U=N&65535|w<<16,e[1]=G=M&65535|x<<16,C=L,R=K,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=t[2],R=e[2],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,t[2]=L=N&65535|w<<16,e[2]=K=M&65535|x<<16,C=j,R=te,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=t[3],R=e[3],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,t[3]=j=N&65535|w<<16,e[3]=te=M&65535|x<<16,C=B,R=_,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=t[4],R=e[4],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,t[4]=B=N&65535|w<<16,e[4]=_=M&65535|x<<16,C=H,R=Z,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=t[5],R=e[5],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,t[5]=H=N&65535|w<<16,e[5]=Z=M&65535|x<<16,C=Y,R=de,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=t[6],R=e[6],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,t[6]=Y=N&65535|w<<16,e[6]=de=M&65535|x<<16,C=Q,R=oe,M=R&65535,x=R>>>16,N=C&65535,w=C>>>16,C=t[7],R=e[7],M+=R&65535,x+=R>>>16,N+=C&65535,w+=C>>>16,x+=M>>>16,N+=x>>>16,w+=N>>>16,t[7]=Q=N&65535|w<<16,e[7]=oe=M&65535|x<<16,pe+=128,i-=128}return i}function fa(t,e,d){var i=new Int32Array(8),a=new Int32Array(8),n=new Uint8Array(256),r,o=d;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,fs(i,a,e,d),d%=128,r=0;r<d;r++)n[r]=e[o-d+r];for(n[d]=128,d=256-128*(d<112?1:0),n[d-9]=0,Ps(n,d-8,o/536870912|0,o<<3),fs(i,a,n,d),r=0;r<8;r++)Ps(t,8*r,i[r],a[r]);return 0}function kr(t,e){var d=ie(),i=ie(),a=ie(),n=ie(),r=ie(),o=ie(),s=ie(),c=ie(),p=ie();Gt(d,t[1],t[0]),Gt(p,e[1],e[0]),ue(d,d,p),Bt(i,t[0],t[1]),Bt(p,e[0],e[1]),ue(i,i,p),ue(a,t[3],e[3]),ue(a,a,fy),ue(n,t[2],e[2]),Bt(n,n,n),Gt(r,i,d),Gt(o,n,a),Bt(s,n,a),Bt(c,i,d),ue(t[0],r,o),ue(t[1],c,s),ue(t[2],s,o),ue(t[3],r,c)}function Is(t,e,d){var i;for(i=0;i<4;i++)Oi(t[i],e[i],d)}function Fo(t,e){var d=ie(),i=ie(),a=ie();ap(a,e[2]),ue(d,e[0],a),ue(i,e[1],a),Ea(t,i),t[31]^=dp(d)<<7}function op(t,e,d){var i,a;for(Md(t[0],Ur),Md(t[1],Fn),Md(t[2],Fn),Md(t[3],Ur),a=255;a>=0;--a)i=d[a/8|0]>>(a&7)&1,Is(t,e,i),kr(e,t),kr(t,t),Is(t,e,i)}function Eo(t,e){var d=[ie(),ie(),ie(),ie()];Md(d[0],ys),Md(d[1],Ss),Md(d[2],Fn),ue(d[3],ys,Ss),op(t,d,e)}function sp(t,e,d){var i=new Uint8Array(64),a=[ie(),ie(),ie(),ie()],n;for(d||bo(e,32),fa(i,e,32),i[0]&=248,i[31]&=127,i[31]|=64,Eo(a,i),Fo(t,a),n=0;n<32;n++)e[n+32]=t[n];return 0}var cr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function cp(t,e){var d,i,a,n;for(i=63;i>=32;--i){for(d=0,a=i-32,n=i-12;a<n;++a)e[a]+=d-16*e[i]*cr[a-(i-32)],d=Math.floor((e[a]+128)/256),e[a]-=d*256;e[a]+=d,e[i]=0}for(d=0,a=0;a<32;a++)e[a]+=d-(e[31]>>4)*cr[a],d=e[a]>>8,e[a]&=255;for(a=0;a<32;a++)e[a]-=d*cr[a];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=e[i]&255}function qr(t){var e=new Float64Array(64),d;for(d=0;d<64;d++)e[d]=t[d];for(d=0;d<64;d++)t[d]=0;cp(t,e)}function vy(t,e,d,i){var a=new Uint8Array(64),n=new Uint8Array(64),r=new Uint8Array(64),o,s,c=new Float64Array(64),p=[ie(),ie(),ie(),ie()];fa(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var u=d+64;for(o=0;o<d;o++)t[64+o]=e[o];for(o=0;o<32;o++)t[32+o]=a[32+o];for(fa(r,t.subarray(32),d+32),qr(r),Eo(p,r),Fo(t,p),o=32;o<64;o++)t[o]=i[o];for(fa(n,t,d+64),qr(n),o=0;o<64;o++)c[o]=0;for(o=0;o<32;o++)c[o]=r[o];for(o=0;o<32;o++)for(s=0;s<32;s++)c[o+s]+=n[o]*a[s];return cp(t.subarray(32),c),u}function Cy(t,e){var d=ie(),i=ie(),a=ie(),n=ie(),r=ie(),o=ie(),s=ie();return Md(t[2],Fn),ip(t[1],e),wt(a,t[1]),ue(n,a,hy),Gt(a,a,t[2]),Bt(n,t[2],n),wt(r,n),wt(o,r),ue(s,o,r),ue(d,s,a),ue(d,d,n),Fy(d,d),ue(d,d,a),ue(d,d,n),ue(d,d,n),ue(t[0],d,n),wt(i,t[0]),ue(i,i,n),gs(i,a)&&ue(t[0],t[0],Iy),wt(i,t[0]),ue(i,i,n),gs(i,a)?-1:(dp(t[0])===e[31]>>7&&Gt(t[0],Ur,t[0]),ue(t[3],t[0],t[1]),0)}function Xy(t,e,d,i){var a,n=new Uint8Array(32),r=new Uint8Array(64),o=[ie(),ie(),ie(),ie()],s=[ie(),ie(),ie(),ie()];if(d<64||Cy(s,i))return-1;for(a=0;a<d;a++)t[a]=e[a];for(a=0;a<32;a++)t[a+32]=i[a];if(fa(r,t,d),qr(r),op(o,s,r),Eo(s,e.subarray(32)),kr(o,s),Fo(n,o),d-=64,tp(e,0,n,0)){for(a=0;a<d;a++)t[a]=0;return-1}for(a=0;a<d;a++)t[a]=e[a+64];return d}var bs=32,Ty=32,pp=32,lp=32,ni=64,jn=32,Gn=64,Dy=32;function ta(){for(var t=0;t<arguments.length;t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Ry(t){for(var e=0;e<t.length;e++)t[e]=0}De.scalarMult=function(t,e){if(ta(t,e),t.length!==Ty)throw new Error("bad n size");if(e.length!==bs)throw new Error("bad p size");var d=new Uint8Array(bs);return np(d,t,e),d};De.box={};De.box.keyPair=function(){var t=new Uint8Array(pp),e=new Uint8Array(lp);return Ey(t,e),{publicKey:t,secretKey:e}};De.box.keyPair.fromSecretKey=function(t){if(ta(t),t.length!==lp)throw new Error("bad secret key size");var e=new Uint8Array(pp);return rp(e,t),{publicKey:e,secretKey:new Uint8Array(t)}};De.sign=function(t,e){if(ta(t,e),e.length!==Gn)throw new Error("bad secret key size");var d=new Uint8Array(ni+t.length);return vy(d,t,t.length,e),d};De.sign.detached=function(t,e){for(var d=De.sign(t,e),i=new Uint8Array(ni),a=0;a<i.length;a++)i[a]=d[a];return i};De.sign.detached.verify=function(t,e,d){if(ta(t,e,d),e.length!==ni)throw new Error("bad signature size");if(d.length!==jn)throw new Error("bad public key size");var i=new Uint8Array(ni+t.length),a=new Uint8Array(ni+t.length),n;for(n=0;n<ni;n++)i[n]=e[n];for(n=0;n<t.length;n++)i[n+ni]=t[n];return Xy(a,i,i.length,d)>=0};De.sign.keyPair=function(){var t=new Uint8Array(jn),e=new Uint8Array(Gn);return sp(t,e),{publicKey:t,secretKey:e}};De.sign.keyPair.fromSecretKey=function(t){if(ta(t),t.length!==Gn)throw new Error("bad secret key size");for(var e=new Uint8Array(jn),d=0;d<e.length;d++)e[d]=t[32+d];return{publicKey:e,secretKey:new Uint8Array(t)}};De.sign.keyPair.fromSeed=function(t){if(ta(t),t.length!==Dy)throw new Error("bad seed size");for(var e=new Uint8Array(jn),d=new Uint8Array(Gn),i=0;i<32;i++)d[i]=t[i];return sp(e,d,!0),{publicKey:e,secretKey:d}};De.setPRNG=function(t){bo=t};(function(){if(or&&or.getRandomValues){var t=65536;De.setPRNG(function(e,d){var i,a=new Uint8Array(d);for(i=0;i<d;i+=t)or.getRandomValues(a.subarray(i,i+Math.min(d-i,t)));for(i=0;i<d;i++)e[i]=a[i];Ry(a)})}})();var Ny={"2a8648ce3d030107":l.curve.nistP256,"2b81040022":l.curve.nistP384,"2b81040023":l.curve.nistP521,"2b8104000a":l.curve.secp256k1,"2b06010401da470f01":l.curve.ed25519Legacy,"2b060104019755010501":l.curve.curve25519Legacy,"2b2403030208010107":l.curve.brainpoolP256r1,"2b240303020801010b":l.curve.brainpoolP384r1,"2b240303020801010d":l.curve.brainpoolP512r1},oi=class up{constructor(e){if(e instanceof up)this.oid=e.oid;else if(I.isArray(e)||I.isUint8Array(e)){if(e=new Uint8Array(e),e[0]===6){if(e[1]!==e.length-2)throw new Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){let d=e[0];if(e.length>=1+d)return this.oid=e.subarray(1,1+d),1+this.oid.length}throw new Error("Invalid oid")}write(){return I.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return I.uint8ArrayToHex(this.oid)}getName(){let e=Ny[this.toHex()];if(!e)throw new Error("Unknown curve object identifier.");return e}};function mp(t){let e=0,d,i=t[0];return i<192?([e]=t,d=1):i<255?(e=(t[0]-192<<8)+t[1]+192,d=2):i===255&&(e=I.readNumber(t.subarray(1,5)),d=5),{len:e,offset:d}}function Qn(t){return t<192?new Uint8Array([t]):t>191&&t<8384?new Uint8Array([(t-192>>8)+192,t-192&255]):I.concatUint8Array([new Uint8Array([255]),I.writeNumber(t,4)])}function Ay(t){if(t<0||t>30)throw new Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+t])}function En(t){return new Uint8Array([192|t])}function Fs(t,e){return I.concatUint8Array([En(t),Qn(e)])}function sn(t){return[l.packet.literalData,l.packet.compressedData,l.packet.symmetricallyEncryptedData,l.packet.symEncryptedIntegrityProtectedData,l.packet.aeadEncryptedData].includes(t)}async function wy(t,e){let d=gd(t),i,a;try{let n=await d.peekBytes(2);if(!n||n.length<2||(n[0]&128)===0)throw new Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");let r=await d.readByte(),o=-1,s=-1,c;s=0,(r&64)!==0&&(s=1);let p;s?o=r&63:(o=(r&63)>>2,p=r&3);let u=sn(o),m=null;if(u){if(I.isStream(t)==="array"){let y=new Kt;i=ht(y),m=y}else{let y=new TransformStream;i=ht(y.writable),m=y.readable}a=e({tag:o,packet:m})}else m=[];let S;do{if(s){let y=await d.readByte();if(S=!1,y<192)c=y;else if(y>=192&&y<224)c=(y-192<<8)+await d.readByte()+192;else if(y>223&&y<255){if(c=1<<(y&31),S=!0,!u)throw new TypeError("This packet type does not support partial lengths.")}else c=await d.readByte()<<24|await d.readByte()<<16|await d.readByte()<<8|await d.readByte()}else switch(p){case 0:c=await d.readByte();break;case 1:c=await d.readByte()<<8|await d.readByte();break;case 2:c=await d.readByte()<<24|await d.readByte()<<16|await d.readByte()<<8|await d.readByte();break;default:c=1/0;break}if(c>0){let y=0;for(;;){i&&await i.ready;let{done:P,value:f}=await d.read();if(P){if(c===1/0)break;throw new Error("Unexpected end of packet")}let E=c===1/0?f:f.subarray(0,c-y);if(i?await i.write(E):m.push(E),y+=f.length,y>=c){d.unshift(f.subarray(c-y+f.length));break}}}}while(S);let g=await d.peekBytes(u?1/0:2);return i?(await i.ready,await i.close()):(m=I.concatUint8Array(m),await e({tag:o,packet:m})),!g||!g.length}catch(n){if(i)return await i.abort(n),!0;throw n}finally{i&&await a,d.releaseLock()}}var Te=class yp extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,yp),this.name="UnsupportedError"}},Sp=class extends Te{constructor(...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Te),this.name="UnknownPacketError"}},Br=class{constructor(t,e){this.tag=t,this.rawContent=e}write(){return this.rawContent}};async function vo(t){switch(t){case l.publicKey.ed25519:try{let e=I.getWebCrypto(),d=await e.generateKey("Ed25519",!0,["sign","verify"]),i=await e.exportKey("jwk",d.privateKey),a=await e.exportKey("jwk",d.publicKey);return{A:new Uint8Array(At(a.x)),seed:At(i.d,!0)}}catch(e){if(e.name!=="NotSupportedError"&&e.name!=="OperationError")throw e;let d=Je(Vn(t)),{publicKey:i}=De.sign.keyPair.fromSeed(d);return{A:i,seed:d}}case l.publicKey.ed448:{let e=await I.getNobleCurve(l.publicKey.ed448),d=e.utils.randomPrivateKey();return{A:e.getPublicKey(d),seed:d}}default:throw new Error("Unsupported EdDSA algorithm")}}async function Co(t,e,d,i,a,n){if(je(e)<je(zn(t)))throw new Error("Hash algorithm too weak for EdDSA.");switch(t){case l.publicKey.ed25519:try{let r=I.getWebCrypto(),o=My(t,i,a),s=await r.importKey("jwk",o,"Ed25519",!1,["sign"]);return{RS:new Uint8Array(await r.sign("Ed25519",s,n))}}catch(r){if(r.name!=="NotSupportedError")throw r;let o=I.concatUint8Array([a,i]);return{RS:De.sign.detached(n,o)}}case l.publicKey.ed448:return{RS:(await I.getNobleCurve(l.publicKey.ed448)).sign(n,a)};default:throw new Error("Unsupported EdDSA algorithm")}}async function Xo(t,e,{RS:d},i,a,n){if(je(e)<je(zn(t)))throw new Error("Hash algorithm too weak for EdDSA.");switch(t){case l.publicKey.ed25519:try{let r=I.getWebCrypto(),o=gp(t,a),s=await r.importKey("jwk",o,"Ed25519",!1,["verify"]);return await r.verify("Ed25519",s,d,n)}catch(r){if(r.name!=="NotSupportedError")throw r;return De.sign.detached.verify(n,d,a)}case l.publicKey.ed448:return(await I.getNobleCurve(l.publicKey.ed448)).verify(d,n,a);default:throw new Error("Unsupported EdDSA algorithm")}}async function Pp(t,e,d){switch(t){case l.publicKey.ed25519:{let{publicKey:i}=De.sign.keyPair.fromSeed(d);return I.equalsUint8Array(e,i)}case l.publicKey.ed448:{let i=(await I.getNobleCurve(l.publicKey.ed448)).getPublicKey(d);return I.equalsUint8Array(e,i)}default:return!1}}function Vn(t){switch(t){case l.publicKey.ed25519:return 32;case l.publicKey.ed448:return 57;default:throw new Error("Unsupported EdDSA algorithm")}}function zn(t){switch(t){case l.publicKey.ed25519:return l.hash.sha256;case l.publicKey.ed448:return l.hash.sha512;default:throw new Error("Unknown EdDSA algo")}}var gp=(t,e)=>{switch(t){case l.publicKey.ed25519:return{kty:"OKP",crv:"Ed25519",x:at(e),ext:!0};default:throw new Error("Unsupported EdDSA algorithm")}},My=(t,e,d)=>{switch(t){case l.publicKey.ed25519:{let i=gp(t,e);return i.d=at(d),i}default:throw new Error("Unsupported EdDSA algorithm")}},xy=Object.freeze({__proto__:null,generate:vo,getPayloadSize:Vn,getPreferredHashAlgo:zn,sign:Co,validateParams:Pp,verify:Xo});function hp(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function he(t,...e){if(!hp(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function vn(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function fp(t,e){he(t);let d=e.outputLen;if(t.length<d)throw new Error(`digestInto() expects output buffer of length at least ${d}`)}var To=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Ee=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Hn=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ly=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ly)throw new Error("Non little-endian hardware is not supported");function Oy(t){if(typeof t!="string")throw new Error(`string expected, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function va(t){if(typeof t=="string")t=Oy(t);else if(hp(t))t=St(t);else throw new Error(`Uint8Array expected, got ${typeof t}`);return t}function Uy(...t){let e=0;for(let i=0;i<t.length;i++){let a=t[i];he(a),e+=a.length}let d=new Uint8Array(e);for(let i=0,a=0;i<t.length;i++){let n=t[i];d.set(n,a),a+=n.length}return d}function Ip(t,e){if(t.length!==e.length)return!1;let d=0;for(let i=0;i<t.length;i++)d|=t[i]^e[i];return d===0}var ka=(t,e)=>(Object.assign(e,t),e);function jr(t,e,d,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,d,i);let a=BigInt(32),n=BigInt(4294967295),r=Number(d>>a&n),o=Number(d&n);t.setUint32(e+0,r,i),t.setUint32(e+4,o,i)}function Ct(t){return t.byteOffset%4===0}function St(t){return Uint8Array.from(t)}function tt(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}var ud=16,Do=new Uint8Array(16),jt=Ee(Do),ky=225,qy=(t,e,d,i)=>{let a=i&1;return{s3:d<<31|i>>>1,s2:e<<31|d>>>1,s1:t<<31|e>>>1,s0:t>>>1^ky<<24&-(a&1)}},vt=t=>(t>>>0&255)<<24|(t>>>8&255)<<16|(t>>>16&255)<<8|t>>>24&255|0;function By(t){t.reverse();let e=t[15]&1,d=0;for(let i=0;i<t.length;i++){let a=t[i];t[i]=a>>>1|d,d=(a&1)<<7}return t[0]^=-e&225,t}var jy=t=>t>64*1024?8:t>1024?4:2,bp=class{constructor(t,e){this.blockLen=ud,this.outputLen=ud,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,t=va(t),he(t,16);let d=Hn(t),i=d.getUint32(0,!1),a=d.getUint32(4,!1),n=d.getUint32(8,!1),r=d.getUint32(12,!1),o=[];for(let m=0;m<128;m++)o.push({s0:vt(i),s1:vt(a),s2:vt(n),s3:vt(r)}),{s0:i,s1:a,s2:n,s3:r}=qy(i,a,n,r);let s=jy(e||1024);if(![1,2,4,8].includes(s))throw new Error(`ghash: wrong window size=${s}, should be 2, 4 or 8`);this.W=s;let c=128/s,p=this.windowSize=2**s,u=[];for(let m=0;m<c;m++)for(let S=0;S<p;S++){let g=0,y=0,P=0,f=0;for(let E=0;E<s;E++){if(!(S>>>s-E-1&1))continue;let{s0:v,s1:F,s2:D,s3:h}=o[s*m+E];g^=v,y^=F,P^=D,f^=h}u.push({s0:g,s1:y,s2:P,s3:f})}this.t=u}_updateBlock(t,e,d,i){t^=this.s0,e^=this.s1,d^=this.s2,i^=this.s3;let{W:a,t:n,windowSize:r}=this,o=0,s=0,c=0,p=0,u=(1<<a)-1,m=0;for(let S of[t,e,d,i])for(let g=0;g<4;g++){let y=S>>>8*g&255;for(let P=8/a-1;P>=0;P--){let f=y>>>a*P&u,{s0:E,s1:v,s2:F,s3:D}=n[m*r+f];o^=E,s^=v,c^=F,p^=D,m+=1}}this.s0=o,this.s1=s,this.s2=c,this.s3=p}update(t){t=va(t),vn(this);let e=Ee(t),d=Math.floor(t.length/ud),i=t.length%ud;for(let a=0;a<d;a++)this._updateBlock(e[a*4+0],e[a*4+1],e[a*4+2],e[a*4+3]);return i&&(Do.set(t.subarray(d*ud)),this._updateBlock(jt[0],jt[1],jt[2],jt[3]),tt(jt)),this}destroy(){let{t}=this;for(let e of t)e.s0=0,e.s1=0,e.s2=0,e.s3=0}digestInto(t){vn(this),fp(t,this),this.finished=!0;let{s0:e,s1:d,s2:i,s3:a}=this,n=Ee(t);return n[0]=e,n[1]=d,n[2]=i,n[3]=a,t}digest(){let t=new Uint8Array(ud);return this.digestInto(t),this.destroy(),t}},Gy=class extends bp{constructor(t,e){t=va(t);let d=By(St(t));super(d,e),tt(d)}update(t){t=va(t),vn(this);let e=Ee(t),d=t.length%ud,i=Math.floor(t.length/ud);for(let a=0;a<i;a++)this._updateBlock(vt(e[a*4+3]),vt(e[a*4+2]),vt(e[a*4+1]),vt(e[a*4+0]));return d&&(Do.set(t.subarray(i*ud)),this._updateBlock(vt(jt[3]),vt(jt[2]),vt(jt[1]),vt(jt[0])),tt(jt)),this}digestInto(t){vn(this),fp(t,this),this.finished=!0;let{s0:e,s1:d,s2:i,s3:a}=this,n=Ee(t);return n[0]=e,n[1]=d,n[2]=i,n[3]=a,t.reverse()}};function Fp(t){let e=(i,a)=>t(a,i.length).update(va(i)).digest(),d=t(new Uint8Array(16),0);return e.outputLen=d.outputLen,e.blockLen=d.blockLen,e.create=(i,a)=>t(i,a),e}var Es=Fp((t,e)=>new bp(t,e));Fp((t,e)=>new Gy(t,e));var nt=16,Ro=4,Ya=new Uint8Array(nt),Qy=283;function No(t){return t<<1^Qy&-(t>>7)}function Ui(t,e){let d=0;for(;e>0;e>>=1)d^=t&-(e&1),t=No(t);return d}var Gr=(()=>{let t=new Uint8Array(256);for(let d=0,i=1;d<256;d++,i^=No(i))t[d]=i;let e=new Uint8Array(256);e[0]=99;for(let d=0;d<255;d++){let i=t[255-d];i|=i<<8,e[t[d]]=(i^i>>4^i>>5^i>>6^i>>7^99)&255}return tt(t),e})(),Vy=Gr.map((t,e)=>Gr.indexOf(e)),zy=t=>t<<24|t>>>8,pr=t=>t<<8|t>>>24,vs=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function Ep(t,e){if(t.length!==256)throw new Error("Wrong sbox length");let d=new Uint32Array(256).map((c,p)=>e(t[p])),i=d.map(pr),a=i.map(pr),n=a.map(pr),r=new Uint32Array(256*256),o=new Uint32Array(256*256),s=new Uint16Array(256*256);for(let c=0;c<256;c++)for(let p=0;p<256;p++){let u=c*256+p;r[u]=d[c]^i[p],o[u]=a[c]^n[p],s[u]=t[c]<<8|t[p]}return{sbox:t,sbox2:s,T0:d,T1:i,T2:a,T3:n,T01:r,T23:o}}var Ao=Ep(Gr,t=>Ui(t,3)<<24|t<<16|t<<8|Ui(t,2)),vp=Ep(Vy,t=>Ui(t,11)<<24|Ui(t,13)<<16|Ui(t,9)<<8|Ui(t,14)),Hy=(()=>{let t=new Uint8Array(16);for(let e=0,d=1;e<16;e++,d=No(d))t[e]=d;return t})();function fi(t){he(t);let e=t.length;if(![16,24,32].includes(e))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${e}`);let{sbox2:d}=Ao,i=[];Ct(t)||i.push(t=St(t));let a=Ee(t),n=a.length,r=s=>Qt(d,s,s,s,s),o=new Uint32Array(e+28);o.set(a);for(let s=n;s<o.length;s++){let c=o[s-1];s%n===0?c=r(zy(c))^Hy[s/n-1]:n>6&&s%n===4&&(c=r(c)),o[s]=o[s-n]^c}return tt(...i),o}function wo(t){let e=fi(t),d=e.slice(),i=e.length,{sbox2:a}=Ao,{T0:n,T1:r,T2:o,T3:s}=vp;for(let c=0;c<i;c+=4)for(let p=0;p<4;p++)d[c+p]=e[i-c-4+p];tt(e);for(let c=4;c<i-4;c++){let p=d[c],u=Qt(a,p,p,p,p);d[c]=n[u&255]^r[u>>>8&255]^o[u>>>16&255]^s[u>>>24]}return d}function xd(t,e,d,i,a,n){return t[d<<8&65280|i>>>8&255]^e[a>>>8&65280|n>>>24&255]}function Qt(t,e,d,i,a){return t[e&255|d&65280]|t[i>>>16&255|a>>>16&65280]<<16}function Mt(t,e,d,i,a){let{sbox2:n,T01:r,T23:o}=Ao,s=0;e^=t[s++],d^=t[s++],i^=t[s++],a^=t[s++];let c=t.length/4-2;for(let g=0;g<c;g++){let y=t[s++]^xd(r,o,e,d,i,a),P=t[s++]^xd(r,o,d,i,a,e),f=t[s++]^xd(r,o,i,a,e,d),E=t[s++]^xd(r,o,a,e,d,i);e=y,d=P,i=f,a=E}let p=t[s++]^Qt(n,e,d,i,a),u=t[s++]^Qt(n,d,i,a,e),m=t[s++]^Qt(n,i,a,e,d),S=t[s++]^Qt(n,a,e,d,i);return{s0:p,s1:u,s2:m,s3:S}}function Wn(t,e,d,i,a){let{sbox2:n,T01:r,T23:o}=vp,s=0;e^=t[s++],d^=t[s++],i^=t[s++],a^=t[s++];let c=t.length/4-2;for(let g=0;g<c;g++){let y=t[s++]^xd(r,o,e,a,i,d),P=t[s++]^xd(r,o,d,e,a,i),f=t[s++]^xd(r,o,i,d,e,a),E=t[s++]^xd(r,o,a,i,d,e);e=y,d=P,i=f,a=E}let p=t[s++]^Qt(n,e,a,i,d),u=t[s++]^Qt(n,d,e,a,i),m=t[s++]^Qt(n,i,d,e,a),S=t[s++]^Qt(n,a,i,d,e);return{s0:p,s1:u,s2:m,s3:S}}function qa(t,e){if(e===void 0)return new Uint8Array(t);if(he(e),e.length<t)throw new Error(`aes: wrong destination length, expected at least ${t}, got: ${e.length}`);if(!Ct(e))throw new Error("unaligned dst");return e}function Cp(t,e,d,i){he(e,nt),he(d);let a=d.length;i=qa(a,i);let n=e,r=Ee(n),{s0:o,s1:s,s2:c,s3:p}=Mt(t,r[0],r[1],r[2],r[3]),u=Ee(d),m=Ee(i);for(let g=0;g+4<=u.length;g+=4){m[g+0]=u[g+0]^o,m[g+1]=u[g+1]^s,m[g+2]=u[g+2]^c,m[g+3]=u[g+3]^p;let y=1;for(let P=n.length-1;P>=0;P--)y=y+(n[P]&255)|0,n[P]=y&255,y>>>=8;({s0:o,s1:s,s2:c,s3:p}=Mt(t,r[0],r[1],r[2],r[3]))}let S=nt*Math.floor(u.length/Ro);if(S<a){let g=new Uint32Array([o,s,c,p]),y=To(g);for(let P=S,f=0;P<a;P++,f++)i[P]=d[P]^y[f];tt(g)}return i}function Sa(t,e,d,i,a){he(d,nt),he(i),a=qa(i.length,a);let n=d,r=Ee(n),o=Hn(n),s=Ee(i),c=Ee(a),p=e?0:12,u=i.length,m=o.getUint32(p,e),{s0:S,s1:g,s2:y,s3:P}=Mt(t,r[0],r[1],r[2],r[3]);for(let E=0;E+4<=s.length;E+=4)c[E+0]=s[E+0]^S,c[E+1]=s[E+1]^g,c[E+2]=s[E+2]^y,c[E+3]=s[E+3]^P,m=m+1>>>0,o.setUint32(p,m,e),{s0:S,s1:g,s2:y,s3:P}=Mt(t,r[0],r[1],r[2],r[3]);let f=nt*Math.floor(s.length/Ro);if(f<u){let E=new Uint32Array([S,g,y,P]),v=To(E);for(let F=f,D=0;F<u;F++,D++)a[F]=i[F]^v[D];tt(E)}return a}var Wy=ka({blockSize:16,nonceLength:16},function(t,e){he(t),he(e,nt);function d(i,a){if(he(i),a!==void 0&&(he(a),!Ct(a)))throw new Error("unaligned destination");let n=fi(t),r=St(e),o=[n,r];Ct(i)||o.push(i=St(i));let s=Cp(n,r,i,a);return tt(...o),s}return{encrypt:(i,a)=>d(i,a),decrypt:(i,a)=>d(i,a)}});function Ky(t){if(he(t),t.length%nt!==0)throw new Error(`aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size ${nt}`)}function Yy(t,e,d){he(t);let i=t.length,a=i%nt;if(!e&&a!==0)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");Ct(t)||(t=St(t));let n=Ee(t);if(e){let s=nt-a;s||(s=nt),i=i+s}let r=qa(i,d),o=Ee(r);return{b:n,o,out:r}}function _y(t,e){if(!e)return t;let d=t.length;if(!d)throw new Error("aes/pcks5: empty ciphertext not allowed");let i=t[d-1];if(i<=0||i>16)throw new Error("aes/pcks5: wrong padding");let a=t.subarray(0,-i);for(let n=0;n<i;n++)if(t[d-n-1]!==i)throw new Error("aes/pcks5: wrong padding");return a}function Jy(t){let e=new Uint8Array(16),d=Ee(e);e.set(t);let i=nt-t.length;for(let a=nt-i;a<nt;a++)e[a]=i;return d}var Xp=ka({blockSize:16,nonceLength:16},function(t,e,d={}){he(t),he(e,16);let i=!d.disablePadding;return{encrypt(a,n){let r=fi(t),{b:o,o:s,out:c}=Yy(a,i,n),p=e,u=[r];Ct(p)||u.push(p=St(p));let m=Ee(p),S=m[0],g=m[1],y=m[2],P=m[3],f=0;for(;f+4<=o.length;)S^=o[f+0],g^=o[f+1],y^=o[f+2],P^=o[f+3],{s0:S,s1:g,s2:y,s3:P}=Mt(r,S,g,y,P),s[f++]=S,s[f++]=g,s[f++]=y,s[f++]=P;if(i){let E=Jy(a.subarray(f*4));S^=E[0],g^=E[1],y^=E[2],P^=E[3],{s0:S,s1:g,s2:y,s3:P}=Mt(r,S,g,y,P),s[f++]=S,s[f++]=g,s[f++]=y,s[f++]=P}return tt(...u),c},decrypt(a,n){Ky(a);let r=wo(t),o=e,s=[r];Ct(o)||s.push(o=St(o));let c=Ee(o),p=qa(a.length,n);Ct(a)||s.push(a=St(a));let u=Ee(a),m=Ee(p),S=c[0],g=c[1],y=c[2],P=c[3];for(let f=0;f+4<=u.length;){let E=S,v=g,F=y,D=P;S=u[f+0],g=u[f+1],y=u[f+2],P=u[f+3];let{s0:h,s1:X,s2:b,s3:T}=Wn(r,S,g,y,P);m[f++]=h^E,m[f++]=X^v,m[f++]=b^F,m[f++]=T^D}return tt(...s),_y(p,i)}}}),Tp=ka({blockSize:16,nonceLength:16},function(t,e){he(t),he(e,16);function d(i,a,n){he(i);let r=i.length;n=qa(r,n);let o=fi(t),s=e,c=[o];Ct(s)||c.push(s=St(s)),Ct(i)||c.push(i=St(i));let p=Ee(i),u=Ee(n),m=a?u:p,S=Ee(s),g=S[0],y=S[1],P=S[2],f=S[3];for(let v=0;v+4<=p.length;){let{s0:F,s1:D,s2:h,s3:X}=Mt(o,g,y,P,f);u[v+0]=p[v+0]^F,u[v+1]=p[v+1]^D,u[v+2]=p[v+2]^h,u[v+3]=p[v+3]^X,g=m[v++],y=m[v++],P=m[v++],f=m[v++]}let E=nt*Math.floor(p.length/Ro);if(E<r){({s0:g,s1:y,s2:P,s3:f}=Mt(o,g,y,P,f));let v=To(new Uint32Array([g,y,P,f]));for(let F=E,D=0;F<r;F++,D++)n[F]=i[F]^v[D];tt(v)}return tt(...c),n}return{encrypt:(i,a)=>d(i,!0,a),decrypt:(i,a)=>d(i,!1,a)}});function $y(t,e,d,i,a){let n=a==null?0:a.length,r=t.create(d,i.length+n);a&&r.update(a),r.update(i);let o=new Uint8Array(16),s=Hn(o);a&&jr(s,0,BigInt(n*8),e),jr(s,8,BigInt(i.length*8),e),r.update(o);let c=r.digest();return tt(o),c}var _a=ka({blockSize:16,nonceLength:12,tagLength:16},function(t,e,d){if(he(t),he(e),d!==void 0&&he(d),e.length<8)throw new Error("aes/gcm: invalid nonce length");let i=16;function a(r,o,s){let c=$y(Es,!1,r,s,d);for(let p=0;p<o.length;p++)c[p]^=o[p];return c}function n(){let r=fi(t),o=Ya.slice(),s=Ya.slice();if(Sa(r,!1,s,s,o),e.length===12)s.set(e);else{let p=Ya.slice(),u=Hn(p);jr(u,8,BigInt(e.length*8),!1);let m=Es.create(o).update(e).update(p);m.digestInto(s),m.destroy()}let c=Sa(r,!1,s,Ya);return{xk:r,authKey:o,counter:s,tagMask:c}}return{encrypt(r){he(r);let{xk:o,authKey:s,counter:c,tagMask:p}=n(),u=new Uint8Array(r.length+i),m=[o,s,c,p];Ct(r)||m.push(r=St(r)),Sa(o,!1,c,r,u);let S=a(s,p,u.subarray(0,u.length-i));return m.push(S),u.set(S,r.length),tt(...m),u},decrypt(r){if(he(r),r.length<i)throw new Error(`aes/gcm: ciphertext less than tagLen (${i})`);let{xk:o,authKey:s,counter:c,tagMask:p}=n(),u=[o,s,p,c];Ct(r)||u.push(r=St(r));let m=r.subarray(0,-i),S=r.subarray(-i),g=a(s,p,m);if(u.push(g),!Ip(g,S))throw new Error("aes/gcm: invalid ghash tag");let y=Sa(o,!1,c,m);return tt(...u),y}}});function Dp(t){return t!=null&&typeof t=="object"&&(t instanceof Uint32Array||t.constructor.name==="Uint32Array")}function Rp(t,e){if(he(e,16),!Dp(t))throw new Error("_encryptBlock accepts result of expandKeyLE");let d=Ee(e),{s0:i,s1:a,s2:n,s3:r}=Mt(t,d[0],d[1],d[2],d[3]);return d[0]=i,d[1]=a,d[2]=n,d[3]=r,e}function Np(t,e){if(he(e,16),!Dp(t))throw new Error("_decryptBlock accepts result of expandKeyLE");let d=Ee(e),{s0:i,s1:a,s2:n,s3:r}=Wn(t,d[0],d[1],d[2],d[3]);return d[0]=i,d[1]=a,d[2]=n,d[3]=r,e}var Cs={encrypt(t,e){if(e.length>=2**32)throw new Error("plaintext should be less than 4gb");let d=fi(t);if(e.length===16)Rp(d,e);else{let i=Ee(e),a=i[0],n=i[1];for(let r=0,o=1;r<6;r++)for(let s=2;s<i.length;s+=2,o++){let{s0:c,s1:p,s2:u,s3:m}=Mt(d,a,n,i[s],i[s+1]);a=c,n=p^vs(o),i[s]=u,i[s+1]=m}i[0]=a,i[1]=n}d.fill(0)},decrypt(t,e){if(e.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");let d=wo(t),i=e.length/8-1;if(i===1)Np(d,e);else{let a=Ee(e),n=a[0],r=a[1];for(let o=0,s=i*6;o<6;o++)for(let c=i*2;c>=1;c-=2,s--){r^=vs(s);let{s0:p,s1:u,s2:m,s3:S}=Wn(d,n,r,a[c],a[c+1]);n=p,r=u,a[c]=m,a[c+1]=S}a[0]=n,a[1]=r}d.fill(0)}},Xs=new Uint8Array(8).fill(166),Ap=ka({blockSize:8},t=>({encrypt(e){if(he(e),!e.length||e.length%8!==0)throw new Error("invalid plaintext length");if(e.length===8)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");let d=Uy(Xs,e);return Cs.encrypt(t,d),d},decrypt(e){if(he(e),e.length%8!==0||e.length<3*8)throw new Error("invalid ciphertext length");let d=St(e);if(Cs.decrypt(t,d),!Ip(d.subarray(0,8),Xs))throw new Error("integrity check failed");return d.subarray(0,8).fill(0),d.subarray(8)}})),Ts={expandKeyLE:fi,expandKeyDecLE:wo,encrypt:Mt,decrypt:Wn,encryptBlock:Rp,decryptBlock:Np,ctrCounter:Cp,ctr32:Sa};async function wp(t){switch(t){case l.symmetric.aes128:case l.symmetric.aes192:case l.symmetric.aes256:throw new Error("Not a legacy cipher");case l.symmetric.cast5:case l.symmetric.blowfish:case l.symmetric.twofish:case l.symmetric.tripledes:{let{legacyCiphers:e}=await Promise.resolve().then(function(){return gP}),d=l.read(l.symmetric,t),i=e.get(d);if(!i)throw new Error("Unsupported cipher algorithm");return i}default:throw new Error("Unsupported cipher algorithm")}}function Zy(t){switch(t){case l.symmetric.aes128:case l.symmetric.aes192:case l.symmetric.aes256:case l.symmetric.twofish:return 16;case l.symmetric.blowfish:case l.symmetric.cast5:case l.symmetric.tripledes:return 8;default:throw new Error("Unsupported cipher")}}function eS(t){switch(t){case l.symmetric.aes128:case l.symmetric.blowfish:case l.symmetric.cast5:return 16;case l.symmetric.aes192:case l.symmetric.tripledes:return 24;case l.symmetric.aes256:case l.symmetric.twofish:return 32;default:throw new Error("Unsupported cipher")}}function Ce(t){return{keySize:eS(t),blockSize:Zy(t)}}var ji=I.getWebCrypto();async function Qr(t,e,d){let{keySize:i}=Ce(t);if(!I.isAES(t)||e.length!==i)throw new Error("Unexpected algorithm or key size");try{let a=await ji.importKey("raw",e,{name:"AES-KW"},!1,["wrapKey"]),n=await ji.importKey("raw",d,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),r=await ji.wrapKey("raw",n,a,{name:"AES-KW"});return new Uint8Array(r)}catch(a){if(a.name!=="NotSupportedError"&&!(e.length===24&&a.name==="OperationError"))throw a;I.printDebugError("Browser did not support operation: "+a.message)}return Ap(e).encrypt(d)}async function Vr(t,e,d){let{keySize:i}=Ce(t);if(!I.isAES(t)||e.length!==i)throw new Error("Unexpected algorithm or key size");let a;try{a=await ji.importKey("raw",e,{name:"AES-KW"},!1,["unwrapKey"])}catch(n){if(n.name!=="NotSupportedError"&&!(e.length===24&&n.name==="OperationError"))throw n;return I.printDebugError("Browser did not support operation: "+n.message),Ap(e).decrypt(d)}try{let n=await ji.unwrapKey("raw",d,a,{name:"AES-KW"},{name:"HMAC",hash:"SHA-256"},!0,["sign"]);return new Uint8Array(await ji.exportKey("raw",n))}catch(n){throw n.name==="OperationError"?new Error("Key Data Integrity failed"):n}}var Ds=I.getWebCrypto();async function qd(t,e,d,i,a){let n=l.read(l.webHash,t);if(!n)throw new Error("Hash algo not supported with HKDF");let r=await Ds.importKey("raw",e,"HKDF",!1,["deriveBits"]),o=await Ds.deriveBits({name:"HKDF",hash:n,salt:d,info:i},r,a*8);return new Uint8Array(o)}var Cn={x25519:I.encodeUTF8("OpenPGP X25519"),x448:I.encodeUTF8("OpenPGP X448")};async function Mo(t){switch(t){case l.publicKey.x25519:{let e=Je(32),{publicKey:d}=De.box.keyPair.fromSecretKey(e);return{A:d,k:e}}case l.publicKey.x448:{let e=await I.getNobleCurve(l.publicKey.x448),d=e.utils.randomPrivateKey();return{A:e.getPublicKey(d),k:d}}default:throw new Error("Unsupported ECDH algorithm")}}async function Mp(t,e,d){switch(t){case l.publicKey.x25519:{let{publicKey:i}=De.box.keyPair.fromSecretKey(d);return I.equalsUint8Array(e,i)}case l.publicKey.x448:{let i=(await I.getNobleCurve(l.publicKey.x448)).getPublicKey(d);return I.equalsUint8Array(e,i)}default:return!1}}async function xp(t,e,d){let{ephemeralPublicKey:i,sharedSecret:a}=await Lo(t,d),n=I.concatUint8Array([i,d,a]);switch(t){case l.publicKey.x25519:{let r=l.symmetric.aes128,{keySize:o}=Ce(r),s=await qd(l.hash.sha256,n,new Uint8Array,Cn.x25519,o),c=await Qr(r,s,e);return{ephemeralPublicKey:i,wrappedKey:c}}case l.publicKey.x448:{let r=l.symmetric.aes256,{keySize:o}=Ce(l.symmetric.aes256),s=await qd(l.hash.sha512,n,new Uint8Array,Cn.x448,o),c=await Qr(r,s,e);return{ephemeralPublicKey:i,wrappedKey:c}}default:throw new Error("Unsupported ECDH algorithm")}}async function Lp(t,e,d,i,a){let n=await Oo(t,e,i,a),r=I.concatUint8Array([e,i,n]);switch(t){case l.publicKey.x25519:{let o=l.symmetric.aes128,{keySize:s}=Ce(o),c=await qd(l.hash.sha256,r,new Uint8Array,Cn.x25519,s);return Vr(o,c,d)}case l.publicKey.x448:{let o=l.symmetric.aes256,{keySize:s}=Ce(l.symmetric.aes256),c=await qd(l.hash.sha512,r,new Uint8Array,Cn.x448,s);return Vr(o,c,d)}default:throw new Error("Unsupported ECDH algorithm")}}function xo(t){switch(t){case l.publicKey.x25519:return 32;case l.publicKey.x448:return 56;default:throw new Error("Unsupported ECDH algorithm")}}async function Lo(t,e){switch(t){case l.publicKey.x25519:{let d=Je(xo(t)),i=De.scalarMult(d,e);Xn(i);let{publicKey:a}=De.box.keyPair.fromSecretKey(d);return{ephemeralPublicKey:a,sharedSecret:i}}case l.publicKey.x448:{let d=await I.getNobleCurve(l.publicKey.x448),i=d.utils.randomPrivateKey(),a=d.getSharedSecret(i,e);return Xn(a),{ephemeralPublicKey:d.getPublicKey(i),sharedSecret:a}}default:throw new Error("Unsupported ECDH algorithm")}}async function Oo(t,e,d,i){switch(t){case l.publicKey.x25519:{let a=De.scalarMult(i,e);return Xn(a),a}case l.publicKey.x448:{let a=(await I.getNobleCurve(l.publicKey.x448)).getSharedSecret(i,e);return Xn(a),a}default:throw new Error("Unsupported ECDH algorithm")}}function Xn(t){let e=0;for(let d=0;d<t.length;d++)e|=t[d];if(e===0)throw new Error("Unexpected low order point")}var tS=Object.freeze({__proto__:null,decrypt:Lp,encrypt:xp,generate:Mo,generateEphemeralEncryptionMaterial:Lo,getPayloadSize:xo,recomputeSharedSecret:Oo,validateParams:Mp}),lr=I.getWebCrypto(),Tn=I.getNodeCrypto(),Ht={[l.curve.nistP256]:"P-256",[l.curve.nistP384]:"P-384",[l.curve.nistP521]:"P-521"},ad=Tn?Tn.getCurves():[],qt=Tn?{[l.curve.secp256k1]:ad.includes("secp256k1")?"secp256k1":void 0,[l.curve.nistP256]:ad.includes("prime256v1")?"prime256v1":void 0,[l.curve.nistP384]:ad.includes("secp384r1")?"secp384r1":void 0,[l.curve.nistP521]:ad.includes("secp521r1")?"secp521r1":void 0,[l.curve.ed25519Legacy]:ad.includes("ED25519")?"ED25519":void 0,[l.curve.curve25519Legacy]:ad.includes("X25519")?"X25519":void 0,[l.curve.brainpoolP256r1]:ad.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,[l.curve.brainpoolP384r1]:ad.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,[l.curve.brainpoolP512r1]:ad.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Op={[l.curve.nistP256]:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:l.publicKey.ecdsa,hash:l.hash.sha256,cipher:l.symmetric.aes128,node:qt[l.curve.nistP256],web:Ht[l.curve.nistP256],payloadSize:32,sharedSize:256,wireFormatLeadingByte:4},[l.curve.nistP384]:{oid:[6,5,43,129,4,0,34],keyType:l.publicKey.ecdsa,hash:l.hash.sha384,cipher:l.symmetric.aes192,node:qt[l.curve.nistP384],web:Ht[l.curve.nistP384],payloadSize:48,sharedSize:384,wireFormatLeadingByte:4},[l.curve.nistP521]:{oid:[6,5,43,129,4,0,35],keyType:l.publicKey.ecdsa,hash:l.hash.sha512,cipher:l.symmetric.aes256,node:qt[l.curve.nistP521],web:Ht[l.curve.nistP521],payloadSize:66,sharedSize:528,wireFormatLeadingByte:4},[l.curve.secp256k1]:{oid:[6,5,43,129,4,0,10],keyType:l.publicKey.ecdsa,hash:l.hash.sha256,cipher:l.symmetric.aes128,node:qt[l.curve.secp256k1],payloadSize:32,wireFormatLeadingByte:4},[l.curve.ed25519Legacy]:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:l.publicKey.eddsaLegacy,hash:l.hash.sha512,node:!1,payloadSize:32,wireFormatLeadingByte:64},[l.curve.curve25519Legacy]:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:l.publicKey.ecdh,hash:l.hash.sha256,cipher:l.symmetric.aes128,node:!1,payloadSize:32,wireFormatLeadingByte:64},[l.curve.brainpoolP256r1]:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:l.publicKey.ecdsa,hash:l.hash.sha256,cipher:l.symmetric.aes128,node:qt[l.curve.brainpoolP256r1],payloadSize:32,wireFormatLeadingByte:4},[l.curve.brainpoolP384r1]:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:l.publicKey.ecdsa,hash:l.hash.sha384,cipher:l.symmetric.aes192,node:qt[l.curve.brainpoolP384r1],payloadSize:48,wireFormatLeadingByte:4},[l.curve.brainpoolP512r1]:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:l.publicKey.ecdsa,hash:l.hash.sha512,cipher:l.symmetric.aes256,node:qt[l.curve.brainpoolP512r1],payloadSize:64,wireFormatLeadingByte:4}},Xt=class{constructor(t){try{this.name=t instanceof oi?t.getName():l.write(l.curve,t)}catch{throw new Te("Unknown curve")}let e=Op[this.name];this.keyType=e.keyType,this.oid=e.oid,this.hash=e.hash,this.cipher=e.cipher,this.node=e.node,this.web=e.web,this.payloadSize=e.payloadSize,this.sharedSize=e.sharedSize,this.wireFormatLeadingByte=e.wireFormatLeadingByte,this.web&&I.getWebCrypto()?this.type="web":this.node&&I.getNodeCrypto()?this.type="node":this.name===l.curve.curve25519Legacy?this.type="curve25519Legacy":this.name===l.curve.ed25519Legacy&&(this.type="ed25519Legacy")}async genKeyPair(){switch(this.type){case"web":try{return await dS(this.name,this.wireFormatLeadingByte)}catch(t){return I.printDebugError("Browser did not support generating ec key "+t.message),Rs(this.name)}case"node":return iS(this.name);case"curve25519Legacy":{let{k:t,A:e}=await Mo(l.publicKey.x25519),d=t.slice().reverse();return d[0]=d[0]&127|64,d[31]&=248,{publicKey:I.concatUint8Array([new Uint8Array([this.wireFormatLeadingByte]),e]),privateKey:d}}case"ed25519Legacy":{let{seed:t,A:e}=await vo(l.publicKey.ed25519);return{publicKey:I.concatUint8Array([new Uint8Array([this.wireFormatLeadingByte]),e]),privateKey:t}}default:return Rs(this.name)}}};async function cn(t){let e=new Xt(t),{oid:d,hash:i,cipher:a}=e,n=await e.genKeyPair();return{oid:d,Q:n.publicKey,secret:I.leftPad(n.privateKey,e.payloadSize),hash:i,cipher:a}}function Up(t){return Op[t.getName()].hash}async function kp(t,e,d,i){let a={[l.curve.nistP256]:!0,[l.curve.nistP384]:!0,[l.curve.nistP521]:!0,[l.curve.secp256k1]:!0,[l.curve.curve25519Legacy]:t===l.publicKey.ecdh,[l.curve.brainpoolP256r1]:!0,[l.curve.brainpoolP384r1]:!0,[l.curve.brainpoolP512r1]:!0},n=e.getName();if(!a[n])return!1;if(n===l.curve.curve25519Legacy){i=i.slice().reverse();let{publicKey:o}=De.box.keyPair.fromSecretKey(i);d=new Uint8Array(d);let s=new Uint8Array([64,...o]);return!!I.equalsUint8Array(s,d)}let r=(await I.getNobleCurve(l.publicKey.ecdsa,n)).getPublicKey(i,!1);return!!I.equalsUint8Array(r,d)}function mi(t,e){let{payloadSize:d,wireFormatLeadingByte:i,name:a}=t,n=a===l.curve.curve25519Legacy||a===l.curve.ed25519Legacy?d:d*2;if(e[0]!==i||e.length!==n+1)throw new Error("Invalid point encoding")}async function Rs(t){let e=await I.getNobleCurve(l.publicKey.ecdsa,t),d=e.utils.randomPrivateKey();return{publicKey:e.getPublicKey(d,!1),privateKey:d}}async function dS(t,e){let d=await lr.generateKey({name:"ECDSA",namedCurve:Ht[t]},!0,["sign","verify"]),i=await lr.exportKey("jwk",d.privateKey),a=await lr.exportKey("jwk",d.publicKey);return{publicKey:qp(a,e),privateKey:At(i.d)}}async function iS(t){let e=Tn.createECDH(qt[t]);return await e.generateKeys(),{publicKey:new Uint8Array(e.getPublicKey()),privateKey:new Uint8Array(e.getPrivateKey())}}function qp(t,e){let d=At(t.x),i=At(t.y),a=new Uint8Array(d.length+i.length+1);return a[0]=e,a.set(d,1),a.set(i,d.length+1),a}function Kn(t,e,d){let i=t,a=d.slice(1,i+1),n=d.slice(i+1,i*2+1);return{kty:"EC",crv:e,x:at(a),y:at(n),ext:!0}}function Bp(t,e,d,i){let a=Kn(t,e,d);return a.d=at(i),a}var Dn=I.getWebCrypto(),jp=I.getNodeCrypto();async function Uo(t,e,d,i,a,n){let r=new Xt(t);if(mi(r,i),d&&!I.isStream(d)){let s={publicKey:i,privateKey:a};switch(r.type){case"web":try{return await nS(r,e,d,s)}catch(c){if(r.name!=="nistP521"&&(c.name==="DataError"||c.name==="OperationError"))throw c;I.printDebugError("Browser did not support signing: "+c.message)}break;case"node":return oS(r,e,d,a)}}let o=(await I.getNobleCurve(l.publicKey.ecdsa,r.name)).sign(n,a,{lowS:!1});return{r:Oe(o.r,"be",r.payloadSize),s:Oe(o.s,"be",r.payloadSize)}}async function ko(t,e,d,i,a,n){let r=new Xt(t);mi(r,a);let o=async()=>n[0]===0?Ns(r,d,n.subarray(1),a):!1;if(i&&!I.isStream(i))switch(r.type){case"web":try{return await rS(r,e,d,i,a)||o()}catch(s){if(r.name!=="nistP521"&&(s.name==="DataError"||s.name==="OperationError"))throw s;I.printDebugError("Browser did not support verifying: "+s.message)}break;case"node":return await sS(r,e,d,i,a)||o()}return await Ns(r,d,n,a)||o()}async function aS(t,e,d){let i=new Xt(t);if(i.keyType!==l.publicKey.ecdsa)return!1;switch(i.type){case"web":case"node":{let a=Je(8),n=l.hash.sha256,r=await Yt(n,a);try{let o=await Uo(t,n,a,e,d,r);return await ko(t,n,o,a,e,r)}catch{return!1}}default:return kp(l.publicKey.ecdsa,t,e,d)}}async function Ns(t,e,d,i){return(await I.getNobleCurve(l.publicKey.ecdsa,t.name)).verify(I.concatUint8Array([e.r,e.s]),d,i,{lowS:!1})}async function nS(t,e,d,i){let a=t.payloadSize,n=Bp(t.payloadSize,Ht[t.name],i.publicKey,i.privateKey),r=await Dn.importKey("jwk",n,{name:"ECDSA",namedCurve:Ht[t.name],hash:{name:l.read(l.webHash,t.hash)}},!1,["sign"]),o=new Uint8Array(await Dn.sign({name:"ECDSA",namedCurve:Ht[t.name],hash:{name:l.read(l.webHash,e)}},r,d));return{r:o.slice(0,a),s:o.slice(a,a<<1)}}async function rS(t,e,{r:d,s:i},a,n){let r=Kn(t.payloadSize,Ht[t.name],n),o=await Dn.importKey("jwk",r,{name:"ECDSA",namedCurve:Ht[t.name],hash:{name:l.read(l.webHash,t.hash)}},!1,["verify"]),s=I.concatUint8Array([d,i]).buffer;return Dn.verify({name:"ECDSA",namedCurve:Ht[t.name],hash:{name:l.read(l.webHash,e)}},o,s,a)}async function oS(t,e,d,i){let a=I.nodeRequire("eckey-utils"),n=I.getNodeBuffer(),{privateKey:r}=a.generateDer({curveName:qt[t.name],privateKey:n.from(i)}),o=jp.createSign(l.read(l.hash,e));o.write(d),o.end();let s=new Uint8Array(o.sign({key:r,format:"der",type:"sec1",dsaEncoding:"ieee-p1363"})),c=t.payloadSize;return{r:s.subarray(0,c),s:s.subarray(c,c<<1)}}async function sS(t,e,{r:d,s:i},a,n){let r=I.nodeRequire("eckey-utils"),o=I.getNodeBuffer(),{publicKey:s}=r.generateDer({curveName:qt[t.name],publicKey:o.from(n)}),c=jp.createVerify(l.read(l.hash,e));c.write(a),c.end();let p=I.concatUint8Array([d,i]);try{return c.verify({key:s,format:"der",type:"spki",dsaEncoding:"ieee-p1363"},p)}catch{return!1}}var cS=Object.freeze({__proto__:null,sign:Uo,validateParams:aS,verify:ko});async function Gp(t,e,d,i,a,n){let r=new Xt(t);if(mi(r,i),je(e)<je(l.hash.sha256))throw new Error("Hash algorithm too weak for EdDSA.");let{RS:o}=await Co(l.publicKey.ed25519,e,d,i.subarray(1),a,n);return{r:o.subarray(0,32),s:o.subarray(32)}}async function Qp(t,e,{r:d,s:i},a,n,r){let o=new Xt(t);if(mi(o,n),je(e)<je(l.hash.sha256))throw new Error("Hash algorithm too weak for EdDSA.");let s=I.concatUint8Array([d,i]);return Xo(l.publicKey.ed25519,e,{RS:s},a,n.subarray(1),r)}async function Vp(t,e,d){if(t.getName()!==l.curve.ed25519Legacy)return!1;let{publicKey:i}=De.sign.keyPair.fromSeed(d),a=new Uint8Array([64,...i]);return I.equalsUint8Array(e,a)}var pS=Object.freeze({__proto__:null,sign:Gp,validateParams:Vp,verify:Qp});function lS(t){let e=8-t.length%8,d=new Uint8Array(t.length+e).fill(e);return d.set(t),d}function uS(t){let e=t.length;if(e>0){let d=t[e-1];if(d>=1){let i=t.subarray(e-d),a=new Uint8Array(d).fill(d);if(I.equalsUint8Array(i,a))return t.subarray(0,e-d)}}throw new Error("Invalid padding")}var Ld=I.getWebCrypto(),zp=I.getNodeCrypto();async function mS(t,e,d){return kp(l.publicKey.ecdh,t,e,d)}function Hp(t,e,d,i){return I.concatUint8Array([e.write(),new Uint8Array([t]),d.write(),I.stringToUint8Array("Anonymous Sender "),i])}async function Wp(t,e,d,i,a=!1,n=!1){let r;if(a){for(r=0;r<e.length&&e[r]===0;r++);e=e.subarray(r)}if(n){for(r=e.length-1;r>=0&&e[r]===0;r--);e=e.subarray(0,r+1)}return(await Yt(t,I.concatUint8Array([new Uint8Array([0,0,0,1]),e,i]))).subarray(0,d)}async function yS(t,e){switch(t.type){case"curve25519Legacy":{let{sharedSecret:d,ephemeralPublicKey:i}=await Lo(l.publicKey.x25519,e.subarray(1));return{publicKey:I.concatUint8Array([new Uint8Array([t.wireFormatLeadingByte]),i]),sharedKey:d}}case"web":if(t.web&&I.getWebCrypto())try{return await gS(t,e)}catch(d){return I.printDebugError(d),ws(t,e)}break;case"node":return fS(t,e);default:return ws(t,e)}}async function Kp(t,e,d,i,a){let n=lS(d),r=new Xt(t);mi(r,i);let{publicKey:o,sharedKey:s}=await yS(r,i),c=Hp(l.publicKey.ecdh,t,e,a),{keySize:p}=Ce(e.cipher),u=await Wp(e.hash,s,p,c),m=await Qr(e.cipher,u,n);return{publicKey:o,wrappedKey:m}}async function SS(t,e,d,i){if(i.length!==t.payloadSize){let a=new Uint8Array(t.payloadSize);a.set(i,t.payloadSize-i.length),i=a}switch(t.type){case"curve25519Legacy":{let a=i.slice().reverse(),n=await Oo(l.publicKey.x25519,e.subarray(1),d.subarray(1),a);return{secretKey:a,sharedKey:n}}case"web":if(t.web&&I.getWebCrypto())try{return await PS(t,e,d,i)}catch(a){return I.printDebugError(a),As(t,e,i)}break;case"node":return hS(t,e,i);default:return As(t,e,i)}}async function Yp(t,e,d,i,a,n,r){let o=new Xt(t);mi(o,a),mi(o,d);let{sharedKey:s}=await SS(o,d,a,n),c=Hp(l.publicKey.ecdh,t,e,r),{keySize:p}=Ce(e.cipher),u;for(let m=0;m<3;m++)try{let S=await Wp(e.hash,s,p,c,m===1,m===2);return uS(await Vr(e.cipher,S,i))}catch(S){u=S}throw u}async function As(t,e,d){let i=(await I.getNobleCurve(l.publicKey.ecdh,t.name)).getSharedSecret(d,e).subarray(1);return{secretKey:d,sharedKey:i}}async function ws(t,e){let d=await I.getNobleCurve(l.publicKey.ecdh,t.name),{publicKey:i,privateKey:a}=await t.genKeyPair(),n=d.getSharedSecret(a,e).subarray(1);return{publicKey:i,sharedKey:n}}async function PS(t,e,d,i){let a=Bp(t.payloadSize,t.web,d,i),n=Ld.importKey("jwk",a,{name:"ECDH",namedCurve:t.web},!0,["deriveKey","deriveBits"]),r=Kn(t.payloadSize,t.web,e),o=Ld.importKey("jwk",r,{name:"ECDH",namedCurve:t.web},!0,[]);[n,o]=await Promise.all([n,o]);let s=Ld.deriveBits({name:"ECDH",namedCurve:t.web,public:o},n,t.sharedSize),c=Ld.exportKey("jwk",n);[s,c]=await Promise.all([s,c]);let p=new Uint8Array(s);return{secretKey:At(c.d),sharedKey:p}}async function gS(t,e){let d=Kn(t.payloadSize,t.web,e),i=Ld.generateKey({name:"ECDH",namedCurve:t.web},!0,["deriveKey","deriveBits"]),a=Ld.importKey("jwk",d,{name:"ECDH",namedCurve:t.web},!1,[]);[i,a]=await Promise.all([i,a]);let n=Ld.deriveBits({name:"ECDH",namedCurve:t.web,public:a},i.privateKey,t.sharedSize),r=Ld.exportKey("jwk",i.publicKey);[n,r]=await Promise.all([n,r]);let o=new Uint8Array(n);return{publicKey:new Uint8Array(qp(r,t.wireFormatLeadingByte)),sharedKey:o}}async function hS(t,e,d){let i=zp.createECDH(t.node);i.setPrivateKey(d);let a=new Uint8Array(i.computeSecret(e));return{secretKey:new Uint8Array(i.getPrivateKey()),sharedKey:a}}async function fS(t,e){let d=zp.createECDH(t.node);d.generateKeys();let i=new Uint8Array(d.computeSecret(e));return{publicKey:new Uint8Array(d.getPublicKey()),sharedKey:i}}var IS=Object.freeze({__proto__:null,decrypt:Yp,encrypt:Kp,validateParams:mS}),bS=Object.freeze({__proto__:null,CurveWithOID:Xt,ecdh:IS,ecdhX:tS,ecdsa:cS,eddsa:xy,eddsaLegacy:pS,generate:cn,getPreferredHashAlgo:Up}),pn=BigInt(0),Pa=BigInt(1);async function FS(t,e,d,i,a,n){let r=BigInt(0);i=ae(i),a=ae(a),d=ae(d),n=ae(n);let o,s,c,p;d=le(d,i),n=le(n,a);let u=le(ae(e.subarray(0,yt(a))),a);for(;;){if(o=zd(Pa,a),s=le(We(d,o,i),a),s===r)continue;let m=le(n*s,a);if(p=le(u+m,a),c=le(Vi(o,a)*p,a),c!==r)break}return{r:Oe(s,"be",yt(i)),s:Oe(c,"be",yt(i))}}async function ES(t,e,d,i,a,n,r,o){if(e=ae(e),d=ae(d),n=ae(n),r=ae(r),a=ae(a),o=ae(o),e<=pn||e>=r||d<=pn||d>=r)return I.printDebug("invalid DSA Signature"),!1;let s=le(ae(i.subarray(0,yt(r))),r),c=Vi(d,r);if(c===pn)return I.printDebug("invalid DSA Signature"),!1;a=le(a,n),o=le(o,n);let p=le(s*c,r),u=le(e*c,r),m=We(a,p,n),S=We(o,u,n);return le(le(m*S,n),r)===e}async function vS(t,e,d,i,a){if(t=ae(t),e=ae(e),d=ae(d),i=ae(i),d<=Pa||d>=t||le(t-Pa,e)!==pn||We(d,e,t)!==Pa)return!1;let n=BigInt(ea(e)),r=BigInt(150);if(n<r||!_c(e,null,32))return!1;a=ae(a);let o=BigInt(2),s=zd(o<<n-Pa,o<<n),c=e*s+a;return i===We(d,c,t)}var _p=class{constructor(t){t&&(this.data=t)}read(t){if(t.length>=1){let e=t[0];if(t.length>=1+e)return this.data=t.subarray(1,1+e),1+this.data.length}throw new Error("Invalid symmetric key")}write(){return I.concatUint8Array([new Uint8Array([this.data.length]),this.data])}},Jp=class{constructor(t){if(t){let{hash:e,cipher:d}=t;this.hash=e,this.cipher=d}else this.hash=null,this.cipher=null}read(t){if(t.length<4||t[0]!==3||t[1]!==1)throw new Te("Cannot read KDFParams");return this.hash=t[2],this.cipher=t[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}},$p=class Zp{static fromObject({wrappedKey:e,algorithm:d}){let i=new Zp;return i.wrappedKey=e,i.algorithm=d,i}read(e){let d=0,i=e[d++];this.algorithm=i%2?e[d++]:null,i-=i%2,this.wrappedKey=I.readExactSubarray(e,d,d+i),d+=i}write(){return I.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}};async function CS(t,e,d,i,a){switch(t){case l.publicKey.rsaEncrypt:case l.publicKey.rsaEncryptSign:{let{n,e:r}=d;return{c:await ey(i,n,r)}}case l.publicKey.elgamal:{let{p:n,g:r,y:o}=d;return yy(i,n,r,o)}case l.publicKey.ecdh:{let{oid:n,Q:r,kdfParams:o}=d,{publicKey:s,wrappedKey:c}=await Kp(n,o,i,r,a);return{V:s,C:new _p(c)}}case l.publicKey.x25519:case l.publicKey.x448:{if(e&&!I.isAES(e))throw new Error("X25519 and X448 keys can only encrypt AES session keys");let{A:n}=d,{ephemeralPublicKey:r,wrappedKey:o}=await xp(t,i,n),s=$p.fromObject({algorithm:e,wrappedKey:o});return{ephemeralPublicKey:r,C:s}}default:return[]}}async function XS(t,e,d,i,a,n){switch(t){case l.publicKey.rsaEncryptSign:case l.publicKey.rsaEncrypt:{let{c:r}=i,{n:o,e:s}=e,{d:c,p,q:u,u:m}=d;return ty(r,o,s,c,p,u,m,n)}case l.publicKey.elgamal:{let{c1:r,c2:o}=i,s=e.p,c=d.x;return Sy(r,o,s,c,n)}case l.publicKey.ecdh:{let{oid:r,Q:o,kdfParams:s}=e,{d:c}=d,{V:p,C:u}=i;return Yp(r,s,p,u.data,o,c,a)}case l.publicKey.x25519:case l.publicKey.x448:{let{A:r}=e,{k:o}=d,{ephemeralPublicKey:s,C:c}=i;if(c.algorithm!==null&&!I.isAES(c.algorithm))throw new Error("AES session key expected");return Lp(t,s,c.wrappedKey,r,o)}default:throw new Error("Unknown public key encryption algorithm.")}}function TS(t,e){let d=0;switch(t){case l.publicKey.rsaEncrypt:case l.publicKey.rsaEncryptSign:case l.publicKey.rsaSign:{let i=I.readMPI(e.subarray(d));d+=i.length+2;let a=I.readMPI(e.subarray(d));return d+=a.length+2,{read:d,publicParams:{n:i,e:a}}}case l.publicKey.dsa:{let i=I.readMPI(e.subarray(d));d+=i.length+2;let a=I.readMPI(e.subarray(d));d+=a.length+2;let n=I.readMPI(e.subarray(d));d+=n.length+2;let r=I.readMPI(e.subarray(d));return d+=r.length+2,{read:d,publicParams:{p:i,q:a,g:n,y:r}}}case l.publicKey.elgamal:{let i=I.readMPI(e.subarray(d));d+=i.length+2;let a=I.readMPI(e.subarray(d));d+=a.length+2;let n=I.readMPI(e.subarray(d));return d+=n.length+2,{read:d,publicParams:{p:i,g:a,y:n}}}case l.publicKey.ecdsa:{let i=new oi;d+=i.read(e),ur(i);let a=I.readMPI(e.subarray(d));return d+=a.length+2,{read:d,publicParams:{oid:i,Q:a}}}case l.publicKey.eddsaLegacy:{let i=new oi;if(d+=i.read(e),ur(i),i.getName()!==l.curve.ed25519Legacy)throw new Error("Unexpected OID for eddsaLegacy");let a=I.readMPI(e.subarray(d));return d+=a.length+2,a=I.leftPad(a,33),{read:d,publicParams:{oid:i,Q:a}}}case l.publicKey.ecdh:{let i=new oi;d+=i.read(e),ur(i);let a=I.readMPI(e.subarray(d));d+=a.length+2;let n=new Jp;return d+=n.read(e.subarray(d)),{read:d,publicParams:{oid:i,Q:a,kdfParams:n}}}case l.publicKey.ed25519:case l.publicKey.ed448:case l.publicKey.x25519:case l.publicKey.x448:{let i=I.readExactSubarray(e,d,d+ki(t));return d+=i.length,{read:d,publicParams:{A:i}}}default:throw new Te("Unknown public key encryption algorithm.")}}function Ms(t,e,d){let i=0;switch(t){case l.publicKey.rsaEncrypt:case l.publicKey.rsaEncryptSign:case l.publicKey.rsaSign:{let a=I.readMPI(e.subarray(i));i+=a.length+2;let n=I.readMPI(e.subarray(i));i+=n.length+2;let r=I.readMPI(e.subarray(i));i+=r.length+2;let o=I.readMPI(e.subarray(i));return i+=o.length+2,{read:i,privateParams:{d:a,p:n,q:r,u:o}}}case l.publicKey.dsa:case l.publicKey.elgamal:{let a=I.readMPI(e.subarray(i));return i+=a.length+2,{read:i,privateParams:{x:a}}}case l.publicKey.ecdsa:case l.publicKey.ecdh:{let a=ki(t,d.oid),n=I.readMPI(e.subarray(i));return i+=n.length+2,n=I.leftPad(n,a),{read:i,privateParams:{d:n}}}case l.publicKey.eddsaLegacy:{let a=ki(t,d.oid);if(d.oid.getName()!==l.curve.ed25519Legacy)throw new Error("Unexpected OID for eddsaLegacy");let n=I.readMPI(e.subarray(i));return i+=n.length+2,n=I.leftPad(n,a),{read:i,privateParams:{seed:n}}}case l.publicKey.ed25519:case l.publicKey.ed448:{let a=ki(t),n=I.readExactSubarray(e,i,i+a);return i+=n.length,{read:i,privateParams:{seed:n}}}case l.publicKey.x25519:case l.publicKey.x448:{let a=ki(t),n=I.readExactSubarray(e,i,i+a);return i+=n.length,{read:i,privateParams:{k:n}}}default:throw new Te("Unknown public key encryption algorithm.")}}function DS(t,e){let d=0;switch(t){case l.publicKey.rsaEncrypt:case l.publicKey.rsaEncryptSign:return{c:I.readMPI(e.subarray(d))};case l.publicKey.elgamal:{let i=I.readMPI(e.subarray(d));d+=i.length+2;let a=I.readMPI(e.subarray(d));return{c1:i,c2:a}}case l.publicKey.ecdh:{let i=I.readMPI(e.subarray(d));d+=i.length+2;let a=new _p;return a.read(e.subarray(d)),{V:i,C:a}}case l.publicKey.x25519:case l.publicKey.x448:{let i=ki(t),a=I.readExactSubarray(e,d,d+i);d+=a.length;let n=new $p;return n.read(e.subarray(d)),{ephemeralPublicKey:a,C:n}}default:throw new Te("Unknown public key encryption algorithm.")}}function Hi(t,e){let d=new Set([l.publicKey.ed25519,l.publicKey.x25519,l.publicKey.ed448,l.publicKey.x448]),i=Object.keys(e).map(a=>{let n=e[a];return I.isUint8Array(n)?d.has(t)?n:I.uint8ArrayToMPI(n):n.write()});return I.concatUint8Array(i)}function RS(t,e,d){switch(t){case l.publicKey.rsaEncrypt:case l.publicKey.rsaEncryptSign:case l.publicKey.rsaSign:return dy(e,65537).then(({n:i,e:a,d:n,p:r,q:o,u:s})=>({privateParams:{d:n,p:r,q:o,u:s},publicParams:{n:i,e:a}}));case l.publicKey.ecdsa:return cn(d).then(({oid:i,Q:a,secret:n})=>({privateParams:{d:n},publicParams:{oid:new oi(i),Q:a}}));case l.publicKey.eddsaLegacy:return cn(d).then(({oid:i,Q:a,secret:n})=>({privateParams:{seed:n},publicParams:{oid:new oi(i),Q:a}}));case l.publicKey.ecdh:return cn(d).then(({oid:i,Q:a,secret:n,hash:r,cipher:o})=>({privateParams:{d:n},publicParams:{oid:new oi(i),Q:a,kdfParams:new Jp({hash:r,cipher:o})}}));case l.publicKey.ed25519:case l.publicKey.ed448:return vo(t).then(({A:i,seed:a})=>({privateParams:{seed:a},publicParams:{A:i}}));case l.publicKey.x25519:case l.publicKey.x448:return Mo(t).then(({A:i,k:a})=>({privateParams:{k:a},publicParams:{A:i}}));case l.publicKey.dsa:case l.publicKey.elgamal:throw new Error("Unsupported algorithm for key generation.");default:throw new Error("Unknown public key algorithm.")}}async function NS(t,e,d){if(!e||!d)throw new Error("Missing key parameters");switch(t){case l.publicKey.rsaEncrypt:case l.publicKey.rsaEncryptSign:case l.publicKey.rsaSign:{let{n:i,e:a}=e,{d:n,p:r,q:o,u:s}=d;return iy(i,a,n,r,o,s)}case l.publicKey.dsa:{let{p:i,q:a,g:n,y:r}=e,{x:o}=d;return vS(i,a,n,r,o)}case l.publicKey.elgamal:{let{p:i,g:a,y:n}=e,{x:r}=d;return Py(i,a,n,r)}case l.publicKey.ecdsa:case l.publicKey.ecdh:{let i=bS[l.read(l.publicKey,t)],{oid:a,Q:n}=e,{d:r}=d;return i.validateParams(a,n,r)}case l.publicKey.eddsaLegacy:{let{Q:i,oid:a}=e,{seed:n}=d;return Vp(a,i,n)}case l.publicKey.ed25519:case l.publicKey.ed448:{let{A:i}=e,{seed:a}=d;return Pp(t,i,a)}case l.publicKey.x25519:case l.publicKey.x448:{let{A:i}=e,{k:a}=d;return Mp(t,i,a)}default:throw new Error("Unknown public key algorithm.")}}function zr(t){let{keySize:e}=Ce(t);return Je(e)}function ur(t){try{t.getName()}catch{throw new Te("Unknown curve OID")}}function ki(t,e){switch(t){case l.publicKey.ecdsa:case l.publicKey.ecdh:case l.publicKey.eddsaLegacy:return new Xt(e).payloadSize;case l.publicKey.ed25519:case l.publicKey.ed448:return Vn(t);case l.publicKey.x25519:case l.publicKey.x448:return xo(t);default:throw new Error("Unknown elliptic algo")}}function AS(t,e){switch(t){case l.publicKey.ecdsa:case l.publicKey.eddsaLegacy:return Up(e);case l.publicKey.ed25519:case l.publicKey.ed448:return zn(t);default:throw new Error("Unknown elliptic signing algo")}}var ln=I.getWebCrypto(),Ca=I.getNodeCrypto(),ei=Ca?Ca.getCiphers():[],Yn={idea:ei.includes("idea-cfb")?"idea-cfb":void 0,tripledes:ei.includes("des-ede3-cfb")?"des-ede3-cfb":void 0,cast5:ei.includes("cast5-cfb")?"cast5-cfb":void 0,blowfish:ei.includes("bf-cfb")?"bf-cfb":void 0,aes128:ei.includes("aes-128-cfb")?"aes-128-cfb":void 0,aes192:ei.includes("aes-192-cfb")?"aes-192-cfb":void 0,aes256:ei.includes("aes-256-cfb")?"aes-256-cfb":void 0};async function wS(t){let{blockSize:e}=Ce(t),d=await Je(e),i=new Uint8Array([d[d.length-2],d[d.length-1]]);return I.concat([d,i])}async function qo(t,e,d,i,a){let n=l.read(l.symmetric,t);if(I.getNodeCrypto()&&Yn[n])return LS(t,e,d,i);if(I.isAES(t))return MS(t,e,d,i);let r=await wp(t),o=new r(e),s=o.blockSize,c=i.slice(),p=new Uint8Array,u=m=>{m&&(p=I.concatUint8Array([p,m]));let S=new Uint8Array(p.length),g,y=0;for(;m?p.length>=s:p.length;){let P=o.encrypt(c);for(g=0;g<s;g++)c[g]=p[g]^P[g],S[y++]=c[g];p=p.subarray(s)}return S.subarray(0,y)};return xe(d,u,u)}async function Bo(t,e,d,i){let a=l.read(l.symmetric,t);if(Ca&&Yn[a])return OS(t,e,d,i);if(I.isAES(t))return xS(t,e,d,i);let n=await wp(t),r=new n(e),o=r.blockSize,s=i,c=new Uint8Array,p=u=>{u&&(c=I.concatUint8Array([c,u]));let m=new Uint8Array(c.length),S,g=0;for(;u?c.length>=o:c.length;){let y=r.encrypt(s);for(s=c.subarray(0,o),S=0;S<o;S++)m[g++]=s[S]^y[S];c=c.subarray(o)}return m.subarray(0,g)};return xe(d,p,p)}var xs=class{constructor(t,e,d){let{blockSize:i}=Ce(t);this.key=e,this.prevBlock=d,this.nextBlock=new Uint8Array(i),this.i=0,this.blockSize=i,this.zeroBlock=new Uint8Array(this.blockSize)}static async isSupported(t){let{keySize:e}=Ce(t);return ln.importKey("raw",new Uint8Array(e),"aes-cbc",!1,["encrypt"]).then(()=>!0,()=>!1)}async _runCBC(t,e){let d="AES-CBC";this.keyRef=this.keyRef||await ln.importKey("raw",this.key,d,!1,["encrypt"]);let i=await ln.encrypt({name:d,iv:e||this.zeroBlock},this.keyRef,t);return new Uint8Array(i).subarray(0,t.length)}async encryptChunk(t){let e=this.nextBlock.length-this.i,d=t.subarray(0,e);if(this.nextBlock.set(d,this.i),this.i+t.length>=2*this.blockSize){let a=(t.length-e)%this.blockSize,n=I.concatUint8Array([this.nextBlock,t.subarray(e,t.length-a)]),r=I.concatUint8Array([this.prevBlock,n.subarray(0,n.length-this.blockSize)]),o=await this._runCBC(r);return Ja(o,n),this.prevBlock=o.slice(-this.blockSize),a>0&&this.nextBlock.set(t.subarray(-a)),this.i=a,o}this.i+=d.length;let i;if(this.i===this.nextBlock.length){let a=this.nextBlock;i=await this._runCBC(this.prevBlock),Ja(i,a),this.prevBlock=i.slice(),this.i=0;let n=t.subarray(d.length);this.nextBlock.set(n,this.i),this.i+=n.length}else i=new Uint8Array;return i}async finish(){let t;if(this.i===0)t=new Uint8Array;else{this.nextBlock=this.nextBlock.subarray(0,this.i);let e=this.nextBlock,d=await this._runCBC(this.prevBlock);Ja(d,e),t=d.subarray(0,e.length)}return this.clearSensitiveData(),t}clearSensitiveData(){this.nextBlock.fill(0),this.prevBlock.fill(0),this.keyRef=null,this.key=null}async encrypt(t){let e=(await this._runCBC(I.concatUint8Array([new Uint8Array(this.blockSize),t]),this.iv)).subarray(0,t.length);return Ja(e,t),this.clearSensitiveData(),e}},el=class{constructor(t,e,d,i){this.forEncryption=t;let{blockSize:a}=Ce(e);this.key=Ts.expandKeyLE(d),i.byteOffset%4!==0&&(i=i.slice()),this.prevBlock=mr(i),this.nextBlock=new Uint8Array(a),this.i=0,this.blockSize=a}_runCFB(t){let e=mr(t),d=new Uint8Array(t.length),i=mr(d);for(let a=0;a+4<=i.length;a+=4){let{s0:n,s1:r,s2:o,s3:s}=Ts.encrypt(this.key,this.prevBlock[0],this.prevBlock[1],this.prevBlock[2],this.prevBlock[3]);i[a+0]=e[a+0]^n,i[a+1]=e[a+1]^r,i[a+2]=e[a+2]^o,i[a+3]=e[a+3]^s,this.prevBlock=(this.forEncryption?i:e).slice(a,a+4)}return d}async processChunk(t){let e=this.nextBlock.length-this.i,d=t.subarray(0,e);if(this.nextBlock.set(d,this.i),this.i+t.length>=2*this.blockSize){let a=(t.length-e)%this.blockSize,n=I.concatUint8Array([this.nextBlock,t.subarray(e,t.length-a)]),r=this._runCFB(n);return a>0&&this.nextBlock.set(t.subarray(-a)),this.i=a,r}this.i+=d.length;let i;if(this.i===this.nextBlock.length){i=this._runCFB(this.nextBlock),this.i=0;let a=t.subarray(d.length);this.nextBlock.set(a,this.i),this.i+=a.length}else i=new Uint8Array;return i}async finish(){let t;return this.i===0?t=new Uint8Array:t=this._runCFB(this.nextBlock).subarray(0,this.i),this.clearSensitiveData(),t}clearSensitiveData(){this.nextBlock.fill(0),this.prevBlock.fill(0),this.key.fill(0)}};async function MS(t,e,d,i){if(ln&&await xs.isSupported(t)){let a=new xs(t,e,i);return I.isStream(d)?xe(d,n=>a.encryptChunk(n),()=>a.finish()):a.encrypt(d)}else if(I.isStream(d)){let a=new el(!0,t,e,i);return xe(d,n=>a.processChunk(n),()=>a.finish())}return Tp(e,i).encrypt(d)}async function xS(t,e,d,i){if(I.isStream(d)){let a=new el(!1,t,e,i);return xe(d,n=>a.processChunk(n),()=>a.finish())}return Tp(e,i).decrypt(d)}function Ja(t,e){let d=Math.min(t.length,e.length);for(let i=0;i<d;i++)t[i]=t[i]^e[i]}var mr=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));function LS(t,e,d,i){let a=l.read(l.symmetric,t),n=new Ca.createCipheriv(Yn[a],e,i);return xe(d,r=>new Uint8Array(n.update(r)))}function OS(t,e,d,i){let a=l.read(l.symmetric,t),n=new Ca.createDecipheriv(Yn[a],e,i);return xe(d,r=>new Uint8Array(n.update(r)))}var Ls=I.getWebCrypto(),US=I.getNodeCrypto(),Sd=16;function Os(t,e){let d=t.length-Sd;for(let i=0;i<Sd;i++)t[i+d]^=e[i];return t}function kS(t,e,d){if(t.length&&t.length%Sd===0)return Os(t,e);let i=new Uint8Array(t.length+(Sd-t.length%Sd));return i.set(t),i[t.length]=128,Os(i,d)}var un=new Uint8Array(Sd);async function qS(t){let e=await BS(t),d=I.double(await e(un)),i=I.double(d);return async function(a){return(await e(kS(a,d,i))).subarray(-Sd)}}async function BS(t){if(I.getNodeCrypto())return async function(e){let d=new US.createCipheriv("aes-"+t.length*8+"-cbc",t,un).update(e);return new Uint8Array(d)};if(I.getWebCrypto())try{return t=await Ls.importKey("raw",t,{name:"AES-CBC",length:t.length*8},!1,["encrypt"]),async function(e){let d=await Ls.encrypt({name:"AES-CBC",iv:un,length:Sd*8},t,e);return new Uint8Array(d).subarray(0,d.byteLength-Sd)}}catch(e){if(e.name!=="NotSupportedError"&&!(t.length===24&&e.name==="OperationError"))throw e;I.printDebugError("Browser did not support operation: "+e.message)}return async function(e){return Xp(t,un,{disablePadding:!0}).encrypt(e)}}var Us=I.getWebCrypto(),jS=I.getNodeCrypto(),GS=I.getNodeBuffer(),Id=16,QS=Id,xi=Id,ks=new Uint8Array(Id),Hr=new Uint8Array(Id);Hr[Id-1]=1;var Wr=new Uint8Array(Id);Wr[Id-1]=2;async function VS(t){let e=await qS(t);return function(d,i){return e(I.concatUint8Array([d,i]))}}async function zS(t){if(I.getNodeCrypto())return async function(e,d){let i=new jS.createCipheriv("aes-"+t.length*8+"-ctr",t,d),a=GS.concat([i.update(e),i.final()]);return new Uint8Array(a)};if(I.getWebCrypto())try{let e=await Us.importKey("raw",t,{name:"AES-CTR",length:t.length*8},!1,["encrypt"]);return async function(d,i){let a=await Us.encrypt({name:"AES-CTR",counter:i,length:Id*8},e,d);return new Uint8Array(a)}}catch(e){if(e.name!=="NotSupportedError"&&!(t.length===24&&e.name==="OperationError"))throw e;I.printDebugError("Browser did not support operation: "+e.message)}return async function(e,d){return Wy(t,d).encrypt(e)}}async function Ba(t,e){if(t!==l.symmetric.aes128&&t!==l.symmetric.aes192&&t!==l.symmetric.aes256)throw new Error("EAX mode supports only AES cipher");let[d,i]=await Promise.all([VS(e),zS(e)]);return{encrypt:async function(a,n,r){let[o,s]=await Promise.all([d(ks,n),d(Hr,r)]),c=await i(a,o),p=await d(Wr,c);for(let u=0;u<xi;u++)p[u]^=s[u]^o[u];return I.concatUint8Array([c,p])},decrypt:async function(a,n,r){if(a.length<xi)throw new Error("Invalid EAX ciphertext");let o=a.subarray(0,-xi),s=a.subarray(-xi),[c,p,u]=await Promise.all([d(ks,n),d(Hr,r),d(Wr,o)]),m=u;for(let S=0;S<xi;S++)m[S]^=p[S]^c[S];if(!I.equalsUint8Array(s,m))throw new Error("Authentication tag mismatch");return await i(o,c)}}}Ba.getNonce=function(t,e){let d=t.slice();for(let i=0;i<e.length;i++)d[8+i]^=e[i];return d};Ba.blockLength=Id;Ba.ivLength=QS;Ba.tagLength=xi;var it=16,tl=15,Ad=16;function qs(t){let e=0;for(let d=1;(t&d)===0;d<<=1)e++;return e}function st(t,e){for(let d=0;d<t.length;d++)t[d]^=e[d];return t}function $a(t,e){return st(t.slice(),e)}var Za=new Uint8Array(it),HS=new Uint8Array([1]);async function ja(t,e){let{keySize:d}=Ce(t);if(!I.isAES(t)||e.length!==d)throw new Error("Unexpected algorithm or key size");let i=0,a=Xp(e,Za,{disablePadding:!0}),n=m=>a.encrypt(m),r=m=>a.decrypt(m),o;s();function s(){let m=n(Za),S=I.double(m);o=[],o[0]=I.double(S),o.x=m,o.$=S}function c(m,S){let g=I.nbits(Math.max(m.length,S.length)/it|0)-1;for(let y=i+1;y<=g;y++)o[y]=I.double(o[y-1]);i=g}function p(m){if(!m.length)return Za;let S=m.length/it|0,g=new Uint8Array(it),y=new Uint8Array(it);for(let P=0;P<S;P++)st(g,o[qs(P+1)]),st(y,n($a(g,m))),m=m.subarray(it);if(m.length){st(g,o.x);let P=new Uint8Array(it);P.set(m,0),P[m.length]=128,st(P,g),st(y,n(P))}return y}function u(m,S,g,y){let P=S.length/it|0;c(S,y);let f=I.concatUint8Array([Za.subarray(0,tl-g.length),HS,g]),E=f[it-1]&63;f[it-1]&=192;let v=n(f),F=I.concatUint8Array([v,$a(v.subarray(0,8),v.subarray(1,9))]),D=I.shiftRight(F.subarray(0+(E>>3),17+(E>>3)),8-(E&7)).subarray(1),h=new Uint8Array(it),X=new Uint8Array(S.length+Ad),b,T=0;for(b=0;b<P;b++)st(D,o[qs(b+1)]),X.set(st(m($a(D,S)),D),T),st(h,m===n?S:X.subarray(T)),S=S.subarray(it),T+=it;if(S.length){st(D,o.x);let R=n(D);X.set($a(S,R),T);let M=new Uint8Array(it);M.set(m===n?S:X.subarray(T,-Ad),0),M[S.length]=128,st(h,M),T+=S.length}let C=st(n(st(st(h,D),o.$)),p(y));return X.set(C,T),X}return{encrypt:async function(m,S,g){return u(n,m,S,g)},decrypt:async function(m,S,g){if(m.length<Ad)throw new Error("Invalid OCB ciphertext");let y=m.subarray(-Ad);m=m.subarray(0,-Ad);let P=u(r,m,S,g);if(I.equalsUint8Array(y,P.subarray(-Ad)))return P.subarray(0,-Ad);throw new Error("Authentication tag mismatch")}}}ja.getNonce=function(t,e){let d=t.slice();for(let i=0;i<e.length;i++)d[7+i]^=e[i];return d};ja.blockLength=it;ja.ivLength=tl;ja.tagLength=Ad;var yr=I.getWebCrypto(),Bs=I.getNodeCrypto(),js=I.getNodeBuffer(),WS=16,KS=12,Li=16,Sr="AES-GCM";async function Wi(t,e){if(t!==l.symmetric.aes128&&t!==l.symmetric.aes192&&t!==l.symmetric.aes256)throw new Error("GCM mode supports only AES cipher");if(I.getNodeCrypto())return{encrypt:async function(d,i,a=new Uint8Array){let n=new Bs.createCipheriv("aes-"+e.length*8+"-gcm",e,i);n.setAAD(a);let r=js.concat([n.update(d),n.final(),n.getAuthTag()]);return new Uint8Array(r)},decrypt:async function(d,i,a=new Uint8Array){let n=new Bs.createDecipheriv("aes-"+e.length*8+"-gcm",e,i);n.setAAD(a),n.setAuthTag(d.slice(d.length-Li,d.length));let r=js.concat([n.update(d.slice(0,d.length-Li)),n.final()]);return new Uint8Array(r)}};if(I.getWebCrypto())try{let d=await yr.importKey("raw",e,{name:Sr},!1,["encrypt","decrypt"]),i=navigator.userAgent.match(/Version\/13\.\d(\.\d)* Safari/)||navigator.userAgent.match(/Version\/(13|14)\.\d(\.\d)* Mobile\/\S* Safari/);return{encrypt:async function(a,n,r=new Uint8Array){if(i&&!a.length)return _a(e,n,r).encrypt(a);let o=await yr.encrypt({name:Sr,iv:n,additionalData:r,tagLength:Li*8},d,a);return new Uint8Array(o)},decrypt:async function(a,n,r=new Uint8Array){if(i&&a.length===Li)return _a(e,n,r).decrypt(a);try{let o=await yr.decrypt({name:Sr,iv:n,additionalData:r,tagLength:Li*8},d,a);return new Uint8Array(o)}catch(o){if(o.name==="OperationError")throw new Error("Authentication tag mismatch")}}}}catch(d){if(d.name!=="NotSupportedError"&&!(e.length===24&&d.name==="OperationError"))throw d;I.printDebugError("Browser did not support operation: "+d.message)}return{encrypt:async function(d,i,a){return _a(e,i,a).encrypt(d)},decrypt:async function(d,i,a){return _a(e,i,a).decrypt(d)}}}Wi.getNonce=function(t,e){let d=t.slice();for(let i=0;i<e.length;i++)d[4+i]^=e[i];return d};Wi.blockLength=WS;Wi.ivLength=KS;Wi.tagLength=Li;function si(t,e=!1){switch(t){case l.aead.eax:return Ba;case l.aead.ocb:return ja;case l.aead.gcm:return Wi;case l.aead.experimentalGCM:if(!e)throw new Error("Unexpected non-standard `experimentalGCM` AEAD algorithm provided in `config.preferredAEADAlgorithm`: use `gcm` instead");return Wi;default:throw new Error("Unsupported AEAD mode")}}function YS(t,e){let d=0;switch(t){case l.publicKey.rsaEncryptSign:case l.publicKey.rsaEncrypt:case l.publicKey.rsaSign:{let i=I.readMPI(e.subarray(d));return d+=i.length+2,{read:d,signatureParams:{s:i}}}case l.publicKey.dsa:case l.publicKey.ecdsa:{let i=I.readMPI(e.subarray(d));d+=i.length+2;let a=I.readMPI(e.subarray(d));return d+=a.length+2,{read:d,signatureParams:{r:i,s:a}}}case l.publicKey.eddsaLegacy:{let i=I.readMPI(e.subarray(d));d+=i.length+2;let a=I.readMPI(e.subarray(d));return d+=a.length+2,{read:d,signatureParams:{r:i,s:a}}}case l.publicKey.ed25519:case l.publicKey.ed448:{let i=2*Vn(t),a=I.readExactSubarray(e,d,d+i);return d+=a.length,{read:d,signatureParams:{RS:a}}}default:throw new Te("Unknown signature algorithm.")}}async function _S(t,e,d,i,a,n){switch(t){case l.publicKey.rsaEncryptSign:case l.publicKey.rsaEncrypt:case l.publicKey.rsaSign:{let{n:r,e:o}=i,s=I.leftPad(d.s,r.length);return Zm(e,a,s,r,o,n)}case l.publicKey.dsa:{let{g:r,p:o,q:s,y:c}=i,{r:p,s:u}=d;return ES(e,p,u,n,r,o,s,c)}case l.publicKey.ecdsa:{let{oid:r,Q:o}=i,s=new Xt(r).payloadSize,c=I.leftPad(d.r,s),p=I.leftPad(d.s,s);return ko(r,e,{r:c,s:p},a,o,n)}case l.publicKey.eddsaLegacy:{let{oid:r,Q:o}=i,s=new Xt(r).payloadSize,c=I.leftPad(d.r,s),p=I.leftPad(d.s,s);return Qp(r,e,{r:c,s:p},a,o,n)}case l.publicKey.ed25519:case l.publicKey.ed448:{let{A:r}=i;return Xo(t,e,d,a,r,n)}default:throw new Error("Unknown signature algorithm.")}}async function JS(t,e,d,i,a,n){if(!d||!i)throw new Error("Missing key parameters");switch(t){case l.publicKey.rsaEncryptSign:case l.publicKey.rsaEncrypt:case l.publicKey.rsaSign:{let{n:r,e:o}=d,{d:s,p:c,q:p,u}=i;return{s:await $m(e,a,r,o,s,c,p,u,n)}}case l.publicKey.dsa:{let{g:r,p:o,q:s}=d,{x:c}=i;return FS(e,n,r,o,s,c)}case l.publicKey.elgamal:throw new Error("Signing with Elgamal is not defined in the OpenPGP standard.");case l.publicKey.ecdsa:{let{oid:r,Q:o}=d,{d:s}=i;return Uo(r,e,a,o,s,n)}case l.publicKey.eddsaLegacy:{let{oid:r,Q:o}=d,{seed:s}=i;return Gp(r,e,a,o,s,n)}case l.publicKey.ed25519:case l.publicKey.ed448:{let{A:r}=d,{seed:o}=i;return Co(t,e,a,r,o,n)}default:throw new Error("Unknown signature algorithm.")}}var $S=2,ZS=19,e2=16,dl=class il extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,il),this.name="Argon2OutOfMemoryError"}},en,oa,t2=2<<19,d2=class{constructor(t=J){let{passes:e,parallelism:d,memoryExponent:i}=t.s2kArgon2Params;this.type="argon2",this.salt=null,this.t=e,this.p=d,this.encodedM=i}generateSalt(){this.salt=Je(e2)}read(t){let e=0;return this.salt=t.subarray(e,e+16),e+=16,this.t=t[e++],this.p=t[e++],this.encodedM=t[e++],e}write(){let t=[new Uint8Array([l.write(l.s2k,this.type)]),this.salt,new Uint8Array([this.t,this.p,this.encodedM])];return I.concatUint8Array(t)}async produceKey(t,e){let d=2<<this.encodedM-1;try{en=en||(await Promise.resolve().then(function(){return QP})).default,oa=oa||en();let i=await oa,a=I.encodeUTF8(t),n=i({version:ZS,type:$S,password:a,salt:this.salt,tagLength:e,memorySize:d,parallelism:this.p,passes:this.t});return d>t2&&(oa=en(),oa.catch(()=>{})),n}catch(i){throw i.message&&(i.message.includes("Unable to grow instance memory")||i.message.includes("failed to grow memory")||i.message.includes("WebAssembly.Memory.grow")||i.message.includes("Out of memory"))?new dl("Could not allocate required memory for Argon2"):i}}},i2=class{constructor(t,e=J){this.algorithm=l.hash.sha256,this.type=l.read(l.s2k,t),this.c=e.s2kIterationCountByte,this.salt=null}generateSalt(){switch(this.type){case"salted":case"iterated":this.salt=Je(8)}}getCount(){return 16+(this.c&15)<<(this.c>>4)+6}read(t){let e=0;switch(this.algorithm=t[e++],this.type){case"simple":break;case"salted":this.salt=t.subarray(e,e+8),e+=8;break;case"iterated":this.salt=t.subarray(e,e+8),e+=8,this.c=t[e++];break;case"gnu":if(I.uint8ArrayToString(t.subarray(e,e+3))==="GNU")if(e+=3,1e3+t[e++]===1001)this.type="gnu-dummy";else throw new Te("Unknown s2k gnu protection mode.");else throw new Te("Unknown s2k type.");break;default:throw new Te("Unknown s2k type.")}return e}write(){if(this.type==="gnu-dummy")return new Uint8Array([101,0,...I.stringToUint8Array("GNU"),1]);let t=[new Uint8Array([l.write(l.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":t.push(this.salt);break;case"iterated":t.push(this.salt),t.push(new Uint8Array([this.c]));break;case"gnu":throw new Error("GNU s2k type not supported.");default:throw new Error("Unknown s2k type.")}return I.concatUint8Array(t)}async produceKey(t,e){t=I.encodeUTF8(t);let d=[],i=0,a=0;for(;i<e;){let n;switch(this.type){case"simple":n=I.concatUint8Array([new Uint8Array(a),t]);break;case"salted":n=I.concatUint8Array([new Uint8Array(a),this.salt,t]);break;case"iterated":{let o=I.concatUint8Array([this.salt,t]),s=o.length,c=Math.max(this.getCount(),s);n=new Uint8Array(a+c),n.set(o,a);for(let p=a+s;p<c;p+=s,s*=2)n.copyWithin(p,a,p);break}case"gnu":throw new Error("GNU s2k type not supported.");default:throw new Error("Unknown s2k type.")}let r=await Yt(this.algorithm,n);d.push(r),i+=r.length,a++}return I.concatUint8Array(d).subarray(0,e)}},a2=new Set([l.s2k.argon2,l.s2k.iterated]);function Rn(t,e=J){switch(t){case l.s2k.argon2:return new d2(e);case l.s2k.iterated:case l.s2k.gnu:case l.s2k.salted:case l.s2k.simple:return new i2(t,e);default:throw new Te("Unsupported S2K type")}}function al(t){let{s2kType:e}=t;if(!a2.has(e))throw new Error("The provided `config.s2kType` value is not allowed");return Rn(e,t)}var _e=Uint8Array,lt=Uint16Array,_n=Uint32Array,Jn=new _e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),$n=new _e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Kr=new _e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nl=function(t,e){for(var d=new lt(31),i=0;i<31;++i)d[i]=e+=1<<t[i-1];for(var a=new _n(d[30]),i=1;i<30;++i)for(var n=d[i];n<d[i+1];++n)a[n]=n-d[i]<<5|i;return[d,a]},rl=nl(Jn,2),ol=rl[0],Yr=rl[1];ol[28]=258,Yr[258]=28;var sl=nl($n,0),n2=sl[0],Gs=sl[1],_r=new lt(32768);for(Se=0;Se<32768;++Se)nd=(Se&43690)>>>1|(Se&21845)<<1,nd=(nd&52428)>>>2|(nd&13107)<<2,nd=(nd&61680)>>>4|(nd&3855)<<4,_r[Se]=((nd&65280)>>>8|(nd&255)<<8)>>>1;var nd,Se,Wt=function(t,e,d){for(var i=t.length,a=0,n=new lt(e);a<i;++a)t[a]&&++n[t[a]-1];var r=new lt(e);for(a=0;a<e;++a)r[a]=r[a-1]+n[a-1]<<1;var o;if(d){o=new lt(1<<e);var s=15-e;for(a=0;a<i;++a)if(t[a])for(var c=a<<4|t[a],p=e-t[a],u=r[t[a]-1]++<<p,m=u|(1<<p)-1;u<=m;++u)o[_r[u]>>>s]=c}else for(o=new lt(i),a=0;a<i;++a)t[a]&&(o[a]=_r[r[t[a]-1]++]>>>15-t[a]);return o},Bd=new _e(288);for(Se=0;Se<144;++Se)Bd[Se]=8;var Se;for(Se=144;Se<256;++Se)Bd[Se]=9;var Se;for(Se=256;Se<280;++Se)Bd[Se]=7;var Se;for(Se=280;Se<288;++Se)Bd[Se]=8;var Se,Xa=new _e(32);for(Se=0;Se<32;++Se)Xa[Se]=5;var Se,r2=Wt(Bd,9,0),o2=Wt(Bd,9,1),s2=Wt(Xa,5,0),c2=Wt(Xa,5,1),Pr=function(t){for(var e=t[0],d=1;d<t.length;++d)t[d]>e&&(e=t[d]);return e},Dt=function(t,e,d){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(e&7)&d},gr=function(t,e){var d=e/8|0;return(t[d]|t[d+1]<<8|t[d+2]<<16)>>(e&7)},jo=function(t){return(t+7)/8|0},Ia=function(t,e,d){(e==null||e<0)&&(e=0),(d==null||d>t.length)&&(d=t.length);var i=new(t.BYTES_PER_ELEMENT==2?lt:t.BYTES_PER_ELEMENT==4?_n:_e)(d-e);return i.set(t.subarray(e,d)),i},p2=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],gt=function(t,e,d){var i=new Error(e||p2[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,gt),!d)throw i;return i},l2=function(t,e,d){var i=t.length;if(!i||d&&d.f&&!d.l)return e||new _e(0);var a=!e||d,n=!d||d.i;d||(d={}),e||(e=new _e(i*3));var r=function(K){var te=e.length;if(K>te){var _=new _e(Math.max(te*2,K));_.set(e),e=_}},o=d.f||0,s=d.p||0,c=d.b||0,p=d.l,u=d.d,m=d.m,S=d.n,g=i*8;do{if(!p){o=Dt(t,s,1);var y=Dt(t,s+1,3);if(s+=3,y)if(y==1)p=o2,u=c2,m=9,S=5;else if(y==2){var P=Dt(t,s,31)+257,f=Dt(t,s+10,15)+4,E=P+Dt(t,s+5,31)+1;s+=14;for(var v=new _e(E),F=new _e(19),D=0;D<f;++D)F[Kr[D]]=Dt(t,s+D*3,7);s+=f*3;for(var h=Pr(F),X=(1<<h)-1,b=Wt(F,h,1),D=0;D<E;){var T=b[Dt(t,s,X)];s+=T&15;var C=T>>>4;if(C<16)v[D++]=C;else{var R=0,M=0;for(C==16?(M=3+Dt(t,s,3),s+=2,R=v[D-1]):C==17?(M=3+Dt(t,s,7),s+=3):C==18&&(M=11+Dt(t,s,127),s+=7);M--;)v[D++]=R}}var x=v.subarray(0,P),N=v.subarray(P);m=Pr(x),S=Pr(N),p=Wt(x,m,1),u=Wt(N,S,1)}else gt(1);else{var C=jo(s)+4,w=t[C-4]|t[C-3]<<8,A=C+w;if(A>i){n&&gt(0);break}a&&r(c+w),e.set(t.subarray(C,A),c),d.b=c+=w,d.p=s=A*8,d.f=o;continue}if(s>g){n&&gt(0);break}}a&&r(c+131072);for(var U=(1<<m)-1,L=(1<<S)-1,j=s;;j=s){var R=p[gr(t,s)&U],B=R>>>4;if(s+=R&15,s>g){n&&gt(0);break}if(R||gt(2),B<256)e[c++]=B;else if(B==256){j=s,p=null;break}else{var H=B-254;if(B>264){var D=B-257,Y=Jn[D];H=Dt(t,s,(1<<Y)-1)+ol[D],s+=Y}var Q=u[gr(t,s)&L],W=Q>>>4;Q||gt(3),s+=Q&15;var N=n2[W];if(W>3){var Y=$n[W];N+=gr(t,s)&(1<<Y)-1,s+=Y}if(s>g){n&&gt(0);break}a&&r(c+131072);for(var G=c+H;c<G;c+=4)e[c]=e[c-N],e[c+1]=e[c+1-N],e[c+2]=e[c+2-N],e[c+3]=e[c+3-N];c=G}}d.l=p,d.p=j,d.b=c,d.f=o,p&&(o=1,d.m=m,d.d=u,d.n=S)}while(!o);return c==e.length?e:Ia(e,0,c)},rd=function(t,e,d){d<<=e&7;var i=e/8|0;t[i]|=d,t[i+1]|=d>>>8},sa=function(t,e,d){d<<=e&7;var i=e/8|0;t[i]|=d,t[i+1]|=d>>>8,t[i+2]|=d>>>16},hr=function(t,e){for(var d=[],i=0;i<t.length;++i)t[i]&&d.push({s:i,f:t[i]});var a=d.length,n=d.slice();if(!a)return[Go,0];if(a==1){var r=new _e(d[0].s+1);return r[d[0].s]=1,[r,1]}d.sort(function(D,h){return D.f-h.f}),d.push({s:-1,f:25001});var o=d[0],s=d[1],c=0,p=1,u=2;for(d[0]={s:-1,f:o.f+s.f,l:o,r:s};p!=a-1;)o=d[d[c].f<d[u].f?c++:u++],s=d[c!=p&&d[c].f<d[u].f?c++:u++],d[p++]={s:-1,f:o.f+s.f,l:o,r:s};for(var m=n[0].s,i=1;i<a;++i)n[i].s>m&&(m=n[i].s);var S=new lt(m+1),g=Jr(d[p-1],S,0);if(g>e){var i=0,y=0,P=g-e,f=1<<P;for(n.sort(function(h,X){return S[X.s]-S[h.s]||h.f-X.f});i<a;++i){var E=n[i].s;if(S[E]>e)y+=f-(1<<g-S[E]),S[E]=e;else break}for(y>>>=P;y>0;){var v=n[i].s;S[v]<e?y-=1<<e-S[v]++-1:++i}for(;i>=0&&y;--i){var F=n[i].s;S[F]==e&&(--S[F],++y)}g=e}return[new _e(S),g]},Jr=function(t,e,d){return t.s==-1?Math.max(Jr(t.l,e,d+1),Jr(t.r,e,d+1)):e[t.s]=d},Qs=function(t){for(var e=t.length;e&&!t[--e];);for(var d=new lt(++e),i=0,a=t[0],n=1,r=function(s){d[i++]=s},o=1;o<=e;++o)if(t[o]==a&&o!=e)++n;else{if(!a&&n>2){for(;n>138;n-=138)r(32754);n>2&&(r(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(r(a),--n;n>6;n-=6)r(8304);n>2&&(r(n-3<<5|8208),n=0)}for(;n--;)r(a);n=1,a=t[o]}return[d.subarray(0,i),e]},ca=function(t,e){for(var d=0,i=0;i<e.length;++i)d+=t[i]*e[i];return d},$r=function(t,e,d){var i=d.length,a=jo(e+2);t[a]=i&255,t[a+1]=i>>>8,t[a+2]=t[a]^255,t[a+3]=t[a+1]^255;for(var n=0;n<i;++n)t[a+n+4]=d[n];return(a+4+i)*8},Vs=function(t,e,d,i,a,n,r,o,s,c,p){rd(e,p++,d),++a[256];for(var u=hr(a,15),m=u[0],S=u[1],g=hr(n,15),y=g[0],P=g[1],f=Qs(m),E=f[0],v=f[1],F=Qs(y),D=F[0],h=F[1],X=new lt(19),b=0;b<E.length;++b)X[E[b]&31]++;for(var b=0;b<D.length;++b)X[D[b]&31]++;for(var T=hr(X,7),C=T[0],R=T[1],M=19;M>4&&!C[Kr[M-1]];--M);var x=c+5<<3,N=ca(a,Bd)+ca(n,Xa)+r,w=ca(a,m)+ca(n,y)+r+14+3*M+ca(X,C)+(2*X[16]+3*X[17]+7*X[18]);if(x<=N&&x<=w)return $r(e,p,t.subarray(s,s+c));var A,U,L,j;if(rd(e,p,1+(w<N)),p+=2,w<N){A=Wt(m,S,0),U=m,L=Wt(y,P,0),j=y;var B=Wt(C,R,0);rd(e,p,v-257),rd(e,p+5,h-1),rd(e,p+10,M-4),p+=14;for(var b=0;b<M;++b)rd(e,p+3*b,C[Kr[b]]);p+=3*M;for(var H=[E,D],Y=0;Y<2;++Y)for(var Q=H[Y],b=0;b<Q.length;++b){var W=Q[b]&31;rd(e,p,B[W]),p+=C[W],W>15&&(rd(e,p,Q[b]>>>5&127),p+=Q[b]>>>12)}}else A=r2,U=Bd,L=s2,j=Xa;for(var b=0;b<o;++b)if(i[b]>255){var W=i[b]>>>18&31;sa(e,p,A[W+257]),p+=U[W+257],W>7&&(rd(e,p,i[b]>>>23&31),p+=Jn[W]);var G=i[b]&31;sa(e,p,L[G]),p+=j[G],G>3&&(sa(e,p,i[b]>>>5&8191),p+=$n[G])}else sa(e,p,A[i[b]]),p+=U[i[b]];return sa(e,p,A[256]),p+U[256]},u2=new _n([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Go=new _e(0),m2=function(t,e,d,i,a,n){var r=t.length,o=new _e(i+r+5*(1+Math.ceil(r/7e3))+a),s=o.subarray(i,o.length-a),c=0;if(!e||r<8)for(var p=0;p<=r;p+=65535){var u=p+65535;u>=r&&(s[c>>3]=n),c=$r(s,c+1,t.subarray(p,u))}else{for(var m=u2[e-1],S=m>>>13,g=m&8191,y=(1<<d)-1,P=new lt(32768),f=new lt(y+1),E=Math.ceil(d/3),v=2*E,F=function(me){return(t[me]^t[me+1]<<E^t[me+2]<<v)&y},D=new _n(25e3),h=new lt(288),X=new lt(32),b=0,T=0,p=0,C=0,R=0,M=0;p<r;++p){var x=F(p),N=p&32767,w=f[x];if(P[N]=w,f[x]=N,R<=p){var A=r-p;if((b>7e3||C>24576)&&A>423){c=Vs(t,s,0,D,h,X,T,C,M,p-M,c),C=b=T=0,M=p;for(var U=0;U<286;++U)h[U]=0;for(var U=0;U<30;++U)X[U]=0}var L=2,j=0,B=g,H=N-w&32767;if(A>2&&x==F(p-H))for(var Y=Math.min(S,A)-1,Q=Math.min(32767,p),W=Math.min(258,A);H<=Q&&--B&&N!=w;){if(t[p+L]==t[p+L-H]){for(var G=0;G<W&&t[p+G]==t[p+G-H];++G);if(G>L){if(L=G,j=H,G>Y)break;for(var K=Math.min(H,G-2),te=0,U=0;U<K;++U){var _=p-H+U+32768&32767,Z=P[_],de=_-Z+32768&32767;de>te&&(te=de,w=_)}}}N=w,w=P[N],H+=N-w+32768&32767}if(j){D[C++]=268435456|Yr[L]<<18|Gs[j];var oe=Yr[L]&31,pe=Gs[j]&31;T+=Jn[oe]+$n[pe],++h[257+oe],++X[pe],R=p+L,++b}else D[C++]=t[p],++h[t[p]]}}c=Vs(t,s,n,D,h,X,T,C,M,p-M,c),!n&&c&7&&(c=$r(s,c+1,Go))}return Ia(o,0,i+jo(c)+a)},y2=function(){var t=1,e=0;return{p:function(d){for(var i=t,a=e,n=d.length|0,r=0;r!=n;){for(var o=Math.min(r+2655,n);r<o;++r)a+=i+=d[r];i=(i&65535)+15*(i>>16),a=(a&65535)+15*(a>>16)}t=i,e=a},d:function(){return t%=65521,e%=65521,(t&255)<<24|t>>>8<<16|(e&255)<<8|e>>>8}}},cl=function(t,e,d,i,a){return m2(t,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):12+e.mem,d,i,!a)},S2=function(t,e,d){for(;d;++e)t[e]=d,d>>>=8},P2=function(t,e){var d=e.level,i=d==0?0:d<6?1:d==9?3:2;t[0]=120,t[1]=i<<6|(i?32-2*i:1)},Zr=function(){function t(e,d){!d&&typeof e=="function"&&(d=e,e={}),this.ondata=d,this.o=e||{}}return t.prototype.p=function(e,d){this.ondata(cl(e,this.o,0,0,!d),d)},t.prototype.push=function(e,d){this.ondata||gt(5),this.d&&gt(4),this.d=d,this.p(e,d||!1)},t}(),mn=function(){function t(e){this.s={},this.p=new _e(0),this.ondata=e}return t.prototype.e=function(e){this.ondata||gt(5),this.d&&gt(4);var d=this.p.length,i=new _e(d+e.length);i.set(this.p),i.set(e,d),this.p=i},t.prototype.c=function(e){this.d=this.s.i=e||!1;var d=this.s.b,i=l2(this.p,this.o,this.s);this.ondata(Ia(i,d,this.s.b),this.d),this.o=Ia(i,this.s.b-32768),this.s.b=this.o.length,this.p=Ia(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(e,d){this.e(e),this.c(d)},t}(),g2=function(){function t(e,d){this.c=y2(),this.v=1,Zr.call(this,e,d)}return t.prototype.push=function(e,d){Zr.prototype.push.call(this,e,d)},t.prototype.p=function(e,d){this.c.p(e);var i=cl(e,this.o,this.v&&2,d&&4,!d);this.v&&(P2(i,this.o),this.v=0),d&&S2(i,i.length-4,this.c.d()),this.ondata(i,d)},t}(),h2=function(){function t(e){this.v=1,mn.call(this,e)}return t.prototype.push=function(e,d){if(mn.prototype.e.call(this,e),this.v){if(this.p.length<2&&!d)return;this.p=this.p.subarray(2),this.v=0}d&&(this.p.length<4&&gt(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),mn.prototype.c.call(this,d)},t}(),f2=typeof TextDecoder<"u"&&new TextDecoder,I2=0;try{f2.decode(Go,{stream:!0}),I2=1}catch{}var Nn=class{static get tag(){return l.packet.literalData}constructor(t=new Date){this.format=l.literal.utf8,this.date=I.normalizeDate(t),this.text=null,this.data=null,this.filename=""}setText(t,e=l.literal.utf8){this.format=e,this.text=t,this.data=null}getText(t=!1){return(this.text===null||I.isStream(this.text))&&(this.text=I.decodeUTF8(I.nativeEOL(this.getBytes(t)))),this.text}setBytes(t,e){this.format=e,this.data=t,this.text=null}getBytes(t=!1){return this.data===null&&(this.data=I.canonicalizeEOL(I.encodeUTF8(this.text))),t?ha(this.data):this.data}setFilename(t){this.filename=t}getFilename(){return this.filename}async read(t){await ho(t,async e=>{let d=await e.readByte(),i=await e.readByte();this.filename=I.decodeUTF8(await e.readBytes(i)),this.date=I.readDate(await e.readBytes(4));let a=e.remainder();qe(a)&&(a=await Ve(a)),this.setBytes(a,d)})}writeHeader(){let t=I.encodeUTF8(this.filename),e=new Uint8Array([t.length]),d=new Uint8Array([this.format]),i=I.writeDate(this.date);return I.concatUint8Array([d,e,t,i])}write(){let t=this.writeHeader(),e=this.getBytes();return I.concat([t,e])}},ci=class eo{constructor(){this.bytes=""}read(e){return this.bytes=I.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return I.stringToUint8Array(this.bytes)}toHex(){return I.uint8ArrayToHex(I.stringToUint8Array(this.bytes))}equals(e,d=!1){return d&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return this.bytes===""}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){let d=new eo;return d.read(I.hexToUint8Array(e)),d}static wildcard(){let e=new eo;return e.read(new Uint8Array(8)),e}},pa=Symbol("verified"),zs="salt@notations.openpgpjs.org",b2=new Set([l.signatureSubpacket.issuerKeyID,l.signatureSubpacket.issuerFingerprint,l.signatureSubpacket.embeddedSignature]),It=class pl{static get tag(){return l.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.unknownSubpackets=[],this.signedHashValue=null,this.salt=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new ci,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.preferredCipherSuites=null,this.revoked=null,this[pa]=null}read(e,d=J){let i=0;if(this.version=e[i++],this.version===5&&!d.enableParsingV5Entities)throw new Te("Support for v5 entities is disabled; turn on `config.enableParsingV5Entities` if needed");if(this.version!==4&&this.version!==5&&this.version!==6)throw new Te(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[i++],this.publicKeyAlgorithm=e[i++],this.hashAlgorithm=e[i++],i+=this.readSubPackets(e.subarray(i,e.length),!0),!this.created)throw new Error("Missing signature creation time subpacket.");if(this.signatureData=e.subarray(0,i),i+=this.readSubPackets(e.subarray(i,e.length),!1),this.signedHashValue=e.subarray(i,i+2),i+=2,this.version===6){let o=e[i++];this.salt=e.subarray(i,i+o),i+=o}let a=e.subarray(i,e.length),{read:n,signatureParams:r}=YS(this.publicKeyAlgorithm,a);if(n<a.length)throw new Error("Error reading MPIs");this.params=r}writeParams(){return this.params instanceof Promise?Vd(async()=>Hi(this.publicKeyAlgorithm,await this.params)):Hi(this.publicKeyAlgorithm,this.params)}write(){let e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),this.version===6&&(e.push(new Uint8Array([this.salt.length])),e.push(this.salt)),e.push(this.writeParams()),I.concat(e)}async sign(e,d,i=new Date,a=!1,n){this.version=e.version,this.created=I.normalizeDate(i),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID();let r=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];if(this.version===6){let p=fr(this.hashAlgorithm);if(this.salt===null)this.salt=Je(p);else if(p!==this.salt.length)throw new Error("Provided salt does not have the required length")}else if(n.nonDeterministicSignaturesViaNotation)if(this.rawNotations.filter(({name:p})=>p===zs).length===0){let p=Je(fr(this.hashAlgorithm));this.rawNotations.push({name:zs,value:p,humanReadable:!1,critical:!1})}else throw new Error("Unexpected existing salt notation");r.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=I.concat(r);let o=this.toHash(this.signatureType,d,a),s=await this.hash(this.signatureType,d,o,a);this.signedHashValue=Ye(Fa(s),0,2);let c=async()=>JS(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,o,await Ve(s));I.isStream(s)?this.params=c():(this.params=await c(),this[pa]=!0)}writeHashedSubPackets(){let e=l.signatureSubpacket,d=[],i;if(this.created===null)throw new Error("Missing signature creation time");d.push(Ie(e.signatureCreationTime,!0,I.writeDate(this.created))),this.signatureExpirationTime!==null&&d.push(Ie(e.signatureExpirationTime,!0,I.writeNumber(this.signatureExpirationTime,4))),this.exportable!==null&&d.push(Ie(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),this.trustLevel!==null&&(i=new Uint8Array([this.trustLevel,this.trustAmount]),d.push(Ie(e.trustSignature,!0,i))),this.regularExpression!==null&&d.push(Ie(e.regularExpression,!0,this.regularExpression)),this.revocable!==null&&d.push(Ie(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),this.keyExpirationTime!==null&&d.push(Ie(e.keyExpirationTime,!0,I.writeNumber(this.keyExpirationTime,4))),this.preferredSymmetricAlgorithms!==null&&(i=I.stringToUint8Array(I.uint8ArrayToString(this.preferredSymmetricAlgorithms)),d.push(Ie(e.preferredSymmetricAlgorithms,!1,i))),this.revocationKeyClass!==null&&(i=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),i=I.concat([i,this.revocationKeyFingerprint]),d.push(Ie(e.revocationKey,!1,i))),!this.issuerKeyID.isNull()&&this.issuerKeyVersion<5&&d.push(Ie(e.issuerKeyID,!0,this.issuerKeyID.write())),this.rawNotations.forEach(({name:r,value:o,humanReadable:s,critical:c})=>{i=[new Uint8Array([s?128:0,0,0,0])];let p=I.encodeUTF8(r);i.push(I.writeNumber(p.length,2)),i.push(I.writeNumber(o.length,2)),i.push(p),i.push(o),i=I.concat(i),d.push(Ie(e.notationData,c,i))}),this.preferredHashAlgorithms!==null&&(i=I.stringToUint8Array(I.uint8ArrayToString(this.preferredHashAlgorithms)),d.push(Ie(e.preferredHashAlgorithms,!1,i))),this.preferredCompressionAlgorithms!==null&&(i=I.stringToUint8Array(I.uint8ArrayToString(this.preferredCompressionAlgorithms)),d.push(Ie(e.preferredCompressionAlgorithms,!1,i))),this.keyServerPreferences!==null&&(i=I.stringToUint8Array(I.uint8ArrayToString(this.keyServerPreferences)),d.push(Ie(e.keyServerPreferences,!1,i))),this.preferredKeyServer!==null&&d.push(Ie(e.preferredKeyServer,!1,I.encodeUTF8(this.preferredKeyServer))),this.isPrimaryUserID!==null&&d.push(Ie(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),this.policyURI!==null&&d.push(Ie(e.policyURI,!1,I.encodeUTF8(this.policyURI))),this.keyFlags!==null&&(i=I.stringToUint8Array(I.uint8ArrayToString(this.keyFlags)),d.push(Ie(e.keyFlags,!0,i))),this.signersUserID!==null&&d.push(Ie(e.signersUserID,!1,I.encodeUTF8(this.signersUserID))),this.reasonForRevocationFlag!==null&&(i=I.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),d.push(Ie(e.reasonForRevocation,!0,i))),this.features!==null&&(i=I.stringToUint8Array(I.uint8ArrayToString(this.features)),d.push(Ie(e.features,!1,i))),this.signatureTargetPublicKeyAlgorithm!==null&&(i=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],i.push(I.stringToUint8Array(this.signatureTargetHash)),i=I.concat(i),d.push(Ie(e.signatureTarget,!0,i))),this.embeddedSignature!==null&&d.push(Ie(e.embeddedSignature,!0,this.embeddedSignature.write())),this.issuerFingerprint!==null&&(i=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],i=I.concat(i),d.push(Ie(e.issuerFingerprint,this.version>=5,i))),this.preferredAEADAlgorithms!==null&&(i=I.stringToUint8Array(I.uint8ArrayToString(this.preferredAEADAlgorithms)),d.push(Ie(e.preferredAEADAlgorithms,!1,i))),this.preferredCipherSuites!==null&&(i=new Uint8Array([].concat(...this.preferredCipherSuites)),d.push(Ie(e.preferredCipherSuites,!1,i)));let a=I.concat(d),n=I.writeNumber(a.length,this.version===6?4:2);return I.concat([n,a])}writeUnhashedSubPackets(){let e=this.unhashedSubpackets.map(({type:a,critical:n,body:r})=>Ie(a,n,r)),d=I.concat(e),i=I.writeNumber(d.length,this.version===6?4:2);return I.concat([i,d])}readSubPacket(e,d=!0){let i=0,a=!!(e[i]&128),n=e[i]&127;if(i++,!(!d&&(this.unhashedSubpackets.push({type:n,critical:a,body:e.subarray(i,e.length)}),!b2.has(n))))switch(n){case l.signatureSubpacket.signatureCreationTime:this.created=I.readDate(e.subarray(i,e.length));break;case l.signatureSubpacket.signatureExpirationTime:{let r=I.readNumber(e.subarray(i,e.length));this.signatureNeverExpires=r===0,this.signatureExpirationTime=r;break}case l.signatureSubpacket.exportableCertification:this.exportable=e[i++]===1;break;case l.signatureSubpacket.trustSignature:this.trustLevel=e[i++],this.trustAmount=e[i++];break;case l.signatureSubpacket.regularExpression:this.regularExpression=e[i];break;case l.signatureSubpacket.revocable:this.revocable=e[i++]===1;break;case l.signatureSubpacket.keyExpirationTime:{let r=I.readNumber(e.subarray(i,e.length));this.keyExpirationTime=r,this.keyNeverExpires=r===0;break}case l.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(i,e.length)];break;case l.signatureSubpacket.revocationKey:this.revocationKeyClass=e[i++],this.revocationKeyAlgorithm=e[i++],this.revocationKeyFingerprint=e.subarray(i,i+20);break;case l.signatureSubpacket.issuerKeyID:if(this.version===4)this.issuerKeyID.read(e.subarray(i,e.length));else if(d)throw new Error("Unexpected Issuer Key ID subpacket");break;case l.signatureSubpacket.notationData:{let r=!!(e[i]&128);i+=4;let o=I.readNumber(e.subarray(i,i+2));i+=2;let s=I.readNumber(e.subarray(i,i+2));i+=2;let c=I.decodeUTF8(e.subarray(i,i+o)),p=e.subarray(i+o,i+o+s);this.rawNotations.push({name:c,humanReadable:r,value:p,critical:a}),r&&(this.notations[c]=I.decodeUTF8(p));break}case l.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(i,e.length)];break;case l.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(i,e.length)];break;case l.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(i,e.length)];break;case l.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=I.decodeUTF8(e.subarray(i,e.length));break;case l.signatureSubpacket.primaryUserID:this.isPrimaryUserID=e[i++]!==0;break;case l.signatureSubpacket.policyURI:this.policyURI=I.decodeUTF8(e.subarray(i,e.length));break;case l.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(i,e.length)];break;case l.signatureSubpacket.signersUserID:this.signersUserID=I.decodeUTF8(e.subarray(i,e.length));break;case l.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[i++],this.reasonForRevocationString=I.decodeUTF8(e.subarray(i,e.length));break;case l.signatureSubpacket.features:this.features=[...e.subarray(i,e.length)];break;case l.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[i++],this.signatureTargetHashAlgorithm=e[i++];let r=je(this.signatureTargetHashAlgorithm);this.signatureTargetHash=I.uint8ArrayToString(e.subarray(i,i+r));break}case l.signatureSubpacket.embeddedSignature:this.embeddedSignature=new pl,this.embeddedSignature.read(e.subarray(i,e.length));break;case l.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[i++],this.issuerFingerprint=e.subarray(i,e.length),this.issuerKeyVersion>=5?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case l.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(i,e.length)];break;case l.signatureSubpacket.preferredCipherSuites:this.preferredCipherSuites=[];for(let r=i;r<e.length;r+=2)this.preferredCipherSuites.push([e[r],e[r+1]]);break;default:this.unknownSubpackets.push({type:n,critical:a,body:e.subarray(i,e.length)});break}}readSubPackets(e,d=!0,i){let a=this.version===6?4:2,n=I.readNumber(e.subarray(0,a)),r=a;for(;r<2+n;){let o=mp(e.subarray(r,e.length));r+=o.offset,this.readSubPacket(e.subarray(r,r+o.len),d,i),r+=o.len}return r}toSign(e,d){let i=l.signature;switch(e){case i.binary:return d.text!==null?I.encodeUTF8(d.getText(!0)):d.getBytes(!0);case i.text:{let a=d.getBytes(!0);return I.canonicalizeEOL(a)}case i.standalone:return new Uint8Array(0);case i.certGeneric:case i.certPersona:case i.certCasual:case i.certPositive:case i.certRevocation:{let a,n;if(d.userID)n=180,a=d.userID;else if(d.userAttribute)n=209,a=d.userAttribute;else throw new Error("Either a userID or userAttribute packet needs to be supplied for certification.");let r=a.write();return I.concat([this.toSign(i.key,d),new Uint8Array([n]),I.writeNumber(r.length,4),r])}case i.subkeyBinding:case i.subkeyRevocation:case i.keyBinding:return I.concat([this.toSign(i.key,d),this.toSign(i.key,{key:d.bind})]);case i.key:if(d.key===void 0)throw new Error("Key packet is required for this signature.");return d.key.writeForHash(this.version);case i.keyRevocation:return this.toSign(i.key,d);case i.timestamp:return new Uint8Array(0);case i.thirdParty:throw new Error("Not implemented");default:throw new Error("Unknown signature type.")}}calculateTrailer(e,d){let i=0;return xe(Fa(this.signatureData),a=>{i+=a.length},()=>{let a=[];return this.version===5&&(this.signatureType===l.signature.binary||this.signatureType===l.signature.text)&&(d?a.push(new Uint8Array(6)):a.push(e.writeHeader())),a.push(new Uint8Array([this.version,255])),this.version===5&&a.push(new Uint8Array(4)),a.push(I.writeNumber(i,4)),I.concat(a)})}toHash(e,d,i=!1){let a=this.toSign(e,d);return I.concat([this.salt||new Uint8Array,a,this.signatureData,this.calculateTrailer(d,i)])}async hash(e,d,i,a=!1){if(this.version===6&&this.salt.length!==fr(this.hashAlgorithm))throw new Error("Signature salt does not have the expected length");return i||(i=this.toHash(e,d,a)),Yt(this.hashAlgorithm,i)}async verify(e,d,i,a=new Date,n=!1,r=J){if(!this.issuerKeyID.equals(e.getKeyID()))throw new Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw new Error("Public key algorithm used to sign signature does not match issuer key algorithm.");let o=d===l.signature.binary||d===l.signature.text;if(!(this[pa]&&!o)){let c,p;if(this.hashed?p=await this.hashed:(c=this.toHash(d,i,n),p=await this.hash(d,i,c)),p=await Ve(p),this.signedHashValue[0]!==p[0]||this.signedHashValue[1]!==p[1])throw new Error("Signed digest did not match");if(this.params=await this.params,this[pa]=await _S(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,c,p),!this[pa])throw new Error("Signature verification failed")}let s=I.normalizeDate(a);if(s&&this.created>s)throw new Error("Signature creation time is in the future");if(s&&s>=this.getExpirationTime())throw new Error("Signature is expired");if(r.rejectHashAlgorithms.has(this.hashAlgorithm))throw new Error("Insecure hash algorithm: "+l.read(l.hash,this.hashAlgorithm).toUpperCase());if(r.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[l.signature.binary,l.signature.text].includes(this.signatureType))throw new Error("Insecure message hash algorithm: "+l.read(l.hash,this.hashAlgorithm).toUpperCase());if(this.unknownSubpackets.forEach(({type:c,critical:p})=>{if(p)throw new Error(`Unknown critical signature subpacket type ${c}`)}),this.rawNotations.forEach(({name:c,critical:p})=>{if(p&&r.knownNotations.indexOf(c)<0)throw new Error(`Unknown critical notation: ${c}`)}),this.revocationKeyClass!==null)throw new Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){let d=I.normalizeDate(e);return d!==null?!(this.created<=d&&d<this.getExpirationTime()):!1}getExpirationTime(){return this.signatureNeverExpires?1/0:new Date(this.created.getTime()+this.signatureExpirationTime*1e3)}};function Ie(t,e,d){let i=[];return i.push(Qn(d.length+1)),i.push(new Uint8Array([(e?128:0)|t])),i.push(d),I.concat(i)}function fr(t){switch(t){case l.hash.sha256:return 16;case l.hash.sha384:return 24;case l.hash.sha512:return 32;case l.hash.sha224:return 16;case l.hash.sha3_256:return 16;case l.hash.sha3_512:return 32;default:throw new Error("Unsupported hash function")}}var Ii=class ll{static get tag(){return l.packet.onePassSignature}static fromSignaturePacket(e,d){let i=new ll;return i.version=e.version===6?6:3,i.signatureType=e.signatureType,i.hashAlgorithm=e.hashAlgorithm,i.publicKeyAlgorithm=e.publicKeyAlgorithm,i.issuerKeyID=e.issuerKeyID,i.salt=e.salt,i.issuerFingerprint=e.issuerFingerprint,i.flags=d?1:0,i}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.salt=null,this.issuerKeyID=null,this.issuerFingerprint=null,this.flags=null}read(e){let d=0;if(this.version=e[d++],this.version!==3&&this.version!==6)throw new Te(`Version ${this.version} of the one-pass signature packet is unsupported.`);if(this.signatureType=e[d++],this.hashAlgorithm=e[d++],this.publicKeyAlgorithm=e[d++],this.version===6){let i=e[d++];this.salt=e.subarray(d,d+i),d+=i,this.issuerFingerprint=e.subarray(d,d+32),d+=32,this.issuerKeyID=new ci,this.issuerKeyID.read(this.issuerFingerprint)}else this.issuerKeyID=new ci,this.issuerKeyID.read(e.subarray(d,d+8)),d+=8;return this.flags=e[d++],this}write(){let e=[new Uint8Array([this.version,this.signatureType,this.hashAlgorithm,this.publicKeyAlgorithm])];return this.version===6?e.push(new Uint8Array([this.salt.length]),this.salt,this.issuerFingerprint):e.push(this.issuerKeyID.write()),e.push(new Uint8Array([this.flags])),I.concatUint8Array(e)}calculateTrailer(...e){return Vd(async()=>It.prototype.calculateTrailer.apply(await this.correspondingSig,e))}async verify(){let e=await this.correspondingSig;if(!e||e.constructor.tag!==l.packet.signature)throw new Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID)||this.version===3&&e.version===6||this.version===6&&e.version!==6||this.version===6&&!I.equalsUint8Array(e.issuerFingerprint,this.issuerFingerprint)||this.version===6&&!I.equalsUint8Array(e.salt,this.salt))throw new Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}};Ii.prototype.hash=It.prototype.hash;Ii.prototype.toHash=It.prototype.toHash;Ii.prototype.toSign=It.prototype.toSign;function F2(t,e){if(!e[t]){let d;try{d=l.read(l.packet,t)}catch{throw new Sp(`Unknown packet type with tag: ${t}`)}throw new Error(`Packet not allowed in this context: ${d}`)}return new e[t]}var Ue=class yn extends Array{static async fromBinary(e,d,i=J){let a=new yn;return await a.read(e,d,i),a}async read(e,d,i=J){i.additionalAllowedPackets.length&&(d={...d,...I.constructAllowedPackets(i.additionalAllowedPackets)}),this.stream=Qd(e,async(n,r)=>{let o=ht(r);try{for(;;)if(await o.ready,await wy(n,async s=>{try{if(s.tag===l.packet.marker||s.tag===l.packet.trust||s.tag===l.packet.padding)return;let c=F2(s.tag,d);c.packets=new yn,c.fromStream=I.isStream(s.packet),await c.read(s.packet,i),await o.write(c)}catch(c){if(c instanceof Sp)if(s.tag<=39)await o.abort(c);else return;let p=!i.ignoreUnsupportedPackets&&c instanceof Te,u=!i.ignoreMalformedPackets&&!(c instanceof Te);if(p||u||sn(s.tag))await o.abort(c);else{let m=new Br(s.tag,s.packet);await o.write(m)}I.printDebugError(c)}})){await o.ready,await o.close();return}}catch(s){await o.abort(s)}});let a=gd(this.stream);for(;;){let{done:n,value:r}=await a.read();if(n?this.stream=null:this.push(r),n||sn(r.constructor.tag))break}a.releaseLock()}write(){let e=[];for(let d=0;d<this.length;d++){let i=this[d]instanceof Br?this[d].tag:this[d].constructor.tag,a=this[d].write();if(I.isStream(a)&&sn(this[d].constructor.tag)){let n=[],r=0,o=512;e.push(En(i)),e.push(xe(a,s=>{if(n.push(s),r+=s.length,r>=o){let c=Math.min(Math.log(r)/Math.LN2|0,30),p=2**c,u=I.concat([Ay(c)].concat(n));return n=[u.subarray(1+p)],r=n[0].length,u.subarray(0,1+p)}},()=>I.concat([Qn(r)].concat(n))))}else{if(I.isStream(a)){let n=0;e.push(xe(Fa(a),r=>{n+=r.length},()=>Fs(i,n)))}else e.push(Fs(i,a.length));e.push(a)}}return I.concat(e)}filterByTag(...e){let d=new yn,i=a=>n=>a===n;for(let a=0;a<this.length;a++)e.some(i(this[a].constructor.tag))&&d.push(this[a]);return d}findPacket(e){return this.find(d=>d.constructor.tag===e)}indexOfTag(...e){let d=[],i=this,a=n=>r=>n===r;for(let n=0;n<this.length;n++)e.some(a(i[n].constructor.tag))&&d.push(n);return d}},E2=I.constructAllowedPackets([Nn,Ii,It]),ul=class{static get tag(){return l.packet.compressedData}constructor(t=J){this.packets=null,this.algorithm=t.preferredCompressionAlgorithm,this.compressed=null}async read(t,e=J){await ho(t,async d=>{this.algorithm=await d.readByte(),this.compressed=d.remainder(),await this.decompress(e)})}write(){return this.compressed===null&&this.compress(),I.concat([new Uint8Array([this.algorithm]),this.compressed])}async decompress(t=J){let e=l.read(l.compression,this.algorithm),d=X2[e];if(!d)throw new Error(`${e} decompression not supported`);this.packets=await Ue.fromBinary(await d(this.compressed),E2,t)}compress(){let t=l.read(l.compression,this.algorithm),e=C2[t];if(!e)throw new Error(`${t} compression not supported`);this.compressed=e(this.packets.write())}};function An(t,e){return d=>{if(!I.isStream(d)||qe(d))return Vd(()=>Ve(d).then(n=>new Promise((r,o)=>{let s=new e;s.ondata=c=>{r(c)};try{s.push(n,!0)}catch(c){o(c)}})));if(t)try{let n=t();return d.pipeThrough(n)}catch(n){if(n.name!=="TypeError")throw n}let i=d.getReader(),a=new e;return new ReadableStream({async start(n){for(a.ondata=async(r,o)=>{n.enqueue(r),o&&n.close()};;){let{done:r,value:o}=await i.read();if(r){a.push(new Uint8Array,!0);return}else o.length&&a.push(o)}}})}}function v2(){return async function(t){let{decode:e}=await Promise.resolve().then(function(){return ng});return Vd(async()=>e(await Ve(t)))}}var wn=t=>({compressor:typeof CompressionStream<"u"&&(()=>new CompressionStream(t)),decompressor:typeof DecompressionStream<"u"&&(()=>new DecompressionStream(t))}),C2={zip:An(wn("deflate-raw").compressor,Zr),zlib:An(wn("deflate").compressor,g2)},X2={uncompressed:t=>t,zip:An(wn("deflate-raw").decompressor,mn),zlib:An(wn("deflate").decompressor,h2),bzip2:v2()},T2=I.constructAllowedPackets([Nn,ul,Ii,It]),to=class ml{static get tag(){return l.packet.symEncryptedIntegrityProtectedData}static fromObject({version:e,aeadAlgorithm:d}){if(e!==1&&e!==2)throw new Error("Unsupported SEIPD version");let i=new ml;return i.version=e,e===2&&(i.aeadAlgorithm=d),i}constructor(){this.version=null,this.cipherAlgorithm=null,this.aeadAlgorithm=null,this.chunkSizeByte=null,this.salt=null,this.encrypted=null,this.packets=null}async read(e){await ho(e,async d=>{if(this.version=await d.readByte(),this.version!==1&&this.version!==2)throw new Te(`Version ${this.version} of the SEIP packet is unsupported.`);this.version===2&&(this.cipherAlgorithm=await d.readByte(),this.aeadAlgorithm=await d.readByte(),this.chunkSizeByte=await d.readByte(),this.salt=await d.readBytes(32)),this.encrypted=d.remainder()})}write(){return this.version===2?I.concat([new Uint8Array([this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte]),this.salt,this.encrypted]):I.concat([new Uint8Array([this.version]),this.encrypted])}async encrypt(e,d,i=J){let{blockSize:a,keySize:n}=Ce(e);if(d.length!==n)throw new Error("Unexpected session key size");let r=this.packets.write();if(qe(r)&&(r=await Ve(r)),this.version===2)this.cipherAlgorithm=e,this.salt=Je(32),this.chunkSizeByte=i.aeadChunkSizeByte,this.encrypted=await Hs(this,"encrypt",d,r);else{let o=await wS(e),s=new Uint8Array([211,20]),c=I.concat([o,r,s]),p=await Yt(l.hash.sha1,ha(c)),u=I.concat([c,p]);this.encrypted=await qo(e,d,u,new Uint8Array(a))}return!0}async decrypt(e,d,i=J){if(d.length!==Ce(e).keySize)throw new Error("Unexpected session key size");let a=Fa(this.encrypted);qe(a)&&(a=await Ve(a));let n;if(this.version===2){if(this.cipherAlgorithm!==e)throw new Error("Unexpected session key algorithm");n=await Hs(this,"decrypt",d,a)}else{let{blockSize:r}=Ce(e),o=await Bo(e,d,a,new Uint8Array(r)),s=Ye(ha(o),-20),c=Ye(o,0,-20),p=Promise.all([Ve(await Yt(l.hash.sha1,ha(c))),Ve(s)]).then(([m,S])=>{if(!I.equalsUint8Array(m,S))throw new Error("Modification detected.");return new Uint8Array}),u=Ye(c,r+2);n=Ye(u,0,-2),n=ut([n,Vd(()=>p)]),(!I.isStream(a)||!i.allowUnauthenticatedStream)&&(n=await Ve(n))}return this.packets=await Ue.fromBinary(n,T2,i),!0}};async function Hs(t,e,d,i){let a=t instanceof to&&t.version===2,n=!a&&t.constructor.tag===l.packet.aeadEncryptedData;if(!a&&!n)throw new Error("Unexpected packet type");let r=si(t.aeadAlgorithm,n),o=e==="decrypt"?r.tagLength:0,s=e==="encrypt"?r.tagLength:0,c=2**(t.chunkSizeByte+6)+o,p=n?8:0,u=new ArrayBuffer(13+p),m=new Uint8Array(u,0,5+p),S=new Uint8Array(u),g=new DataView(u),y=new Uint8Array(u,5,8);m.set([192|t.constructor.tag,t.version,t.cipherAlgorithm,t.aeadAlgorithm,t.chunkSizeByte],0);let P=0,f=Promise.resolve(),E=0,v=0,F,D;if(a){let{keySize:X}=Ce(t.cipherAlgorithm),{ivLength:b}=r,T=new Uint8Array(u,0,5),C=await qd(l.hash.sha256,d,t.salt,T,X+b);d=C.subarray(0,X),F=C.subarray(X),F.fill(0,F.length-8),D=new DataView(F.buffer,F.byteOffset,F.byteLength)}else F=t.iv;let h=await r(t.cipherAlgorithm,d);return Qd(i,async(X,b)=>{if(I.isStream(X)!=="array"){let R=new TransformStream({},{highWaterMark:I.getHardwareConcurrency()*2**(t.chunkSizeByte+6),size:M=>M.length});hi(R.readable,b),b=R.writable}let T=gd(X),C=ht(b);try{for(;;){let R=await T.readBytes(c+o)||new Uint8Array,M=R.subarray(R.length-o);R=R.subarray(0,R.length-o);let x,N,w;if(a)w=F;else{w=F.slice();for(let A=0;A<8;A++)w[F.length-8+A]^=y[A]}if(!P||R.length?(T.unshift(M),x=h[e](R,w,m),x.catch(()=>{}),v+=R.length-o+s):(g.setInt32(5+p+4,E),x=h[e](M,w,S),x.catch(()=>{}),v+=s,N=!0),E+=R.length-o,f=f.then(()=>x).then(async A=>{await C.ready,await C.write(A),v-=A.length}).catch(A=>C.abort(A)),(N||v>C.desiredSize)&&await f,!N)a?D.setInt32(F.length-4,++P):g.setInt32(9,++P);else{await C.close();break}}}catch(R){await C.ready.catch(()=>{}),await C.abort(R)}})}var Ws=class yl{static get tag(){return l.packet.publicKeyEncryptedSessionKey}constructor(){this.version=null,this.publicKeyID=new ci,this.publicKeyVersion=null,this.publicKeyFingerprint=null,this.publicKeyAlgorithm=null,this.sessionKey=null,this.sessionKeyAlgorithm=null,this.encrypted={}}static fromObject({version:e,encryptionKeyPacket:d,anonymousRecipient:i,sessionKey:a,sessionKeyAlgorithm:n}){let r=new yl;if(e!==3&&e!==6)throw new Error("Unsupported PKESK version");return r.version=e,e===6&&(r.publicKeyVersion=i?null:d.version,r.publicKeyFingerprint=i?null:d.getFingerprintBytes()),r.publicKeyID=i?ci.wildcard():d.getKeyID(),r.publicKeyAlgorithm=d.algorithm,r.sessionKey=a,r.sessionKeyAlgorithm=n,r}read(e){let d=0;if(this.version=e[d++],this.version!==3&&this.version!==6)throw new Te(`Version ${this.version} of the PKESK packet is unsupported.`);if(this.version===6){let i=e[d++];if(i){this.publicKeyVersion=e[d++];let a=i-1;this.publicKeyFingerprint=e.subarray(d,d+a),d+=a,this.publicKeyVersion>=5?this.publicKeyID.read(this.publicKeyFingerprint):this.publicKeyID.read(this.publicKeyFingerprint.subarray(-8))}else this.publicKeyID=ci.wildcard()}else d+=this.publicKeyID.read(e.subarray(d,d+8));if(this.publicKeyAlgorithm=e[d++],this.encrypted=DS(this.publicKeyAlgorithm,e.subarray(d)),this.publicKeyAlgorithm===l.publicKey.x25519||this.publicKeyAlgorithm===l.publicKey.x448){if(this.version===3)this.sessionKeyAlgorithm=l.write(l.symmetric,this.encrypted.C.algorithm);else if(this.encrypted.C.algorithm!==null)throw new Error("Unexpected cleartext symmetric algorithm")}}write(){let e=[new Uint8Array([this.version])];return this.version===6?this.publicKeyFingerprint!==null?(e.push(new Uint8Array([this.publicKeyFingerprint.length+1,this.publicKeyVersion])),e.push(this.publicKeyFingerprint)):e.push(new Uint8Array([0])):e.push(this.publicKeyID.write()),e.push(new Uint8Array([this.publicKeyAlgorithm]),Hi(this.publicKeyAlgorithm,this.encrypted)),I.concatUint8Array(e)}async encrypt(e){let d=l.write(l.publicKey,this.publicKeyAlgorithm),i=this.version===3?this.sessionKeyAlgorithm:null,a=e.version===5?e.getFingerprintBytes().subarray(0,20):e.getFingerprintBytes(),n=Ks(this.version,d,i,this.sessionKey);this.encrypted=await CS(d,i,e.publicParams,n,a)}async decrypt(e,d){if(this.publicKeyAlgorithm!==e.algorithm)throw new Error("Decryption error");let i=d?Ks(this.version,this.publicKeyAlgorithm,d.sessionKeyAlgorithm,d.sessionKey):null,a=e.version===5?e.getFingerprintBytes().subarray(0,20):e.getFingerprintBytes(),n=await XS(this.publicKeyAlgorithm,e.publicParams,e.privateParams,this.encrypted,a,i),{sessionKey:r,sessionKeyAlgorithm:o}=D2(this.version,this.publicKeyAlgorithm,n,d);if(this.version===3){let s=this.publicKeyAlgorithm!==l.publicKey.x25519&&this.publicKeyAlgorithm!==l.publicKey.x448;if(this.sessionKeyAlgorithm=s?o:this.sessionKeyAlgorithm,r.length!==Ce(this.sessionKeyAlgorithm).keySize)throw new Error("Unexpected session key size")}this.sessionKey=r}};function Ks(t,e,d,i){switch(e){case l.publicKey.rsaEncrypt:case l.publicKey.rsaEncryptSign:case l.publicKey.elgamal:case l.publicKey.ecdh:return I.concatUint8Array([new Uint8Array(t===6?[]:[d]),i,I.writeChecksum(i.subarray(i.length%8))]);case l.publicKey.x25519:case l.publicKey.x448:return i;default:throw new Error("Unsupported public key algorithm")}}function D2(t,e,d,i){switch(e){case l.publicKey.rsaEncrypt:case l.publicKey.rsaEncryptSign:case l.publicKey.elgamal:case l.publicKey.ecdh:{let a=d.subarray(0,d.length-2),n=d.subarray(d.length-2),r=I.writeChecksum(a.subarray(a.length%8)),o=r[0]===n[0]&r[1]===n[1],s=t===6?{sessionKeyAlgorithm:null,sessionKey:a}:{sessionKeyAlgorithm:a[0],sessionKey:a.subarray(1)};if(i){let c=o&s.sessionKeyAlgorithm===i.sessionKeyAlgorithm&s.sessionKey.length===i.sessionKey.length;return{sessionKey:I.selectUint8Array(c,s.sessionKey,i.sessionKey),sessionKeyAlgorithm:t===6?null:I.selectUint8(c,s.sessionKeyAlgorithm,i.sessionKeyAlgorithm)}}else{if(o&&(t===6||l.read(l.symmetric,s.sessionKeyAlgorithm)))return s;throw new Error("Decryption error")}}case l.publicKey.x25519:case l.publicKey.x448:return{sessionKeyAlgorithm:null,sessionKey:d};default:throw new Error("Unsupported public key algorithm")}}var Sl=class io{static get tag(){return l.packet.symEncryptedSessionKey}constructor(e=J){this.version=e.aeadProtect?6:4,this.sessionKey=null,this.sessionKeyEncryptionAlgorithm=null,this.sessionKeyAlgorithm=null,this.aeadAlgorithm=l.write(l.aead,e.preferredAEADAlgorithm),this.encrypted=null,this.s2k=null,this.iv=null}read(e){let d=0;if(this.version=e[d++],this.version!==4&&this.version!==5&&this.version!==6)throw new Te(`Version ${this.version} of the SKESK packet is unsupported.`);this.version===6&&d++;let i=e[d++];this.version>=5&&(this.aeadAlgorithm=e[d++],this.version===6&&d++);let a=e[d++];if(this.s2k=Rn(a),d+=this.s2k.read(e.subarray(d,e.length)),this.version>=5){let n=si(this.aeadAlgorithm,!0);this.iv=e.subarray(d,d+=n.ivLength)}this.version>=5||d<e.length?(this.encrypted=e.subarray(d,e.length),this.sessionKeyEncryptionAlgorithm=i):this.sessionKeyAlgorithm=i}write(){let e=this.encrypted===null?this.sessionKeyAlgorithm:this.sessionKeyEncryptionAlgorithm,d,i=this.s2k.write();if(this.version===6){let a=i.length,n=3+a+this.iv.length;d=I.concatUint8Array([new Uint8Array([this.version,n,e,this.aeadAlgorithm,a]),i,this.iv,this.encrypted])}else this.version===5?d=I.concatUint8Array([new Uint8Array([this.version,e,this.aeadAlgorithm]),i,this.iv,this.encrypted]):(d=I.concatUint8Array([new Uint8Array([this.version,e]),i]),this.encrypted!==null&&(d=I.concatUint8Array([d,this.encrypted])));return d}async decrypt(e){let d=this.sessionKeyEncryptionAlgorithm!==null?this.sessionKeyEncryptionAlgorithm:this.sessionKeyAlgorithm,{blockSize:i,keySize:a}=Ce(d),n=await this.s2k.produceKey(e,a);if(this.version>=5){let r=si(this.aeadAlgorithm,!0),o=new Uint8Array([192|io.tag,this.version,this.sessionKeyEncryptionAlgorithm,this.aeadAlgorithm]),s=this.version===6?await qd(l.hash.sha256,n,new Uint8Array,o,a):n,c=await r(d,s);this.sessionKey=await c.decrypt(this.encrypted,this.iv,o)}else if(this.encrypted!==null){let r=await Bo(d,n,this.encrypted,new Uint8Array(i));if(this.sessionKeyAlgorithm=l.write(l.symmetric,r[0]),this.sessionKey=r.subarray(1,r.length),this.sessionKey.length!==Ce(this.sessionKeyAlgorithm).keySize)throw new Error("Unexpected session key size")}else this.sessionKey=n}async encrypt(e,d=J){let i=this.sessionKeyEncryptionAlgorithm!==null?this.sessionKeyEncryptionAlgorithm:this.sessionKeyAlgorithm;this.sessionKeyEncryptionAlgorithm=i,this.s2k=al(d),this.s2k.generateSalt();let{blockSize:a,keySize:n}=Ce(i),r=await this.s2k.produceKey(e,n);if(this.sessionKey===null&&(this.sessionKey=zr(this.sessionKeyAlgorithm)),this.version>=5){let o=si(this.aeadAlgorithm);this.iv=Je(o.ivLength);let s=new Uint8Array([192|io.tag,this.version,this.sessionKeyEncryptionAlgorithm,this.aeadAlgorithm]),c=this.version===6?await qd(l.hash.sha256,r,new Uint8Array,s,n):r,p=await o(i,c);this.encrypted=await p.encrypt(this.sessionKey,this.iv,s)}else{let o=I.concatUint8Array([new Uint8Array([this.sessionKeyAlgorithm]),this.sessionKey]);this.encrypted=await qo(i,r,o,new Uint8Array(a))}}},jd=class Pl{static get tag(){return l.packet.publicKey}constructor(e=new Date,d=J){this.version=d.v6Keys?6:4,this.created=I.normalizeDate(e),this.algorithm=null,this.publicParams=null,this.expirationTimeV3=0,this.fingerprint=null,this.keyID=null}static fromSecretKeyPacket(e){let d=new Pl,{version:i,created:a,algorithm:n,publicParams:r,keyID:o,fingerprint:s}=e;return d.version=i,d.created=a,d.algorithm=n,d.publicParams=r,d.keyID=o,d.fingerprint=s,d}async read(e,d=J){let i=0;if(this.version=e[i++],this.version===5&&!d.enableParsingV5Entities)throw new Te("Support for parsing v5 entities is disabled; turn on `config.enableParsingV5Entities` if needed");if(this.version===4||this.version===5||this.version===6){this.created=I.readDate(e.subarray(i,i+4)),i+=4,this.algorithm=e[i++],this.version>=5&&(i+=4);let{read:a,publicParams:n}=TS(this.algorithm,e.subarray(i));if(this.version===6&&n.oid&&(n.oid.getName()===l.curve.curve25519Legacy||n.oid.getName()===l.curve.ed25519Legacy))throw new Error("Legacy curve25519 cannot be used with v6 keys");return this.publicParams=n,i+=a,await this.computeFingerprintAndKeyID(),i}throw new Te(`Version ${this.version} of the key packet is unsupported.`)}write(){let e=[];e.push(new Uint8Array([this.version])),e.push(I.writeDate(this.created)),e.push(new Uint8Array([this.algorithm]));let d=Hi(this.algorithm,this.publicParams);return this.version>=5&&e.push(I.writeNumber(d.length,4)),e.push(d),I.concatUint8Array(e)}writeForHash(e){let d=this.writePublicKey(),i=149+e,a=e>=5?4:2;return I.concatUint8Array([new Uint8Array([i]),I.writeNumber(d.length,a),d])}isDecrypted(){return null}getCreationTime(){return this.created}getKeyID(){return this.keyID}async computeFingerprintAndKeyID(){if(await this.computeFingerprint(),this.keyID=new ci,this.version>=5)this.keyID.read(this.fingerprint.subarray(0,8));else if(this.version===4)this.keyID.read(this.fingerprint.subarray(12,20));else throw new Error("Unsupported key version")}async computeFingerprint(){let e=this.writeForHash(this.version);if(this.version>=5)this.fingerprint=await Yt(l.hash.sha256,e);else if(this.version===4)this.fingerprint=await Yt(l.hash.sha1,e);else throw new Error("Unsupported key version")}getFingerprintBytes(){return this.fingerprint}getFingerprint(){return I.uint8ArrayToHex(this.getFingerprintBytes())}hasSameFingerprintAs(e){return this.version===e.version&&I.equalsUint8Array(this.writePublicKey(),e.writePublicKey())}getAlgorithmInfo(){let e={};e.algorithm=l.read(l.publicKey,this.algorithm);let d=this.publicParams.n||this.publicParams.p;return d?e.bits=I.uint8ArrayBitLength(d):this.publicParams.oid&&(e.curve=this.publicParams.oid.getName()),e}};jd.prototype.readPublicKey=jd.prototype.read;jd.prototype.writePublicKey=jd.prototype.write;var gl=class hl extends jd{static get tag(){return l.packet.publicSubkey}constructor(e,d){super(e,d)}static fromSecretSubkeyPacket(e){let d=new hl,{version:i,created:a,algorithm:n,publicParams:r,keyID:o,fingerprint:s}=e;return d.version=i,d.created=a,d.algorithm=n,d.publicParams=r,d.keyID=o,d.fingerprint=s,d}},R2=class fl{static get tag(){return l.packet.userAttribute}constructor(){this.attributes=[]}read(e){let d=0;for(;d<e.length;){let i=mp(e.subarray(d,e.length));d+=i.offset,this.attributes.push(I.uint8ArrayToString(e.subarray(d,d+i.len))),d+=i.len}}write(){let e=[];for(let d=0;d<this.attributes.length;d++)e.push(Qn(this.attributes[d].length)),e.push(I.stringToUint8Array(this.attributes[d]));return I.concatUint8Array(e)}equals(e){return!e||!(e instanceof fl)?!1:this.attributes.every(function(d,i){return d===e.attributes[i]})}},Il=class extends jd{static get tag(){return l.packet.secretKey}constructor(t=new Date,e=J){super(t,e),this.keyMaterial=null,this.isEncrypted=null,this.s2kUsage=0,this.s2k=null,this.symmetric=null,this.aead=null,this.isLegacyAEAD=null,this.privateParams=null,this.usedModernAEAD=null}async read(t,e=J){let d=await this.readPublicKey(t,e),i=d;this.s2kUsage=t[d++],this.version===5&&d++,this.version===6&&this.s2kUsage&&d++;try{if(this.s2kUsage===255||this.s2kUsage===254||this.s2kUsage===253){this.symmetric=t[d++],this.s2kUsage===253&&(this.aead=t[d++]),this.version===6&&d++;let a=t[d++];if(this.s2k=Rn(a),d+=this.s2k.read(t.subarray(d,t.length)),this.s2k.type==="gnu-dummy")return}else this.s2kUsage&&(this.symmetric=this.s2kUsage);this.s2kUsage&&(this.isLegacyAEAD=this.s2kUsage===253&&(this.version===5||this.version===4&&e.parseAEADEncryptedV4KeysAsLegacy),this.s2kUsage!==253||this.isLegacyAEAD?(this.iv=t.subarray(d,d+Ce(this.symmetric).blockSize),this.usedModernAEAD=!1):(this.iv=t.subarray(d,d+si(this.aead).ivLength),this.usedModernAEAD=!0),d+=this.iv.length)}catch(a){if(!this.s2kUsage)throw a;this.unparseableKeyMaterial=t.subarray(i),this.isEncrypted=!0}if(this.version===5&&(d+=4),this.keyMaterial=t.subarray(d),this.isEncrypted=!!this.s2kUsage,!this.isEncrypted){let a;if(this.version===6)a=this.keyMaterial;else if(a=this.keyMaterial.subarray(0,-2),!I.equalsUint8Array(I.writeChecksum(a),this.keyMaterial.subarray(-2)))throw new Error("Key checksum mismatch");try{let{read:n,privateParams:r}=Ms(this.algorithm,a,this.publicParams);if(n<a.length)throw new Error("Error reading MPIs");this.privateParams=r}catch(n){throw n instanceof Te?n:new Error("Error reading MPIs")}}}write(){let t=this.writePublicKey();if(this.unparseableKeyMaterial)return I.concatUint8Array([t,this.unparseableKeyMaterial]);let e=[t];e.push(new Uint8Array([this.s2kUsage]));let d=[];if(this.s2kUsage===255||this.s2kUsage===254||this.s2kUsage===253){d.push(this.symmetric),this.s2kUsage===253&&d.push(this.aead);let i=this.s2k.write();this.version===6&&d.push(i.length),d.push(...i)}return this.s2kUsage&&this.s2k.type!=="gnu-dummy"&&d.push(...this.iv),(this.version===5||this.version===6&&this.s2kUsage)&&e.push(new Uint8Array([d.length])),e.push(new Uint8Array(d)),this.isDummy()||(this.s2kUsage||(this.keyMaterial=Hi(this.algorithm,this.privateParams)),this.version===5&&e.push(I.writeNumber(this.keyMaterial.length,4)),e.push(this.keyMaterial),!this.s2kUsage&&this.version!==6&&e.push(I.writeChecksum(this.keyMaterial))),I.concatUint8Array(e)}isDecrypted(){return this.isEncrypted===!1}isMissingSecretKeyMaterial(){return this.unparseableKeyMaterial!==void 0||this.isDummy()}isDummy(){return!!(this.s2k&&this.s2k.type==="gnu-dummy")}makeDummy(t=J){this.isDummy()||(this.isDecrypted()&&this.clearPrivateParams(),delete this.unparseableKeyMaterial,this.isEncrypted=null,this.keyMaterial=null,this.s2k=Rn(l.s2k.gnu,t),this.s2k.algorithm=0,this.s2k.c=0,this.s2k.type="gnu-dummy",this.s2kUsage=254,this.symmetric=l.symmetric.aes256,this.isLegacyAEAD=null,this.usedModernAEAD=null)}async encrypt(t,e=J){if(this.isDummy())return;if(!this.isDecrypted())throw new Error("Key packet is already encrypted");if(!t)throw new Error("A non-empty passphrase is required for key encryption.");this.s2k=al(e),this.s2k.generateSalt();let d=Hi(this.algorithm,this.privateParams);this.symmetric=l.symmetric.aes256;let{blockSize:i}=Ce(this.symmetric);if(e.aeadProtect){this.s2kUsage=253,this.aead=e.preferredAEADAlgorithm;let a=si(this.aead);this.isLegacyAEAD=this.version===5,this.usedModernAEAD=!this.isLegacyAEAD;let n=En(this.constructor.tag),r=await Ir(this.version,this.s2k,t,this.symmetric,this.aead,n,this.isLegacyAEAD),o=await a(this.symmetric,r);this.iv=this.isLegacyAEAD?Je(i):Je(a.ivLength);let s=this.isLegacyAEAD?new Uint8Array:I.concatUint8Array([n,this.writePublicKey()]);this.keyMaterial=await o.encrypt(d,this.iv.subarray(0,a.ivLength),s)}else{this.s2kUsage=254,this.usedModernAEAD=!1;let a=await Ir(this.version,this.s2k,t,this.symmetric);this.iv=Je(i),this.keyMaterial=await qo(this.symmetric,a,I.concatUint8Array([d,await Yt(l.hash.sha1,d)]),this.iv)}}async decrypt(t){if(this.isDummy())return!1;if(this.unparseableKeyMaterial)throw new Error("Key packet cannot be decrypted: unsupported S2K or cipher algo");if(this.isDecrypted())throw new Error("Key packet is already decrypted.");let e,d=En(this.constructor.tag);if(this.s2kUsage===254||this.s2kUsage===253)e=await Ir(this.version,this.s2k,t,this.symmetric,this.aead,d,this.isLegacyAEAD);else throw this.s2kUsage===255?new Error("Encrypted private key is authenticated using an insecure two-byte hash"):new Error("Private key is encrypted using an insecure S2K function: unsalted MD5");let i;if(this.s2kUsage===253){let a=si(this.aead,!0),n=await a(this.symmetric,e);try{let r=this.isLegacyAEAD?new Uint8Array:I.concatUint8Array([d,this.writePublicKey()]);i=await n.decrypt(this.keyMaterial,this.iv.subarray(0,a.ivLength),r)}catch(r){throw r.message==="Authentication tag mismatch"?new Error("Incorrect key passphrase: "+r.message):r}}else{let a=await Bo(this.symmetric,e,this.keyMaterial,this.iv);i=a.subarray(0,-20);let n=await Yt(l.hash.sha1,i);if(!I.equalsUint8Array(n,a.subarray(-20)))throw new Error("Incorrect key passphrase")}try{let{privateParams:a}=Ms(this.algorithm,i,this.publicParams);this.privateParams=a}catch{throw new Error("Error reading MPIs")}this.isEncrypted=!1,this.keyMaterial=null,this.s2kUsage=0,this.aead=null,this.symmetric=null,this.isLegacyAEAD=null}async validate(){if(this.isDummy())return;if(!this.isDecrypted())throw new Error("Key is not decrypted");if(this.usedModernAEAD)return;let t;try{t=await NS(this.algorithm,this.publicParams,this.privateParams)}catch{t=!1}if(!t)throw new Error("Key is invalid")}async generate(t,e){if(this.version===6&&(this.algorithm===l.publicKey.ecdh&&e===l.curve.curve25519Legacy||this.algorithm===l.publicKey.eddsaLegacy))throw new Error(`Cannot generate v6 keys of type 'ecc' with curve ${e}. Generate a key of type 'curve25519' instead`);let{privateParams:d,publicParams:i}=await RS(this.algorithm,t,e);this.privateParams=d,this.publicParams=i,this.isEncrypted=!1}clearPrivateParams(){this.isMissingSecretKeyMaterial()||(Object.keys(this.privateParams).forEach(t=>{this.privateParams[t].fill(0),delete this.privateParams[t]}),this.privateParams=null,this.isEncrypted=!0)}};async function Ir(t,e,d,i,a,n,r){if(e.type==="argon2"&&!a)throw new Error("Using Argon2 S2K without AEAD is not allowed");if(e.type==="simple"&&t===6)throw new Error("Using Simple S2K with version 6 keys is not allowed");let{keySize:o}=Ce(i),s=await e.produceKey(d,o);if(!a||t===5||r)return s;let c=I.concatUint8Array([n,new Uint8Array([t,i,a])]);return qd(l.hash.sha256,s,new Uint8Array,c,o)}var N2=class bl{static get tag(){return l.packet.userID}constructor(){this.userID="",this.name="",this.email="",this.comment=""}static fromObject(e){if(I.isString(e)||e.name&&!I.isString(e.name)||e.email&&!I.isEmailAddress(e.email)||e.comment&&!I.isString(e.comment))throw new Error("Invalid user ID format");let d=new bl;Object.assign(d,e);let i=[];return d.name&&i.push(d.name),d.comment&&i.push(`(${d.comment})`),d.email&&i.push(`<${d.email}>`),d.userID=i.join(" "),d}read(e,d=J){let i=I.decodeUTF8(e);if(i.length>d.maxUserIDLength)throw new Error("User ID string is too long");let a=/^(?<name>[^()]+\s+)?(?<comment>\([^()]+\)\s+)?(?<email><\S+@\S+>)$/.exec(i);if(a!==null){let{name:n,comment:r,email:o}=a.groups;this.comment=r?.replace(/^\(|\)|\s$/g,"").trim()||"",this.name=n?.trim()||"",this.email=o.substring(1,o.length-1)}else/^[^\s@]+@[^\s@]+$/.test(i)&&(this.email=i);this.userID=i}write(){return I.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}},Fl=class extends Il{static get tag(){return l.packet.secretSubkey}constructor(t=new Date,e=J){super(t,e)}},Gi=class{constructor(t){this.packets=t||new Ue}write(){return this.packets.write()}armor(t=J){let e=this.packets.some(d=>d.constructor.tag===It.tag&&d.version!==6);return Zi(l.armor.signature,this.write(),void 0,void 0,void 0,e,t)}getSigningKeyIDs(){return this.packets.map(t=>t.issuerKeyID)}};async function A2(t,e){let d=new Fl(t.date,e);return d.packets=null,d.algorithm=l.write(l.publicKey,t.algorithm),await d.generate(t.rsaBits,t.curve),await d.computeFingerprintAndKeyID(),d}async function Nt(t,e,d,i,a=new Date,n){let r,o;for(let s=t.length-1;s>=0;s--)try{(!r||t[s].created>=r.created)&&(await t[s].verify(e,d,i,a,void 0,n),r=t[s])}catch(c){o=c}if(!r)throw I.wrapError(`Could not find valid ${l.read(l.signature,d)} signature in key ${e.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,(s,c,p)=>c+" "+p.toLowerCase()),o);return r}function ao(t,e,d=new Date){let i=I.normalizeDate(d);if(i!==null){let a=Mn(t,e);return!(t.created<=i&&i<a)}return!1}async function w2(t,e,d,i){let a={};a.key=e,a.bind=t;let n={signatureType:l.signature.subkeyBinding};return d.sign?(n.keyFlags=[l.keyFlags.signData],n.embeddedSignature=await yi(a,[],t,{signatureType:l.signature.keyBinding},d.date,void 0,void 0,void 0,i)):n.keyFlags=[l.keyFlags.encryptCommunication|l.keyFlags.encryptStorage],d.keyExpirationTime>0&&(n.keyExpirationTime=d.keyExpirationTime,n.keyNeverExpires=!1),await yi(a,[],e,n,d.date,void 0,void 0,void 0,i)}async function M2(t,e,d=new Date,i=[],a){let n=l.hash.sha256,r=a.preferredHashAlgorithm,o=await Promise.all(t.map(async(u,m)=>(await u.getPrimarySelfSignature(d,i[m],a)).preferredHashAlgorithms||[])),s=new Map;for(let u of o)for(let m of u)try{let S=l.write(l.hash,m);s.set(S,s.has(S)?s.get(S)+1:1)}catch{}let c=u=>t.length===0||s.get(u)===t.length||u===n,p=()=>{if(s.size===0)return n;let u=Array.from(s.keys()).filter(m=>c(m)).sort((m,S)=>je(m)-je(S))[0];return je(u)>=je(n)?u:n};if(new Set([l.publicKey.ecdsa,l.publicKey.eddsaLegacy,l.publicKey.ed25519,l.publicKey.ed448]).has(e.algorithm)){let u=AS(e.algorithm,e.publicParams.oid),m=c(r),S=je(r)>=je(u);if(m&&S)return r;{let g=p();return je(g)>=je(u)?g:u}}return c(r)?r:p()}async function x2(t=[],e=new Date,d=[],i=J){let a=await Promise.all(t.map((o,s)=>o.getPrimarySelfSignature(e,d[s],i)));if(t.length?a.every(o=>o.features&&o.features[0]&l.features.seipdv2):i.aeadProtect){let o={symmetricAlgo:l.symmetric.aes128,aeadAlgo:l.aead.ocb},s=[{symmetricAlgo:i.preferredSymmetricAlgorithm,aeadAlgo:i.preferredAEADAlgorithm},{symmetricAlgo:i.preferredSymmetricAlgorithm,aeadAlgo:l.aead.ocb},{symmetricAlgo:l.symmetric.aes128,aeadAlgo:i.preferredAEADAlgorithm}];for(let c of s)if(a.every(p=>p.preferredCipherSuites&&p.preferredCipherSuites.some(u=>u[0]===c.symmetricAlgo&&u[1]===c.aeadAlgo)))return c;return o}let n=l.symmetric.aes128,r=i.preferredSymmetricAlgorithm;return{symmetricAlgo:a.every(o=>o.preferredSymmetricAlgorithms&&o.preferredSymmetricAlgorithms.includes(r))?r:n,aeadAlgo:void 0}}async function yi(t,e,d,i,a,n,r=[],o=!1,s){if(d.isDummy())throw new Error("Cannot sign with a gnu-dummy key.");if(!d.isDecrypted())throw new Error("Signing key is not decrypted.");let c=new It;return Object.assign(c,i),c.publicKeyAlgorithm=d.algorithm,c.hashAlgorithm=await M2(e,d,a,n,s),c.rawNotations=[...r],await c.sign(d,t,a,o,s),c}async function pi(t,e,d,i=new Date,a){t=t[d],t&&(e[d].length?await Promise.all(t.map(async function(n){!n.isExpired(i)&&(!a||await a(n))&&!e[d].some(function(r){return I.equalsUint8Array(r.writeParams(),n.writeParams())})&&e[d].push(n)})):e[d]=t)}async function Ki(t,e,d,i,a,n,r=new Date,o){n=n||t;let s=[];return await Promise.all(i.map(async function(c){try{if(!a||c.issuerKeyID.equals(a.issuerKeyID)){let p=![l.reasonForRevocation.keyRetired,l.reasonForRevocation.keySuperseded,l.reasonForRevocation.userIDInvalid].includes(c.reasonForRevocationFlag);await c.verify(n,e,d,p?null:r,!1,o),s.push(c.issuerKeyID)}}catch{}})),a?(a.revoked=s.some(c=>c.equals(a.issuerKeyID))?!0:a.revoked||!1,a.revoked):s.length>0}function Mn(t,e){let d;return e.keyNeverExpires===!1&&(d=t.created.getTime()+e.keyExpirationTime*1e3),d?new Date(d):1/0}function L2(t,e={}){switch(t.type=t.type||e.type,t.curve=t.curve||e.curve,t.rsaBits=t.rsaBits||e.rsaBits,t.keyExpirationTime=t.keyExpirationTime!==void 0?t.keyExpirationTime:e.keyExpirationTime,t.passphrase=I.isString(t.passphrase)?t.passphrase:e.passphrase,t.date=t.date||e.date,t.sign=t.sign||!1,t.type){case"ecc":try{t.curve=l.write(l.curve,t.curve)}catch{throw new Error("Unknown curve")}(t.curve===l.curve.ed25519Legacy||t.curve===l.curve.curve25519Legacy||t.curve==="ed25519"||t.curve==="curve25519")&&(t.curve=t.sign?l.curve.ed25519Legacy:l.curve.curve25519Legacy),t.sign?t.algorithm=t.curve===l.curve.ed25519Legacy?l.publicKey.eddsaLegacy:l.publicKey.ecdsa:t.algorithm=l.publicKey.ecdh;break;case"curve25519":t.algorithm=t.sign?l.publicKey.ed25519:l.publicKey.x25519;break;case"curve448":t.algorithm=t.sign?l.publicKey.ed448:l.publicKey.x448;break;case"rsa":t.algorithm=l.publicKey.rsaEncryptSign;break;default:throw new Error(`Unsupported key type ${t.type}`)}return t}function Ys(t,e,d){switch(t.algorithm){case l.publicKey.rsaEncryptSign:case l.publicKey.rsaSign:case l.publicKey.dsa:case l.publicKey.ecdsa:case l.publicKey.eddsaLegacy:case l.publicKey.ed25519:case l.publicKey.ed448:if(!e.keyFlags&&!d.allowMissingKeyFlags)throw new Error("None of the key flags is set: consider passing `config.allowMissingKeyFlags`");return!e.keyFlags||(e.keyFlags[0]&l.keyFlags.signData)!==0;default:return!1}}function _s(t,e,d){switch(t.algorithm){case l.publicKey.rsaEncryptSign:case l.publicKey.rsaEncrypt:case l.publicKey.elgamal:case l.publicKey.ecdh:case l.publicKey.x25519:case l.publicKey.x448:if(!e.keyFlags&&!d.allowMissingKeyFlags)throw new Error("None of the key flags is set: consider passing `config.allowMissingKeyFlags`");return!e.keyFlags||(e.keyFlags[0]&l.keyFlags.encryptCommunication)!==0||(e.keyFlags[0]&l.keyFlags.encryptStorage)!==0;default:return!1}}function Js(t,e,d){if(!e.keyFlags&&!d.allowMissingKeyFlags)throw new Error("None of the key flags is set: consider passing `config.allowMissingKeyFlags`");switch(t.algorithm){case l.publicKey.rsaEncryptSign:case l.publicKey.rsaEncrypt:case l.publicKey.elgamal:case l.publicKey.ecdh:case l.publicKey.x25519:case l.publicKey.x448:return(!e.keyFlags||(e.keyFlags[0]&l.keyFlags.signData)!==0)&&d.allowInsecureDecryptionWithSigningKeys?!0:!e.keyFlags||(e.keyFlags[0]&l.keyFlags.encryptCommunication)!==0||(e.keyFlags[0]&l.keyFlags.encryptStorage)!==0;default:return!1}}function ai(t,e){let d=l.write(l.publicKey,t.algorithm),i=t.getAlgorithmInfo();if(e.rejectPublicKeyAlgorithms.has(d))throw new Error(`${i.algorithm} keys are considered too weak.`);switch(d){case l.publicKey.rsaEncryptSign:case l.publicKey.rsaSign:case l.publicKey.rsaEncrypt:if(i.bits<e.minRSABits)throw new Error(`RSA keys shorter than ${e.minRSABits} bits are considered too weak.`);break;case l.publicKey.ecdsa:case l.publicKey.eddsaLegacy:case l.publicKey.ecdh:if(e.rejectCurves.has(i.curve))throw new Error(`Support for ${i.algorithm} keys using curve ${i.curve} is disabled.`);break}}var O2=class Sn{constructor(e,d){this.userID=e.constructor.tag===l.packet.userID?e:null,this.userAttribute=e.constructor.tag===l.packet.userAttribute?e:null,this.selfCertifications=[],this.otherCertifications=[],this.revocationSignatures=[],this.mainKey=d}toPacketList(){let e=new Ue;return e.push(this.userID||this.userAttribute),e.push(...this.revocationSignatures),e.push(...this.selfCertifications),e.push(...this.otherCertifications),e}clone(){let e=new Sn(this.userID||this.userAttribute,this.mainKey);return e.selfCertifications=[...this.selfCertifications],e.otherCertifications=[...this.otherCertifications],e.revocationSignatures=[...this.revocationSignatures],e}async certify(e,d,i){let a=this.mainKey.keyPacket,n={userID:this.userID,userAttribute:this.userAttribute,key:a},r=new Sn(n.userID||n.userAttribute,this.mainKey);return r.otherCertifications=await Promise.all(e.map(async function(o){if(!o.isPrivate())throw new Error("Need private key for signing");if(o.hasSameFingerprintAs(a))throw new Error("The user's own key can only be used for self-certifications");let s=await o.getSigningKey(void 0,d,void 0,i);return yi(n,[o],s.keyPacket,{signatureType:l.signature.certGeneric,keyFlags:[l.keyFlags.certifyKeys|l.keyFlags.signData]},d,void 0,void 0,void 0,i)})),await r.update(this,d,i),r}async isRevoked(e,d,i=new Date,a=J){let n=this.mainKey.keyPacket;return Ki(n,l.signature.certRevocation,{key:n,userID:this.userID,userAttribute:this.userAttribute},this.revocationSignatures,e,d,i,a)}async verifyCertificate(e,d,i=new Date,a){let n=this,r=this.mainKey.keyPacket,o={userID:this.userID,userAttribute:this.userAttribute,key:r},{issuerKeyID:s}=e,c=d.filter(p=>p.getKeys(s).length>0);return c.length===0?null:(await Promise.all(c.map(async p=>{let u=await p.getSigningKey(s,e.created,void 0,a);if(e.revoked||await n.isRevoked(e,u.keyPacket,i,a))throw new Error("User certificate is revoked");try{await e.verify(u.keyPacket,l.signature.certGeneric,o,i,void 0,a)}catch(m){throw I.wrapError("User certificate is invalid",m)}})),!0)}async verifyAllCertifications(e,d=new Date,i){let a=this,n=this.selfCertifications.concat(this.otherCertifications);return Promise.all(n.map(async r=>({keyID:r.issuerKeyID,valid:await a.verifyCertificate(r,e,d,i).catch(()=>!1)})))}async verify(e=new Date,d){if(!this.selfCertifications.length)throw new Error("No self-certifications found");let i=this,a=this.mainKey.keyPacket,n={userID:this.userID,userAttribute:this.userAttribute,key:a},r;for(let o=this.selfCertifications.length-1;o>=0;o--)try{let s=this.selfCertifications[o];if(s.revoked||await i.isRevoked(s,void 0,e,d))throw new Error("Self-certification is revoked");try{await s.verify(a,l.signature.certGeneric,n,e,void 0,d)}catch(c){throw I.wrapError("Self-certification is invalid",c)}return!0}catch(s){r=s}throw r}async update(e,d,i){let a=this.mainKey.keyPacket,n={userID:this.userID,userAttribute:this.userAttribute,key:a};await pi(e,this,"selfCertifications",d,async function(r){try{return await r.verify(a,l.signature.certGeneric,n,d,!1,i),!0}catch{return!1}}),await pi(e,this,"otherCertifications",d),await pi(e,this,"revocationSignatures",d,function(r){return Ki(a,l.signature.certRevocation,n,[r],void 0,void 0,d,i)})}async revoke(e,{flag:d=l.reasonForRevocation.noReason,string:i=""}={},a=new Date,n=J){let r={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new Sn(r.userID||r.userAttribute,this.mainKey);return o.revocationSignatures.push(await yi(r,[],e,{signatureType:l.signature.certRevocation,reasonForRevocationFlag:l.write(l.reasonForRevocation,d),reasonForRevocationString:i},a,void 0,void 0,!1,n)),await o.update(this),o}},Qo=class no{constructor(e,d){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=d}toPacketList(){let e=new Ue;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){let e=new no(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,d,i=new Date,a=J){let n=this.mainKey.keyPacket;return Ki(n,l.signature.subkeyRevocation,{key:n,bind:this.keyPacket},this.revocationSignatures,e,d,i,a)}async verify(e=new Date,d=J){let i=this.mainKey.keyPacket,a={key:i,bind:this.keyPacket},n=await Nt(this.bindingSignatures,i,l.signature.subkeyBinding,a,e,d);if(n.revoked||await this.isRevoked(n,null,e,d))throw new Error("Subkey is revoked");if(ao(this.keyPacket,n,e))throw new Error("Subkey is expired");return n}async getExpirationTime(e=new Date,d=J){let i=this.mainKey.keyPacket,a={key:i,bind:this.keyPacket},n;try{n=await Nt(this.bindingSignatures,i,l.signature.subkeyBinding,a,e,d)}catch{return null}let r=Mn(this.keyPacket,n),o=n.getExpirationTime();return r<o?r:o}async update(e,d=new Date,i=J){let a=this.mainKey.keyPacket;if(!this.hasSameFingerprintAs(e))throw new Error("Subkey update method: fingerprints of subkeys not equal");this.keyPacket.constructor.tag===l.packet.publicSubkey&&e.keyPacket.constructor.tag===l.packet.secretSubkey&&(this.keyPacket=e.keyPacket);let n=this,r={key:a,bind:n.keyPacket};await pi(e,this,"bindingSignatures",d,async function(o){for(let s=0;s<n.bindingSignatures.length;s++)if(n.bindingSignatures[s].issuerKeyID.equals(o.issuerKeyID))return o.created>n.bindingSignatures[s].created&&(n.bindingSignatures[s]=o),!1;try{return await o.verify(a,l.signature.subkeyBinding,r,d,void 0,i),!0}catch{return!1}}),await pi(e,this,"revocationSignatures",d,function(o){return Ki(a,l.signature.subkeyRevocation,r,[o],void 0,void 0,d,i)})}async revoke(e,{flag:d=l.reasonForRevocation.noReason,string:i=""}={},a=new Date,n=J){let r={key:e,bind:this.keyPacket},o=new no(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await yi(r,[],e,{signatureType:l.signature.subkeyRevocation,reasonForRevocationFlag:l.write(l.reasonForRevocation,d),reasonForRevocationString:i},a,void 0,void 0,!1,n)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}};["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach(t=>{Qo.prototype[t]=function(){return this.keyPacket[t]()}});var U2=I.constructAllowedPackets([It]),$s=new Set([l.packet.publicKey,l.packet.privateKey]),Zs=new Set([l.packet.publicKey,l.packet.privateKey,l.packet.publicSubkey,l.packet.privateSubkey]),El=class{packetListToStructure(t,e=new Set){let d,i,a,n;for(let r of t){if(r instanceof Br){Zs.has(r.tag)&&!n&&($s.has(r.tag)?n=$s:n=Zs);continue}let o=r.constructor.tag;if(n){if(!n.has(o))continue;n=null}if(e.has(o))throw new Error(`Unexpected packet type: ${o}`);switch(o){case l.packet.publicKey:case l.packet.secretKey:if(this.keyPacket)throw new Error("Key block contains multiple keys");if(this.keyPacket=r,i=this.getKeyID(),!i)throw new Error("Missing Key ID");break;case l.packet.userID:case l.packet.userAttribute:d=new O2(r,this),this.users.push(d);break;case l.packet.publicSubkey:case l.packet.secretSubkey:d=null,a=new Qo(r,this),this.subkeys.push(a);break;case l.packet.signature:switch(r.signatureType){case l.signature.certGeneric:case l.signature.certPersona:case l.signature.certCasual:case l.signature.certPositive:if(!d){I.printDebug("Dropping certification signatures without preceding user packet");continue}r.issuerKeyID.equals(i)?d.selfCertifications.push(r):d.otherCertifications.push(r);break;case l.signature.certRevocation:d?d.revocationSignatures.push(r):this.directSignatures.push(r);break;case l.signature.key:this.directSignatures.push(r);break;case l.signature.subkeyBinding:if(!a){I.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}a.bindingSignatures.push(r);break;case l.signature.keyRevocation:this.revocationSignatures.push(r);break;case l.signature.subkeyRevocation:if(!a){I.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}a.revocationSignatures.push(r);break}break}}}toPacketList(){let t=new Ue;return t.push(this.keyPacket),t.push(...this.revocationSignatures),t.push(...this.directSignatures),this.users.map(e=>t.push(...e.toPacketList())),this.subkeys.map(e=>t.push(...e.toPacketList())),t}clone(t=!1){let e=new this.constructor(this.toPacketList());return t&&e.getKeys().forEach(d=>{if(d.keyPacket=Object.create(Object.getPrototypeOf(d.keyPacket),Object.getOwnPropertyDescriptors(d.keyPacket)),!d.keyPacket.isDecrypted())return;let i={};Object.keys(d.keyPacket.privateParams).forEach(a=>{i[a]=new Uint8Array(d.keyPacket.privateParams[a])}),d.keyPacket.privateParams=i}),e}getSubkeys(t=null){return this.subkeys.filter(e=>!t||e.getKeyID().equals(t,!0))}getKeys(t=null){let e=[];return(!t||this.getKeyID().equals(t,!0))&&e.push(this),e.concat(this.getSubkeys(t))}getKeyIDs(){return this.getKeys().map(t=>t.getKeyID())}getUserIDs(){return this.users.map(t=>t.userID?t.userID.userID:null).filter(t=>t!==null)}write(){return this.toPacketList().write()}async getSigningKey(t=null,e=new Date,d={},i=J){await this.verifyPrimaryKey(e,d,i);let a=this.keyPacket;try{ai(a,i)}catch(o){throw I.wrapError("Could not verify primary key",o)}let n=this.subkeys.slice().sort((o,s)=>s.keyPacket.created-o.keyPacket.created),r;for(let o of n)if(!t||o.getKeyID().equals(t))try{await o.verify(e,i);let s={key:a,bind:o.keyPacket},c=await Nt(o.bindingSignatures,a,l.signature.subkeyBinding,s,e,i);if(!Ys(o.keyPacket,c,i))continue;if(!c.embeddedSignature)throw new Error("Missing embedded signature");return await Nt([c.embeddedSignature],o.keyPacket,l.signature.keyBinding,s,e,i),ai(o.keyPacket,i),o}catch(s){r=s}try{let o=await this.getPrimarySelfSignature(e,d,i);if((!t||a.getKeyID().equals(t))&&Ys(a,o,i))return ai(a,i),this}catch(o){r=o}throw I.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),r)}async getEncryptionKey(t,e=new Date,d={},i=J){await this.verifyPrimaryKey(e,d,i);let a=this.keyPacket;try{ai(a,i)}catch(o){throw I.wrapError("Could not verify primary key",o)}let n=this.subkeys.slice().sort((o,s)=>s.keyPacket.created-o.keyPacket.created),r;for(let o of n)if(!t||o.getKeyID().equals(t))try{await o.verify(e,i);let s={key:a,bind:o.keyPacket},c=await Nt(o.bindingSignatures,a,l.signature.subkeyBinding,s,e,i);if(_s(o.keyPacket,c,i))return ai(o.keyPacket,i),o}catch(s){r=s}try{let o=await this.getPrimarySelfSignature(e,d,i);if((!t||a.getKeyID().equals(t))&&_s(a,o,i))return ai(a,i),this}catch(o){r=o}throw I.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),r)}async isRevoked(t,e,d=new Date,i=J){return Ki(this.keyPacket,l.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,t,e,d,i)}async verifyPrimaryKey(t=new Date,e={},d=J){let i=this.keyPacket;if(await this.isRevoked(null,null,t,d))throw new Error("Primary key is revoked");let a=await this.getPrimarySelfSignature(t,e,d);if(ao(i,a,t))throw new Error("Primary key is expired");if(i.version!==6){let n=await Nt(this.directSignatures,i,l.signature.key,{key:i},t,d).catch(()=>{});if(n&&ao(i,n,t))throw new Error("Primary key is expired")}}async getExpirationTime(t,e=J){let d;try{let i=await this.getPrimarySelfSignature(null,t,e),a=Mn(this.keyPacket,i),n=i.getExpirationTime(),r=this.keyPacket.version!==6&&await Nt(this.directSignatures,this.keyPacket,l.signature.key,{key:this.keyPacket},null,e).catch(()=>{});if(r){let o=Mn(this.keyPacket,r);d=Math.min(a,n,o)}else d=a<n?a:n}catch{d=null}return I.normalizeDate(d)}async getPrimarySelfSignature(t=new Date,e={},d=J){let i=this.keyPacket;if(i.version===6)return Nt(this.directSignatures,i,l.signature.key,{key:i},t,d);let{selfCertification:a}=await this.getPrimaryUser(t,e,d);return a}async getPrimaryUser(t=new Date,e={},d=J){let i=this.keyPacket,a=[],n;for(let c=0;c<this.users.length;c++)try{let p=this.users[c];if(!p.userID)continue;if(e.name!==void 0&&p.userID.name!==e.name||e.email!==void 0&&p.userID.email!==e.email||e.comment!==void 0&&p.userID.comment!==e.comment)throw new Error("Could not find user that matches that user ID");let u={userID:p.userID,key:i},m=await Nt(p.selfCertifications,i,l.signature.certGeneric,u,t,d);a.push({index:c,user:p,selfCertification:m})}catch(p){n=p}if(!a.length)throw n||new Error("Could not find primary user");await Promise.all(a.map(async function(c){return c.selfCertification.revoked||c.user.isRevoked(c.selfCertification,null,t,d)}));let r=a.sort(function(c,p){let u=c.selfCertification,m=p.selfCertification;return m.revoked-u.revoked||u.isPrimaryUserID-m.isPrimaryUserID||u.created-m.created}).pop(),{user:o,selfCertification:s}=r;if(s.revoked||await o.isRevoked(s,null,t,d))throw new Error("Primary user is revoked");return r}async update(t,e=new Date,d=J){if(!this.hasSameFingerprintAs(t))throw new Error("Primary key fingerprints must be equal to update the key");if(!this.isPrivate()&&t.isPrivate()){if(!(this.subkeys.length===t.subkeys.length&&this.subkeys.every(a=>t.subkeys.some(n=>a.hasSameFingerprintAs(n)))))throw new Error("Cannot update public key with private key if subkeys mismatch");return t.update(this,d)}let i=this.clone();return await pi(t,i,"revocationSignatures",e,a=>Ki(i.keyPacket,l.signature.keyRevocation,i,[a],null,t.keyPacket,e,d)),await pi(t,i,"directSignatures",e),await Promise.all(t.users.map(async a=>{let n=i.users.filter(r=>a.userID&&a.userID.equals(r.userID)||a.userAttribute&&a.userAttribute.equals(r.userAttribute));if(n.length>0)await Promise.all(n.map(r=>r.update(a,e,d)));else{let r=a.clone();r.mainKey=i,i.users.push(r)}})),await Promise.all(t.subkeys.map(async a=>{let n=i.subkeys.filter(r=>r.hasSameFingerprintAs(a));if(n.length>0)await Promise.all(n.map(r=>r.update(a,e,d)));else{let r=a.clone();r.mainKey=i,i.subkeys.push(r)}})),i}async getRevocationCertificate(t=new Date,e=J){let d={key:this.keyPacket},i=await Nt(this.revocationSignatures,this.keyPacket,l.signature.keyRevocation,d,t,e),a=new Ue;a.push(i);let n=this.keyPacket.version!==6;return Zi(l.armor.publicKey,a.write(),null,null,"This is a revocation certificate",n,e)}async applyRevocationCertificate(t,e=new Date,d=J){let i=await Bn(t),a=(await Ue.fromBinary(i.data,U2,d)).findPacket(l.packet.signature);if(!a||a.signatureType!==l.signature.keyRevocation)throw new Error("Could not find revocation signature packet");if(!a.issuerKeyID.equals(this.getKeyID()))throw new Error("Revocation signature does not match key");try{await a.verify(this.keyPacket,l.signature.keyRevocation,{key:this.keyPacket},e,void 0,d)}catch(r){throw I.wrapError("Could not verify revocation signature",r)}let n=this.clone();return n.revocationSignatures.push(a),n}async signPrimaryUser(t,e,d,i=J){let{index:a,user:n}=await this.getPrimaryUser(e,d,i),r=await n.certify(t,e,i),o=this.clone();return o.users[a]=r,o}async signAllUsers(t,e=new Date,d=J){let i=this.clone();return i.users=await Promise.all(this.users.map(function(a){return a.certify(t,e,d)})),i}async verifyPrimaryUser(t,e=new Date,d,i=J){let a=this.keyPacket,{user:n}=await this.getPrimaryUser(e,d,i);return t?await n.verifyAllCertifications(t,e,i):[{keyID:a.getKeyID(),valid:await n.verify(e,i).catch(()=>!1)}]}async verifyAllUsers(t,e=new Date,d=J){let i=this.keyPacket,a=[];return await Promise.all(this.users.map(async n=>{let r=t?await n.verifyAllCertifications(t,e,d):[{keyID:i.getKeyID(),valid:await n.verify(e,d).catch(()=>!1)}];a.push(...r.map(o=>({userID:n.userID?n.userID.userID:null,userAttribute:n.userAttribute,keyID:o.keyID,valid:o.valid})))})),a}};["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach(t=>{El.prototype[t]=Qo.prototype[t]});var ro=class extends El{constructor(t){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],t&&(this.packetListToStructure(t,new Set([l.packet.secretKey,l.packet.secretSubkey])),!this.keyPacket))throw new Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(t=J){let e=this.keyPacket.version!==6;return Zi(l.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e,t)}},k2=class vl extends ro{constructor(e){if(super(),this.packetListToStructure(e,new Set([l.packet.publicKey,l.packet.publicSubkey])),!this.keyPacket)throw new Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){let e=new Ue,d=this.toPacketList();for(let i of d)switch(i.constructor.tag){case l.packet.secretKey:{let a=jd.fromSecretKeyPacket(i);e.push(a);break}case l.packet.secretSubkey:{let a=gl.fromSecretSubkeyPacket(i);e.push(a);break}default:e.push(i)}return new ro(e)}armor(e=J){let d=this.keyPacket.version!==6;return Zi(l.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,d,e)}async getDecryptionKeys(e,d=new Date,i={},a=J){let n=this.keyPacket,r=[],o=null;for(let c=0;c<this.subkeys.length;c++)if(!e||this.subkeys[c].getKeyID().equals(e,!0)){if(this.subkeys[c].keyPacket.isDummy()){o=o||new Error("Gnu-dummy key packets cannot be used for decryption");continue}try{let p={key:n,bind:this.subkeys[c].keyPacket},u=await Nt(this.subkeys[c].bindingSignatures,n,l.signature.subkeyBinding,p,d,a);Js(this.subkeys[c].keyPacket,u,a)&&r.push(this.subkeys[c])}catch(p){o=p}}let s=await this.getPrimarySelfSignature(d,i,a);if((!e||n.getKeyID().equals(e,!0))&&Js(n,s,a)&&(n.isDummy()?o=o||new Error("Gnu-dummy key packets cannot be used for decryption"):r.push(this)),r.length===0)throw o||new Error("No decryption key packets found");return r}isDecrypted(){return this.getKeys().some(({keyPacket:e})=>e.isDecrypted())}async validate(e=J){if(!this.isPrivate())throw new Error("Cannot validate a public key");let d;if(!this.keyPacket.isDummy())d=this.keyPacket;else{let i=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});i&&!i.keyPacket.isDummy()&&(d=i.keyPacket)}if(d)return d.validate();{let i=this.getKeys();if(i.map(a=>a.keyPacket.isDummy()).every(Boolean))throw new Error("Cannot validate an all-gnu-dummy key");return Promise.all(i.map(async a=>a.keyPacket.validate()))}}clearPrivateParams(){this.getKeys().forEach(({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()})}async revoke({flag:e=l.reasonForRevocation.noReason,string:d=""}={},i=new Date,a=J){if(!this.isPrivate())throw new Error("Need private key for revoking");let n={key:this.keyPacket},r=this.clone();return r.revocationSignatures.push(await yi(n,[],this.keyPacket,{signatureType:l.signature.keyRevocation,reasonForRevocationFlag:l.write(l.reasonForRevocation,e),reasonForRevocationString:d},i,void 0,void 0,void 0,a)),r}async addSubkey(e={}){let d={...J,...e.config};if(e.passphrase)throw new Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBits<d.minRSABits)throw new Error(`rsaBits should be at least ${d.minRSABits}, got: ${e.rsaBits}`);let i=this.keyPacket;if(i.isDummy())throw new Error("Cannot add subkey to gnu-dummy primary key");if(!i.isDecrypted())throw new Error("Key is not decrypted");let a=i.getAlgorithmInfo();a.type=q2(a.algorithm),a.rsaBits=a.bits||4096,a.curve=a.curve||"curve25519Legacy",e=L2(e,a);let n=await A2(e,{...d,v6Keys:this.keyPacket.version===6});ai(n,d);let r=await w2(n,i,e,d),o=this.toPacketList();return o.push(n,r),new vl(o)}};function q2(t){switch(l.write(l.publicKey,t)){case l.publicKey.rsaEncrypt:case l.publicKey.rsaEncryptSign:case l.publicKey.rsaSign:case l.publicKey.dsa:return"rsa";case l.publicKey.ecdsa:case l.publicKey.eddsaLegacy:return"ecc";case l.publicKey.ed25519:return"curve25519";case l.publicKey.ed448:return"curve448";default:throw new Error("Unsupported algorithm")}}var B2=I.constructAllowedPackets([jd,gl,Il,Fl,N2,R2,It]);function j2(t){for(let e of t)switch(e.constructor.tag){case l.packet.secretKey:return new k2(t);case l.packet.publicKey:return new ro(t)}throw new Error("No key packet found")}async function G2({armoredKey:t,binaryKey:e,config:d,...i}){if(d={...J,...d},!t&&!e)throw new Error("readKey: must pass options object containing `armoredKey` or `binaryKey`");if(t&&!I.isString(t))throw new Error("readKey: options.armoredKey must be a string");if(e&&!I.isUint8Array(e))throw new Error("readKey: options.binaryKey must be a Uint8Array");let a=Object.keys(i);if(a.length>0)throw new Error(`Unknown option: ${a.join(", ")}`);let n;if(t){let{type:c,data:p}=await Bn(t);if(!(c===l.armor.publicKey||c===l.armor.privateKey))throw new Error("Armored text not of type key");n=p}else n=e;let r=await Ue.fromBinary(n,B2,d),o=r.indexOfTag(l.packet.publicKey,l.packet.secretKey);if(o.length===0)throw new Error("No key packet found");let s=r.slice(o[0],o[1]);return j2(s)}var Q2=I.constructAllowedPackets([Sl]),V2=I.constructAllowedPackets([It]),z2=class pd{constructor(e){this.packets=e||new Ue}getEncryptionKeyIDs(){let e=[];return this.packets.filterByTag(l.packet.publicKeyEncryptedSessionKey).forEach(function(d){e.push(d.publicKeyID)}),e}getSigningKeyIDs(){let e=this.unwrapCompressed(),d=e.packets.filterByTag(l.packet.onePassSignature);return d.length>0?d.map(i=>i.issuerKeyID):e.packets.filterByTag(l.packet.signature).map(i=>i.issuerKeyID)}async decrypt(e,d,i,a=new Date,n=J){let r=this.packets.filterByTag(l.packet.symmetricallyEncryptedData,l.packet.symEncryptedIntegrityProtectedData,l.packet.aeadEncryptedData);if(r.length===0)throw new Error("No encrypted data found");let o=r[0],s=o.cipherAlgorithm,c=i||await this.decryptSessionKeys(e,d,s,a,n),p=null,u=Promise.all(c.map(async({algorithm:S,data:g})=>{if(!I.isUint8Array(g)||!o.cipherAlgorithm&&!I.isString(S))throw new Error("Invalid session key for decryption.");try{let y=o.cipherAlgorithm||l.write(l.symmetric,S);await o.decrypt(y,g,n)}catch(y){I.printDebugError(y),p=y}}));if(Lr(o.encrypted),o.encrypted=null,await u,!o.packets||!o.packets.length)throw p||new Error("Decryption failed.");let m=new pd(o.packets);return o.packets=new Ue,m}async decryptSessionKeys(e,d,i,a=new Date,n=J){let r=[],o;if(d){let s=this.packets.filterByTag(l.packet.symEncryptedSessionKey);if(s.length===0)throw new Error("No symmetrically encrypted session key packet found.");await Promise.all(d.map(async function(c,p){let u;p?u=await Ue.fromBinary(s.write(),Q2,n):u=s,await Promise.all(u.map(async function(m){try{await m.decrypt(c),r.push(m)}catch(S){I.printDebugError(S),S instanceof dl&&(o=S)}}))}))}else if(e){let s=this.packets.filterByTag(l.packet.publicKeyEncryptedSessionKey);if(s.length===0)throw new Error("No public key encrypted session key packet found.");await Promise.all(s.map(async function(c){await Promise.all(e.map(async function(p){let u;try{u=(await p.getDecryptionKeys(c.publicKeyID,null,void 0,n)).map(S=>S.keyPacket)}catch(S){o=S;return}let m=[l.symmetric.aes256,l.symmetric.aes128,l.symmetric.tripledes,l.symmetric.cast5];try{let S=await p.getPrimarySelfSignature(a,void 0,n);S.preferredSymmetricAlgorithms&&(m=m.concat(S.preferredSymmetricAlgorithms))}catch{}await Promise.all(u.map(async function(S){if(!S.isDecrypted())throw new Error("Decryption key is not decrypted.");if(n.constantTimePKCS1Decryption&&(c.publicKeyAlgorithm===l.publicKey.rsaEncrypt||c.publicKeyAlgorithm===l.publicKey.rsaEncryptSign||c.publicKeyAlgorithm===l.publicKey.rsaSign||c.publicKeyAlgorithm===l.publicKey.elgamal)){let g=c.write();await Promise.all((i?[i]:Array.from(n.constantTimePKCS1DecryptionSupportedSymmetricAlgorithms)).map(async y=>{let P=new Ws;P.read(g);let f={sessionKeyAlgorithm:y,sessionKey:zr(y)};try{await P.decrypt(S,f),r.push(P)}catch(E){I.printDebugError(E),o=E}}))}else try{await c.decrypt(S);let g=i||c.sessionKeyAlgorithm;if(g&&!m.includes(l.write(l.symmetric,g)))throw new Error("A non-preferred symmetric algorithm was used.");r.push(c)}catch(g){I.printDebugError(g),o=g}}))})),Lr(c.encrypted),c.encrypted=null}))}else throw new Error("No key or password specified.");if(r.length>0){if(r.length>1){let s=new Set;r=r.filter(c=>{let p=c.sessionKeyAlgorithm+I.uint8ArrayToString(c.sessionKey);return s.has(p)?!1:(s.add(p),!0)})}return r.map(s=>({data:s.sessionKey,algorithm:s.sessionKeyAlgorithm&&l.read(l.symmetric,s.sessionKeyAlgorithm)}))}throw o||new Error("Session key decryption failed.")}getLiteralData(){let e=this.unwrapCompressed().packets.findPacket(l.packet.literalData);return e&&e.getBytes()||null}getFilename(){let e=this.unwrapCompressed().packets.findPacket(l.packet.literalData);return e&&e.getFilename()||null}getText(){let e=this.unwrapCompressed().packets.findPacket(l.packet.literalData);return e?e.getText():null}static async generateSessionKey(e=[],d=new Date,i=[],a=J){let{symmetricAlgo:n,aeadAlgo:r}=await x2(e,d,i,a),o=l.read(l.symmetric,n),s=r?l.read(l.aead,r):void 0;return await Promise.all(e.map(c=>c.getEncryptionKey().catch(()=>null).then(p=>{if(p&&(p.keyPacket.algorithm===l.publicKey.x25519||p.keyPacket.algorithm===l.publicKey.x448)&&!s&&!I.isAES(n))throw new Error("Could not generate a session key compatible with the given `encryptionKeys`: X22519 and X448 keys can only be used to encrypt AES session keys; change `config.preferredSymmetricAlgorithm` accordingly.")}))),{data:zr(n),algorithm:o,aeadAlgorithm:s}}async encrypt(e,d,i,a=!1,n=[],r=new Date,o=[],s=J){if(i){if(!I.isUint8Array(i.data)||!I.isString(i.algorithm))throw new Error("Invalid session key for encryption.")}else if(e&&e.length)i=await pd.generateSessionKey(e,r,o,s);else if(d&&d.length)i=await pd.generateSessionKey(void 0,void 0,void 0,s);else throw new Error("No keys, passwords, or session key provided.");let{data:c,algorithm:p,aeadAlgorithm:u}=i,m=await pd.encryptSessionKey(c,p,u,e,d,a,n,r,o,s),S=to.fromObject({version:u?2:1,aeadAlgorithm:u?l.write(l.aead,u):null});S.packets=this.packets;let g=l.write(l.symmetric,p);return await S.encrypt(g,c,s),m.packets.push(S),S.packets=new Ue,m}static async encryptSessionKey(e,d,i,a,n,r=!1,o=[],s=new Date,c=[],p=J){let u=new Ue,m=l.write(l.symmetric,d),S=i&&l.write(l.aead,i);if(a){let g=await Promise.all(a.map(async function(y,P){let f=await y.getEncryptionKey(o[P],s,c,p),E=Ws.fromObject({version:S?6:3,encryptionKeyPacket:f.keyPacket,anonymousRecipient:r,sessionKey:e,sessionKeyAlgorithm:m});return await E.encrypt(f.keyPacket),delete E.sessionKey,E}));u.push(...g)}if(n){let g=async function(E,v){try{return await E.decrypt(v),1}catch{return 0}},y=(E,v)=>E+v,P=async function(E,v,F,D){let h=new Sl(p);return h.sessionKey=E,h.sessionKeyAlgorithm=v,F&&(h.aeadAlgorithm=F),await h.encrypt(D,p),p.passwordCollisionCheck&&(await Promise.all(n.map(X=>g(h,X)))).reduce(y)!==1?P(E,v,D):(delete h.sessionKey,h)},f=await Promise.all(n.map(E=>P(e,m,S,E)));u.push(...f)}return new pd(u)}async sign(e=[],d=[],i=null,a=[],n=new Date,r=[],o=[],s=[],c=J){let p=new Ue,u=this.packets.findPacket(l.packet.literalData);if(!u)throw new Error("No literal data packet to sign.");let m=await oo(u,e,d,i,a,n,r,o,s,!1,c),S=m.map((g,y)=>Ii.fromSignaturePacket(g,y===0)).reverse();return p.push(...S),p.push(u),p.push(...m),new pd(p)}compress(e,d=J){if(e===l.compression.uncompressed)return this;let i=new ul(d);i.algorithm=e,i.packets=this.packets;let a=new Ue;return a.push(i),new pd(a)}async signDetached(e=[],d=[],i=null,a=[],n=[],r=new Date,o=[],s=[],c=J){let p=this.packets.findPacket(l.packet.literalData);if(!p)throw new Error("No literal data packet to sign.");return new Gi(await oo(p,e,d,i,a,n,r,o,s,!0,c))}async verify(e,d=new Date,i=J){let a=this.unwrapCompressed(),n=a.packets.filterByTag(l.packet.literalData);if(n.length!==1)throw new Error("Can only verify message with one literal data packet.");let r=a.packets;qe(r.stream)&&(r=r.concat(await Ve(r.stream,c=>c||[])));let o=r.filterByTag(l.packet.onePassSignature).reverse(),s=r.filterByTag(l.packet.signature);return o.length&&!s.length&&I.isStream(r.stream)&&!qe(r.stream)?(await Promise.all(o.map(async c=>{c.correspondingSig=new Promise((p,u)=>{c.correspondingSigResolve=p,c.correspondingSigReject=u}),c.signatureData=Vd(async()=>(await c.correspondingSig).signatureData),c.hashed=Ve(await c.hash(c.signatureType,n[0],void 0,!1)),c.hashed.catch(()=>{})})),r.stream=Qd(r.stream,async(c,p)=>{let u=gd(c),m=ht(p);try{for(let S=0;S<o.length;S++){let{value:g}=await u.read();o[S].correspondingSigResolve(g)}await u.readToEnd(),await m.ready,await m.close()}catch(S){o.forEach(g=>{g.correspondingSigReject(S)}),await m.abort(S)}}),Pn(o,n,e,d,!1,i)):Pn(s,n,e,d,!1,i)}verifyDetached(e,d,i=new Date,a=J){let n=this.unwrapCompressed().packets.filterByTag(l.packet.literalData);if(n.length!==1)throw new Error("Can only verify message with one literal data packet.");let r=e.packets.filterByTag(l.packet.signature);return Pn(r,n,d,i,!0,a)}unwrapCompressed(){let e=this.packets.filterByTag(l.packet.compressedData);return e.length?new pd(e[0].packets):this}async appendSignature(e,d=J){await this.packets.read(I.isUint8Array(e)?e:(await Bn(e)).data,V2,d)}write(){return this.packets.write()}armor(e=J){let d=this.packets[this.packets.length-1],i=d.constructor.tag===to.tag?d.version!==2:this.packets.some(a=>a.constructor.tag===It.tag&&a.version!==6);return Zi(l.armor.message,this.write(),null,null,null,i,e)}};async function oo(t,e,d=[],i=null,a=[],n=new Date,r=[],o=[],s=[],c=!1,p=J){let u=new Ue,m=t.text===null?l.signature.binary:l.signature.text;if(await Promise.all(e.map(async(S,g)=>{let y=r[g];if(!S.isPrivate())throw new Error("Need private key for signing");let P=await S.getSigningKey(a[g],n,y,p);return yi(t,d.length?d:[S],P.keyPacket,{signatureType:m},n,o,s,c,p)})).then(S=>{u.push(...S)}),i){let S=i.packets.filterByTag(l.packet.signature);u.push(...S)}return u}async function H2(t,e,d,i=new Date,a=!1,n=J){let r,o;for(let p of d){let u=p.getKeys(t.issuerKeyID);if(u.length>0){r=p,o=u[0];break}}let s=t instanceof Ii?t.correspondingSig:t,c={keyID:t.issuerKeyID,verified:(async()=>{if(!o)throw new Error(`Could not find signing key with key ID ${t.issuerKeyID.toHex()}`);await t.verify(o.keyPacket,t.signatureType,e[0],i,a,n);let p=await s;if(o.getCreationTime()>p.created)throw new Error("Key is newer than the signature");try{await r.getSigningKey(o.getKeyID(),p.created,void 0,n)}catch(u){if(n.allowInsecureVerificationWithReformattedKeys&&u.message.match(/Signature creation time is in the future/))await r.getSigningKey(o.getKeyID(),i,void 0,n);else throw u}return!0})(),signature:(async()=>{let p=await s,u=new Ue;return p&&u.push(p),new Gi(u)})()};return c.signature.catch(()=>{}),c.verified.catch(()=>{}),c}async function Pn(t,e,d,i=new Date,a=!1,n=J){return Promise.all(t.filter(function(r){return["text","binary"].includes(l.read(l.signature,r.signatureType))}).map(async function(r){return H2(r,e,d,i,a,n)}))}var W2=I.constructAllowedPackets([It]),xn=class Cl{constructor(e,d){if(this.text=I.removeTrailingSpaces(e).replace(/\r?\n/g,`\r
9338
9338
  `),d&&!(d instanceof Gi))throw new Error("Invalid signature input");this.signature=d||new Gi(new Ue)}getSigningKeyIDs(){let e=[];return this.signature.packets.forEach(function(d){e.push(d.issuerKeyID)}),e}async sign(e,d=[],i=null,a=[],n=new Date,r=[],o=[],s=[],c=J){let p=new Nn;p.setText(this.text);let u=new Gi(await oo(p,e,d,i,a,n,r,o,s,!0,c));return new Cl(this.text,u)}verify(e,d=new Date,i=J){let a=this.signature.packets.filterByTag(l.packet.signature),n=new Nn;return n.setText(this.text),Pn(a,[n],e,d,!0,i)}getText(){return this.text.replace(/\r\n/g,`
9339
- `)}armor(e=J){let d=this.signature.packets.some(a=>a.version!==6),i={hash:d?Array.from(new Set(this.signature.packets.map(a=>l.read(l.hash,a.hashAlgorithm).toUpperCase()))).join():null,text:this.text,data:this.signature.packets.write()};return Zi(l.armor.signed,i,void 0,void 0,void 0,d,e)}};async function K2({cleartextMessage:t,config:e,...d}){if(e={...J,...e},!t)throw new Error("readCleartextMessage: must pass options object containing `cleartextMessage`");if(!I.isString(t))throw new Error("readCleartextMessage: options.cleartextMessage must be a string");let i=Object.keys(d);if(i.length>0)throw new Error(`Unknown option: ${i.join(", ")}`);let a=await Bn(t);if(a.type!==l.armor.signed)throw new Error("No cleartext signed message.");let n=await Ue.fromBinary(a.data,W2,e);Y2(a.headers,n);let r=new Gi(n);return new xn(a.text,r)}function Y2(t,e){let d=function(a){let n=r=>o=>r.hashAlgorithm===o;for(let r=0;r<e.length;r++)if(e[r].constructor.tag===l.packet.signature&&!a.some(n(e[r])))return!1;return!0},i=[];if(t.forEach(a=>{let n=a.match(/^Hash: (.+)$/);if(n){let r=n[1].replace(/\s/g,"").split(",").map(o=>{try{return l.write(l.hash,o.toLowerCase())}catch{throw new Error("Unknown hash algorithm in armor header: "+o.toLowerCase())}});i.push(...r)}else throw new Error('Only "Hash" header allowed in cleartext signed message')}),i.length&&!d(i))throw new Error("Hash algorithm mismatch in armor header and signature")}async function _2({message:t,verificationKeys:e,expectSigned:d=!1,format:i="utf8",signature:a=null,date:n=new Date,config:r,...o}){if(r={...J,...r},Z2(r),J2(t),e=e0(e),o.publicKeys)throw new Error("The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead");let s=Object.keys(o);if(s.length>0)throw new Error(`Unknown option: ${s.join(", ")}`);if(t instanceof xn&&i==="binary")throw new Error("Can't return cleartext message data as binary");if(t instanceof xn&&a)throw new Error("Can't verify detached cleartext signature");try{let c={};if(a?c.signatures=await t.verifyDetached(a,e,n,r):c.signatures=await t.verify(e,n,r),c.data=i==="binary"?t.getLiteralData():t.getText(),t.fromStream&&!a&&d0(c,t),d){if(c.signatures.length===0)throw new Error("Message is not signed");c.data=ut([c.data,Vd(async()=>(await I.anyPromise(c.signatures.map(p=>p.verified)),i==="binary"?new Uint8Array:""))])}return c.data=await t0(c.data),c}catch(c){throw I.wrapError("Error verifying signed message",c)}}function J2(t){if(!(t instanceof xn)&&!(t instanceof z2))throw new Error("Parameter [message] needs to be of type Message or CleartextMessage")}var $2=Object.keys(J).length;function Z2(t){let e=Object.keys(t);if(e.length!==$2){for(let d of e)if(J[d]===void 0)throw new Error(`Unknown config property: ${d}`)}}function e0(t){return t&&!I.isArray(t)&&(t=[t]),t}async function t0(t){return I.isStream(t)==="array"?Ve(t):t}function d0(t,e){t.data=Qd(e.packets.stream,async(d,i)=>{await hi(t.data,i,{preventClose:!0});let a=ht(i);try{await Ve(d,n=>n),await a.close()}catch(n){await a.abort(n)}})}function Ln(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function i0(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Ga(t,...e){if(!i0(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function a0(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ln(t.outputLen),Ln(t.blockLen)}function Yi(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Xl(t,e){Ga(t);let d=e.outputLen;if(t.length<d)throw new Error(`digestInto() expects output buffer of length at least ${d}`)}var Ni=typeof et=="object"&&"crypto"in et?et.crypto:void 0,n0=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),br=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ot=(t,e)=>t<<32-e|t>>>e,Od=(t,e)=>t<<e|t>>>32-e>>>0,ec=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,r0=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function tc(t){for(let e=0;e<t.length;e++)t[e]=r0(t[e])}function Tl(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Qa(t){return typeof t=="string"&&(t=Tl(t)),Ga(t),t}function Dl(...t){let e=0;for(let i=0;i<t.length;i++){let a=t[i];Ga(a),e+=a.length}let d=new Uint8Array(e);for(let i=0,a=0;i<t.length;i++){let n=t[i];d.set(n,a),a+=n.length}return d}var Vo=class{clone(){return this._cloneInto()}};function Jt(t){let e=i=>t().update(Qa(i)).digest(),d=t();return e.outputLen=d.outputLen,e.blockLen=d.blockLen,e.create=()=>t(),e}function o0(t){let e=(i,a)=>t(a).update(Qa(i)).digest(),d=t({});return e.outputLen=d.outputLen,e.blockLen=d.blockLen,e.create=i=>t(i),e}function zo(t=32){if(Ni&&typeof Ni.getRandomValues=="function")return Ni.getRandomValues(new Uint8Array(t));if(Ni&&typeof Ni.randomBytes=="function")return Ni.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function s0(t,e,d,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,d,i);let a=BigInt(32),n=BigInt(4294967295),r=Number(d>>a&n),o=Number(d&n),s=i?4:0,c=i?0:4;t.setUint32(e+s,r,i),t.setUint32(e+c,o,i)}var Rl=(t,e,d)=>t&e^~t&d,Nl=(t,e,d)=>t&e^t&d^e&d,Va=class extends Vo{constructor(t,e,d,i){super(),this.blockLen=t,this.outputLen=e,this.padOffset=d,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=br(this.buffer)}update(t){Yi(this);let{view:e,buffer:d,blockLen:i}=this;t=Qa(t);let a=t.length;for(let n=0;n<a;){let r=Math.min(i-this.pos,a-n);if(r===i){let o=br(t);for(;i<=a-n;n+=i)this.process(o,n);continue}d.set(t.subarray(n,n+r),this.pos),this.pos+=r,n+=r,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Yi(this),Xl(t,this),this.finished=!0;let{buffer:e,view:d,blockLen:i,isLE:a}=this,{pos:n}=this;e[n++]=128,this.buffer.subarray(n).fill(0),this.padOffset>i-n&&(this.process(d,0),n=0);for(let p=n;p<i;p++)e[p]=0;s0(d,i-8,BigInt(this.length*8),a),this.process(d,0);let r=br(t),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let s=o/4,c=this.get();if(s>c.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<s;p++)r.setUint32(4*p,c[p],a)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let d=t.slice(0,e);return this.destroy(),d}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:d,length:i,finished:a,destroyed:n,pos:r}=this;return t.length=i,t.pos=r,t.finished=a,t.destroyed=n,i%e&&t.buffer.set(d),t}},c0=new Uint32Array([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]),vd=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Cd=new Uint32Array(64),Al=class extends Va{constructor(){super(64,32,8,!1),this.A=vd[0]|0,this.B=vd[1]|0,this.C=vd[2]|0,this.D=vd[3]|0,this.E=vd[4]|0,this.F=vd[5]|0,this.G=vd[6]|0,this.H=vd[7]|0}get(){let{A:t,B:e,C:d,D:i,E:a,F:n,G:r,H:o}=this;return[t,e,d,i,a,n,r,o]}set(t,e,d,i,a,n,r,o){this.A=t|0,this.B=e|0,this.C=d|0,this.D=i|0,this.E=a|0,this.F=n|0,this.G=r|0,this.H=o|0}process(t,e){for(let p=0;p<16;p++,e+=4)Cd[p]=t.getUint32(e,!1);for(let p=16;p<64;p++){let u=Cd[p-15],m=Cd[p-2],S=Ot(u,7)^Ot(u,18)^u>>>3,g=Ot(m,17)^Ot(m,19)^m>>>10;Cd[p]=g+Cd[p-7]+S+Cd[p-16]|0}let{A:d,B:i,C:a,D:n,E:r,F:o,G:s,H:c}=this;for(let p=0;p<64;p++){let u=Ot(r,6)^Ot(r,11)^Ot(r,25),m=c+u+Rl(r,o,s)+c0[p]+Cd[p]|0,S=(Ot(d,2)^Ot(d,13)^Ot(d,22))+Nl(d,i,a)|0;c=s,s=o,o=r,r=n+m|0,n=a,a=i,i=d,d=m+S|0}d=d+this.A|0,i=i+this.B|0,a=a+this.C|0,n=n+this.D|0,r=r+this.E|0,o=o+this.F|0,s=s+this.G|0,c=c+this.H|0,this.set(d,i,a,n,r,o,s,c)}roundClean(){Cd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},p0=class extends Al{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},Zn=Jt(()=>new Al),l0=Jt(()=>new p0),wl=class extends Vo{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,a0(t);let d=Qa(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,a=new Uint8Array(i);a.set(d.length>i?t.create().update(d).digest():d);for(let n=0;n<a.length;n++)a[n]^=54;this.iHash.update(a),this.oHash=t.create();for(let n=0;n<a.length;n++)a[n]^=106;this.oHash.update(a),a.fill(0)}update(t){return Yi(this),this.iHash.update(t),this}digestInto(t){Yi(this),Ga(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:d,finished:i,destroyed:a,blockLen:n,outputLen:r}=this;return t=t,t.finished=i,t.destroyed=a,t.blockLen=n,t.outputLen=r,t.oHash=e._cloneInto(t.oHash),t.iHash=d._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Ml=(t,e,d)=>new wl(t,e).update(d).digest();Ml.create=(t,e)=>new wl(t,e);var Ho=BigInt(0),er=BigInt(1),u0=BigInt(2);function Si(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function za(t){if(!Si(t))throw new Error("Uint8Array expected")}function Pd(t,e){if(typeof e!="boolean")throw new Error(`${t} must be valid boolean, got "${e}".`)}var m0=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Pi(t){za(t);let e="";for(let d=0;d<t.length;d++)e+=m0[t[d]];return e}function qi(t){let e=t.toString(16);return e.length&1?`0${e}`:e}function Wo(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}var od={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function dc(t){if(t>=od._0&&t<=od._9)return t-od._0;if(t>=od._A&&t<=od._F)return t-(od._A-10);if(t>=od._a&&t<=od._f)return t-(od._a-10)}function _i(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);let e=t.length,d=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let i=new Uint8Array(d);for(let a=0,n=0;a<d;a++,n+=2){let r=dc(t.charCodeAt(n)),o=dc(t.charCodeAt(n+1));if(r===void 0||o===void 0){let s=t[n]+t[n+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+n)}i[a]=r*16+o}return i}function li(t){return Wo(Pi(t))}function Ud(t){return za(t),Wo(Pi(Uint8Array.from(t).reverse()))}function Ji(t,e){return _i(t.toString(16).padStart(e*2,"0"))}function $i(t,e){return Ji(t,e).reverse()}function y0(t){return _i(qi(t))}function Le(t,e,d){let i;if(typeof e=="string")try{i=_i(e)}catch(n){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${n}`)}else if(Si(e))i=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);let a=i.length;if(typeof d=="number"&&a!==d)throw new Error(`${t} expected ${d} bytes, got ${a}`);return i}function gi(...t){let e=0;for(let i=0;i<t.length;i++){let a=t[i];za(a),e+=a.length}let d=new Uint8Array(e);for(let i=0,a=0;i<t.length;i++){let n=t[i];d.set(n,a),a+=n.length}return d}function S0(t,e){if(t.length!==e.length)return!1;let d=0;for(let i=0;i<t.length;i++)d|=t[i]^e[i];return d===0}function P0(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}var Fr=t=>typeof t=="bigint"&&Ho<=t;function tr(t,e,d){return Fr(t)&&Fr(e)&&Fr(d)&&e<=t&&t<d}function pt(t,e,d,i){if(!tr(e,d,i))throw new Error(`expected valid ${t}: ${d} <= n < ${i}, got ${typeof e} ${e}`)}function xl(t){let e;for(e=0;t>Ho;t>>=er,e+=1);return e}function g0(t,e){return t>>BigInt(e)&er}function h0(t,e,d){return t|(d?er:Ho)<<BigInt(e)}var Ko=t=>(u0<<BigInt(t-1))-er,Er=t=>new Uint8Array(t),ic=t=>Uint8Array.from(t);function Ll(t,e,d){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof d!="function")throw new Error("hmacFn must be a function");let i=Er(t),a=Er(t),n=0,r=()=>{i.fill(1),a.fill(0),n=0},o=(...p)=>d(a,i,...p),s=(p=Er())=>{a=o(ic([0]),p),i=o(),p.length!==0&&(a=o(ic([1]),p),i=o())},c=()=>{if(n++>=1e3)throw new Error("drbg: tried 1000 values");let p=0,u=[];for(;p<e;){i=o();let m=i.slice();u.push(m),p+=i.length}return gi(...u)};return(p,u)=>{r(),s(p);let m;for(;!(m=u(c()));)s();return r(),m}}var f0={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Si(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function bi(t,e,d={}){let i=(a,n,r)=>{let o=f0[n];if(typeof o!="function")throw new Error(`Invalid validator "${n}", expected function`);let s=t[a];if(!(r&&s===void 0)&&!o(s,t))throw new Error(`Invalid param ${String(a)}=${s} (${typeof s}), expected ${n}`)};for(let[a,n]of Object.entries(e))i(a,n,!1);for(let[a,n]of Object.entries(d))i(a,n,!0);return t}var I0=()=>{throw new Error("not implemented")};function Ta(t){let e=new WeakMap;return(d,...i)=>{let a=e.get(d);if(a!==void 0)return a;let n=t(d,...i);return e.set(d,n),n}}var b0=Object.freeze({__proto__:null,aInRange:pt,abool:Pd,abytes:za,bitGet:g0,bitLen:xl,bitMask:Ko,bitSet:h0,bytesToHex:Pi,bytesToNumberBE:li,bytesToNumberLE:Ud,concatBytes:gi,createHmacDrbg:Ll,ensureBytes:Le,equalBytes:S0,hexToBytes:_i,hexToNumber:Wo,inRange:tr,isBytes:Si,memoized:Ta,notImplemented:I0,numberToBytesBE:Ji,numberToBytesLE:$i,numberToHexUnpadded:qi,numberToVarBytesBE:y0,utf8ToBytes:P0,validateObject:bi}),He=BigInt(0),ke=BigInt(1),ri=BigInt(2),F0=BigInt(3),so=BigInt(4),ac=BigInt(5),nc=BigInt(8);BigInt(9);BigInt(16);function Re(t,e){let d=t%e;return d>=He?d:e+d}function Ol(t,e,d){if(d<=He||e<He)throw new Error("Expected power/modulo > 0");if(d===ke)return He;let i=ke;for(;e>He;)e&ke&&(i=i*t%d),t=t*t%d,e>>=ke;return i}function Xe(t,e,d){let i=t;for(;e-- >He;)i*=i,i%=d;return i}function co(t,e){if(t===He||e<=He)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let d=Re(t,e),i=e,a=He,n=ke;for(;d!==He;){let r=i/d,o=i%d,s=a-n*r;i=d,d=o,a=n,n=s}if(i!==ke)throw new Error("invert: does not exist");return Re(a,e)}function E0(t){let e=(t-ke)/ri,d,i,a;for(d=t-ke,i=0;d%ri===He;d/=ri,i++);for(a=ri;a<t&&Ol(a,e,t)!==t-ke;a++);if(i===1){let r=(t+ke)/so;return function(o,s){let c=o.pow(s,r);if(!o.eql(o.sqr(c),s))throw new Error("Cannot find square root");return c}}let n=(d+ke)/ri;return function(r,o){if(r.pow(o,e)===r.neg(r.ONE))throw new Error("Cannot find square root");let s=i,c=r.pow(r.mul(r.ONE,a),d),p=r.pow(o,n),u=r.pow(o,d);for(;!r.eql(u,r.ONE);){if(r.eql(u,r.ZERO))return r.ZERO;let m=1;for(let g=r.sqr(u);m<s&&!r.eql(g,r.ONE);m++)g=r.sqr(g);let S=r.pow(c,ke<<BigInt(s-m-1));c=r.sqr(S),p=r.mul(p,S),u=r.mul(u,c),s=m}return p}}function v0(t){if(t%so===F0){let e=(t+ke)/so;return function(d,i){let a=d.pow(i,e);if(!d.eql(d.sqr(a),i))throw new Error("Cannot find square root");return a}}if(t%nc===ac){let e=(t-ac)/nc;return function(d,i){let a=d.mul(i,ri),n=d.pow(a,e),r=d.mul(i,n),o=d.mul(d.mul(r,ri),n),s=d.mul(r,d.sub(o,d.ONE));if(!d.eql(d.sqr(s),i))throw new Error("Cannot find square root");return s}}return E0(t)}var C0=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function X0(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},d=C0.reduce((i,a)=>(i[a]="function",i),e);return bi(t,d)}function T0(t,e,d){if(d<He)throw new Error("Expected power > 0");if(d===He)return t.ONE;if(d===ke)return e;let i=t.ONE,a=e;for(;d>He;)d&ke&&(i=t.mul(i,a)),a=t.sqr(a),d>>=ke;return i}function D0(t,e){let d=new Array(e.length),i=e.reduce((n,r,o)=>t.is0(r)?n:(d[o]=n,t.mul(n,r)),t.ONE),a=t.inv(i);return e.reduceRight((n,r,o)=>t.is0(r)?n:(d[o]=t.mul(n,d[o]),t.mul(n,r)),a),d}function Ul(t,e){let d=e!==void 0?e:t.toString(2).length,i=Math.ceil(d/8);return{nBitLength:d,nByteLength:i}}function $t(t,e,d=!1,i={}){if(t<=He)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:a,nByteLength:n}=Ul(t,e);if(n>2048)throw new Error("Field lengths over 2048 bytes are not supported");let r=v0(t),o=Object.freeze({ORDER:t,BITS:a,BYTES:n,MASK:Ko(a),ZERO:He,ONE:ke,create:s=>Re(s,t),isValid:s=>{if(typeof s!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof s}`);return He<=s&&s<t},is0:s=>s===He,isOdd:s=>(s&ke)===ke,neg:s=>Re(-s,t),eql:(s,c)=>s===c,sqr:s=>Re(s*s,t),add:(s,c)=>Re(s+c,t),sub:(s,c)=>Re(s-c,t),mul:(s,c)=>Re(s*c,t),pow:(s,c)=>T0(o,s,c),div:(s,c)=>Re(s*co(c,t),t),sqrN:s=>s*s,addN:(s,c)=>s+c,subN:(s,c)=>s-c,mulN:(s,c)=>s*c,inv:s=>co(s,t),sqrt:i.sqrt||(s=>r(o,s)),invertBatch:s=>D0(o,s),cmov:(s,c,p)=>p?c:s,toBytes:s=>d?$i(s,n):Ji(s,n),fromBytes:s=>{if(s.length!==n)throw new Error(`Fp.fromBytes: expected ${n}, got ${s.length}`);return d?Ud(s):li(s)}});return Object.freeze(o)}function kl(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function ql(t){let e=kl(t);return e+Math.ceil(e/2)}function R0(t,e,d=!1){let i=t.length,a=kl(e),n=ql(e);if(i<16||i<n||i>1024)throw new Error(`expected ${n}-1024 bytes of input, got ${i}`);let r=d?li(t):Ud(t),o=Re(r,e-ke)+ke;return d?$i(o,a):Ji(o,a)}var N0=BigInt(0),vr=BigInt(1),Cr=new WeakMap,rc=new WeakMap;function Bl(t,e){let d=(n,r)=>{let o=r.negate();return n?o:r},i=n=>{if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error(`Wrong window size=${n}, should be [1..${e}]`)},a=n=>{i(n);let r=Math.ceil(e/n)+1,o=2**(n-1);return{windows:r,windowSize:o}};return{constTimeNegate:d,unsafeLadder(n,r){let o=t.ZERO,s=n;for(;r>N0;)r&vr&&(o=o.add(s)),s=s.double(),r>>=vr;return o},precomputeWindow(n,r){let{windows:o,windowSize:s}=a(r),c=[],p=n,u=p;for(let m=0;m<o;m++){u=p,c.push(u);for(let S=1;S<s;S++)u=u.add(p),c.push(u);p=u.double()}return c},wNAF(n,r,o){let{windows:s,windowSize:c}=a(n),p=t.ZERO,u=t.BASE,m=BigInt(2**n-1),S=2**n,g=BigInt(n);for(let y=0;y<s;y++){let P=y*c,f=Number(o&m);o>>=g,f>c&&(f-=S,o+=vr);let E=P,v=P+Math.abs(f)-1,F=y%2!==0,D=f<0;f===0?u=u.add(d(F,r[E])):p=p.add(d(D,r[v]))}return{p,f:u}},wNAFCached(n,r,o){let s=rc.get(n)||1,c=Cr.get(n);return c||(c=this.precomputeWindow(n,s),s!==1&&Cr.set(n,o(c))),this.wNAF(s,c,r)},setWindowSize(n,r){i(r),rc.set(n,r),Cr.delete(n)}}}function jl(t,e,d,i){if(!Array.isArray(d)||!Array.isArray(i)||i.length!==d.length)throw new Error("arrays of points and scalars must have equal length");i.forEach((p,u)=>{if(!e.isValid(p))throw new Error(`wrong scalar at index ${u}`)}),d.forEach((p,u)=>{if(!(p instanceof t))throw new Error(`wrong point at index ${u}`)});let a=xl(BigInt(d.length)),n=a>12?a-3:a>4?a-2:a?2:1,r=(1<<n)-1,o=new Array(r+1).fill(t.ZERO),s=Math.floor((e.BITS-1)/n)*n,c=t.ZERO;for(let p=s;p>=0;p-=n){o.fill(t.ZERO);for(let m=0;m<i.length;m++){let S=i[m],g=Number(S>>BigInt(p)&BigInt(r));o[g]=o[g].add(d[m])}let u=t.ZERO;for(let m=o.length-1,S=t.ZERO;m>0;m--)S=S.add(o[m]),u=u.add(S);if(c=c.add(u),p!==0)for(let m=0;m<n;m++)c=c.double()}return c}function Yo(t){return X0(t.Fp),bi(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ul(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function oc(t){t.lowS!==void 0&&Pd("lowS",t.lowS),t.prehash!==void 0&&Pd("prehash",t.prehash)}function A0(t){let e=Yo(t);bi(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:d,Fp:i,a}=e;if(d){if(!i.eql(a,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof d!="object"||typeof d.beta!="bigint"||typeof d.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:w0,hexToBytes:M0}=b0,md={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(t,e)=>{let{Err:d}=md;if(t<0||t>256)throw new d("tlv.encode: wrong tag");if(e.length&1)throw new d("tlv.encode: unpadded data");let i=e.length/2,a=qi(i);if(a.length/2&128)throw new d("tlv.encode: long form length too big");let n=i>127?qi(a.length/2|128):"";return`${qi(t)}${n}${a}${e}`},decode(t,e){let{Err:d}=md,i=0;if(t<0||t>256)throw new d("tlv.encode: wrong tag");if(e.length<2||e[i++]!==t)throw new d("tlv.decode: wrong tlv");let a=e[i++],n=!!(a&128),r=0;if(!n)r=a;else{let s=a&127;if(!s)throw new d("tlv.decode(long): indefinite length not supported");if(s>4)throw new d("tlv.decode(long): byte length is too big");let c=e.subarray(i,i+s);if(c.length!==s)throw new d("tlv.decode: length bytes not complete");if(c[0]===0)throw new d("tlv.decode(long): zero leftmost byte");for(let p of c)r=r<<8|p;if(i+=s,r<128)throw new d("tlv.decode(long): not minimal encoding")}let o=e.subarray(i,i+r);if(o.length!==r)throw new d("tlv.decode: wrong value length");return{v:o,l:e.subarray(i+r)}}},_int:{encode(t){let{Err:e}=md;if(t<yd)throw new e("integer: negative integers are not allowed");let d=qi(t);if(Number.parseInt(d[0],16)&8&&(d="00"+d),d.length&1)throw new e("unexpected assertion");return d},decode(t){let{Err:e}=md;if(t[0]&128)throw new e("Invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return w0(t)}},toSig(t){let{Err:e,_int:d,_tlv:i}=md,a=typeof t=="string"?M0(t):t;za(a);let{v:n,l:r}=i.decode(48,a);if(r.length)throw new e("Invalid signature: left bytes after parsing");let{v:o,l:s}=i.decode(2,n),{v:c,l:p}=i.decode(2,s);if(p.length)throw new e("Invalid signature: left bytes after parsing");return{r:d.decode(o),s:d.decode(c)}},hexFromSig(t){let{_tlv:e,_int:d}=md,i=`${e.encode(2,d.encode(t.r))}${e.encode(2,d.encode(t.s))}`;return e.encode(48,i)}},yd=BigInt(0),Qe=BigInt(1);BigInt(2);var sc=BigInt(3);BigInt(4);function x0(t){let e=A0(t),{Fp:d}=e,i=$t(e.n,e.nBitLength),a=e.toBytes||((y,P,f)=>{let E=P.toAffine();return gi(Uint8Array.from([4]),d.toBytes(E.x),d.toBytes(E.y))}),n=e.fromBytes||(y=>{let P=y.subarray(1),f=d.fromBytes(P.subarray(0,d.BYTES)),E=d.fromBytes(P.subarray(d.BYTES,2*d.BYTES));return{x:f,y:E}});function r(y){let{a:P,b:f}=e,E=d.sqr(y),v=d.mul(E,y);return d.add(d.add(v,d.mul(y,P)),f)}if(!d.eql(d.sqr(e.Gy),r(e.Gx)))throw new Error("bad generator point: equation left != right");function o(y){return tr(y,Qe,e.n)}function s(y){let{allowedPrivateKeyLengths:P,nByteLength:f,wrapPrivateKey:E,n:v}=e;if(P&&typeof y!="bigint"){if(Si(y)&&(y=Pi(y)),typeof y!="string"||!P.includes(y.length))throw new Error("Invalid key");y=y.padStart(f*2,"0")}let F;try{F=typeof y=="bigint"?y:li(Le("private key",y,f))}catch{throw new Error(`private key must be ${f} bytes, hex or bigint, not ${typeof y}`)}return E&&(F=Re(F,v)),pt("private key",F,Qe,v),F}function c(y){if(!(y instanceof m))throw new Error("ProjectivePoint expected")}let p=Ta((y,P)=>{let{px:f,py:E,pz:v}=y;if(d.eql(v,d.ONE))return{x:f,y:E};let F=y.is0();P==null&&(P=F?d.ONE:d.inv(v));let D=d.mul(f,P),h=d.mul(E,P),X=d.mul(v,P);if(F)return{x:d.ZERO,y:d.ZERO};if(!d.eql(X,d.ONE))throw new Error("invZ was invalid");return{x:D,y:h}}),u=Ta(y=>{if(y.is0()){if(e.allowInfinityPoint&&!d.is0(y.py))return;throw new Error("bad point: ZERO")}let{x:P,y:f}=y.toAffine();if(!d.isValid(P)||!d.isValid(f))throw new Error("bad point: x or y not FE");let E=d.sqr(f),v=r(P);if(!d.eql(E,v))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(P,f,E){if(this.px=P,this.py=f,this.pz=E,P==null||!d.isValid(P))throw new Error("x required");if(f==null||!d.isValid(f))throw new Error("y required");if(E==null||!d.isValid(E))throw new Error("z required");Object.freeze(this)}static fromAffine(P){let{x:f,y:E}=P||{};if(!P||!d.isValid(f)||!d.isValid(E))throw new Error("invalid affine point");if(P instanceof m)throw new Error("projective point not allowed");let v=F=>d.eql(F,d.ZERO);return v(f)&&v(E)?m.ZERO:new m(f,E,d.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(P){let f=d.invertBatch(P.map(E=>E.pz));return P.map((E,v)=>E.toAffine(f[v])).map(m.fromAffine)}static fromHex(P){let f=m.fromAffine(n(Le("pointHex",P)));return f.assertValidity(),f}static fromPrivateKey(P){return m.BASE.multiply(s(P))}static msm(P,f){return jl(m,i,P,f)}_setWindowSize(P){g.setWindowSize(this,P)}assertValidity(){u(this)}hasEvenY(){let{y:P}=this.toAffine();if(d.isOdd)return!d.isOdd(P);throw new Error("Field doesn't support isOdd")}equals(P){c(P);let{px:f,py:E,pz:v}=this,{px:F,py:D,pz:h}=P,X=d.eql(d.mul(f,h),d.mul(F,v)),b=d.eql(d.mul(E,h),d.mul(D,v));return X&&b}negate(){return new m(this.px,d.neg(this.py),this.pz)}double(){let{a:P,b:f}=e,E=d.mul(f,sc),{px:v,py:F,pz:D}=this,h=d.ZERO,X=d.ZERO,b=d.ZERO,T=d.mul(v,v),C=d.mul(F,F),R=d.mul(D,D),M=d.mul(v,F);return M=d.add(M,M),b=d.mul(v,D),b=d.add(b,b),h=d.mul(P,b),X=d.mul(E,R),X=d.add(h,X),h=d.sub(C,X),X=d.add(C,X),X=d.mul(h,X),h=d.mul(M,h),b=d.mul(E,b),R=d.mul(P,R),M=d.sub(T,R),M=d.mul(P,M),M=d.add(M,b),b=d.add(T,T),T=d.add(b,T),T=d.add(T,R),T=d.mul(T,M),X=d.add(X,T),R=d.mul(F,D),R=d.add(R,R),T=d.mul(R,M),h=d.sub(h,T),b=d.mul(R,C),b=d.add(b,b),b=d.add(b,b),new m(h,X,b)}add(P){c(P);let{px:f,py:E,pz:v}=this,{px:F,py:D,pz:h}=P,X=d.ZERO,b=d.ZERO,T=d.ZERO,C=e.a,R=d.mul(e.b,sc),M=d.mul(f,F),x=d.mul(E,D),N=d.mul(v,h),w=d.add(f,E),A=d.add(F,D);w=d.mul(w,A),A=d.add(M,x),w=d.sub(w,A),A=d.add(f,v);let U=d.add(F,h);return A=d.mul(A,U),U=d.add(M,N),A=d.sub(A,U),U=d.add(E,v),X=d.add(D,h),U=d.mul(U,X),X=d.add(x,N),U=d.sub(U,X),T=d.mul(C,A),X=d.mul(R,N),T=d.add(X,T),X=d.sub(x,T),T=d.add(x,T),b=d.mul(X,T),x=d.add(M,M),x=d.add(x,M),N=d.mul(C,N),A=d.mul(R,A),x=d.add(x,N),N=d.sub(M,N),N=d.mul(C,N),A=d.add(A,N),M=d.mul(x,A),b=d.add(b,M),M=d.mul(U,A),X=d.mul(w,X),X=d.sub(X,M),M=d.mul(w,x),T=d.mul(U,T),T=d.add(T,M),new m(X,b,T)}subtract(P){return this.add(P.negate())}is0(){return this.equals(m.ZERO)}wNAF(P){return g.wNAFCached(this,P,m.normalizeZ)}multiplyUnsafe(P){pt("scalar",P,yd,e.n);let f=m.ZERO;if(P===yd)return f;if(P===Qe)return this;let{endo:E}=e;if(!E)return g.unsafeLadder(this,P);let{k1neg:v,k1:F,k2neg:D,k2:h}=E.splitScalar(P),X=f,b=f,T=this;for(;F>yd||h>yd;)F&Qe&&(X=X.add(T)),h&Qe&&(b=b.add(T)),T=T.double(),F>>=Qe,h>>=Qe;return v&&(X=X.negate()),D&&(b=b.negate()),b=new m(d.mul(b.px,E.beta),b.py,b.pz),X.add(b)}multiply(P){let{endo:f,n:E}=e;pt("scalar",P,Qe,E);let v,F;if(f){let{k1neg:D,k1:h,k2neg:X,k2:b}=f.splitScalar(P),{p:T,f:C}=this.wNAF(h),{p:R,f:M}=this.wNAF(b);T=g.constTimeNegate(D,T),R=g.constTimeNegate(X,R),R=new m(d.mul(R.px,f.beta),R.py,R.pz),v=T.add(R),F=C.add(M)}else{let{p:D,f:h}=this.wNAF(P);v=D,F=h}return m.normalizeZ([v,F])[0]}multiplyAndAddUnsafe(P,f,E){let v=m.BASE,F=(h,X)=>X===yd||X===Qe||!h.equals(v)?h.multiplyUnsafe(X):h.multiply(X),D=F(this,f).add(F(P,E));return D.is0()?void 0:D}toAffine(P){return p(this,P)}isTorsionFree(){let{h:P,isTorsionFree:f}=e;if(P===Qe)return!0;if(f)return f(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:P,clearCofactor:f}=e;return P===Qe?this:f?f(m,this):this.multiplyUnsafe(e.h)}toRawBytes(P=!0){return Pd("isCompressed",P),this.assertValidity(),a(m,this,P)}toHex(P=!0){return Pd("isCompressed",P),Pi(this.toRawBytes(P))}}m.BASE=new m(e.Gx,e.Gy,d.ONE),m.ZERO=new m(d.ZERO,d.ONE,d.ZERO);let S=e.nBitLength,g=Bl(m,e.endo?Math.ceil(S/2):S);return{CURVE:e,ProjectivePoint:m,normPrivateKeyToScalar:s,weierstrassEquation:r,isWithinCurveOrder:o}}function L0(t){let e=Yo(t);return bi(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function O0(t){let e=L0(t),{Fp:d,n:i}=e,a=d.BYTES+1,n=2*d.BYTES+1;function r(N){return Re(N,i)}function o(N){return co(N,i)}let{ProjectivePoint:s,normPrivateKeyToScalar:c,weierstrassEquation:p,isWithinCurveOrder:u}=x0({...e,toBytes(N,w,A){let U=w.toAffine(),L=d.toBytes(U.x),j=gi;return Pd("isCompressed",A),A?j(Uint8Array.from([w.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,d.toBytes(U.y))},fromBytes(N){let w=N.length,A=N[0],U=N.subarray(1);if(w===a&&(A===2||A===3)){let L=li(U);if(!tr(L,Qe,d.ORDER))throw new Error("Point is not on curve");let j=p(L),B;try{B=d.sqrt(j)}catch(Y){let Q=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+Q)}let H=(B&Qe)===Qe;return(A&1)===1!==H&&(B=d.neg(B)),{x:L,y:B}}else if(w===n&&A===4){let L=d.fromBytes(U.subarray(0,d.BYTES)),j=d.fromBytes(U.subarray(d.BYTES,2*d.BYTES));return{x:L,y:j}}else throw new Error(`Point of length ${w} was invalid. Expected ${a} compressed bytes or ${n} uncompressed bytes`)}}),m=N=>Pi(Ji(N,e.nByteLength));function S(N){let w=i>>Qe;return N>w}function g(N){return S(N)?r(-N):N}let y=(N,w,A)=>li(N.slice(w,A));class P{constructor(w,A,U){this.r=w,this.s=A,this.recovery=U,this.assertValidity()}static fromCompact(w){let A=e.nByteLength;return w=Le("compactSignature",w,A*2),new P(y(w,0,A),y(w,A,2*A))}static fromDER(w){let{r:A,s:U}=md.toSig(Le("DER",w));return new P(A,U)}assertValidity(){pt("r",this.r,Qe,i),pt("s",this.s,Qe,i)}addRecoveryBit(w){return new P(this.r,this.s,w)}recoverPublicKey(w){let{r:A,s:U,recovery:L}=this,j=h(Le("msgHash",w));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");let B=L===2||L===3?A+e.n:A;if(B>=d.ORDER)throw new Error("recovery id 2 or 3 invalid");let H=(L&1)===0?"02":"03",Y=s.fromHex(H+m(B)),Q=o(B),W=r(-j*Q),G=r(U*Q),K=s.BASE.multiplyAndAddUnsafe(Y,W,G);if(!K)throw new Error("point at infinify");return K.assertValidity(),K}hasHighS(){return S(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,r(-this.s),this.recovery):this}toDERRawBytes(){return _i(this.toDERHex())}toDERHex(){return md.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return _i(this.toCompactHex())}toCompactHex(){return m(this.r)+m(this.s)}}let f={isValidPrivateKey(N){try{return c(N),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{let N=ql(e.n);return R0(e.randomBytes(N),e.n)},precompute(N=8,w=s.BASE){return w._setWindowSize(N),w.multiply(BigInt(3)),w}};function E(N,w=!0){return s.fromPrivateKey(N).toRawBytes(w)}function v(N){let w=Si(N),A=typeof N=="string",U=(w||A)&&N.length;return w?U===a||U===n:A?U===2*a||U===2*n:N instanceof s}function F(N,w,A=!0){if(v(N))throw new Error("first arg must be private key");if(!v(w))throw new Error("second arg must be public key");return s.fromHex(w).multiply(c(N)).toRawBytes(A)}let D=e.bits2int||function(N){let w=li(N),A=N.length*8-e.nBitLength;return A>0?w>>BigInt(A):w},h=e.bits2int_modN||function(N){return r(D(N))},X=Ko(e.nBitLength);function b(N){return pt(`num < 2^${e.nBitLength}`,N,yd,X),Ji(N,e.nByteLength)}function T(N,w,A=C){if(["recovered","canonical"].some(_=>_ in A))throw new Error("sign() legacy options not supported");let{hash:U,randomBytes:L}=e,{lowS:j,prehash:B,extraEntropy:H}=A;j==null&&(j=!0),N=Le("msgHash",N),oc(A),B&&(N=Le("prehashed msgHash",U(N)));let Y=h(N),Q=c(w),W=[b(Q),b(Y)];if(H!=null&&H!==!1){let _=H===!0?L(d.BYTES):H;W.push(Le("extraEntropy",_))}let G=gi(...W),K=Y;function te(_){let Z=D(_);if(!u(Z))return;let de=o(Z),oe=s.BASE.multiply(Z).toAffine(),pe=r(oe.x);if(pe===yd)return;let fe=r(de*r(K+pe*Q));if(fe===yd)return;let me=(oe.x===pe?0:2)|Number(oe.y&Qe),Pe=fe;return j&&S(fe)&&(Pe=g(fe),me^=1),new P(pe,Pe,me)}return{seed:G,k2sig:te}}let C={lowS:e.lowS,prehash:!1},R={lowS:e.lowS,prehash:!1};function M(N,w,A=C){let{seed:U,k2sig:L}=T(N,w,A),j=e;return Ll(j.hash.outputLen,j.nByteLength,j.hmac)(U,L)}s.BASE._setWindowSize(8);function x(N,w,A,U=R){let L=N;if(w=Le("msgHash",w),A=Le("publicKey",A),"strict"in U)throw new Error("options.strict was renamed to lowS");oc(U);let{lowS:j,prehash:B}=U,H,Y;try{if(typeof L=="string"||Si(L))try{H=P.fromDER(L)}catch(de){if(!(de instanceof md.Err))throw de;H=P.fromCompact(L)}else if(typeof L=="object"&&typeof L.r=="bigint"&&typeof L.s=="bigint"){let{r:de,s:oe}=L;H=new P(de,oe)}else throw new Error("PARSE");Y=s.fromHex(A)}catch(de){if(de.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(j&&H.hasHighS())return!1;B&&(w=e.hash(w));let{r:Q,s:W}=H,G=h(w),K=o(W),te=r(G*K),_=r(Q*K),Z=s.BASE.multiplyAndAddUnsafe(Y,te,_)?.toAffine();return Z?r(Z.x)===Q:!1}return{CURVE:e,getPublicKey:E,getSharedSecret:F,sign:M,verify:x,ProjectivePoint:s,Signature:P,utils:f}}function U0(t){return{hash:t,hmac:(e,...d)=>Ml(t,e,Dl(...d)),randomBytes:zo}}function Fi(t,e){let d=i=>O0({...t,...U0(i)});return Object.freeze({...d(e),create:d})}var Gl=$t(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),k0=Gl.create(BigInt("-3")),q0=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),B0=Fi({a:k0,b:q0,Fp:Gl,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},Zn),tn=BigInt(2**32-1),po=BigInt(32);function Ql(t,e=!1){return e?{h:Number(t&tn),l:Number(t>>po&tn)}:{h:Number(t>>po&tn)|0,l:Number(t&tn)|0}}function Vl(t,e=!1){let d=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let a=0;a<t.length;a++){let{h:n,l:r}=Ql(t[a],e);[d[a],i[a]]=[n,r]}return[d,i]}var j0=(t,e)=>BigInt(t>>>0)<<po|BigInt(e>>>0),G0=(t,e,d)=>t>>>d,Q0=(t,e,d)=>t<<32-d|e>>>d,V0=(t,e,d)=>t>>>d|e<<32-d,z0=(t,e,d)=>t<<32-d|e>>>d,H0=(t,e,d)=>t<<64-d|e>>>d-32,W0=(t,e,d)=>t>>>d-32|e<<64-d,K0=(t,e)=>e,Y0=(t,e)=>t,zl=(t,e,d)=>t<<d|e>>>32-d,Hl=(t,e,d)=>e<<d|t>>>32-d,Wl=(t,e,d)=>e<<d-32|t>>>64-d,Kl=(t,e,d)=>t<<d-32|e>>>64-d;function _0(t,e,d,i){let a=(e>>>0)+(i>>>0);return{h:t+d+(a/2**32|0)|0,l:a|0}}var J0=(t,e,d)=>(t>>>0)+(e>>>0)+(d>>>0),$0=(t,e,d,i)=>e+d+i+(t/2**32|0)|0,Z0=(t,e,d,i)=>(t>>>0)+(e>>>0)+(d>>>0)+(i>>>0),e1=(t,e,d,i,a)=>e+d+i+a+(t/2**32|0)|0,t1=(t,e,d,i,a)=>(t>>>0)+(e>>>0)+(d>>>0)+(i>>>0)+(a>>>0),d1=(t,e,d,i,a,n)=>e+d+i+a+n+(t/2**32|0)|0,ce={fromBig:Ql,split:Vl,toBig:j0,shrSH:G0,shrSL:Q0,rotrSH:V0,rotrSL:z0,rotrBH:H0,rotrBL:W0,rotr32H:K0,rotr32L:Y0,rotlSH:zl,rotlSL:Hl,rotlBH:Wl,rotlBL:Kl,add:_0,add3L:J0,add3H:$0,add4L:Z0,add4H:e1,add5H:d1,add5L:t1},[i1,a1]=ce.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Xd=new Uint32Array(80),Td=new Uint32Array(80),Yl=class extends Va{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:d,Bl:i,Ch:a,Cl:n,Dh:r,Dl:o,Eh:s,El:c,Fh:p,Fl:u,Gh:m,Gl:S,Hh:g,Hl:y}=this;return[t,e,d,i,a,n,r,o,s,c,p,u,m,S,g,y]}set(t,e,d,i,a,n,r,o,s,c,p,u,m,S,g,y){this.Ah=t|0,this.Al=e|0,this.Bh=d|0,this.Bl=i|0,this.Ch=a|0,this.Cl=n|0,this.Dh=r|0,this.Dl=o|0,this.Eh=s|0,this.El=c|0,this.Fh=p|0,this.Fl=u|0,this.Gh=m|0,this.Gl=S|0,this.Hh=g|0,this.Hl=y|0}process(t,e){for(let E=0;E<16;E++,e+=4)Xd[E]=t.getUint32(e),Td[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let v=Xd[E-15]|0,F=Td[E-15]|0,D=ce.rotrSH(v,F,1)^ce.rotrSH(v,F,8)^ce.shrSH(v,F,7),h=ce.rotrSL(v,F,1)^ce.rotrSL(v,F,8)^ce.shrSL(v,F,7),X=Xd[E-2]|0,b=Td[E-2]|0,T=ce.rotrSH(X,b,19)^ce.rotrBH(X,b,61)^ce.shrSH(X,b,6),C=ce.rotrSL(X,b,19)^ce.rotrBL(X,b,61)^ce.shrSL(X,b,6),R=ce.add4L(h,C,Td[E-7],Td[E-16]),M=ce.add4H(R,D,T,Xd[E-7],Xd[E-16]);Xd[E]=M|0,Td[E]=R|0}let{Ah:d,Al:i,Bh:a,Bl:n,Ch:r,Cl:o,Dh:s,Dl:c,Eh:p,El:u,Fh:m,Fl:S,Gh:g,Gl:y,Hh:P,Hl:f}=this;for(let E=0;E<80;E++){let v=ce.rotrSH(p,u,14)^ce.rotrSH(p,u,18)^ce.rotrBH(p,u,41),F=ce.rotrSL(p,u,14)^ce.rotrSL(p,u,18)^ce.rotrBL(p,u,41),D=p&m^~p&g,h=u&S^~u&y,X=ce.add5L(f,F,h,a1[E],Td[E]),b=ce.add5H(X,P,v,D,i1[E],Xd[E]),T=X|0,C=ce.rotrSH(d,i,28)^ce.rotrBH(d,i,34)^ce.rotrBH(d,i,39),R=ce.rotrSL(d,i,28)^ce.rotrBL(d,i,34)^ce.rotrBL(d,i,39),M=d&a^d&r^a&r,x=i&n^i&o^n&o;P=g|0,f=y|0,g=m|0,y=S|0,m=p|0,S=u|0,{h:p,l:u}=ce.add(s|0,c|0,b|0,T|0),s=r|0,c=o|0,r=a|0,o=n|0,a=d|0,n=i|0;let N=ce.add3L(T,R,x);d=ce.add3H(N,b,C,M),i=N|0}({h:d,l:i}=ce.add(this.Ah|0,this.Al|0,d|0,i|0)),{h:a,l:n}=ce.add(this.Bh|0,this.Bl|0,a|0,n|0),{h:r,l:o}=ce.add(this.Ch|0,this.Cl|0,r|0,o|0),{h:s,l:c}=ce.add(this.Dh|0,this.Dl|0,s|0,c|0),{h:p,l:u}=ce.add(this.Eh|0,this.El|0,p|0,u|0),{h:m,l:S}=ce.add(this.Fh|0,this.Fl|0,m|0,S|0),{h:g,l:y}=ce.add(this.Gh|0,this.Gl|0,g|0,y|0),{h:P,l:f}=ce.add(this.Hh|0,this.Hl|0,P|0,f|0),this.set(d,i,a,n,r,o,s,c,p,u,m,S,g,y,P,f)}roundClean(){Xd.fill(0),Td.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},n1=class extends Yl{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},_o=Jt(()=>new Yl),Jo=Jt(()=>new n1),r1=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),_l=$t(r1),o1=_l.create(BigInt("-3")),s1=BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),c1=Fi({a:o1,b:s1,Fp:_l,n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),h:BigInt(1),lowS:!1},Jo),p1=BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),lo=$t(p1),Ai={a:lo.create(BigInt("-3")),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Fp:lo,n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),h:BigInt(1)},l1=Fi({a:Ai.a,b:Ai.b,Fp:lo,n:Ai.n,Gx:Ai.Gx,Gy:Ai.Gy,h:Ai.h,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},_o),Jl=[],$l=[],Zl=[],u1=BigInt(0),la=BigInt(1),m1=BigInt(2),y1=BigInt(7),S1=BigInt(256),P1=BigInt(113);for(let t=0,e=la,d=1,i=0;t<24;t++){[d,i]=[i,(2*d+3*i)%5],Jl.push(2*(5*i+d)),$l.push((t+1)*(t+2)/2%64);let a=u1;for(let n=0;n<7;n++)e=(e<<la^(e>>y1)*P1)%S1,e&m1&&(a^=la<<(la<<BigInt(n))-la);Zl.push(a)}var[g1,h1]=Vl(Zl,!0),cc=(t,e,d)=>d>32?Wl(t,e,d):zl(t,e,d),pc=(t,e,d)=>d>32?Kl(t,e,d):Hl(t,e,d);function f1(t,e=24){let d=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let r=0;r<10;r++)d[r]=t[r]^t[r+10]^t[r+20]^t[r+30]^t[r+40];for(let r=0;r<10;r+=2){let o=(r+8)%10,s=(r+2)%10,c=d[s],p=d[s+1],u=cc(c,p,1)^d[o],m=pc(c,p,1)^d[o+1];for(let S=0;S<50;S+=10)t[r+S]^=u,t[r+S+1]^=m}let a=t[2],n=t[3];for(let r=0;r<24;r++){let o=$l[r],s=cc(a,n,o),c=pc(a,n,o),p=Jl[r];a=t[p],n=t[p+1],t[p]=s,t[p+1]=c}for(let r=0;r<50;r+=10){for(let o=0;o<10;o++)d[o]=t[r+o];for(let o=0;o<10;o++)t[r+o]^=~d[(o+2)%10]&d[(o+4)%10]}t[0]^=g1[i],t[1]^=h1[i]}d.fill(0)}var eu=class tu extends Vo{constructor(e,d,i,a=!1,n=24){if(super(),this.blockLen=e,this.suffix=d,this.outputLen=i,this.enableXOF=a,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ln(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=n0(this.state)}keccak(){ec||tc(this.state32),f1(this.state32,this.rounds),ec||tc(this.state32),this.posOut=0,this.pos=0}update(e){Yi(this);let{blockLen:d,state:i}=this;e=Qa(e);let a=e.length;for(let n=0;n<a;){let r=Math.min(d-this.pos,a-n);for(let o=0;o<r;o++)i[this.pos++]^=e[n++];this.pos===d&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:d,pos:i,blockLen:a}=this;e[i]^=d,(d&128)!==0&&i===a-1&&this.keccak(),e[a-1]^=128,this.keccak()}writeInto(e){Yi(this,!1),Ga(e),this.finish();let d=this.state,{blockLen:i}=this;for(let a=0,n=e.length;a<n;){this.posOut>=i&&this.keccak();let r=Math.min(i-this.posOut,n-a);e.set(d.subarray(this.posOut,this.posOut+r),a),this.posOut+=r,a+=r}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ln(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Xl(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:d,suffix:i,outputLen:a,rounds:n,enableXOF:r}=this;return e||(e=new tu(d,i,a,r,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=a,e.enableXOF=r,e.destroyed=this.destroyed,e}},du=(t,e,d)=>Jt(()=>new eu(e,t,d)),I1=du(6,136,256/8),b1=du(6,72,512/8),F1=(t,e,d)=>o0((i={})=>new eu(e,t,i.dkLen===void 0?d:i.dkLen,!0)),iu=F1(31,136,256/8),Rt=BigInt(0),ot=BigInt(1),dn=BigInt(2),E1=BigInt(8),v1={zip215:!0};function C1(t){let e=Yo(t);return bi(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function X1(t){let e=C1(t),{Fp:d,n:i,prehash:a,hash:n,randomBytes:r,nByteLength:o,h:s}=e,c=dn<<BigInt(o*8)-ot,p=d.create,u=$t(e.n,e.nBitLength),m=e.uvRatio||((w,A)=>{try{return{isValid:!0,value:d.sqrt(w*d.inv(A))}}catch{return{isValid:!1,value:Rt}}}),S=e.adjustScalarBytes||(w=>w),g=e.domain||((w,A,U)=>{if(Pd("phflag",U),A.length||U)throw new Error("Contexts/pre-hash are not supported");return w});function y(w,A){pt("coordinate "+w,A,Rt,c)}function P(w){if(!(w instanceof v))throw new Error("ExtendedPoint expected")}let f=Ta((w,A)=>{let{ex:U,ey:L,ez:j}=w,B=w.is0();A==null&&(A=B?E1:d.inv(j));let H=p(U*A),Y=p(L*A),Q=p(j*A);if(B)return{x:Rt,y:ot};if(Q!==ot)throw new Error("invZ was invalid");return{x:H,y:Y}}),E=Ta(w=>{let{a:A,d:U}=e;if(w.is0())throw new Error("bad point: ZERO");let{ex:L,ey:j,ez:B,et:H}=w,Y=p(L*L),Q=p(j*j),W=p(B*B),G=p(W*W),K=p(Y*A),te=p(W*p(K+Q)),_=p(G+p(U*p(Y*Q)));if(te!==_)throw new Error("bad point: equation left != right (1)");let Z=p(L*j),de=p(B*H);if(Z!==de)throw new Error("bad point: equation left != right (2)");return!0});class v{constructor(A,U,L,j){this.ex=A,this.ey=U,this.ez=L,this.et=j,y("x",A),y("y",U),y("z",L),y("t",j),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(A){if(A instanceof v)throw new Error("extended point not allowed");let{x:U,y:L}=A||{};return y("x",U),y("y",L),new v(U,L,ot,p(U*L))}static normalizeZ(A){let U=d.invertBatch(A.map(L=>L.ez));return A.map((L,j)=>L.toAffine(U[j])).map(v.fromAffine)}static msm(A,U){return jl(v,u,A,U)}_setWindowSize(A){h.setWindowSize(this,A)}assertValidity(){E(this)}equals(A){P(A);let{ex:U,ey:L,ez:j}=this,{ex:B,ey:H,ez:Y}=A,Q=p(U*Y),W=p(B*j),G=p(L*Y),K=p(H*j);return Q===W&&G===K}is0(){return this.equals(v.ZERO)}negate(){return new v(p(-this.ex),this.ey,this.ez,p(-this.et))}double(){let{a:A}=e,{ex:U,ey:L,ez:j}=this,B=p(U*U),H=p(L*L),Y=p(dn*p(j*j)),Q=p(A*B),W=U+L,G=p(p(W*W)-B-H),K=Q+H,te=K-Y,_=Q-H,Z=p(G*te),de=p(K*_),oe=p(G*_),pe=p(te*K);return new v(Z,de,pe,oe)}add(A){P(A);let{a:U,d:L}=e,{ex:j,ey:B,ez:H,et:Y}=this,{ex:Q,ey:W,ez:G,et:K}=A;if(U===BigInt(-1)){let k=p((B-j)*(W+Q)),q=p((B+j)*(W-Q)),ee=p(q-k);if(ee===Rt)return this.double();let ne=p(H*dn*K),$=p(Y*dn*G),ye=$+ne,Ae=q+k,Tt=$-ne,id=p(ye*ee),Ci=p(Ae*Tt),Xi=p(ye*Tt),Ti=p(ee*Ae);return new v(id,Ci,Ti,Xi)}let te=p(j*Q),_=p(B*W),Z=p(Y*L*K),de=p(H*G),oe=p((j+B)*(Q+W)-te-_),pe=de-Z,fe=de+Z,me=p(_-U*te),Pe=p(oe*pe),dd=p(fe*me),vi=p(oe*me),Kd=p(pe*fe);return new v(Pe,dd,Kd,vi)}subtract(A){return this.add(A.negate())}wNAF(A){return h.wNAFCached(this,A,v.normalizeZ)}multiply(A){let U=A;pt("scalar",U,ot,i);let{p:L,f:j}=this.wNAF(U);return v.normalizeZ([L,j])[0]}multiplyUnsafe(A){let U=A;return pt("scalar",U,Rt,i),U===Rt?D:this.equals(D)||U===ot?this:this.equals(F)?this.wNAF(U).p:h.unsafeLadder(this,U)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}isTorsionFree(){return h.unsafeLadder(this,i).is0()}toAffine(A){return f(this,A)}clearCofactor(){let{h:A}=e;return A===ot?this:this.multiplyUnsafe(A)}static fromHex(A,U=!1){let{d:L,a:j}=e,B=d.BYTES;A=Le("pointHex",A,B),Pd("zip215",U);let H=A.slice(),Y=A[B-1];H[B-1]=Y&-129;let Q=Ud(H),W=U?c:d.ORDER;pt("pointHex.y",Q,Rt,W);let G=p(Q*Q),K=p(G-ot),te=p(L*G-j),{isValid:_,value:Z}=m(K,te);if(!_)throw new Error("Point.fromHex: invalid y coordinate");let de=(Z&ot)===ot,oe=(Y&128)!==0;if(!U&&Z===Rt&&oe)throw new Error("Point.fromHex: x=0 and x_0=1");return oe!==de&&(Z=p(-Z)),v.fromAffine({x:Z,y:Q})}static fromPrivateKey(A){return T(A).point}toRawBytes(){let{x:A,y:U}=this.toAffine(),L=$i(U,d.BYTES);return L[L.length-1]|=A&ot?128:0,L}toHex(){return Pi(this.toRawBytes())}}v.BASE=new v(e.Gx,e.Gy,ot,p(e.Gx*e.Gy)),v.ZERO=new v(Rt,ot,ot,Rt);let{BASE:F,ZERO:D}=v,h=Bl(v,o*8);function X(w){return Re(w,i)}function b(w){return X(Ud(w))}function T(w){let A=o;w=Le("private key",w,A);let U=Le("hashed private key",n(w),2*A),L=S(U.slice(0,A)),j=U.slice(A,2*A),B=b(L),H=F.multiply(B),Y=H.toRawBytes();return{head:L,prefix:j,scalar:B,point:H,pointBytes:Y}}function C(w){return T(w).pointBytes}function R(w=new Uint8Array,...A){let U=gi(...A);return b(n(g(U,Le("context",w),!!a)))}function M(w,A,U={}){w=Le("message",w),a&&(w=a(w));let{prefix:L,scalar:j,pointBytes:B}=T(A),H=R(U.context,L,w),Y=F.multiply(H).toRawBytes(),Q=R(U.context,Y,B,w),W=X(H+Q*j);pt("signature.s",W,Rt,i);let G=gi(Y,$i(W,d.BYTES));return Le("result",G,o*2)}let x=v1;function N(w,A,U,L=x){let{context:j,zip215:B}=L,H=d.BYTES;w=Le("signature",w,2*H),A=Le("message",A),B!==void 0&&Pd("zip215",B),a&&(A=a(A));let Y=Ud(w.slice(H,2*H)),Q,W,G;try{Q=v.fromHex(U,B),W=v.fromHex(w.slice(0,H),B),G=F.multiplyUnsafe(Y)}catch{return!1}if(!B&&Q.isSmallOrder())return!1;let K=R(j,W.toRawBytes(),Q.toRawBytes(),A);return W.add(Q.multiplyUnsafe(K)).subtract(G).clearCofactor().equals(v.ZERO)}return F._setWindowSize(8),{CURVE:e,getPublicKey:C,sign:M,verify:N,ExtendedPoint:v,utils:{getExtendedPublicKey:T,randomPrivateKey:()=>r(d.BYTES),precompute(w=8,A=v.BASE){return A._setWindowSize(w),A.multiply(BigInt(3)),A}}}}var wi=BigInt(0),Xr=BigInt(1);function T1(t){return bi(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function D1(t){let e=T1(t),{P:d}=e,i=E=>Re(E,d),a=e.montgomeryBits,n=Math.ceil(a/8),r=e.nByteLength,o=e.adjustScalarBytes||(E=>E),s=e.powPminus2||(E=>Ol(E,d-BigInt(2),d));function c(E,v,F){let D=i(E*(v-F));return v=i(v-D),F=i(F+D),[v,F]}let p=(e.a-BigInt(2))/BigInt(4);function u(E,v){pt("u",E,wi,d),pt("scalar",v,wi,d);let F=v,D=E,h=Xr,X=wi,b=E,T=Xr,C=wi,R;for(let x=BigInt(a-1);x>=wi;x--){let N=F>>x&Xr;C^=N,R=c(C,h,b),h=R[0],b=R[1],R=c(C,X,T),X=R[0],T=R[1],C=N;let w=h+X,A=i(w*w),U=h-X,L=i(U*U),j=A-L,B=b+T,H=b-T,Y=i(H*w),Q=i(B*U),W=Y+Q,G=Y-Q;b=i(W*W),T=i(D*i(G*G)),h=i(A*L),X=i(j*(A+i(p*j)))}R=c(C,h,b),h=R[0],b=R[1],R=c(C,X,T),X=R[0],T=R[1];let M=s(X);return i(h*M)}function m(E){return $i(i(E),n)}function S(E){let v=Le("u coordinate",E,n);return r===32&&(v[31]&=127),Ud(v)}function g(E){let v=Le("scalar",E),F=v.length;if(F!==n&&F!==r)throw new Error(`Expected ${n} or ${r} bytes, got ${F}`);return Ud(o(v))}function y(E,v){let F=S(v),D=g(E),h=u(F,D);if(h===wi)throw new Error("Invalid private or public key received");return m(h)}let P=m(e.Gu);function f(E){return y(E,P)}return{scalarMult:y,scalarMultBase:f,getSharedSecret:(E,v)=>y(E,v),getPublicKey:E=>f(E),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:P}}var R1=Jt(()=>iu.create({dkLen:114})),$g=Jt(()=>iu.create({dkLen:64})),Da=BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018365439"),N1=BigInt(1),lc=BigInt(2),uc=BigInt(3);BigInt(4);var A1=BigInt(11),w1=BigInt(22),mc=BigInt(44),M1=BigInt(88),x1=BigInt(223);function au(t){let e=Da,d=t*t*t%e,i=d*d*t%e,a=Xe(i,uc,e)*i%e,n=Xe(a,uc,e)*i%e,r=Xe(n,lc,e)*d%e,o=Xe(r,A1,e)*r%e,s=Xe(o,w1,e)*o%e,c=Xe(s,mc,e)*s%e,p=Xe(c,M1,e)*c%e,u=Xe(p,mc,e)*s%e,m=Xe(u,lc,e)*d%e,S=Xe(m,N1,e)*t%e;return Xe(S,x1,e)*m%e}function nu(t){return t[0]&=252,t[55]|=128,t[56]=0,t}function L1(t,e){let d=Da,i=Re(t*t*e,d),a=Re(i*t,d),n=Re(a*i*e,d),r=au(n),o=Re(a*r,d),s=Re(o*o,d);return{isValid:Re(s*e,d)===t,value:o}}var ru=$t(Da,456,!0),ou={a:BigInt(1),d:BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018326358"),Fp:ru,n:BigInt("181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779"),nBitLength:456,h:BigInt(4),Gx:BigInt("224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710"),Gy:BigInt("298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660"),hash:R1,randomBytes:zo,adjustScalarBytes:nu,domain:(t,e,d)=>{if(e.length>255)throw new Error(`Context is too big: ${e.length}`);return Dl(Tl("SigEd448"),new Uint8Array([d?1:0,e.length]),e,t)},uvRatio:L1},O1=X1(ou);({...ou});var U1=D1({a:BigInt(156326),montgomeryBits:448,nByteLength:56,P:Da,Gu:BigInt(5),powPminus2:t=>{let e=Da,d=au(t),i=Xe(d,BigInt(2),e);return Re(i*t,e)},adjustScalarBytes:nu,randomBytes:zo});(ru.ORDER-BigInt(3))/BigInt(4);BigInt(156326);BigInt("39082");BigInt("78163");BigInt("98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214");BigInt("315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716");BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var su=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),yc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),k1=BigInt(1),uo=BigInt(2),Sc=(t,e)=>(t+e/uo)/e;function q1(t){let e=su,d=BigInt(3),i=BigInt(6),a=BigInt(11),n=BigInt(22),r=BigInt(23),o=BigInt(44),s=BigInt(88),c=t*t*t%e,p=c*c*t%e,u=Xe(p,d,e)*p%e,m=Xe(u,d,e)*p%e,S=Xe(m,uo,e)*c%e,g=Xe(S,a,e)*S%e,y=Xe(g,n,e)*g%e,P=Xe(y,o,e)*y%e,f=Xe(P,s,e)*P%e,E=Xe(f,o,e)*y%e,v=Xe(E,d,e)*p%e,F=Xe(v,r,e)*g%e,D=Xe(F,i,e)*c%e,h=Xe(D,uo,e);if(!mo.eql(mo.sqr(h),t))throw new Error("Cannot find square root");return h}var mo=$t(su,void 0,void 0,{sqrt:q1}),cu=Fi({a:BigInt(0),b:BigInt(7),Fp:mo,n:yc,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=yc,d=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-k1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),n=d,r=BigInt("0x100000000000000000000000000000000"),o=Sc(n*t,e),s=Sc(-i*t,e),c=Re(t-o*d-s*a,e),p=Re(-o*i-s*n,e),u=c>r,m=p>r;if(u&&(c=e-c),m&&(p=e-p),c>r||p>r)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:u,k1:c,k2neg:m,k2:p}}}},Zn);BigInt(0);cu.ProjectivePoint;var pu=$t(BigInt("0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377")),B1=pu.create(BigInt("0x7d5a0975fc2c3057eef67530417affe7fb8055c126dc5c6ce94a4b44f330b5d9")),j1=BigInt("0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6"),G1=Fi({a:B1,b:j1,Fp:pu,n:BigInt("0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7"),Gx:BigInt("0x8bd2aeb9cb7e57cb2c4b482ffc81b7afb9de27e1e3bd23c23a4453bd9ace3262"),Gy:BigInt("0x547ef835c3dac4fd97f8461a14611dc9c27745132ded8e545c1d54c72f046997"),h:BigInt(1),lowS:!1},Zn),lu=$t(BigInt("0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53")),Q1=lu.create(BigInt("0x7bc382c63d8c150c3c72080ace05afa0c2bea28e4fb22787139165efba91f90f8aa5814a503ad4eb04a8c7dd22ce2826")),V1=BigInt("0x04a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11"),z1=Fi({a:Q1,b:V1,Fp:lu,n:BigInt("0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565"),Gx:BigInt("0x1d1c64f068cf45ffa2a63a81b7c13f6b8847a3e77ef14fe3db7fcafe0cbd10e8e826e03436d646aaef87b2e247d4af1e"),Gy:BigInt("0x8abe1d7520f9c2a45cb1eb8e95cfd55262b70b29feec5864e19c054ff99129280e4646217791811142820341263c5315"),h:BigInt(1),lowS:!1},Jo),uu=$t(BigInt("0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3")),H1=uu.create(BigInt("0x7830a3318b603b89e2327145ac234cc594cbdd8d3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94ca")),W1=BigInt("0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723"),K1=Fi({a:H1,b:W1,Fp:uu,n:BigInt("0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069"),Gx:BigInt("0x81aee4bdd82ed9645a21322e9c4c6a9385ed9f70b5d916c1b43b62eef4d0098eff3b1f78e2d0d48d50d1687b93b97d5f7c6d5047406a5e688b352209bcb9f822"),Gy:BigInt("0x7dde385d566332ecc0eabfa9cf7822fdf209f70024a57b1aa000c55b881f8111b2dcde494a5f485e5bca4bd88a2763aed1ca2b2fa8f0540678cd1e0f3ad80892"),h:BigInt(1),lowS:!1},_o),Y1=new Map(Object.entries({nistP256:B0,nistP384:c1,nistP521:l1,brainpoolP256r1:G1,brainpoolP384r1:z1,brainpoolP512r1:K1,secp256k1:cu,x448:U1,ed448:O1})),_1=Object.freeze({__proto__:null,nobleCurves:Y1}),ua=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Dd=new Uint32Array(80),J1=class extends Va{constructor(){super(64,20,8,!1),this.A=ua[0]|0,this.B=ua[1]|0,this.C=ua[2]|0,this.D=ua[3]|0,this.E=ua[4]|0}get(){let{A:t,B:e,C:d,D:i,E:a}=this;return[t,e,d,i,a]}set(t,e,d,i,a){this.A=t|0,this.B=e|0,this.C=d|0,this.D=i|0,this.E=a|0}process(t,e){for(let o=0;o<16;o++,e+=4)Dd[o]=t.getUint32(e,!1);for(let o=16;o<80;o++)Dd[o]=Od(Dd[o-3]^Dd[o-8]^Dd[o-14]^Dd[o-16],1);let{A:d,B:i,C:a,D:n,E:r}=this;for(let o=0;o<80;o++){let s,c;o<20?(s=Rl(i,a,n),c=1518500249):o<40?(s=i^a^n,c=1859775393):o<60?(s=Nl(i,a,n),c=2400959708):(s=i^a^n,c=3395469782);let p=Od(d,5)+s+r+c+Dd[o]|0;r=n,n=a,a=Od(i,30),i=d,d=p}d=d+this.A|0,i=i+this.B|0,a=a+this.C|0,n=n+this.D|0,r=r+this.E|0,this.set(d,i,a,n,r)}roundClean(){Dd.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}},$1=Jt(()=>new J1),Z1=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),mu=new Uint8Array(new Array(16).fill(0).map((t,e)=>e)),eP=mu.map(t=>(9*t+5)%16),$o=[mu],Zo=[eP];for(let t=0;t<4;t++)for(let e of[$o,Zo])e.push(e[t].map(d=>Z1[d]));var yu=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),tP=$o.map((t,e)=>t.map(d=>yu[e][d])),dP=Zo.map((t,e)=>t.map(d=>yu[e][d])),iP=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),aP=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function Pc(t,e,d,i){return t===0?e^d^i:t===1?e&d|~e&i:t===2?(e|~d)^i:t===3?e&i|d&~i:e^(d|~i)}var an=new Uint32Array(16),nP=class extends Va{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:e,h2:d,h3:i,h4:a}=this;return[t,e,d,i,a]}set(t,e,d,i,a){this.h0=t|0,this.h1=e|0,this.h2=d|0,this.h3=i|0,this.h4=a|0}process(t,e){for(let m=0;m<16;m++,e+=4)an[m]=t.getUint32(e,!0);let d=this.h0|0,i=d,a=this.h1|0,n=a,r=this.h2|0,o=r,s=this.h3|0,c=s,p=this.h4|0,u=p;for(let m=0;m<5;m++){let S=4-m,g=iP[m],y=aP[m],P=$o[m],f=Zo[m],E=tP[m],v=dP[m];for(let F=0;F<16;F++){let D=Od(d+Pc(m,a,r,s)+an[P[F]]+g,E[F])+p|0;d=p,p=s,s=Od(r,10)|0,r=a,a=D}for(let F=0;F<16;F++){let D=Od(i+Pc(S,n,o,c)+an[f[F]]+y,v[F])+u|0;i=u,u=c,c=Od(o,10)|0,o=n,n=D}}this.set(this.h1+r+c|0,this.h2+s+u|0,this.h3+p+i|0,this.h4+d+n|0,this.h0+a+o|0)}roundClean(){an.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},rP=Jt(()=>new nP),oP=Array.from({length:64},(t,e)=>Math.floor(2**32*Math.abs(Math.sin(e+1)))),gc=(t,e,d)=>t&e^~t&d,nn=new Uint32Array([1732584193,4023233417,2562383102,271733878]),Tr=new Uint32Array(16),sP=class extends Va{constructor(){super(64,16,8,!0),this.A=nn[0]|0,this.B=nn[1]|0,this.C=nn[2]|0,this.D=nn[3]|0}get(){let{A:t,B:e,C:d,D:i}=this;return[t,e,d,i]}set(t,e,d,i){this.A=t|0,this.B=e|0,this.C=d|0,this.D=i|0}process(t,e){for(let r=0;r<16;r++,e+=4)Tr[r]=t.getUint32(e,!0);let{A:d,B:i,C:a,D:n}=this;for(let r=0;r<64;r++){let o,s,c;r<16?(o=gc(i,a,n),s=r,c=[7,12,17,22]):r<32?(o=gc(n,i,a),s=(5*r+1)%16,c=[5,9,14,20]):r<48?(o=i^a^n,s=(3*r+5)%16,c=[4,11,16,23]):(o=a^(i|~n),s=7*r%16,c=[6,10,15,21]),o=o+d+oP[r]+Tr[s],d=n,n=a,a=i,i=i+Od(o,c[r%4])}d=d+this.A|0,i=i+this.B|0,a=a+this.C|0,n=n+this.D|0,this.set(d,i,a,n)}roundClean(){Tr.fill(0)}destroy(){this.set(0,0,0,0),this.buffer.fill(0)}},cP=Jt(()=>new sP),pP=new Map(Object.entries({md5:cP,sha1:$1,sha224:l0,sha256:Zn,sha384:Jo,sha512:_o,sha3_256:I1,sha3_512:b1,ripemd160:rP})),lP=Object.freeze({__proto__:null,nobleHashes:pP});function Dr(t,e,d,i,a,n){let r=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],p=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],u=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],m=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],S=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696],g=0,y,P,f,E,v,F,D,h,X,b,T=e.length,C=t.length===32?3:9;C===3?h=d?[0,32,2]:[30,-2,-2]:h=d?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],d&&(e=uP(e),T=e.length);let R=new Uint8Array(T),M=0;for(;g<T;){for(F=e[g++]<<24|e[g++]<<16|e[g++]<<8|e[g++],D=e[g++]<<24|e[g++]<<16|e[g++]<<8|e[g++],f=(F>>>4^D)&252645135,D^=f,F^=f<<4,f=(F>>>16^D)&65535,D^=f,F^=f<<16,f=(D>>>2^F)&858993459,F^=f,D^=f<<2,f=(D>>>8^F)&16711935,F^=f,D^=f<<8,f=(F>>>1^D)&1431655765,D^=f,F^=f<<1,F=F<<1|F>>>31,D=D<<1|D>>>31,P=0;P<C;P+=3){for(X=h[P+1],b=h[P+2],y=h[P];y!==X;y+=b)E=D^t[y],v=(D>>>4|D<<28)^t[y+1],f=F,F=D,D=f^(o[E>>>24&63]|c[E>>>16&63]|u[E>>>8&63]|S[E&63]|r[v>>>24&63]|s[v>>>16&63]|p[v>>>8&63]|m[v&63]);f=F,F=D,D=f}F=F>>>1|F<<31,D=D>>>1|D<<31,f=(F>>>1^D)&1431655765,D^=f,F^=f<<1,f=(D>>>8^F)&16711935,F^=f,D^=f<<8,f=(D>>>2^F)&858993459,F^=f,D^=f<<2,f=(F>>>16^D)&65535,D^=f,F^=f<<16,f=(F>>>4^D)&252645135,D^=f,F^=f<<4,R[M++]=F>>>24,R[M++]=F>>>16&255,R[M++]=F>>>8&255,R[M++]=F&255,R[M++]=D>>>24,R[M++]=D>>>16&255,R[M++]=D>>>8&255,R[M++]=D&255}return d||(R=mP(R)),R}function Rr(t){let e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],d=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],n=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],r=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],s=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],p=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],u=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],S=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length>8?3:1,P=new Array(32*y),f=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],E,v,F=0,D=0,h;for(let X=0;X<y;X++){let b=t[F++]<<24|t[F++]<<16|t[F++]<<8|t[F++],T=t[F++]<<24|t[F++]<<16|t[F++]<<8|t[F++];h=(b>>>4^T)&252645135,T^=h,b^=h<<4,h=(T>>>-16^b)&65535,b^=h,T^=h<<-16,h=(b>>>2^T)&858993459,T^=h,b^=h<<2,h=(T>>>-16^b)&65535,b^=h,T^=h<<-16,h=(b>>>1^T)&1431655765,T^=h,b^=h<<1,h=(T>>>8^b)&16711935,b^=h,T^=h<<8,h=(b>>>1^T)&1431655765,T^=h,b^=h<<1,h=b<<8|T>>>20&240,b=T<<24|T<<8&16711680|T>>>8&65280|T>>>24&240,T=h;for(let C=0;C<f.length;C++)f[C]?(b=b<<2|b>>>26,T=T<<2|T>>>26):(b=b<<1|b>>>27,T=T<<1|T>>>27),b&=-15,T&=-15,E=e[b>>>28]|d[b>>>24&15]|i[b>>>20&15]|a[b>>>16&15]|n[b>>>12&15]|r[b>>>8&15]|o[b>>>4&15],v=s[T>>>28]|c[T>>>24&15]|p[T>>>20&15]|u[T>>>16&15]|m[T>>>12&15]|S[T>>>8&15]|g[T>>>4&15],h=(v>>>16^E)&65535,P[D++]=E^h,P[D++]=v^h<<16}return P}function uP(t,e){let d=8-t.length%8,i;if(d<8)i=0;else{if(d===8)return t;throw new Error("des: invalid padding")}let a=new Uint8Array(t.length+d);for(let n=0;n<t.length;n++)a[n]=t[n];for(let n=0;n<d;n++)a[t.length+n]=i;return a}function mP(t,e){let d=null,i;if(i=0,!d){for(d=1;t[t.length-d]===i;)d++;d--}return t.subarray(0,t.length-d)}function Ra(t){this.key=[];for(let e=0;e<3;e++)this.key.push(new Uint8Array(t.subarray(e*8,e*8+8)));this.encrypt=function(e){return Dr(Rr(this.key[2]),Dr(Rr(this.key[1]),Dr(Rr(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0)}}Ra.keySize=Ra.prototype.keySize=24;Ra.blockSize=Ra.prototype.blockSize=8;function yP(){this.BlockSize=8,this.KeySize=16,this.setKey=function(r){if(this.masking=new Array(16),this.rotate=new Array(16),this.reset(),r.length===this.KeySize)this.keySchedule(r);else throw new Error("CAST-128: keys must be 16 bytes");return!0},this.reset=function(){for(let r=0;r<16;r++)this.masking[r]=0,this.rotate[r]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(r){let o=new Array(r.length);for(let s=0;s<r.length;s+=8){let c=r[s]<<24|r[s+1]<<16|r[s+2]<<8|r[s+3],p=r[s+4]<<24|r[s+5]<<16|r[s+6]<<8|r[s+7],u;u=p,p=c^d(p,this.masking[0],this.rotate[0]),c=u,u=p,p=c^i(p,this.masking[1],this.rotate[1]),c=u,u=p,p=c^a(p,this.masking[2],this.rotate[2]),c=u,u=p,p=c^d(p,this.masking[3],this.rotate[3]),c=u,u=p,p=c^i(p,this.masking[4],this.rotate[4]),c=u,u=p,p=c^a(p,this.masking[5],this.rotate[5]),c=u,u=p,p=c^d(p,this.masking[6],this.rotate[6]),c=u,u=p,p=c^i(p,this.masking[7],this.rotate[7]),c=u,u=p,p=c^a(p,this.masking[8],this.rotate[8]),c=u,u=p,p=c^d(p,this.masking[9],this.rotate[9]),c=u,u=p,p=c^i(p,this.masking[10],this.rotate[10]),c=u,u=p,p=c^a(p,this.masking[11],this.rotate[11]),c=u,u=p,p=c^d(p,this.masking[12],this.rotate[12]),c=u,u=p,p=c^i(p,this.masking[13],this.rotate[13]),c=u,u=p,p=c^a(p,this.masking[14],this.rotate[14]),c=u,u=p,p=c^d(p,this.masking[15],this.rotate[15]),c=u,o[s]=p>>>24&255,o[s+1]=p>>>16&255,o[s+2]=p>>>8&255,o[s+3]=p&255,o[s+4]=c>>>24&255,o[s+5]=c>>>16&255,o[s+6]=c>>>8&255,o[s+7]=c&255}return o},this.decrypt=function(r){let o=new Array(r.length);for(let s=0;s<r.length;s+=8){let c=r[s]<<24|r[s+1]<<16|r[s+2]<<8|r[s+3],p=r[s+4]<<24|r[s+5]<<16|r[s+6]<<8|r[s+7],u;u=p,p=c^d(p,this.masking[15],this.rotate[15]),c=u,u=p,p=c^a(p,this.masking[14],this.rotate[14]),c=u,u=p,p=c^i(p,this.masking[13],this.rotate[13]),c=u,u=p,p=c^d(p,this.masking[12],this.rotate[12]),c=u,u=p,p=c^a(p,this.masking[11],this.rotate[11]),c=u,u=p,p=c^i(p,this.masking[10],this.rotate[10]),c=u,u=p,p=c^d(p,this.masking[9],this.rotate[9]),c=u,u=p,p=c^a(p,this.masking[8],this.rotate[8]),c=u,u=p,p=c^i(p,this.masking[7],this.rotate[7]),c=u,u=p,p=c^d(p,this.masking[6],this.rotate[6]),c=u,u=p,p=c^a(p,this.masking[5],this.rotate[5]),c=u,u=p,p=c^i(p,this.masking[4],this.rotate[4]),c=u,u=p,p=c^d(p,this.masking[3],this.rotate[3]),c=u,u=p,p=c^a(p,this.masking[2],this.rotate[2]),c=u,u=p,p=c^i(p,this.masking[1],this.rotate[1]),c=u,u=p,p=c^d(p,this.masking[0],this.rotate[0]),c=u,o[s]=p>>>24&255,o[s+1]=p>>>16&255,o[s+2]=p>>>8&255,o[s+3]=p&255,o[s+4]=c>>>24&255,o[s+5]=c>>16&255,o[s+6]=c>>8&255,o[s+7]=c&255}return o};let t=new Array(4);t[0]=new Array(4),t[0][0]=[4,0,13,15,12,14,8],t[0][1]=[5,2,16,18,17,19,10],t[0][2]=[6,3,23,22,21,20,9],t[0][3]=[7,1,26,25,27,24,11],t[1]=new Array(4),t[1][0]=[0,6,21,23,20,22,16],t[1][1]=[1,4,0,2,1,3,18],t[1][2]=[2,5,7,6,5,4,17],t[1][3]=[3,7,10,9,11,8,19],t[2]=new Array(4),t[2][0]=[4,0,13,15,12,14,8],t[2][1]=[5,2,16,18,17,19,10],t[2][2]=[6,3,23,22,21,20,9],t[2][3]=[7,1,26,25,27,24,11],t[3]=new Array(4),t[3][0]=[0,6,21,23,20,22,16],t[3][1]=[1,4,0,2,1,3,18],t[3][2]=[2,5,7,6,5,4,17],t[3][3]=[3,7,10,9,11,8,19];let e=new Array(4);e[0]=new Array(4),e[0][0]=[24,25,23,22,18],e[0][1]=[26,27,21,20,22],e[0][2]=[28,29,19,18,25],e[0][3]=[30,31,17,16,28],e[1]=new Array(4),e[1][0]=[3,2,12,13,8],e[1][1]=[1,0,14,15,13],e[1][2]=[7,6,8,9,3],e[1][3]=[5,4,10,11,7],e[2]=new Array(4),e[2][0]=[19,18,28,29,25],e[2][1]=[17,16,30,31,28],e[2][2]=[23,22,24,25,18],e[2][3]=[21,20,26,27,22],e[3]=new Array(4),e[3][0]=[8,9,7,6,3],e[3][1]=[10,11,5,4,7],e[3][2]=[12,13,3,2,8],e[3][3]=[14,15,1,0,13],this.keySchedule=function(r){let o=new Array(8),s=new Array(32),c;for(let S=0;S<4;S++)c=S*4,o[S]=r[c]<<24|r[c+1]<<16|r[c+2]<<8|r[c+3];let p=[6,7,4,5],u=0,m;for(let S=0;S<2;S++)for(let g=0;g<4;g++){for(c=0;c<4;c++){let y=t[g][c];m=o[y[1]],m^=n[4][o[y[2]>>>2]>>>24-8*(y[2]&3)&255],m^=n[5][o[y[3]>>>2]>>>24-8*(y[3]&3)&255],m^=n[6][o[y[4]>>>2]>>>24-8*(y[4]&3)&255],m^=n[7][o[y[5]>>>2]>>>24-8*(y[5]&3)&255],m^=n[p[c]][o[y[6]>>>2]>>>24-8*(y[6]&3)&255],o[y[0]]=m}for(c=0;c<4;c++){let y=e[g][c];m=n[4][o[y[0]>>>2]>>>24-8*(y[0]&3)&255],m^=n[5][o[y[1]>>>2]>>>24-8*(y[1]&3)&255],m^=n[6][o[y[2]>>>2]>>>24-8*(y[2]&3)&255],m^=n[7][o[y[3]>>>2]>>>24-8*(y[3]&3)&255],m^=n[4+c][o[y[4]>>>2]>>>24-8*(y[4]&3)&255],s[u]=m,u++}}for(let S=0;S<16;S++)this.masking[S]=s[S],this.rotate[S]=s[16+S]&31};function d(r,o,s){let c=o+r,p=c<<s|c>>>32-s;return(n[0][p>>>24]^n[1][p>>>16&255])-n[2][p>>>8&255]+n[3][p&255]}function i(r,o,s){let c=o^r,p=c<<s|c>>>32-s;return n[0][p>>>24]-n[1][p>>>16&255]+n[2][p>>>8&255]^n[3][p&255]}function a(r,o,s){let c=o-r,p=c<<s|c>>>32-s;return(n[0][p>>>24]+n[1][p>>>16&255]^n[2][p>>>8&255])-n[3][p&255]}let n=new Array(8);n[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],n[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],n[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],n[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],n[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],n[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],n[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],n[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Na(t){this.cast5=new yP,this.cast5.setKey(t),this.encrypt=function(e){return this.cast5.encrypt(e)}}Na.blockSize=Na.prototype.blockSize=8;Na.keySize=Na.prototype.keySize=16;var Ft=4294967295;function Ut(t,e){return(t<<e|t>>>32-e)&Ft}function sd(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function Rd(t,e,d){t.splice(e,4,d&255,d>>>8&255,d>>>16&255,d>>>24&255)}function re(t,e){return t>>>e*8&255}function SP(){let t=null,e=null,d=-1,i=[],a=[[],[],[],[]];function n(g){t=g;let y,P,f,E,v,F=[],D=[],h=[],X,b=[],T,C,R,M=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],x=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],N=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],w=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],A=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],U=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],L=[[],[]],j=[[],[],[],[]];function B(G){return G^G>>2^[0,90,180,238][G&3]}function H(G){return G^G>>1^G>>2^[0,238,180,90][G&3]}function Y(G,K){let te,_,Z;for(te=0;te<8;te++)_=K>>>24,K=K<<8&Ft|G>>>24,G=G<<8&Ft,Z=_<<1,_&128&&(Z^=333),K^=_^Z<<16,Z^=_>>>1,_&1&&(Z^=166),K^=Z<<24|Z<<8;return K}function Q(G,K){let te=K>>4,_=K&15,Z=M[G][te^_],de=x[G][A[_]^U[te]];return w[G][A[de]^U[Z]]<<4|N[G][Z^de]}function W(G,K){let te=re(G,0),_=re(G,1),Z=re(G,2),de=re(G,3);switch(X){case 4:te=L[1][te]^re(K[3],0),_=L[0][_]^re(K[3],1),Z=L[0][Z]^re(K[3],2),de=L[1][de]^re(K[3],3);case 3:te=L[1][te]^re(K[2],0),_=L[1][_]^re(K[2],1),Z=L[0][Z]^re(K[2],2),de=L[0][de]^re(K[2],3);case 2:te=L[0][L[0][te]^re(K[1],0)]^re(K[0],0),_=L[0][L[1][_]^re(K[1],1)]^re(K[0],1),Z=L[1][L[0][Z]^re(K[1],2)]^re(K[0],2),de=L[1][L[1][de]^re(K[1],3)]^re(K[0],3)}return j[0][te]^j[1][_]^j[2][Z]^j[3][de]}for(t=t.slice(0,32),y=t.length;y!==16&&y!==24&&y!==32;)t[y++]=0;for(y=0;y<t.length;y+=4)h[y>>2]=sd(t,y);for(y=0;y<256;y++)L[0][y]=Q(0,y),L[1][y]=Q(1,y);for(y=0;y<256;y++)T=L[1][y],C=B(T),R=H(T),j[0][y]=T+(C<<8)+(R<<16)+(R<<24),j[2][y]=C+(R<<8)+(T<<16)+(R<<24),T=L[0][y],C=B(T),R=H(T),j[1][y]=R+(R<<8)+(C<<16)+(T<<24),j[3][y]=C+(T<<8)+(R<<16)+(C<<24);for(X=h.length/2,y=0;y<X;y++)P=h[y+y],F[y]=P,f=h[y+y+1],D[y]=f,b[X-y-1]=Y(P,f);for(y=0;y<40;y+=2)P=16843009*y,f=P+16843009,P=W(P,F),f=Ut(W(f,D),8),i[y]=P+f&Ft,i[y+1]=Ut(P+2*f,9);for(y=0;y<256;y++)switch(P=f=E=v=y,X){case 4:P=L[1][P]^re(b[3],0),f=L[0][f]^re(b[3],1),E=L[0][E]^re(b[3],2),v=L[1][v]^re(b[3],3);case 3:P=L[1][P]^re(b[2],0),f=L[1][f]^re(b[2],1),E=L[0][E]^re(b[2],2),v=L[0][v]^re(b[2],3);case 2:a[0][y]=j[0][L[0][L[0][P]^re(b[1],0)]^re(b[0],0)],a[1][y]=j[1][L[0][L[1][f]^re(b[1],1)]^re(b[0],1)],a[2][y]=j[2][L[1][L[0][E]^re(b[1],2)]^re(b[0],2)],a[3][y]=j[3][L[1][L[1][v]^re(b[1],3)]^re(b[0],3)]}}function r(g){return a[0][re(g,0)]^a[1][re(g,1)]^a[2][re(g,2)]^a[3][re(g,3)]}function o(g){return a[0][re(g,3)]^a[1][re(g,0)]^a[2][re(g,1)]^a[3][re(g,2)]}function s(g,y){let P=r(y[0]),f=o(y[1]);y[2]=Ut(y[2]^P+f+i[4*g+8]&Ft,31),y[3]=Ut(y[3],1)^P+2*f+i[4*g+9]&Ft,P=r(y[2]),f=o(y[3]),y[0]=Ut(y[0]^P+f+i[4*g+10]&Ft,31),y[1]=Ut(y[1],1)^P+2*f+i[4*g+11]&Ft}function c(g,y){let P=r(y[0]),f=o(y[1]);y[2]=Ut(y[2],1)^P+f+i[4*g+10]&Ft,y[3]=Ut(y[3]^P+2*f+i[4*g+11]&Ft,31),P=r(y[2]),f=o(y[3]),y[0]=Ut(y[0],1)^P+f+i[4*g+8]&Ft,y[1]=Ut(y[1]^P+2*f+i[4*g+9]&Ft,31)}function p(){i=[],a=[[],[],[],[]]}function u(g,y){e=g,d=y;let P=[sd(e,d)^i[0],sd(e,d+4)^i[1],sd(e,d+8)^i[2],sd(e,d+12)^i[3]];for(let f=0;f<8;f++)s(f,P);return Rd(e,d,P[2]^i[4]),Rd(e,d+4,P[3]^i[5]),Rd(e,d+8,P[0]^i[6]),Rd(e,d+12,P[1]^i[7]),d+=16,e}function m(g,y){e=g,d=y;let P=[sd(e,d)^i[4],sd(e,d+4)^i[5],sd(e,d+8)^i[6],sd(e,d+12)^i[7]];for(let f=7;f>=0;f--)c(f,P);Rd(e,d,P[2]^i[0]),Rd(e,d+4,P[3]^i[1]),Rd(e,d+8,P[0]^i[2]),Rd(e,d+12,P[1]^i[3]),d+=16}function S(){return e}return{name:"twofish",blocksize:128/8,open:n,close:p,encrypt:u,decrypt:m,finalize:S}}function Aa(t){this.tf=SP(),this.tf.open(Array.from(t),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}Aa.keySize=Aa.prototype.keySize=32;Aa.blockSize=Aa.prototype.blockSize=16;function xt(){}xt.prototype.BLOCKSIZE=8;xt.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];xt.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731];xt.prototype.NN=16;xt.prototype._clean=function(t){return t<0&&(t=(t&2147483647)+2147483648),t};xt.prototype._F=function(t){let e,d=t&255;t>>>=8;let i=t&255;t>>>=8;let a=t&255;t>>>=8;let n=t&255;return e=this.sboxes[0][n]+this.sboxes[1][a],e^=this.sboxes[2][i],e+=this.sboxes[3][d],e};xt.prototype._encryptBlock=function(t){let e=t[0],d=t[1],i;for(i=0;i<this.NN;++i){e^=this.parray[i],d=this._F(e)^d;let a=e;e=d,d=a}e^=this.parray[this.NN+0],d^=this.parray[this.NN+1],t[0]=this._clean(d),t[1]=this._clean(e)};xt.prototype.encryptBlock=function(t){let e,d=[0,0],i=this.BLOCKSIZE/2;for(e=0;e<this.BLOCKSIZE/2;++e)d[0]=d[0]<<8|t[e+0]&255,d[1]=d[1]<<8|t[e+i]&255;this._encryptBlock(d);let a=[];for(e=0;e<this.BLOCKSIZE/2;++e)a[e+0]=d[0]>>>24-8*e&255,a[e+i]=d[1]>>>24-8*e&255;return a};xt.prototype._decryptBlock=function(t){let e=t[0],d=t[1],i;for(i=this.NN+1;i>1;--i){e^=this.parray[i],d=this._F(e)^d;let a=e;e=d,d=a}e^=this.parray[1],d^=this.parray[0],t[0]=this._clean(d),t[1]=this._clean(e)};xt.prototype.init=function(t){let e,d=0;for(this.parray=[],e=0;e<this.NN+2;++e){let a=0;for(let n=0;n<4;++n)a=a<<8|t[d]&255,++d>=t.length&&(d=0);this.parray[e]=this.PARRAY[e]^a}for(this.sboxes=[],e=0;e<4;++e)for(this.sboxes[e]=[],d=0;d<256;++d)this.sboxes[e][d]=this.SBOXES[e][d];let i=[0,0];for(e=0;e<this.NN+2;e+=2)this._encryptBlock(i),this.parray[e+0]=i[0],this.parray[e+1]=i[1];for(e=0;e<4;++e)for(d=0;d<256;d+=2)this._encryptBlock(i),this.sboxes[e][d+0]=i[0],this.sboxes[e][d+1]=i[1]};function wa(t){this.bf=new xt,this.bf.init(t),this.encrypt=function(e){return this.bf.encryptBlock(e)}}wa.keySize=wa.prototype.keySize=16;wa.blockSize=wa.prototype.blockSize=8;var PP=new Map(Object.entries({tripledes:Ra,cast5:Na,twofish:Aa,blowfish:wa})),gP=Object.freeze({__proto__:null,legacyCiphers:PP});function Mi(t,e,d,i){t[e]+=d[i],t[e+1]+=d[i+1]+(t[e]<d[i])}function hc(t,e){t[0]+=e,t[1]+=t[0]<e}function Nd(t,e,d,i,a,n,r,o){Mi(t,d,t,i),Mi(t,d,e,r);let s=t[n]^t[d],c=t[n+1]^t[d+1];t[n]=c,t[n+1]=s,Mi(t,a,t,n),s=t[i]^t[a],c=t[i+1]^t[a+1],t[i]=s>>>24^c<<8,t[i+1]=c>>>24^s<<8,Mi(t,d,t,i),Mi(t,d,e,o),s=t[n]^t[d],c=t[n+1]^t[d+1],t[n]=s>>>16^c<<16,t[n+1]=c>>>16^s<<16,Mi(t,a,t,n),s=t[i]^t[a],c=t[i+1]^t[a+1],t[i]=c>>>31^s<<1,t[i+1]=s>>>31^c<<1}var Su=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Ze=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(t=>t*2));function fc(t,e){let d=new Uint32Array(32),i=new Uint32Array(t.b.buffer,t.b.byteOffset,32);for(let n=0;n<16;n++)d[n]=t.h[n],d[n+16]=Su[n];d[24]^=t.t0[0],d[25]^=t.t0[1];let a=e?4294967295:0;d[28]^=a,d[29]^=a;for(let n=0;n<12;n++){let r=n<<4;Nd(d,i,0,8,16,24,Ze[r+0],Ze[r+1]),Nd(d,i,2,10,18,26,Ze[r+2],Ze[r+3]),Nd(d,i,4,12,20,28,Ze[r+4],Ze[r+5]),Nd(d,i,6,14,22,30,Ze[r+6],Ze[r+7]),Nd(d,i,0,10,20,30,Ze[r+8],Ze[r+9]),Nd(d,i,2,12,22,24,Ze[r+10],Ze[r+11]),Nd(d,i,4,14,16,26,Ze[r+12],Ze[r+13]),Nd(d,i,6,8,18,28,Ze[r+14],Ze[r+15])}for(let n=0;n<16;n++)t.h[n]^=d[n]^d[n+16]}var hP=class{constructor(t,e,d,i){let a=new Uint8Array(64);this.S={b:new Uint8Array(ma),h:new Uint32Array(yo/4),t0:new Uint32Array(2),c:0,outlen:t},a[0]=t,e&&(a[1]=e.length),a[2]=1,a[3]=1,d&&a.set(d,32),i&&a.set(i,48);let n=new Uint32Array(a.buffer,a.byteOffset,a.length/Uint32Array.BYTES_PER_ELEMENT);for(let r=0;r<16;r++)this.S.h[r]=Su[r]^n[r];if(e){let r=new Uint8Array(ma);r.set(e),this.update(r)}}update(t){if(!(t instanceof Uint8Array))throw new Error("Input must be Uint8Array or Buffer");let e=0;for(;e<t.length;){this.S.c===ma&&(hc(this.S.t0,this.S.c),fc(this.S,!1),this.S.c=0);let d=ma-this.S.c;this.S.b.set(t.subarray(e,e+d),this.S.c);let i=Math.min(d,t.length-e);this.S.c+=i,e+=i}return this}digest(t){hc(this.S.t0,this.S.c),this.S.b.fill(0,this.S.c),this.S.c=ma,fc(this.S,!0);let e=t||new Uint8Array(this.S.outlen);for(let d=0;d<this.S.outlen;d++)e[d]=this.S.h[d>>2]>>8*(d&3);return this.S.h=null,e.buffer}};function gn(t,e,d,i){if(t>yo)throw new Error(`outlen must be at most ${yo} (given: ${t})`);return new hP(t,e,d,i)}var yo=64,ma=128,es=2,Pu=19,fP=4294967295,IP=4,bP=4294967295,FP=8,EP=4294967295,vP=8,CP=4294967295,XP=4294967295,TP=32,cd=1024,DP=64,RP=new Uint8Array(new Uint16Array([43981]).buffer)[0]===205;function ct(t,e,d){return t[d+0]=e,t[d+1]=e>>8,t[d+2]=e>>16,t[d+3]=e>>24,t}function ti(t,e,d){if(e>Number.MAX_SAFE_INTEGER)throw new Error("LE64: large numbers unsupported");let i=e;for(let a=d;a<d+7;a++)t[a]=i,i=(i-t[a])/256;return t}function Nr(t,e,d){let i=new Uint8Array(64),a=new Uint8Array(4+e.length);if(ct(a,t,0),a.set(e,4),t<=64)return gn(t).update(a).digest(d),d;let n=Math.ceil(t/32)-2;for(let o=0;o<n;o++)gn(64).update(o===0?a:i).digest(i),d.set(i.subarray(0,32),o*32);let r=new Uint8Array(gn(t-32*n).update(i).digest());return d.set(r,n*32),d}function Ic(t,e,d,i){return t.fn.XOR(e.byteOffset,d.byteOffset,i.byteOffset),e}function NP(t,e,d,i){return t.fn.G(e.byteOffset,d.byteOffset,i.byteOffset,t.refs.gZ.byteOffset),i}function AP(t,e,d,i){return t.fn.G2(e.byteOffset,d.byteOffset,i.byteOffset,t.refs.gZ.byteOffset),i}function*wP(t,e,d,i,a,n,r,o){t.refs.prngTmp.fill(0);let s=t.refs.prngTmp.subarray(0,6*8);ti(s,e,0),ti(s,d,8),ti(s,i,16),ti(s,a,24),ti(s,n,32),ti(s,es,40);for(let c=1;c<=r;c++){ti(t.refs.prngTmp,c,s.length);let p=AP(t,t.refs.ZERO1024,t.refs.prngTmp,t.refs.prngR);for(let u=c===1?o*8:0;u<p.length;u+=8)yield p.subarray(u,u+8)}return[]}function MP({type:t,version:e,tagLength:d,password:i,salt:a,ad:n,secret:r,parallelism:o,memorySize:s,passes:c}){let p=(u,m,S,g)=>{if(m<S||m>g)throw new Error(`${u} size should be between ${S} and ${g} bytes`)};if(t!==es||e!==Pu)throw new Error("Unsupported type or version");return p("password",i,vP,EP),p("salt",a,FP,bP),p("tag",d,IP,fP),p("memory",s,8*o,CP),n&&p("associated data",n,0,XP),r&&p("secret",r,0,TP),{type:t,version:e,tagLength:d,password:i,salt:a,ad:n,secret:r,lanes:o,memorySize:s,passes:c}}var gu=1024,xP=64*gu;function LP(t,{memory:e,instance:d}){if(!RP)throw new Error("BigEndian system not supported");let i=MP({type:es,version:Pu,...t}),{G:a,G2:n,xor:r,getLZ:o}=d.exports,s={},c={};c.G=a,c.G2=n,c.XOR=r;let p=4*i.lanes*Math.floor(i.memorySize/(4*i.lanes)),u=p*cd+10*gu;if(e.buffer.byteLength<u){let C=Math.ceil((u-e.buffer.byteLength)/xP);e.grow(C)}let m=0;s.gZ=new Uint8Array(e.buffer,m,cd),m+=s.gZ.length,s.prngR=new Uint8Array(e.buffer,m,cd),m+=s.prngR.length,s.prngTmp=new Uint8Array(e.buffer,m,cd),m+=s.prngTmp.length,s.ZERO1024=new Uint8Array(e.buffer,m,1024),m+=s.ZERO1024.length;let S=new Uint32Array(e.buffer,m,2);m+=S.length*Uint32Array.BYTES_PER_ELEMENT;let g={fn:c,refs:s},y=new Uint8Array(e.buffer,m,cd);m+=y.length;let P=new Uint8Array(e.buffer,m,i.memorySize*cd),f=new Uint8Array(e.buffer,0,m),E=OP(i),v=p/i.lanes,F=new Array(i.lanes).fill(null).map(()=>new Array(v)),D=(C,R)=>(F[C][R]=P.subarray(C*v*1024+R*1024,C*v*1024+R*1024+cd),F[C][R]);for(let C=0;C<i.lanes;C++){let R=new Uint8Array(E.length+8);R.set(E),ct(R,0,E.length),ct(R,C,E.length+4),Nr(cd,R,D(C,0)),ct(R,1,E.length),Nr(cd,R,D(C,1))}let h=4,X=v/h;for(let C=0;C<i.passes;C++)for(let R=0;R<h;R++){let M=C===0&&R<=1;for(let x=0;x<i.lanes;x++){let N=R===0&&C===0?2:0,w=M?wP(g,C,x,R,p,i.passes,X,N):null;for(N;N<X;N++){let A=R*X+N,U=A>0?F[x][A-1]:F[x][v-1],L=M?w.next().value:U;o(S.byteOffset,L.byteOffset,x,i.lanes,C,R,N,h,X);let j=S[0],B=S[1];C===0&&D(x,A),NP(g,U,F[j][B],C>0?y:F[x][A]),C>0&&Ic(g,F[x][A],y,F[x][A])}}}let b=F[0][v-1];for(let C=1;C<i.lanes;C++)Ic(g,b,b,F[C][v-1]);let T=Nr(i.tagLength,b,new Uint8Array(i.tagLength));return f.fill(0),e.grow(0),T}function OP(t){let e=gn(DP),d=new Uint8Array(4),i=new Uint8Array(24);ct(i,t.lanes,0),ct(i,t.tagLength,4),ct(i,t.memorySize,8),ct(i,t.passes,12),ct(i,t.version,16),ct(i,t.type,20);let a=[i];t.password?(a.push(ct(new Uint8Array(4),t.password.length,0)),a.push(t.password)):a.push(d),t.salt?(a.push(ct(new Uint8Array(4),t.salt.length,0)),a.push(t.salt)):a.push(d),t.secret?(a.push(ct(new Uint8Array(4),t.secret.length,0)),a.push(t.secret)):a.push(d),t.ad?(a.push(ct(new Uint8Array(4),t.ad.length,0)),a.push(t.ad)):a.push(d),e.update(UP(a));let n=e.digest();return new Uint8Array(n)}function UP(t){if(t.length===1)return t[0];let e=0;for(let a=0;a<t.length;a++){if(!(t[a]instanceof Uint8Array))throw new Error("concatArrays: Data must be in the form of a Uint8Array");e+=t[a].length}let d=new Uint8Array(e),i=0;return t.forEach(a=>{d.set(a,i),i+=a.length}),d}var rn;async function kP(t,e,d){let i={env:{memory:t}};if(rn===void 0)try{let a=await e(i);return rn=!0,a}catch{rn=!1}return(rn?e:d)(i)}async function qP(t,e){let d=new WebAssembly.Memory({initial:1040,maximum:65536}),i=await kP(d,t,e);return a=>LP(a,{instance:i.instance,memory:d})}function hu(t,e,d,i){function a(c,p,u){var m=WebAssembly.instantiate,S=WebAssembly.compile;return p?m(c,p):S(c)}var n=null,r=et.atob(d),o=r.length;n=new Uint8Array(new ArrayBuffer(o));for(var s=0;s<o;s++)n[s]=r.charCodeAt(s);return a(n,i)}function BP(t){return hu(0,null,"AGFzbQEAAAABKwdgBH9/f38AYAABf2AAAGADf39/AGAJf39/f39/f39/AX9gAX8AYAF/AX8CEwEDZW52Bm1lbW9yeQIBkAiAgAQDCgkCAwAABAEFBgEEBQFwAQICBgkBfwFBkIjAAgsHfQoDeG9yAAEBRwACAkcyAAMFZ2V0TFoABBlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALX2luaXRpYWxpemUAABBfX2Vycm5vX2xvY2F0aW9uAAgJc3RhY2tTYXZlAAUMc3RhY2tSZXN0b3JlAAYKc3RhY2tBbGxvYwAHCQcBAEEBCwEACs0gCQMAAQtYAQJ/A0AgACAEQQR0IgNqIAIgA2r9AAQAIAEgA2r9AAQA/VH9CwQAIAAgA0EQciIDaiACIANq/QAEACABIANq/QAEAP1R/QsEACAEQQJqIgRBwABHDQALC7ceAgt7A38DQCADIBFBBHQiD2ogASAPav0ABAAgACAPav0ABAD9USIF/QsEACACIA9qIAX9CwQAIAMgD0EQciIPaiABIA9q/QAEACAAIA9q/QAEAP1RIgX9CwQAIAIgD2ogBf0LBAAgEUECaiIRQcAARw0ACwNAIAMgEEEHdGoiAEEQaiAA/QAEcCAA/QAEMCIFIAD9AAQQIgT9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAQgBP0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9USIJQSD9ywEgCUEg/c0B/VAiCSAA/QAEUCIG/c4BIAkgCf0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIGIAX9USIFQSj9ywEgBUEY/c0B/VAiCCAE/c4BIAggCP0NAAECAwgJCgsAAQIDCAkKCyAEIAT9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIKIAogCf1RIgVBMP3LASAFQRD9zQH9UCIFIAb9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgkgCP1RIgRBAf3LASAEQT/9zQH9UCIMIAD9AARgIAD9AAQgIgQgAP0ABAAiBv3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBv1RIghBIP3LASAIQSD9zQH9UCIIIABBQGsiAf0ABAAiB/3OASAIIAj9DQABAgMICQoLAAECAwgJCgsgByAH/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiByAE/VEiBEEo/csBIARBGP3NAf1QIgsgBv3OASALIAv9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAI/VEiBEEw/csBIARBEP3NAf1QIgQgB/3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgByAH/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCCAL/VEiB0EB/csBIAdBP/3NAf1QIg0gDf0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eHyIH/c4BIAcgB/0NAAECAwgJCgsAAQIDCAkKCyAKIAr9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIKIAQgBSAF/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/VEiC0Eg/csBIAtBIP3NAf1QIgsgCP3OASALIAv9DQABAgMICQoLAAECAwgJCgsgCCAI/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCCAH/VEiB0Eo/csBIAdBGP3NAf1QIgcgCv3OASAHIAf9DQABAgMICQoLAAECAwgJCgsgCiAK/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiDv0LBAAgACAGIA0gDCAM/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4fIgr9zgEgCiAK/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgYgBSAEIAT9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9USIFQSD9ywEgBUEg/c0B/VAiBSAJ/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAJIAn9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJIAr9USIEQSj9ywEgBEEY/c0B/VAiCiAG/c4BIAogCv0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIE/QsEACAAIAQgBf1RIgVBMP3LASAFQRD9zQH9UCIFIA4gC/1RIgRBMP3LASAEQRD9zQH9UCIEIAT9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwRgIAAgBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwRwIAEgBCAI/c4BIAQgBP0NAAECAwgJCgsAAQIDCAkKCyAIIAj9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIE/QsEACAAIAUgCf3OASAFIAX9DQABAgMICQoLAAECAwgJCgsgCSAJ/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCf0LBFAgACAEIAf9USIFQQH9ywEgBUE//c0B/VAiBSAJIAr9USIEQQH9ywEgBEE//c0B/VAiBCAE/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEICAAIAQgBSAF/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEMCAQQQFqIhBBCEcNAAtBACEQA0AgAyAQQQR0aiIAQYABaiAA/QAEgAcgAP0ABIADIgUgAP0ABIABIgT9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAQgBP0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9USIJQSD9ywEgCUEg/c0B/VAiCSAA/QAEgAUiBv3OASAJIAn9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAF/VEiBUEo/csBIAVBGP3NAf1QIgggBP3OASAIIAj9DQABAgMICQoLAAECAwgJCgsgBCAE/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCiAKIAn9USIFQTD9ywEgBUEQ/c0B/VAiBSAG/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJIAj9USIEQQH9ywEgBEE//c0B/VAiDCAA/QAEgAYgAP0ABIACIgQgAP0ABAAiBv3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBv1RIghBIP3LASAIQSD9zQH9UCIIIAD9AASABCIH/c4BIAggCP0NAAECAwgJCgsAAQIDCAkKCyAHIAf9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIHIAT9USIEQSj9ywEgBEEY/c0B/VAiCyAG/c4BIAsgC/0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIGIAj9USIEQTD9ywEgBEEQ/c0B/VAiBCAH/c4BIAQgBP0NAAECAwgJCgsAAQIDCAkKCyAHIAf9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIIIAv9USIHQQH9ywEgB0E//c0B/VAiDSAN/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4fIgf9zgEgByAH/Q0AAQIDCAkKCwABAgMICQoLIAogCv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgogBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9USILQSD9ywEgC0Eg/c0B/VAiCyAI/c4BIAsgC/0NAAECAwgJCgsAAQIDCAkKCyAIIAj9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIIIAf9USIHQSj9ywEgB0EY/c0B/VAiByAK/c4BIAcgB/0NAAECAwgJCgsAAQIDCAkKCyAKIAr9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIO/QsEACAAIAYgDSAMIAz9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh8iCv3OASAKIAr9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAFIAQgBP0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/1RIgVBIP3LASAFQSD9zQH9UCIFIAn9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAkgCf0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgkgCv1RIgRBKP3LASAEQRj9zQH9UCIKIAb9zgEgCiAK/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9CwQAIAAgBCAF/VEiBUEw/csBIAVBEP3NAf1QIgUgDiAL/VEiBEEw/csBIARBEP3NAf1QIgQgBP0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/0LBIAGIAAgBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwSAByAAIAQgCP3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgCCAI/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBP0LBIAEIAAgBSAJ/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAJIAn9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJ/QsEgAUgACAEIAf9USIFQQH9ywEgBUE//c0B/VAiBSAJIAr9USIEQQH9ywEgBEE//c0B/VAiBCAE/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEgAIgACAEIAUgBf0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/0LBIADIBBBAWoiEEEIRw0AC0EAIRADQCACIBBBBHQiAGoiASAAIANq/QAEACAB/QAEAP1R/QsEACACIABBEHIiAWoiDyABIANq/QAEACAP/QAEAP1R/QsEACACIABBIHIiAWoiDyABIANq/QAEACAP/QAEAP1R/QsEACACIABBMHIiAGoiASAAIANq/QAEACAB/QAEAP1R/QsEACAQQQRqIhBBwABHDQALCxYAIAAgASACIAMQAiAAIAIgAiADEAILewIBfwF+IAIhCSABNQIAIQogBCAFcgRAIAEoAgQgA3AhCQsgACAJNgIAIAAgB0EBayAFIAQbIAhsIAZBAWtBAEF/IAYbIAIgCUYbaiIBIAVBAWogCGxBACAEG2ogAa0gCiAKfkIgiH5CIIinQX9zaiAHIAhscDYCBCAACwQAIwALBgAgACQACxAAIwAgAGtBcHEiACQAIAALBQBBgAgL",t)}function jP(t){return hu(0,null,"AGFzbQEAAAABPwhgBH9/f38AYAABf2AAAGADf39/AGARf39/f39/f39/f39/f39/f38AYAl/f39/f39/f38Bf2ABfwBgAX8BfwITAQNlbnYGbWVtb3J5AgGQCICABAMLCgIDBAAABQEGBwEEBQFwAQICBgkBfwFBkIjAAgsHfQoDeG9yAAEBRwADAkcyAAQFZ2V0TFoABRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALX2luaXRpYWxpemUAABBfX2Vycm5vX2xvY2F0aW9uAAkJc3RhY2tTYXZlAAYMc3RhY2tSZXN0b3JlAAcKc3RhY2tBbGxvYwAICQcBAEEBCwEACssaCgMAAQtQAQJ/A0AgACAEQQN0IgNqIAIgA2opAwAgASADaikDAIU3AwAgACADQQhyIgNqIAIgA2opAwAgASADaikDAIU3AwAgBEECaiIEQYABRw0ACwveDwICfgF/IAAgAUEDdGoiEyATKQMAIhEgACAFQQN0aiIBKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA1BA3RqIgUgESAFKQMAhUIgiSIRNwMAIAAgCUEDdGoiCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIoiSIRNwMAIBMgESATKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAFIBEgBSkDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgASARIAEpAwCFQgGJNwMAIAAgAkEDdGoiDSANKQMAIhEgACAGQQN0aiICKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA5BA3RqIgYgESAGKQMAhUIgiSIRNwMAIAAgCkEDdGoiCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIoiSIRNwMAIA0gESANKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAKIBEgCikDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAiARIAIpAwCFQgGJNwMAIAAgA0EDdGoiDiAOKQMAIhEgACAHQQN0aiIDKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA9BA3RqIgcgESAHKQMAhUIgiSIRNwMAIAAgC0EDdGoiCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAMgESADKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAHIBEgBykDAIVCMIkiETcDACALIBEgCykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQgGJNwMAIAAgBEEDdGoiDyAPKQMAIhEgACAIQQN0aiIEKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIBBBA3RqIgggESAIKQMAhUIgiSIRNwMAIAAgDEEDdGoiACARIAApAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA8gESAPKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAIIBEgCCkDAIVCMIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIBMgEykDACIRIAIpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAggESAIKQMAhUIgiSIRNwMAIAsgESALKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACACIBEgAikDAIVCKIkiETcDACATIBEgEykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgCCARIAgpAwCFQjCJIhE3AwAgCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIBiTcDACANIA0pAwAiESADKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAFIBEgBSkDAIVCIIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQiiJIhE3AwAgDSARIA0pAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAUgESAFKQMAhUIwiSIRNwMAIAAgESAAKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACADIBEgAykDAIVCAYk3AwAgDiAOKQMAIhEgBCkDACISfCARQgGGQv7///8fgyASQv////8Pg358IhE3AwAgBiARIAYpAwCFQiCJIhE3AwAgCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIA8gDykDACIRIAEpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAcgESAHKQMAhUIgiSIRNwMAIAogESAKKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACABIBEgASkDAIVCKIkiETcDACAPIBEgDykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgByARIAcpAwCFQjCJIhE3AwAgCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIBiTcDAAvdCAEPfwNAIAIgBUEDdCIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAIgBkEIciIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAVBAmoiBUGAAUcNAAsDQCADIARBA3QiAGogACACaikDADcDACADIARBAXIiAEEDdCIBaiABIAJqKQMANwMAIAMgBEECciIBQQN0IgVqIAIgBWopAwA3AwAgAyAEQQNyIgVBA3QiBmogAiAGaikDADcDACADIARBBHIiBkEDdCIHaiACIAdqKQMANwMAIAMgBEEFciIHQQN0IghqIAIgCGopAwA3AwAgAyAEQQZyIghBA3QiCWogAiAJaikDADcDACADIARBB3IiCUEDdCIKaiACIApqKQMANwMAIAMgBEEIciIKQQN0IgtqIAIgC2opAwA3AwAgAyAEQQlyIgtBA3QiDGogAiAMaikDADcDACADIARBCnIiDEEDdCINaiACIA1qKQMANwMAIAMgBEELciINQQN0Ig5qIAIgDmopAwA3AwAgAyAEQQxyIg5BA3QiD2ogAiAPaikDADcDACADIARBDXIiD0EDdCIQaiACIBBqKQMANwMAIAMgBEEOciIQQQN0IhFqIAIgEWopAwA3AwAgAyAEQQ9yIhFBA3QiEmogAiASaikDADcDACADIARB//8DcSAAQf//A3EgAUH//wNxIAVB//8DcSAGQf//A3EgB0H//wNxIAhB//8DcSAJQf//A3EgCkH//wNxIAtB//8DcSAMQf//A3EgDUH//wNxIA5B//8DcSAPQf//A3EgEEH//wNxIBFB//8DcRACIARB8ABJIQAgBEEQaiEEIAANAAtBACEBIANBAEEBQRBBEUEgQSFBMEExQcAAQcEAQdAAQdEAQeAAQeEAQfAAQfEAEAIgA0ECQQNBEkETQSJBI0EyQTNBwgBBwwBB0gBB0wBB4gBB4wBB8gBB8wAQAiADQQRBBUEUQRVBJEElQTRBNUHEAEHFAEHUAEHVAEHkAEHlAEH0AEH1ABACIANBBkEHQRZBF0EmQSdBNkE3QcYAQccAQdYAQdcAQeYAQecAQfYAQfcAEAIgA0EIQQlBGEEZQShBKUE4QTlByABByQBB2ABB2QBB6ABB6QBB+ABB+QAQAiADQQpBC0EaQRtBKkErQTpBO0HKAEHLAEHaAEHbAEHqAEHrAEH6AEH7ABACIANBDEENQRxBHUEsQS1BPEE9QcwAQc0AQdwAQd0AQewAQe0AQfwAQf0AEAIgA0EOQQ9BHkEfQS5BL0E+QT9BzgBBzwBB3gBB3wBB7gBB7wBB/gBB/wAQAgNAIAIgAUEDdCIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAiAAQQhyIgRqIgUgAyAEaikDACAFKQMAhTcDACACIABBEHIiBGoiBSADIARqKQMAIAUpAwCFNwMAIAIgAEEYciIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAUEEaiIBQYABRw0ACwsWACAAIAEgAiADEAMgACACIAIgAxADC3sCAX8BfiACIQkgATUCACEKIAQgBXIEQCABKAIEIANwIQkLIAAgCTYCACAAIAdBAWsgBSAEGyAIbCAGQQFrQQBBfyAGGyACIAlGG2oiASAFQQFqIAhsQQAgBBtqIAGtIAogCn5CIIh+QiCIp0F/c2ogByAIbHA2AgQgAAsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwUAQYAICw==",t)}var GP=async()=>qP(t=>BP(t),t=>jP(t)),QP=Object.freeze({__proto__:null,default:GP}),bc=[0,1,3,7,15,31,63,127,255],Ha=function(t){this.stream=t,this.bitOffset=0,this.curByte=0,this.hasByte=!1};Ha.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)};Ha.prototype.read=function(t){for(var e=0;t>0;){this._ensureByte();var d=8-this.bitOffset;if(t>=d)e<<=d,e|=bc[d]&this.curByte,this.hasByte=!1,this.bitOffset=0,t-=d;else{e<<=t;var i=d-t;e|=(this.curByte&bc[t]<<i)>>i,this.bitOffset+=t,t=0}}return e};Ha.prototype.seek=function(t){var e=t%8,d=(t-e)/8;this.bitOffset=e,this.stream.seek(d),this.hasByte=!1};Ha.prototype.pi=function(){var t=new Uint8Array(6),e;for(e=0;e<t.length;e++)t[e]=this.read(8);return VP(t)};function VP(t){return Array.prototype.map.call(t,e=>("00"+e.toString(16)).slice(-2)).join("")}var zP=Ha,Ei=function(){};Ei.prototype.readByte=function(){throw new Error("abstract method readByte() not implemented")};Ei.prototype.read=function(t,e,d){for(var i=0;i<d;){var a=this.readByte();if(a<0)return i===0?-1:i;t[e++]=a,i++}return i};Ei.prototype.seek=function(t){throw new Error("abstract method seek() not implemented")};Ei.prototype.writeByte=function(t){throw new Error("abstract method readByte() not implemented")};Ei.prototype.write=function(t,e,d){var i;for(i=0;i<d;i++)this.writeByte(t[e++]);return d};Ei.prototype.flush=function(){};var HP=Ei,WP=function(){var t=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]),e=function(){var d=4294967295;this.getCRC=function(){return~d>>>0},this.updateCRC=function(i){d=d<<8^t[(d>>>24^i)&255]},this.updateCRCRun=function(i,a){for(;a-- >0;)d=d<<8^t[(d>>>24^i)&255]}};return e}(),KP=zP,Ma=HP,fu=WP,on=20,Fc=258,Ec=0,YP=1,_P=2,JP=6,$P=50,ZP="314159265359",eg="177245385090",vc=function(t,e){var d=t[e],i;for(i=e;i>0;i--)t[i]=t[i-1];return t[0]=d,d},ve={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},Hd={};Hd[ve.LAST_BLOCK]="Bad file checksum";Hd[ve.NOT_BZIP_DATA]="Not bzip data";Hd[ve.UNEXPECTED_INPUT_EOF]="Unexpected input EOF";Hd[ve.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF";Hd[ve.DATA_ERROR]="Data error";Hd[ve.OUT_OF_MEMORY]="Out of memory";Hd[ve.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var Ke=function(t,e){var d=Hd[t]||"unknown error";e&&(d+=": "+e);var i=new TypeError(d);throw i.errorCode=t,i},Wd=function(t,e){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(t,e)};Wd.prototype._init_block=function(){var t=this._get_next_block();return t?(this.blockCRC=new fu,!0):(this.writeCount=-1,!1)};Wd.prototype._start_bunzip=function(t,e){var d=new Uint8Array(4);(t.read(d,0,4)!==4||String.fromCharCode(d[0],d[1],d[2])!=="BZh")&&Ke(ve.NOT_BZIP_DATA,"bad magic");var i=d[3]-48;(i<1||i>9)&&Ke(ve.NOT_BZIP_DATA,"level out of range"),this.reader=new KP(t),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=e,this.streamCRC=0};Wd.prototype._get_next_block=function(){var t,e,d,i=this.reader,a=i.pi();if(a===eg)return!1;a!==ZP&&Ke(ve.NOT_BZIP_DATA),this.targetBlockCRC=i.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,i.read(1)&&Ke(ve.OBSOLETE_INPUT);var n=i.read(24);n>this.dbufSize&&Ke(ve.DATA_ERROR,"initial position out of bounds");var r=i.read(16),o=new Uint8Array(256),s=0;for(t=0;t<16;t++)if(r&1<<15-t){var c=t*16;for(d=i.read(16),e=0;e<16;e++)d&1<<15-e&&(o[s++]=c+e)}var p=i.read(3);(p<_P||p>JP)&&Ke(ve.DATA_ERROR);var u=i.read(15);u===0&&Ke(ve.DATA_ERROR);var m=new Uint8Array(256);for(t=0;t<p;t++)m[t]=t;var S=new Uint8Array(u);for(t=0;t<u;t++){for(e=0;i.read(1);e++)e>=p&&Ke(ve.DATA_ERROR);S[t]=vc(m,e)}var g=s+2,y=[],P;for(e=0;e<p;e++){var f=new Uint8Array(g),E=new Uint16Array(on+1);for(r=i.read(5),t=0;t<g;t++){for(;(r<1||r>on)&&Ke(ve.DATA_ERROR),!!i.read(1);)i.read(1)?r--:r++;f[t]=r}var v,F;for(v=F=f[0],t=1;t<g;t++)f[t]>F?F=f[t]:f[t]<v&&(v=f[t]);P={},y.push(P),P.permute=new Uint16Array(Fc),P.limit=new Uint32Array(on+2),P.base=new Uint32Array(on+1),P.minLen=v,P.maxLen=F;var D=0;for(t=v;t<=F;t++)for(E[t]=P.limit[t]=0,r=0;r<g;r++)f[r]===t&&(P.permute[D++]=r);for(t=0;t<g;t++)E[f[t]]++;for(D=r=0,t=v;t<F;t++)D+=E[t],P.limit[t]=D-1,D<<=1,r+=E[t],P.base[t+1]=D-r;P.limit[F+1]=Number.MAX_VALUE,P.limit[F]=D+E[F]-1,P.base[v]=0}var h=new Uint32Array(256);for(t=0;t<256;t++)m[t]=t;var X=0,b=0,T=0,C,R=this.dbuf=new Uint32Array(this.dbufSize);for(g=0;;){for(g--||(g=$P-1,T>=u&&Ke(ve.DATA_ERROR),P=y[S[T++]]),t=P.minLen,e=i.read(t);t>P.maxLen&&Ke(ve.DATA_ERROR),!(e<=P.limit[t]);t++)e=e<<1|i.read(1);e-=P.base[t],(e<0||e>=Fc)&&Ke(ve.DATA_ERROR);var M=P.permute[e];if(M===Ec||M===YP){X||(X=1,r=0),M===Ec?r+=X:r+=2*X,X<<=1;continue}if(X)for(X=0,b+r>this.dbufSize&&Ke(ve.DATA_ERROR),C=o[m[0]],h[C]+=r;r--;)R[b++]=C;if(M>s)break;b>=this.dbufSize&&Ke(ve.DATA_ERROR),t=M-1,C=vc(m,t),C=o[C],h[C]++,R[b++]=C}for((n<0||n>=b)&&Ke(ve.DATA_ERROR),e=0,t=0;t<256;t++)d=e+h[t],h[t]=e,e=d;for(t=0;t<b;t++)C=R[t]&255,R[h[C]]|=t<<8,h[C]++;var x=0,N=0,w=0;return b&&(x=R[n],N=x&255,x>>=8,w=-1),this.writePos=x,this.writeCurrent=N,this.writeCount=b,this.writeRun=w,!0};Wd.prototype._read_bunzip=function(t,e){var d,i,a;if(this.writeCount<0)return 0;var n=this.dbuf,r=this.writePos,o=this.writeCurrent,s=this.writeCount;this.outputsize;for(var c=this.writeRun;s;){for(s--,i=o,r=n[r],o=r&255,r>>=8,c++===3?(d=o,a=i,o=-1):(d=1,a=o),this.blockCRC.updateCRCRun(a,d);d--;)this.outputStream.writeByte(a),this.nextoutput++;o!=i&&(c=0)}return this.writeCount=s,this.blockCRC.getCRC()!==this.targetBlockCRC&&Ke(ve.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var ts=function(t){if("readByte"in t)return t;var e=new Ma;return e.pos=0,e.readByte=function(){return t[this.pos++]},e.seek=function(d){this.pos=d},e.eof=function(){return this.pos>=t.length},e},Iu=function(t){var e=new Ma,d=!0;if(t)if(typeof t=="number")e.buffer=new Uint8Array(t),d=!1;else{if("writeByte"in t)return t;e.buffer=t,d=!1}else e.buffer=new Uint8Array(16384);return e.pos=0,e.writeByte=function(i){if(d&&this.pos>=this.buffer.length){var a=new Uint8Array(this.buffer.length*2);a.set(this.buffer),this.buffer=a}this.buffer[this.pos++]=i},e.getBuffer=function(){if(this.pos!==this.buffer.length){if(!d)throw new TypeError("outputsize does not match decoded input");var i=new Uint8Array(this.pos);i.set(this.buffer.subarray(0,this.pos)),this.buffer=i}return this.buffer},e._coerced=!0,e},tg=function(t,e,d){for(var i=ts(t),a=Iu(e),n=new Wd(i,a);!("eof"in i&&i.eof());)if(n._init_block())n._read_bunzip();else{var r=n.reader.read(32)>>>0;if(r!==n.streamCRC&&Ke(ve.DATA_ERROR,"Bad stream CRC (got "+n.streamCRC.toString(16)+" expected "+r.toString(16)+")"),d&&"eof"in i&&!i.eof())n._start_bunzip(i,a);else break}if("getBuffer"in a)return a.getBuffer()},dg=function(t,e,d){var i=ts(t),a=Iu(d),n=new Wd(i,a);n.reader.seek(e);var r=n._get_next_block();if(r&&(n.blockCRC=new fu,n.writeCopies=0,n._read_bunzip()),"getBuffer"in a)return a.getBuffer()},ig=function(t,e,d){var i=new Ma;i.delegate=ts(t),i.pos=0,i.readByte=function(){return this.pos++,this.delegate.readByte()},i.delegate.eof&&(i.eof=i.delegate.eof.bind(i.delegate));var a=new Ma;a.pos=0,a.writeByte=function(){this.pos++};for(var n=new Wd(i,a),r=n.dbufSize;!("eof"in i&&i.eof());){var o=i.pos*8+n.reader.bitOffset;if(n.reader.hasByte&&(o-=8),n._init_block()){var s=a.pos;n._read_bunzip(),e(o,a.pos-s)}else if(n.reader.read(32),d&&"eof"in i&&!i.eof())n._start_bunzip(i,a),console.assert(n.dbufSize===r,"shouldn't change block size within multistream file");else break}},ag={Bunzip:Wd,Stream:Ma,Err:ve,decode:tg,decodeBlock:dg,table:ig},ng=vm({__proto__:null},[ag]),rg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",og=t=>{let e=rg.indexOf(t);return e<0?void 0:e},Cc=t=>{let e=`${t}`;if(e=e.replace(/[ \t\n\f\r]/g,""),e.length%4===0&&(e=e.replace(/==?$/,"")),e.length%4===1||/[^+/0-9A-Za-z]/.test(e))return;let d="",i=0,a=0;return[...e].forEach(n=>{i<<=6,i|=og(n),a+=6,a===24&&(d+=String.fromCharCode((i&16711680)>>16),d+=String.fromCharCode((i&65280)>>8),d+=String.fromCharCode(i&255),i=a=0)}),a===12?(i>>=4,d+=String.fromCharCode(i)):a===18&&(i>>=2,d+=String.fromCharCode((i&65280)>>8),d+=String.fromCharCode(i&255)),d},sg=t=>t==null||t.length===0,Me=class se{static#n="MTc1MjAyMzc2MjIzMg==";static#i;static#a=!1;static#e=void 0;static#t="none";static#d;static#o=`-----BEGIN PGP PUBLIC KEY BLOCK-----
9339
+ `)}armor(e=J){let d=this.signature.packets.some(a=>a.version!==6),i={hash:d?Array.from(new Set(this.signature.packets.map(a=>l.read(l.hash,a.hashAlgorithm).toUpperCase()))).join():null,text:this.text,data:this.signature.packets.write()};return Zi(l.armor.signed,i,void 0,void 0,void 0,d,e)}};async function K2({cleartextMessage:t,config:e,...d}){if(e={...J,...e},!t)throw new Error("readCleartextMessage: must pass options object containing `cleartextMessage`");if(!I.isString(t))throw new Error("readCleartextMessage: options.cleartextMessage must be a string");let i=Object.keys(d);if(i.length>0)throw new Error(`Unknown option: ${i.join(", ")}`);let a=await Bn(t);if(a.type!==l.armor.signed)throw new Error("No cleartext signed message.");let n=await Ue.fromBinary(a.data,W2,e);Y2(a.headers,n);let r=new Gi(n);return new xn(a.text,r)}function Y2(t,e){let d=function(a){let n=r=>o=>r.hashAlgorithm===o;for(let r=0;r<e.length;r++)if(e[r].constructor.tag===l.packet.signature&&!a.some(n(e[r])))return!1;return!0},i=[];if(t.forEach(a=>{let n=a.match(/^Hash: (.+)$/);if(n){let r=n[1].replace(/\s/g,"").split(",").map(o=>{try{return l.write(l.hash,o.toLowerCase())}catch{throw new Error("Unknown hash algorithm in armor header: "+o.toLowerCase())}});i.push(...r)}else throw new Error('Only "Hash" header allowed in cleartext signed message')}),i.length&&!d(i))throw new Error("Hash algorithm mismatch in armor header and signature")}async function _2({message:t,verificationKeys:e,expectSigned:d=!1,format:i="utf8",signature:a=null,date:n=new Date,config:r,...o}){if(r={...J,...r},Z2(r),J2(t),e=e0(e),o.publicKeys)throw new Error("The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead");let s=Object.keys(o);if(s.length>0)throw new Error(`Unknown option: ${s.join(", ")}`);if(t instanceof xn&&i==="binary")throw new Error("Can't return cleartext message data as binary");if(t instanceof xn&&a)throw new Error("Can't verify detached cleartext signature");try{let c={};if(a?c.signatures=await t.verifyDetached(a,e,n,r):c.signatures=await t.verify(e,n,r),c.data=i==="binary"?t.getLiteralData():t.getText(),t.fromStream&&!a&&d0(c,t),d){if(c.signatures.length===0)throw new Error("Message is not signed");c.data=ut([c.data,Vd(async()=>(await I.anyPromise(c.signatures.map(p=>p.verified)),i==="binary"?new Uint8Array:""))])}return c.data=await t0(c.data),c}catch(c){throw I.wrapError("Error verifying signed message",c)}}function J2(t){if(!(t instanceof xn)&&!(t instanceof z2))throw new Error("Parameter [message] needs to be of type Message or CleartextMessage")}var $2=Object.keys(J).length;function Z2(t){let e=Object.keys(t);if(e.length!==$2){for(let d of e)if(J[d]===void 0)throw new Error(`Unknown config property: ${d}`)}}function e0(t){return t&&!I.isArray(t)&&(t=[t]),t}async function t0(t){return I.isStream(t)==="array"?Ve(t):t}function d0(t,e){t.data=Qd(e.packets.stream,async(d,i)=>{await hi(t.data,i,{preventClose:!0});let a=ht(i);try{await Ve(d,n=>n),await a.close()}catch(n){await a.abort(n)}})}function Ln(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function i0(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Ga(t,...e){if(!i0(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function a0(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ln(t.outputLen),Ln(t.blockLen)}function Yi(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Xl(t,e){Ga(t);let d=e.outputLen;if(t.length<d)throw new Error(`digestInto() expects output buffer of length at least ${d}`)}var Ni=typeof et=="object"&&"crypto"in et?et.crypto:void 0,n0=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),br=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ot=(t,e)=>t<<32-e|t>>>e,Od=(t,e)=>t<<e|t>>>32-e>>>0,ec=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,r0=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function tc(t){for(let e=0;e<t.length;e++)t[e]=r0(t[e])}function Tl(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Qa(t){return typeof t=="string"&&(t=Tl(t)),Ga(t),t}function Dl(...t){let e=0;for(let i=0;i<t.length;i++){let a=t[i];Ga(a),e+=a.length}let d=new Uint8Array(e);for(let i=0,a=0;i<t.length;i++){let n=t[i];d.set(n,a),a+=n.length}return d}var Vo=class{clone(){return this._cloneInto()}};function Jt(t){let e=i=>t().update(Qa(i)).digest(),d=t();return e.outputLen=d.outputLen,e.blockLen=d.blockLen,e.create=()=>t(),e}function o0(t){let e=(i,a)=>t(a).update(Qa(i)).digest(),d=t({});return e.outputLen=d.outputLen,e.blockLen=d.blockLen,e.create=i=>t(i),e}function zo(t=32){if(Ni&&typeof Ni.getRandomValues=="function")return Ni.getRandomValues(new Uint8Array(t));if(Ni&&typeof Ni.randomBytes=="function")return Ni.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function s0(t,e,d,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,d,i);let a=BigInt(32),n=BigInt(4294967295),r=Number(d>>a&n),o=Number(d&n),s=i?4:0,c=i?0:4;t.setUint32(e+s,r,i),t.setUint32(e+c,o,i)}var Rl=(t,e,d)=>t&e^~t&d,Nl=(t,e,d)=>t&e^t&d^e&d,Va=class extends Vo{constructor(t,e,d,i){super(),this.blockLen=t,this.outputLen=e,this.padOffset=d,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=br(this.buffer)}update(t){Yi(this);let{view:e,buffer:d,blockLen:i}=this;t=Qa(t);let a=t.length;for(let n=0;n<a;){let r=Math.min(i-this.pos,a-n);if(r===i){let o=br(t);for(;i<=a-n;n+=i)this.process(o,n);continue}d.set(t.subarray(n,n+r),this.pos),this.pos+=r,n+=r,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Yi(this),Xl(t,this),this.finished=!0;let{buffer:e,view:d,blockLen:i,isLE:a}=this,{pos:n}=this;e[n++]=128,this.buffer.subarray(n).fill(0),this.padOffset>i-n&&(this.process(d,0),n=0);for(let p=n;p<i;p++)e[p]=0;s0(d,i-8,BigInt(this.length*8),a),this.process(d,0);let r=br(t),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let s=o/4,c=this.get();if(s>c.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<s;p++)r.setUint32(4*p,c[p],a)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let d=t.slice(0,e);return this.destroy(),d}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:d,length:i,finished:a,destroyed:n,pos:r}=this;return t.length=i,t.pos=r,t.finished=a,t.destroyed=n,i%e&&t.buffer.set(d),t}},c0=new Uint32Array([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]),vd=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Cd=new Uint32Array(64),Al=class extends Va{constructor(){super(64,32,8,!1),this.A=vd[0]|0,this.B=vd[1]|0,this.C=vd[2]|0,this.D=vd[3]|0,this.E=vd[4]|0,this.F=vd[5]|0,this.G=vd[6]|0,this.H=vd[7]|0}get(){let{A:t,B:e,C:d,D:i,E:a,F:n,G:r,H:o}=this;return[t,e,d,i,a,n,r,o]}set(t,e,d,i,a,n,r,o){this.A=t|0,this.B=e|0,this.C=d|0,this.D=i|0,this.E=a|0,this.F=n|0,this.G=r|0,this.H=o|0}process(t,e){for(let p=0;p<16;p++,e+=4)Cd[p]=t.getUint32(e,!1);for(let p=16;p<64;p++){let u=Cd[p-15],m=Cd[p-2],S=Ot(u,7)^Ot(u,18)^u>>>3,g=Ot(m,17)^Ot(m,19)^m>>>10;Cd[p]=g+Cd[p-7]+S+Cd[p-16]|0}let{A:d,B:i,C:a,D:n,E:r,F:o,G:s,H:c}=this;for(let p=0;p<64;p++){let u=Ot(r,6)^Ot(r,11)^Ot(r,25),m=c+u+Rl(r,o,s)+c0[p]+Cd[p]|0,S=(Ot(d,2)^Ot(d,13)^Ot(d,22))+Nl(d,i,a)|0;c=s,s=o,o=r,r=n+m|0,n=a,a=i,i=d,d=m+S|0}d=d+this.A|0,i=i+this.B|0,a=a+this.C|0,n=n+this.D|0,r=r+this.E|0,o=o+this.F|0,s=s+this.G|0,c=c+this.H|0,this.set(d,i,a,n,r,o,s,c)}roundClean(){Cd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},p0=class extends Al{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},Zn=Jt(()=>new Al),l0=Jt(()=>new p0),wl=class extends Vo{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,a0(t);let d=Qa(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,a=new Uint8Array(i);a.set(d.length>i?t.create().update(d).digest():d);for(let n=0;n<a.length;n++)a[n]^=54;this.iHash.update(a),this.oHash=t.create();for(let n=0;n<a.length;n++)a[n]^=106;this.oHash.update(a),a.fill(0)}update(t){return Yi(this),this.iHash.update(t),this}digestInto(t){Yi(this),Ga(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:d,finished:i,destroyed:a,blockLen:n,outputLen:r}=this;return t=t,t.finished=i,t.destroyed=a,t.blockLen=n,t.outputLen=r,t.oHash=e._cloneInto(t.oHash),t.iHash=d._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Ml=(t,e,d)=>new wl(t,e).update(d).digest();Ml.create=(t,e)=>new wl(t,e);var Ho=BigInt(0),er=BigInt(1),u0=BigInt(2);function Si(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function za(t){if(!Si(t))throw new Error("Uint8Array expected")}function Pd(t,e){if(typeof e!="boolean")throw new Error(`${t} must be valid boolean, got "${e}".`)}var m0=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Pi(t){za(t);let e="";for(let d=0;d<t.length;d++)e+=m0[t[d]];return e}function qi(t){let e=t.toString(16);return e.length&1?`0${e}`:e}function Wo(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}var od={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function dc(t){if(t>=od._0&&t<=od._9)return t-od._0;if(t>=od._A&&t<=od._F)return t-(od._A-10);if(t>=od._a&&t<=od._f)return t-(od._a-10)}function _i(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);let e=t.length,d=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let i=new Uint8Array(d);for(let a=0,n=0;a<d;a++,n+=2){let r=dc(t.charCodeAt(n)),o=dc(t.charCodeAt(n+1));if(r===void 0||o===void 0){let s=t[n]+t[n+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+n)}i[a]=r*16+o}return i}function li(t){return Wo(Pi(t))}function Ud(t){return za(t),Wo(Pi(Uint8Array.from(t).reverse()))}function Ji(t,e){return _i(t.toString(16).padStart(e*2,"0"))}function $i(t,e){return Ji(t,e).reverse()}function y0(t){return _i(qi(t))}function Le(t,e,d){let i;if(typeof e=="string")try{i=_i(e)}catch(n){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${n}`)}else if(Si(e))i=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);let a=i.length;if(typeof d=="number"&&a!==d)throw new Error(`${t} expected ${d} bytes, got ${a}`);return i}function gi(...t){let e=0;for(let i=0;i<t.length;i++){let a=t[i];za(a),e+=a.length}let d=new Uint8Array(e);for(let i=0,a=0;i<t.length;i++){let n=t[i];d.set(n,a),a+=n.length}return d}function S0(t,e){if(t.length!==e.length)return!1;let d=0;for(let i=0;i<t.length;i++)d|=t[i]^e[i];return d===0}function P0(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}var Fr=t=>typeof t=="bigint"&&Ho<=t;function tr(t,e,d){return Fr(t)&&Fr(e)&&Fr(d)&&e<=t&&t<d}function pt(t,e,d,i){if(!tr(e,d,i))throw new Error(`expected valid ${t}: ${d} <= n < ${i}, got ${typeof e} ${e}`)}function xl(t){let e;for(e=0;t>Ho;t>>=er,e+=1);return e}function g0(t,e){return t>>BigInt(e)&er}function h0(t,e,d){return t|(d?er:Ho)<<BigInt(e)}var Ko=t=>(u0<<BigInt(t-1))-er,Er=t=>new Uint8Array(t),ic=t=>Uint8Array.from(t);function Ll(t,e,d){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof d!="function")throw new Error("hmacFn must be a function");let i=Er(t),a=Er(t),n=0,r=()=>{i.fill(1),a.fill(0),n=0},o=(...p)=>d(a,i,...p),s=(p=Er())=>{a=o(ic([0]),p),i=o(),p.length!==0&&(a=o(ic([1]),p),i=o())},c=()=>{if(n++>=1e3)throw new Error("drbg: tried 1000 values");let p=0,u=[];for(;p<e;){i=o();let m=i.slice();u.push(m),p+=i.length}return gi(...u)};return(p,u)=>{r(),s(p);let m;for(;!(m=u(c()));)s();return r(),m}}var f0={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Si(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function bi(t,e,d={}){let i=(a,n,r)=>{let o=f0[n];if(typeof o!="function")throw new Error(`Invalid validator "${n}", expected function`);let s=t[a];if(!(r&&s===void 0)&&!o(s,t))throw new Error(`Invalid param ${String(a)}=${s} (${typeof s}), expected ${n}`)};for(let[a,n]of Object.entries(e))i(a,n,!1);for(let[a,n]of Object.entries(d))i(a,n,!0);return t}var I0=()=>{throw new Error("not implemented")};function Ta(t){let e=new WeakMap;return(d,...i)=>{let a=e.get(d);if(a!==void 0)return a;let n=t(d,...i);return e.set(d,n),n}}var b0=Object.freeze({__proto__:null,aInRange:pt,abool:Pd,abytes:za,bitGet:g0,bitLen:xl,bitMask:Ko,bitSet:h0,bytesToHex:Pi,bytesToNumberBE:li,bytesToNumberLE:Ud,concatBytes:gi,createHmacDrbg:Ll,ensureBytes:Le,equalBytes:S0,hexToBytes:_i,hexToNumber:Wo,inRange:tr,isBytes:Si,memoized:Ta,notImplemented:I0,numberToBytesBE:Ji,numberToBytesLE:$i,numberToHexUnpadded:qi,numberToVarBytesBE:y0,utf8ToBytes:P0,validateObject:bi}),He=BigInt(0),ke=BigInt(1),ri=BigInt(2),F0=BigInt(3),so=BigInt(4),ac=BigInt(5),nc=BigInt(8);BigInt(9);BigInt(16);function Re(t,e){let d=t%e;return d>=He?d:e+d}function Ol(t,e,d){if(d<=He||e<He)throw new Error("Expected power/modulo > 0");if(d===ke)return He;let i=ke;for(;e>He;)e&ke&&(i=i*t%d),t=t*t%d,e>>=ke;return i}function Xe(t,e,d){let i=t;for(;e-- >He;)i*=i,i%=d;return i}function co(t,e){if(t===He||e<=He)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let d=Re(t,e),i=e,a=He,n=ke;for(;d!==He;){let r=i/d,o=i%d,s=a-n*r;i=d,d=o,a=n,n=s}if(i!==ke)throw new Error("invert: does not exist");return Re(a,e)}function E0(t){let e=(t-ke)/ri,d,i,a;for(d=t-ke,i=0;d%ri===He;d/=ri,i++);for(a=ri;a<t&&Ol(a,e,t)!==t-ke;a++);if(i===1){let r=(t+ke)/so;return function(o,s){let c=o.pow(s,r);if(!o.eql(o.sqr(c),s))throw new Error("Cannot find square root");return c}}let n=(d+ke)/ri;return function(r,o){if(r.pow(o,e)===r.neg(r.ONE))throw new Error("Cannot find square root");let s=i,c=r.pow(r.mul(r.ONE,a),d),p=r.pow(o,n),u=r.pow(o,d);for(;!r.eql(u,r.ONE);){if(r.eql(u,r.ZERO))return r.ZERO;let m=1;for(let g=r.sqr(u);m<s&&!r.eql(g,r.ONE);m++)g=r.sqr(g);let S=r.pow(c,ke<<BigInt(s-m-1));c=r.sqr(S),p=r.mul(p,S),u=r.mul(u,c),s=m}return p}}function v0(t){if(t%so===F0){let e=(t+ke)/so;return function(d,i){let a=d.pow(i,e);if(!d.eql(d.sqr(a),i))throw new Error("Cannot find square root");return a}}if(t%nc===ac){let e=(t-ac)/nc;return function(d,i){let a=d.mul(i,ri),n=d.pow(a,e),r=d.mul(i,n),o=d.mul(d.mul(r,ri),n),s=d.mul(r,d.sub(o,d.ONE));if(!d.eql(d.sqr(s),i))throw new Error("Cannot find square root");return s}}return E0(t)}var C0=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function X0(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},d=C0.reduce((i,a)=>(i[a]="function",i),e);return bi(t,d)}function T0(t,e,d){if(d<He)throw new Error("Expected power > 0");if(d===He)return t.ONE;if(d===ke)return e;let i=t.ONE,a=e;for(;d>He;)d&ke&&(i=t.mul(i,a)),a=t.sqr(a),d>>=ke;return i}function D0(t,e){let d=new Array(e.length),i=e.reduce((n,r,o)=>t.is0(r)?n:(d[o]=n,t.mul(n,r)),t.ONE),a=t.inv(i);return e.reduceRight((n,r,o)=>t.is0(r)?n:(d[o]=t.mul(n,d[o]),t.mul(n,r)),a),d}function Ul(t,e){let d=e!==void 0?e:t.toString(2).length,i=Math.ceil(d/8);return{nBitLength:d,nByteLength:i}}function $t(t,e,d=!1,i={}){if(t<=He)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:a,nByteLength:n}=Ul(t,e);if(n>2048)throw new Error("Field lengths over 2048 bytes are not supported");let r=v0(t),o=Object.freeze({ORDER:t,BITS:a,BYTES:n,MASK:Ko(a),ZERO:He,ONE:ke,create:s=>Re(s,t),isValid:s=>{if(typeof s!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof s}`);return He<=s&&s<t},is0:s=>s===He,isOdd:s=>(s&ke)===ke,neg:s=>Re(-s,t),eql:(s,c)=>s===c,sqr:s=>Re(s*s,t),add:(s,c)=>Re(s+c,t),sub:(s,c)=>Re(s-c,t),mul:(s,c)=>Re(s*c,t),pow:(s,c)=>T0(o,s,c),div:(s,c)=>Re(s*co(c,t),t),sqrN:s=>s*s,addN:(s,c)=>s+c,subN:(s,c)=>s-c,mulN:(s,c)=>s*c,inv:s=>co(s,t),sqrt:i.sqrt||(s=>r(o,s)),invertBatch:s=>D0(o,s),cmov:(s,c,p)=>p?c:s,toBytes:s=>d?$i(s,n):Ji(s,n),fromBytes:s=>{if(s.length!==n)throw new Error(`Fp.fromBytes: expected ${n}, got ${s.length}`);return d?Ud(s):li(s)}});return Object.freeze(o)}function kl(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function ql(t){let e=kl(t);return e+Math.ceil(e/2)}function R0(t,e,d=!1){let i=t.length,a=kl(e),n=ql(e);if(i<16||i<n||i>1024)throw new Error(`expected ${n}-1024 bytes of input, got ${i}`);let r=d?li(t):Ud(t),o=Re(r,e-ke)+ke;return d?$i(o,a):Ji(o,a)}var N0=BigInt(0),vr=BigInt(1),Cr=new WeakMap,rc=new WeakMap;function Bl(t,e){let d=(n,r)=>{let o=r.negate();return n?o:r},i=n=>{if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error(`Wrong window size=${n}, should be [1..${e}]`)},a=n=>{i(n);let r=Math.ceil(e/n)+1,o=2**(n-1);return{windows:r,windowSize:o}};return{constTimeNegate:d,unsafeLadder(n,r){let o=t.ZERO,s=n;for(;r>N0;)r&vr&&(o=o.add(s)),s=s.double(),r>>=vr;return o},precomputeWindow(n,r){let{windows:o,windowSize:s}=a(r),c=[],p=n,u=p;for(let m=0;m<o;m++){u=p,c.push(u);for(let S=1;S<s;S++)u=u.add(p),c.push(u);p=u.double()}return c},wNAF(n,r,o){let{windows:s,windowSize:c}=a(n),p=t.ZERO,u=t.BASE,m=BigInt(2**n-1),S=2**n,g=BigInt(n);for(let y=0;y<s;y++){let P=y*c,f=Number(o&m);o>>=g,f>c&&(f-=S,o+=vr);let E=P,v=P+Math.abs(f)-1,F=y%2!==0,D=f<0;f===0?u=u.add(d(F,r[E])):p=p.add(d(D,r[v]))}return{p,f:u}},wNAFCached(n,r,o){let s=rc.get(n)||1,c=Cr.get(n);return c||(c=this.precomputeWindow(n,s),s!==1&&Cr.set(n,o(c))),this.wNAF(s,c,r)},setWindowSize(n,r){i(r),rc.set(n,r),Cr.delete(n)}}}function jl(t,e,d,i){if(!Array.isArray(d)||!Array.isArray(i)||i.length!==d.length)throw new Error("arrays of points and scalars must have equal length");i.forEach((p,u)=>{if(!e.isValid(p))throw new Error(`wrong scalar at index ${u}`)}),d.forEach((p,u)=>{if(!(p instanceof t))throw new Error(`wrong point at index ${u}`)});let a=xl(BigInt(d.length)),n=a>12?a-3:a>4?a-2:a?2:1,r=(1<<n)-1,o=new Array(r+1).fill(t.ZERO),s=Math.floor((e.BITS-1)/n)*n,c=t.ZERO;for(let p=s;p>=0;p-=n){o.fill(t.ZERO);for(let m=0;m<i.length;m++){let S=i[m],g=Number(S>>BigInt(p)&BigInt(r));o[g]=o[g].add(d[m])}let u=t.ZERO;for(let m=o.length-1,S=t.ZERO;m>0;m--)S=S.add(o[m]),u=u.add(S);if(c=c.add(u),p!==0)for(let m=0;m<n;m++)c=c.double()}return c}function Yo(t){return X0(t.Fp),bi(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ul(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function oc(t){t.lowS!==void 0&&Pd("lowS",t.lowS),t.prehash!==void 0&&Pd("prehash",t.prehash)}function A0(t){let e=Yo(t);bi(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:d,Fp:i,a}=e;if(d){if(!i.eql(a,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof d!="object"||typeof d.beta!="bigint"||typeof d.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:w0,hexToBytes:M0}=b0,md={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(t,e)=>{let{Err:d}=md;if(t<0||t>256)throw new d("tlv.encode: wrong tag");if(e.length&1)throw new d("tlv.encode: unpadded data");let i=e.length/2,a=qi(i);if(a.length/2&128)throw new d("tlv.encode: long form length too big");let n=i>127?qi(a.length/2|128):"";return`${qi(t)}${n}${a}${e}`},decode(t,e){let{Err:d}=md,i=0;if(t<0||t>256)throw new d("tlv.encode: wrong tag");if(e.length<2||e[i++]!==t)throw new d("tlv.decode: wrong tlv");let a=e[i++],n=!!(a&128),r=0;if(!n)r=a;else{let s=a&127;if(!s)throw new d("tlv.decode(long): indefinite length not supported");if(s>4)throw new d("tlv.decode(long): byte length is too big");let c=e.subarray(i,i+s);if(c.length!==s)throw new d("tlv.decode: length bytes not complete");if(c[0]===0)throw new d("tlv.decode(long): zero leftmost byte");for(let p of c)r=r<<8|p;if(i+=s,r<128)throw new d("tlv.decode(long): not minimal encoding")}let o=e.subarray(i,i+r);if(o.length!==r)throw new d("tlv.decode: wrong value length");return{v:o,l:e.subarray(i+r)}}},_int:{encode(t){let{Err:e}=md;if(t<yd)throw new e("integer: negative integers are not allowed");let d=qi(t);if(Number.parseInt(d[0],16)&8&&(d="00"+d),d.length&1)throw new e("unexpected assertion");return d},decode(t){let{Err:e}=md;if(t[0]&128)throw new e("Invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return w0(t)}},toSig(t){let{Err:e,_int:d,_tlv:i}=md,a=typeof t=="string"?M0(t):t;za(a);let{v:n,l:r}=i.decode(48,a);if(r.length)throw new e("Invalid signature: left bytes after parsing");let{v:o,l:s}=i.decode(2,n),{v:c,l:p}=i.decode(2,s);if(p.length)throw new e("Invalid signature: left bytes after parsing");return{r:d.decode(o),s:d.decode(c)}},hexFromSig(t){let{_tlv:e,_int:d}=md,i=`${e.encode(2,d.encode(t.r))}${e.encode(2,d.encode(t.s))}`;return e.encode(48,i)}},yd=BigInt(0),Qe=BigInt(1);BigInt(2);var sc=BigInt(3);BigInt(4);function x0(t){let e=A0(t),{Fp:d}=e,i=$t(e.n,e.nBitLength),a=e.toBytes||((y,P,f)=>{let E=P.toAffine();return gi(Uint8Array.from([4]),d.toBytes(E.x),d.toBytes(E.y))}),n=e.fromBytes||(y=>{let P=y.subarray(1),f=d.fromBytes(P.subarray(0,d.BYTES)),E=d.fromBytes(P.subarray(d.BYTES,2*d.BYTES));return{x:f,y:E}});function r(y){let{a:P,b:f}=e,E=d.sqr(y),v=d.mul(E,y);return d.add(d.add(v,d.mul(y,P)),f)}if(!d.eql(d.sqr(e.Gy),r(e.Gx)))throw new Error("bad generator point: equation left != right");function o(y){return tr(y,Qe,e.n)}function s(y){let{allowedPrivateKeyLengths:P,nByteLength:f,wrapPrivateKey:E,n:v}=e;if(P&&typeof y!="bigint"){if(Si(y)&&(y=Pi(y)),typeof y!="string"||!P.includes(y.length))throw new Error("Invalid key");y=y.padStart(f*2,"0")}let F;try{F=typeof y=="bigint"?y:li(Le("private key",y,f))}catch{throw new Error(`private key must be ${f} bytes, hex or bigint, not ${typeof y}`)}return E&&(F=Re(F,v)),pt("private key",F,Qe,v),F}function c(y){if(!(y instanceof m))throw new Error("ProjectivePoint expected")}let p=Ta((y,P)=>{let{px:f,py:E,pz:v}=y;if(d.eql(v,d.ONE))return{x:f,y:E};let F=y.is0();P==null&&(P=F?d.ONE:d.inv(v));let D=d.mul(f,P),h=d.mul(E,P),X=d.mul(v,P);if(F)return{x:d.ZERO,y:d.ZERO};if(!d.eql(X,d.ONE))throw new Error("invZ was invalid");return{x:D,y:h}}),u=Ta(y=>{if(y.is0()){if(e.allowInfinityPoint&&!d.is0(y.py))return;throw new Error("bad point: ZERO")}let{x:P,y:f}=y.toAffine();if(!d.isValid(P)||!d.isValid(f))throw new Error("bad point: x or y not FE");let E=d.sqr(f),v=r(P);if(!d.eql(E,v))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(P,f,E){if(this.px=P,this.py=f,this.pz=E,P==null||!d.isValid(P))throw new Error("x required");if(f==null||!d.isValid(f))throw new Error("y required");if(E==null||!d.isValid(E))throw new Error("z required");Object.freeze(this)}static fromAffine(P){let{x:f,y:E}=P||{};if(!P||!d.isValid(f)||!d.isValid(E))throw new Error("invalid affine point");if(P instanceof m)throw new Error("projective point not allowed");let v=F=>d.eql(F,d.ZERO);return v(f)&&v(E)?m.ZERO:new m(f,E,d.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(P){let f=d.invertBatch(P.map(E=>E.pz));return P.map((E,v)=>E.toAffine(f[v])).map(m.fromAffine)}static fromHex(P){let f=m.fromAffine(n(Le("pointHex",P)));return f.assertValidity(),f}static fromPrivateKey(P){return m.BASE.multiply(s(P))}static msm(P,f){return jl(m,i,P,f)}_setWindowSize(P){g.setWindowSize(this,P)}assertValidity(){u(this)}hasEvenY(){let{y:P}=this.toAffine();if(d.isOdd)return!d.isOdd(P);throw new Error("Field doesn't support isOdd")}equals(P){c(P);let{px:f,py:E,pz:v}=this,{px:F,py:D,pz:h}=P,X=d.eql(d.mul(f,h),d.mul(F,v)),b=d.eql(d.mul(E,h),d.mul(D,v));return X&&b}negate(){return new m(this.px,d.neg(this.py),this.pz)}double(){let{a:P,b:f}=e,E=d.mul(f,sc),{px:v,py:F,pz:D}=this,h=d.ZERO,X=d.ZERO,b=d.ZERO,T=d.mul(v,v),C=d.mul(F,F),R=d.mul(D,D),M=d.mul(v,F);return M=d.add(M,M),b=d.mul(v,D),b=d.add(b,b),h=d.mul(P,b),X=d.mul(E,R),X=d.add(h,X),h=d.sub(C,X),X=d.add(C,X),X=d.mul(h,X),h=d.mul(M,h),b=d.mul(E,b),R=d.mul(P,R),M=d.sub(T,R),M=d.mul(P,M),M=d.add(M,b),b=d.add(T,T),T=d.add(b,T),T=d.add(T,R),T=d.mul(T,M),X=d.add(X,T),R=d.mul(F,D),R=d.add(R,R),T=d.mul(R,M),h=d.sub(h,T),b=d.mul(R,C),b=d.add(b,b),b=d.add(b,b),new m(h,X,b)}add(P){c(P);let{px:f,py:E,pz:v}=this,{px:F,py:D,pz:h}=P,X=d.ZERO,b=d.ZERO,T=d.ZERO,C=e.a,R=d.mul(e.b,sc),M=d.mul(f,F),x=d.mul(E,D),N=d.mul(v,h),w=d.add(f,E),A=d.add(F,D);w=d.mul(w,A),A=d.add(M,x),w=d.sub(w,A),A=d.add(f,v);let U=d.add(F,h);return A=d.mul(A,U),U=d.add(M,N),A=d.sub(A,U),U=d.add(E,v),X=d.add(D,h),U=d.mul(U,X),X=d.add(x,N),U=d.sub(U,X),T=d.mul(C,A),X=d.mul(R,N),T=d.add(X,T),X=d.sub(x,T),T=d.add(x,T),b=d.mul(X,T),x=d.add(M,M),x=d.add(x,M),N=d.mul(C,N),A=d.mul(R,A),x=d.add(x,N),N=d.sub(M,N),N=d.mul(C,N),A=d.add(A,N),M=d.mul(x,A),b=d.add(b,M),M=d.mul(U,A),X=d.mul(w,X),X=d.sub(X,M),M=d.mul(w,x),T=d.mul(U,T),T=d.add(T,M),new m(X,b,T)}subtract(P){return this.add(P.negate())}is0(){return this.equals(m.ZERO)}wNAF(P){return g.wNAFCached(this,P,m.normalizeZ)}multiplyUnsafe(P){pt("scalar",P,yd,e.n);let f=m.ZERO;if(P===yd)return f;if(P===Qe)return this;let{endo:E}=e;if(!E)return g.unsafeLadder(this,P);let{k1neg:v,k1:F,k2neg:D,k2:h}=E.splitScalar(P),X=f,b=f,T=this;for(;F>yd||h>yd;)F&Qe&&(X=X.add(T)),h&Qe&&(b=b.add(T)),T=T.double(),F>>=Qe,h>>=Qe;return v&&(X=X.negate()),D&&(b=b.negate()),b=new m(d.mul(b.px,E.beta),b.py,b.pz),X.add(b)}multiply(P){let{endo:f,n:E}=e;pt("scalar",P,Qe,E);let v,F;if(f){let{k1neg:D,k1:h,k2neg:X,k2:b}=f.splitScalar(P),{p:T,f:C}=this.wNAF(h),{p:R,f:M}=this.wNAF(b);T=g.constTimeNegate(D,T),R=g.constTimeNegate(X,R),R=new m(d.mul(R.px,f.beta),R.py,R.pz),v=T.add(R),F=C.add(M)}else{let{p:D,f:h}=this.wNAF(P);v=D,F=h}return m.normalizeZ([v,F])[0]}multiplyAndAddUnsafe(P,f,E){let v=m.BASE,F=(h,X)=>X===yd||X===Qe||!h.equals(v)?h.multiplyUnsafe(X):h.multiply(X),D=F(this,f).add(F(P,E));return D.is0()?void 0:D}toAffine(P){return p(this,P)}isTorsionFree(){let{h:P,isTorsionFree:f}=e;if(P===Qe)return!0;if(f)return f(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:P,clearCofactor:f}=e;return P===Qe?this:f?f(m,this):this.multiplyUnsafe(e.h)}toRawBytes(P=!0){return Pd("isCompressed",P),this.assertValidity(),a(m,this,P)}toHex(P=!0){return Pd("isCompressed",P),Pi(this.toRawBytes(P))}}m.BASE=new m(e.Gx,e.Gy,d.ONE),m.ZERO=new m(d.ZERO,d.ONE,d.ZERO);let S=e.nBitLength,g=Bl(m,e.endo?Math.ceil(S/2):S);return{CURVE:e,ProjectivePoint:m,normPrivateKeyToScalar:s,weierstrassEquation:r,isWithinCurveOrder:o}}function L0(t){let e=Yo(t);return bi(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function O0(t){let e=L0(t),{Fp:d,n:i}=e,a=d.BYTES+1,n=2*d.BYTES+1;function r(N){return Re(N,i)}function o(N){return co(N,i)}let{ProjectivePoint:s,normPrivateKeyToScalar:c,weierstrassEquation:p,isWithinCurveOrder:u}=x0({...e,toBytes(N,w,A){let U=w.toAffine(),L=d.toBytes(U.x),j=gi;return Pd("isCompressed",A),A?j(Uint8Array.from([w.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,d.toBytes(U.y))},fromBytes(N){let w=N.length,A=N[0],U=N.subarray(1);if(w===a&&(A===2||A===3)){let L=li(U);if(!tr(L,Qe,d.ORDER))throw new Error("Point is not on curve");let j=p(L),B;try{B=d.sqrt(j)}catch(Y){let Q=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+Q)}let H=(B&Qe)===Qe;return(A&1)===1!==H&&(B=d.neg(B)),{x:L,y:B}}else if(w===n&&A===4){let L=d.fromBytes(U.subarray(0,d.BYTES)),j=d.fromBytes(U.subarray(d.BYTES,2*d.BYTES));return{x:L,y:j}}else throw new Error(`Point of length ${w} was invalid. Expected ${a} compressed bytes or ${n} uncompressed bytes`)}}),m=N=>Pi(Ji(N,e.nByteLength));function S(N){let w=i>>Qe;return N>w}function g(N){return S(N)?r(-N):N}let y=(N,w,A)=>li(N.slice(w,A));class P{constructor(w,A,U){this.r=w,this.s=A,this.recovery=U,this.assertValidity()}static fromCompact(w){let A=e.nByteLength;return w=Le("compactSignature",w,A*2),new P(y(w,0,A),y(w,A,2*A))}static fromDER(w){let{r:A,s:U}=md.toSig(Le("DER",w));return new P(A,U)}assertValidity(){pt("r",this.r,Qe,i),pt("s",this.s,Qe,i)}addRecoveryBit(w){return new P(this.r,this.s,w)}recoverPublicKey(w){let{r:A,s:U,recovery:L}=this,j=h(Le("msgHash",w));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");let B=L===2||L===3?A+e.n:A;if(B>=d.ORDER)throw new Error("recovery id 2 or 3 invalid");let H=(L&1)===0?"02":"03",Y=s.fromHex(H+m(B)),Q=o(B),W=r(-j*Q),G=r(U*Q),K=s.BASE.multiplyAndAddUnsafe(Y,W,G);if(!K)throw new Error("point at infinify");return K.assertValidity(),K}hasHighS(){return S(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,r(-this.s),this.recovery):this}toDERRawBytes(){return _i(this.toDERHex())}toDERHex(){return md.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return _i(this.toCompactHex())}toCompactHex(){return m(this.r)+m(this.s)}}let f={isValidPrivateKey(N){try{return c(N),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{let N=ql(e.n);return R0(e.randomBytes(N),e.n)},precompute(N=8,w=s.BASE){return w._setWindowSize(N),w.multiply(BigInt(3)),w}};function E(N,w=!0){return s.fromPrivateKey(N).toRawBytes(w)}function v(N){let w=Si(N),A=typeof N=="string",U=(w||A)&&N.length;return w?U===a||U===n:A?U===2*a||U===2*n:N instanceof s}function F(N,w,A=!0){if(v(N))throw new Error("first arg must be private key");if(!v(w))throw new Error("second arg must be public key");return s.fromHex(w).multiply(c(N)).toRawBytes(A)}let D=e.bits2int||function(N){let w=li(N),A=N.length*8-e.nBitLength;return A>0?w>>BigInt(A):w},h=e.bits2int_modN||function(N){return r(D(N))},X=Ko(e.nBitLength);function b(N){return pt(`num < 2^${e.nBitLength}`,N,yd,X),Ji(N,e.nByteLength)}function T(N,w,A=C){if(["recovered","canonical"].some(_=>_ in A))throw new Error("sign() legacy options not supported");let{hash:U,randomBytes:L}=e,{lowS:j,prehash:B,extraEntropy:H}=A;j==null&&(j=!0),N=Le("msgHash",N),oc(A),B&&(N=Le("prehashed msgHash",U(N)));let Y=h(N),Q=c(w),W=[b(Q),b(Y)];if(H!=null&&H!==!1){let _=H===!0?L(d.BYTES):H;W.push(Le("extraEntropy",_))}let G=gi(...W),K=Y;function te(_){let Z=D(_);if(!u(Z))return;let de=o(Z),oe=s.BASE.multiply(Z).toAffine(),pe=r(oe.x);if(pe===yd)return;let fe=r(de*r(K+pe*Q));if(fe===yd)return;let me=(oe.x===pe?0:2)|Number(oe.y&Qe),Pe=fe;return j&&S(fe)&&(Pe=g(fe),me^=1),new P(pe,Pe,me)}return{seed:G,k2sig:te}}let C={lowS:e.lowS,prehash:!1},R={lowS:e.lowS,prehash:!1};function M(N,w,A=C){let{seed:U,k2sig:L}=T(N,w,A),j=e;return Ll(j.hash.outputLen,j.nByteLength,j.hmac)(U,L)}s.BASE._setWindowSize(8);function x(N,w,A,U=R){let L=N;if(w=Le("msgHash",w),A=Le("publicKey",A),"strict"in U)throw new Error("options.strict was renamed to lowS");oc(U);let{lowS:j,prehash:B}=U,H,Y;try{if(typeof L=="string"||Si(L))try{H=P.fromDER(L)}catch(de){if(!(de instanceof md.Err))throw de;H=P.fromCompact(L)}else if(typeof L=="object"&&typeof L.r=="bigint"&&typeof L.s=="bigint"){let{r:de,s:oe}=L;H=new P(de,oe)}else throw new Error("PARSE");Y=s.fromHex(A)}catch(de){if(de.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(j&&H.hasHighS())return!1;B&&(w=e.hash(w));let{r:Q,s:W}=H,G=h(w),K=o(W),te=r(G*K),_=r(Q*K),Z=s.BASE.multiplyAndAddUnsafe(Y,te,_)?.toAffine();return Z?r(Z.x)===Q:!1}return{CURVE:e,getPublicKey:E,getSharedSecret:F,sign:M,verify:x,ProjectivePoint:s,Signature:P,utils:f}}function U0(t){return{hash:t,hmac:(e,...d)=>Ml(t,e,Dl(...d)),randomBytes:zo}}function Fi(t,e){let d=i=>O0({...t,...U0(i)});return Object.freeze({...d(e),create:d})}var Gl=$t(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),k0=Gl.create(BigInt("-3")),q0=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),B0=Fi({a:k0,b:q0,Fp:Gl,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},Zn),tn=BigInt(2**32-1),po=BigInt(32);function Ql(t,e=!1){return e?{h:Number(t&tn),l:Number(t>>po&tn)}:{h:Number(t>>po&tn)|0,l:Number(t&tn)|0}}function Vl(t,e=!1){let d=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let a=0;a<t.length;a++){let{h:n,l:r}=Ql(t[a],e);[d[a],i[a]]=[n,r]}return[d,i]}var j0=(t,e)=>BigInt(t>>>0)<<po|BigInt(e>>>0),G0=(t,e,d)=>t>>>d,Q0=(t,e,d)=>t<<32-d|e>>>d,V0=(t,e,d)=>t>>>d|e<<32-d,z0=(t,e,d)=>t<<32-d|e>>>d,H0=(t,e,d)=>t<<64-d|e>>>d-32,W0=(t,e,d)=>t>>>d-32|e<<64-d,K0=(t,e)=>e,Y0=(t,e)=>t,zl=(t,e,d)=>t<<d|e>>>32-d,Hl=(t,e,d)=>e<<d|t>>>32-d,Wl=(t,e,d)=>e<<d-32|t>>>64-d,Kl=(t,e,d)=>t<<d-32|e>>>64-d;function _0(t,e,d,i){let a=(e>>>0)+(i>>>0);return{h:t+d+(a/2**32|0)|0,l:a|0}}var J0=(t,e,d)=>(t>>>0)+(e>>>0)+(d>>>0),$0=(t,e,d,i)=>e+d+i+(t/2**32|0)|0,Z0=(t,e,d,i)=>(t>>>0)+(e>>>0)+(d>>>0)+(i>>>0),e1=(t,e,d,i,a)=>e+d+i+a+(t/2**32|0)|0,t1=(t,e,d,i,a)=>(t>>>0)+(e>>>0)+(d>>>0)+(i>>>0)+(a>>>0),d1=(t,e,d,i,a,n)=>e+d+i+a+n+(t/2**32|0)|0,ce={fromBig:Ql,split:Vl,toBig:j0,shrSH:G0,shrSL:Q0,rotrSH:V0,rotrSL:z0,rotrBH:H0,rotrBL:W0,rotr32H:K0,rotr32L:Y0,rotlSH:zl,rotlSL:Hl,rotlBH:Wl,rotlBL:Kl,add:_0,add3L:J0,add3H:$0,add4L:Z0,add4H:e1,add5H:d1,add5L:t1},[i1,a1]=ce.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Xd=new Uint32Array(80),Td=new Uint32Array(80),Yl=class extends Va{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:d,Bl:i,Ch:a,Cl:n,Dh:r,Dl:o,Eh:s,El:c,Fh:p,Fl:u,Gh:m,Gl:S,Hh:g,Hl:y}=this;return[t,e,d,i,a,n,r,o,s,c,p,u,m,S,g,y]}set(t,e,d,i,a,n,r,o,s,c,p,u,m,S,g,y){this.Ah=t|0,this.Al=e|0,this.Bh=d|0,this.Bl=i|0,this.Ch=a|0,this.Cl=n|0,this.Dh=r|0,this.Dl=o|0,this.Eh=s|0,this.El=c|0,this.Fh=p|0,this.Fl=u|0,this.Gh=m|0,this.Gl=S|0,this.Hh=g|0,this.Hl=y|0}process(t,e){for(let E=0;E<16;E++,e+=4)Xd[E]=t.getUint32(e),Td[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let v=Xd[E-15]|0,F=Td[E-15]|0,D=ce.rotrSH(v,F,1)^ce.rotrSH(v,F,8)^ce.shrSH(v,F,7),h=ce.rotrSL(v,F,1)^ce.rotrSL(v,F,8)^ce.shrSL(v,F,7),X=Xd[E-2]|0,b=Td[E-2]|0,T=ce.rotrSH(X,b,19)^ce.rotrBH(X,b,61)^ce.shrSH(X,b,6),C=ce.rotrSL(X,b,19)^ce.rotrBL(X,b,61)^ce.shrSL(X,b,6),R=ce.add4L(h,C,Td[E-7],Td[E-16]),M=ce.add4H(R,D,T,Xd[E-7],Xd[E-16]);Xd[E]=M|0,Td[E]=R|0}let{Ah:d,Al:i,Bh:a,Bl:n,Ch:r,Cl:o,Dh:s,Dl:c,Eh:p,El:u,Fh:m,Fl:S,Gh:g,Gl:y,Hh:P,Hl:f}=this;for(let E=0;E<80;E++){let v=ce.rotrSH(p,u,14)^ce.rotrSH(p,u,18)^ce.rotrBH(p,u,41),F=ce.rotrSL(p,u,14)^ce.rotrSL(p,u,18)^ce.rotrBL(p,u,41),D=p&m^~p&g,h=u&S^~u&y,X=ce.add5L(f,F,h,a1[E],Td[E]),b=ce.add5H(X,P,v,D,i1[E],Xd[E]),T=X|0,C=ce.rotrSH(d,i,28)^ce.rotrBH(d,i,34)^ce.rotrBH(d,i,39),R=ce.rotrSL(d,i,28)^ce.rotrBL(d,i,34)^ce.rotrBL(d,i,39),M=d&a^d&r^a&r,x=i&n^i&o^n&o;P=g|0,f=y|0,g=m|0,y=S|0,m=p|0,S=u|0,{h:p,l:u}=ce.add(s|0,c|0,b|0,T|0),s=r|0,c=o|0,r=a|0,o=n|0,a=d|0,n=i|0;let N=ce.add3L(T,R,x);d=ce.add3H(N,b,C,M),i=N|0}({h:d,l:i}=ce.add(this.Ah|0,this.Al|0,d|0,i|0)),{h:a,l:n}=ce.add(this.Bh|0,this.Bl|0,a|0,n|0),{h:r,l:o}=ce.add(this.Ch|0,this.Cl|0,r|0,o|0),{h:s,l:c}=ce.add(this.Dh|0,this.Dl|0,s|0,c|0),{h:p,l:u}=ce.add(this.Eh|0,this.El|0,p|0,u|0),{h:m,l:S}=ce.add(this.Fh|0,this.Fl|0,m|0,S|0),{h:g,l:y}=ce.add(this.Gh|0,this.Gl|0,g|0,y|0),{h:P,l:f}=ce.add(this.Hh|0,this.Hl|0,P|0,f|0),this.set(d,i,a,n,r,o,s,c,p,u,m,S,g,y,P,f)}roundClean(){Xd.fill(0),Td.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},n1=class extends Yl{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},_o=Jt(()=>new Yl),Jo=Jt(()=>new n1),r1=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),_l=$t(r1),o1=_l.create(BigInt("-3")),s1=BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),c1=Fi({a:o1,b:s1,Fp:_l,n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),h:BigInt(1),lowS:!1},Jo),p1=BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),lo=$t(p1),Ai={a:lo.create(BigInt("-3")),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Fp:lo,n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),h:BigInt(1)},l1=Fi({a:Ai.a,b:Ai.b,Fp:lo,n:Ai.n,Gx:Ai.Gx,Gy:Ai.Gy,h:Ai.h,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},_o),Jl=[],$l=[],Zl=[],u1=BigInt(0),la=BigInt(1),m1=BigInt(2),y1=BigInt(7),S1=BigInt(256),P1=BigInt(113);for(let t=0,e=la,d=1,i=0;t<24;t++){[d,i]=[i,(2*d+3*i)%5],Jl.push(2*(5*i+d)),$l.push((t+1)*(t+2)/2%64);let a=u1;for(let n=0;n<7;n++)e=(e<<la^(e>>y1)*P1)%S1,e&m1&&(a^=la<<(la<<BigInt(n))-la);Zl.push(a)}var[g1,h1]=Vl(Zl,!0),cc=(t,e,d)=>d>32?Wl(t,e,d):zl(t,e,d),pc=(t,e,d)=>d>32?Kl(t,e,d):Hl(t,e,d);function f1(t,e=24){let d=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let r=0;r<10;r++)d[r]=t[r]^t[r+10]^t[r+20]^t[r+30]^t[r+40];for(let r=0;r<10;r+=2){let o=(r+8)%10,s=(r+2)%10,c=d[s],p=d[s+1],u=cc(c,p,1)^d[o],m=pc(c,p,1)^d[o+1];for(let S=0;S<50;S+=10)t[r+S]^=u,t[r+S+1]^=m}let a=t[2],n=t[3];for(let r=0;r<24;r++){let o=$l[r],s=cc(a,n,o),c=pc(a,n,o),p=Jl[r];a=t[p],n=t[p+1],t[p]=s,t[p+1]=c}for(let r=0;r<50;r+=10){for(let o=0;o<10;o++)d[o]=t[r+o];for(let o=0;o<10;o++)t[r+o]^=~d[(o+2)%10]&d[(o+4)%10]}t[0]^=g1[i],t[1]^=h1[i]}d.fill(0)}var eu=class tu extends Vo{constructor(e,d,i,a=!1,n=24){if(super(),this.blockLen=e,this.suffix=d,this.outputLen=i,this.enableXOF=a,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ln(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=n0(this.state)}keccak(){ec||tc(this.state32),f1(this.state32,this.rounds),ec||tc(this.state32),this.posOut=0,this.pos=0}update(e){Yi(this);let{blockLen:d,state:i}=this;e=Qa(e);let a=e.length;for(let n=0;n<a;){let r=Math.min(d-this.pos,a-n);for(let o=0;o<r;o++)i[this.pos++]^=e[n++];this.pos===d&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:d,pos:i,blockLen:a}=this;e[i]^=d,(d&128)!==0&&i===a-1&&this.keccak(),e[a-1]^=128,this.keccak()}writeInto(e){Yi(this,!1),Ga(e),this.finish();let d=this.state,{blockLen:i}=this;for(let a=0,n=e.length;a<n;){this.posOut>=i&&this.keccak();let r=Math.min(i-this.posOut,n-a);e.set(d.subarray(this.posOut,this.posOut+r),a),this.posOut+=r,a+=r}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ln(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Xl(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:d,suffix:i,outputLen:a,rounds:n,enableXOF:r}=this;return e||(e=new tu(d,i,a,r,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=a,e.enableXOF=r,e.destroyed=this.destroyed,e}},du=(t,e,d)=>Jt(()=>new eu(e,t,d)),I1=du(6,136,256/8),b1=du(6,72,512/8),F1=(t,e,d)=>o0((i={})=>new eu(e,t,i.dkLen===void 0?d:i.dkLen,!0)),iu=F1(31,136,256/8),Rt=BigInt(0),ot=BigInt(1),dn=BigInt(2),E1=BigInt(8),v1={zip215:!0};function C1(t){let e=Yo(t);return bi(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function X1(t){let e=C1(t),{Fp:d,n:i,prehash:a,hash:n,randomBytes:r,nByteLength:o,h:s}=e,c=dn<<BigInt(o*8)-ot,p=d.create,u=$t(e.n,e.nBitLength),m=e.uvRatio||((w,A)=>{try{return{isValid:!0,value:d.sqrt(w*d.inv(A))}}catch{return{isValid:!1,value:Rt}}}),S=e.adjustScalarBytes||(w=>w),g=e.domain||((w,A,U)=>{if(Pd("phflag",U),A.length||U)throw new Error("Contexts/pre-hash are not supported");return w});function y(w,A){pt("coordinate "+w,A,Rt,c)}function P(w){if(!(w instanceof v))throw new Error("ExtendedPoint expected")}let f=Ta((w,A)=>{let{ex:U,ey:L,ez:j}=w,B=w.is0();A==null&&(A=B?E1:d.inv(j));let H=p(U*A),Y=p(L*A),Q=p(j*A);if(B)return{x:Rt,y:ot};if(Q!==ot)throw new Error("invZ was invalid");return{x:H,y:Y}}),E=Ta(w=>{let{a:A,d:U}=e;if(w.is0())throw new Error("bad point: ZERO");let{ex:L,ey:j,ez:B,et:H}=w,Y=p(L*L),Q=p(j*j),W=p(B*B),G=p(W*W),K=p(Y*A),te=p(W*p(K+Q)),_=p(G+p(U*p(Y*Q)));if(te!==_)throw new Error("bad point: equation left != right (1)");let Z=p(L*j),de=p(B*H);if(Z!==de)throw new Error("bad point: equation left != right (2)");return!0});class v{constructor(A,U,L,j){this.ex=A,this.ey=U,this.ez=L,this.et=j,y("x",A),y("y",U),y("z",L),y("t",j),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(A){if(A instanceof v)throw new Error("extended point not allowed");let{x:U,y:L}=A||{};return y("x",U),y("y",L),new v(U,L,ot,p(U*L))}static normalizeZ(A){let U=d.invertBatch(A.map(L=>L.ez));return A.map((L,j)=>L.toAffine(U[j])).map(v.fromAffine)}static msm(A,U){return jl(v,u,A,U)}_setWindowSize(A){h.setWindowSize(this,A)}assertValidity(){E(this)}equals(A){P(A);let{ex:U,ey:L,ez:j}=this,{ex:B,ey:H,ez:Y}=A,Q=p(U*Y),W=p(B*j),G=p(L*Y),K=p(H*j);return Q===W&&G===K}is0(){return this.equals(v.ZERO)}negate(){return new v(p(-this.ex),this.ey,this.ez,p(-this.et))}double(){let{a:A}=e,{ex:U,ey:L,ez:j}=this,B=p(U*U),H=p(L*L),Y=p(dn*p(j*j)),Q=p(A*B),W=U+L,G=p(p(W*W)-B-H),K=Q+H,te=K-Y,_=Q-H,Z=p(G*te),de=p(K*_),oe=p(G*_),pe=p(te*K);return new v(Z,de,pe,oe)}add(A){P(A);let{a:U,d:L}=e,{ex:j,ey:B,ez:H,et:Y}=this,{ex:Q,ey:W,ez:G,et:K}=A;if(U===BigInt(-1)){let k=p((B-j)*(W+Q)),q=p((B+j)*(W-Q)),ee=p(q-k);if(ee===Rt)return this.double();let ne=p(H*dn*K),$=p(Y*dn*G),ye=$+ne,Ae=q+k,Tt=$-ne,id=p(ye*ee),Ci=p(Ae*Tt),Xi=p(ye*Tt),Ti=p(ee*Ae);return new v(id,Ci,Ti,Xi)}let te=p(j*Q),_=p(B*W),Z=p(Y*L*K),de=p(H*G),oe=p((j+B)*(Q+W)-te-_),pe=de-Z,fe=de+Z,me=p(_-U*te),Pe=p(oe*pe),dd=p(fe*me),vi=p(oe*me),Kd=p(pe*fe);return new v(Pe,dd,Kd,vi)}subtract(A){return this.add(A.negate())}wNAF(A){return h.wNAFCached(this,A,v.normalizeZ)}multiply(A){let U=A;pt("scalar",U,ot,i);let{p:L,f:j}=this.wNAF(U);return v.normalizeZ([L,j])[0]}multiplyUnsafe(A){let U=A;return pt("scalar",U,Rt,i),U===Rt?D:this.equals(D)||U===ot?this:this.equals(F)?this.wNAF(U).p:h.unsafeLadder(this,U)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}isTorsionFree(){return h.unsafeLadder(this,i).is0()}toAffine(A){return f(this,A)}clearCofactor(){let{h:A}=e;return A===ot?this:this.multiplyUnsafe(A)}static fromHex(A,U=!1){let{d:L,a:j}=e,B=d.BYTES;A=Le("pointHex",A,B),Pd("zip215",U);let H=A.slice(),Y=A[B-1];H[B-1]=Y&-129;let Q=Ud(H),W=U?c:d.ORDER;pt("pointHex.y",Q,Rt,W);let G=p(Q*Q),K=p(G-ot),te=p(L*G-j),{isValid:_,value:Z}=m(K,te);if(!_)throw new Error("Point.fromHex: invalid y coordinate");let de=(Z&ot)===ot,oe=(Y&128)!==0;if(!U&&Z===Rt&&oe)throw new Error("Point.fromHex: x=0 and x_0=1");return oe!==de&&(Z=p(-Z)),v.fromAffine({x:Z,y:Q})}static fromPrivateKey(A){return T(A).point}toRawBytes(){let{x:A,y:U}=this.toAffine(),L=$i(U,d.BYTES);return L[L.length-1]|=A&ot?128:0,L}toHex(){return Pi(this.toRawBytes())}}v.BASE=new v(e.Gx,e.Gy,ot,p(e.Gx*e.Gy)),v.ZERO=new v(Rt,ot,ot,Rt);let{BASE:F,ZERO:D}=v,h=Bl(v,o*8);function X(w){return Re(w,i)}function b(w){return X(Ud(w))}function T(w){let A=o;w=Le("private key",w,A);let U=Le("hashed private key",n(w),2*A),L=S(U.slice(0,A)),j=U.slice(A,2*A),B=b(L),H=F.multiply(B),Y=H.toRawBytes();return{head:L,prefix:j,scalar:B,point:H,pointBytes:Y}}function C(w){return T(w).pointBytes}function R(w=new Uint8Array,...A){let U=gi(...A);return b(n(g(U,Le("context",w),!!a)))}function M(w,A,U={}){w=Le("message",w),a&&(w=a(w));let{prefix:L,scalar:j,pointBytes:B}=T(A),H=R(U.context,L,w),Y=F.multiply(H).toRawBytes(),Q=R(U.context,Y,B,w),W=X(H+Q*j);pt("signature.s",W,Rt,i);let G=gi(Y,$i(W,d.BYTES));return Le("result",G,o*2)}let x=v1;function N(w,A,U,L=x){let{context:j,zip215:B}=L,H=d.BYTES;w=Le("signature",w,2*H),A=Le("message",A),B!==void 0&&Pd("zip215",B),a&&(A=a(A));let Y=Ud(w.slice(H,2*H)),Q,W,G;try{Q=v.fromHex(U,B),W=v.fromHex(w.slice(0,H),B),G=F.multiplyUnsafe(Y)}catch{return!1}if(!B&&Q.isSmallOrder())return!1;let K=R(j,W.toRawBytes(),Q.toRawBytes(),A);return W.add(Q.multiplyUnsafe(K)).subtract(G).clearCofactor().equals(v.ZERO)}return F._setWindowSize(8),{CURVE:e,getPublicKey:C,sign:M,verify:N,ExtendedPoint:v,utils:{getExtendedPublicKey:T,randomPrivateKey:()=>r(d.BYTES),precompute(w=8,A=v.BASE){return A._setWindowSize(w),A.multiply(BigInt(3)),A}}}}var wi=BigInt(0),Xr=BigInt(1);function T1(t){return bi(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function D1(t){let e=T1(t),{P:d}=e,i=E=>Re(E,d),a=e.montgomeryBits,n=Math.ceil(a/8),r=e.nByteLength,o=e.adjustScalarBytes||(E=>E),s=e.powPminus2||(E=>Ol(E,d-BigInt(2),d));function c(E,v,F){let D=i(E*(v-F));return v=i(v-D),F=i(F+D),[v,F]}let p=(e.a-BigInt(2))/BigInt(4);function u(E,v){pt("u",E,wi,d),pt("scalar",v,wi,d);let F=v,D=E,h=Xr,X=wi,b=E,T=Xr,C=wi,R;for(let x=BigInt(a-1);x>=wi;x--){let N=F>>x&Xr;C^=N,R=c(C,h,b),h=R[0],b=R[1],R=c(C,X,T),X=R[0],T=R[1],C=N;let w=h+X,A=i(w*w),U=h-X,L=i(U*U),j=A-L,B=b+T,H=b-T,Y=i(H*w),Q=i(B*U),W=Y+Q,G=Y-Q;b=i(W*W),T=i(D*i(G*G)),h=i(A*L),X=i(j*(A+i(p*j)))}R=c(C,h,b),h=R[0],b=R[1],R=c(C,X,T),X=R[0],T=R[1];let M=s(X);return i(h*M)}function m(E){return $i(i(E),n)}function S(E){let v=Le("u coordinate",E,n);return r===32&&(v[31]&=127),Ud(v)}function g(E){let v=Le("scalar",E),F=v.length;if(F!==n&&F!==r)throw new Error(`Expected ${n} or ${r} bytes, got ${F}`);return Ud(o(v))}function y(E,v){let F=S(v),D=g(E),h=u(F,D);if(h===wi)throw new Error("Invalid private or public key received");return m(h)}let P=m(e.Gu);function f(E){return y(E,P)}return{scalarMult:y,scalarMultBase:f,getSharedSecret:(E,v)=>y(E,v),getPublicKey:E=>f(E),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:P}}var R1=Jt(()=>iu.create({dkLen:114})),$g=Jt(()=>iu.create({dkLen:64})),Da=BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018365439"),N1=BigInt(1),lc=BigInt(2),uc=BigInt(3);BigInt(4);var A1=BigInt(11),w1=BigInt(22),mc=BigInt(44),M1=BigInt(88),x1=BigInt(223);function au(t){let e=Da,d=t*t*t%e,i=d*d*t%e,a=Xe(i,uc,e)*i%e,n=Xe(a,uc,e)*i%e,r=Xe(n,lc,e)*d%e,o=Xe(r,A1,e)*r%e,s=Xe(o,w1,e)*o%e,c=Xe(s,mc,e)*s%e,p=Xe(c,M1,e)*c%e,u=Xe(p,mc,e)*s%e,m=Xe(u,lc,e)*d%e,S=Xe(m,N1,e)*t%e;return Xe(S,x1,e)*m%e}function nu(t){return t[0]&=252,t[55]|=128,t[56]=0,t}function L1(t,e){let d=Da,i=Re(t*t*e,d),a=Re(i*t,d),n=Re(a*i*e,d),r=au(n),o=Re(a*r,d),s=Re(o*o,d);return{isValid:Re(s*e,d)===t,value:o}}var ru=$t(Da,456,!0),ou={a:BigInt(1),d:BigInt("726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018326358"),Fp:ru,n:BigInt("181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779"),nBitLength:456,h:BigInt(4),Gx:BigInt("224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710"),Gy:BigInt("298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660"),hash:R1,randomBytes:zo,adjustScalarBytes:nu,domain:(t,e,d)=>{if(e.length>255)throw new Error(`Context is too big: ${e.length}`);return Dl(Tl("SigEd448"),new Uint8Array([d?1:0,e.length]),e,t)},uvRatio:L1},O1=X1(ou);({...ou});var U1=D1({a:BigInt(156326),montgomeryBits:448,nByteLength:56,P:Da,Gu:BigInt(5),powPminus2:t=>{let e=Da,d=au(t),i=Xe(d,BigInt(2),e);return Re(i*t,e)},adjustScalarBytes:nu,randomBytes:zo});(ru.ORDER-BigInt(3))/BigInt(4);BigInt(156326);BigInt("39082");BigInt("78163");BigInt("98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214");BigInt("315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716");BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var su=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),yc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),k1=BigInt(1),uo=BigInt(2),Sc=(t,e)=>(t+e/uo)/e;function q1(t){let e=su,d=BigInt(3),i=BigInt(6),a=BigInt(11),n=BigInt(22),r=BigInt(23),o=BigInt(44),s=BigInt(88),c=t*t*t%e,p=c*c*t%e,u=Xe(p,d,e)*p%e,m=Xe(u,d,e)*p%e,S=Xe(m,uo,e)*c%e,g=Xe(S,a,e)*S%e,y=Xe(g,n,e)*g%e,P=Xe(y,o,e)*y%e,f=Xe(P,s,e)*P%e,E=Xe(f,o,e)*y%e,v=Xe(E,d,e)*p%e,F=Xe(v,r,e)*g%e,D=Xe(F,i,e)*c%e,h=Xe(D,uo,e);if(!mo.eql(mo.sqr(h),t))throw new Error("Cannot find square root");return h}var mo=$t(su,void 0,void 0,{sqrt:q1}),cu=Fi({a:BigInt(0),b:BigInt(7),Fp:mo,n:yc,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=yc,d=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-k1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),n=d,r=BigInt("0x100000000000000000000000000000000"),o=Sc(n*t,e),s=Sc(-i*t,e),c=Re(t-o*d-s*a,e),p=Re(-o*i-s*n,e),u=c>r,m=p>r;if(u&&(c=e-c),m&&(p=e-p),c>r||p>r)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:u,k1:c,k2neg:m,k2:p}}}},Zn);BigInt(0);cu.ProjectivePoint;var pu=$t(BigInt("0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377")),B1=pu.create(BigInt("0x7d5a0975fc2c3057eef67530417affe7fb8055c126dc5c6ce94a4b44f330b5d9")),j1=BigInt("0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6"),G1=Fi({a:B1,b:j1,Fp:pu,n:BigInt("0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7"),Gx:BigInt("0x8bd2aeb9cb7e57cb2c4b482ffc81b7afb9de27e1e3bd23c23a4453bd9ace3262"),Gy:BigInt("0x547ef835c3dac4fd97f8461a14611dc9c27745132ded8e545c1d54c72f046997"),h:BigInt(1),lowS:!1},Zn),lu=$t(BigInt("0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53")),Q1=lu.create(BigInt("0x7bc382c63d8c150c3c72080ace05afa0c2bea28e4fb22787139165efba91f90f8aa5814a503ad4eb04a8c7dd22ce2826")),V1=BigInt("0x04a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11"),z1=Fi({a:Q1,b:V1,Fp:lu,n:BigInt("0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565"),Gx:BigInt("0x1d1c64f068cf45ffa2a63a81b7c13f6b8847a3e77ef14fe3db7fcafe0cbd10e8e826e03436d646aaef87b2e247d4af1e"),Gy:BigInt("0x8abe1d7520f9c2a45cb1eb8e95cfd55262b70b29feec5864e19c054ff99129280e4646217791811142820341263c5315"),h:BigInt(1),lowS:!1},Jo),uu=$t(BigInt("0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3")),H1=uu.create(BigInt("0x7830a3318b603b89e2327145ac234cc594cbdd8d3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94ca")),W1=BigInt("0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723"),K1=Fi({a:H1,b:W1,Fp:uu,n:BigInt("0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069"),Gx:BigInt("0x81aee4bdd82ed9645a21322e9c4c6a9385ed9f70b5d916c1b43b62eef4d0098eff3b1f78e2d0d48d50d1687b93b97d5f7c6d5047406a5e688b352209bcb9f822"),Gy:BigInt("0x7dde385d566332ecc0eabfa9cf7822fdf209f70024a57b1aa000c55b881f8111b2dcde494a5f485e5bca4bd88a2763aed1ca2b2fa8f0540678cd1e0f3ad80892"),h:BigInt(1),lowS:!1},_o),Y1=new Map(Object.entries({nistP256:B0,nistP384:c1,nistP521:l1,brainpoolP256r1:G1,brainpoolP384r1:z1,brainpoolP512r1:K1,secp256k1:cu,x448:U1,ed448:O1})),_1=Object.freeze({__proto__:null,nobleCurves:Y1}),ua=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Dd=new Uint32Array(80),J1=class extends Va{constructor(){super(64,20,8,!1),this.A=ua[0]|0,this.B=ua[1]|0,this.C=ua[2]|0,this.D=ua[3]|0,this.E=ua[4]|0}get(){let{A:t,B:e,C:d,D:i,E:a}=this;return[t,e,d,i,a]}set(t,e,d,i,a){this.A=t|0,this.B=e|0,this.C=d|0,this.D=i|0,this.E=a|0}process(t,e){for(let o=0;o<16;o++,e+=4)Dd[o]=t.getUint32(e,!1);for(let o=16;o<80;o++)Dd[o]=Od(Dd[o-3]^Dd[o-8]^Dd[o-14]^Dd[o-16],1);let{A:d,B:i,C:a,D:n,E:r}=this;for(let o=0;o<80;o++){let s,c;o<20?(s=Rl(i,a,n),c=1518500249):o<40?(s=i^a^n,c=1859775393):o<60?(s=Nl(i,a,n),c=2400959708):(s=i^a^n,c=3395469782);let p=Od(d,5)+s+r+c+Dd[o]|0;r=n,n=a,a=Od(i,30),i=d,d=p}d=d+this.A|0,i=i+this.B|0,a=a+this.C|0,n=n+this.D|0,r=r+this.E|0,this.set(d,i,a,n,r)}roundClean(){Dd.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}},$1=Jt(()=>new J1),Z1=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),mu=new Uint8Array(new Array(16).fill(0).map((t,e)=>e)),eP=mu.map(t=>(9*t+5)%16),$o=[mu],Zo=[eP];for(let t=0;t<4;t++)for(let e of[$o,Zo])e.push(e[t].map(d=>Z1[d]));var yu=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),tP=$o.map((t,e)=>t.map(d=>yu[e][d])),dP=Zo.map((t,e)=>t.map(d=>yu[e][d])),iP=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),aP=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function Pc(t,e,d,i){return t===0?e^d^i:t===1?e&d|~e&i:t===2?(e|~d)^i:t===3?e&i|d&~i:e^(d|~i)}var an=new Uint32Array(16),nP=class extends Va{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:e,h2:d,h3:i,h4:a}=this;return[t,e,d,i,a]}set(t,e,d,i,a){this.h0=t|0,this.h1=e|0,this.h2=d|0,this.h3=i|0,this.h4=a|0}process(t,e){for(let m=0;m<16;m++,e+=4)an[m]=t.getUint32(e,!0);let d=this.h0|0,i=d,a=this.h1|0,n=a,r=this.h2|0,o=r,s=this.h3|0,c=s,p=this.h4|0,u=p;for(let m=0;m<5;m++){let S=4-m,g=iP[m],y=aP[m],P=$o[m],f=Zo[m],E=tP[m],v=dP[m];for(let F=0;F<16;F++){let D=Od(d+Pc(m,a,r,s)+an[P[F]]+g,E[F])+p|0;d=p,p=s,s=Od(r,10)|0,r=a,a=D}for(let F=0;F<16;F++){let D=Od(i+Pc(S,n,o,c)+an[f[F]]+y,v[F])+u|0;i=u,u=c,c=Od(o,10)|0,o=n,n=D}}this.set(this.h1+r+c|0,this.h2+s+u|0,this.h3+p+i|0,this.h4+d+n|0,this.h0+a+o|0)}roundClean(){an.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},rP=Jt(()=>new nP),oP=Array.from({length:64},(t,e)=>Math.floor(2**32*Math.abs(Math.sin(e+1)))),gc=(t,e,d)=>t&e^~t&d,nn=new Uint32Array([1732584193,4023233417,2562383102,271733878]),Tr=new Uint32Array(16),sP=class extends Va{constructor(){super(64,16,8,!0),this.A=nn[0]|0,this.B=nn[1]|0,this.C=nn[2]|0,this.D=nn[3]|0}get(){let{A:t,B:e,C:d,D:i}=this;return[t,e,d,i]}set(t,e,d,i){this.A=t|0,this.B=e|0,this.C=d|0,this.D=i|0}process(t,e){for(let r=0;r<16;r++,e+=4)Tr[r]=t.getUint32(e,!0);let{A:d,B:i,C:a,D:n}=this;for(let r=0;r<64;r++){let o,s,c;r<16?(o=gc(i,a,n),s=r,c=[7,12,17,22]):r<32?(o=gc(n,i,a),s=(5*r+1)%16,c=[5,9,14,20]):r<48?(o=i^a^n,s=(3*r+5)%16,c=[4,11,16,23]):(o=a^(i|~n),s=7*r%16,c=[6,10,15,21]),o=o+d+oP[r]+Tr[s],d=n,n=a,a=i,i=i+Od(o,c[r%4])}d=d+this.A|0,i=i+this.B|0,a=a+this.C|0,n=n+this.D|0,this.set(d,i,a,n)}roundClean(){Tr.fill(0)}destroy(){this.set(0,0,0,0),this.buffer.fill(0)}},cP=Jt(()=>new sP),pP=new Map(Object.entries({md5:cP,sha1:$1,sha224:l0,sha256:Zn,sha384:Jo,sha512:_o,sha3_256:I1,sha3_512:b1,ripemd160:rP})),lP=Object.freeze({__proto__:null,nobleHashes:pP});function Dr(t,e,d,i,a,n){let r=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],p=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],u=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],m=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],S=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696],g=0,y,P,f,E,v,F,D,h,X,b,T=e.length,C=t.length===32?3:9;C===3?h=d?[0,32,2]:[30,-2,-2]:h=d?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],d&&(e=uP(e),T=e.length);let R=new Uint8Array(T),M=0;for(;g<T;){for(F=e[g++]<<24|e[g++]<<16|e[g++]<<8|e[g++],D=e[g++]<<24|e[g++]<<16|e[g++]<<8|e[g++],f=(F>>>4^D)&252645135,D^=f,F^=f<<4,f=(F>>>16^D)&65535,D^=f,F^=f<<16,f=(D>>>2^F)&858993459,F^=f,D^=f<<2,f=(D>>>8^F)&16711935,F^=f,D^=f<<8,f=(F>>>1^D)&1431655765,D^=f,F^=f<<1,F=F<<1|F>>>31,D=D<<1|D>>>31,P=0;P<C;P+=3){for(X=h[P+1],b=h[P+2],y=h[P];y!==X;y+=b)E=D^t[y],v=(D>>>4|D<<28)^t[y+1],f=F,F=D,D=f^(o[E>>>24&63]|c[E>>>16&63]|u[E>>>8&63]|S[E&63]|r[v>>>24&63]|s[v>>>16&63]|p[v>>>8&63]|m[v&63]);f=F,F=D,D=f}F=F>>>1|F<<31,D=D>>>1|D<<31,f=(F>>>1^D)&1431655765,D^=f,F^=f<<1,f=(D>>>8^F)&16711935,F^=f,D^=f<<8,f=(D>>>2^F)&858993459,F^=f,D^=f<<2,f=(F>>>16^D)&65535,D^=f,F^=f<<16,f=(F>>>4^D)&252645135,D^=f,F^=f<<4,R[M++]=F>>>24,R[M++]=F>>>16&255,R[M++]=F>>>8&255,R[M++]=F&255,R[M++]=D>>>24,R[M++]=D>>>16&255,R[M++]=D>>>8&255,R[M++]=D&255}return d||(R=mP(R)),R}function Rr(t){let e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],d=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],n=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],r=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],s=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],p=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],u=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],S=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length>8?3:1,P=new Array(32*y),f=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],E,v,F=0,D=0,h;for(let X=0;X<y;X++){let b=t[F++]<<24|t[F++]<<16|t[F++]<<8|t[F++],T=t[F++]<<24|t[F++]<<16|t[F++]<<8|t[F++];h=(b>>>4^T)&252645135,T^=h,b^=h<<4,h=(T>>>-16^b)&65535,b^=h,T^=h<<-16,h=(b>>>2^T)&858993459,T^=h,b^=h<<2,h=(T>>>-16^b)&65535,b^=h,T^=h<<-16,h=(b>>>1^T)&1431655765,T^=h,b^=h<<1,h=(T>>>8^b)&16711935,b^=h,T^=h<<8,h=(b>>>1^T)&1431655765,T^=h,b^=h<<1,h=b<<8|T>>>20&240,b=T<<24|T<<8&16711680|T>>>8&65280|T>>>24&240,T=h;for(let C=0;C<f.length;C++)f[C]?(b=b<<2|b>>>26,T=T<<2|T>>>26):(b=b<<1|b>>>27,T=T<<1|T>>>27),b&=-15,T&=-15,E=e[b>>>28]|d[b>>>24&15]|i[b>>>20&15]|a[b>>>16&15]|n[b>>>12&15]|r[b>>>8&15]|o[b>>>4&15],v=s[T>>>28]|c[T>>>24&15]|p[T>>>20&15]|u[T>>>16&15]|m[T>>>12&15]|S[T>>>8&15]|g[T>>>4&15],h=(v>>>16^E)&65535,P[D++]=E^h,P[D++]=v^h<<16}return P}function uP(t,e){let d=8-t.length%8,i;if(d<8)i=0;else{if(d===8)return t;throw new Error("des: invalid padding")}let a=new Uint8Array(t.length+d);for(let n=0;n<t.length;n++)a[n]=t[n];for(let n=0;n<d;n++)a[t.length+n]=i;return a}function mP(t,e){let d=null,i;if(i=0,!d){for(d=1;t[t.length-d]===i;)d++;d--}return t.subarray(0,t.length-d)}function Ra(t){this.key=[];for(let e=0;e<3;e++)this.key.push(new Uint8Array(t.subarray(e*8,e*8+8)));this.encrypt=function(e){return Dr(Rr(this.key[2]),Dr(Rr(this.key[1]),Dr(Rr(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0)}}Ra.keySize=Ra.prototype.keySize=24;Ra.blockSize=Ra.prototype.blockSize=8;function yP(){this.BlockSize=8,this.KeySize=16,this.setKey=function(r){if(this.masking=new Array(16),this.rotate=new Array(16),this.reset(),r.length===this.KeySize)this.keySchedule(r);else throw new Error("CAST-128: keys must be 16 bytes");return!0},this.reset=function(){for(let r=0;r<16;r++)this.masking[r]=0,this.rotate[r]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(r){let o=new Array(r.length);for(let s=0;s<r.length;s+=8){let c=r[s]<<24|r[s+1]<<16|r[s+2]<<8|r[s+3],p=r[s+4]<<24|r[s+5]<<16|r[s+6]<<8|r[s+7],u;u=p,p=c^d(p,this.masking[0],this.rotate[0]),c=u,u=p,p=c^i(p,this.masking[1],this.rotate[1]),c=u,u=p,p=c^a(p,this.masking[2],this.rotate[2]),c=u,u=p,p=c^d(p,this.masking[3],this.rotate[3]),c=u,u=p,p=c^i(p,this.masking[4],this.rotate[4]),c=u,u=p,p=c^a(p,this.masking[5],this.rotate[5]),c=u,u=p,p=c^d(p,this.masking[6],this.rotate[6]),c=u,u=p,p=c^i(p,this.masking[7],this.rotate[7]),c=u,u=p,p=c^a(p,this.masking[8],this.rotate[8]),c=u,u=p,p=c^d(p,this.masking[9],this.rotate[9]),c=u,u=p,p=c^i(p,this.masking[10],this.rotate[10]),c=u,u=p,p=c^a(p,this.masking[11],this.rotate[11]),c=u,u=p,p=c^d(p,this.masking[12],this.rotate[12]),c=u,u=p,p=c^i(p,this.masking[13],this.rotate[13]),c=u,u=p,p=c^a(p,this.masking[14],this.rotate[14]),c=u,u=p,p=c^d(p,this.masking[15],this.rotate[15]),c=u,o[s]=p>>>24&255,o[s+1]=p>>>16&255,o[s+2]=p>>>8&255,o[s+3]=p&255,o[s+4]=c>>>24&255,o[s+5]=c>>>16&255,o[s+6]=c>>>8&255,o[s+7]=c&255}return o},this.decrypt=function(r){let o=new Array(r.length);for(let s=0;s<r.length;s+=8){let c=r[s]<<24|r[s+1]<<16|r[s+2]<<8|r[s+3],p=r[s+4]<<24|r[s+5]<<16|r[s+6]<<8|r[s+7],u;u=p,p=c^d(p,this.masking[15],this.rotate[15]),c=u,u=p,p=c^a(p,this.masking[14],this.rotate[14]),c=u,u=p,p=c^i(p,this.masking[13],this.rotate[13]),c=u,u=p,p=c^d(p,this.masking[12],this.rotate[12]),c=u,u=p,p=c^a(p,this.masking[11],this.rotate[11]),c=u,u=p,p=c^i(p,this.masking[10],this.rotate[10]),c=u,u=p,p=c^d(p,this.masking[9],this.rotate[9]),c=u,u=p,p=c^a(p,this.masking[8],this.rotate[8]),c=u,u=p,p=c^i(p,this.masking[7],this.rotate[7]),c=u,u=p,p=c^d(p,this.masking[6],this.rotate[6]),c=u,u=p,p=c^a(p,this.masking[5],this.rotate[5]),c=u,u=p,p=c^i(p,this.masking[4],this.rotate[4]),c=u,u=p,p=c^d(p,this.masking[3],this.rotate[3]),c=u,u=p,p=c^a(p,this.masking[2],this.rotate[2]),c=u,u=p,p=c^i(p,this.masking[1],this.rotate[1]),c=u,u=p,p=c^d(p,this.masking[0],this.rotate[0]),c=u,o[s]=p>>>24&255,o[s+1]=p>>>16&255,o[s+2]=p>>>8&255,o[s+3]=p&255,o[s+4]=c>>>24&255,o[s+5]=c>>16&255,o[s+6]=c>>8&255,o[s+7]=c&255}return o};let t=new Array(4);t[0]=new Array(4),t[0][0]=[4,0,13,15,12,14,8],t[0][1]=[5,2,16,18,17,19,10],t[0][2]=[6,3,23,22,21,20,9],t[0][3]=[7,1,26,25,27,24,11],t[1]=new Array(4),t[1][0]=[0,6,21,23,20,22,16],t[1][1]=[1,4,0,2,1,3,18],t[1][2]=[2,5,7,6,5,4,17],t[1][3]=[3,7,10,9,11,8,19],t[2]=new Array(4),t[2][0]=[4,0,13,15,12,14,8],t[2][1]=[5,2,16,18,17,19,10],t[2][2]=[6,3,23,22,21,20,9],t[2][3]=[7,1,26,25,27,24,11],t[3]=new Array(4),t[3][0]=[0,6,21,23,20,22,16],t[3][1]=[1,4,0,2,1,3,18],t[3][2]=[2,5,7,6,5,4,17],t[3][3]=[3,7,10,9,11,8,19];let e=new Array(4);e[0]=new Array(4),e[0][0]=[24,25,23,22,18],e[0][1]=[26,27,21,20,22],e[0][2]=[28,29,19,18,25],e[0][3]=[30,31,17,16,28],e[1]=new Array(4),e[1][0]=[3,2,12,13,8],e[1][1]=[1,0,14,15,13],e[1][2]=[7,6,8,9,3],e[1][3]=[5,4,10,11,7],e[2]=new Array(4),e[2][0]=[19,18,28,29,25],e[2][1]=[17,16,30,31,28],e[2][2]=[23,22,24,25,18],e[2][3]=[21,20,26,27,22],e[3]=new Array(4),e[3][0]=[8,9,7,6,3],e[3][1]=[10,11,5,4,7],e[3][2]=[12,13,3,2,8],e[3][3]=[14,15,1,0,13],this.keySchedule=function(r){let o=new Array(8),s=new Array(32),c;for(let S=0;S<4;S++)c=S*4,o[S]=r[c]<<24|r[c+1]<<16|r[c+2]<<8|r[c+3];let p=[6,7,4,5],u=0,m;for(let S=0;S<2;S++)for(let g=0;g<4;g++){for(c=0;c<4;c++){let y=t[g][c];m=o[y[1]],m^=n[4][o[y[2]>>>2]>>>24-8*(y[2]&3)&255],m^=n[5][o[y[3]>>>2]>>>24-8*(y[3]&3)&255],m^=n[6][o[y[4]>>>2]>>>24-8*(y[4]&3)&255],m^=n[7][o[y[5]>>>2]>>>24-8*(y[5]&3)&255],m^=n[p[c]][o[y[6]>>>2]>>>24-8*(y[6]&3)&255],o[y[0]]=m}for(c=0;c<4;c++){let y=e[g][c];m=n[4][o[y[0]>>>2]>>>24-8*(y[0]&3)&255],m^=n[5][o[y[1]>>>2]>>>24-8*(y[1]&3)&255],m^=n[6][o[y[2]>>>2]>>>24-8*(y[2]&3)&255],m^=n[7][o[y[3]>>>2]>>>24-8*(y[3]&3)&255],m^=n[4+c][o[y[4]>>>2]>>>24-8*(y[4]&3)&255],s[u]=m,u++}}for(let S=0;S<16;S++)this.masking[S]=s[S],this.rotate[S]=s[16+S]&31};function d(r,o,s){let c=o+r,p=c<<s|c>>>32-s;return(n[0][p>>>24]^n[1][p>>>16&255])-n[2][p>>>8&255]+n[3][p&255]}function i(r,o,s){let c=o^r,p=c<<s|c>>>32-s;return n[0][p>>>24]-n[1][p>>>16&255]+n[2][p>>>8&255]^n[3][p&255]}function a(r,o,s){let c=o-r,p=c<<s|c>>>32-s;return(n[0][p>>>24]+n[1][p>>>16&255]^n[2][p>>>8&255])-n[3][p&255]}let n=new Array(8);n[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],n[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],n[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],n[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],n[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],n[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],n[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],n[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Na(t){this.cast5=new yP,this.cast5.setKey(t),this.encrypt=function(e){return this.cast5.encrypt(e)}}Na.blockSize=Na.prototype.blockSize=8;Na.keySize=Na.prototype.keySize=16;var Ft=4294967295;function Ut(t,e){return(t<<e|t>>>32-e)&Ft}function sd(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function Rd(t,e,d){t.splice(e,4,d&255,d>>>8&255,d>>>16&255,d>>>24&255)}function re(t,e){return t>>>e*8&255}function SP(){let t=null,e=null,d=-1,i=[],a=[[],[],[],[]];function n(g){t=g;let y,P,f,E,v,F=[],D=[],h=[],X,b=[],T,C,R,M=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],x=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],N=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],w=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],A=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],U=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],L=[[],[]],j=[[],[],[],[]];function B(G){return G^G>>2^[0,90,180,238][G&3]}function H(G){return G^G>>1^G>>2^[0,238,180,90][G&3]}function Y(G,K){let te,_,Z;for(te=0;te<8;te++)_=K>>>24,K=K<<8&Ft|G>>>24,G=G<<8&Ft,Z=_<<1,_&128&&(Z^=333),K^=_^Z<<16,Z^=_>>>1,_&1&&(Z^=166),K^=Z<<24|Z<<8;return K}function Q(G,K){let te=K>>4,_=K&15,Z=M[G][te^_],de=x[G][A[_]^U[te]];return w[G][A[de]^U[Z]]<<4|N[G][Z^de]}function W(G,K){let te=re(G,0),_=re(G,1),Z=re(G,2),de=re(G,3);switch(X){case 4:te=L[1][te]^re(K[3],0),_=L[0][_]^re(K[3],1),Z=L[0][Z]^re(K[3],2),de=L[1][de]^re(K[3],3);case 3:te=L[1][te]^re(K[2],0),_=L[1][_]^re(K[2],1),Z=L[0][Z]^re(K[2],2),de=L[0][de]^re(K[2],3);case 2:te=L[0][L[0][te]^re(K[1],0)]^re(K[0],0),_=L[0][L[1][_]^re(K[1],1)]^re(K[0],1),Z=L[1][L[0][Z]^re(K[1],2)]^re(K[0],2),de=L[1][L[1][de]^re(K[1],3)]^re(K[0],3)}return j[0][te]^j[1][_]^j[2][Z]^j[3][de]}for(t=t.slice(0,32),y=t.length;y!==16&&y!==24&&y!==32;)t[y++]=0;for(y=0;y<t.length;y+=4)h[y>>2]=sd(t,y);for(y=0;y<256;y++)L[0][y]=Q(0,y),L[1][y]=Q(1,y);for(y=0;y<256;y++)T=L[1][y],C=B(T),R=H(T),j[0][y]=T+(C<<8)+(R<<16)+(R<<24),j[2][y]=C+(R<<8)+(T<<16)+(R<<24),T=L[0][y],C=B(T),R=H(T),j[1][y]=R+(R<<8)+(C<<16)+(T<<24),j[3][y]=C+(T<<8)+(R<<16)+(C<<24);for(X=h.length/2,y=0;y<X;y++)P=h[y+y],F[y]=P,f=h[y+y+1],D[y]=f,b[X-y-1]=Y(P,f);for(y=0;y<40;y+=2)P=16843009*y,f=P+16843009,P=W(P,F),f=Ut(W(f,D),8),i[y]=P+f&Ft,i[y+1]=Ut(P+2*f,9);for(y=0;y<256;y++)switch(P=f=E=v=y,X){case 4:P=L[1][P]^re(b[3],0),f=L[0][f]^re(b[3],1),E=L[0][E]^re(b[3],2),v=L[1][v]^re(b[3],3);case 3:P=L[1][P]^re(b[2],0),f=L[1][f]^re(b[2],1),E=L[0][E]^re(b[2],2),v=L[0][v]^re(b[2],3);case 2:a[0][y]=j[0][L[0][L[0][P]^re(b[1],0)]^re(b[0],0)],a[1][y]=j[1][L[0][L[1][f]^re(b[1],1)]^re(b[0],1)],a[2][y]=j[2][L[1][L[0][E]^re(b[1],2)]^re(b[0],2)],a[3][y]=j[3][L[1][L[1][v]^re(b[1],3)]^re(b[0],3)]}}function r(g){return a[0][re(g,0)]^a[1][re(g,1)]^a[2][re(g,2)]^a[3][re(g,3)]}function o(g){return a[0][re(g,3)]^a[1][re(g,0)]^a[2][re(g,1)]^a[3][re(g,2)]}function s(g,y){let P=r(y[0]),f=o(y[1]);y[2]=Ut(y[2]^P+f+i[4*g+8]&Ft,31),y[3]=Ut(y[3],1)^P+2*f+i[4*g+9]&Ft,P=r(y[2]),f=o(y[3]),y[0]=Ut(y[0]^P+f+i[4*g+10]&Ft,31),y[1]=Ut(y[1],1)^P+2*f+i[4*g+11]&Ft}function c(g,y){let P=r(y[0]),f=o(y[1]);y[2]=Ut(y[2],1)^P+f+i[4*g+10]&Ft,y[3]=Ut(y[3]^P+2*f+i[4*g+11]&Ft,31),P=r(y[2]),f=o(y[3]),y[0]=Ut(y[0],1)^P+f+i[4*g+8]&Ft,y[1]=Ut(y[1]^P+2*f+i[4*g+9]&Ft,31)}function p(){i=[],a=[[],[],[],[]]}function u(g,y){e=g,d=y;let P=[sd(e,d)^i[0],sd(e,d+4)^i[1],sd(e,d+8)^i[2],sd(e,d+12)^i[3]];for(let f=0;f<8;f++)s(f,P);return Rd(e,d,P[2]^i[4]),Rd(e,d+4,P[3]^i[5]),Rd(e,d+8,P[0]^i[6]),Rd(e,d+12,P[1]^i[7]),d+=16,e}function m(g,y){e=g,d=y;let P=[sd(e,d)^i[4],sd(e,d+4)^i[5],sd(e,d+8)^i[6],sd(e,d+12)^i[7]];for(let f=7;f>=0;f--)c(f,P);Rd(e,d,P[2]^i[0]),Rd(e,d+4,P[3]^i[1]),Rd(e,d+8,P[0]^i[2]),Rd(e,d+12,P[1]^i[3]),d+=16}function S(){return e}return{name:"twofish",blocksize:128/8,open:n,close:p,encrypt:u,decrypt:m,finalize:S}}function Aa(t){this.tf=SP(),this.tf.open(Array.from(t),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}Aa.keySize=Aa.prototype.keySize=32;Aa.blockSize=Aa.prototype.blockSize=16;function xt(){}xt.prototype.BLOCKSIZE=8;xt.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];xt.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731];xt.prototype.NN=16;xt.prototype._clean=function(t){return t<0&&(t=(t&2147483647)+2147483648),t};xt.prototype._F=function(t){let e,d=t&255;t>>>=8;let i=t&255;t>>>=8;let a=t&255;t>>>=8;let n=t&255;return e=this.sboxes[0][n]+this.sboxes[1][a],e^=this.sboxes[2][i],e+=this.sboxes[3][d],e};xt.prototype._encryptBlock=function(t){let e=t[0],d=t[1],i;for(i=0;i<this.NN;++i){e^=this.parray[i],d=this._F(e)^d;let a=e;e=d,d=a}e^=this.parray[this.NN+0],d^=this.parray[this.NN+1],t[0]=this._clean(d),t[1]=this._clean(e)};xt.prototype.encryptBlock=function(t){let e,d=[0,0],i=this.BLOCKSIZE/2;for(e=0;e<this.BLOCKSIZE/2;++e)d[0]=d[0]<<8|t[e+0]&255,d[1]=d[1]<<8|t[e+i]&255;this._encryptBlock(d);let a=[];for(e=0;e<this.BLOCKSIZE/2;++e)a[e+0]=d[0]>>>24-8*e&255,a[e+i]=d[1]>>>24-8*e&255;return a};xt.prototype._decryptBlock=function(t){let e=t[0],d=t[1],i;for(i=this.NN+1;i>1;--i){e^=this.parray[i],d=this._F(e)^d;let a=e;e=d,d=a}e^=this.parray[1],d^=this.parray[0],t[0]=this._clean(d),t[1]=this._clean(e)};xt.prototype.init=function(t){let e,d=0;for(this.parray=[],e=0;e<this.NN+2;++e){let a=0;for(let n=0;n<4;++n)a=a<<8|t[d]&255,++d>=t.length&&(d=0);this.parray[e]=this.PARRAY[e]^a}for(this.sboxes=[],e=0;e<4;++e)for(this.sboxes[e]=[],d=0;d<256;++d)this.sboxes[e][d]=this.SBOXES[e][d];let i=[0,0];for(e=0;e<this.NN+2;e+=2)this._encryptBlock(i),this.parray[e+0]=i[0],this.parray[e+1]=i[1];for(e=0;e<4;++e)for(d=0;d<256;d+=2)this._encryptBlock(i),this.sboxes[e][d+0]=i[0],this.sboxes[e][d+1]=i[1]};function wa(t){this.bf=new xt,this.bf.init(t),this.encrypt=function(e){return this.bf.encryptBlock(e)}}wa.keySize=wa.prototype.keySize=16;wa.blockSize=wa.prototype.blockSize=8;var PP=new Map(Object.entries({tripledes:Ra,cast5:Na,twofish:Aa,blowfish:wa})),gP=Object.freeze({__proto__:null,legacyCiphers:PP});function Mi(t,e,d,i){t[e]+=d[i],t[e+1]+=d[i+1]+(t[e]<d[i])}function hc(t,e){t[0]+=e,t[1]+=t[0]<e}function Nd(t,e,d,i,a,n,r,o){Mi(t,d,t,i),Mi(t,d,e,r);let s=t[n]^t[d],c=t[n+1]^t[d+1];t[n]=c,t[n+1]=s,Mi(t,a,t,n),s=t[i]^t[a],c=t[i+1]^t[a+1],t[i]=s>>>24^c<<8,t[i+1]=c>>>24^s<<8,Mi(t,d,t,i),Mi(t,d,e,o),s=t[n]^t[d],c=t[n+1]^t[d+1],t[n]=s>>>16^c<<16,t[n+1]=c>>>16^s<<16,Mi(t,a,t,n),s=t[i]^t[a],c=t[i+1]^t[a+1],t[i]=c>>>31^s<<1,t[i+1]=s>>>31^c<<1}var Su=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Ze=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(t=>t*2));function fc(t,e){let d=new Uint32Array(32),i=new Uint32Array(t.b.buffer,t.b.byteOffset,32);for(let n=0;n<16;n++)d[n]=t.h[n],d[n+16]=Su[n];d[24]^=t.t0[0],d[25]^=t.t0[1];let a=e?4294967295:0;d[28]^=a,d[29]^=a;for(let n=0;n<12;n++){let r=n<<4;Nd(d,i,0,8,16,24,Ze[r+0],Ze[r+1]),Nd(d,i,2,10,18,26,Ze[r+2],Ze[r+3]),Nd(d,i,4,12,20,28,Ze[r+4],Ze[r+5]),Nd(d,i,6,14,22,30,Ze[r+6],Ze[r+7]),Nd(d,i,0,10,20,30,Ze[r+8],Ze[r+9]),Nd(d,i,2,12,22,24,Ze[r+10],Ze[r+11]),Nd(d,i,4,14,16,26,Ze[r+12],Ze[r+13]),Nd(d,i,6,8,18,28,Ze[r+14],Ze[r+15])}for(let n=0;n<16;n++)t.h[n]^=d[n]^d[n+16]}var hP=class{constructor(t,e,d,i){let a=new Uint8Array(64);this.S={b:new Uint8Array(ma),h:new Uint32Array(yo/4),t0:new Uint32Array(2),c:0,outlen:t},a[0]=t,e&&(a[1]=e.length),a[2]=1,a[3]=1,d&&a.set(d,32),i&&a.set(i,48);let n=new Uint32Array(a.buffer,a.byteOffset,a.length/Uint32Array.BYTES_PER_ELEMENT);for(let r=0;r<16;r++)this.S.h[r]=Su[r]^n[r];if(e){let r=new Uint8Array(ma);r.set(e),this.update(r)}}update(t){if(!(t instanceof Uint8Array))throw new Error("Input must be Uint8Array or Buffer");let e=0;for(;e<t.length;){this.S.c===ma&&(hc(this.S.t0,this.S.c),fc(this.S,!1),this.S.c=0);let d=ma-this.S.c;this.S.b.set(t.subarray(e,e+d),this.S.c);let i=Math.min(d,t.length-e);this.S.c+=i,e+=i}return this}digest(t){hc(this.S.t0,this.S.c),this.S.b.fill(0,this.S.c),this.S.c=ma,fc(this.S,!0);let e=t||new Uint8Array(this.S.outlen);for(let d=0;d<this.S.outlen;d++)e[d]=this.S.h[d>>2]>>8*(d&3);return this.S.h=null,e.buffer}};function gn(t,e,d,i){if(t>yo)throw new Error(`outlen must be at most ${yo} (given: ${t})`);return new hP(t,e,d,i)}var yo=64,ma=128,es=2,Pu=19,fP=4294967295,IP=4,bP=4294967295,FP=8,EP=4294967295,vP=8,CP=4294967295,XP=4294967295,TP=32,cd=1024,DP=64,RP=new Uint8Array(new Uint16Array([43981]).buffer)[0]===205;function ct(t,e,d){return t[d+0]=e,t[d+1]=e>>8,t[d+2]=e>>16,t[d+3]=e>>24,t}function ti(t,e,d){if(e>Number.MAX_SAFE_INTEGER)throw new Error("LE64: large numbers unsupported");let i=e;for(let a=d;a<d+7;a++)t[a]=i,i=(i-t[a])/256;return t}function Nr(t,e,d){let i=new Uint8Array(64),a=new Uint8Array(4+e.length);if(ct(a,t,0),a.set(e,4),t<=64)return gn(t).update(a).digest(d),d;let n=Math.ceil(t/32)-2;for(let o=0;o<n;o++)gn(64).update(o===0?a:i).digest(i),d.set(i.subarray(0,32),o*32);let r=new Uint8Array(gn(t-32*n).update(i).digest());return d.set(r,n*32),d}function Ic(t,e,d,i){return t.fn.XOR(e.byteOffset,d.byteOffset,i.byteOffset),e}function NP(t,e,d,i){return t.fn.G(e.byteOffset,d.byteOffset,i.byteOffset,t.refs.gZ.byteOffset),i}function AP(t,e,d,i){return t.fn.G2(e.byteOffset,d.byteOffset,i.byteOffset,t.refs.gZ.byteOffset),i}function*wP(t,e,d,i,a,n,r,o){t.refs.prngTmp.fill(0);let s=t.refs.prngTmp.subarray(0,6*8);ti(s,e,0),ti(s,d,8),ti(s,i,16),ti(s,a,24),ti(s,n,32),ti(s,es,40);for(let c=1;c<=r;c++){ti(t.refs.prngTmp,c,s.length);let p=AP(t,t.refs.ZERO1024,t.refs.prngTmp,t.refs.prngR);for(let u=c===1?o*8:0;u<p.length;u+=8)yield p.subarray(u,u+8)}return[]}function MP({type:t,version:e,tagLength:d,password:i,salt:a,ad:n,secret:r,parallelism:o,memorySize:s,passes:c}){let p=(u,m,S,g)=>{if(m<S||m>g)throw new Error(`${u} size should be between ${S} and ${g} bytes`)};if(t!==es||e!==Pu)throw new Error("Unsupported type or version");return p("password",i,vP,EP),p("salt",a,FP,bP),p("tag",d,IP,fP),p("memory",s,8*o,CP),n&&p("associated data",n,0,XP),r&&p("secret",r,0,TP),{type:t,version:e,tagLength:d,password:i,salt:a,ad:n,secret:r,lanes:o,memorySize:s,passes:c}}var gu=1024,xP=64*gu;function LP(t,{memory:e,instance:d}){if(!RP)throw new Error("BigEndian system not supported");let i=MP({type:es,version:Pu,...t}),{G:a,G2:n,xor:r,getLZ:o}=d.exports,s={},c={};c.G=a,c.G2=n,c.XOR=r;let p=4*i.lanes*Math.floor(i.memorySize/(4*i.lanes)),u=p*cd+10*gu;if(e.buffer.byteLength<u){let C=Math.ceil((u-e.buffer.byteLength)/xP);e.grow(C)}let m=0;s.gZ=new Uint8Array(e.buffer,m,cd),m+=s.gZ.length,s.prngR=new Uint8Array(e.buffer,m,cd),m+=s.prngR.length,s.prngTmp=new Uint8Array(e.buffer,m,cd),m+=s.prngTmp.length,s.ZERO1024=new Uint8Array(e.buffer,m,1024),m+=s.ZERO1024.length;let S=new Uint32Array(e.buffer,m,2);m+=S.length*Uint32Array.BYTES_PER_ELEMENT;let g={fn:c,refs:s},y=new Uint8Array(e.buffer,m,cd);m+=y.length;let P=new Uint8Array(e.buffer,m,i.memorySize*cd),f=new Uint8Array(e.buffer,0,m),E=OP(i),v=p/i.lanes,F=new Array(i.lanes).fill(null).map(()=>new Array(v)),D=(C,R)=>(F[C][R]=P.subarray(C*v*1024+R*1024,C*v*1024+R*1024+cd),F[C][R]);for(let C=0;C<i.lanes;C++){let R=new Uint8Array(E.length+8);R.set(E),ct(R,0,E.length),ct(R,C,E.length+4),Nr(cd,R,D(C,0)),ct(R,1,E.length),Nr(cd,R,D(C,1))}let h=4,X=v/h;for(let C=0;C<i.passes;C++)for(let R=0;R<h;R++){let M=C===0&&R<=1;for(let x=0;x<i.lanes;x++){let N=R===0&&C===0?2:0,w=M?wP(g,C,x,R,p,i.passes,X,N):null;for(N;N<X;N++){let A=R*X+N,U=A>0?F[x][A-1]:F[x][v-1],L=M?w.next().value:U;o(S.byteOffset,L.byteOffset,x,i.lanes,C,R,N,h,X);let j=S[0],B=S[1];C===0&&D(x,A),NP(g,U,F[j][B],C>0?y:F[x][A]),C>0&&Ic(g,F[x][A],y,F[x][A])}}}let b=F[0][v-1];for(let C=1;C<i.lanes;C++)Ic(g,b,b,F[C][v-1]);let T=Nr(i.tagLength,b,new Uint8Array(i.tagLength));return f.fill(0),e.grow(0),T}function OP(t){let e=gn(DP),d=new Uint8Array(4),i=new Uint8Array(24);ct(i,t.lanes,0),ct(i,t.tagLength,4),ct(i,t.memorySize,8),ct(i,t.passes,12),ct(i,t.version,16),ct(i,t.type,20);let a=[i];t.password?(a.push(ct(new Uint8Array(4),t.password.length,0)),a.push(t.password)):a.push(d),t.salt?(a.push(ct(new Uint8Array(4),t.salt.length,0)),a.push(t.salt)):a.push(d),t.secret?(a.push(ct(new Uint8Array(4),t.secret.length,0)),a.push(t.secret)):a.push(d),t.ad?(a.push(ct(new Uint8Array(4),t.ad.length,0)),a.push(t.ad)):a.push(d),e.update(UP(a));let n=e.digest();return new Uint8Array(n)}function UP(t){if(t.length===1)return t[0];let e=0;for(let a=0;a<t.length;a++){if(!(t[a]instanceof Uint8Array))throw new Error("concatArrays: Data must be in the form of a Uint8Array");e+=t[a].length}let d=new Uint8Array(e),i=0;return t.forEach(a=>{d.set(a,i),i+=a.length}),d}var rn;async function kP(t,e,d){let i={env:{memory:t}};if(rn===void 0)try{let a=await e(i);return rn=!0,a}catch{rn=!1}return(rn?e:d)(i)}async function qP(t,e){let d=new WebAssembly.Memory({initial:1040,maximum:65536}),i=await kP(d,t,e);return a=>LP(a,{instance:i.instance,memory:d})}function hu(t,e,d,i){function a(c,p,u){var m=WebAssembly.instantiate,S=WebAssembly.compile;return p?m(c,p):S(c)}var n=null,r=et.atob(d),o=r.length;n=new Uint8Array(new ArrayBuffer(o));for(var s=0;s<o;s++)n[s]=r.charCodeAt(s);return a(n,i)}function BP(t){return hu(0,null,"AGFzbQEAAAABKwdgBH9/f38AYAABf2AAAGADf39/AGAJf39/f39/f39/AX9gAX8AYAF/AX8CEwEDZW52Bm1lbW9yeQIBkAiAgAQDCgkCAwAABAEFBgEEBQFwAQICBgkBfwFBkIjAAgsHfQoDeG9yAAEBRwACAkcyAAMFZ2V0TFoABBlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALX2luaXRpYWxpemUAABBfX2Vycm5vX2xvY2F0aW9uAAgJc3RhY2tTYXZlAAUMc3RhY2tSZXN0b3JlAAYKc3RhY2tBbGxvYwAHCQcBAEEBCwEACs0gCQMAAQtYAQJ/A0AgACAEQQR0IgNqIAIgA2r9AAQAIAEgA2r9AAQA/VH9CwQAIAAgA0EQciIDaiACIANq/QAEACABIANq/QAEAP1R/QsEACAEQQJqIgRBwABHDQALC7ceAgt7A38DQCADIBFBBHQiD2ogASAPav0ABAAgACAPav0ABAD9USIF/QsEACACIA9qIAX9CwQAIAMgD0EQciIPaiABIA9q/QAEACAAIA9q/QAEAP1RIgX9CwQAIAIgD2ogBf0LBAAgEUECaiIRQcAARw0ACwNAIAMgEEEHdGoiAEEQaiAA/QAEcCAA/QAEMCIFIAD9AAQQIgT9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAQgBP0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9USIJQSD9ywEgCUEg/c0B/VAiCSAA/QAEUCIG/c4BIAkgCf0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIGIAX9USIFQSj9ywEgBUEY/c0B/VAiCCAE/c4BIAggCP0NAAECAwgJCgsAAQIDCAkKCyAEIAT9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIKIAogCf1RIgVBMP3LASAFQRD9zQH9UCIFIAb9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgkgCP1RIgRBAf3LASAEQT/9zQH9UCIMIAD9AARgIAD9AAQgIgQgAP0ABAAiBv3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBv1RIghBIP3LASAIQSD9zQH9UCIIIABBQGsiAf0ABAAiB/3OASAIIAj9DQABAgMICQoLAAECAwgJCgsgByAH/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiByAE/VEiBEEo/csBIARBGP3NAf1QIgsgBv3OASALIAv9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAI/VEiBEEw/csBIARBEP3NAf1QIgQgB/3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgByAH/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCCAL/VEiB0EB/csBIAdBP/3NAf1QIg0gDf0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eHyIH/c4BIAcgB/0NAAECAwgJCgsAAQIDCAkKCyAKIAr9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIKIAQgBSAF/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/VEiC0Eg/csBIAtBIP3NAf1QIgsgCP3OASALIAv9DQABAgMICQoLAAECAwgJCgsgCCAI/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCCAH/VEiB0Eo/csBIAdBGP3NAf1QIgcgCv3OASAHIAf9DQABAgMICQoLAAECAwgJCgsgCiAK/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiDv0LBAAgACAGIA0gDCAM/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4fIgr9zgEgCiAK/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgYgBSAEIAT9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9USIFQSD9ywEgBUEg/c0B/VAiBSAJ/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAJIAn9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJIAr9USIEQSj9ywEgBEEY/c0B/VAiCiAG/c4BIAogCv0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIE/QsEACAAIAQgBf1RIgVBMP3LASAFQRD9zQH9UCIFIA4gC/1RIgRBMP3LASAEQRD9zQH9UCIEIAT9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwRgIAAgBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwRwIAEgBCAI/c4BIAQgBP0NAAECAwgJCgsAAQIDCAkKCyAIIAj9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIE/QsEACAAIAUgCf3OASAFIAX9DQABAgMICQoLAAECAwgJCgsgCSAJ/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCf0LBFAgACAEIAf9USIFQQH9ywEgBUE//c0B/VAiBSAJIAr9USIEQQH9ywEgBEE//c0B/VAiBCAE/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEICAAIAQgBSAF/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEMCAQQQFqIhBBCEcNAAtBACEQA0AgAyAQQQR0aiIAQYABaiAA/QAEgAcgAP0ABIADIgUgAP0ABIABIgT9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAQgBP0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9USIJQSD9ywEgCUEg/c0B/VAiCSAA/QAEgAUiBv3OASAJIAn9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAF/VEiBUEo/csBIAVBGP3NAf1QIgggBP3OASAIIAj9DQABAgMICQoLAAECAwgJCgsgBCAE/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCiAKIAn9USIFQTD9ywEgBUEQ/c0B/VAiBSAG/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJIAj9USIEQQH9ywEgBEE//c0B/VAiDCAA/QAEgAYgAP0ABIACIgQgAP0ABAAiBv3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBv1RIghBIP3LASAIQSD9zQH9UCIIIAD9AASABCIH/c4BIAggCP0NAAECAwgJCgsAAQIDCAkKCyAHIAf9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIHIAT9USIEQSj9ywEgBEEY/c0B/VAiCyAG/c4BIAsgC/0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIGIAj9USIEQTD9ywEgBEEQ/c0B/VAiBCAH/c4BIAQgBP0NAAECAwgJCgsAAQIDCAkKCyAHIAf9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIIIAv9USIHQQH9ywEgB0E//c0B/VAiDSAN/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4fIgf9zgEgByAH/Q0AAQIDCAkKCwABAgMICQoLIAogCv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgogBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9USILQSD9ywEgC0Eg/c0B/VAiCyAI/c4BIAsgC/0NAAECAwgJCgsAAQIDCAkKCyAIIAj9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIIIAf9USIHQSj9ywEgB0EY/c0B/VAiByAK/c4BIAcgB/0NAAECAwgJCgsAAQIDCAkKCyAKIAr9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIO/QsEACAAIAYgDSAMIAz9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh8iCv3OASAKIAr9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAFIAQgBP0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/1RIgVBIP3LASAFQSD9zQH9UCIFIAn9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAkgCf0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgkgCv1RIgRBKP3LASAEQRj9zQH9UCIKIAb9zgEgCiAK/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9CwQAIAAgBCAF/VEiBUEw/csBIAVBEP3NAf1QIgUgDiAL/VEiBEEw/csBIARBEP3NAf1QIgQgBP0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/0LBIAGIAAgBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwSAByAAIAQgCP3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgCCAI/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBP0LBIAEIAAgBSAJ/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAJIAn9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJ/QsEgAUgACAEIAf9USIFQQH9ywEgBUE//c0B/VAiBSAJIAr9USIEQQH9ywEgBEE//c0B/VAiBCAE/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEgAIgACAEIAUgBf0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/0LBIADIBBBAWoiEEEIRw0AC0EAIRADQCACIBBBBHQiAGoiASAAIANq/QAEACAB/QAEAP1R/QsEACACIABBEHIiAWoiDyABIANq/QAEACAP/QAEAP1R/QsEACACIABBIHIiAWoiDyABIANq/QAEACAP/QAEAP1R/QsEACACIABBMHIiAGoiASAAIANq/QAEACAB/QAEAP1R/QsEACAQQQRqIhBBwABHDQALCxYAIAAgASACIAMQAiAAIAIgAiADEAILewIBfwF+IAIhCSABNQIAIQogBCAFcgRAIAEoAgQgA3AhCQsgACAJNgIAIAAgB0EBayAFIAQbIAhsIAZBAWtBAEF/IAYbIAIgCUYbaiIBIAVBAWogCGxBACAEG2ogAa0gCiAKfkIgiH5CIIinQX9zaiAHIAhscDYCBCAACwQAIwALBgAgACQACxAAIwAgAGtBcHEiACQAIAALBQBBgAgL",t)}function jP(t){return hu(0,null,"AGFzbQEAAAABPwhgBH9/f38AYAABf2AAAGADf39/AGARf39/f39/f39/f39/f39/f38AYAl/f39/f39/f38Bf2ABfwBgAX8BfwITAQNlbnYGbWVtb3J5AgGQCICABAMLCgIDBAAABQEGBwEEBQFwAQICBgkBfwFBkIjAAgsHfQoDeG9yAAEBRwADAkcyAAQFZ2V0TFoABRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALX2luaXRpYWxpemUAABBfX2Vycm5vX2xvY2F0aW9uAAkJc3RhY2tTYXZlAAYMc3RhY2tSZXN0b3JlAAcKc3RhY2tBbGxvYwAICQcBAEEBCwEACssaCgMAAQtQAQJ/A0AgACAEQQN0IgNqIAIgA2opAwAgASADaikDAIU3AwAgACADQQhyIgNqIAIgA2opAwAgASADaikDAIU3AwAgBEECaiIEQYABRw0ACwveDwICfgF/IAAgAUEDdGoiEyATKQMAIhEgACAFQQN0aiIBKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA1BA3RqIgUgESAFKQMAhUIgiSIRNwMAIAAgCUEDdGoiCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIoiSIRNwMAIBMgESATKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAFIBEgBSkDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgASARIAEpAwCFQgGJNwMAIAAgAkEDdGoiDSANKQMAIhEgACAGQQN0aiICKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA5BA3RqIgYgESAGKQMAhUIgiSIRNwMAIAAgCkEDdGoiCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIoiSIRNwMAIA0gESANKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAKIBEgCikDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAiARIAIpAwCFQgGJNwMAIAAgA0EDdGoiDiAOKQMAIhEgACAHQQN0aiIDKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA9BA3RqIgcgESAHKQMAhUIgiSIRNwMAIAAgC0EDdGoiCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAMgESADKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAHIBEgBykDAIVCMIkiETcDACALIBEgCykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQgGJNwMAIAAgBEEDdGoiDyAPKQMAIhEgACAIQQN0aiIEKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIBBBA3RqIgggESAIKQMAhUIgiSIRNwMAIAAgDEEDdGoiACARIAApAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA8gESAPKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAIIBEgCCkDAIVCMIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIBMgEykDACIRIAIpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAggESAIKQMAhUIgiSIRNwMAIAsgESALKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACACIBEgAikDAIVCKIkiETcDACATIBEgEykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgCCARIAgpAwCFQjCJIhE3AwAgCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIBiTcDACANIA0pAwAiESADKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAFIBEgBSkDAIVCIIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQiiJIhE3AwAgDSARIA0pAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAUgESAFKQMAhUIwiSIRNwMAIAAgESAAKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACADIBEgAykDAIVCAYk3AwAgDiAOKQMAIhEgBCkDACISfCARQgGGQv7///8fgyASQv////8Pg358IhE3AwAgBiARIAYpAwCFQiCJIhE3AwAgCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIA8gDykDACIRIAEpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAcgESAHKQMAhUIgiSIRNwMAIAogESAKKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACABIBEgASkDAIVCKIkiETcDACAPIBEgDykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgByARIAcpAwCFQjCJIhE3AwAgCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIBiTcDAAvdCAEPfwNAIAIgBUEDdCIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAIgBkEIciIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAVBAmoiBUGAAUcNAAsDQCADIARBA3QiAGogACACaikDADcDACADIARBAXIiAEEDdCIBaiABIAJqKQMANwMAIAMgBEECciIBQQN0IgVqIAIgBWopAwA3AwAgAyAEQQNyIgVBA3QiBmogAiAGaikDADcDACADIARBBHIiBkEDdCIHaiACIAdqKQMANwMAIAMgBEEFciIHQQN0IghqIAIgCGopAwA3AwAgAyAEQQZyIghBA3QiCWogAiAJaikDADcDACADIARBB3IiCUEDdCIKaiACIApqKQMANwMAIAMgBEEIciIKQQN0IgtqIAIgC2opAwA3AwAgAyAEQQlyIgtBA3QiDGogAiAMaikDADcDACADIARBCnIiDEEDdCINaiACIA1qKQMANwMAIAMgBEELciINQQN0Ig5qIAIgDmopAwA3AwAgAyAEQQxyIg5BA3QiD2ogAiAPaikDADcDACADIARBDXIiD0EDdCIQaiACIBBqKQMANwMAIAMgBEEOciIQQQN0IhFqIAIgEWopAwA3AwAgAyAEQQ9yIhFBA3QiEmogAiASaikDADcDACADIARB//8DcSAAQf//A3EgAUH//wNxIAVB//8DcSAGQf//A3EgB0H//wNxIAhB//8DcSAJQf//A3EgCkH//wNxIAtB//8DcSAMQf//A3EgDUH//wNxIA5B//8DcSAPQf//A3EgEEH//wNxIBFB//8DcRACIARB8ABJIQAgBEEQaiEEIAANAAtBACEBIANBAEEBQRBBEUEgQSFBMEExQcAAQcEAQdAAQdEAQeAAQeEAQfAAQfEAEAIgA0ECQQNBEkETQSJBI0EyQTNBwgBBwwBB0gBB0wBB4gBB4wBB8gBB8wAQAiADQQRBBUEUQRVBJEElQTRBNUHEAEHFAEHUAEHVAEHkAEHlAEH0AEH1ABACIANBBkEHQRZBF0EmQSdBNkE3QcYAQccAQdYAQdcAQeYAQecAQfYAQfcAEAIgA0EIQQlBGEEZQShBKUE4QTlByABByQBB2ABB2QBB6ABB6QBB+ABB+QAQAiADQQpBC0EaQRtBKkErQTpBO0HKAEHLAEHaAEHbAEHqAEHrAEH6AEH7ABACIANBDEENQRxBHUEsQS1BPEE9QcwAQc0AQdwAQd0AQewAQe0AQfwAQf0AEAIgA0EOQQ9BHkEfQS5BL0E+QT9BzgBBzwBB3gBB3wBB7gBB7wBB/gBB/wAQAgNAIAIgAUEDdCIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAiAAQQhyIgRqIgUgAyAEaikDACAFKQMAhTcDACACIABBEHIiBGoiBSADIARqKQMAIAUpAwCFNwMAIAIgAEEYciIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAUEEaiIBQYABRw0ACwsWACAAIAEgAiADEAMgACACIAIgAxADC3sCAX8BfiACIQkgATUCACEKIAQgBXIEQCABKAIEIANwIQkLIAAgCTYCACAAIAdBAWsgBSAEGyAIbCAGQQFrQQBBfyAGGyACIAlGG2oiASAFQQFqIAhsQQAgBBtqIAGtIAogCn5CIIh+QiCIp0F/c2ogByAIbHA2AgQgAAsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwUAQYAICw==",t)}var GP=async()=>qP(t=>BP(t),t=>jP(t)),QP=Object.freeze({__proto__:null,default:GP}),bc=[0,1,3,7,15,31,63,127,255],Ha=function(t){this.stream=t,this.bitOffset=0,this.curByte=0,this.hasByte=!1};Ha.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)};Ha.prototype.read=function(t){for(var e=0;t>0;){this._ensureByte();var d=8-this.bitOffset;if(t>=d)e<<=d,e|=bc[d]&this.curByte,this.hasByte=!1,this.bitOffset=0,t-=d;else{e<<=t;var i=d-t;e|=(this.curByte&bc[t]<<i)>>i,this.bitOffset+=t,t=0}}return e};Ha.prototype.seek=function(t){var e=t%8,d=(t-e)/8;this.bitOffset=e,this.stream.seek(d),this.hasByte=!1};Ha.prototype.pi=function(){var t=new Uint8Array(6),e;for(e=0;e<t.length;e++)t[e]=this.read(8);return VP(t)};function VP(t){return Array.prototype.map.call(t,e=>("00"+e.toString(16)).slice(-2)).join("")}var zP=Ha,Ei=function(){};Ei.prototype.readByte=function(){throw new Error("abstract method readByte() not implemented")};Ei.prototype.read=function(t,e,d){for(var i=0;i<d;){var a=this.readByte();if(a<0)return i===0?-1:i;t[e++]=a,i++}return i};Ei.prototype.seek=function(t){throw new Error("abstract method seek() not implemented")};Ei.prototype.writeByte=function(t){throw new Error("abstract method readByte() not implemented")};Ei.prototype.write=function(t,e,d){var i;for(i=0;i<d;i++)this.writeByte(t[e++]);return d};Ei.prototype.flush=function(){};var HP=Ei,WP=function(){var t=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]),e=function(){var d=4294967295;this.getCRC=function(){return~d>>>0},this.updateCRC=function(i){d=d<<8^t[(d>>>24^i)&255]},this.updateCRCRun=function(i,a){for(;a-- >0;)d=d<<8^t[(d>>>24^i)&255]}};return e}(),KP=zP,Ma=HP,fu=WP,on=20,Fc=258,Ec=0,YP=1,_P=2,JP=6,$P=50,ZP="314159265359",eg="177245385090",vc=function(t,e){var d=t[e],i;for(i=e;i>0;i--)t[i]=t[i-1];return t[0]=d,d},ve={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},Hd={};Hd[ve.LAST_BLOCK]="Bad file checksum";Hd[ve.NOT_BZIP_DATA]="Not bzip data";Hd[ve.UNEXPECTED_INPUT_EOF]="Unexpected input EOF";Hd[ve.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF";Hd[ve.DATA_ERROR]="Data error";Hd[ve.OUT_OF_MEMORY]="Out of memory";Hd[ve.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var Ke=function(t,e){var d=Hd[t]||"unknown error";e&&(d+=": "+e);var i=new TypeError(d);throw i.errorCode=t,i},Wd=function(t,e){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(t,e)};Wd.prototype._init_block=function(){var t=this._get_next_block();return t?(this.blockCRC=new fu,!0):(this.writeCount=-1,!1)};Wd.prototype._start_bunzip=function(t,e){var d=new Uint8Array(4);(t.read(d,0,4)!==4||String.fromCharCode(d[0],d[1],d[2])!=="BZh")&&Ke(ve.NOT_BZIP_DATA,"bad magic");var i=d[3]-48;(i<1||i>9)&&Ke(ve.NOT_BZIP_DATA,"level out of range"),this.reader=new KP(t),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=e,this.streamCRC=0};Wd.prototype._get_next_block=function(){var t,e,d,i=this.reader,a=i.pi();if(a===eg)return!1;a!==ZP&&Ke(ve.NOT_BZIP_DATA),this.targetBlockCRC=i.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,i.read(1)&&Ke(ve.OBSOLETE_INPUT);var n=i.read(24);n>this.dbufSize&&Ke(ve.DATA_ERROR,"initial position out of bounds");var r=i.read(16),o=new Uint8Array(256),s=0;for(t=0;t<16;t++)if(r&1<<15-t){var c=t*16;for(d=i.read(16),e=0;e<16;e++)d&1<<15-e&&(o[s++]=c+e)}var p=i.read(3);(p<_P||p>JP)&&Ke(ve.DATA_ERROR);var u=i.read(15);u===0&&Ke(ve.DATA_ERROR);var m=new Uint8Array(256);for(t=0;t<p;t++)m[t]=t;var S=new Uint8Array(u);for(t=0;t<u;t++){for(e=0;i.read(1);e++)e>=p&&Ke(ve.DATA_ERROR);S[t]=vc(m,e)}var g=s+2,y=[],P;for(e=0;e<p;e++){var f=new Uint8Array(g),E=new Uint16Array(on+1);for(r=i.read(5),t=0;t<g;t++){for(;(r<1||r>on)&&Ke(ve.DATA_ERROR),!!i.read(1);)i.read(1)?r--:r++;f[t]=r}var v,F;for(v=F=f[0],t=1;t<g;t++)f[t]>F?F=f[t]:f[t]<v&&(v=f[t]);P={},y.push(P),P.permute=new Uint16Array(Fc),P.limit=new Uint32Array(on+2),P.base=new Uint32Array(on+1),P.minLen=v,P.maxLen=F;var D=0;for(t=v;t<=F;t++)for(E[t]=P.limit[t]=0,r=0;r<g;r++)f[r]===t&&(P.permute[D++]=r);for(t=0;t<g;t++)E[f[t]]++;for(D=r=0,t=v;t<F;t++)D+=E[t],P.limit[t]=D-1,D<<=1,r+=E[t],P.base[t+1]=D-r;P.limit[F+1]=Number.MAX_VALUE,P.limit[F]=D+E[F]-1,P.base[v]=0}var h=new Uint32Array(256);for(t=0;t<256;t++)m[t]=t;var X=0,b=0,T=0,C,R=this.dbuf=new Uint32Array(this.dbufSize);for(g=0;;){for(g--||(g=$P-1,T>=u&&Ke(ve.DATA_ERROR),P=y[S[T++]]),t=P.minLen,e=i.read(t);t>P.maxLen&&Ke(ve.DATA_ERROR),!(e<=P.limit[t]);t++)e=e<<1|i.read(1);e-=P.base[t],(e<0||e>=Fc)&&Ke(ve.DATA_ERROR);var M=P.permute[e];if(M===Ec||M===YP){X||(X=1,r=0),M===Ec?r+=X:r+=2*X,X<<=1;continue}if(X)for(X=0,b+r>this.dbufSize&&Ke(ve.DATA_ERROR),C=o[m[0]],h[C]+=r;r--;)R[b++]=C;if(M>s)break;b>=this.dbufSize&&Ke(ve.DATA_ERROR),t=M-1,C=vc(m,t),C=o[C],h[C]++,R[b++]=C}for((n<0||n>=b)&&Ke(ve.DATA_ERROR),e=0,t=0;t<256;t++)d=e+h[t],h[t]=e,e=d;for(t=0;t<b;t++)C=R[t]&255,R[h[C]]|=t<<8,h[C]++;var x=0,N=0,w=0;return b&&(x=R[n],N=x&255,x>>=8,w=-1),this.writePos=x,this.writeCurrent=N,this.writeCount=b,this.writeRun=w,!0};Wd.prototype._read_bunzip=function(t,e){var d,i,a;if(this.writeCount<0)return 0;var n=this.dbuf,r=this.writePos,o=this.writeCurrent,s=this.writeCount;this.outputsize;for(var c=this.writeRun;s;){for(s--,i=o,r=n[r],o=r&255,r>>=8,c++===3?(d=o,a=i,o=-1):(d=1,a=o),this.blockCRC.updateCRCRun(a,d);d--;)this.outputStream.writeByte(a),this.nextoutput++;o!=i&&(c=0)}return this.writeCount=s,this.blockCRC.getCRC()!==this.targetBlockCRC&&Ke(ve.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var ts=function(t){if("readByte"in t)return t;var e=new Ma;return e.pos=0,e.readByte=function(){return t[this.pos++]},e.seek=function(d){this.pos=d},e.eof=function(){return this.pos>=t.length},e},Iu=function(t){var e=new Ma,d=!0;if(t)if(typeof t=="number")e.buffer=new Uint8Array(t),d=!1;else{if("writeByte"in t)return t;e.buffer=t,d=!1}else e.buffer=new Uint8Array(16384);return e.pos=0,e.writeByte=function(i){if(d&&this.pos>=this.buffer.length){var a=new Uint8Array(this.buffer.length*2);a.set(this.buffer),this.buffer=a}this.buffer[this.pos++]=i},e.getBuffer=function(){if(this.pos!==this.buffer.length){if(!d)throw new TypeError("outputsize does not match decoded input");var i=new Uint8Array(this.pos);i.set(this.buffer.subarray(0,this.pos)),this.buffer=i}return this.buffer},e._coerced=!0,e},tg=function(t,e,d){for(var i=ts(t),a=Iu(e),n=new Wd(i,a);!("eof"in i&&i.eof());)if(n._init_block())n._read_bunzip();else{var r=n.reader.read(32)>>>0;if(r!==n.streamCRC&&Ke(ve.DATA_ERROR,"Bad stream CRC (got "+n.streamCRC.toString(16)+" expected "+r.toString(16)+")"),d&&"eof"in i&&!i.eof())n._start_bunzip(i,a);else break}if("getBuffer"in a)return a.getBuffer()},dg=function(t,e,d){var i=ts(t),a=Iu(d),n=new Wd(i,a);n.reader.seek(e);var r=n._get_next_block();if(r&&(n.blockCRC=new fu,n.writeCopies=0,n._read_bunzip()),"getBuffer"in a)return a.getBuffer()},ig=function(t,e,d){var i=new Ma;i.delegate=ts(t),i.pos=0,i.readByte=function(){return this.pos++,this.delegate.readByte()},i.delegate.eof&&(i.eof=i.delegate.eof.bind(i.delegate));var a=new Ma;a.pos=0,a.writeByte=function(){this.pos++};for(var n=new Wd(i,a),r=n.dbufSize;!("eof"in i&&i.eof());){var o=i.pos*8+n.reader.bitOffset;if(n.reader.hasByte&&(o-=8),n._init_block()){var s=a.pos;n._read_bunzip(),e(o,a.pos-s)}else if(n.reader.read(32),d&&"eof"in i&&!i.eof())n._start_bunzip(i,a),console.assert(n.dbufSize===r,"shouldn't change block size within multistream file");else break}},ag={Bunzip:Wd,Stream:Ma,Err:ve,decode:tg,decodeBlock:dg,table:ig},ng=vm({__proto__:null},[ag]),rg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",og=t=>{let e=rg.indexOf(t);return e<0?void 0:e},Cc=t=>{let e=`${t}`;if(e=e.replace(/[ \t\n\f\r]/g,""),e.length%4===0&&(e=e.replace(/==?$/,"")),e.length%4===1||/[^+/0-9A-Za-z]/.test(e))return;let d="",i=0,a=0;return[...e].forEach(n=>{i<<=6,i|=og(n),a+=6,a===24&&(d+=String.fromCharCode((i&16711680)>>16),d+=String.fromCharCode((i&65280)>>8),d+=String.fromCharCode(i&255),i=a=0)}),a===12?(i>>=4,d+=String.fromCharCode(i)):a===18&&(i>>=2,d+=String.fromCharCode((i&65280)>>8),d+=String.fromCharCode(i&255)),d},sg=t=>t==null||t.length===0,Me=class se{static#n="MTc1MjAyNTMyMzM5Mg==";static#i;static#a=!1;static#e=void 0;static#t="none";static#d;static#o=`-----BEGIN PGP PUBLIC KEY BLOCK-----
9340
9340
 
9341
9341
  xjMEYSAlmRYJKwYBBAHaRw8BAQdATxsL8ZGu79iIXGoMwAGxis0Ot6zN+c+H
9342
9342
  FiEfymdU5QHNIGZpeHBhcnNlci5pbyA8aW5mb0BmaXhwYXJzZXIuaW8+wowE
@@ -10110,7 +10110,7 @@ S5ZXnD0TGixaxWGBs96860f4U3qluhTjUAD9EAu8DxxpKVw59ngh8836nlRZ
10110
10110
  Required when TestOrderOffsetPeriod(3090) is specified.`}],numInGroup:{id:3082,added:"FIX.Latest",addedEP:"295",description:""}},{name:"TestGatewayDetailGrp",abbrName:"TstGtwyDetl",addedEP:"295",added:"FIX.Latest",category:"Testing",id:2283,description:`Provides information about gateways for testing applications, e.g. for order entry or market data.
10111
10111
 
10112
10112
 
10113
- The gateways may be offered by service providers simulating execution venues or offered directly by the venues.`,fieldRef:[{added:"FIX.Latest",addedEP:"295",id:3093,description:"Required if NoTestGatewayDetails(3092)>0."},{added:"FIX.Latest",addedEP:"295",id:3094,description:"Required if NoTestGatewayDetails(3092)>0."},{added:"FIX.Latest",addedEP:"295",id:3095,description:"Required if NoTestGatewayDetails(3092)>0."},{added:"FIX.Latest",addedEP:"295",id:3096,description:""}],numInGroup:{id:3092,added:"FIX.Latest",addedEP:"295",description:""}}],ug=class{groups=lg;cacheMap=new Map;cacheMapByName=new Map;constructor(){this.groups.forEach(t=>{this.cacheMap.set(t.id,t)}),this.groups.forEach(t=>{this.cacheMapByName.set(t.name,t)})}find(t){return this.cacheMap.get(t)}findByName(t){return this.cacheMapByName.get(t)}filterMapByNumInGroupId(t,e){if(t===O.NoMDEntries&&e===be.MarketDataSnapshotFullRefresh)return this.find(2031);if(t===O.NoMDEntries&&e===be.MarketDataIncrementalRefresh)return this.find(2032);for(let[,d]of this.cacheMap.entries())if(d.numInGroup?.id===t)return d}},Et=Object.freeze({FIX27:"0",FIX30:"1",FIX40:"2",FIX41:"3",FIX42:"4",FIX43:"5",FIX44:"6",FIX50:"7",FIX50SP1:"8",FIX50SP2:"9",FIXLatest:"10"}),mg=(t,e)=>{if(Number.isNaN(t.getTime()))return e.log({level:"error",message:"Invalid date specified!"}),"";let d=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())),i=d.getUTCFullYear(),a=String(d.getUTCMonth()+1).padStart(2,"0"),n=String(d.getUTCDate()).padStart(2,"0"),r=String(d.getUTCHours()).padStart(2,"0"),o=String(d.getUTCMinutes()).padStart(2,"0"),s=String(d.getUTCSeconds()).padStart(2,"0"),c=String(d.getUTCMilliseconds()).padStart(3,"0");return`${i}${a}${n}-${r}:${o}:${s}.${c}`},yg={version:"0.0.0",build:"2025-07-09T01:16:02.231Z"},ba=t=>bu[t]??t,bu={[Et.FIX27]:"FIX.2.7",[Et.FIX30]:"FIX.3.0",[Et.FIX40]:"FIX.4.0",[Et.FIX41]:"FIX.4.1",[Et.FIX42]:"FIX.4.2",[Et.FIX43]:"FIX.4.3",[Et.FIX44]:"FIX.4.4",[Et.FIX50]:"FIX.5.0",[Et.FIX50SP1]:"FIX.5.0SP1",[Et.FIX50SP2]:"FIX.5.0SP2",[Et.FIXLatest]:"FIXT.1.1"},xa=bu[Et.FIXLatest],Xc=30,Tc=1e5,Dc="utf8",ga="",Sg="=",Pg=/[.*+?^${}()|[\]\\]/g,gg=/8=FIXT?\.\d\.\d([^\d]+)/i,Rc=100,hg=(t,e)=>`0000000000000000${t}`.slice(-e),di="10=",Ar="35=",Nc="",Ac="",fg=t=>t.enumeration?.name??t.value,wc=(t,e,d=!1)=>{let i=d?fg(t):t.value,a=t.name??t.tag;e[a]?e[a]=Array.isArray(e[a])?[...e[a],i]:[e[a],i]:e[a]=i},Fu=class Eu{fixVersion=xa;data=[];messageString="";description="";messageType="";messageTypeDescription="";messageSequence=-1;structure=void 0;bodyLengthValid=!1;checksumValid=!1;checksumValue=void 0;checksumExpected=void 0;bodyLengthValue=void 0;bodyLengthExpected=void 0;#n=void 0;#i=void 0;#a=void 0;#e=void 0;#t=void 0;constructor(e=xa,...d){this.fixVersion=ba(e),this.reset(),d.forEach(i=>{i.tag===O.BeginString&&(this.fixVersion=String(i.value)),i.tag===O.MsgSeqNum&&(this.messageSequence=Number(i.value)),i.tag===O.MsgType?this.data.splice(0,0,i):this.data.push(i)})}#d=()=>{this.#n||(this.#n=new xr),this.#i||(this.#i=new Bc),this.#a||(this.#a=new qc),this.#e||(this.#e=new pg),this.#t||(this.#t=new ug)};#o=e=>{let d=e.indexOf(Ar)===-1?0:e.indexOf(Ar)+1;return(e.lastIndexOf(di)===-1?e.length:e.lastIndexOf(di)+1)-d};#r=e=>{let d=0;for(let i=0;i<e.length;i++)d+=e.charCodeAt(i);return hg(d%256,3)};#s=(e,...d)=>{let i=e[0],a=1;for(a;a<e.length;a++)(d[a-1]||d[a-1]==="0")&&(i+=d[a-1]),i+=e[a];return i.replace(/\s+/g," ")};#c=(e,d,i)=>{if(e?.data[d]&&e?.presence==="required"){let a=e?.data[d].filter(n=>n.presence==="required");for(let n of a)if(!i.has(Number(n.id)))return{field:{...n},name:n.name,tag:Number(n.id),value:null,error:`Missing field ${n.name}`}}};#p=(e,d=!0)=>{this.#d();let i=[],a=structuredClone(e.data),n=new Set(a.map(o=>o.tag)),r=(o,s,c)=>{let p=this.#i?.cacheMap.get(o.tag);i.push({field:p,name:o.name,tag:o.tag,value:o.value,error:s,expectedValue:c})};for(let o of a){let s=this.#n?.getEnumByTag(String(o.tag)),c=s&&this.#n?.getEnum(String(o.tag),o.value),p=this.#a?.validateDatatype(o.value,o.type?.name);(s&&!c||!p)&&r(o,"Incorrect data format for value"),o.tag===O.BodyLength&&!this.validateBodyLength(String(this.bodyLengthValue))&&r(o,"Incorrect value for BodyLength",this.bodyLengthExpected),o.tag===O.CheckSum&&!this.validateChecksum(String(this.checksumValue))&&r(o,"Incorrect value for CheckSum",this.checksumExpected)}if(this.structure)for(let o of this.structure){if(d&&o.presence!=="required")continue;let{id:s,name:c,fieldRef:p,groupRef:u,componentRef:m}=o.data,S=Number(s),g=!n.has(S)&&!p&&!u&&!m&&S!==1003,y=[1137,372,1130,1410,1128].includes(S)&&[1137,372,1130,1410,1128].some(P=>n.has(P));if(g&&!y)if(o.data.type==="component"){let P=this.#l(S),f=new Set(a.map(E=>E.tag));P.length>0&&!P.some(E=>f.has(E))&&i.push({field:{...o.data},tag:Number(o.data.id),name:o.data.name,value:null,error:`Missing block ${o.data.name}`})}else r({tag:S,name:c},`Missing field ${c}`);["fieldRef","componentRef","groupRef"].forEach(P=>{let f=this.#c(o,P,n);f&&i.push(f)})}return i};#l=e=>{let d=this.#e?.cacheMap.get(e);if(!d)return[];let{fieldRef:i=[],componentRef:a=[],groupRef:n=[]}=d;return[...i.map(r=>r.id),...a.map(r=>r.id),...n.map(r=>r.id)]};addField(e){this.data.push(e)}addFields(...e){e.forEach(d=>{d.tag===O.MsgType?this.data.splice(0,0,d):this.data.push(d)})}removeFieldByTag(e){let d=this.data.findIndex(i=>i.tag===e);d>-1&&this.data.splice(d,1)}getField(e){return this.data.find(d=>d.tag===e)}getFields(e){return this.data.filter(d=>d.tag===e)}getFieldExplains(){let e={};return this.data.forEach(d=>{wc(d,e,!0)}),e}getFieldNameValues(){let e={};return this.data.forEach(d=>{wc(d,e,!1)}),e}getFieldValues(){let e={};return this.data.forEach(d=>{e[d.tag]?Array.isArray(e[d.tag])?e[d.tag]=[...e[d.tag],d.value]:e[d.tag]=[e[d.tag],d.value]:e[d.tag]=d.value}),e}setField(e){let d=this.data.findIndex(i=>i.tag===e.tag);d>-1?this.data[d]=e:this.data.push(e),e.tag!==O.BodyLength&&e.tag!==O.CheckSum&&this.recalculateMessageLengths()}getEnum(e,d){return!this.getField(O.MsgType)?.tag||!this.getField(O.MsgType)?.value?void 0:new xr().getEnum(e.toString(),d)}getBriefDescription(){let e="",d=this.getField(O.Side),i="";if(d?.enumeration&&(i=d.enumeration.name,i=i?i.replace("Sell","SL").toUpperCase():void 0),this.getField(O.LeavesQty)!==void 0){let a="";this.getField(O.ContraTradeQty)?a=String(this.getField(O.ContraTradeQty)?.value):a=String(this.getField(O.OrderQty)?.value??"");let n=String(this.getField(O.LeavesQty)?.value),r=this.getField(O.LastPx)?Number(this.getField(O.LastPx)?.value):0;e=this.#s`${a} @${r||r===0?r.toFixed(2):"0.00"} ${this.getField(O.LeavesQty).name.replace("LeavesQty","LvsQty")} ${Number.parseInt(n,10).toString()}`}else if(this.getField(O.OrderQty)){let a=String(this.getField(O.OrderQty)?.value),n=this.getField(O.Symbol)?String(this.getField(O.Symbol)?.value):"",r=this.getField(O.OrdType),o="";r?.enumeration?.name&&(o=r.enumeration.name);let s=this.getField(O.TimeInForce),c="";s?.enumeration&&(c=String(s.enumeration.name));let p=this.getField(O.Price);if(p){let u=String(p.value),m=Number(p.value);m>=1?u=m.toFixed(2):m<1&&(u=m.toString().replace("0.","."));let S=i?`${i} `:"",g=a?`${a} `:"",y=n?`${n.toUpperCase()} `:"",P=o?`${o.replace("Market","MKT").replace("Limit","LMT").toUpperCase()} `:"",f=`@${u} `,E=c?c.toUpperCase():"",v=S+g+y+P+f+E;e=this.#s`${v}`}else e=this.#s`${i??""} ${a} ${n?n.toUpperCase():""} ${o?o.replace("Market","MKT").replace("Limit","LMT").toUpperCase():""} ${c?c.toUpperCase():""}`}else{let a=this.getField(O.MsgType);return a?.tag&&a.value?this.getEnum(a.tag,String(a.value))?.name??"":void 0}return e.trim()}validateBodyLength(e){let d=this.messageString.indexOf(Ar),i=this.messageString.lastIndexOf(di),a=d===-1?0:d,n=(i===-1?this.messageString.length:i)-a;return this.bodyLengthValue=Number(e),this.bodyLengthExpected=n,this.bodyLengthValid=Number(e)===n,this.bodyLengthValid}validateChecksum(e){let d=this.messageString.lastIndexOf(di),i=d===-1?this.messageString.length:d,a=this.messageString.substring(0,i),n=this.#r(a);return this.checksumValue=e,this.checksumExpected=n,this.checksumValid=e===n,this.checksumValid}recalculateMessageLengths(){let e=this.#o(this.messageString),d=this.messageString.lastIndexOf(di),i=d===-1?this.messageString.length:d,a=this.messageString.substring(0,i),n=this.#r(a);return this.bodyLengthValue=e,this.bodyLengthExpected=e,this.bodyLengthValid=!0,this.checksumValue=n,this.checksumExpected=n,this.checksumValid=!0,this.setField(new V(O.BodyLength,e)),this.setField(new V(O.CheckSum,n)),{bodyLength:e,checksum:n}}validate(e=!0){if(!Me.validateFreeLicense())throw new Error(Me.ERROR_MESSAGE_NO_FREE_LICENSE);return this.#p(this,e)}encode(e=ga){if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);let d=this.data.map(u=>new V(u.tag,u.value)),i=[],a=new V(O.BeginString,this.fixVersion).toString(),n=new V(O.BodyLength,Nc).toString(),r=new V(O.CheckSum,Ac).toString(),o=d.findIndex(u=>u.tag===O.BeginString);if(o>-1){let u=ba(d[o].value);a=new V(O.BeginString,u).toString(),d.splice(o,1)}o=d.findIndex(u=>u.tag===O.BodyLength),o>-1&&(n=d[o].toString(),d.splice(o,1)),o=d.findIndex(u=>u.tag===O.CheckSum),o>-1&&(r=d[o].toString(),d.splice(o,1)),i.push(a),i.push(n),d.forEach(u=>{i.push(u.toString())}),i.push(r);let s=`${i.join(e)}${e}`;s=s.replace(Nc,this.#o(s).toString());let c=s.lastIndexOf(di)===-1?s.length:s.lastIndexOf(di),p=this.#r(s.substring(0,c));return s=s.replace(Ac,p),s}toFIXJSON(){if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);this.#d();let e=this.#e?.getTagsByComponentName("StandardHeader"),d=this.#e?.getTagsByComponentName("StandardTrailer"),i={},a={},n={},r=0,o=[],s=()=>{m();let S=o[r],g=S.parentName==="Body"?a:o.find(y=>y.name===S.parentName);g&&(S.parentName==="Body"?a[S.name]=S.values:g.valueInstance[S.name]=S.values),o.splice(r,1),r--},c=S=>{for(;o.length>0&&!o[r].availableTagsInGroup.has(S.tag);)s()},p=(S,g)=>{let y=o.length>0?o[r].name:"Body",P={name:S.name??`${S.tag}`,parentName:y,availableTagsInGroup:new Set,valueInstanceFirstTag:this.data[g+1].tag,valueInstance:{},values:[]};o.push(P),r=o.length===1?0:r+1;let f=this.#t?.filterMapByNumInGroupId(S.tag,this.messageType);f&&u(f)},u=S=>{if(!S)return;let g=P=>o[r].availableTagsInGroup.add(Number(P.id));S.numInGroup&&g(S.numInGroup),S.fieldRef&&S.fieldRef.forEach(P=>{g(P)});let y=(P,f)=>{P.forEach(E=>{let v=f.find(Number(E.id));v&&u(v)})};S.groupRef&&this.#t&&y(S.groupRef,this.#t),S.componentRef&&this.#e&&y(S.componentRef,this.#e)},m=()=>{let{valueInstance:S,values:g}=o[r];Object.keys(S).length>0&&(g.push(S),o[r].valueInstance={})};return this.data.forEach((S,g)=>{let y=S.tag,P=S.enumeration?.name??S.value,f=S.name??`${S.tag}`;if(e?.includes(y)){i[f]=P;return}if(d?.includes(y)){c(S),n[f]=P;return}if(S?.type?.name==="NumInGroup"){o.length===0||o.length>0&&o[r]?.availableTagsInGroup.has(y)||s(),p(S,g);return}if(o.length>0&&o[r].availableTagsInGroup.has(y)){o[r].valueInstanceFirstTag===y?(m(),o[r].valueInstance[f]=P):o[r].valueInstance={...o[r].valueInstance,[S?.name??String(y)]:P};return}c(S),o[r]?.valueInstanceFirstTag===y&&(m(),o[r].valueInstance[f]=P),o[r]?.availableTagsInGroup.has(y)||(a[f]=P)}),{Header:i,Body:a,Trailer:n}}clone(){let e=new Eu(this.fixVersion,...this.data);return e.messageSequence=this.messageSequence,e.messageType=this.messageType,e}reset(){this.data=[],this.messageString="",this.description="",this.messageType="",this.messageSequence=-1,this.structure=void 0,this.bodyLengthValid=!1,this.checksumValid=!1,this.checksumValue=void 0,this.checksumExpected=void 0,this.bodyLengthValue=void 0,this.bodyLengthExpected=void 0}},Ig=class{fixVersion=xa;message=void 0;messageTags=[];messageString="";fields=new Bc;enums=new xr;proxy=void 0;tlsKey;tlsCert;tlsUseSNI;tlsSkipStdInPipe;skipValidation;processMessage(){let t=gg.exec(this.messageString);if(t&&t.length===2){let e=this.messageString.replace(new RegExp(t[1].replace(Pg,"\\$&"),"g"),ga);this.message&&(this.message.messageString=e),this.messageTags=e.split(ga)}else this.message=void 0,this.messageTags=[]}processFields(){let t,e,d=0,i,a;for(d;d<this.messageTags.length-1;d++)i=this.messageTags[d].indexOf(Sg),t=Number(this.messageTags[d].substring(0,i)),e=this.messageTags[d].substring(i+1),a=new V(t,e),this.fields.processField(this.message,a),this.enums.processEnum(a),a.tag===O.BeginString?this.message.fixVersion=String(a.value):a.tag===O.BodyLength?this.message?.validateBodyLength(e):a.tag===O.CheckSum&&this.message?.validateChecksum(e),this.message?.addField(a)}parse(t){if(!Me.validateFreeLicense())throw new Error(Me.ERROR_MESSAGE_NO_FREE_LICENSE);let e=0,d=t?t.split(/(?<!\d)8=FIX/):[],i=[];for(e;e<d.length;e++)this.message=new Fu(this.fixVersion),this.messageString=`8=FIX${d[e]}`,this.messageString.indexOf(ga)>-1?(this.message.messageString=this.messageString,this.messageTags=this.messageString.split(ga)):this.processMessage(),this.message&&(this.skipValidation||this.processFields(),i.push(this.message));return i}},bg=class{format;useStderr;constructor({format:t="json",useStderr:e=!1}){this.format=t,this.useStderr=e}configure(t){this.format=t.format||"json",t.useStderr!==void 0&&(this.useStderr=t.useStderr)}async send(t){let e=this.useStderr?console.error:console.log;if(this.format==="json")e(JSON.stringify(t));else if(this.format==="jsonrpc"){let{message:d,...i}=t,a={jsonrpc:"2.0",method:t.level,params:{message:d,...i}};e(JSON.stringify(a))}else{let{name:d,id:i,message:a,level:n,...r}=t,o=Object.entries(r).map(([c,p])=>`${c}: ${p}`),s="";d&&(s+=`${d} `),s+=`${i}: ${a}`,e(s,o.join(", "))}}async flush(){}async close(){}status(){return"connected"}},Fg=(t,e)=>e==="error"&&t.level==="error"||e==="warn"&&(t.level==="error"||t.level==="warn")?!0:e==="info"&&(t.level==="error"||t.level==="warn"||t.level==="info"),Mc=class{name;id;#n=!0;#i;#a;#e;constructor(t){this.name=t?.name??"",this.id=t?.id??Zu(),this.#e=t?.level??"info",this.#e=t?.level??"info",this.#a=t?.format??"json",this.#i=t?.transport??new bg({format:this.#a})}processMessage(t){if(this.#e==="silent"||!this.#n)return this;if(!Fg(t,this.#e))return this;let e={name:this.name,id:this.id,timestamp:Date.now(),...t};return this.#i.send(e),this}log(t){return this.processMessage({...t,level:t.level?t.level:"info"})}logWarning(t){return this.processMessage({...t,level:"warn"})}logError(t){return this.processMessage({...t,level:"error"})}set silent(t){this.#e=t?"silent":"info"}get silent(){return this.#e==="silent"}get level(){return this.#e}get format(){return this.#a}},Zg=Object.freeze({CarriedCustomerSide:1,CarriedNonCustomerSide:2,HouseTrader:3,FloorTrader:4,CarriedNonCustomerSideCrossMargined:6,HouseTraderCrossMargined:7,JointBackOfficeAccount:8,EquitiesSpecialist:9,OptionsMarketMaker:10,OptionsFirmAccount:11,AccountCustomerNonCustomerOrders:12,AccountOrdersMultipleCustomers:13}),eh=Object.freeze({BIC:1,SIDCode:2,TFM:3,OMGEO:4,DTCCCode:5,SPSAID:6,Other:99}),th=Object.freeze({Cancel:1,Error:2,Correction:3}),dh=Object.freeze({ProcessRequestAsMarginDisposition:0,DeltaPlus:1,DeltaMinus:2,Final:3,CustomerSpecificPosition:4}),ih=Object.freeze({Buy:"B",Sell:"S",Trade:"T",Cross:"X"}),ah=Object.freeze({New:"N",Cancel:"C",Replace:"R"}),nh=Object.freeze({Received:1,ConfirmRejected:2,Affirmed:3}),rh=Object.freeze({BookEntriesToBeAggregated:"Y",BookEntriesShouldNotBeAggregated:"N"}),oh=Object.freeze({OrderInitiatorIsAggressor:"Y",OrderInitiatorIsPassive:"N"}),sh=Object.freeze({Received:0,Accepted:1,Rejected:2}),ch=Object.freeze({New:0,Cancel:1,Replace:2}),ph=Object.freeze({CertificateInformation:0,CertificateStateChanged:1}),lh=Object.freeze({Received:0,Accepted:1,Rejected:2}),uh=Object.freeze({New:0,Cancel:1,Replace:2}),mh=Object.freeze({CertificateInformation:0,GenerateCertificate:1,ChangeCertificateStatus:2,ForwardCertificate:3}),yh=Object.freeze({Draft:0,Approved:1,Submitted:2,Registered:3}),Sh=Object.freeze({NonAlgorithmicTrade:0,AlgorithmicTrade:1}),Ph=Object.freeze({CarriedCustomerSide:1,CarriedNonCustomerSide:2,HouseTrader:3,FloorTrader:4,CarriedNonCustomerSideCrossMargined:6,HouseTraderCrossMargined:7,JointBackOfficeAccount:8}),gh=Object.freeze({Rollup:0,DoNotRollUp:1}),hh=Object.freeze({OriginalDetailsIncomplete:1,ChangeInUnderlyingOrderDetails:2,CancelledByGiveupFirm:3,Other:99}),fh=Object.freeze({Added:0,Canceled:1,Replaced:2,Changed:3,Pending:4}),Ih=Object.freeze({TradeType:1,TradePublicationIndicator:2,OrderHandlingInstruction:3}),bh=Object.freeze({Match:1,Forward:2,ForwardAndMatch:3,AutoClaimGiveUp:4}),Fh=Object.freeze({PendingAccept:1,PendingRelease:2,PendingReversal:3,Accept:4,BlockLevelReject:5,AccountLevelReject:6}),Eh=Object.freeze({FXNetting:0,FXSwap:1}),vh=Object.freeze({Automatic:1,Guarantor:2,Manual:3,BrokerAssigned:4}),Ch=Object.freeze({NotSpecified:0,ExplicitListProvided:1}),Xh=Object.freeze({Open:"O",Close:"C",Rolled:"R",FIFO:"F"}),Th=Object.freeze({UnknownAccount:0,IncorrectQuantity:1,IncorrectAveragePrice:2,UnknownExecutingBrokerMnemonic:3,CommissionDifference:4,UnknownOrderID:5,UnknownListID:6,OtherSeeText:7,IncorrectAllocatedQuantity:8,CalculationDifference:9,UnknownOrStaleExecID:10,MismatchedData:11,UnknownClOrdID:12,WarehouseRequestRejected:13,DuplicateOrMissingIndividualAllocID:14,TradeNotRecognized:15,DuplicateTrade:16,IncorrectOrMissingInstrument:17,IncorrectOrMissingSettlDate:18,IncorrectOrMissingFundIDOrFundName:19,IncorrectOrMissingSettlInstructions:20,IncorrectOrMissingFees:21,IncorrectOrMissingTax:22,UnknownOrMissingParty:23,IncorrectOrMissingSide:24,IncorrectOrMissingNetMoney:25,IncorrectOrMissingTradeDate:26,IncorrectOrMissingSettlCcyInstructions:27,IncorrectOrMissingProcessCode:28,Other:99}),Dh=Object.freeze({PreliminaryRequestToIntermediary:2,SellsideCalculatedUsingPreliminary:3,SellsideCalculatedWithoutPreliminary:4,WarehouseRecap:5,RequestToIntermediary:8,Accept:9,Reject:10,AcceptPending:11,Complete:12,ReversePending:14,Giveup:15,Takeup:16,Reversal:17,Alleged:18,SubAllocationGiveup:19}),Rh=Object.freeze({Accepted:0,Rejected:1}),Nh=Object.freeze({Completed:0,Refused:1,Cancelled:2}),Ah=Object.freeze({UseDefaultInstructions:0,DeriveFromParametersProvided:1,FullDetailsProvided:2,SSIDBIDsProvided:3,PhoneForInstructions:4}),wh=Object.freeze({Accepted:0,BlockLevelReject:1,AccountLevelReject:2,Received:3,Incomplete:4,RejectedByIntermediary:5,AllocationPending:6,Reversed:7,CancelledByIntermediary:8,Claimed:9,Refused:10,PendingGiveUpApproval:11,Cancelled:12,PendingTakeUpApproval:13,ReversalPending:14}),Mh=Object.freeze({New:"0",Replace:"1",Cancel:"2",Reversal:"6"}),xh=Object.freeze({Calculated:1,Preliminary:2,ReadyToBook:5,WarehouseInstruction:7,RequestToIntermediary:8,Accept:9,Reject:10,AcceptPending:11,IncompleteGroup:12,CompleteGroup:13,ReversalPending:14,ReopenGroup:15,CancelGroup:16,Giveup:17,Takeup:18,RefuseTakeup:19,InitiateReversal:20,Reverse:21,RefuseReversal:22,SubAllocationGiveup:23,ApproveGiveup:24,ApproveTakeup:25,NotionalValueAveragePxGroupAlloc:26}),Lh=Object.freeze({NoApplRecoveryNeeded:0,ApplRecoveryNeeded:1}),Oh=Object.freeze({NoActionTaken:0,QueueFlushed:1,OverlayLast:2,EndSession:3}),Uh=Object.freeze({NoActionTaken:0,QueueFlushed:1,OverlayLast:2,EndSession:3}),kh=Object.freeze({ApplSeqNumReset:0,LastMessageSent:1,ApplicationAlive:2,ResendComplete:3}),qh=Object.freeze({Retransmission:0,Subscription:1,RequestLastSeqNum:2,RequestApplications:3,Unsubscribe:4,CancelRetransmission:5,CancelRetransmissionUnsubscribe:6}),Bh=Object.freeze({ApplicationDoesNotExist:0,MessagesRequestedAreNotAvailable:1,UserNotAuthorizedForApplication:2}),jh=Object.freeze({RequestSuccessfullyProcessed:0,ApplicationDoesNotExist:1,MessagesNotAvailable:2}),Gh=Object.freeze({False:"0",True:"1"}),Qh=Object.freeze({InterestRate:1,Currency:2,Credit:3,Equity:4,Commodity:5,Other:6,Cash:7,Debt:8,Fund:9,LoanFacility:10,Index:11}),Vh=Object.freeze({Financials:1,Commodities:2,AlternativeInvestments:3}),zh=Object.freeze({SingleCurrency:1,CrossCurrency:2,Basket:3,SingleName:4,CreditIndex:5,IndexTranche:6,CreditBasket:7,Exotic:8,Common:9,Preferred:10,EquityIndex:11,EquityBasket:12,Metals:13,Bullion:14,Energy:15,CommodityIndex:16,Agricultural:17,Environmental:18,Freight:19,Government:20,Agency:21,Corporate:22,Financing:23,MoneyMarket:24,Mortgage:25,Municipal:26,MutualFund:27,CollectiveInvestmentVehicle:28,InvestmentProgram:29,SpecializedAccountProgram:30,TermLoan:31,BridgeLoan:32,LetterOfCredit:33,DividendIndex:34,StockDividend:35,ExchangeTradedFund:36,VolatilityIndex:37,FXCrossRates:38,FXEmergingMarkets:39,FXMajors:40,Fertilizer:41,IndustrialProduct:42,Inflation:43,Paper:44,Polypropylene:45,OfficialEconomicStatistics:46,OtherC10:47,Other:48}),Hh=Object.freeze({BlackScholes:1,Whaley:2,Bachelier:3,Kirk:4,Curran:5,Black76:6,Binomial:7,OtherModel:99}),Wh=Object.freeze({ProRata:"P",Random:"R"}),Kh=Object.freeze({Base64:0,RawBinary:1}),Yh=Object.freeze({AutomatedAuctionPermitted:0,AutomatedAuctionNotPermitted:1}),_h=Object.freeze({None:0,BlockOrderAuction:1,DirectedOrderAuction:2,ExposureOrderAuction:3,FlashOrderAuction:4,FacilitationOrderAuction:5,SolicitationOrderAuction:6,PriceImprovementMechanism:7,DirectedOrderPriceImprovementMechanism:8}),Jh=Object.freeze({TimeWeightedAveragePrice:0,VolumeWeightedAveragePrice:1,PercentOfVolumeAveragePrice:2,LimitOrderAveragePrice:3}),$h=Object.freeze({NoAveragePricing:0,Trade:1,LastTrade:2,NotionalValueAveragePxGroupTrade:3,AveragePricedTrade:4}),Zh=Object.freeze({ClosingPriceAtMorningSession:"2",ClosingPrice:"3",CurrentPrice:"4",SQ:"5",VWAPThroughADay:"6",VWAPThroughAMorningSession:"7",VWAPThroughAnAfternoonSession:"8",VWAPThroughADayExcept:"9",VWAPThroughAMorningSessionExcept:"A",VWAPThroughAnAfternoonSessionExcept:"B",Strike:"C",Open:"D",Others:"Z"}),ef=Object.freeze({Update:0,Snapshot:1}),tf=Object.freeze({FIX42:"FIX.4.2",FIX44:"FIX.4.4",FIXT11:"FIXT.1.1"}),df=Object.freeze({CURVE:"1",FiveYR:"2",OLD5:"3",TenYR:"4",OLD10:"5",ThirtyYR:"6",OLD30:"7",ThreeMOLIBOR:"8",SixMOLIBOR:"9"}),af=Object.freeze({EONIA:"EONIA",EUREPO:"EUREPO",Euribor:"Euribor",FutureSWAP:"FutureSWAP",LIBID:"LIBID",LIBOR:"LIBOR",MuniAAA:"MuniAAA",OTHER:"OTHER",Pfandbriefe:"Pfandbriefe",SONIA:"SONIA",SWAP:"SWAP",Treasury:"Treasury",FedFundRateEffective:"FEDEFF",FedOpen:"FEDOPEN",EURIBOR:"EURIBOR",AUBSW:"AUBSW",BUBOR:"BUBOR",CDOR:"CDOR",CIBOR:"CIBOR",EONIASWAP:"EONIASWAP",ESTR:"ESTR",EURODOLLAR:"EURODOLLAR",EUROSWISS:"EUROSWISS",GCFREPO:"GCFREPO",ISDAFIX:"ISDAFIX",JIBAR:"JIBAR",MOSPRIM:"MOSPRIM",NIBOR:"NIBOR",PRIBOR:"PRIBOR",SOFR:"SOFR",STIBOR:"STIBOR",TELBOR:"TELBOR",TIBOR:"TIBOR",WIBOR:"WIBOR",AONIA:"AONIA",AONIAR:"AONIA-R",BKBM:"BKBM",CD91D:"CD91D",CORRA:"CORRA",DIRRTN:"DIRR-TN",EIBOR:"EIBOR",FixingRepoRate:"FixingRepoRate",HIBOR:"HIBOR",IBR:"IBR",KLIBOR:"KLIBOR",MIBOR:"MIBOR",NZONIA:"NZONIA",PHIREF:"PHIREF",REIBOR:"REIBOR",SAIBOR:"SAIBOR",SARON:"SARON",SORA:"SORA",TLREF:"TLREF",TIIE:"TIIE",THBFIX:"THBFIX",TONAR:"TONAR"}),nf=Object.freeze({Sector:1,Country:2,Index:3}),rf=Object.freeze({Cancel:"C",New:"N"}),of=Object.freeze({Agency:"A",VWAPGuarantee:"G",GuaranteedClose:"J",RiskTrade:"R"}),sf=Object.freeze({NonDisclosed:1,Disclosed:2,NoBiddingProcess:3}),cf=Object.freeze({BlockToBeAllocated:0,BlockNotToBeAllocated:1,AllocatedTrade:2}),pf=Object.freeze({RegularBooking:0,CFD:1,TotalReturnSwap:2}),lf=Object.freeze({EachPartialExecutionIsABookableUnit:"0",AggregatePartialExecutionsOnThisOrder:"1",AggregateExecutionsForThisSymbol:"2"}),uf=Object.freeze({NotApplicable:0,None:1,FollowingDay:2,FloatingRateNote:3,ModifiedFollowingDay:4,PrecedingDay:5,ModifiedPrecedingDay:6,NearestDay:7}),mf=Object.freeze({Other:0,UnknownID:1,UnknownSecurity:2,UnsupportedMessageType:3,ApplicationNotAvailable:4,ConditionallyRequiredFieldMissing:5,NotAuthorized:6,DeliverToFirmNotAvailableAtThisTime:7,ThrottleLimitExceeded:8,ThrottleLimitExceededSessionDisconnected:9,ThrottledMessagesRejectedOnRequest:10,InvalidPriceIncrement:18}),yf=Object.freeze({Automatic:0,Manual:1}),Sf=Object.freeze({Yes:"Y",NoExecutionOnly:"N",NoWaiverAgreement:"M",NoInstitutional:"O"}),Pf=Object.freeze({Cash:"1",MarginOpen:"2",MarginClose:"3"}),gf=Object.freeze({Close:0,Hedge:1}),hf=Object.freeze({Bid:0,Mid:1,Offer:2}),ff=Object.freeze({Market:0,Highest:1,AverageMarket:2,AverageHighest:3,BlendedMarket:4,BlendedHighest:5,AverageBlendedMarket:6,AverageBlendedHighest:7}),If=Object.freeze({NotCleared:0,Cleared:1,Submitted:2,Rejected:3}),bf=Object.freeze({Customer:1,Firm:2,MarketMaker:3}),Ff=Object.freeze({FirstYearDelegate:"1",SecondYearDelegate:"2",ThirdYearDelegate:"3",FourthYearDelegate:"4",FifthYearDelegate:"5",SixthYearDelegate:"9",CBOEMember:"B",NonMemberAndCustomer:"C",EquityMemberAndClearingMember:"E",FullAndAssociateMember:"F",Firms106HAnd106J:"H",GIM:"I",Lessee106FEmployees:"L",AllOtherOwnershipTypes:"M"}),Ef=Object.freeze({ProcessNormally:0,ExcludeFromAllNetting:1,BilateralNettingOnly:2,ExClearing:3,SpecialTrade:4,MultilateralNetting:5,ClearAgainstCentralCounterparty:6,ExcludeFromCentralCounterparty:7,ManualMode:8,AutomaticPostingMode:9,AutomaticGiveUpMode:10,QualifiedServiceRepresentativeQSR:11,CustomerTrade:12,SelfClearing:13,BuyIn:14}),vf=Object.freeze({DoNotIntendToClear:0,IntendToClear:1}),Cf=Object.freeze({NoException:0,Exception:1,EndUserException:2,InterAffiliateException:3,TreasuryAffiliateException:4,CooperativeException:5}),Xf=Object.freeze({Retain:0,Add:1,Remove:2}),Tf=Object.freeze({SpecificDeposit:0,General:1}),Df=Object.freeze({Initial:0,Scheduled:1,TimeWarning:2,MarginDeficiency:3,MarginExcess:4,ForwardCollateralDemand:5,EventOfDefault:6,AdverseTaxEvent:7,TransferDeposit:8,TransferWithdrawal:9,Pledge:10}),Rf=Object.freeze({UnknownDeal:0,UnknownOrInvalidInstrument:1,UnauthorizedTransaction:2,InsufficientCollateral:3,InvalidTypeOfCollateral:4,ExcessiveSubstitution:5,Other:99}),Nf=Object.freeze({Received:0,Accepted:1,Declined:2,Rejected:3,TransactionPending:4,TransactionCompletedWithWarning:5}),Af=Object.freeze({New:0,Replace:1,Cancel:2,Release:3,Reverse:4}),wf=Object.freeze({MarketValuation:0,PortfolioValue:1,ValueConfirmed:2,CollateralCreditValue:3,AdditionalCollateralValue:4,EstimatedMarketValuation:5}),Mf=Object.freeze({MoneyMarketFund:0,OtherComingledPool:1,RepoMarket:2,DirectPurchaseOfSecurities:3,OtherInvestments:4}),xf=Object.freeze({TradeDate:0,GCInstrument:1,CollateralInstrument:2,SubstitutionEligible:3,NotAssigned:4,PartiallyAssigned:5,FullyAssigned:6,OutstandingTrades:7}),Lf=Object.freeze({Successful:0,InvalidOrUnknownInstrument:1,InvalidOrUnknownCollateralType:2,InvalidParties:3,InvalidTransportTypeRequested:4,InvalidDestinationRequested:5,NoCollateralFoundForTheTradeSpecified:6,NoCollateralFoundForTheOrderSpecified:7,CollateralInquiryTypeNotSupported:8,UnauthorizedForCollateralInquiry:9,Other:99}),Of=Object.freeze({Accepted:0,AcceptedWithWarnings:1,Completed:2,CompletedWithWarnings:3,Rejected:4}),Uf=Object.freeze({UnknownTrade:0,UnknownInstrument:1,UnknownCounterparty:2,UnknownPosition:3,UnacceptableCollateral:4,Other:99}),kf=Object.freeze({Accepted:0,Received:1,Rejected:2}),qf=Object.freeze({Unassigned:0,PartiallyAssigned:1,AssignmentProposed:2,Assigned:3,Challenged:4,Reused:5}),Bf=Object.freeze({ResearchPaymentAccount:0,CommissionSharingAgreement:1,OtherTypeResearchPayment:2}),jf=Object.freeze({Unspecified:0,Acceptance:1,Broker:2,ClearingBroker:3,Retail:4,SalesCommission:5,LocalCommission:6,ResearchPayment:7}),Gf=Object.freeze({ArgusMcCloskey:0,Baltic:1,Exchange:2,GlobalCoal:3,IHSMcCloskey:4,Platts:5,Other:99}),Qf=Object.freeze({PerUnit:"1",Percent:"2",Absolute:"3",PercentageWaivedCashDiscount:"4",PercentageWaivedEnhancedUnits:"5",PointsPerBondOrContract:"6",BasisPoints:"7",AmountPerContract:"8"}),Vf=Object.freeze({And:1,Or:2}),zf=Object.freeze({SellerNotifies:0,BuyerNotifies:1,SellerOrBuyerNotifies:2}),Hf=Object.freeze({Business:0,Calendar:1,CommodityBusiness:2,CurrencyBusiness:3,ExchangeBusiness:4,ScheduledTradingDay:5}),Wf=Object.freeze({AsianOut:0,AsianIn:1,BarrierCap:2,BarrierFloor:3,KnockOut:4,KnockIn:5}),Kf=Object.freeze({LessThanComplexEventPrice:1,LessThanOrEqualToComplexEventPrice:2,EqualToComplexEventPrice:3,GreaterThanOrEqualToComplexEventPrice:4,GreaterThanComplexEventPrice:5}),Yf=Object.freeze({Expiration:1,Immediate:2,SpecifiedDate:3,Close:4,Open:5,OfficialSettlPrice:6,DerivativesClose:7,AsSpecifiedMasterConfirmation:8}),_f=Object.freeze({Close:0,HedgeElection:1}),Jf=Object.freeze({Currency1PerCurrency2:0,Currency2PerCurrency1:1}),$f=Object.freeze({Capped:1,Trigger:2,KnockInUp:3,KnockInDown:4,KnockOutUp:5,KnockOutDown:6,Underlying:7,ResetBarrier:8,RollingBarrier:9,OneTouch:10,NoTouch:11,DblOneTouch:12,DblNoTouch:13,FXComposite:14,FXQuanto:15,FXCrssCcy:16,StrkSpread:17,ClndrSpread:18,PxObsvtn:19,PassThrough:20,StrkSched:21,EquityValuation:22,DividendValuation:23}),Zf=Object.freeze({Close:0,Open:1,OfficialSettl:2,ValuationTime:3,ExcahgneSettlTime:4,DerivativesClose:5,AsSpecified:6}),eI=Object.freeze({NonElectronic:0,Electronic:1,Unconfirmed:2}),tI=Object.freeze({MismatchedAccount:1,MissingSettlementInstructions:2,UnknownOrMissingIndividualAllocId:3,TransactionNotRecognized:4,DuplicateTransaction:5,IncorrectOrMissingInstrument:6,IncorrectOrMissingPrice:7,IncorrectOrMissingCommission:8,IncorrectOrMissingSettlDate:9,IncorrectOrMissingFundIDOrFundName:10,IncorrectOrMissingQuantity:11,IncorrectOrMissingFees:12,IncorrectOrMissingTax:13,IncorrectOrMissingParty:14,IncorrectOrMissingSide:15,IncorrectOrMissingNetMoney:16,IncorrectOrMissingTradeDate:17,IncorrectOrMissingSettlCcyInstructions:18,IncorrectOrMissingCapacity:19,Other:99}),dI=Object.freeze({Received:1,MismatchedAccount:2,MissingSettlementInstructions:3,Confirmed:4,RequestRejected:5}),iI=Object.freeze({New:0,Replace:1,Cancel:2}),aI=Object.freeze({Status:1,Confirmation:2,ConfirmationRequestRejected:3}),nI=Object.freeze({CommissionAmount:1,CommissionPercent:2,InitialChargeAmount:3,InitialChargePercent:4,DiscountAmount:5,DiscountPercent:6,DilutionLevyAmount:7,DilutionLevyPercent:8,ExitChargeAmount:9,ExitChargePercent:10,FundBasedRenewalCommissionPercent:11,ProjectedFundValue:12,FundBasedRenewalCommissionOnOrder:13,FundBasedRenewalCommissionOnFund:14,NetSettlementAmount:15}),rI=Object.freeze({OneCancelsTheOther:1,OneTriggersTheOther:2,OneUpdatesTheOtherAbsolute:3,OneUpdatesTheOtherProportional:4,BidAndOffer:5,BidAndOfferOCO:6}),oI=Object.freeze({Shares:0,Hours:1,Days:2}),sI=Object.freeze({TwoComponentIntercommoditySpread:0,IndexOrBasket:1,TwoComponentLocationBasis:2,Other:99}),cI=Object.freeze({ExDividend:"A",ExDistribution:"B",ExRights:"C",New:"D",ExInterest:"E",CashDividend:"F",StockDividend:"G",NonIntegerStockSplit:"H",ReverseStockSplit:"I",StandardIntegerStockSplit:"J",PositionConsolidation:"K",LiquidationReorganization:"L",MergerReorganization:"M",RightsOffering:"N",ShareholderMeeting:"O",Spinoff:"P",TenderOffer:"Q",Warrant:"R",SpecialAction:"S",SymbolConversion:"T",CUSIP:"U",LeapRollover:"V",SuccessionEvent:"W"}),pI=Object.freeze({OneOne:0,ThirtyThreeSixtyUS:1,ThirtyThreeSixtySIA:2,ThirtyThreeSixtyM:3,ThirtyEThreeSixty:4,ThirtyEThreeSixtyISDA:5,ActThreeSixty:6,ActThreeSixtyFiveFixed:7,ActActAFB:8,ActActICMA:9,ActActISMAUltimo:10,ActActISDA:11,BusTwoFiftyTwo:12,ThirtyEPlusThreeSixty:13,ActThreeSixtyFiveL:14,NLThreeSixtyFive:15,NLThreeSixty:16,Act364:17,ThirtyThreeSixtyFive:18,ThirtyActual:19,ThirtyThreeSixtyICMA:20,ThirtyETwoThreeSixty:21,ThirtyEThreeThreeSixty:22,Other:99}),lI=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr",Hour:"H",Minute:"Min",Second:"S",Term:"T"}),uI=Object.freeze({Zero:0,FixedRate:1,FloatingRate:2,Structured:3}),mI=Object.freeze({Covered:0,Uncovered:1}),yI=Object.freeze({Program3a3:1,Program42:2,Program3a2:3,Program3a3And3c7:4,Program3a4:5,Program3a5:6,Program3a7:7,Program3c7:8,Other:99}),SI=Object.freeze({NoCross:0,CrossRejected:1,CrossAccepted:2}),PI=Object.freeze({None:0,BuySideIsPrioritized:1,SellSideIsPrioritized:2}),gI=Object.freeze({CrossAON:1,CrossIOC:2,CrossOneSide:3,CrossSamePrice:4,BasisCross:5,ContingentCross:6,VWAPCross:7,STSCross:8,CustomerToCustomer:9}),hI=Object.freeze({CUSIP:"1",SEDOL:"2",ISINNumber:"4",ISOCurrencyCode:"6",FinancialInstrumentGlobalIdentifier:"S",DigitalTokenIdentifier:"Y"}),fI=Object.freeze({MemberTradingForTheirOwnAccount:1,ClearingFirmTradingForItsProprietaryAccount:2,MemberTradingForAnotherMember:3,AllOther:4,RetailCustomer:5}),II=Object.freeze({PhoneSimple:"A",GOrderAndFCMAPIorFIX:"G",PhoneComplex:"B",AddOnOrder:"ADD",FCMProvidedScreen:"C",AllOrNone:"AON",OtherProvidedScreen:"D",ConditionalOrder:"CND",ClientProvidedPlatformControlledByFCM:"E",CashNotHeld:"CNH",ClientProvidedPlatformDirectToExchange:"F",DeliveryInstructionsCash:"CSH",DirectedOrder:"DIR",AlgoEngine:"H",DiscretionaryLimitOrder:"DLO",PriceAtExecution:"J",ExchangeForPhysicalTransaction:"E.W",DeskElectronic:"W",FillOrKill:"FOK",DeskPit:"X",ClientElectronic:"Y",IntraDayCross:"IDX",ClientPit:"Z",ImbalanceOnly:"IO",ImmediateOrCancel:"IOC",IntermarketSweepOrder:"ISO",LimitOnOpen:"LOO",LimitOnClose:"LOC",MarketAtOpen:"MAO",MarketAtClose:"MAC",MarketOnOpen:"MOO",MarketOnClose:"MOC",MergerRelatedTransferPosition:"MPT",MinimumQuantity:"MQT",MarketToLimit:"MTL",DeliveryInstructionsNextDay:"ND",NotHeld:"NH",OptionsRelatedTransaction:"OPT",OverTheDay:"OVD",Pegged:"PEG",ReserveSizeOrder:"RSV",StopStockTransaction:"S.W",Scale:"SCL",DeliveryInstructionsSellersOption:"SLR",TimeOrder:"TMO",TrailingStop:"TS",Work:"WRK",StayOnOfferside:"F0",GoAlong:"F3",ParticipateDoNotInitiate:"F6",StrictScale:"F7",TryToScale:"F8",StayOnBidside:"F9",NoCross:"FA",OKToCross:"FB",CallFirst:"FC",PercentOfVolume:"FD",ReinstateOnSystemFailure:"FH",InstitutionOnly:"FI",ReinstateOnTradingHalt:"FJ",CancelOnTradingHalf:"FK",LastPeg:"FL",MidPricePeg:"FM",NonNegotiable:"FN",OpeningPeg:"FO",MarketPeg:"FP",CancelOnSystemFailure:"FQ",PrimaryPeg:"FR",Suspend:"FS",FixedPegToLocalBBO:"FT",PegToVWAP:"FW",TradeAlong:"FX",TryToStop:"FY",CancelIfNotBest:"FZ",StrictLimit:"Fb",IgnorePriceValidityChecks:"Fc",PegToLimitPrice:"Fd",WorkToTargetStrategy:"Fe"}),bI=Object.freeze({Customer:0,Firm:1}),FI=Object.freeze({NoPriority:0,UnconditionalPriority:1}),EI=Object.freeze({TooLateToCancel:0,UnknownOrder:1,BrokerCredit:2,OrderAlreadyInPendingStatus:3,UnableToProcessOrderMassCancelRequest:4,OrigOrdModTime:5,DuplicateClOrdID:6,PriceExceedsCurrentPrice:7,PriceExceedsCurrentPriceBand:8,InvalidPriceIncrement:18,Other:99}),vI=Object.freeze({OrderCancelRequest:"1",OrderCancelReplaceRequest:"2"}),CI=Object.freeze({FirstDay:"1",SecondDay:"2",ThirdDay:"3",FourthDay:"4",FifthDay:"5",SixthDay:"6",SeventhDay:"7",EighthDay:"8",NinthDay:"9",TenthDay:"10",EleventhDay:"11",TwelvthDay:"12",ThirteenthDay:"13",ForteenthDay:"14",FifteenthDay:"15",SixteenthDay:"16",SeventeenthDay:"17",EighteenthDay:"18",NineteenthDay:"19",TwentiethDay:"20",TwentyFirstDay:"21",TwentySecondDay:"22",TwentyThirdDay:"23",TwentyFourthDay:"24",TwentyFifthDay:"25",TwentySixthDay:"26",TwentySeventhDay:"27",TwentyEigthDa28y:"28",TwentyNinthDay:"29",ThirtiethDay:"30",EOM:"EOM",FRN:"FRN",IMM:"IMM",IMMCAD:"IMMCAD",IMMAUD:"IMMAUD",IMMNZD:"IMMNZD",SFE:"SFE",NONE:"NONE",TBILL:"TBILL",MON:"MON",TUE:"TUE",WED:"WED",THU:"THU",FRI:"FRI",SAT:"SAT",SUN:"SUN"}),XI=Object.freeze({Auto:"0",SpeakWithOrderInitiatorBeforeBooking:"1",Accumulate:"2"}),TI=Object.freeze({Agent:"A",Principal:"P",RisklessPrincipal:"R"}),DI=Object.freeze({Cancellation:"0",Error:"1"}),RI=Object.freeze({BookEntry:1,Bearer:2}),NI=Object.freeze({Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6,Sunday:7,AllWeekdays:8,AllDays:9,AllWeekends:10}),AI=Object.freeze({AllTimes:0,OnPeak:1,OffPeak:2,Base:3,BlockHours:4,Other:5}),wI=Object.freeze({DoNotIncludeHolidays:0,IncludeHolidays:1}),MI=Object.freeze({Hour:0,Timestamp:1}),xI=Object.freeze({Absolute:0,Percentage:1}),LI=Object.freeze({Notional:0,Delivery:1,PhysicalSettlPeriods:2}),OI=Object.freeze({Proprietary:0,EIC:1}),UI=Object.freeze({Firm:1,NonFirm:2,ForceMajeure:3,SystemFirm:4,UnitFirm:5}),kI=Object.freeze({Buyer:0,Seller:1}),qI=Object.freeze({Transfers:0,DoesNotTransfer:1}),BI=Object.freeze({Buyer:1,Seller:2}),jI=Object.freeze({Periodic:0,Initial:1,Single:2}),GI=Object.freeze({VersusPayment:0,Free:1,TriParty:2,HoldInCustody:3,DeliverByValue:4}),QI=Object.freeze({Agency:"A",Arbitrage:"AR",BlockTrading:"B",ConvertibleDesk:"C",CentralRiskBooks:"CR",Derivatives:"D",EquityCapitalMarkets:"EC",International:"IN",Institutional:"IS",Other:"O",PreferredTrading:"PF",Proprietary:"PR",ProgramTrading:"PT",Sales:"S",Swaps:"SW",TradingDeskSystem:"T",Treasury:"TR",FloorBroker:"FB"}),VI=Object.freeze({FINRAOATS:1}),zI=Object.freeze({No:0,Yes:1,UseDefaultSetting:2}),HI=Object.freeze({Volume:1,Price:2,Side:3,AON:4,General:5,ClearingAccount:6,CMTAAccount:7}),WI=Object.freeze({RelatedToDisplayedPrice:"0",RelatedToMarketPrice:"1",RelatedToPrimaryPrice:"2",RelatedToLocalPrimaryPrice:"3",RelatedToMidpointPrice:"4",RelatedToLastTradePrice:"5",RelatedToVWAP:"6",AveragePriceGuarantee:"7"}),KI=Object.freeze({OrBetter:0,Strict:1,OrWorse:2}),YI=Object.freeze({Floating:0,Fixed:1}),_I=Object.freeze({Price:0,BasisPoints:1,Ticks:2,PriceTier:3}),JI=Object.freeze({MoreAggressive:1,MorePassive:2}),$I=Object.freeze({Local:1,National:2,Global:3,NationalExcludingLocal:4}),ZI=Object.freeze({Initial:"1",New:"2",Random:"3",Undisclosed:"4"}),e4=Object.freeze({Immediate:"1",Exhaust:"2"}),t4=Object.freeze({CREST:1,NSCC:2,Euroclear:3,Clearstream:4,Cheque:5,TelegraphicTransfer:6,FedWire:7,DirectCredit:8,ACHCredit:9,BPAY:10,HighValueClearingSystemHVACS:11,ReinvestInFund:12,Other:999}),d4=Object.freeze({RecordAmount:0,ExAmount:1,PaidAmount:2,PerMasterConfirm:3}),i4=Object.freeze({EquityAmountReceiver:0,CalculationAgent:1}),a4=Object.freeze({ExDate:0,RecordDate:1}),n4=Object.freeze({UnknownSymbol:"A",WrongSide:"B",QuantityExceedsOrder:"C",NoMatchingOrder:"D",PriceExceedsLimit:"E",CalculationDifference:"F",NoMatchingExecutionReport:"G",Other:"Z"}),r4=Object.freeze({Cash:"C",Securities:"S"}),o4=Object.freeze({NotRelatedToSecurityHalt:"N",RelatedToSecurityHalt:"Y"}),s4=Object.freeze({UniqueClOrdID:"N",DuplicateClOrdID:"Y"}),c4=Object.freeze({New:"0",Reply:"1",AdminReply:"2"}),ds=Object.freeze({None:0,PKCS:1,DES:2,PKCSDES:3,PGPDES:4,PGPDESMD5:5,PEM:6}),p4=Object.freeze({Int:1,Length:2,NumInGroup:3,SeqNum:4,TagNum:5,Float:6,Qty:7,Price:8,PriceOffset:9,Amt:10,Percentage:11,Char:12,Boolean:13,String:14,MultipleCharValue:15,Currency:16,Exchange:17,MonthYear:18,UTCTimestamp:19,UTCTimeOnly:20,LocalMktDate:21,UTCDateOnly:22,Data:23,MultipleStringValue:24,Country:25,Language:26,TZTimeOnly:27,TZTimestamp:28,Tenor:29,DayOfMonth:30,XMLData:31,Pattern:32,Reserved100Plus:33,Reserved1000Plus:34,Reserved4000Plus:35}),l4=Object.freeze({Successful:0,InvalidParty:1,InvalidRelatedParty:2,InvalidEntitlementType:3,InvalidEntitlementID:4,InvalidEntitlementAttribute:5,InvalidInstrumentScope:6,InvalidMarketSegmentScope:7,InvalidStartDate:8,InvalidEndDate:9,InstrumentScopeNotSupported:10,MarketSegmentScopeNotSupported:11,EntitlementNotApprovedForParty:12,EntitlementAlreadyDefinedForParty:13,InstrumentNotApprovedForParty:14,NotAuthorized:98,Other:99}),u4=Object.freeze({Accepted:0,AcceptedWithChanges:1,Rejected:2,Pending:3,Requested:4,Deferred:5}),m4=Object.freeze({OrderEntry:1,HItLift:2,ViewIndicativePx:3,ViewExecutablePx:4,SingleQuote:5,StreamingQuotes:6,SingleBroker:7,MultiBrokers:8}),y4=Object.freeze({Trade:0,MakeMarkets:1,HoldPositions:2,PerformGiveUps:3,SubmitIOIs:4,SubscribeMarketData:5,ShortWithPreBorrow:6,SubmitQuoteRequests:7,RespondToQuoteRequests:8}),S4=Object.freeze({CustomerOrClient:"C",ExchangeOrExecutionVenue:"E",FirmOrBroker:"F"}),P4=Object.freeze({Hour:"H",Minute:"Min",Second:"S",Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),g4=Object.freeze({Put:1,Call:2,Tender:3,SinkingFundCall:4,Activation:5,Inactiviation:6,LastEligibleTradeDate:7,SwapStartDate:8,SwapEndDate:9,SwapRollDate:10,SwapNextStartDate:11,SwapNextRollDate:12,FirstDeliveryDate:13,LastDeliveryDate:14,InitialInventoryDueDate:15,FinalInventoryDueDate:16,FirstIntentDate:17,LastIntentDate:18,PositionRemovalDate:19,MinimumNotice:20,DeliveryStartTime:21,DeliveryEndTime:22,FirstNoticeDate:23,LastNoticeDate:24,FirstExerciseDate:25,RedemptionDate:26,TrdCntntnEfctvDt:27,Other:99}),h4=Object.freeze({False:"N",True:"Y"}),f4=Object.freeze({BIC:"B",GeneralIdentifier:"C",Proprietary:"D",ISOCountryCode:"E",MIC:"G"}),I4=Object.freeze({NoRestriction:0,TradedOnlyOnTradingVenue:1,TradedOnlyOnSI:2,TradedOnTradingVenueOrSI:3}),b4=Object.freeze({Received:"0",Accepted:"1",DontKnow:"2"}),F4=Object.freeze({StayOnOfferSide:"0",NotHeld:"1",Work:"2",GoAlong:"3",OverTheDay:"4",Held:"5",ParticipateDoNotInitiate:"6",StrictScale:"7",TryToScale:"8",StayOnBidSide:"9",NoCross:"A",OKToCross:"B",CallFirst:"C",PercentOfVolume:"D",DoNotIncrease:"E",DoNotReduce:"F",AllOrNone:"G",ReinstateOnSystemFailure:"H",InstitutionsOnly:"I",ReinstateOnTradingHalt:"J",CancelOnTradingHalt:"K",LastPeg:"L",MidPricePeg:"M",NonNegotiable:"N",OpeningPeg:"O",MarketPeg:"P",CancelOnSystemFailure:"Q",PrimaryPeg:"R",Suspend:"S",FixedPegToLocalBestBidOrOfferAtTimeOfOrder:"T",CustomerDisplayInstruction:"U",Netting:"V",PegToVWAP:"W",TradeAlong:"X",TryToStop:"Y",CancelIfNotBest:"Z",TrailingStopPeg:"a",StrictLimit:"b",IgnorePriceValidityChecks:"c",PegToLimitPrice:"d",WorkToTargetStrategy:"e",IntermarketSweep:"f",ExternalRoutingAllowed:"g",ExternalRoutingNotAllowed:"h",ImbalanceOnly:"i",SingleExecutionRequestedForBlockTrade:"j",BestExecution:"k",SuspendOnSystemFailure:"l",SuspendOnTradingHalt:"m",ReinstateOnConnectionLoss:"n",CancelOnConnectionLoss:"o",SuspendOnConnectionLoss:"p",Release:"q",ExecuteAsDeltaNeutral:"r",ExecuteAsDurationNeutral:"s",ExecuteAsFXNeutral:"t",MinGuaranteedFillEligible:"u",BypassNonDisplayLiquidity:"v",Lock:"w",IgnoreNotionalValueChecks:"x",TrdAtRefPx:"y",AllowFacilitation:"z"}),E4=Object.freeze({Unspecified:0,Manual:1,Automated:2,VoiceBrokered:3}),v4=Object.freeze({BidPrice:"B",CreationPrice:"C",CreationPricePlusAdjustmentPercent:"D",CreationPricePlusAdjustmentAmount:"E",OfferPrice:"O",OfferPriceMinusAdjustmentPercent:"P",OfferPriceMinusAdjustmentAmount:"Q",SinglePrice:"S"}),C4=Object.freeze({GTCorporateAction:0,GTRenewal:1,VerbalChange:2,RepricingOfOrder:3,BrokerOption:4,PartialDeclineOfOrderQty:5,CancelOnTradingHalt:6,CancelOnSystemFailure:7,Market:8,Canceled:9,WarehouseRecap:10,PegRefresh:11,CancelOnConnectionLoss:12,CancelOnLogout:13,AssignTimePriority:14,CancelledForTradePriceViolation:15,CancelledForCrossImbalance:16,CxldSMP:17,CxldSMPAggressive:18,CxldSMPPassive:19,CxldSMPAggressivePassive:20,Other:99}),X4=Object.freeze({New:"0",Cancel:"1",Correct:"2",Status:"3"}),T4=Object.freeze({New:"0",DoneForDay:"3",Canceled:"4",Replaced:"5",PendingCancel:"6",Stopped:"7",Rejected:"8",Suspended:"9",PendingNew:"A",Calculated:"B",Expired:"C",Restated:"D",PendingReplace:"E",Trade:"F",TradeCorrect:"G",TradeCancel:"H",OrderStatus:"I",TradeInAClearingHold:"J",TradeHasBeenReleasedToClearing:"K",TriggeredOrActivatedBySystem:"L",Locked:"M",Released:"N"}),D4=Object.freeze({OrdAddedOnRequest:1,OrdReplacedOnRequest:2,OrdCxldOnRequest:3,UnsolicitedOrdCxl:4,NonRestingOrdAddedOnRequest:5,OrdReplacedWithNonRestingOrdOnRequest:6,TriggerOrdReplacedOnRequest:7,SuspendedOrdReplacedOnRequest:8,SuspendedOrdCxldOnRequest:9,OrdCxlPending:10,PendingCxlExecuted:11,RestingOrdTriggered:12,SuspendedOrdActivated:13,ActiveOrdSuspended:14,OrdExpired:15}),R4=Object.freeze({NotRequired:0,NonElectronic:1,Electronic:2,Unknown:3}),N4=Object.freeze({Automatic:"A",Manual:"M"}),A4=Object.freeze({European:0,American:1,Bermuda:2,Other:99}),w4=Object.freeze({ExpireOnTradingSessionClose:0,ExpireOnTradingSessionOpen:1,SpecifiedExpiration:2}),M4=Object.freeze({AutoExercise:1,NonAutoExercise:2,FinalWillBeExercised:3,ContraryIntention:4,Difference:5}),x4=Object.freeze({CalculationAgent:0,OptionsExchange:1}),L4=Object.freeze({Bankrupt:"1",PendingDelisting:"2",Restricted:"3"}),O4=Object.freeze({NERCEasternOffPeak:0,NERCWesternOffPeak:1,NERCCalendarAllDaysInMonth:2,NERCEasternPeak:3,NERCWesternPeak:4,AllTimes:5,OnPeak:6,OffPeak:7,Base:8,Block:9,Other:99}),U4=Object.freeze({DoNotExecuteForexAfterSecurityTrade:"N",ExecuteForexAfterSecurityTrade:"Y"}),k4=Object.freeze({Repo:0,Cash:1,FreeCedits:2,CustomerShortSales:3,BrokerShortSales:4,UnsecuredBorrowing:5,Other:99}),q4=Object.freeze({No:"N",Yes:"Y"}),B4=Object.freeze({Bloomberg:1,CentralBank:2,WMR:3,MitsubishiUFJ:4,LondonBullionMarketAssociation:5,LondonMetalExchange:6,Other:99}),hn=Object.freeze({SequenceReset:"N",GapFillMessage:"Y"}),j4=Object.freeze({BookOutAllTradesOnDayOfExecution:0,AccumulateUntilFilledOrExpired:1,AccumulateUntilVerballyNotifiedOtherwise:2}),G4=Object.freeze({NewsDissemination:0,OrderInflux:1,OrderImbalance:2,AdditionalInformation:3,NewsPending:4,EquipmentChangeover:5}),Q4=Object.freeze({AutomatedExecutionNoIntervention:"1",AutomatedExecutionInterventionOK:"2",ManualOrder:"3"}),V4=Object.freeze({CUSIP:"1",SEDOL:"2",QUIK:"3",ISINNumber:"4",RICCode:"5",ISOCurrencyCode:"6",ISOCountryCode:"7",ExchangeSymbol:"8",ConsolidatedTapeAssociation:"9"}),z4=Object.freeze({NotImplied:0,ImpliedIn:1,ImpliedOut:2,BothImpliedInAndImpliedOut:3}),H4=Object.freeze({Net:1,Gross:2}),W4=Object.freeze({SubAllocate:1,ThirdPartyAllocation:2}),K4=Object.freeze({Flat:1,ZeroCoupon:2,InterestBearing:3,NoPeriodicPayments:4,VariableRate:5,LessFeeForPut:6,SteppedCoupon:7,CouponPeriod:8,When:9,OriginalIssueDiscount:10,Callable:11,EscrowedToMaturity:12,EscrowedToRedemptionDate:13,PreRefunded:14,InDefault:15,Unrated:16,Taxable:17,Indexed:18,SubjectToAlternativeMinimumTax:19,OriginalIssueDiscountPrice:20,CallableBelowMaturityValue:21,CallableWithoutNotice:22,PriceTickRulesForSecurity:23,TradeTypeEligibilityDetailsForSecurity:24,InstrumentDenominator:25,InstrumentNumerator:26,InstrumentPricePrecision:27,InstrumentStrikePrice:28,TradeableIndicator:29,InstrumentEligibleAnonOrders:30,MinGuaranteedFillVolume:31,MinGuaranteedFillStatus:32,TradeAtSettlementEligibility:33,TestInstrument:34,DummyInstrument:35,NegativeSettlementPriceEligibility:36,NegativeStrikePriceEligibility:37,USStdContractInd:38,AdmittedToTradingOnTradingVenue:39,AverageDailyNotionalAmount:40,AverageDailyNumberTrades:41,Text:99}),Y4=Object.freeze({ProRata:"P",Random:"R"}),_4=Object.freeze({Include:1,Exclude:2}),J4=Object.freeze({StandardITM:0,ATMITM:1,ATMCallITM:2,ATMPutITM:3}),$4=Object.freeze({HaltWasNotRelatedToAHaltOfTheCommonStock:"N",HaltWasDueToCommonStockBeingHalted:"Y"}),Z4=Object.freeze({NotNatural:"N",Natural:"Y"}),e5=Object.freeze({High:"H",Low:"L",Medium:"M"}),t5=Object.freeze({Small:"S",Medium:"M",Large:"L",UndisclosedQuantity:"U"}),d5=Object.freeze({AllOrNone:"A",MarketOnClose:"B",AtTheClose:"C",VWAP:"D",Axe:"E",AxeOnBid:"F",AxeOnOffer:"G",ClientNaturalWorking:"H",InTouchWith:"I",PositionWanted:"J",MarketMaking:"K",Limit:"L",MoreBehind:"M",ClientNaturalBlock:"N",AtTheOpen:"O",TakingAPosition:"P",AtTheMarket:"Q",ReadyToTrade:"R",PortfolioShown:"S",ThroughTheDay:"T",Unwind:"U",Versus:"V",Indication:"W",CrossingOpportunity:"X",AtTheMidpoint:"Y",PreOpen:"Z",QuantityNegotiable:"1",AllowLateBids:"2",ImmediateOrCounter:"3",AutoTrade:"4",AutomaticSpot:"a",PlatformCalculatedSpot:"b",OutsideSpread:"c",DeferredSpot:"d",NegotiatedSpot:"n"}),i5=Object.freeze({Large:"L",Medium:"M",Small:"S"}),a5=Object.freeze({New:"N",Cancel:"C",Replace:"R"}),n5=Object.freeze({Pay:"PAY",Rcv:"RCV",NA:"NA"}),r5=Object.freeze({Agent:"1",CrossAsAgent:"2",CrossAsPrincipal:"3",Principal:"4",RisklessPrincipal:"5"}),o5=Object.freeze({NotLastMessage:"N",LastMessage:"Y"}),s5=Object.freeze({NeitherAddedNorRemovedLiquidity:0,AddedLiquidity:1,RemovedLiquidity:2,LiquidityRoutedOut:3,Auction:4,TriggeredStopOrder:5,TriggeredContingencyOrder:6,TriggeredMarketOrder:7,RemovedLiquidityAfterFirmOrderCommitment:8,AuctionExecutionAfterFirmOrderCommitment:9,Unknown:10,Other:11}),c5=Object.freeze({NotLastMessage:"N",LastMessage:"Y"}),p5=Object.freeze({DoesNotConsituteALegalConfirm:"N",LegalConfirm:"Y"}),l5=Object.freeze({ParForPar:1,ModifiedDuration:2,Risk:4,Proceeds:5}),u5=Object.freeze({Unknown:0,FirstLien:1,SecondLien:2,ThirdLien:3}),m5=Object.freeze({CreditLimit:0,GrossPositionLimit:1,NetPositionLimit:2,RiskExposureLimit:3,LongPositionLimit:4,ShortPositionLimit:5}),y5=Object.freeze({FiveDayMovingAverage:1,TwentyDayMovingAverage:2,NormalMarketSize:3,Other:4}),S5=Object.freeze({Immediate:"1",WaitForInstruction:"2",SellDriven:"3",BuyDrivenCashTopUp:"4",BuyDrivenCashWithdraw:"5"}),P5=Object.freeze({PreListedOnly:0,UserRequested:1}),g5=Object.freeze({InBiddingProcess:1,ReceivedForExecution:2,Executing:3,Cancelling:4,Alert:5,AllDone:6,Reject:7}),h5=Object.freeze({BrokerCredit:0,ExchangeClosed:2,TooLateToEnter:4,UnknownOrder:5,DuplicateOrder:6,UnsupportedOrderCharacteristic:11,Other:99}),f5=Object.freeze({Ack:1,Response:2,Timed:3,ExecStarted:4,AllDone:5,Alert:6}),I5=Object.freeze({Add:"A",Delete:"D",Modify:"M",Snapshot:"S"}),b5=Object.freeze({BridgeLoan:0,LetterOfCredit:1,RevolvingLoan:2,SwinglineFunding:3,TermLoan:4,TradeClaim:5}),F5=Object.freeze({No:"N",Yes:"Y"}),E5=Object.freeze({NotLocked:0,AwayMarketNetter:1,ThreeTickLocked:2,LockedByMarketMaker:3,DirectedOrderLock:4,MultilegLock:5,MarketOrderLock:6,PreAssignmentLock:7}),v5=Object.freeze({OddLot:"1",RoundLot:"2",BlockLot:"3",RoundLotBasedUpon:"4"}),C5=Object.freeze({AdditionalMargin:1,AdjustedMargin:2,UnadjustedMargin:3,BinaryAddOnAmount:4,CashBalanceAmount:5,ConcentrationMargin:6,CoreMargin:7,DeliveryMargin:8,DiscretionaryMargin:9,FuturesSpreadMargin:10,InitialMargin:11,LiquidatingMargin:12,MarginCallAmount:13,MarginDeficitAmount:14,MarginExcessAmount:15,OptionPremiumAmount:16,PremiumMargin:17,ReserveMargin:18,SecurityCollateralAmount:19,StressTestAddOnAmount:20,SuperMargin:21,TotalMargin:22,VariationMargin:23,SecondaryVariationMargin:24,RolledUpMarginDeficit:25,SpreadResponseMargin:26,SystemicRiskMargin:27,CurveRiskMargin:28,IndexSpreadRiskMargin:29,SectorRiskMargin:30,JumpToDefaultRiskMargin:31,BasisRiskMargin:32,InterestRateRiskMargin:33,JumpToHealthRiskMargin:34,OtherRiskMargin:35}),X5=Object.freeze({Posted:0,Received:1}),T5=Object.freeze({Summary:0,Detail:1,ExcessDeficit:2,NetPosition:3}),D5=Object.freeze({Successful:0,InvalidOrUnknownInstrument:1,InvalidOrUnknownMarginClass:2,InvalidParties:3,InvalidTransportTypeReq:4,InvalidDestinationReq:5,NoMarginReqFound:6,MarginReqInquiryQualifierNotSupported:7,UnauthorizedForMarginReqInquiry:8,Other:99}),R5=Object.freeze({Summary:0,Detail:1,ExcessDeficit:2}),N5=Object.freeze({Normal:0,Stressed:1,Exceptional:2}),A5=Object.freeze({MasterAgreement:0,Confirmation:1}),w5=Object.freeze({Basket:0,Bond:1,Cash:2,Commodity:3,ConvertibleBond:4,Equity:5,ExchangeTradedFund:6,Future:7,Index:8,Loan:9,Mortgage:10,MutualFund:11}),M5=Object.freeze({NotApplicable:0,Applicable:1,AsInMasterAgreement:2,AsInConfirmation:3}),x5=Object.freeze({NoParticipation:0,BuyParticipation:1,SellParticipation:2,BothBuyAndSellParticipation:3}),L5=Object.freeze({MarketSegmentPoolMember:1,RetailSegment:2,WholesaleSegment:3}),O5=Object.freeze({Active:1,Inactive:2,Published:3}),U5=Object.freeze({InterProductSpread:1}),k5=Object.freeze({Pool:1,Retail:2,Wholesale:3}),q5=Object.freeze({None:0,TradingRiskControl:1,ClearingRiskControl:2,MarketMakerProtection:3,StopTrading:4,EmergencyAction:5,SessionLossLogout:6,DuplicateLogin:7,ProductNotTraded:8,InstrumentNotTraded:9,CompleInstrumentDeleted:10,CircuitBreakerActivated:11,Other:99}),B5=Object.freeze({MassActionNotSupported:0,InvalidOrUnknownSecurity:1,InvalidOrUnknownUnderlyingSecurity:2,InvalidOrUnknownProduct:3,InvalidOrUnknownCFICode:4,InvalidOrUnknownSecurityType:5,InvalidOrUnknownTradingSession:6,InvalidOrUnknownMarket:7,InvalidOrUnknownMarketSegment:8,InvalidOrUnknownSecurityGroup:9,InvalidOrUnknownSecurityIssuer:10,InvalidOrUnknownIssuerOfUnderlyingSecurity:11,Other:99}),j5=Object.freeze({Rejected:0,Accepted:1,Completed:2}),G5=Object.freeze({AllOrdersForASecurity:1,AllOrdersForAnUnderlyingSecurity:2,AllOrdersForAProduct:3,AllOrdersForACFICode:4,AllOrdersForASecurityType:5,AllOrdersForATradingSession:6,AllOrders:7,AllOrdersForAMarket:8,AllOrdersForAMarketSegment:9,AllOrdersForASecurityGroup:10,CancelForSecurityIssuer:11,CancelForIssuerOfUnderlyingSecurity:12}),Q5=Object.freeze({SuspendOrders:1,ReleaseOrdersFromSuspension:2,CancelOrders:3}),V5=Object.freeze({MassCancelNotSupported:0,InvalidOrUnknownSecurity:1,InvalidOrUnknownUnderlyingSecurity:2,InvalidOrUnknownProduct:3,InvalidOrUnknownCFICode:4,InvalidOrUnknownSecurityType:5,InvalidOrUnknownTradingSession:6,InvalidOrUnknownMarket:7,InvalidOrUnkownMarketSegment:8,InvalidOrUnknownSecurityGroup:9,InvalidOrUnknownSecurityIssuer:10,InvalidOrUnknownIssuerOfUnderlyingSecurity:11,Other:99}),z5=Object.freeze({CancelOrdersForASecurity:"1",CancelOrdersForAnUnderlyingSecurity:"2",CancelOrdersForAProduct:"3",CancelOrdersForACFICode:"4",CancelOrdersForASecurityType:"5",CancelOrdersForATradingSession:"6",CancelAllOrders:"7",CancelOrdersForAMarket:"8",CancelOrdersForAMarketSegment:"9",CancelOrdersForASecurityGroup:"A",CancelOrdersForSecurityIssuer:"B",CancelForIssuerOfUnderlyingSecurity:"C"}),H5=Object.freeze({CancelRequestRejected:"0",CancelOrdersForASecurity:"1",CancelOrdersForAnUnderlyingSecurity:"2",CancelOrdersForAProduct:"3",CancelOrdersForACFICode:"4",CancelOrdersForASecurityType:"5",CancelOrdersForATradingSession:"6",CancelAllOrders:"7",CancelOrdersForAMarket:"8",CancelOrdersForAMarketSegment:"9",CancelOrdersForASecurityGroup:"A",CancelOrdersForASecuritiesIssuer:"B",CancelOrdersForIssuerOfUnderlyingSecurity:"C"}),W5=Object.freeze({Successful:0,ResponseLevelNotSupported:1,InvalidMarket:2,InvalidMarketSegment:3,Other:99}),K5=Object.freeze({Accepted:1,AcceptedWithAdditionalEvents:2,Rejected:3}),Y5=Object.freeze({StatusForOrdersForASecurity:1,StatusForOrdersForAnUnderlyingSecurity:2,StatusForOrdersForAProduct:3,StatusForOrdersForACFICode:4,StatusForOrdersForASecurityType:5,StatusForOrdersForATradingSession:6,StatusForAllOrders:7,StatusForOrdersForAPartyID:8,StatusForSecurityIssuer:9,StatusForIssuerOfUnderlyingSecurity:10}),_5=Object.freeze({AccruedInterest:1,DealPrice:2,TradeDate:3,SettlementDate:4,SideIndicator:5,TradedCurrency:6,AccountID:7,ExecutingBrokerID:8,SettlementCurrencyAndAmount:9,InvestmentManagerID:10,NetAmount:11,PlaceOfSettlement:12,Commissions:13,SecurityIdentifier:14,QualityAllocated:15,Principal:16,Fees:17,Tax:18}),J5=Object.freeze({FixedAmount:1,Percentage:2}),$5=Object.freeze({NoMatchingConfirmation:0,NoMatchingAllocation:1,AllocationDataElementMissing:2,ConfirmationDataElementMissing:3,DataDifferenceNotWithinTolerance:4,MatchWithinTolerance:5,Other:99}),Z5=Object.freeze({Match:1,DoNotMatch:2}),eb=Object.freeze({Mandatory:1,Optional:2}),tb=Object.freeze({Compared:"0",Uncompared:"1",AdvisoryOrAlert:"2",Mismatched:"3"}),db=Object.freeze({ExactMatchPlus4BadgesExecTime:"A1",ExactMatchPlus4Badges:"A2",ACTAcceptedTrade:"M3",ExactMatchPlus2BadgesExecTime:"A3",ACTDefaultTrade:"M4",ExactMatchPlus2Badges:"A4",ACTDefaultAfterM2:"M5",ExactMatchPlusExecTime:"A5",ACTM6Match:"M6",StampedAdvisoriesOrSpecialistAccepts:"AQ",A1ExactMatchSummarizedQuantity:"S1",A2ExactMatchSummarizedQuantity:"S2",A3ExactMatchSummarizedQuantity:"S3",A4ExactMatchSummarizedQuantity:"S4",A5ExactMatchSummarizedQuantity:"S5",ExactMatchMinusBadgesTimes:"M1",SummarizedMatchMinusBadgesTimes:"M2",OCSLockedIn:"MT",OnePartyTradeReport:"1",TwoPartyTradeReport:"2",ConfirmedTradeReport:"3",AutoMatch:"4",CrossAuction:"5",CounterOrderSelection:"6",CallAuction:"7",Issuing:"8",SystematicInternaliser:"9",AutoMatchLastLook:"10",CrossAuctionLastLook:"11"}),ib=Object.freeze({YearMonthOnly:0,YearMonthDay:1,YearMonthWeek:2}),ab=Object.freeze({Months:0,Days:1,Weeks:2,Years:3}),nb=Object.freeze({TopOfBook:1,PriceDepth:2,OrderDepth:3}),z=Object.freeze({Bid:"0",Offer:"1",Trade:"2",IndexValue:"3",OpeningPrice:"4",ClosingPrice:"5",SettlementPrice:"6",TradingSessionHighPrice:"7",TradingSessionLowPrice:"8",VWAP:"9",Imbalance:"A",TradeVolume:"B",OpenInterest:"C",CompositeUnderlyingPrice:"D",SimulatedSellPrice:"E",SimulatedBuyPrice:"F",MarginRate:"G",MidPrice:"H",EmptyBook:"J",SettleHighPrice:"K",SettleLowPrice:"L",PriorSettlePrice:"M",SessionHighBid:"N",SessionLowOffer:"O",EarlyPrices:"P",AuctionClearingPrice:"Q",SwapValueFactor:"S",DailyValueAdjustmentForLongPositions:"R",CumulativeValueAdjustmentForLongPositions:"T",DailyValueAdjustmentForShortPositions:"U",CumulativeValueAdjustmentForShortPositions:"V",FixingPrice:"W",CashRate:"X",RecoveryRate:"Y",RecoveryRateForLong:"Z",RecoveryRateForShort:"a",MarketBid:"b",MarketOffer:"c",ShortSaleMinPrice:"d",PreviousClosingPrice:"e",ThresholdLimitPriceBanding:"g",DailyFinancingValue:"h",AccruedFinancingValue:"i",TWAP:"t"}),rb=Object.freeze({No:"N",Yes:"Y"}),ob=Object.freeze({Book:0,OffBook:1,Cross:2,QuoteDrivenMarket:3,DarkOrderBook:4,AuctionDrivenMarket:5,QuoteNegotiation:6,VoiceNegotiation:7,HybridMarket:8,OtherMarket:9}),sb=Object.freeze({StartInstrumentRefData:1,EndInstrumentRefData:2,StartOffMarketTrades:3,EndOffMarketTrades:4,StartOrderBookTrades:5,EndOrderBookTrades:6,StartOpenInterest:7,EndOpenInterest:8,StartSettlementPrices:9,EndSettlementPrices:10,StartStatsRefData:11,EndStatsRefData:12,StartStatistics:13,EndStatistics:14}),cb=Object.freeze({UnknownSymbol:"0",DuplicateMDReqID:"1",InsufficientBandwidth:"2",InsufficientPermissions:"3",UnsupportedSubscriptionRequestType:"4",UnsupportedMarketDepth:"5",UnsupportedMDUpdateType:"6",UnsupportedAggregatedBook:"7",UnsupportedMDEntryType:"8",UnsupportedTradingSessionID:"9",UnsupportedScope:"A",UnsupportedOpenCloseSettleFlag:"B",UnsupportedMDImplicitDelete:"C",InsufficientCredit:"D"}),pb=Object.freeze({Customer:1,CustomerProfessional:2,DoNotTradeThrough:3}),lb=Object.freeze({SlidingWindow:1,SlidingWindowPeak:2,FixedDateRange:3,FixedTimeRange:4,CurrentTimeUnit:5,PreviousTimeUnit:6,MaximumRange:7,MaximumRangeUpToPreviousTimeUnit:8}),ub=Object.freeze({BuyersToSellers:1,UpticksToDownticks:2,MarketMakerToNonMarketMaker:3,AutomatedToNonAutomated:4,OrdersToTrades:5,QuotesToTrades:6,OrdersAndQuotesToTrades:7,FailedToTotalTradedValue:8,BenefitsToTotalTradedValue:9,FeesToTotalTradedValue:10,TradeVolumeToTotalTradedVolume:11,OrdersToTotalNumberOrders:12}),mb=Object.freeze({Successful:0,InvalidOrUnknownMarket:1,InvalidOrUnknownMarketSegment:2,InvalidOrUnknownSecurityList:3,InvalidOrUnknownInstruments:4,InvalidParties:5,TradeDateOutOfSupportedRange:6,UnsupportedStatisticType:7,UnsupportedScopeOrSubScope:8,UnsupportedScopeType:9,MarketDepthNotSupported:10,FrequencyNotSupported:11,UnsupportedStatisticInterval:12,UnsupportedStatisticDateRange:13,UnsupportedStatisticTimeRange:14,UnsupportedRatioType:15,InvalidOrUnknownTradeInputSource:16,InvalidOrUnknownTradingSession:17,UnauthorizedForStatisticRequest:18,Other:99}),yb=Object.freeze({BidPrices:1,OfferPrices:2,BidDepth:3,OfferDepth:4,Orders:5,Quotes:6,OrdersAndQuotes:7,Trades:8,TradePrices:9,AuctionPrices:10,OpeningPrices:11,ClosingPrices:12,SettlementPrices:13,UnderlyingPrices:14,OpenInterest:15,IndexValues:16,MarginRates:17,Outages:18,ScheduledAuctions:19,ReferencePrices:20,TradeValue:21,MarketDataFeeItems:22,Rebates:23,Discounts:24,Payments:25,Taxes:26,Levies:27,Benefits:28,Fees:29,OrdersRFQs:30,MarketMakers:31,TradingInterruptions:32,TradingSuspensions:33,NoQuotes:34,RequestForQuotes:35,TradeVolume:36}),Sb=Object.freeze({EntryRate:1,ModificationRate:2,CancelRate:3,DownwardMove:4,UpwardMove:5}),Pb=Object.freeze({Active:1,Inactive:2}),gb=Object.freeze({Visible:1,Hidden:2,Indicative:3,Tradeable:4,Passive:5,MarketConsensus:6,Power:7,HardwareError:8,SoftwareError:9,NetworkError:10,Failed:11,Executed:12,Entered:13,Modified:14,Cancelled:15,MarketDataAccess:16,TerminalAccess:17,Volume:18,Cleared:19,Settled:20,Other:21,Monetary:22,NonMonetary:23,Gross:24,LargeInScale:25,NeitherHiddenNorLargeInScale:26,CorporateAction:27,VenueDecision:28,MinimumTimePeriod:29,Open:30,NotExecuted:31,Aggressive:32,Directed:33}),hb=Object.freeze({Count:1,AverageVolume:2,TotalVolume:3,Distribution:4,Ratio:5,Liquidity:6,VWAP:7,Volatility:8,Duration:9,Tick:10,AverageValue:11,TotalValue:12,High:13,Low:14,Midpoint:15,First:16,Last:17,Final:18,ExchangeBest:19,ExchangeBestWithVolume:20,ConsolidatedBest:21,ConsolidatedBestWithVolume:22,TWAP:23,AverageDuration:24,AveragePrice:25,TotalFees:26,TotalBenefits:27,MedianValue:28,AverageLiquidity:29,MedianDuration:30}),fb=Object.freeze({Absolute:1,Percentage:2}),Ib=Object.freeze({New:"0",Change:"1",Delete:"2",DeleteThru:"3",DeleteFrom:"4",Overlay:"5"}),bb=Object.freeze({FullRefresh:0,IncrementalRefresh:1}),Fb=Object.freeze({Range1:1,Range2:2,Range3:3}),Eb=Object.freeze({ISO2022JP:"ISO-2022-JP",EUCJP:"EUC-JP",ShiftJIS:"Shift_JIS",UTF8:"UTF-8"}),vb=Object.freeze({Realtime:1,EndOfDay:2}),Cb=Object.freeze({Once:1,Multiple:2}),Xb=Object.freeze({Absolute:0,PerUnit:1,Percentage:2}),Tb=Object.freeze({Contributes:0,DoesNotContribute:1}),Db=Object.freeze({Regulatory:"1",Tax:"2",LocalCommission:"3",ExchangeFees:"4",Stamp:"5",Levy:"6",Other:"7",Markup:"8",ConsumptionTax:"9",PerTransaction:"10",Conversion:"11",Agent:"12",TransferFee:"13",SecurityLending:"14",TradeReporting:"15",TaxOnPrincipalAmount:"16",TaxOnAccruedInterestAmount:"17",NewIssuanceFee:"18",ServiceFee:"19",OddLotFee:"20",AuctionFee:"21",ValueAddedTax:"22",SalesTax:"23",ExecutionFee:"24",OrderEntryFee:"25",OrderModificationFee:"26",OrdersCancellationFee:"27",MarketDataAccessFee:"28",MarketDataTerminalFee:"29",MarketDataVolumeFee:"30",ClearingFee:"31",SettlementFee:"32",Rebates:"33",Discounts:"34",Payments:"35",NonMonetaryPayments:"36"}),Rb=Object.freeze({UtilityProvidedStandardModel:0,ProprietaryModel:1}),Nb=Object.freeze({Passed:"Y",NotChecked:"N",ExemptBelowLimit:"1",ExemptMoneyType:"2",ExemptAuthorised:"3"}),Ab=Object.freeze({Receive:"R",Send:"S"}),kt=Object.freeze({Heartbeat:"0",TestRequest:"1",ResendRequest:"2",Reject:"3",SequenceReset:"4",Logout:"5",IOI:"6",Advertisement:"7",ExecutionReport:"8",OrderCancelReject:"9",Logon:"A",News:"B",Email:"C",NewOrderSingle:"D",NewOrderList:"E",OrderCancelRequest:"F",OrderCancelReplaceRequest:"G",OrderStatusRequest:"H",AllocationInstruction:"J",ListCancelRequest:"K",ListExecute:"L",ListStatusRequest:"M",ListStatus:"N",AllocationInstructionAck:"P",DontKnowTrade:"Q",QuoteRequest:"R",Quote:"S",SettlementInstructions:"T",MarketDataRequest:"V",MarketDataSnapshotFullRefresh:"W",MarketDataIncrementalRefresh:"X",MarketDataRequestReject:"Y",QuoteCancel:"Z",QuoteStatusRequest:"a",MassQuoteAck:"b",SecurityDefinitionRequest:"c",SecurityDefinition:"d",SecurityStatusRequest:"e",SecurityStatus:"f",TradingSessionStatusRequest:"g",TradingSessionStatus:"h",MassQuote:"i",BusinessMessageReject:"j",BidRequest:"k",BidResponse:"l",ListStrikePrice:"m",XMLnonFIX:"n",RegistrationInstructions:"o",RegistrationInstructionsResponse:"p",OrderMassCancelRequest:"q",OrderMassCancelReport:"r",NewOrderCross:"s",CrossOrderCancelReplaceRequest:"t",CrossOrderCancelRequest:"u",SecurityTypeRequest:"v",SecurityTypes:"w",SecurityListRequest:"x",SecurityList:"y",DerivativeSecurityListRequest:"z",DerivativeSecurityList:"AA",NewOrderMultileg:"AB",MultilegOrderCancelReplace:"AC",TradeCaptureReportRequest:"AD",TradeCaptureReport:"AE",OrderMassStatusRequest:"AF",QuoteRequestReject:"AG",RFQRequest:"AH",QuoteStatusReport:"AI",QuoteResponse:"AJ",Confirmation:"AK",PositionMaintenanceRequest:"AL",PositionMaintenanceReport:"AM",RequestForPositions:"AN",RequestForPositionsAck:"AO",PositionReport:"AP",TradeCaptureReportRequestAck:"AQ",TradeCaptureReportAck:"AR",AllocationReport:"AS",AllocationReportAck:"AT",ConfirmationAck:"AU",SettlementInstructionRequest:"AV",AssignmentReport:"AW",CollateralRequest:"AX",CollateralAssignment:"AY",CollateralResponse:"AZ",CollateralReport:"BA",CollateralInquiry:"BB",NetworkCounterpartySystemStatusRequest:"BC",NetworkCounterpartySystemStatusResponse:"BD",UserRequest:"BE",UserResponse:"BF",CollateralInquiryAck:"BG",ConfirmationRequest:"BH",ContraryIntentionReport:"BO",SecurityDefinitionUpdateReport:"BP",SecurityListUpdateReport:"BK",AdjustedPositionReport:"BL",AllocationInstructionAlert:"BM",ExecutionAck:"BN",TradingSessionList:"BJ",TradingSessionListRequest:"BI",SettlementObligationReport:"BQ",DerivativeSecurityListUpdateReport:"BR",TradingSessionListUpdateReport:"BS",MarketDefinitionRequest:"BT",MarketDefinition:"BU",MarketDefinitionUpdateReport:"BV",ApplicationMessageRequest:"BW",ApplicationMessageRequestAck:"BX",ApplicationMessageReport:"BY",OrderMassActionReport:"BZ",OrderMassActionRequest:"CA",UserNotification:"CB",StreamAssignmentRequest:"CC",StreamAssignmentReport:"CD",StreamAssignmentReportACK:"CE",PartyDetailsListRequest:"CF",PartyDetailsListReport:"CG",MarginRequirementInquiry:"CH",MarginRequirementInquiryAck:"CI",MarginRequirementReport:"CJ",PartyDetailsListUpdateReport:"CK",PartyRiskLimitsRequest:"CL",PartyRiskLimitsReport:"CM",SecurityMassStatusRequest:"CN",SecurityMassStatus:"CO",AccountSummaryReport:"CQ",PartyRiskLimitsUpdateReport:"CR",PartyRiskLimitsDefinitionRequest:"CS",PartyRiskLimitsDefinitionRequestAck:"CT",PartyEntitlementsRequest:"CU",PartyEntitlementsReport:"CV",QuoteAck:"CW",PartyDetailsDefinitionRequest:"CX",PartyDetailsDefinitionRequestAck:"CY",PartyEntitlementsUpdateReport:"CZ",PartyEntitlementsDefinitionRequest:"DA",PartyEntitlementsDefinitionRequestAck:"DB",TradeMatchReport:"DC",TradeMatchReportAck:"DD",PartyRiskLimitsReportAck:"DE",PartyRiskLimitCheckRequest:"DF",PartyRiskLimitCheckRequestAck:"DG",PartyActionRequest:"DH",PartyActionReport:"DI",MassOrder:"DJ",MassOrderAck:"DK",PositionTransferInstruction:"DL",PositionTransferInstructionAck:"DM",PositionTransferReport:"DN",MarketDataStatisticsRequest:"DO",MarketDataStatisticsReport:"DP",CollateralReportAck:"DQ",MarketDataReport:"DR",CrossRequest:"DS",CrossRequestAck:"DT",AllocationInstructionAlertRequest:"DU",AllocationInstructionAlertRequestAck:"DV",TradeAggregationRequest:"DW",TradeAggregationReport:"DX",PayManagementReport:"EA",PayManagementReportAck:"EB",PayManagementRequest:"DY",PayManagementRequestAck:"DZ",SettlementStatusRequest:"EC",SettlementStatusRequestAck:"ED",SettlementStatusReport:"EE",SettlementStatusReportAck:"EF",SecurityRiskMetricsReport:"EG",AlgoCertificateRequest:"EH",AlgoCertificateRequestAck:"EI",AlgoCertificateReport:"EJ",AlgoCertificateReportAck:"EK",TestSuiteDefinitionRequest:"EL",TestSuiteDefinitionRequestAck:"EM",TestActionRequest:"EN",TestActionRequestAck:"EO",TestActionReport:"EP"}),wb=Object.freeze({NotMultiJrsdctnEligible:0,MultiJrsdctnEligible:1}),Mb=Object.freeze({SingleSecurity:"1",IndividualLegOfAMultiLegSecurity:"2",MultiLegSecurity:"3"}),xb=Object.freeze({ReportByMulitlegSecurityOnly:0,ReportByMultilegSecurityAndInstrumentLegs:1,ReportByInstrumentLegsOnly:2}),Lb=Object.freeze({PredefinedMultilegSecurity:0,UserDefinedMultilegSecurity:1,UserDefined:2}),Ob=Object.freeze({NetPrice:0,ReversedNetPrice:1,YieldDifference:2,Individual:3,ContractWeightedAveragePrice:4,MultipliedPrice:5}),Ub=Object.freeze({Bid:0,Offer:1,MidPrice:2}),kb=Object.freeze({NotApplicable:0,Direct:1,SIP:2,Hybrid:3}),qb=Object.freeze({AutoSpot:0,NegotiatedSpot:1,PhoneSpot:2}),Bb=Object.freeze({Net:1,Gross:2}),jb=Object.freeze({Snapshot:1,Subscribe:2,StopSubscribing:4,LevelOfDetail:8}),Gb=Object.freeze({Full:1,IncrementalUpdate:2}),Qb=Object.freeze({CompanyNews:0,MarketplaceNews:1,FinancialMarketNews:2,TechnicalNews:3,OtherNews:99}),Vb=Object.freeze({Replacement:0,OtherLanguage:1,Complimentary:2,Withdrawal:3}),zb=Object.freeze({PotentialAdjustment:0,CashEquivalent:1}),Hb=Object.freeze({Unadjusted:0,Adjusted:1}),Wb=Object.freeze({OneSide:1,BothSides:2}),Kb=Object.freeze({OrderSuspended:0,InstrumentSuspended:1}),Yb=Object.freeze({DetailsShouldNotBeCommunicated:"N",DetailsShouldBeCommunicated:"Y"}),_b=Object.freeze({Bond:"0",ConvertBond:"1",Mortgage:"2",Loan:"3"}),Jb=Object.freeze({TreatAsRoundLot:"N",TreatAsOddLot:"Y"}),$b=Object.freeze({Offset:0,Onset:1}),Zb=Object.freeze({Regular:0,Offshore:1,Onshore:2}),eF=Object.freeze({Close:"C",Open:"O"}),tF=Object.freeze({DailyOpen:"0",SessionOpen:"1",DeliverySettlementEntry:"2"}),dF=Object.freeze({DailyOpen:"0",SessionOpen:"1",DeliverySettlementEntry:"2",ExpectedEntry:"3",EntryFromPreviousBusinessDay:"4",TheoreticalPriceValue:"5"}),iF=Object.freeze({Unadjusted:0,Adjusted:1}),aF=Object.freeze({Vanilla:1,Capped:2,Binary:3,Asian:4,Barrier:5,DigitalBarrier:6,Lookback:7,OtherPathDependent:8,Other:99}),nF=Object.freeze({AggregatedOrder:0,PendingAllocation:1,LiquidityProvisionActivityOrder:2,RiskReductionOrder:3,AlgorithmicOrder:4,SystematicInternaliserOrder:5,AllExecutionsSubmittedToAPA:6,OrderExecutionInstructedByClient:7,LargeInScale:8,Hidden:9,SubjectToEUSTO:10,SubjectToUKSTO:11,RepresentativeOrder:12,LinkageType:13,ExemptFromSTO:14}),rF=Object.freeze({Agency:"A",Proprietary:"G",Individual:"I",Principal:"P",RisklessPrincipal:"R",AgentForOtherMember:"W",MixedCapacity:"M"}),oF=Object.freeze({Order:"1",Quote:"2",PrivatelyNegotiatedTrade:"3",MultilegOrder:"4",LinkedOrder:"5",QuoteRequest:"6",ImpliedOrder:"7",CrossOrder:"8",StreamingPrice:"9",InternalCrossOrder:"A"}),sF=Object.freeze({Seconds:0,TenthsOfASecond:1,HundredthsOfASecond:2,Milliseconds:3,Microseconds:4,Nanoseconds:5,Minutes:10,Hours:11,Days:12,Weeks:13,Months:14,Years:15}),cF=Object.freeze({Add:"1",Modify:"2",Delete:"3",Suspend:"4",Release:"5"}),pF=Object.freeze({AddOrderRequest:1,ModifyOrderRequest:2,DeleteOrderRequest:3,OrderEnteredOOB:4,OrderModifiedOOB:5,OrderDeletedOOB:6,OrderActivatedOrTriggered:7,OrderExpired:8,ReserveOrderRefreshed:9,AwayMarketBetter:10,CorporateAction:11,StartOfDay:12,EndOfDay:13}),lF=Object.freeze({Added:1,Modified:2,Deleted:3,PartiallyFilled:4,Filled:5,Suspended:6,Released:7,Restated:8,Locked:9,Triggered:10,Activated:11}),uF=Object.freeze({FINRAOATS:1,FIAExecutionSourceCode:2}),mF=Object.freeze({OrderReceivedFromCustomer:1,OrderReceivedFromWithinFirm:2,OrderReceivedFromAnotherBrokerDealer:3,OrderReceivedFromCustomerOrWithFirm:4,OrderReceivedFromDirectAccessCustomer:5,OrderReceivedFromForeignDealerEquivalent:6,OrderReceivedFromExecutionOnlyService:7}),yF=Object.freeze({NoChange:0,ExecutingPartyChange:1,EnteringPartyChange:2,SpecifiedPartyChange:3}),SF=Object.freeze({NotSpecified:0,OrderAggregation:1,OrderSplit:2}),PF=Object.freeze({NoAck:0,MinimumAck:1,AckEach:2,SummaryAck:3}),gF=Object.freeze({ProgramTrade:"1",IndexArbitrage:"2",NonIndexArbitrage:"3",CompetingMarketMaker:"4",ActingAsMarketMakerOrSpecialistInSecurity:"5",ActingAsMarketMakerOrSpecialistInUnderlying:"6",ForeignEntity:"7",ExternalMarketParticipant:"8",ExternalInterConnectedMarketLinkage:"9",RisklessArbitrage:"A",IssuerHolding:"B",IssuePriceStabilization:"C",NonAlgorithmic:"D",Algorithmic:"E",Cross:"F",InsiderAccount:"G",SignificantShareholder:"H",NormalCourseIssuerBid:"I"}),hF=Object.freeze({BrokerCredit:0,UnknownSymbol:1,ExchangeClosed:2,OrderExceedsLimit:3,TooLateToEnter:4,UnknownOrder:5,DuplicateOrder:6,DuplicateOfAVerballyCommunicatedOrder:7,StaleOrder:8,TradeAlongRequired:9,InvalidInvestorID:10,UnsupportedOrderCharacteristic:11,SurveillanceOption:12,IncorrectQuantity:13,IncorrectAllocatedQuantity:14,UnknownAccount:15,PriceExceedsCurrentPriceBand:16,InvalidPriceIncrement:18,ReferencePriceNotAvailable:19,NotionalValueExceedsThreshold:20,AlgorithmRiskThresholdBreached:21,ShortSellNotPermitted:22,ShortSellSecurityPreBorrowRestriction:23,ShortSellAccountPreBorrowRestriction:24,InsufficientCreditLimit:25,ExceededClipSizeLimit:26,ExceededMaxNotionalOrderAmt:27,ExceededDV01PV01Limit:28,ExceededCS01Limit:29,LastLook:30,LastLookLatency:31,UnavailablePriceLiquidity:32,InvalidMissingEntitlements:33,Other:99}),fF=Object.freeze({New:"0",PartiallyFilled:"1",Filled:"2",DoneForDay:"3",Canceled:"4",Replaced:"5",PendingCancel:"6",Stopped:"7",Rejected:"8",Suspended:"9",PendingNew:"A",Calculated:"B",Expired:"C",AcceptedForBidding:"D",PendingReplace:"E"}),IF=Object.freeze({Market:"1",Limit:"2",Stop:"3",StopLimit:"4",MarketOnClose:"5",WithOrWithout:"6",LimitOrBetter:"7",LimitWithOrWithout:"8",OnBasis:"9",OnClose:"A",LimitOnClose:"B",ForexMarket:"C",PreviouslyQuoted:"D",PreviouslyIndicated:"E",ForexLimit:"F",ForexSwap:"G",ForexPreviouslyQuoted:"H",Funari:"I",MarketIfTouched:"J",MarketWithLeftOverAsLimit:"K",PreviousFundValuationPoint:"L",NextFundValuationPoint:"M",Pegged:"P",CounterOrderSelection:"Q",StopOnBidOrOffer:"R",StopLimitOnBidOrOffer:"S"}),bF=Object.freeze({MemberTradingForTheirOwnAccount:1,ClearingFirmTradingForItsProprietaryAccount:2,MemberTradingForAnotherMember:3,AllOther:4}),FF=Object.freeze({JointInvestors:"J",TenantsInCommon:"T",JointTrustees:"2"}),EF=Object.freeze({IndividualInvestor:1,PublicCompany:2,PrivateCompany:3,IndividualTrustee:4,CompanyTrustee:5,PensionPlan:6,CustodianUnderGiftsToMinorsAct:7,Trusts:8,Fiduciaries:9,NetworkingSubAccount:10,NonProfitOrganization:11,CorporateBody:12,Nominee:13,InstitutionalCustomer:14,Combined:15,MemberFirmEmployee:16,MarketMakingAccount:17,ProprietaryAccount:18,NonbrokerDealer:19,UnknownBeneficialOwnerType:20,FirmsErrorAccount:21,FirmAgencyAveragePriceAccount:22}),vF=Object.freeze({InvalidParty:0,UnkReqParty:1,NotAuthorized:98,Other:99}),CF=Object.freeze({Accepted:0,Completed:1,Rejected:2}),XF=Object.freeze({Suspend:0,HaltTrading:1,Reinstate:2}),TF=Object.freeze({Accepted:0,AcceptedWithChanges:1,Rejected:2}),DF=Object.freeze({Successful:0,InvalidParty:1,InvalidRelatedParty:2,InvalidPartyStatus:3,NotAuthorized:98,Other:99}),RF=Object.freeze({Accepted:0,AcceptedWithChanges:1,Rejected:2,AcceptancePending:3}),NF=Object.freeze({Agency:0,Principal:1,RisklessPrincipal:2,ExchangeOrderSubmitter:30,GeneralClearingMember:3,IndividualClearingMember:4,PreferredMarketMaker:5,DirectedMarketMaker:6,Bank:7,Hub:8,PrimaryTrdRepository:9,OrigTrdRepository:10,AddtnlIntlTrdRepository:11,AddtnlDomesticTrdRepository:12,RelatedExchange:13,OptionsExchange:14,SpecifiedExchange:15,ConstituentExchange:16,ExemptFromTradeReporting:17,Current:18,New:19,DesignatedSponsor:20,Specialist:21,Algorithm:22,FirmOrLegalEntity:23,NaturalPerson:24,RegularTrader:25,HeadTrader:26,Supervisor:27,TriParty:28,Lender:29}),AF=Object.freeze({Active:0,Suspended:1,Halted:2}),wF=Object.freeze({UKNationalInsuranceOrPensionNumber:"6",KoreanInvestorID:"1",ISITCAcronym:"I",BIC:"B",USSocialSecurityNumber:"7",TaiwaneseForeignInvestorID:"2",GeneralIdentifier:"C",USEmployerOrTaxIDNumber:"8",TaiwaneseTradingAcct:"3",Proprietary:"D",AustralianBusinessNumber:"9",MalaysianCentralDepository:"4",ISOCountryCode:"E",AustralianTaxFileNumber:"A",ChineseInvestorID:"5",SettlementEntityLocation:"F",TaxID:"J",MIC:"G",CSDParticipant:"H",AustralianCompanyNumber:"K",AustralianRegisteredBodyNumber:"L",CFTCReportingFirmIdentifier:"M",LegalEntityIdentifier:"N",InterimIdentifier:"O",ShortCodeIdentifier:"P",NationalIDNaturalPerson:"Q",IndiaPermanentAccountNumber:"R",FDID:"S",SPSAID:"T",MasterSPSAID:"U",KoreaShortSellingRegistrationNumber:"V"}),MF=Object.freeze({IsAlso:0,ClearsFor:1,ClearsThrough:2,TradesFor:3,TradesThrough:4,Sponsors:5,SponsoredThrough:6,ProvidesGuaranteeFor:7,IsGuaranteedBy:8,MemberOf:9,HasMembers:10,ProvidesMarketplaceFor:11,ParticipantOfMarketplace:12,CarriesPositionsFor:13,PostsTradesTo:14,EntersTradesFor:15,EntersTradesThrough:16,ProvidesQuotesTo:17,RequestsQuotesFrom:18,InvestsFor:19,InvestsThrough:20,BrokersTradesFor:21,BrokersTradesThrough:22,ProvidesTradingServicesFor:23,UsesTradingServicesOf:24,ApprovesOf:25,ApprovedBy:26,ParentFirmFor:27,SubsidiaryOf:28,RegulatoryOwnerOf:29,OwnedByRegulatory:30,Controls:31,IsControlledBy:32,LegalOwnerOf:33,OwnedByLegal:34,BeneficialOwnerOf:35,OwnedByBeneficial:36,SettlesFor:37,SettlesThrough:38}),xF=Object.freeze({Disabled:0,Enabled:1}),LF=Object.freeze({ExecutingFirm:1,BrokerOfCredit:2,ClientID:3,ClearingFirm:4,InvestorID:5,IntroducingFirm:6,EnteringFirm:7,Locate:8,FundManagerClientID:9,SettlementLocation:10,OrderOriginationTrader:11,ExecutingTrader:12,OrderOriginationFirm:13,GiveupClearingFirmDepr:14,CorrespondantClearingFirm:15,ExecutingSystem:16,ContraFirm:17,ContraClearingFirm:18,SponsoringFirm:19,UnderlyingContraFirm:20,ClearingOrganization:21,Exchange:22,CustomerAccount:24,CorrespondentClearingOrganization:25,CorrespondentBroker:26,Buyer:27,Custodian:28,Intermediary:29,Agent:30,SubCustodian:31,Beneficiary:32,InterestedParty:33,RegulatoryBody:34,LiquidityProvider:35,EnteringTrader:36,ContraTrader:37,PositionAccount:38,ContraInvestorID:39,TransferToFirm:40,ContraPositionAccount:41,ContraExchange:42,InternalCarryAccount:43,OrderEntryOperatorID:44,SecondaryAccountNumber:45,ForeignFirm:46,ThirdPartyAllocationFirm:47,ClaimingAccount:48,AssetManager:49,PledgorAccount:50,PledgeeAccount:51,LargeTraderReportableAccount:52,TraderMnemonic:53,SenderLocation:54,SessionID:55,AcceptableCounterparty:56,UnacceptableCounterparty:57,EnteringUnit:58,ExecutingUnit:59,IntroducingBroker:60,QuoteOriginator:61,ReportOriginator:62,SystematicInternaliser:63,MultilateralTradingFacility:64,RegulatedMarket:65,MarketMaker:66,InvestmentFirm:67,HostCompetentAuthority:68,HomeCompetentAuthority:69,CompetentAuthorityLiquidity:70,CompetentAuthorityTransactionVenue:71,ReportingIntermediary:72,ExecutionVenue:73,MarketDataEntryOriginator:74,LocationID:75,DeskID:76,MarketDataMarket:77,AllocationEntity:78,PrimeBroker:79,StepOutFirm:80,BrokerClearingID:81,CentralRegistrationDepository:82,ClearingAccount:83,AcceptableSettlingCounterparty:84,UnacceptableSettlingCounterparty:85,CLSMemberBank:86,InConcertGroup:87,InConcertControllingEntity:88,LargePositionsReportingAccount:89,SettlementFirm:90,SettlementAccount:91,ReportingMarketCenter:92,RelatedReportingMarketCenter:93,AwayMarket:94,GiveupTradingFirm:95,TakeupTradingFirm:96,GiveupClearingFirm:97,TakeupClearingFirm:98,OriginatingMarket:99,MarginAccount:100,CollateralAssetAccount:101,DataRepository:102,CalculationAgent:103,ExerciseNoticeSender:104,ExerciseNoticeReceiver:105,RateReferenceBank:106,Correspondent:107,BeneficiaryBank:109,Borrower:110,PrimaryObligator:111,Guarantor:112,ExcludedReferenceEntity:113,DeterminingParty:114,HedgingParty:115,ReportingEntity:116,SalesPerson:117,Operator:118,CSD:119,ICSD:120,TradingSubAccount:121,InvestmentDecisionMaker:122,PublishingIntermediary:123,CSDParticipant:124,Issuer:125,ContraCustomerAccount:126,ContraInvestmentDecisionMaker:127,AuthorizingPerson:128}),OF=Object.freeze({Firm:1,Person:2,System:3,Application:4,FullLegalNameOfFirm:5,PostalAddress:6,PhoneNumber:7,EmailAddress:8,ContactName:9,SecuritiesAccountNumber:10,RegistrationNumber:11,RegisteredAddressForConfirmation:12,RegulatoryStatus:13,RegistrationName:14,CashAccountNumber:15,BIC:16,CSDParticipantMemberCode:17,RegisteredAddress:18,FundAccountName:19,TelexNumber:20,FaxNumber:21,SecuritiesAccountName:22,CashAccountName:23,Department:24,LocationDesk:25,PositionAccountType:26,SecurityLocateID:27,MarketMaker:28,EligibleCounterparty:29,ProfessionalClient:30,Location:31,ExecutionVenue:32,CurrencyDeliveryIdentifier:33,AddressCity:34,AddressStateOrProvince:35,AddressPostalCode:36,AddressStreet:37,AddressISOCountryCode:38,ISOCountryCode:39,MarketSegment:40,CustomerAccountType:41,OmnibusAccount:42,FundsSegregationType:43,GuaranteeFund:44,SwapDealer:45,MajorParticipant:46,FinancialEntity:47,USPerson:48,ReportingEntityIndicator:49,ElectedClearingRequirementException:50,BusinessCenter:51,ReferenceText:52,ShortMarkingExemptAccount:53,ParentFirmIdentifier:54,ParentFirmName:55,DealIdentifier:56,SystemTradeID:57,SystemTradeSubID:58,FCMCode:59,DlvryTrmlCode:60,VolntyRptEntity:61,RptObligJursdctn:62,VolntyRptJursdctn:63,CompanyActivities:64,EEAreaDomiciled:65,ContractLinked:66,ContractAbove:67,VolntyRptPty:68,EndUser:69,LocationOrJurisdiction:70,DerivativesDealer:71,Domicile:72,ExemptFromRecognition:73,Payer:74,Receiver:75,SystematicInternaliser:76,PublishingEntityIndicator:77,FirstName:78,Surname:79,DateOfBirth:80,OrderTransmittingFirm:81,OrderTransmittingFirmBuyer:82,OrderTransmitterSeller:83,LegalEntityIdentifier:84,SubSectorClassification:85,PartySide:86,LegalRegistrationCountry:87}),UF=Object.freeze({Business:0,Calendar:1,Commodity:2,Currency:3,Exchange:4,Scheduled:5}),kF=Object.freeze({Prepaid:0,Postpaid:1,Variable:2,Fixed:3}),qF=Object.freeze({CREST:1,NSCC:2,Euroclear:3,Clearstream:4,Cheque:5,TelegraphicTransfer:6,FedWire:7,DebitCard:8,DirectDebit:9,DirectCredit:10,CreditCard:11,ACHDebit:12,ACHCredit:13,BPAY:14,HighValueClearingSystem:15,CHIPS:16,SWIFT:17,CHAPS:18,SIC:19,EuroSIC:20,Other:999}),BF=Object.freeze({Buy:1,Sell:2}),jF=Object.freeze({Initial:0,Previous:1}),GF=Object.freeze({Notional:0,CashFlow:1,FXLinkedNotional:2,FixedRate:3,FutureValueNotional:4,KnownAmount:5,FloatingRateMultiplier:6,Spread:7,CapRate:8,FloorRate:9,NonDeliverableSettlPaymentDates:10,NonDeliverableSettlCalculationDates:11,NonDeliverableFXFixingDates:12,SettlPeriodNotnl:13,SettlPeriodPx:14,CalcPeriod:15,DividendAccrualRateMultiplier:16,DividendAccrualRateSpread:17,DividendAccrualCapRate:18,DividendAccrualFloorRate:19,CompoundingRateMultiplier:20,CompoundingRateSpread:21,CompoundingCapRate:22,CompoundingFloorRate:23}),QF=Object.freeze({Standard:0,Net:1,StandardfNet:2}),VF=Object.freeze({Unweighted:0,Weighted:1}),zF=Object.freeze({Buyer:1,Seller:2}),HF=Object.freeze({None:0,Flat:1,Straight:2,SpreadExclusive:3}),WF=Object.freeze({Standard:0,FRA:1}),KF=Object.freeze({Buyer:1,Seller:2}),YF=Object.freeze({None:0,ISDA:1,AFMA:2}),_F=Object.freeze({None:0,LinearZeroYield:1}),JF=Object.freeze({Business:0,Calendar:1,CommodityBusiness:2,CurrencyBusiness:3,ExchangeBusiness:4,ScheduledTradingDay:5}),$F=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),ZF=Object.freeze({Initial:0,InitialAndFinal:1,Final:2,AnyPeriod:3}),eE=Object.freeze({Volatility:0,Variance:1}),tE=Object.freeze({ZeroInterestRateMethod:0,NegativeInterestRateMethod:1}),dE=Object.freeze({Business:0,Calendar:1,CommodityBusiness:2,CurrencyBusiness:3,ExchangeBusiness:4,ScheduledTradingDay:5}),iE=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),aE=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr",Term:"T"}),nE=Object.freeze({All:0,First:1,Last:2,Penultimate:3}),rE=Object.freeze({EveryDay:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6,Sunday:7}),oE=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),sE=Object.freeze({Bloomberg:0,Reuters:1,Telerate:2,Other:99}),cE=Object.freeze({Short:0,Long:1}),pE=Object.freeze({Absolute:0,Percentage:1}),lE=Object.freeze({BondEquivalentYield:0,MoneyMarketYield:1}),uE=Object.freeze({Previous:0,Last:1,Both:2}),mE=Object.freeze({Monday:"MON",Tuesday:"TUE",Wednesday:"WED",Thursday:"THU",Friday:"FRI",Saturday:"SAT",Sunday:"SUN"}),yE=Object.freeze({Average:0,Maximum:1,Minimum:2,Cumulative:3}),SE=Object.freeze({Periodic:0,Initial:1,Single:2,Dividend:3,Interest:4,DividendReturn:5,PriceReturn:6,TotalReturn:7,Variance:8,Correlation:9}),PE=Object.freeze({Short:0,Long:1}),gE=Object.freeze({Initial:0,Final:1,CompoundingInitial:2,CompoundingFinal:3}),hE=Object.freeze({Initial:0,Intermediate:1,Final:2,Prepaid:3,Postpaid:4,Variable:5,Fixed:6,Swap:7,Conditional:8,FixedRate:9,FloatingRate:10}),fE=Object.freeze({Brokerage:0,UpfrontFee:1,IndependentAmountCollateral:2,PrincipalExchange:3,NovationTermination:4,EarlyTerminationProvision:5,CancelableProvision:6,ExtendibleProvision:7,CapRateProvision:8,FloorRateProvision:9,OptionPremium:10,SettlementPayment:11,CashSettl:12,SecurityLending:13,Rebate:14,Other:99}),IE=Object.freeze({Received:0,Accepted:1,Rejected:2,Disputed:3}),bE=Object.freeze({New:0,Replace:1,Status:2}),FE=Object.freeze({Received:0,Accepted:1,Rejected:2,Disputed:3}),EE=Object.freeze({New:0,Cancel:1}),vE=Object.freeze({OrBetter:0,Strict:1,OrWorse:2}),CE=Object.freeze({Floating:0,Fixed:1}),XE=Object.freeze({Price:0,BasisPoints:1,Ticks:2,PriceTier:3,Percentage:4}),TE=Object.freeze({LastPeg:1,MidPricePeg:2,OpeningPeg:3,MarketPeg:4,PrimaryPeg:5,PegToVWAP:7,TrailingStopPeg:8,PegToLimitPrice:9,ShortSaleMinPricePeg:10}),DE=Object.freeze({MoreAggressive:1,MorePassive:2}),RE=Object.freeze({Local:1,National:2,Global:3,NationalExcludingLocal:4}),NE=Object.freeze({OptionsSettlement:0,PendingErosionAdjustment:1,FinalErosionAdjustment:2,TearUpCouponAmount:3,PriceAlignmentInterest:4,DeliveryInvoiceCharges:5,DeliveryStorageCharges:6}),AE=Object.freeze({CashAmount:"CASH",CashResidualAmount:"CRES",FinalMarkToMarketAmount:"FMTM",IncrementalMarkToMarketAmount:"IMTM",PremiumAmount:"PREM",StartOfDayMarkToMarketAmount:"SMTM",TradeVariationAmount:"TVAR",ValueAdjustedAmount:"VADJ",SettlementValue:"SETL",InitialTradeCouponAmount:"ICPN",AccruedCouponAmount:"ACPN",CouponAmount:"CPN",IncrementalAccruedCoupon:"IACPN",CollateralizedMarkToMarket:"CMTM",IncrementalCollateralizedMarkToMarket:"ICMTM",CompensationAmount:"DLV",TotalBankedAmount:"BANK",TotalCollateralizedAmount:"COLAT",LongPairedSwapNotionalValue:"LSNV",ShortPairedSwapNotionalValue:"SSNV",StartOfDayAccruedCoupon:"SACPN",NetPresentValue:"NPV",StartOfDayNetPresentValue:"SNPV",NetCashFlow:"NCF",PresentValueOfFees:"PVFEES",PresentValueOneBasisPoints:"PV01",FiveYearEquivalentNotional:"5YREN",UndiscountedMarkToMarket:"UMTM",MarkToModel:"MTD",MarkToMarketVariance:"VMTM",MarkToModelVariance:"VMTD",UpfrontPayment:"UPFRNT",EndVale:"ENDV",OutstandingMarginLoan:"MGNLN",LoanValue:"LNVL"}),wE=Object.freeze({Principal:0,Agent:1,Customer:2,Counterparty:3}),ME=Object.freeze({Close:"C",FIFO:"F",Open:"O",Rolled:"R",CloseButNotifyOnOpen:"N",Default:"D"}),xE=Object.freeze({New:1,Replace:2,Cancel:3,Reverse:4}),LE=Object.freeze({SuccessfulCompletion:0,Rejected:1,Other:99}),OE=Object.freeze({Accepted:0,AcceptedWithWarnings:1,Rejected:2,Completed:3,CompletedWithWarnings:4}),UE=Object.freeze({Submitted:0,Accepted:1,Rejected:2}),kE=Object.freeze({ValidRequest:0,InvalidOrUnsupportedRequest:1,NoPositionsFoundThatMatchCriteria:2,NotAuthorizedToRequestPositions:3,RequestForPositionNotSupported:4,Other:99}),qE=Object.freeze({Completed:0,CompletedWithWarnings:1,Rejected:2}),BE=Object.freeze({Positions:0,Trades:1,Exercises:2,Assignments:3,SettlementActivity:4,BackoutMessage:5,DeltaPositions:6,NetPosition:7,LargePositionsReporting:8,ExercisePositionReportingSubmission:9,PositionLimitReportingSubmissing:10}),Eg=Object.freeze({OriginalTransmission:"N",PossibleDuplicate:"Y"}),jE=Object.freeze({OriginalTransmission:"N",PossibleResend:"Y"}),GE=Object.freeze({Exercise:1,DoNotExercise:2,PositionAdjustment:3,PositionChangeSubmission:4,Pledge:5,LargeTraderSubmission:6,LargePositionsReportingSubmission:7,LongHoldings:8,InternalTransfer:9,TransferOfFirm:10,ExternalTransfer:11,CorporateAction:12,Notification:13,PositionCreation:14,Closeout:15,Reopen:16}),QE=Object.freeze({AllocationTradeQty:"ALC",OptionAssignment:"AS",AsOfTradeQty:"ASF",DeliveryQty:"DLV",ElectronicTradeQty:"ETR",OptionExerciseQty:"EX",EndOfDayQty:"FIN",IntraSpreadQty:"IAS",InterSpreadQty:"IES",AdjustmentQty:"PA",PitTradeQty:"PIT",StartOfDayQty:"SOD",IntegralSplit:"SPL",TransactionFromAssignment:"TA",TotalTransactionQty:"TOT",TransactionQuantity:"TQ",TransferTradeQty:"TRF",TransactionFromExercise:"TX",CrossMarginQty:"XM",ReceiveQuantity:"RCV",CorporateActionAdjustment:"CAA",DeliveryNoticeQty:"DN",ExchangeForPhysicalQty:"EP",PrivatelyNegotiatedTradeQty:"PNTN",NetDeltaQty:"DLT",CreditEventAdjustment:"CEA",SuccessionEventAdjustment:"SEA",NetQty:"NET",GrossQty:"GRS",IntradayQty:"ITD",GrossLongNonDeltaAdjustedSwaptionPosition:"NDAS",LongDeltaAdjustedPairedSwaptionPosition:"DAS",ExpiringQuantity:"EXP",QuantityNotExercised:"UNEX",RequestedExerciseQuantity:"REQ",CashFuturesEquivalentQuantity:"CFE",LoanOrBorrowedQuantity:"SECLN"}),VE=Object.freeze({DebitPay:0,CreditReceive:1}),zE=Object.freeze({New:0,Initiated:1,Pending:2,Confirmed:3,Rejected:4}),HE=Object.freeze({ProRata:"0",DoNotProRata:"1"}),WE=Object.freeze({NotReportedToCounterparty:"N",PreviouslyReportedToCounterparty:"Y"}),KE=Object.freeze({Price:0,Ticks:1,Percentage:2}),YE=Object.freeze({Amount:0,Percentage:1}),_E=Object.freeze({None:"0",Local:"1",National:"2",Global:"3"}),JE=Object.freeze({AccruedInterestIsFactored:0,TaxIsFactored:1,BondAmortizationIsFactored:2}),$E=Object.freeze({Standard:"STD",Index:"INX",InterestRateIndex:"INT",PercentOfPar:"PCTPAR"}),ZE=Object.freeze({Percentage:1,PerUnit:2,FixedAmount:3,Discount:4,Premium:5,Spread:6,TEDPrice:7,TEDYield:8,Yield:9,FixedCabinetTradePrice:10,VariableCabinetTradePrice:11,PriceSpread:12,ProductTicksInHalves:13,ProductTicksInFourths:14,ProductTicksInEighths:15,ProductTicksInSixteenths:16,ProductTicksInThirtySeconds:17,ProductTicksInSixtyFourths:18,ProductTicksInOneTwentyEighths:19,NormalRateRepresentation:20,InverseRateRepresentation:21,BasisPoints:22,UpfrontPoints:23,InterestRate:24,PercentageNotional:25}),ev=Object.freeze({PriorityUnchanged:0,LostPriorityAsResultOfOrderChange:1}),tv=Object.freeze({PrivateQuote:"Y",PublicQuote:"N"}),dv=Object.freeze({Regular:"0",SoftDollar:"1",StepIn:"2",StepOut:"3",SoftDollarStepIn:"4",SoftDollarStepOut:"5",PlanSponsor:"6"}),iv=Object.freeze({AGENCY:1,COMMODITY:2,CORPORATE:3,CURRENCY:4,EQUITY:5,GOVERNMENT:6,INDEX:7,LOAN:8,MONEYMARKET:9,MORTGAGE:10,MUNICIPAL:11,OTHER:12,FINANCING:13}),av=Object.freeze({BuySideRequests:1,SellSideSends:2,RealTimeExecutionReports:3}),nv=Object.freeze({Business:0,Calendar:1,CommodityBusiness:2,CurrencyBusiness:3,ExchangeBusiness:4,ScheduledTradingDay:5}),rv=Object.freeze({RestructuringMultipleHoldingObligations:"H",RestructuringMultipleCreditEventNotices:"E",FloatingRateInterestShortfall:"C"}),ov=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),sv=Object.freeze({FlatFee:0,AmortizedFee:1,FundingFee:2,FlatAndFundingFee:3,AmortizedAndFundingFee:4}),cv=Object.freeze({ExercisingParty:0,NonExercisingParty:1,MasterAgreeent:2,Supplement:3}),pv=Object.freeze({CashPrice:0,CashPriceAlternate:1,ParYieldCurveAdjusted:2,ZeroCouponYieldCurveAdjusted:3,ParYieldCurveUnadjusted:4,CrossCurrency:5,CollateralizedPrice:6}),lv=Object.freeze({Unadjusted:0,Adjusted:1}),uv=Object.freeze({Bid:0,Mid:1,Offer:2,ExercisingPartyPays:3}),mv=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),yv=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),Sv=Object.freeze({Unadjusted:0,Adjusted:1}),Pv=Object.freeze({Buy:1,Sell:2}),gv=Object.freeze({MandatoryEarlyTermination:0,OptionalEarlyTermination:1,Cancelable:2,Extendable:3,MutualEarlyTermination:4,Evergreen:5,Callable:6,Puttable:7}),hv=Object.freeze({DoNotReportTrade:"N",ReportTrade:"Y"}),fv=Object.freeze({Put:0,Call:1,Other:2,Chooser:3}),Iv=Object.freeze({Units:0,Contracts:1,UnitsOfMeasurePerTimeUnit:2}),bv=Object.freeze({ReceivedNotYetProcessed:0,Accepted:1,Rejected:2}),Fv=Object.freeze({QuoteAboveStandardMarketSize:0,QuoteAboveSpecificInstrumentSize:1,QuoteApplicableForLiquidtyProvisionActivity:2,QuoteIssuerStatus:3,BidOrAskRequest:4}),Ev=Object.freeze({CancelForOneOrMoreSecurities:1,CancelForSecurityType:2,CancelForUnderlyingSecurity:3,CancelAllQuotes:4,CancelSpecifiedSingleQuote:5,CancelByTypeOfQuote:6,CancelForSecurityIssuer:7,CancelForIssuerOfUnderlyingSecurity:8}),vv=Object.freeze({Open:"A",Closed:"B",ExchangeBest:"C",ConsolidatedBest:"D",Locked:"E",Crossed:"F",Depth:"G",FastTrading:"H",NonFirm:"I",Manual:"L",OutrightPrice:"J",ImpliedPrice:"K",DepthOnOffer:"M",DepthOnBid:"N",Closing:"O",NewsDissemination:"P",TradingRange:"Q",OrderInflux:"R",DueToRelated:"S",NewsPending:"T",AdditionalInfo:"U",AdditionalInfoDueToRelated:"V",Resume:"W",ViewOfCommon:"X",VolumeAlert:"Y",OrderImbalance:"Z",EquipmentChangeover:"a",NoOpen:"b",RegularETH:"c",AutomaticExecution:"d",AutomaticExecutionETH:"e",FastMarketETH:"f",InactiveETH:"g",Rotation:"h",RotationETH:"i",Halt:"j",HaltETH:"k",DueToNewsDissemination:"l",DueToNewsPending:"m",TradingResume:"n",OutOfSequence:"o",BidSpecialist:"p",OfferSpecialist:"q",BidOfferSpecialist:"r",EndOfDaySAM:"s",ForbiddenSAM:"t",FrozenSAM:"u",PreOpeningSAM:"v",OpeningSAM:"w",OpenSAM:"x",SurveillanceSAM:"y",SuspendedSAM:"z",ReservedSAM:"0",NoActiveSAM:"1",Restricted:"2",RestOfBookVWAP:"3",BetterPricesInConditionalOrders:"4",MedianPrice:"5",FullCurve:"6",FlatCurve:"7"}),Cv=Object.freeze({UnknownSymbol:1,Exchange:2,QuoteExceedsLimit:3,TooLateToEnter:4,UnknownQuote:5,DuplicateQuote:6,InvalidBidAskSpread:7,InvalidPrice:8,NotAuthorizedToQuoteSecurity:9}),Xv=Object.freeze({Accepted:0,Rejected:5,RemovedFromMarket:6,Expired:7,LockedMarketWarning:12,CrossMarketWarning:13,CanceledDueToLockMarket:14,CanceledDueToCrossMarket:15,Active:16}),Tv=Object.freeze({QuoteEntry:1,QuoteModification:2}),Dv=Object.freeze({Percent:1,PerShare:2,FixedAmount:3,Discount:4,Premium:5,Spread:6,TEDPrice:7,TEDYield:8,YieldSpread:9,Yield:10,PriceSpread:12,ProductTicksInHalves:13,ProductTicksInFourths:14,ProductTicksInEighths:15,ProductTicksInSixteenths:16,ProductTicksInThirtySeconds:17,ProductTicksInSixtyFourths:18,ProductTicksInOneTwentyEighths:19,NormalRateRepresentation:20,InverseRateRepresentation:21,BasisPoints:22,UpFrontPoints:23,InterestRate:24,PercentageOfNotional:25}),Rv=Object.freeze({UnknownSymbol:1,Exchange:2,QuoteRequestExceedsLimit:3,TooLateToEnter:4,UnknownQuote:5,DuplicateQuote:6,InvalidBid:7,InvalidPrice:8,NotAuthorizedToQuoteSecurity:9,PriceExceedsCurrentPriceBand:10,QuoteLocked:11,InvalidOrUnknownSecurityIssuer:12,InvalidOrUnknownIssuerOfUnderlyingSecurity:13,NotionalValueExceedsThreshold:14,PriceExceedsCurrentPriceBandDepr:15,ReferencePriceNotAvailable:16,InsufficientCreditLimit:17,ExceededClipSizeLimit:18,ExceededMaxNotionalOrderAmt:19,ExceededDV01PV01Limit:20,ExceededCS01Limit:21,UnavailablePriceLiquidity:22,InvalidMissingEntitlements:23,UnknownAccounts:24,Other:99}),Nv=Object.freeze({UnknownSymbol:1,Exchange:2,QuoteRequestExceedsLimit:3,TooLateToEnter:4,InvalidPrice:5,NotAuthorizedToRequestQuote:6,NoMatchForInquiry:7,NoMarketForInstrument:8,NoInventory:9,Pass:10,InsufficientCredit:11,ExceededClipSizeLimit:12,ExceededMaxNotionalOrderAmt:13,ExceededDV01PV01Limit:14,ExceededCS01Limit:15,UnavailablePriceLiquidity:16,UnmetRegulatoryRequirement:17,UnknownAccounts:18,InvalidMissingEntitlements:19,Other:99}),Av=Object.freeze({Manual:1,Automatic:2,ConfirmQuote:3}),wv=Object.freeze({NoAcknowledgement:0,AcknowledgeOnlyNegativeOrErroneousQuotes:1,AcknowledgeEachQuoteMessage:2,SummaryAcknowledgement:3}),Mv=Object.freeze({Hit:1,Counter:2,Expired:3,Cover:4,DoneAway:5,Pass:6,EndTrade:7,TimedOut:8,Tied:9,TiedCover:10,Accept:11,TerminateContract:12}),xv=Object.freeze({No:"N",Yes:"Y"}),Lv=Object.freeze({Accepted:0,CancelForSymbol:1,CanceledForSecurityType:2,CanceledForUnderlying:3,CanceledAll:4,Rejected:5,RemovedFromMarket:6,Expired:7,Query:8,QuoteNotFound:9,Pending:10,Pass:11,LockedMarketWarning:12,CrossMarketWarning:13,CanceledDueToLockMarket:14,CanceledDueToCrossMarket:15,Active:16,Canceled:17,UnsolicitedQuoteReplenishment:18,PendingEndTrade:19,TooLateToEnd:20,Traded:21,TradedAndRemoved:22,ContractTerminates:23}),Ov=Object.freeze({Indicative:0,Tradeable:1,RestrictedTradeable:2,Counter:3,InitiallyTradeable:4}),Uv=Object.freeze({Bloomberg:0,Reuters:1,Telerate:2,ISDARateOption:3,Other:99}),kv=Object.freeze({Primary:0,Secondary:1}),qv=Object.freeze({AdmitToTradeRequestDate:0,AdmitToTradeApprovalDate:1,AdmitToTradeOrFirstTradeDate:2,TerminationDate:3}),Bv=Object.freeze({Asian:1,AustralianNewZealand:2,EuropeanEmergingMarkets:3,Japanese:4,NorthAmericanHighYield:5,NorthAmericanInsurance:6,NorthAmericanInvestmentGrade:7,Singaporean:8,WesternEuropean:9,WesternEuropeanInsurance:10}),jv=Object.freeze({SecondaryOrderID:"0",OrderID:"1",MDEntryID:"2",QuoteEntryID:"3",OriginalOrderID:"4",QuoteID:"5",QuoteReqID:"6",PreviousOrderIdentifier:"7",PreviousQuoteIdentifier:"8",ParentOrderIdentifier:"9",ManualOrderIdentifier:"A"}),Gv=Object.freeze({GTCFromPreviousDay:0,PartialFillRemaining:1,OrderChanged:2}),Qv=Object.freeze({RiskLimitRequestID:0,RiskLimitCheckID:1,OutOfBandID:3}),Vv=Object.freeze({InvalidAccountType:1,InvalidTaxExemptType:2,InvalidOwnershipType:3,NoRegDetails:4,InvalidRegSeqNo:5,InvalidRegDetails:6,InvalidMailingDetails:7,InvalidMailingInstructions:8,InvalidInvestorID:9,InvalidInvestorIDSource:10,InvalidDateOfBirth:11,InvalidCountry:12,InvalidDistribInstns:13,InvalidPercentage:14,InvalidPaymentMethod:15,InvalidAccountName:16,InvalidAgentCode:17,InvalidAccountNum:18,Other:99}),zv=Object.freeze({Accepted:"A",Rejected:"R",Held:"H",Reminder:"N"}),Hv=Object.freeze({New:"0",Cancel:"2",Replace:"1"}),Wv=Object.freeze({RT:0,PET:1,Snapshot:2,Confirmation:3,RTPET:4,PETConfirmation:5,RTPETConfirmation:6,PostTrade:7,Verification:8,PstTrdEvnt:9,PstTrdEvntRTReportable:10,LMTF:11,DATF:12,VOLO:13,FWAF:14,IDAF:15,VOLW:16,FULF:17,FULA:18,FULV:19,FULJ:20,COAF:21,Order:22,ChildOrder:23,OrderRoute:24,Trade:25,Quote:26,Supplement:27,NewTransaction:28,TransactionCorrection:29,TransactionModification:30,CollateralUpdate:31,MarginUpdate:32,TransactionReportedInError:33,TerminationEarlyTermination:34}),Kv=Object.freeze({InitialBlockTrade:0,Allocation:1,Clearing:2,Compression:3,Novation:4,Termination:5,PostTrdVal:6}),Yv=Object.freeze({ClearingMember:1,Client:2}),_v=Object.freeze({UniqueTransactionIdentifier:"1"}),Jv=Object.freeze({Current:0,Previous:1,Block:2,Related:3,ClearedBlockTrade:4,TradingVenueTransactionIdentifier:5,ReportTrackingNumber:6}),$v=Object.freeze({None:0,SEFRequiredTransaction:1,SEFPermittedTransaction:2}),Zv=Object.freeze({HedgesForInstrument:1,Underlier:2,EquityEquivalent:3,NearestExchangeTradedContract:4,RetailEquivalent:5,Leg:6}),eC=Object.freeze({NonFIXSource:0,SystemOrderIdentifier:1,ClientOrderIdentifier:2,SecondaryOrderIdentifier:3,SecondaryClientOrderIdentifier:4}),tC=Object.freeze({PosMaintRptID:1,TransferID:2,PositionEntityID:3}),dC=Object.freeze({NBBid:1,NBOffer:2}),iC=Object.freeze({NonFIXSource:0,TradeID:1,SecondaryTradeID:2,TradeReportID:3,FirmTradeID:4,SecondaryFirmTradeID:5,RegulatoryTradeID:6}),aC=Object.freeze({Bid:1,Mid:2,Offer:3}),nC=Object.freeze({ASWSpread:1,OIS:2,ZSpread:3,DiscountMargin:4,ISpread:5,OAS:6,GSpread:7,CDSBasis:8,CDSInterpolatedBasis:9,DV01:10,PV01:11,CS01:12}),rC=Object.freeze({ISO:1,NoAwayMarketBetterCheck:2}),oC=Object.freeze({NoRemunerationPaid:0,RemunerationPaid:1}),sC=Object.freeze({SenderReports:"N",ReceiverReports:"Y"}),cC=Object.freeze({ValidRequest:0,InvalidOrUnsupportedRequest:1,NoDataFound:2,NotAuthorized:3,DataTemporarilyUnavailable:4,RequestForDataNotSupported:5,Other:99}),On=Object.freeze({No:"N",Yes:"Y"}),pC=Object.freeze({AllMarketParticipants:1,SpecifiedMarketParticipants:2,AllMarketMakers:3,PrimaryMarketMaker:4}),lC=Object.freeze({Inband:0,OutOfBand:1}),uC=Object.freeze({FullRestructuring:"FR",ModifiedRestructuring:"MR",ModifiedModRestructuring:"MM",NoRestructuringSpecified:"XR"}),mC=Object.freeze({PriceValuation:0,DividendValuation:1}),yC=Object.freeze({Gross:0,Net:1,Accrued:2,CleanNet:3}),SC=Object.freeze({Initial:0,Interim:1,Final:2}),PC=Object.freeze({AbsoluteTerms:0,PercentageOfNotional:1}),gC=Object.freeze({Open:0,OfficialSettlPx:1,Xetra:2,Close:3,DerivativesClose:4,High:5,Low:6,AsSpecifiedInMasterConfirmation:7}),hC=Object.freeze({None:0,FuturesPrice:1,OptionsPrice:2}),fC=Object.freeze({Dividend:1,Variance:2,Volatility:3,TotalReturn:4,ContractForDifference:5,CreditDefault:6,SpreadBet:7,Price:8,ForwardPriceUnderlyingInstrument:9,Other:99}),IC=Object.freeze({QueueInbound:0,QueueOutbound:1,Reject:2,Disconnect:3,Warning:4,PingCreditCheckWithRevalidation:5,PingCreditCheckNoRevalidation:6,PushCreditCheckWithRevalidation:7,PushCreditCheckNoRevalidation:8,Suspend:9,HaltTrading:10}),bC=Object.freeze({None:0,PlusOneModel:1,PingModel:2,PushModel:3}),FC=Object.freeze({Successful:0,InvalidParty:1,ReqExceedsCreditLimit:2,ReqExceedsClipSizeLimit:3,ReqExceedsMaxNotional:4,Other:99}),EC=Object.freeze({Approved:0,PartiallyApproved:1,Rejected:2,ApprovalPending:3,Cancelled:4}),vC=Object.freeze({AllOrNone:0,Partial:1}),CC=Object.freeze({Accepted:0,Rejected:1,ClaimRequired:2,PreDefinedLimitCheckSucceeded:3,PreDefinedLimitCheckFailed:4,PreDefinedAutoAcceptRuleInvoked:5,PreDefinedAutoRejectRuleInvoked:6,AcceptedByClearingFirm:7,RejectedByClearingFirm:8,Pending:9,AcceptedByCreditHub:10,RejectedByCreditHub:11,PendingCreditHubCheck:12,AcceptedByExecVenue:13,RejectedByExecVenue:14}),XC=Object.freeze({New:0,Cancel:1,Replace:2}),TC=Object.freeze({Submit:0,LimitConsumed:1}),DC=Object.freeze({UnkRiskLmtRprtID:0,UnkPty:1,Other:99}),RC=Object.freeze({Accepted:0,Rejected:1}),NC=Object.freeze({Successful:0,InvalidParty:1,InvalidRelatedParty:2,InvalidRiskLimitType:3,InvalidRiskLimitID:4,InvalidRiskLimitAmount:5,InvalidRiskWarningLevelAction:6,InvalidRiskInstrumentScope:7,RiskLimitActionsNotSupported:8,WarningLevelsNotSupported:9,WarningLevelActionsNotSupported:10,RiskInstrumentScopeNotSupported:11,RiskLimitNotApprovedForParty:12,RiskLimitAlreadyDefinedForParty:13,InstrumentNotApprovedForParty:14,NotAuthorized:98,Other:99}),AC=Object.freeze({Definitions:1,Utilization:2,DefinitionsAndUtilizations:3}),wC=Object.freeze({CreditLimit:0,GrossLimit:1,NetLimit:2,Exposure:3,LongLimit:4,ShortLimit:5,CashMargin:6,AdditionalMargin:7,TotalMargin:8,LimitConsumed:9,ClipSize:10,MaxNotionalOrderSize:11,DV01PV01Limit:12,CS01Limit:13,VolumeLimitPerTimePeriod:14,VolFilledPctOrdVolTmPeriod:15,NotlFilledPctNotlTmPeriod:16,TransactionExecutionLimitPerTimePeriod:17}),MC=Object.freeze({RoundToNearest:"0",RoundDown:"1",RoundUp:"2"}),xC=Object.freeze({NoRoutingArrangementInPlace:0,RoutingArrangementInPlace:1}),LC=Object.freeze({TargetFirm:1,TargetList:2,BlockFirm:3,BlockList:4,TargetPerson:5,BlockPerson:6}),OC=Object.freeze({AgencySingleOrder:"A",ShortExemptTransactionAType:"B",ProprietaryNonAlgo:"C",ProgramOrderMember:"D",ShortExemptTransactionForPrincipal:"E",ShortExemptTransactionWType:"F",ShortExemptTransactionIType:"H",IndividualInvestor:"I",ProprietaryAlgo:"J",AgencyAlgo:"K",ShortExemptTransactionMemberAffliated:"L",ProgramOrderOtherMember:"M",AgentForOtherMember:"N",ProprietaryTransactionAffiliated:"O",Principal:"P",TransactionNonMember:"R",SpecialistTrades:"S",TransactionUnaffiliatedMember:"T",AgencyIndexArb:"U",AllOtherOrdersAsAgentForOtherMember:"W",ShortExemptTransactionMemberNotAffliated:"X",AgencyNonAlgo:"Y",ShortExemptTransactionNonMember:"Z"}),UC=Object.freeze({LocalMarket:"1",National:"2",Global:"3"}),kC=Object.freeze({Fee:0,CreditControls:1,Margin:2,EntitlementOrEligibility:3,MarketData:4,AccountSelection:5,DeliveryProcess:6,Sector:7}),qC=Object.freeze({CUSIP:"1",SEDOL:"2",QUIK:"3",ISINNumber:"4",RICCode:"5",ISOCurrencyCode:"6",ISOCountryCode:"7",ExchangeSymbol:"8",ConsolidatedTapeAssociation:"9",BloombergSymbol:"A",Wertpapier:"B",Dutch:"C",Valoren:"D",Sicovam:"E",Belgian:"F",Common:"G",ClearingHouse:"H",ISDAFpMLSpecification:"I",OptionPriceReportingAuthority:"J",ISDAFpMLURL:"K",LetterOfCredit:"L",MarketplaceAssignedIdentifier:"M",MarkitREDEntityCLIP:"N",MarkitREDPairCLIP:"P",CFTCCommodityCode:"Q",ISDACommodityReferencePrice:"R",FinancialInstrumentGlobalIdentifier:"S",LegalEntityIdentifier:"T",Synthetic:"U",FidessaInstrumentMnemonic:"V",IndexName:"W",UniformSymbol:"X",DigitalTokenIdentifier:"Y"}),BC=Object.freeze({Symbol:0,SecurityTypeAnd:1,Product:2,TradingSessionID:3,AllSecurities:4,MarketIDOrMarketID:5}),jC=Object.freeze({IndustryClassification:1,TradingList:2,Market:3,NewspaperList:4}),GC=Object.freeze({ICB:1,NAICS:2,GICS:3}),QC=Object.freeze({InvalidInstrumentRequested:1,InstrumentAlreadyExists:2,RequestTypeNotSupported:3,SystemUnavailableForInstrumentCreation:4,IneligibleInstrumentGroup:5,InstrumentIDUnavailable:6,InvalidOrMissingDataOnOptionLeg:7,InvalidOrMissingDataOnFutureLeg:8,InvalidOrMissingDataOnFXLeg:10,InvalidLegPriceSpecified:11,InvalidInstrumentStructureSpecified:12}),VC=Object.freeze({ValidRequest:0,InvalidOrUnsupportedRequest:1,NoInstrumentsFound:2,NotAuthorizedToRetrieveInstrumentData:3,InstrumentDataTemporarilyUnavailable:4,RequestForInstrumentDataNotSupported:5}),zC=Object.freeze({RequestSecurityIdentityAndSpecifications:0,RequestSecurityIdentityForSpecifications:1,RequestListSecurityTypes:2,RequestListSecurities:3,Symbol:4,SecurityTypeAndOrCFICode:5,Product:6,TradingSessionID:7,AllSecurities:8,MarketIDOrMarketID:9}),HC=Object.freeze({AcceptAsIs:1,AcceptWithRevisions:2,RejectSecurityProposal:5,CannotMatchSelectionCriteria:6}),WC=Object.freeze({Active:"1",Inactive:"2",ActiveClosingOrdersOnly:"3",Expired:"4",Delisted:"5",KnockedOut:"6",KnockOutRevoked:"7",PendingExpiry:"8",Suspended:"9",Published:"10",PendingDeletion:"11"}),KC=Object.freeze({OrderImbalance:1,TradingResumes:2,PriceVolatilityInterruption:3,ChangeOfTradingSession:4,ChangeOfTradingSubsession:5,ChangeOfSecurityTradingStatus:6,ChangeOfBookType:7,ChangeOfMarketDepth:8,CorporateAction:9}),YC=Object.freeze({OpeningDelay:1,TradingHalt:2,Resume:3,NoOpen:4,PriceIndication:5,TradingRangeIndication:6,MarketImbalanceBuy:7,MarketImbalanceSell:8,MarketOnCloseImbalanceBuy:9,MarketOnCloseImbalanceSell:10,NoMarketImbalance:12,NoMarketOnCloseImbalance:13,ITSPreOpening:14,NewPriceIndication:15,TradeDisseminationTime:16,ReadyToTrade:17,NotAvailableForTrading:18,NotTradedOnThisMarket:19,UnknownOrInvalid:20,PreOpen:21,OpeningRotation:22,FastMarket:23,PreCross:24,Cross:25,PostClose:26,NoCancel:27}),_C=Object.freeze({EuroSupranationalCoupons:"EUSUPRA",CorporateBond:"CORP",ForeignExchangeContract:"FOR",CommonStock:"CS",Repurchase:"REPO",BradyBond:"BRADY",TermLoan:"TERM",BankersAcceptance:"BA",AssetBackedSecurities:"ABS",OtherAnticipationNotes:"AN",MutualFund:"MF",FederalAgencyCoupon:"FAC",CorporatePrivatePlacement:"CPP",NonDeliverableForward:"FXNDF",Cap:"CAP",PreferredStock:"PS",Forward:"FORWARD",CanadianTreasuryNotes:"CAN",RevolverLoan:"RVLV",BankDepositoryNote:"BDN",CanadianMortgageBonds:"CMB",CertificateOfObligation:"COFO",MultilegInstrument:"MLEG",FederalAgencyDiscountNote:"FADN",ConvertibleBond:"CB",FXSpot:"FXSPOT",CreditDefaultSwap:"CDS",DepositoryReceipts:"DR",BuySellback:"BUYSELL",CanadianTreasuryBills:"CTB",Revolver:"RVLVTRM",BankNotes:"BN",Corp:"CMBS",CertificateOfParticipation:"COFP",NoSecurityType:"NONE",USTreasuryNoteOld:"UST",PrivateExportFunding:"PEF",DualCurrency:"DUAL",FXForward:"FXFWD",Collar:"CLLR",SecuritiesLoan:"SECLOAN",EuroSovereigns:"EUSOV",BridgeLoan:"BRIDGE",BillOfExchanges:"BOX",CollateralizedMortgageObligation:"CMO",GeneralObligationBonds:"GO",USTreasuryBillOld:"USTB",USDSupranationalCoupons:"SUPRA",EuroCorporateBond:"EUCORP",FXSwap:"FXSWAP",CommoditySwap:"CMDTYSWAP",SecuritiesPledge:"SECPLEDGE",CanadianProvincialBonds:"PROV",LetterOfCredit:"LOFC",CanadianMoneyMarkets:"CAMM",IOETTEMortgage:"IET",MandatoryTender:"MT",EuroCorporateFloatingRateNotes:"EUFRN",NonDeliverableSwap:"FXNDS",Exotic:"EXOTIC",DeliveryVersusPledge:"DVPLDG",TreasuryBill:"TB",SwingLineFacility:"SWING",CertificateOfDeposit:"CD",MortgageBackedSecurities:"MBS",RevenueAnticipationNote:"RAN",Wildcard:"?",USCorporateFloatingRateNotes:"FRN",FXBankNote:"FXBN",OptionsOnCombo:"OOC",Floor:"FLR",CollateralBasket:"COLLBSKT",USTreasuryBond:"TBOND",DebtorInPossession:"DINP",CallLoans:"CL",MortgageInterestOnly:"MIO",RevenueBonds:"REV",Cash:"CASH",IndexedLinked:"XLINKD",ForeignCurrencyDiscountNote:"FXDN",FRA:"FRA",StructuredFinanceProduct:"SFP",InterestStripFromAnyBondOrNote:"TINT",Defaulted:"DEFLTED",CommercialPaper:"CP",MortgagePrincipalOnly:"MPO",SpecialAssessment:"SPCLA",Other:"Other",StructuredNotes:"STRUCT",Future:"FUT",USTreasuryBill:"TBILL",TreasuryInflationProtectedSecurities:"TIPS",Withdrawn:"WITHDRN",DepositNotes:"DN",MortgagePrivatePlacement:"MPP",SpecialObligation:"SPCLO",ExchangeTradedNote:"ETN",YankeeCorporateBond:"YANK",DerivativeForward:"FWD",MarginLoan:"MRGNLOAN",PrincipalStripOfACallableBondOrNote:"TCAL",Replaced:"REPLACD",EuroCertificateOfDeposit:"EUCD",MiscellaneousPassThrough:"MPT",SpecialTax:"SPCLT",OffshoreIssuedChineseYuanCorporateBond:"DIMSUMCORP",InterestRateSwap:"IRS",TotalReturnSwap:"TRS",PrincipalStripFromANonCallableBondOrNote:"TPRN",Matured:"MATURED",EuroCommercialPaper:"EUCP",Pfandbrief:"PFAND",TaxAnticipationNote:"TAN",SecuritizedDerivative:"SECDERIV",PreferredCorporateBond:"PRCORP",LoanLease:"LOANLEASE",USTreasuryNote:"TNOTE",Amended:"AMENDED",LiquidityNote:"LQN",ToBeAnnounced:"TBA",TaxAllocation:"TAXA",ExchangeTradedFund:"ETF",OffshoreIssuedChineseYuanSovereignBond:"DIMSUMSOV",Retired:"RETIRED",MediumTermNotes:"MTN",TaxExemptCommercialPaper:"TECP",DigitalAsset:"DIGITAL",OptionsOnFutures:"OOF",SovereignBond:"SOV",Overnight:"ONITE",TaxableMunicipalCP:"TMCP",OptionsOnPhysical:"OOP",USTreasuryFloatingRateNote:"TFRN",PromissoryNote:"PN",ShortTermLoanNote:"STN",TaxRevenueAnticipationNote:"TRAN",Option:"OPT",PlazosFijos:"PZFJ",VariableRateDemandNote:"VRDN",SpotForward:"SPOTFWD",SecuredLiquidityNote:"SLQN",Warrant:"WAR",SwapOption:"SWAPTION",TimeDeposit:"TD",MunicipalInterestBearingCommercialPaper:"MCPIB",Transmission:"XMISSION",TaxableMunicipalBond:"TMB",Index:"INDEX",TermLiquidityNote:"TLQN",VariableRateDemandObligation:"VRDO",BondBasket:"BDBSKT",ExtendedCommNote:"XCN",ContractForDifference:"CFD",YankeeCertificateOfDeposit:"YCD",CorrelationSwap:"CRLTNSWAP",BankAcceptedBill:"BAB",DiviendSwap:"DVDNDSWAP",ShortTermBankNote:"BNST",EquityBasket:"EQBSKT",CallableCommercialPaper:"CLCP",EquityForward:"EQFWD",CommercialNote:"CN",ReturnSwap:"RTRNSWAP",InterestBearingCommercialPaper:"CPIB",VarianceSwap:"VARSWAP",EuroMediumTermNote:"EUMTN",PortfolioSwaps:"PRTFLIOSWAP",EuroNegotiableCommercialPaper:"EUNCP",FuturesOnASwap:"FUTSWAP",EuroStructuredLiquidityNote:"EUSTLQN",ForwardsOnASwap:"FWDSWAP",EuroTimeDeposit:"EUTD",ForwardFreightAgreement:"FWDFRTAGMT",JumboCertificateOfDeposit:"JCD",SpreadBetting:"SPREADBET",MoneyMarketFund:"MMF",ExchangeTradedCommodity:"ETC",MasterNote:"MN",NegotiableCertificateOfDeposit:"NCD",NegotiableCommercialPaper:"NCP",RetailCertificateOfDeposit:"RCD",TermDepositReceipt:"TDR"}),JC=Object.freeze({Add:"A",Delete:"D",Modify:"M"}),$C=Object.freeze({CancelAggressive:1,CancelPassive:2,CancelAggressivePassive:3}),ZC=Object.freeze({SeniorSecured:"SD",Senior:"SR",Subordinated:"SB",Junior:"JR",Mezzanine:"MZ",SeniorNonPreferred:"SN"}),e3=Object.freeze({InvalidTagNumber:0,RequiredTagMissing:1,TagNotDefinedForThisMessageType:2,UndefinedTag:3,TagSpecifiedWithoutAValue:4,ValueIsIncorrect:5,IncorrectDataFormatForValue:6,DecryptionProblem:7,SignatureProblem:8,CompIDProblem:9,SendingTimeAccuracyProblem:10,InvalidMsgType:11,XMLValidationError:12,TagAppearsMoreThanOnce:13,TagSpecifiedOutOfRequiredOrder:14,RepeatingGroupFieldsOutOfOrder:15,IncorrectNumInGroupCountForRepeatingGroup:16,NonDataValueIncludesFieldDelimiter:17,InvalidUnsupportedApplVer:18,Other:99}),t3=Object.freeze({SessionActive:0,SessionPasswordChanged:1,SessionPasswordDueToExpire:2,NewSessionPasswordDoesNotComplyWithPolicy:3,SessionLogoutComplete:4,InvalidUsernameOrPassword:5,AccountLocked:6,LogonsAreNotAllowedAtThisTime:7,PasswordExpired:8,ReceivedMsgSeqNumTooLow:9,ReceivedNextExpectedMsgSeqNumTooHigh:10}),d3=Object.freeze({Multiply:"M",Divide:"D"}),i3=Object.freeze({Versus:0,Free:1,TriParty:2,HoldInCustody:3}),a3=Object.freeze({Negotiation:1,Cancellation:2}),n3=Object.freeze({Default:"0",StandingInstructionsProvided:"1",SpecificAllocationAccountOverriding:"2",SpecificAllocationAccountStanding:"3",SpecificOrderForASingleAccount:"4",RequestReject:"5"}),r3=Object.freeze({UnableToProcessRequest:0,UnknownAccount:1,NoMatchingSettlementInstructionsFound:2,Other:99}),o3=Object.freeze({BrokerCredit:"1",Institution:"2",Investor:"3"}),s3=Object.freeze({New:"N",Cancel:"C",Replace:"R",Restate:"T"}),c3=Object.freeze({CEDEL:"CED",DepositoryTrustCompany:"DTC",EuroClear:"EUR",FederalBookEntry:"FED",LocalMarketSettleLocation:"ISO Country Code",Physical:"PNY",ParticipantTrustCompany:"PTC"}),p3=Object.freeze({CashSettlementRequired:"C",PhysicalSettlementRequired:"P",Election:"E"}),l3=Object.freeze({Regular:"0",Cash:"1",NextDay:"2",TPlus2:"3",TPlus3:"4",TPlus4:"5",Future:"6",WhenAndIfIssued:"7",SellersOption:"8",TPlus5:"9"}),u3=Object.freeze({Preliminary:1,Final:2}),m3=Object.freeze({InstructionsOfBroker:"1",InstructionsForInstitution:"2",Investor:"3",BuyersSettlementInstructions:"4",SellersSettlementInstructions:"5"}),y3=Object.freeze({Cancel:"C",New:"N",Replace:"R",Restate:"T"}),S3=Object.freeze({Unknown:0,LastTradePrice:1,LastBidPrice:2,LastOfferPrice:3,MidPrice:4,AverageLastTradePrice:5,AverageLastTradePeriod:6,UnderlyingPrice:7,CalculatedPrice:8,ManualPrice:9}),P3=Object.freeze({Final:1,Theoretical:2}),g3=Object.freeze({Intraday:"ITD",RegularTradingHours:"RTH",ElectronicTradingHours:"ETH",EndOfDay:"EOD"}),h3=Object.freeze({Received:0,Accepted:1,Rejected:2}),f3=Object.freeze({Received:0,Accepted:1,Rejected:2}),I3=Object.freeze({Shares:1,Derivatives:2,PaymentVsPayment:3,Notional:4,Cascade:5,Repurchase:6,Other:99}),b3=Object.freeze({Regular:"0",Cash:"1",NextDay:"2",TPlus2:"3",TPlus3:"4",TPlus4:"5",Future:"6",WhenAndIfIssued:"7",SellersOption:"8",TPlus5:"9",BrokenDate:"B",FXSpotNextSettlement:"C"}),F3=Object.freeze({ExemptionReasonUnknown:0,IncomingSSE:1,AboveNationalBestBid:2,DelayedDelivery:3,OddLot:4,DomesticArbitrage:5,InternationalArbitrage:6,UnderwriterOrSyndicateDistribution:7,RisklessPrincipal:8,VWAP:9}),E3=Object.freeze({DealerSoldShort:0,DealerSoldShortExempt:1,SellingCustomerSoldShort:2,SellingCustomerSoldShortExempt:3,QualifiedServiceRepresentative:4,QSROrAGUContraSideSoldShortExempt:5}),v3=Object.freeze({NoRestrictions:0,SecurityNotShortable:1,SecurityNotShortableAtOrBelowBestBid:2,SecurityNotShortableWithoutPreBorrow:3}),C3=Object.freeze({Buy:"1",Sell:"2",BuyMinus:"3",SellPlus:"4",SellShort:"5",SellShortExempt:"6",Undisclosed:"7",Cross:"8",CrossShort:"9",CrossShortExempt:"A",AsDefined:"B",Opposite:"C",Subscribe:"D",Redeem:"E",Lend:"F",Borrow:"G",SellUndisclosed:"H"}),X3=Object.freeze({TradeClearingAtExecutionPrice:0,TradeClearingAtAlternateClearingPrice:1}),T3=Object.freeze({SingleSecurity:1,IndividualLegOfAMultilegSecurity:2,MultilegSecurity:3}),D3=Object.freeze({SideValue1:1,SideValue2:2}),R3=Object.freeze({MultipleQuotesAllowed:"N",OnlyOneQuoteAllowed:"Y"}),N3=Object.freeze({WasNotSolicited:"N",WasSolicited:"Y"}),A3=Object.freeze({Other:0,DTCSID:1,ThomsonALERT:2,AGlobalCustodian:3,AccountNet:4}),w3=Object.freeze({ExchangeLast:1,High:2,AveragePrice:3,Turnover:4}),M3=Object.freeze({Connected:1,NotConnectedUnexpected:2,NotConnectedExpected:3,InProcess:4}),x3=Object.freeze({AlternativeMinimumTax:"AMT",IncurredRecovery:"INCURRCVY",AbsolutePrepaymentSpeed:"ABS",AutoReinvestment:"AUTOREINV",AdditionalTerm:"ADDTRM",ConstantPrepaymentPenalty:"CPP",BankQualified:"BANKQUAL",ModifiedEquityDelivery:"MODEQTYDLVY",ConstantPrepaymentRate:"CPR",BargainConditions:"BGNCON",NoReferenceOblication:"NOREFOBLIG",ConstantPrepaymentYield:"CPY",CouponRange:"COUPON",UnknownReferenceObligation:"UNKREFOBLIG",FinalCPROfHomeEquityPrepaymentCurve:"HEP",ISOCurrencyCode:"CURRENCY",AllGuarantees:"ALLGUARANTEES",PercentOfManufacturedHousingPrepaymentCurve:"MHP",CustomStart:"CUSTOMDATE",ReferencePrice:"REFPX",MonthlyPrepaymentRate:"MPR",Geographics:"GEOG",ReferencePolicy:"REFPOLICY",PercentOfProspectusPrepaymentCurve:"PPC",ValuationDiscount:"HAIRCUT",SecuredList:"SECRDLIST",PercentOfBMAPrepaymentCurve:"PSA",Insured:"INSURED",SingleMonthlyMortality:"SMM",IssueDate:"ISSUE",Issuer:"ISSUER",IssueSizeRange:"ISSUESIZE",LookbackDays:"LOOKBACK",ExplicitLotIdentifier:"LOT",LotVariance:"LOTVAR",MaturityYearAndMonth:"MAT",MaturityRange:"MATURITY",MaximumSubstitutions:"MAXSUBS",MinimumDenomination:"MINDNOM",MinimumIncrement:"MININCR",MinimumQuantity:"MINQTY",PaymentFrequency:"PAYFREQ",NumberOfPieces:"PIECES",PoolsMaximum:"PMAX",PoolsPerLot:"PPL",PoolsPerMillion:"PPM",PoolsPerTrade:"PPT",PriceRange:"PRICE",PricingFrequency:"PRICEFREQ",ProductionYear:"PROD",CallProtection:"PROTECT",Purpose:"PURPOSE",BenchmarkPriceSource:"PXSOURCE",RatingSourceAndRange:"RATING",TypeOfRedemption:"REDEMPTION",Restricted:"RESTRICTED",MarketSector:"SECTOR",SecurityTypeIncludedOrExcluded:"SECTYPE",Structure:"STRUCT",SubstitutionsFrequency:"SUBSFREQ",SubstitutionsLeft:"SUBSLEFT",FreeformText:"TEXT",TradeVariance:"TRDVAR",WeightedAverageCoupon:"WAC",WeightedAverageLifeCoupon:"WAL",WeightedAverageLoanAge:"WALA",WeightedAverageMaturity:"WAM",WholePool:"WHOLE",YieldRange:"YIELD",OriginalAmount:"ORIGAMT",AverageFICOScore:"AVFICO",PoolEffectiveDate:"POOLEFFDT",AverageLoanSize:"AVSIZE",PoolInitialFactor:"POOLINITFCTR",MaximumLoanBalance:"MAXBAL",Tranche:"TRANCHE",PoolIdentifier:"POOL",Substitution:"SUBSTITUTION",TypeOfRollTrade:"ROLLTYPE",MULTEXCHFLLBCK:"MULTEXCHFLLBCK",ReferenceToRollingOrClosingTrade:"REFTRADE",COMPSECFLLBCK:"COMPSECFLLBCK",PrincipalOfRollingOrClosingTrade:"REFPRIN",LOCLJRSDCTN:"LOCLJRSDCTN",InterestOfRollingOrClosingTrade:"REFINT",RELVJRSDCTN:"RELVJRSDCTN",AvailableOfferQuantityToBeShownToTheStreet:"AVAILQTY",BrokerCredit:"BROKERCREDIT",OfferPriceToBeShownToInternalBrokers:"INTERNALPX",OfferQuantityToBeShownToInternalBrokers:"INTERNALQTY",TheMinimumResidualOfferQuantity:"LEAVEQTY",MaximumOrderSize:"MAXORDQTY",OrderQuantityIncrement:"ORDRINCR",PrimaryOrSecondaryMarketIndicator:"PRIMARY",BrokerSalesCreditOverride:"SALESCREDITOVR",TraderCredit:"TRADERCREDIT",DiscountRate:"DISCOUNT",YieldToMaturity:"YTM",InterestPayoffOfRollingOrAmendingTrade:"PAYOFF"}),L3=Object.freeze({Int:1,Length:2,NumInGroup:3,SeqNum:4,TagNum:5,Float:6,Qty:7,Price:8,PriceOffset:9,Amt:10,Percentage:11,Char:12,Boolean:13,String:14,MultipleCharValue:15,Currency:16,Exchange:17,MonthYear:18,UTCTimestamp:19,UTCTimeOnly:20,LocalMktDate:21,UTCDateOnly:22,Data:23,MultipleStringValue:24,Country:25,Language:26,TZTimeOnly:27,TZTimestamp:28,Tenor:29}),O3=Object.freeze({Straddle:"STD",Strangle:"STG",Butterfly:"BF",Condor:"CNDR",CallableInversibleSnowball:"CISN",Other:"OTHER"}),U3=Object.freeze({AssignmentAccepted:0,AssignmentRejected:1}),k3=Object.freeze({UnknownClient:0,ExceedsMaximumSize:1,UnknownOrInvalidCurrencyPair:2,NoAvailableStream:3,Other:99}),q3=Object.freeze({StreamAssignmentForNewCustomer:1,StreamAssignmentForExistingCustomer:2}),B3=Object.freeze({Assignment:1,Rejected:2,Terminate:3}),j3=Object.freeze({City:0,Airport:1,WeatherStation:2,WeatherIndex:3}),G3=Object.freeze({Week:"Wk",Month:"Mo"}),Q3=Object.freeze({Day:"D"}),V3=Object.freeze({Execution:0,PortfolioRebalancing:1,Standard:2}),z3=Object.freeze({Term:0,PerBusinessDay:1,PerCalculationPeriod:2,PerSettlPeriod:3,PerCalendarDay:4,PerHour:5,PerMonth:6}),H3=Object.freeze({PaymentCashSettlement:0,PhysicalDelivery:1}),W3=Object.freeze({Bid:0,Mid:1,Offer:2}),K3=Object.freeze({LessThan:1,LessThanOrEqual:2,Equal:3,GreaterThanOrEqual:4,GreaterThan:5}),Y3=Object.freeze({FixedStrike:1,StrikeSetAtExpiration:2,StrikeSetToAverageAcrossLife:3,StrikeSetToOptimalValue:4}),_3=Object.freeze({Snapshot:"0",SnapshotAndUpdates:"1",DisablePreviousSnapshot:"2"}),J3=Object.freeze({BasisSwap:"BS",IndexSwap:"IX",BroadBasedSecuritySwap:"BB",BasketSwap:"SK"}),$3=Object.freeze({Amortizing:"AMTZ",Compounding:"COMP",ConstantNotionalSchedule:"CNST",AccretingNotionalSchedule:"ACRT",CustomNotionalSchedule:"CUST"}),Z3=Object.freeze({EUCPWithLumpSumInterest:"CD",WhenIssued:"WI"}),eX=Object.freeze({VWAP:1,Participate:2,MininizeMarketImpact:3}),tX=Object.freeze({None:0,MaxiISA:1,TESSA:2,MiniCashISA:3,MiniStocksAndSharesISA:4,MiniInsuranceISA:5,CurrentYearPayment:6,PriorYearPayment:7,AssetTransfer:8,EmployeePriorYear:9,EmployeeCurrentYear:10,EmployerPriorYear:11,EmployerCurrentYear:12,NonFundPrototypeIRA:13,NonFundQualifiedPlan:14,DefinedContributionPlan:15,IRA:16,IRARollover:17,KEOGH:18,ProfitSharingPlan:19,US401K:20,SelfDirectedIRA:21,US403b:22,US457:23,RothIRAPrototype:24,RothIRANonPrototype:25,RothConversionIRAPrototype:26,RothConversionIRANonPrototype:27,EducationIRAPrototype:28,EducationIRANonPrototype:29,Other:999}),dX=Object.freeze({ISINOrAltInstrmtID:"I",InterimTaxonomy:"E"}),iX=Object.freeze({Overnight:1,Term:2,Flexible:3,Open:4}),aX=Object.freeze({Received:0,Accepted:1,Rejected:2}),nX=Object.freeze({Start:0,Stop:1,State:2}),rX=Object.freeze({MarketDataGatewayIPAddress:0,MarketDataGatewayPortNumber:1,MarketDataGatewayDataFormat:2,MarketDataGatewayFormatVersion:3,MarketDataGatewayRoutingIPAddress:4,OrderEntryGatewayIPAddress:5,OrderEntryGatewayPortNumber:6,OrderEntryGatewaydataFormat:7,OrderEntryGatewayFormatVersion:8,OrderEntryGatewayRoutingIPAddress:9}),oX=Object.freeze({False:"N",True:"Y"}),sX=Object.freeze({Scheduled:0,Running:1,Completed:2,Cancelled:3}),cX=Object.freeze({Received:0,Accepted:1,Rejected:2}),pX=Object.freeze({New:0,Cancel:1}),lX=Object.freeze({Undefined:0,Pass:1,Fail:2,Warning:3}),uX=Object.freeze({Under:0,Over:1}),mX=Object.freeze({QueueInbound:0,QueueOutbound:1,Reject:2,Disconnect:3,Warning:4}),yX=Object.freeze({OutstandingRequestsUnchanged:0,OutstandingRequestsDecreased:1}),SX=Object.freeze({RejectIfThrottleLimitExceeded:0,QueueIfThrottleLimitExceeded:1}),PX=Object.freeze({ThrottleLimitNotExceededNotQueued:0,QueuedDueToThrottleLimitExceeded:1}),gX=Object.freeze({InboundRate:0,OutstandingRequests:1}),hX=Object.freeze({PlusTick:"0",ZeroPlusTick:"1",MinusTick:"2",ZeroMinusTick:"3"}),fX=Object.freeze({RegularTrading:0,VariableCabinet:1,FixedCabinet:2,TradedAsASpreadLeg:3,SettledAsASpreadLeg:4,TradedAsSpread:5}),IX=Object.freeze({Day:"0",GoodTillCancel:"1",AtTheOpening:"2",ImmediateOrCancel:"3",FillOrKill:"4",GoodTillCrossing:"5",GoodTillDate:"6",AtTheClose:"7",GoodThroughCrossing:"8",AtCrossing:"9",GoodForTime:"A",GoodForAuction:"B",GoodForMonth:"C"}),bX=Object.freeze({Hour:"H",Minute:"Min",Second:"S",Day:"D",Week:"Wk",Month:"Mo",Year:"Yr",Quarter:"Q",EndOfMonth:"EOM",Flexible:"F"}),FX=Object.freeze({UnknownOrders:0,UnknownExecutionFills:1,Other:99}),EX=Object.freeze({Accepted:0,Rejected:1}),vX=Object.freeze({New:0,Cancel:1,Replace:2}),CX=Object.freeze({Add:0,DoNotAdd:1}),XX=Object.freeze({AllocationNotRequired:0,AllocationRequired:1,UseAllocationProvidedWithTheTrade:2,AllocationGiveUpExecutor:3,AllocationFromExecutor:4,AllocationToClaimAccount:5,TradeSplit:6}),TX=Object.freeze({PendingClear:0,Claimed:1,Cleared:2,Rejected:3}),DX=Object.freeze({Uncollateralized:0,PartiallyCollateralized:1,OneWayCollaterallization:2,FullyCollateralized:3,NetExposure:4}),RX=Object.freeze({Cash:"A",AveragePriceTrade:"B",CashTrade:"C",NextDay:"D",Opening:"E",IntradayTradeDetail:"F",Rule127Trade:"G",Rule155Trade:"H",SoldLast:"I",NextDayTrade:"J",Opened:"K",Seller:"L",Sold:"M",StoppedStock:"N",ImbalanceMoreBuyers:"P",ImbalanceMoreSellers:"Q",OpeningPrice:"R",BargainCondition:"S",ConvertedPriceIndicator:"T",ExchangeLast:"U",FinalPriceOfSession:"V",ExPit:"W",Crossed:"X",TradesResultingFromManual:"Y",TradesResultingFromIntermarketSweep:"Z",VolumeOnly:"a",DirectPlus:"b",Acquisition:"c",Bunched:"d",Distribution:"e",BunchedSale:"f",SplitTrade:"g",CancelStopped:"h",CancelETH:"i",CancelStoppedETH:"j",OutOfSequenceETH:"k",CancelLastETH:"l",SoldLastSaleETH:"m",CancelLast:"n",SoldLastSale:"o",CancelOpen:"p",CancelOpenETH:"q",OpenedSaleETH:"r",CancelOnly:"s",CancelOnlyETH:"t",LateOpenETH:"u",AutoExecutionETH:"v",Reopen:"w",ReopenETH:"x",Adjusted:"y",AdjustedETH:"z",Spread:"AA",SpreadETH:"AB",Straddle:"AC",StraddleETH:"AD",Stopped:"AE",StoppedETH:"AF",RegularETH:"AG",Combo:"AH",ComboETH:"AI",OfficialClosingPrice:"AJ",PriorReferencePrice:"AK",StoppedSoldLast:"AL",StoppedOutOfSequence:"AM",OfficialClosingPriceDup:"AN",CrossedOld:"AO",FastMarket:"AP",AutomaticExecution:"AQ",FormT:"AR",BasketIndex:"AS",BurstBasket:"AT",TradeThroughExempt:"AU",QuoteSpread:"AV",LastAuctionPrice:"AW",HighPrice:"AX",LowPrice:"AY",SystematicInternaliser:"AZ",AwayMarket:"BA",MidpointPrice:"BB",TradedBeforeIssueDate:"BC",PreviousClosingPrice:"BD",NationalBestBidOffer:"BE",Cancel:"0",ImpliedTrade:"1",MarketplaceEnteredTrade:"2",MultiAssetClassMultilegTrade:"3",MultilegToMultilegTrade:"4",ShortSaleMinPrice:"5",Benchmark:"6"}),NX=Object.freeze({DoesNotApply:0,ContingentTrade:1,NonContingentTrade:2}),AX=Object.freeze({Novation:0,PartialNovation:1,TradeUnwind:2,PartialTradeUnwind:3,Exercise:4,Netting:5,FullNetting:6,PartialNetting:7,Amendment:8,Increase:9,CreditEvent:10,StrategicRestructuring:11,SuccessionEventReorganization:12,SuccessionEventRenaming:13,Porting:14,Withdrawl:15,Void:16,AccountTransfer:17,GiveUp:18,TakeUp:19,AveragePricing:20,Reversal:21,AllocTrdPosting:22,Cascade:23,Delivery:24,OptionAsgn:25,Expiration:26,Maturity:27,EqualPosAdj:28,UnequalPosAdj:29,Correction:30,EarlyTermination:31,Rerate:32,Other:99}),wX=Object.freeze({NotTradedFlat:"N",TradedFlat:"Y"}),MX=Object.freeze({TradeConfirmation:"0",TwoPartyReport:"1",OnePartyReportForMatching:"2",OnePartyReportForPassThrough:"3",AutomatedFloorOrderRouting:"4",TwoPartyReportForClaim:"5",OnePartyReport:"6",ThirdPtyRptForPassThrough:"7",OnePartyReportAutoMatch:"8"}),xX=Object.freeze({ReceivedNotProcessed:0,Accepted:1,Rejected:2}),LX=Object.freeze({Successful:0,InvalidPartyInformation:1,UnknownInstrument:2,Unauthorized:3,InvalidTradeType:4,Other:99}),OX=Object.freeze({SpecialCumDividend:0,SpecialCumRights:1,SpecialExDividend:2,SpecialExRights:3,SpecialCumCoupon:4,SpecialCumCapitalRepayments:5,SpecialExCoupon:6,SpecialExCapitalRepayments:7,CashSettlement:8,SpecialCumBonus:9,SpecialPrice:10,SpecialExBonus:11,GuaranteedDelivery:12,SpecialDividend:13,PriceImprovement:14,NonPriceFormingTrade:15,TradeExemptedFromTradingObligation:16,PricePending:17,PriceNotApplicable:18}),UX=Object.freeze({PercentPar:0,DealSpread:1,UpfrontPnts:2,UpfrontAmt:3,ParUpfrontAmt:4,SpreadUpfrontAmt:5,UpfrontPntsAmt:6}),kX=Object.freeze({DoNotPublishTrade:0,PublishTrade:1,DeferredPublication:2,Published:3}),qX=Object.freeze({ClearedQuantity:0,LongSideClaimedQuantity:1,ShortSideClaimedQuantity:2,LongSideRejectedQuantity:3,ShortSideRejectedQuantity:4,PendingQuantity:5,TransactionQuantity:6,RemainingQuantity:7,PreviousRemainingQuantity:8}),BX=Object.freeze({NotReported:0,OnBook:1,SISeller:2,SIBuyer:3,NonSISeller:4,SubDelegationByFirm:5,Reportable:6,NonSIBuyer:7,OffBook:8,NotReportable:9}),jX=Object.freeze({Successful:0,InvalidPartyInformation:1,UnknownInstrument:2,UnauthorizedToReportTrades:3,InvalidTradeType:4,PriceExceedsCurrentPriceBand:5,ReferencePriceNotAvailable:6,NotionalValueExceedsThreshold:7,Other:99}),GX=Object.freeze({New:0,Cancel:1,Replace:2,Release:3,Reverse:4,CancelDueToBackOutOfTrade:5}),QX=Object.freeze({Submit:0,Alleged:1,Accept:2,Decline:3,Addendum:4,No:5,TradeReportCancel:6,LockedIn:7,Defaulted:8,InvalidCMTA:9,Pended:10,AllegedNew:11,AllegedAddendum:12,AllegedNo:13,AllegedTradeReportCancel:14,AllegedTradeBreak:15,Verify:16,Dispute:17,NonMaterialUpdate:18}),VX=Object.freeze({Successful:0,InvalidOrUnknownInstrument:1,InvalidTypeOfTradeRequested:2,InvalidParties:3,InvalidTransportTypeRequested:4,InvalidDestinationRequested:5,TradeRequestTypeNotSupported:8,NotAuthorized:9,Other:99}),zX=Object.freeze({Accepted:0,Completed:1,Rejected:2}),HX=Object.freeze({AllTrades:0,MatchedTradesMatchingCriteria:1,UnmatchedTradesThatMatchCriteria:2,UnreportedTradesThatMatchCriteria:3,AdvisoriesThatMatchCriteria:4}),WX=Object.freeze({Agency:"A",VWAPGuarantee:"G",GuaranteedClose:"J",RiskTrade:"R"}),KX=Object.freeze({NumberOfUnits:0,NumberOfRoundLots:1}),YX=Object.freeze({Customer:1,CustomerProfessional:2,BrokerDealer:3,CustomerBrokerDealer:4,Principal:5,MarketMaker:6,AwayMarketMaker:7,SystematicInternaliser:8}),_X=Object.freeze({Day:"1",HalfDay:"2",Morning:"3",Afternoon:"4",Evening:"5",AfterHours:"6",Holiday:"7"}),JX=Object.freeze({PreTrading:"1",OpeningOrOpeningAuction:"2",Continuous:"3",ClosingOrClosingAuction:"4",PostTrading:"5",ScheduledIntradayAuction:"6",Quiescent:"7",AnyAuction:"8",UnscheduledIntradayAuction:"9",OutOfMainSessionTrading:"10",PrivateAuction:"11",PublicAuction:"12",GroupAuction:"13",OrderInitiatedAuction:"14"}),$X=Object.freeze({Automatic:0,Manual:1}),ZX=Object.freeze({TradingResumes:0,ChangeOfTradingSession:1,ChangeOfTradingSubsession:2,ChangeOfTradingStatus:3}),e6=Object.freeze({Electronic:1,OpenOutcry:2,TwoParty:3,Voice:4}),t6=Object.freeze({Testing:1,Simulated:2,Production:3}),d6=Object.freeze({Unknown:0,Halted:1,Open:2,Closed:3,PreOpen:4,PreClose:5,RequestRejected:6}),i6=Object.freeze({UnknownOrInvalidTradingSessionID:1,Other:99}),a6=Object.freeze({ExclusiveArrangement:0,CollateralReuse:1,CollateralArrangementType:2}),n6=Object.freeze({Success:0,InvalidParty:1,UnknownInstrument:2,UnauthorizedToSubmitXfer:3,UnknownPosition:4,Other:99}),r6=Object.freeze({Submit:0,Alleged:1}),o6=Object.freeze({InterFirmTransfer:0,IntraFirmTransfer:1,CMTA:2}),s6=Object.freeze({Received:0,RejectedByIntermediary:1,AcceptPending:2,Accepted:3,Declined:4,Cancelled:5}),c6=Object.freeze({New:0,Replace:1,Cancel:2}),p6=Object.freeze({RequestTransfer:0,AcceptTransfer:1,DeclineTransfer:2}),l6=Object.freeze({Accepted:0,Rejected:1,Received:2}),u6=Object.freeze({NoBookOrderDueToAverageSpreadPrice:0,NoBookOrderDueToRefPrice:1,NoBookOrderDueToOtherConditions:2,NoPublicPriceDueToRefPrice:3,NoPublicPriceDueToIlliquid:4,NoPublicPriceDueToOrderSize:5,DeferralDueToLargeInScale:6,DeferralDueToIlliquid:7,DeferralDueToSizeSpecific:8,NoPublicPriceDueToLargeInScale:9,NoPublicPriceSizeDueToOrderHidden:10,ExemptedDueToSecuritiesFinancingTransaction:11,ExemptedDueToESCBPolicyTransaction:12,ExceptionDueToReportByPaper:13,ExceptionDueToTradeExecutedWithNonReportingParty:14,ExceptionDueToIntraFirmOrder:15,ReportedOutsideReportingHours:16,NoPublicPxDueToPreTradeWaiver:17}),m6=Object.freeze({PreTradeTransparencyWaiver:0,PostTradeDeferral:1,ExemptFromPublication:2,OrderLevelPublicationToSubscribers:3,PriceLevelPublicationToSubscribers:4,OrderLevelPublicationToThePublic:5,PublicationInternalToExecutionVenue:6}),y6=Object.freeze({NotManuallyCaptured:"N",ManuallyCaptured:"Y"}),S6=Object.freeze({ExecutionTime:1,TimeIn:2,TimeOut:3,BrokerReceipt:4,BrokerExecution:5,DeskReceipt:6,SubmissionToClearing:7,TimePriority:8,OrderbookEntryTime:9,OrderSubmissionTime:10,PubliclyReported:11,PublicReportUpdated:12,NonPubliclyReported:13,NonPublicReportUpdated:14,SubmittedForConfirmation:15,UpdatedForConfirmation:16,Confirmed:17,UpdatedForClearing:18,Cleared:19,AllocationsSubmitted:20,AllocationsUpdated:21,AllocationsCompleted:22,SubmittedToRepository:23,PostTrdContntnEvnt:24,PostTradeValuation:25,PreviousTimePriority:26,IdentifierAssigned:27,PreviousIdentifierAssigned:28,OrderCancellationTime:29,OrderModificationTime:30,OrderRoutingTime:31,TradeCancellationTime:32,TradeModificationTime:33,ReferenceTimeForNBBO:34,Affirmed:35}),P6=Object.freeze({Accepted:0,Rejected:1,Cancelled:2,AcceptedWithErrors:3,PendingNew:4,PendingCancel:5,PendingReplace:6,Terminated:7,PendingVerification:8,DeemedVerified:9,Verified:10,Disputed:11}),g6=Object.freeze({CMTA:0,InternalTransferOrAdjustment:1,ExternalTransferOrTransferOfAccount:2,RejectForSubmittingSide:3,AdvisoryForContraSide:4,OffsetDueToAnAllocation:5,OnsetDueToAnAllocation:6,DifferentialSpread:7,ImpliedSpreadLegExecutedAgainstAnOutright:8,TransactionFromExercise:9,TransactionFromAssignment:10,ACATS:11,AI:14,B:15,K:16,LC:17,M:18,N:19,NM:20,NR:21,P:22,PA:23,PC:24,PN:25,R:26,RO:27,RT:28,SW:29,T:30,WN:31,WT:32,OffHoursTrade:33,OnHoursTrade:34,OTCQuote:35,ConvertedSWAP:36,CrossedTrade:37,InterimProtectedTrade:38,LargeInScale:39,WashTrade:40,TradeAtSettlement:41,AuctionTrade:42,TradeAtMarker:43,CreditDefault:44,CreditRestructuring:45,Merger:46,SpinOff:47,MultilateralCompression:48,Balancing:50,BasisTradeIndexClose:51,TradeAtCashOpen:52,TrdSubmitVenueClrSettl:53,BilateralCompression:54}),h6=Object.freeze({RegularTrade:0,BlockTrade:1,EFP:2,Transfer:3,LateTrade:4,TTrade:5,WeightedAveragePriceTrade:6,BunchedTrade:7,LateBunchedTrade:8,PriorReferencePriceTrade:9,AfterHoursTrade:10,ExchangeForRisk:11,ExchangeForSwap:12,ExchangeOfFuturesFor:13,ExchangeOfOptionsForOptions:14,TradingAtSettlement:15,AllOrNone:16,FuturesLargeOrderExecution:17,ExchangeOfFuturesForFutures:18,OptionInterimTrade:19,OptionCabinetTrade:20,PrivatelyNegotiatedTrades:22,SubstitutionOfFuturesForForwards:23,ErrorTrade:24,SpecialCumDividend:25,SpecialExDividend:26,SpecialCumCoupon:27,SpecialExCoupon:28,CashSettlement:29,SpecialPrice:30,GuaranteedDelivery:31,SpecialCumRights:32,SpecialExRights:33,SpecialCumCapitalRepayments:34,SpecialExCapitalRepayments:35,SpecialCumBonus:36,SpecialExBonus:37,LargeTrade:38,WorkedPrincipalTrade:39,BlockTrades:40,NameChange:41,PortfolioTransfer:42,ProrogationBuy:43,ProrogationSell:44,OptionExercise:45,DeltaNeutralTransaction:46,FinancingTransaction:47,NonStandardSettlement:48,DerivativeRelatedTransaction:49,PortfolioTrade:50,VolumeWeightedAverageTrade:51,ExchangeGrantedTrade:52,RepurchaseAgreement:53,OTC:54,ExchangeBasisFacility:55,OpeningTrade:56,NettedTrade:57,BlockSwapTrade:58,CreditEventTrade:59,SuccessionEventTrade:60,GiveUpGiveInTrade:61,DarkTrade:62,TechnicalTrade:63,Benchmark:64,PackageTrade:65,RollTrade:66,ClosingPriceTrade:67,InterFundTransferTrade:68,NetAssetValueCalculatedTrade:69}),f6=Object.freeze({Activate:"1",Modify:"2",Cancel:"3"}),I6=Object.freeze({NotTriggered:0,Triggered:1,StopOrderTriggered:2,OCOOrderTriggered:3,OTOOrderTriggered:4,OUOOrderTriggered:5}),b6=Object.freeze({Market:"1",Limit:"2"}),F6=Object.freeze({Up:"U",Down:"D"}),E6=Object.freeze({BestOffer:"1",LastTrade:"2",BestBid:"3",BestBidOrLastTrade:"4",BestOfferOrLastTrade:"5",BestMid:"6"}),v6=Object.freeze({None:"0",Local:"1",National:"2",Global:"3"}),C6=Object.freeze({ThisOrder:0,OtherOrder:1,AllOtherOrdersForGivenSecurity:2,AllOtherOrdersForGivenSecurityAndPrice:3,AllOtherOrdersForGivenSecurityAndSide:4,AllOtherOrdersForGivenSecurityPriceAndSide:5}),X6=Object.freeze({PartialExecution:"1",SpecifiedTradingSession:"2",NextAuction:"3",PriceMovement:"4",OnOrderEntryOrModification:"5"}),T6=Object.freeze({FIXED:"FIXED",DIFF:"DIFF"}),D6=Object.freeze({Divide:"D",Multiply:"M"}),R6=Object.freeze({Execution:0,PortfolioRebalancing:1,Standard:2}),N6=Object.freeze({Bond:"0",ConvertibleBond:"1",Mortgage:"2",Loan:"3"}),A6=Object.freeze({Regular:1,SpecialReference:2,OptimalValue:3,AverageValue:4}),w6=Object.freeze({TPlus1:2,TPlus3:4,TPlus4:5}),M6=Object.freeze({BillionCubicFeet:"Bcf",Allowances:"Alw",CubicMeters:"CBM",Barrels:"Bbl",Gigajoules:"GJ",BoardFeet:"BDFT",HeatRate:"kHR",Bushels:"Bu",KilowattHours:"kWh",Currency:"Ccy",MegaHeatRate:"MHR",CoolingDegreeDay:"CDD",OneMillionBTU:"MMBtu",CertifiedEmissionsReduction:"CER",MegawattHours:"MWh",CriticalPrecipDay:"CPD",Therms:"thm",ClimateReserveTonnes:"CRT",TonsOfCarbonDioxide:"tnCO2",Hundredweight:"cwt",Day:"day",DryMetricTons:"dt",EnvAllwncCert:"EnvAllwnc",EnvironmentalCredit:"EnvCrd",EnvironmentalOffset:"EnvOfst",Grams:"g",Gallons:"Gal",GrossTons:"GT",HeatingDegreeDay:"HDD",IndexPoint:"IPNT",Kilograms:"kg",Kiloliters:"kL",KilowattYear:"kW-a",KilowattDay:"kW-d",KilowattHour:"kW-h",KilowattMonth:"kW-M",KilowattMinute:"kW-min",Liters:"L",Pounds:"lbs",MegawattYear:"MW-a",MegawattDay:"MW-d",MegawattHour:"MW-h",MegawattMonth:"MW-M",MegawattMinute:"MW-min",TroyOunces:"oz_tr",PrincipalWithRelationToDebtInstrument:"PRINC",MetricTons:"t",Tons:"tn",Are:"a",Acre:"ac",Centiliter:"cL",Centimeter:"cM",DieselGallonEquivalent:"DGE",Foot:"ft",GBGallon:"Gal_gb",GasolineGallonEquivalent:"GGE",Hectare:"ha",Inch:"in",Kilometer:"kM",Meter:"M",Mile:"mi",Milliliter:"mL",Millimeter:"mM",USOunce:"oz",Piece:"pc",USPint:"pt",GBPint:"pt_gb",USQuart:"qt",GBQuart:"qt_gb",SquareCentimeter:"SqcM",SquareFoot:"Sqft",SquareInch:"Sqin",SquareKilometer:"SqkM",SquareMeter:"SqM",SquareMile:"Sqmi",SquareMillimeter:"SqmM",SquareYard:"Sqyd",Yard:"yd",MillionBarrels:"MMbbl",USDollars:"USD"}),x6=Object.freeze({MessageIsBeingSentAsAResultOfAPriorRequest:"N",MessageIsBeingSentUnsolicited:"Y"}),L6=Object.freeze({Percentage:1,FixedAmount:3}),O6=Object.freeze({Normal:"0",Flash:"1",Background:"2"}),U6=Object.freeze({LogOnUser:1,LogOffUser:2,ChangePasswordForUser:3,RequestIndividualUserStatus:4,RequestThrottleLimit:5}),k6=Object.freeze({LoggedIn:1,NotLoggedIn:2,UserNotRecognised:3,PasswordIncorrect:4,PasswordChanged:5,Other:6,ForcedUserLogoutByExchange:7,SessionShutdownWarning:8,ThrottleParametersChanged:9}),q6=Object.freeze({PremiumStyle:"EQTY",FuturesStyleMarkToMarket:"FUT",FuturesStyleWithAnAttachedCashAdjustment:"FUTDA",CDSStyleCollateralization:"CDS",CDSInDeliveryUseRecoveryRateToCalculate:"CDSD"}),B6=Object.freeze({DoNotCheck:0,Check:1,BestEffort:2}),j6=Object.freeze({PriceCheck:1,NotionalValueCheck:2,QuantityCheck:3}),G6=Object.freeze({Electronic:"E",Pit:"P",ExPit:"X",ClearingHouse:"C",RegisteredMarket:"R",OffMarket:"O",CentralLimitOrderBook:"B",QuoteDrivenMarket:"Q",DarkOrderBook:"D",AuctionDrivenMarket:"A",QuoteNegotiation:"N",VoiceNegotiation:"V",HybridMarket:"H",OtherMarket:"z"}),Q6=Object.freeze({NonElectronic:0,Electronic:1}),V6=Object.freeze({NotWorking:"N",Working:"Y"}),z6=Object.freeze({AfterTaxYield:"AFTERTAX",AnnualYield:"ANNUAL",YieldAtIssue:"ATISSUE",YieldToAverageMaturity:"AVGMATURITY",BookYield:"BOOK",YieldToNextCall:"CALL",YieldChangeSinceClose:"CHANGE",ClosingYield:"CLOSE",CompoundYield:"COMPOUND",CurrentYield:"CURRENT",GvntEquivalentYield:"GOVTEQUIV",TrueGrossYield:"GROSS",YieldWithInflationAssumption:"INFLATION",InverseFloaterBondYield:"INVERSEFLOATER",MostRecentClosingYield:"LASTCLOSE",ClosingYieldMostRecentMonth:"LASTMONTH",ClosingYieldMostRecentQuarter:"LASTQUARTER",ClosingYieldMostRecentYear:"LASTYEAR",YieldToLongestAverageLife:"LONGAVGLIFE",MarkToMarketYield:"MARK",YieldToMaturity:"MATURITY",YieldToNextRefund:"NEXTREFUND",OpenAverageYield:"OPENAVG",PreviousCloseYield:"PREVCLOSE",ProceedsYield:"PROCEEDS",YieldToNextPut:"PUT",SemiAnnualYield:"SEMIANNUAL",YieldToShortestAverageLife:"SHORTAVGLIFE",SimpleYield:"SIMPLE",TaxEquivalentYield:"TAXEQUIV",YieldToTenderDate:"TENDER",TrueYield:"TRUE",YieldValueOf32nds:"VALUE1_32",YieldToWorst:"WORST"}),So=(t,e)=>{if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);let d=[new V(O.BeginString,t.fixVersion),new V(O.MsgType,be.Heartbeat),new V(O.MsgSeqNum,t.getNextTargetMsgSeqNum()),new V(O.SenderCompID,t.sender),new V(O.TargetCompID,t.target),new V(O.SendingTime,t.getTimestamp(new Date))];return e&&d.push(e),t.createMessage(...d)},wr=(t,e,d,i=hn.GapFillMessage)=>{if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);let a=[new V(O.BeginString,t.fixVersion),new V(O.MsgType,be.SequenceReset),new V(O.MsgSeqNum,e),new V(O.SenderCompID,t.sender),new V(O.TargetCompID,t.target),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.GapFillFlag,i),new V(O.NewSeqNo,d+1)];return t.createMessage(...a)},vg=(t,e,d)=>{if(t.isLoggedIn)return t.connectionType==="acceptor"?d.getField(O.ResetSeqNumFlag)&&d.getField(O.ResetSeqNumFlag).value.toString()==="Y"&&(t.logger.log({level:"info",message:`FIXServer (${t.protocol.toUpperCase()}): -- Logon acknowledged by acceptor.`,fix:d.encode("|")}),t.messageStoreIn.setNextMsgSeqNum(1)):t.logger.log({level:"info",message:`FIXServer (${t.protocol.toUpperCase()}): -- Logon acknowledged by initiator.`,fix:d.encode("|")}),!0;let i=String(d.getField(O.BeginString)?.value),a=!0,n=!0;i&&(t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): -- FIX version set to ${i}`,fix:d.encode("|")}),t.fixVersion=i,t.fixParser&&(t.fixParser.fixVersion=i));let r=d.getField(O.TargetCompID)?.value?.toString()??t.sender,o=d.getField(O.SenderCompID)?.value?.toString()??t.target;if(r&&r!==t.sender&&(t.logger.logWarning({message:`FIXServer (${t.protocol.toUpperCase()}): -- Expected TargetCompID=${t.sender}, but got ${r}`,fix:d.encode("|")}),n=!1),o&&o!==t.target&&(t.logger.logWarning({message:`FIXServer (${t.protocol?.toUpperCase()}): -- Expected SenderCompID=${t.target}, but got ${o}`,fix:d.encode("|")}),a=!1),a&&n){if(t.connectionType==="acceptor"){let p=t.createMessage(new V(O.MsgType,be.Logon),new V(O.MsgSeqNum,d.getField(O.MsgSeqNum)?.value?.toString()),new V(O.SenderCompID,r),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.TargetCompID,o),new V(O.ResetSeqNumFlag,d.getField(O.ResetSeqNumFlag)?.value?.toString()==="Y"?On.Yes:On.No),new V(O.EncryptMethod,ds.None),new V(O.HeartBtInt,d.getField(O.HeartBtInt)?d.getField(O.HeartBtInt)?.value:t.heartBeatInterval));t.send(p),t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): >> sent Logon acknowledge`,fix:p.encode("|")})}d.getField(O.ResetSeqNumFlag)&&d.getField(O.ResetSeqNumFlag)?.value?.toString()==="Y"&&(t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): -- Logon contains ResetSeqNumFlag=Y, resetting sequence numbers to 1`,fix:d.encode("|")}),t.messageStoreIn.setNextMsgSeqNum(1),t.setNextTargetMsgSeqNum(2)),t.isLoggedIn=!0,t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): >> Logon successful by ${t.connectionType}`,fix:d.encode("|")});let c=d.getField(O.HeartBtInt)?Number(d.getField(O.HeartBtInt)?.value):t.heartBeatInterval;return t.heartBeatInterval=c,t.fixParser&&(t.fixParser.heartBeatInterval=c),t.startHeartbeat(c),!0}let s=t.createMessage(new V(O.MsgType,be.Logout),new V(O.MsgSeqNum,t.getNextTargetMsgSeqNum()),new V(O.SenderCompID,a?o:"INVALID_SENDER"),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.TargetCompID,n?r:"INVALID_TARGET"),new V(O.Text,"Invalid Logon TARGET or SENDER."));return t.isLoggedIn=!1,t.send(s),t.logger.logWarning({message:`FIXServer (${t.protocol?.toUpperCase()}): >> sent Logout due to invalid Logon`,fix:d.encode("|")}),t.stopHeartbeat(),t.close(),!1},Cg=(t,e)=>{if(t.isLoggedIn=!1,!t.requestedLogout){let d=t.createMessage(new V(O.MsgType,be.Logout),new V(O.MsgSeqNum,t.getNextTargetMsgSeqNum()),new V(O.SenderCompID,e.getField(O.SenderCompID)?e.getField(O.SenderCompID).value.toString():t.sender),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.TargetCompID,e.getField(O.TargetCompID)?e.getField(O.TargetCompID).value.toString():t.target),new V(O.Text,"Logout acknowledgement"));t.send(d),t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): >> sent Logout acknowledge`,fix:d.encode("|")})}t.stopHeartbeat(),t.close()},Xg=(t,e,d)=>{let i=d.getField(O.BeginSeqNo)?Number(d.getField(O.BeginSeqNo)?.value):void 0,a=d.getField(O.EndSeqNo)?Number(d.getField(O.EndSeqNo)?.value):void 0;if(i===void 0||a===void 0){t.logger.logWarning({message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- Ignoring ResendRequest - Invalid BeginSeqNo or EndSeqNo`});return}if(a===0&&(a=t.getNextTargetMsgSeqNum()>i?t.getNextTargetMsgSeqNum()-1:i),e.size()===0){t.logger.logWarning({message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- Message Store does not contain the messages requested by the ResendRequest. Sending SequenceReset.`}),t.send(wr(t,i,a,hn.SequenceReset)),t.setNextTargetMsgSeqNum(a+1);return}if(i>=1&&a>=i){let n=i,r=a;for(n;n<=a;n++){let o=e.getByMsgSequence(n);if(o){let s=o,c=s.getField(O.MsgType)?.value;if(c===kt.Heartbeat||c===kt.Logon||c===kt.Logout||c===kt.Reject||c===kt.ResendRequest||c===kt.SequenceReset||c===kt.TestRequest||c===kt.XMLnonFIX||c===kt.MarketDataSnapshotFullRefresh||c===kt.SecurityDefinition){if(i===a||n<a){let p=wr(t,n,n,hn.GapFillMessage);t.send(p),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> resending message with sequence ${n} (replaced administrative message)`,fix:p.encode("|")})}}else{if(s.removeFieldByTag(O.PossDupFlag),s.addField(new V(O.PossDupFlag,Eg.PossibleDuplicate)),s.getField(O.SendingTime)){let p=`${s.getField(O.SendingTime)?.value}`;s.removeFieldByTag(O.SendingTime),s.addField(new V(O.SendingTime,t.getTimestamp(new Date))),s.removeFieldByTag(O.OrigSendingTime),s.addField(new V(O.OrigSendingTime,p))}t.send(s),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> resending message with sequence ${n}`,fix:s.encode("|")})}r=n+1}else{t.send(wr(t,n,a,hn.GapFillMessage)),t.logger.logWarning({message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- Could not find message with sequence ${n}. Sending SequenceReset-GapFill from ${n} to ${a}...`}),r=a+1;break}}t.setNextTargetMsgSeqNum(r),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> sent message sequence from ${i} to ${a}`})}else t.logger.logWarning({message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- BeginSeqNo<${i}> or EndSeqNo<${a}> out of range`})},Tg=(t,e)=>{if(e.messageSequence!==t.messageStoreIn.getNextMsgSeqNum()&&e.messageType!==be.Logon&&e.messageType!==be.SequenceReset){t.logger.logWarning({message:`FIXServer (${t.protocol?.toUpperCase()}): Expected MsgSeqNum ${t.messageStoreIn.getNextMsgSeqNum()}, but got ${e.messageSequence}`,fix:e.encode("|")});let d=t.createMessage(new V(O.MsgType,be.ResendRequest),new V(O.MsgSeqNum,t.getNextTargetMsgSeqNum()),new V(O.SenderCompID,t.sender),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.TargetCompID,t.target),new V(O.BeginSeqNo,t.messageStoreIn.getNextMsgSeqNum()),new V(O.EndSeqNo,0));return t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): Sending ResendRequest from ${t.messageStoreIn.getNextMsgSeqNum()} to 0`,fix:d.encode("|")}),t.send(d),!1}return!0},Dg=(t,e)=>{let d=e.getField(O.NewSeqNo)?.value;d&&Number.isFinite(d)&&(t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- SequenceReset: new sequence number ${d}`,fix:e.encode("|")}),t.messageStoreIn.setNextMsgSeqNum(Number(d)-1))},Rg=(t,e)=>{let d=So(t),i=e.getField(O.TestReqID)?.value??null;if(i!==null&&i!==""){let a=new V(O.TestReqID,i);d=So(t,a),t.send(d),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> responded to TestRequest with Heartbeat<TestReqID=${i}>`,fix:d.encode("|")})}else t.send(d),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> responded to TestRequest with Heartbeat`,fix:d.encode("|")})},Mr=(t,e)=>{Tg(t,e),t.logger.log({level:"info",message:`FIXParser (${t.protocol?.toUpperCase()}): << received ${e.description}`,fix:e.encode("|")}),t.restartHeartbeat(),e.messageType===be.SequenceReset?Dg(t,e):e.messageType===be.TestRequest?Rg(t,e):e.messageType===be.Logon?vg(t,t.messageStoreOut,e):e.messageType===be.Logout?Cg(t,e):e.messageType===be.ResendRequest&&Xg(t,t.messageStoreOut,e),t.messageStoreIn.setNextMsgSeqNum(t.messageStoreIn.getNextMsgSeqNum()+1)},xc=class extends Ng{data;constructor(t){super(t),this.data=""}_transform(t,e,d){let i=(String(this.data)+t).split(/(8=.+?\x0110=\d\d\d\x01)/gs),a=0;for(a;a<i.length-1;a++)this.push(i[a]);this.data=i[i.length-1],d()}destroy(t){return this.data=void 0,super.destroy(t)}},vu=class{static version=yg;parserName="FIXParser";fixParserBase=new Ig;heartBeatIntervalId=void 0;socket=void 0;connected=!1;host;port;protocol="tcp";sender=void 0;target=void 0;heartBeatInterval=Xc;fixVersion=xa;messageStoreIn=new Ka;messageStoreOut=new Ka;requestedLogout=!1;connectionType="initiator";logger=new Mc;logging=!0;logOptions;proxy;tlsOptions;tlsSkipStdInPipe;tlsTimeout;tlsEncoding=Dc;onMessageCallbacks=[];onOpenCallbacks=[];onErrorCallbacks=[];onCloseCallbacks=[];onReadyCallbacks=[];constructor(t={logging:!0,logOptions:void 0,fixVersion:xa,skipValidation:!1,plugins:[]}){if(this.logging=t.logging??!0,this.logOptions=t.logOptions,this.fixParserBase.fixVersion=ba(t.fixVersion),this.fixVersion=this.fixParserBase.fixVersion,this.fixParserBase.skipValidation=t.skipValidation,t.plugins)for(let e of t.plugins)e.register(this)}addOnMessageCallback(t){this.onMessageCallbacks.push(t)}addOnOpenCallback(t){this.onOpenCallbacks.push(t)}addOnErrorCallback(t){this.onErrorCallbacks.push(t)}addOnCloseCallback(t){this.onCloseCallbacks.push(t)}addOnReadyCallback(t){this.onReadyCallbacks.push(t)}triggerOnMessage(t){for(let e of this.onMessageCallbacks)e?.(t)}triggerOnOpen(){for(let t of this.onOpenCallbacks)t?.()}triggerOnError(t){for(let e of this.onErrorCallbacks)e?.(t)}triggerOnClose(){for(let t of this.onCloseCallbacks)t?.()}triggerOnReady(){for(let t of this.onReadyCallbacks)t?.()}onMessageCallback=()=>{};onOpenCallback=()=>{};onErrorCallback=()=>{};onCloseCallback=()=>{};onReadyCallback=()=>{};connect(t={}){let{host:e="localhost",port:d=9878,protocol:i="tcp",sender:a="SENDER",target:n="TARGET",heartbeatIntervalSeconds:r=Xc,fixVersion:o=this.fixVersion,messageStoreIn:s=new Ka,messageStoreOut:c=new Ka,tlsOptions:p={},tlsSkipStdInPipe:u=!1,tlsTimeout:m=Tc,tlsEncoding:S=Dc,proxy:g=void 0,onMessage:y=this.onMessageCallback,onOpen:P=this.onOpenCallback,onError:f=this.onErrorCallback,onClose:E=this.onCloseCallback,onReady:v=this.onReadyCallback}=t;if(this.logger=new Mc(this.logOptions?{name:this.logOptions.name??"fixparser",...this.logOptions}:{name:"fixparser",format:"json"}),this.logging||(this.logger.silent=!0),Me.setLogger(this.logger),!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);switch(this.connectionType="initiator",this.fixVersion=ba(o),this.fixParserBase.fixVersion=ba(o),this.messageStoreIn=s,this.messageStoreOut=c,this.protocol=i,this.sender=a,this.target=n,this.port=d,this.host=e,this.proxy=g,p&&(this.tlsOptions=p),u&&(this.tlsSkipStdInPipe=u),m&&(this.tlsTimeout=m),S&&(this.tlsEncoding=S),this.heartBeatInterval=r,this.onMessageCallback=y,this.onOpenCallback=P,this.onErrorCallback=f,this.onCloseCallback=E,this.onReadyCallback=v,i){case"tcp":this.connectTcp();break;case"ssl-tcp":case"tls-tcp":this.connectTlsTcp();break;case"websocket":this.connectWebsocket();break;default:throw new Error(`Unsupported protocol: ${i}`)}}connectTcp(){this.socket=new _u,this.socket.setEncoding(this.tlsEncoding),this.socket.pipe(new xc).on("data",t=>{let e=this.parse(t.toString()),d=0;for(d;d<e.length;d++)Mr(this,e[d]),this.messageStoreIn.add(e[d]),this.onMessageCallback?.(e[d]),this.triggerOnMessage(e[d])}),this.socket.connect(Number(this.port),String(this.host),()=>{this.connected=!0,this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connected to ${this.host}:${this.port}`}),this.onOpenCallback?.(),this.triggerOnOpen()}),this.socket.on("close",()=>{this.connected=!1,this.onCloseCallback?.(),this.triggerOnClose(),this.stopHeartbeat()}),this.socket.on("ready",()=>{setTimeout(()=>{this.onReadyCallback?.(),this.triggerOnReady()},Rc)}),this.socket.on("timeout",()=>{this.connected=!1;let t=this.socket;this.onCloseCallback?.(),this.triggerOnClose(),t.end(),this.stopHeartbeat()}),this.socket.on("error",t=>{this.connected=!1,this.onErrorCallback?.(t),this.triggerOnError(t),this.stopHeartbeat()})}connectTlsTcp(){this.tlsOptions||(this.tlsOptions={}),this.tlsOptions.host||(this.tlsOptions.host=this.host),this.tlsOptions.port||(this.tlsOptions.port=this.port);let t=Number(this.tlsOptions.port),e=String(this.tlsOptions.host);try{let d=Ju(t,e,this.tlsOptions,()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connected to ${e}:${t} via TLS.`}),this.tlsSkipStdInPipe||(process.stdin.pipe(d),process.stdin.resume()),this.addTcpListeners(d),this.connected=!0,this.onOpenCallback?.(),this.triggerOnOpen()});this.socket=d,d.setEncoding(this.tlsEncoding),d.setTimeout(this.tlsTimeout??Tc),this.addTlsListener(d)}catch(d){d instanceof Error?this.logger.logError({level:"error",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Client connection to ${this.host}:${this.port} failed with error: ${d.message}.`}):this.logger.logError({level:"error",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Client connection to ${this.host}:${this.port} failed with unspecified error.`}),this.connected=!1;return}}addTcpListeners(t){let e=new xc;e.setEncoding(this.tlsEncoding),t.on("ready",()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connection ready to ${this.host}:${this.port}.`})}),t.pipe(e).on("data",d=>{try{let i=this.parse(d);for(let a of i)Mr(this,a),this.messageStoreIn.add(a),this.onMessageCallback?.(a),this.triggerOnMessage(a)}catch(i){this.logger.logError({level:"warn",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Failed to parse/process incoming data \u2014 ${i.message}`})}}),t.on("end",()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Server closed the connection (END). ${this.host}:${this.port}.`}),this.disconnectTlsTcp(t)}),t.on("close",d=>{this.logger.log({level:d?"error":"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connection closed: ${this.host}:${this.port}. HadError? '${d}`}),this.disconnectTlsTcp(t)}),t.on("timeout",()=>{this.logger.logError({level:"warn",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connection timeout for ${this.host}:${this.port}.`}),this.disconnectTlsTcp(t)}),t.on("error",d=>{this.logger.logError({level:"error",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connection error for ${this.host}:${this.port}. error: ${d.message}`}),this.onErrorCallback?.(d),this.triggerOnError(d),this.disconnectTlsTcp(t)})}addTlsListener(t){t.on("secureConnect",()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- TLS handshake completed to ${this.host}:${this.port}.`}),this.onReadyCallback?.(),this.triggerOnReady()})}disconnectTlsTcp(t){t?(this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Disconnected from ${this.host}:${this.port}.`}),this.connected=!1,t.removeAllListeners(),t.destroy(),this.onCloseCallback?.(),this.triggerOnClose(),this.stopHeartbeat(),this.socket=void 0):this.logger.logError({level:"error",message:`FIXParser (${this.protocol?.toUpperCase()}): -- No active connection to disconnect.`})}connectWebsocket(){let t=String(this.host).indexOf("ws://")===-1&&String(this.host).indexOf("wss://")===-1?`ws://${String(this.host)}:${Number(this.port)}`:`${String(this.host)}:${Number(this.port)}`;this.proxy?this.socket=new Jd.default(t,{agent:this.proxy}):this.socket=new Jd.default(t),this.socket.on("message",e=>{let d=this.parse(e.toString()),i=0;for(i;i<d.length;i++)Mr(this,d[i]),this.messageStoreIn.add(d[i]),this.onMessageCallback?.(d[i]),this.triggerOnMessage(d[i])}),this.socket.on("open",()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connected to ${this.host}:${this.port}`}),this.connected=!0,this.onOpenCallback?.(),this.triggerOnOpen()}),this.socket.on("close",()=>{this.connected=!1,this.onCloseCallback?.(),this.triggerOnClose(),this.stopHeartbeat()}),this.socket.readyState===(Jd.default.OPEN||Jd.default.CLOSED||Jd.default.CLOSING||Jd.default.CONNECTING)&&setTimeout(()=>{this.onReadyCallback?.(),this.triggerOnReady()},Rc)}getNextTargetMsgSeqNum(){return this.messageStoreOut.getNextMsgSeqNum()}setNextTargetMsgSeqNum(t){return this.messageStoreOut.setNextMsgSeqNum(t)}getNextSenderMsgSeqNum(){return this.messageStoreIn.getNextMsgSeqNum()}setNextSenderMsgSeqNum(t){return this.messageStoreIn.setNextMsgSeqNum(t)}getTimestamp(t=new Date){return mg(t,this.logger)}createMessage(...t){let e=new Fu(this.fixVersion,...t);return e.messageSequence=this.getNextTargetMsgSeqNum(),e}parse(t){if(!Me.validateFreeLicense())throw new Error(Me.ERROR_MESSAGE_NO_FREE_LICENSE);return this.fixParserBase.parse(t)}send(t){if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);let e=t.getField(O.MsgType);e&&e.value===be.Logout&&(this.requestedLogout=!0);let d=t.encode();this.protocol==="tcp"&&this.connected?(this.setNextTargetMsgSeqNum(this.getNextTargetMsgSeqNum()+1),this.socket.write(d),this.messageStoreOut.add(t.clone()),this.restartHeartbeat(),this.logger.log({level:"info",message:`FIXParser (${this.protocol.toUpperCase()}): >> sent`,fix:d.replace(/\x01/g,"|")})):this.protocol==="websocket"&&this.socket.readyState===Jd.default.OPEN?(this.setNextTargetMsgSeqNum(this.getNextTargetMsgSeqNum()+1),this.socket.send(d),this.messageStoreOut.add(t.clone()),this.restartHeartbeat(),this.logger.log({level:"info",message:`FIXParser (${this.protocol.toUpperCase()}): >> sent`,fix:d.replace(/\x01/g,"|")})):(this.protocol==="ssl-tcp"||this.protocol==="tls-tcp")&&this.connected?(this.setNextTargetMsgSeqNum(this.getNextTargetMsgSeqNum()+1),this.socket.write(d),this.messageStoreOut.add(t.clone()),this.restartHeartbeat(),this.logger.log({level:"info",message:`FIXParser (${this.protocol.toUpperCase()}): >> sent`,fix:d.replace(/\x01/g,"|")})):this.logger.logError({message:`FIXParser (${this.protocol?.toUpperCase()}): -- Could not send message, no connection`,fix:d.replace(/\x01/g,"|")})}isConnected(){return this.connected}close(){if(this.protocol==="tcp"){let t=this.socket;t?(t.destroy(),this.connected=!1):this.logger.logError({message:`FIXParser (${this.protocol.toUpperCase()}): -- Could not close socket, connection not open`})}else if(this.protocol==="websocket"){let t=this.socket;if(t){try{t.close()}catch(e){this.logger.logError({message:`FIXParser (${this.protocol.toUpperCase()}): -- Could not close socket,`,error:e})}this.connected=!1}else this.logger.logError({message:`FIXParser (${this.protocol.toUpperCase()}): -- Could not close socket, connection not open`})}else if(this.protocol==="ssl-tcp"||this.protocol==="tls-tcp"){let t=this.socket;t?(t.destroy(),this.connected=!1):this.logger.logError({message:`FIXParser (${this.protocol.toUpperCase()}): -- Could not close socket, connection not open`})}}stopHeartbeat(){clearInterval(this.heartBeatIntervalId)}restartHeartbeat(){this.stopHeartbeat(),this.startHeartbeat(this.heartBeatInterval,!0)}startHeartbeat(t=this.heartBeatInterval,e){this.stopHeartbeat(),e||this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Heartbeat configured to ${t} seconds`}),this.heartBeatInterval=t,this.heartBeatIntervalId=setInterval(()=>{let d=So(this);this.send(d);let i=d.encode();this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): >> sent Heartbeat`,fix:i.replace(/\x01/g,"|")})},this.heartBeatInterval*1e3)}};var Cu=class{format;useStderr;constructor({format:t="json",useStderr:e=!1}){this.format=t,this.useStderr=e}configure(t){this.format=t.format||"json",t.useStderr!==void 0&&(this.useStderr=t.useStderr)}async send(t){let e=this.useStderr?console.error:console.log;if(this.format==="json")e(JSON.stringify(t));else if(this.format==="jsonrpc"){let{message:d,...i}=t,a={jsonrpc:"2.0",method:t.level,params:{message:d,...i}};e(JSON.stringify(a))}else{let{name:d,id:i,message:a,level:n,...r}=t,o=Object.entries(r).map(([c,p])=>`${c}: ${p}`),s="";d&&(s+=`${d} `),s+=`${i}: ${a}`,e(s,o.join(", "))}}async flush(){}async close(){}status(){return"connected"}};import{randomUUID as kg}from"node:crypto";import{createServer as qg}from"node:http";import{McpServer as Bg}from"@modelcontextprotocol/sdk/server/mcp.js";import{StreamableHTTPServerTransport as jg}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{isInitializeRequest as Gg}from"@modelcontextprotocol/sdk/types.js";import{z as bt}from"zod";var dr=class{logger;parser;onReady=void 0;verifiedOrders=new Map;pendingRequests=new Map;marketDataPrices=new Map;MAX_PRICE_HISTORY=1e5;constructor({logger:e,onReady:d}){this.logger=e,this.onReady=d}};var Xu={parse:{description:"Parses a FIX message and describes it in plain language",schema:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},parseToJSON:{description:"Parses a FIX message into JSON",schema:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},verifyOrder:{description:"Verifies order parameters before execution. verifyOrder must be called before executeOrder.",schema:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"],description:"Handling Instructions: 1=Automated Execution No Intervention, 2=Automated Execution Intervention OK, 3=Manual Order"},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"],description:"Order Type: 1=Market, 2=Limit, 3=Stop, 4=StopLimit, 5=MarketOnClose, 6=WithOrWithout, 7=LimitOrBetter, 8=LimitWithOrWithout, 9=OnBasis, A=OnClose, B=LimitOnClose, C=ForexMarket, D=PreviouslyQuoted, E=PreviouslyIndicated, F=ForexLimit, G=ForexSwap, H=ForexPreviouslyQuoted, I=Funari, J=MarketIfTouched, K=MarketWithLeftOverAsLimit, L=PreviousFundValuationPoint, M=NextFundValuationPoint, P=Pegged, Q=CounterOrderSelection, R=StopOnBidOrOffer, S=StopLimitOnBidOrOffer"},side:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"],description:"Side: 1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed"},symbol:{type:"string"},timeInForce:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C"],description:"Time In Force: 0=Day, 1=GoodTillCancel, 2=AtTheOpening, 3=ImmediateOrCancel, 4=FillOrKill, 5=GoodTillCrossing, 6=GoodTillDate, 7=AtTheClose, 8=GoodThroughCrossing, 9=AtCrossing, A=GoodForTime, B=GoodForAuction, C=GoodForMonth"}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},executeOrder:{description:"Executes a verified order. verifyOrder must be called before executeOrder.",schema:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"],description:"Handling Instructions: 1=Automated Execution No Intervention, 2=Automated Execution Intervention OK, 3=Manual Order"},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"],description:"Order Type: 1=Market, 2=Limit, 3=Stop, 4=StopLimit, 5=MarketOnClose, 6=WithOrWithout, 7=LimitOrBetter, 8=LimitWithOrWithout, 9=OnBasis, A=OnClose, B=LimitOnClose, C=ForexMarket, D=PreviouslyQuoted, E=PreviouslyIndicated, F=ForexLimit, G=ForexSwap, H=ForexPreviouslyQuoted, I=Funari, J=MarketIfTouched, K=MarketWithLeftOverAsLimit, L=PreviousFundValuationPoint, M=NextFundValuationPoint, P=Pegged, Q=CounterOrderSelection, R=StopOnBidOrOffer, S=StopLimitOnBidOrOffer"},side:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"],description:"Side: 1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed"},symbol:{type:"string"},timeInForce:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C"],description:"Time In Force: 0=Day, 1=GoodTillCancel, 2=AtTheOpening, 3=ImmediateOrCancel, 4=FillOrKill, 5=GoodTillCrossing, 6=GoodTillDate, 7=AtTheClose, 8=GoodThroughCrossing, 9=AtCrossing, A=GoodForTime, B=GoodForAuction, C=GoodForMonth"}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},marketDataRequest:{description:"Requests market data for specified symbols",schema:{type:"object",properties:{mdUpdateType:{type:"string",enum:["0","1"],description:"Market Data Update Type: 0=Full Refresh, 1=Incremental Refresh"},symbols:{type:"array",items:{type:"string"}},mdReqID:{type:"string"},subscriptionRequestType:{type:"string",enum:["0","1","2"],description:"Subscription Request Type: 0=Snapshot, 1=Snapshot + Updates, 2=Disable Previous Snapshot + Update Request"},mdEntryTypes:{type:"array",items:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},description:"Market Data Entry Types: 0=Bid, 1=Offer, 2=Trade, 3=Index Value, 4=Opening Price, 5=Closing Price, 6=Settlement Price, 7=High Price, 8=Low Price, 9=Trade Volume, A=Open Interest, B=Simulated Sell Price, C=Simulated Buy Price, D=Empty Book, E=Session High Bid, F=Session Low Offer, G=Fixing Price, H=Electronic Volume, I=Threshold Limits and Price Band Variation, J=Clearing Price, K=Open Interest Change, L=Last Trade Price, M=Last Trade Volume, N=Last Trade Time, O=Last Trade Tick, P=Last Trade Exchange, Q=Last Trade ID, R=Last Trade Side, S=Last Trade Price Change, T=Last Trade Price Change Percent, U=Last Trade Price Change Basis Points, V=Last Trade Price Change Points, W=Last Trade Price Change Ticks, X=Last Trade Price Change Ticks Percent, Y=Last Trade Price Change Ticks Basis Points, Z=Last Trade Price Change Ticks Points"}},required:["mdUpdateType","symbols","mdReqID","subscriptionRequestType"]}},getStockGraph:{description:"Generates a price chart for a given symbol",schema:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}},getStockPriceHistory:{description:"Returns price history for a given symbol",schema:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}},technicalAnalysis:{description:"Performs comprehensive technical analysis on market data for a given symbol, including indicators like SMA, EMA, RSI, Bollinger Bands, and trading signals",schema:{type:"object",properties:{symbol:{type:"string",description:"The trading symbol to analyze (e.g., AAPL, MSFT, EURUSD)"}},required:["symbol"]}}};var Zt=class{static calculateRSI(e,d=14){if(e.length<d+1)return[];let i=[];for(let c=1;c<e.length;c++)i.push(e[c]-e[c-1]);let a=i.map(c=>c>0?c:0),n=i.map(c=>c<0?Math.abs(c):0),r=a.slice(0,d).reduce((c,p)=>c+p,0)/d,o=n.slice(0,d).reduce((c,p)=>c+p,0)/d,s=[];for(let c=d;c<i.length;c++){let p=r/o;s.push(100-100/(1+p)),r=(r*(d-1)+a[c])/d,o=(o*(d-1)+n[c])/d}return s}static calculateStochastic(e,d,i){let a=[];if(e.length<14)return[];let s=[];for(let p=13;p<e.length;p++){let u=Math.max(...d.slice(p-14+1,p+1)),m=Math.min(...i.slice(p-14+1,p+1)),g=(e[p]-m)/(u-m)*100;s.push(g)}let c=[];for(let p=2;p<s.length;p++){let u=s.slice(p-3+1,p+1).reduce((m,S)=>m+S,0);c.push(u/3)}for(let p=2;p<c.length;p++){let m=c.slice(p-3+1,p+1).reduce((S,g)=>S+g,0)/3;a.push({k:c[p],d:m})}return a}static calculateCCI(e,d,i){let a=[];if(e.length<20)return[];for(let r=19;r<e.length;r++){let s=e.slice(r-20+1,r+1).map((S,g)=>{let y=d[r-20+1+g]||S,P=i[r-20+1+g]||S;return(y+P+S)/3}),c=s.reduce((S,g)=>S+g,0)/20,p=s.reduce((S,g)=>S+Math.abs(g-c),0)/20,u=(d[r]+i[r]+e[r])/3,m=p!==0?(u-c)/(.015*p):0;a.push(m)}return a}static calculateROC(e){let d=[];for(let i=10;i<e.length;i++)d.push((e[i]-e[i-10])/e[i-10]*100);return d}static calculateWilliamsR(e){let d=[];if(e.length<14)return[];for(let a=13;a<e.length;a++){let n=e.slice(a-14+1,a+1),r=Math.max(...n),o=Math.min(...n),s=e[a],c=(r-s)/(r-o)*-100;d.push(c)}return d}static calculateMomentum(e){let d=[];for(let i=10;i<e.length;i++)d.push(e[i]-e[i-10]);return d}};var Ne=class{static calculateSMA(e,d){let i=[];for(let a=d-1;a<e.length;a++){let n=e.slice(a-d+1,a+1).reduce((r,o)=>r+o,0);i.push(n/d)}return i}static calculateEMA(e,d){let i=2/(d+1),a=[e[0]];for(let n=1;n<e.length;n++)a.push(e[n]*i+a[n-1]*(1-i));return a}static calculateWMA(e,d){let i=[],a=Array.from({length:d},(r,o)=>o+1),n=a.reduce((r,o)=>r+o,0);for(let r=d-1;r<e.length;r++){let o=0;for(let s=0;s<d;s++)o+=e[r-s]*a[s];i.push(o/n)}return i}static calculateVWMA(e,d,i){let a=[];for(let n=i-1;n<e.length;n++){let r=0,o=0;for(let s=0;s<i;s++){let c=d[n-s]||1;r+=c,o+=e[n-s]*c}a.push(o/r)}return a}};var Lt=class t{static calculateBlackScholes(e,d,i){let a=e,n=d,r=1,o=.05,s=i*.01,c=(Math.log(a/n)+(o+s*s/2)*r)/(s*Math.sqrt(r)),p=c-s*Math.sqrt(r),u=a*t.normalCDF(c)-n*Math.exp(-o*r)*t.normalCDF(p),m=n*Math.exp(-o*r)*t.normalCDF(-p)-a*t.normalCDF(-c);return{callPrice:u,putPrice:m,delta:t.normalCDF(c),gamma:t.normalPDF(c)/(a*s*Math.sqrt(r)),theta:-a*t.normalPDF(c)*s/(2*Math.sqrt(r))-o*n*Math.exp(-o*r)*t.normalCDF(p),vega:a*Math.sqrt(r)*t.normalPDF(c),rho:n*r*Math.exp(-o*r)*t.normalCDF(p)}}static calculateBinomialTree(e,d,i=1,a=.05,n=.2,r=100){let o=i/r,s=Math.exp(n*Math.sqrt(o)),c=1/s,p=(Math.exp(a*o)-c)/(s-c),u=[];for(let D=0;D<=r;D++){u[D]=[];for(let h=0;h<=D;h++)u[D][h]=e*s**h*c**(D-h)}let m=[];m[r]=[];for(let D=0;D<=r;D++){let h=Math.max(0,u[r][D]-d);m[r][D]=h}let S=[];S[r]=[];for(let D=0;D<=r;D++){let h=Math.max(0,d-u[r][D]);S[r][D]=h}for(let D=r-1;D>=0;D--){m[D]=[];for(let h=0;h<=D;h++){let X=m[D+1][h+1],b=m[D+1][h],T=Math.exp(-a*o)*(p*X+(1-p)*b);m[D][h]=Math.max(T,u[D][h]-d)}}for(let D=r-1;D>=0;D--){S[D]=[];for(let h=0;h<=D;h++){let X=S[D+1][h+1],b=S[D+1][h],T=Math.exp(-a*o)*(p*X+(1-p)*b);S[D][h]=Math.max(T,d-u[D][h])}}let g=m[0][0],y=S[0][0],P=(m[1][1]-m[1][0])/(u[1][1]-u[1][0]),f=((m[1][1]-m[1][0])/(u[1][1]-u[1][0])-(m[1][0]-m[1][0])/(u[1][0]-u[1][0]))/(u[1][1]-u[1][0]),E=(m[1][0]-m[0][0])/o,v=(g-g*1.01)/(n*.01),F=(g-g*1.01)/(a*.01);return{callPrice:g,putPrice:y,delta:P,gamma:f,theta:E,vega:v,rho:F}}static calculateTrinomialTree(e,d,i=1,a=.05,n=.2,r=50){let o=i/r,s=n*Math.sqrt(3*o),c=Math.exp(s),p=.5*((a-.5*n*n)*o/s+n*n*o/(s*s)),u=.5*((a-.5*n*n)*o/s-n*n*o/(s*s)),m=1-p-u,S=[];for(let X=0;X<=r;X++){S[X]=[];for(let b=0;b<=2*X+1;b++){let T=b-X;S[X][b]=e*c**T}}let g=[];g[r]=[];for(let X=0;X<=2*r;X++){let b=Math.max(0,S[r][X]-d);g[r][X]=b}let y=[];y[r]=[];for(let X=0;X<=2*r;X++){let b=Math.max(0,d-S[r][X]);y[r][X]=b}for(let X=r-1;X>=0;X--){g[X]=[];for(let b=0;b<=2*X;b++){let T=g[X+1][b+2],C=g[X+1][b+1],R=g[X+1][b],M=Math.exp(-a*o)*(p*T+m*C+u*R);g[X][b]=Math.max(M,S[X][b]-d)}}for(let X=r-1;X>=0;X--){y[X]=[];for(let b=0;b<=2*X;b++){let T=y[X+1][b+2],C=y[X+1][b+1],R=y[X+1][b],M=Math.exp(-a*o)*(p*T+m*C+u*R);y[X][b]=Math.max(M,d-S[X][b])}}let P=g[0][0],f=y[0][0],E=(g[1][2]-g[1][0])/(S[1][2]-S[1][0]),v=((g[1][2]-g[1][1])/(S[1][2]-S[1][1])-(g[1][1]-g[1][0])/(S[1][1]-S[1][0]))/(S[1][2]-S[1][0]),F=(g[1][1]-g[0][0])/o,D=(P-P*1.01)/(n*.01),h=(P-P*1.01)/(a*.01);return{callPrice:P,putPrice:f,delta:E,gamma:v,theta:F,vega:D,rho:h}}static calculateMonteCarlo(e,d,i=1,a=.05,n=.2,r=1e4){let o=0,s=0,c=0,p=0;for(let D=0;D<r;D++){let h=t.boxMuller(),X=e*Math.exp((a-.5*n*n)*i+n*Math.sqrt(i)*h),b=Math.max(0,X-d),T=Math.max(0,d-X);o+=b,s+=T,X>d&&(c+=1,p+=0)}let u=Math.exp(-a*i),m=o/r*u,S=s/r*u,g=c/r*u,y=p/r*u,P=-(m*a),f=(m-m*1.01)/(n*.01),E=(m-m*1.01)/(a*.01),v=Math.sqrt(m*(1-m)/r),F={lower:m-1.96*v,upper:m+1.96*v};return{callPrice:m,putPrice:S,delta:g,gamma:y,theta:P,vega:f,rho:E,confidenceInterval:F}}static calculateHestonModel(e,d,i=1,a=.05,n=.2,r=.2,o=2,s=.3,c=-.5){let p=e*.6-d*Math.exp(-a*i)*.4,u=p-e+d*Math.exp(-a*i),m=Math.sqrt(2*Math.PI/i)*(p/e)*(1+.5*(p/e)),S=.6,g=.01/e,y=-(p*a),P=p*Math.sqrt(i),f=d*i*Math.exp(-a*i)*.4;return{callPrice:p,putPrice:u,impliedVolatility:m,delta:S,gamma:g,theta:y,vega:P,rho:f}}static calculateSABRModel(e,d,i=1,a=.05,n=.2,r=.5,o=-.5,s=.3){let c=e,p=d,u=i,m=s/n*Math.log(c/p),S=Math.log((Math.sqrt(1-2*o*m+m*m)+m-o)/(1-o)),g;Math.abs(c-p)<1e-8?g=n/c**(1-r)*(1+((1-r)**2/24*n**2/c**(2-2*r)+o*r*n*s/(4*c**(1-r))+(2-3*o**2)*s**2/24)*u):g=n/(c*p)**((1-r)/2)*(1+((1-r)**2/24*n**2/(c*p)**(1-r)+o*r*n*s/(4*(c*p)**((1-r)/2))+(2-3*o**2)*s**2/24)*u)*m/S;let y=(Math.log(c/p)+(a+g*g/2)*u)/(g*Math.sqrt(u)),P=y-g*Math.sqrt(u),f=c*t.normalCDF(y)-p*Math.exp(-a*u)*t.normalCDF(P),E=p*Math.exp(-a*u)*t.normalCDF(-P)-c*t.normalCDF(-y),v=t.normalCDF(y),F=t.normalPDF(y)/(c*g*Math.sqrt(u)),D=-c*t.normalPDF(y)*g/(2*Math.sqrt(u))-a*p*Math.exp(-a*u)*t.normalCDF(P),h=c*Math.sqrt(u)*t.normalPDF(y),X=p*u*Math.exp(-a*u)*t.normalCDF(P);return{callPrice:f,putPrice:E,impliedVolatility:g,delta:v,gamma:F,theta:D,vega:h,rho:X}}static calculateVarianceGamma(e,d,i=1,a=.05,n=.2,r=-.1,o=.3){let s=e,c=d,p=i,u=a,m=s*.55-c*Math.exp(-u*p)*.45,S=m-s+c*Math.exp(-u*p),g=Math.sqrt(2*Math.PI/p)*(m/s)*(1+.5*(m/s)),y=.55,P=.01/s,f=-(m*u),E=m*Math.sqrt(p),v=c*p*Math.exp(-u*p)*.45;return{callPrice:m,putPrice:S,impliedVolatility:g,delta:y,gamma:P,theta:f,vega:E,rho:v}}static normalCDF(e){return .5*(1+t.erf(e/Math.sqrt(2)))}static normalPDF(e){return Math.exp(-e*e/2)/Math.sqrt(2*Math.PI)}static erf(e){let d=.254829592,i=-.284496736,a=1.421413741,n=-1.453152027,r=1.061405429,o=.3275911,s=e>=0?1:-1,c=Math.abs(e),p=1/(1+o*c),u=1-((((r*p+n)*p+a)*p+i)*p+d)*p*Math.exp(-c*c);return s*u}static boxMuller(){let e=Math.random(),d=Math.random();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*d)}};var bd=class{static calculateMaxDrawdown(e){let d=e[0],i=0;for(let a=1;a<e.length;a++){e[a]>d&&(d=e[a]);let n=(d-e[a])/d;n>i&&(i=n)}return i}static calculateMaxConsecutiveLosses(e){let d=0,i=0;for(let a=1;a<e.length;a++)e[a]<e[a-1]?(i++,d=Math.max(d,i)):i=0;return d}static calculateWinRate(e){let d=0,i=0;for(let a=1;a<e.length;a++)e[a]!==e[a-1]&&(i++,e[a]>e[a-1]&&d++);return i>0?d/i:0}static calculateProfitFactor(e){let d=0,i=0;for(let a=1;a<e.length;a++){let n=e[a]-e[a-1];n>0?d+=n:i+=Math.abs(n)}return i>0?d/i:0}static calculateSharpeRatio(e,d=.02){if(e.length===0)return 0;let i=e.reduce((o,s)=>o+s,0)/e.length,a=i-d,n=e.reduce((o,s)=>o+(s-i)**2,0)/e.length,r=Math.sqrt(n);return r>0?a/r:0}static calculateSortinoRatio(e,d=.02){if(e.length===0)return 0;let i=e.reduce((s,c)=>s+c,0)/e.length,a=i-d,r=e.filter(s=>s<i).reduce((s,c)=>s+(c-i)**2,0)/e.length,o=Math.sqrt(r);return o>0?a/o:0}static calculateCalmarRatio(e,d){return d===0?0:e.reduce((a,n)=>a+n,0)/e.length/d}static calculatePositionSize(e,d){let i=Math.abs(e-d);return i>0?100/i:1}static calculateConfidence(e){return Math.min(e.length*10,100)}static calculateRiskLevel(e){return e<20?"LOW":e<40?"MEDIUM":"HIGH"}};var da=class t{static generateSignals(e,d,i,a,n,r,o,s,c){let p=0,u=0,m=[];e>d?(m.push(`\u2713 BULLISH: Price above VWAP (+${((e-d)/d*100).toFixed(2)}%)`),p++):(m.push(`\u2717 BEARISH: Price below VWAP (${((e-d)/d*100).toFixed(2)}%)`),u++),i>0&&a>0?(m.push("\u2713 BULLISH: Positive momentum on both timeframes"),p++):i<0&&a<0?(m.push("\u2717 BEARISH: Negative momentum on both timeframes"),u++):m.push("\u25D0 MIXED: Conflicting momentum signals");let S=r/o;return S>1.2&&n>0?(m.push("\u2713 BULLISH: Above-average volume supporting upward move"),p++):S>1.2&&n<0?(m.push("\u2717 BEARISH: Above-average volume supporting downward move"),u++):m.push("\u25D0 NEUTRAL: Volume not providing clear direction"),s>65&&c>30?(m.push("\u2717 BEARISH: High in range with elevated volatility - reversal risk"),u++):s<35&&c>30?(m.push("\u2713 BULLISH: Low in range with volatility - potential bounce"),p++):m.push("\u25D0 NEUTRAL: Price position and volatility not extreme"),{bullishSignals:p,bearishSignals:u,signals:m}}static calculateOverallSignal(e,d,i,a){let n=e-d,r=n>0?"BULLISH_BIAS":n<0?"BEARISH_BIAS":"NEUTRAL",o=t.calculateConfidence(i),s=t.calculateRiskLevel(a);return{bullishSignals:e,bearishSignals:d,signals:i,overallSignal:r,signalScore:n,confidence:o,riskLevel:s}}static calculateConfidence(e){return Math.min(e.length*10,100)}static calculateRiskLevel(e){return e<20?"LOW":e<40?"MEDIUM":"HIGH"}};function $e(t,e=500){if(t.length<=e)return t;let d=[],i=t.length/e;d.push(t[0]);for(let a=1;a<e-1;a++){let n=Math.floor(a*i),r=Math.floor((a+1)*i),o=t.slice(n,r);if(o.length===0)continue;let s=Math.floor(o.length/2);d.push(o[s])}return d.push(t[t.length-1]),d}var dt=class{static calculateZScore(e,d){return(e-d)/(d*.1)}static calculateOrnsteinUhlenbeck(e,d,i,a){let n=d,r=.1;if(a.length>1){let s=a.reduce((c,p)=>c+p*p,0)/a.length;r=Math.max(.01,Math.min(1,s*10))}let o=i*.01;return{mean:n,speed:r,volatility:o,currentValue:e}}static calculateKalmanFilter(e,d,i,a){let n=i*.001,r=i*1e-4,o=d,s=n;if(a.length>0){let c=o,p=s+r,u=p/(p+n);return o=c+u*(e-c),s=(1-u)*p,{state:o,covariance:s,gain:u}}return{state:e,covariance:s,gain:.5}}static calculateARIMA(e,d){if(d.length<3)return{forecast:[e*1.01,e*1.02],residuals:[0,0],aic:100};let i=d.length,a=0,n=0,r=0,o=0;for(let P=1;P<i;P++){let f=d[P],E=d[P-1];a+=f,n+=E,r+=f*E,o+=E*E}let s=(i*r-a*n)/(i*o-n*n),c=(a-s*n)/i,p=[];for(let P=1;P<i;P++){let f=c+s*d[P-1];p.push(d[P]-f)}let u=p.reduce((P,f)=>P+f*f,0),m=i*Math.log(u/i)+2*2,S=d[d.length-1],g=e+(c+s*S),y=g+(c+s*(c+s*S));return{forecast:[g,y],residuals:$e(p),aic:m}}static calculateGARCH(e,d){if(d.length<5)return{volatility:e*.01,persistence:.9,meanReversion:.1};let i=d.map(s=>s*s),a=i.reduce((s,c)=>s+c,0)/i.length,n=.9;if(i.length>1){let s=i.reduce((c,p)=>c+p,0)/i.length;n=Math.min(.99,Math.max(.5,s/a))}let r=a*(1-n);return{volatility:Math.sqrt(a),persistence:n,meanReversion:r}}static calculateVAR(e,d,i=2){if(e.length<i+5||d.length<i+5)return{priceForecast:[e[e.length-1]*1.01],volumeForecast:[d[d.length-1]*1.01],coefficients:[[.5,.3],[.2,.6]],residuals:[[0],[0]]};let a=[],n=[];for(let P=1;P<e.length;P++)a.push((e[P]-e[P-1])/e[P-1]),n.push((d[P]-d[P-1])/d[P-1]);let r=[],o=[],s=[];for(let P=i;P<a.length;P++){let f=[1];for(let E=1;E<=i;E++)f.push(a[P-E]),f.push(n[P-E]);r.push(f),o.push(a[P]),s.push(n[P])}let c=[[.5,.3,.2,.1],[.2,.1,.6,.3]],p=[],u=[];for(let P=0;P<o.length;P++){let f=c[0].reduce((v,F,D)=>v+F*r[P][D],0),E=c[1].reduce((v,F,D)=>v+F*r[P][D],0);p.push(o[P]-f),u.push(s[P]-E)}let m=a[a.length-1],S=n[n.length-1],g=[e[e.length-1]*(1+m*.5)],y=[d[d.length-1]*(1+S*.5)];return{priceForecast:g,volumeForecast:y,coefficients:c,residuals:[$e(p),$e(u)]}}static calculateGaussianProcess(e,d=5){if(e.length<10)return{mean:[e[e.length-1]*1.01,e[e.length-1]*1.02],variance:[.01,.02],confidenceInterval:{lower:[e[e.length-1]*.99,e[e.length-1]*.98],upper:[e[e.length-1]*1.03,e[e.length-1]*1.04]}};let i=[],a=[],n=[],r=[],o=e[e.length-1],s=Math.sqrt(e.reduce((c,p)=>c+(p-o)**2,0)/e.length);for(let c=1;c<=d;c++){let p=(e[e.length-1]-e[e.length-10])/10,u=o+p*c;i.push(u);let m=s*(1+c*.1);a.push(m);let S=1.96*m;n.push(u-S),r.push(u+S)}return{mean:i,variance:a,confidenceInterval:{lower:n,upper:r}}}static calculatePairsTrading(e,d){if(e.length<20||d.length<20)return{spread:[0],zScore:[0],hedgeRatio:1,entrySignal:"NEUTRAL",exitSignal:"NEUTRAL",position:"FLAT"};let i=Math.min(e.length,d.length),a=0,n=0,r=0,o=0;for(let f=0;f<i;f++)a+=e[f],n+=d[f],r+=e[f]*d[f],o+=e[f]*e[f];let s=(i*r-a*n)/(i*o-a*a),c=[];for(let f=0;f<i;f++)c.push(d[f]-s*e[f]);let p=c.reduce((f,E)=>f+E,0)/c.length,u=Math.sqrt(c.reduce((f,E)=>f+(E-p)**2,0)/c.length),m=[];for(let f=0;f<c.length;f++)m.push((c[f]-p)/u);let S=m[m.length-1],g="NEUTRAL",y="NEUTRAL",P="FLAT";return S>2?(g="SHORT_SPREAD",P="SHORT"):S<-2?(g="LONG_SPREAD",P="LONG"):Math.abs(S)<.5&&(y="CLOSE_POSITION",P="FLAT"),{spread:$e(c),zScore:$e(m),hedgeRatio:s,entrySignal:g,exitSignal:y,position:P}}static calculateHilbertTransform(e,d){if(d.length<10)return{analytic:[e],phase:[0],amplitude:[e]};let i=[],a=[],n=[],r=[e-d[d.length-1],e];r.push(...d.map(o=>e+o));for(let o=0;o<r.length;o++){let s=r[o],c=o>0?(r[o]-r[o-1])*.5:0;i.push(s+c),a.push(Math.atan2(c,s)),n.push(Math.sqrt(s*s+c*c))}return{analytic:$e(i),phase:$e(a),amplitude:$e(n)}}static calculateWaveletTransform(e,d){if(d.length<8)return{coefficients:[e],scales:[1]};let i=[e,...d.map(r=>e+r)],a=[],n=[];for(let r=1;r<=Math.min(4,Math.floor(Math.log2(i.length)));r++){let o=2**(r-1);n.push(r);for(let s=0;s<i.length-o;s+=o*2)if(s+o<i.length){let c=(i[s]-i[s+o])/2;a.push(c)}}return{coefficients:$e(a),scales:$e(n)}}static calculateFourierTransform(e){if(e.length<8)return{frequencies:[.1,.2],amplitudes:[e[e.length-1],e[e.length-1]*.5],phases:[0,Math.PI/4],dominantFrequencies:[.1]};let d=e.length,i=[],a=[],n=[];for(let c=0;c<d;c++){let p=c/d;i.push(p);let u=0,m=0;for(let y=0;y<d;y++){let P=-2*Math.PI*c*y/d;u+=e[y]*Math.cos(P),m+=e[y]*Math.sin(P)}let S=Math.sqrt(u*u+m*m)/d,g=Math.atan2(m,u);a.push(S),n.push(g)}let o=[...a].sort((c,p)=>p-c)[Math.floor(d*.1)],s=i.filter((c,p)=>a[p]>o);return{frequencies:$e(i),amplitudes:$e(a),phases:$e(n),dominantFrequencies:$e(s)}}static calculateEMD(e){if(e.length<10)return{imfs:[e],residual:[0],frequencies:[.1]};let d=[],i=[...e];for(let r=0;r<3&&i.length>5;r++){let o=[...i],s=0,c=10;for(;s<c;){let p=[];for(let m=1;m<o.length-1;m++)(o[m]>o[m-1]&&o[m]>o[m+1]||o[m]<o[m-1]&&o[m]<o[m+1])&&p.push(o[m]);if(p.length<3)break;let u=p.map((m,S)=>S===0?p[0]:S===p.length-1?p[p.length-1]:(p[S-1]+p[S+1])/2);for(let m=0;m<o.length;m++){let S=Math.floor(m*p.length/o.length);o[m]-=u[Math.min(S,u.length-1)]}s++}d.push($e([...o]));for(let p=0;p<i.length;p++)i[p]-=o[p]}let a=$e(i),n=$e(d.map((r,o)=>.1/(o+1)));return{imfs:d,residual:a,frequencies:n}}};var Fd=class t{static calculatePivotPoints(e,d,i){let a=[];for(let n=0;n<e.length;n++){let r=d[n]||e[n],o=i[n]||e[n],s=e[n],c=(r+o+s)/3,p=2*c-o,u=2*c-r,m=c+(r-o),S=c-(r-o),g=r+2*(c-o),y=o-2*(r-c);a.push({pp:c,r1:p,r2:m,r3:g,s1:u,s2:S,s3:y})}return a}static calculateFibonacciPivotPoints(e,d,i){let a=[];for(let n=0;n<e.length;n++){let r=d[n]||e[n],o=i[n]||e[n],s=e[n],c=(r+o+s)/3,p=r-o,u=c+.382*p,m=c+.618*p,S=c+1*p,g=c-.382*p,y=c-.618*p,P=c-1*p;a.push({pp:c,r1:u,r2:m,r3:S,s1:g,s2:y,s3:P})}return a}static calculateCamarillaPivotPoints(e,d,i){let a=[];for(let n=0;n<e.length;n++){let r=d[n]||e[n],o=i[n]||e[n],s=e[n],c=(r+o+s)/3,p=r-o,u=s+1.1/12*p,m=s+1.1/6*p,S=s+1.1/4*p,g=s-1.1/12*p,y=s-1.1/6*p,P=s-1.1/4*p;a.push({pp:c,r1:u,r2:m,r3:S,s1:g,s2:y,s3:P})}return a}static calculateFibonacciLevels(e){let d=[];for(let i=0;i<e.length;i++){let a=e[i];d.push({retracement:{level0:a,level236:a*.764,level382:a*.618,level500:a*.5,level618:a*.382,level786:a*.214,level100:a*0},extension:{level1272:a*1.272,level1618:a*1.618,level2618:a*2.618,level4236:a*4.236}})}return d}static calculateGannLevels(e){let d=[];if(e.length===0)return[];if(e.length<=500){for(let n=0;n<e.length;n++)d.push(e[n]*(1+n*.01));return d}let i=e.length/500;d.push(e[0]*1.01);for(let n=1;n<499;n++){let r=Math.floor(n*i),o=Math.floor((n+1)*i),s=e.slice(r,o);if(s.length===0)continue;let c=Math.floor(s.length/2),u=s[c]*(1+(r+c)*.01);d.push(u)}let a=e.length-1;return d.push(e[a]*(1+a*.01)),d}static calculateElliottWave(e){let d=[];if(e.length<10)return[];for(let i=0;i<e.length;i++){let a=[],n=1,r=.5;if(i>=4){let o=e.slice(i-4,i+1),s=t.detectPriceSwings(o);s.length>=3&&(a.push(...s.slice(0,3)),n=Math.min(s.length,5),r=t.calculateWavePosition(o))}d.push({waves:a.length>0?a:[e[i]],currentWave:n,wavePosition:r})}return d}static detectPriceSwings(e){let d=[];for(let i=1;i<e.length-1;i++){let a=e[i-1],n=e[i],r=e[i+1];(n>a&&n>r||n<a&&n<r)&&d.push(n)}return d}static calculateWavePosition(e){if(e.length<2)return .5;let d=e[e.length-1],i=Math.min(...e),a=Math.max(...e);return a!==i?(d-i)/(a-i):.5}static calculateHarmonicPatterns(e){let d=[];if(e.length<5)return[];let i=[];for(let n=4;n<e.length;n++){let r=e.slice(n-4,n+1),o=t.detectHarmonicPattern(r);i.push(o)}if(i.length<=500)return i;let a=i.length/500;d.push(i[0]);for(let n=1;n<499;n++){let r=Math.floor(n*a),o=Math.floor((n+1)*a),s=i.slice(r,o);if(s.length===0)continue;let c=s.reduce((p,u)=>u.completion>p.completion?u:p);d.push(c)}return d.push(i[i.length-1]),d}static detectHarmonicPattern(e){if(e.length<5)return{type:"Unknown",completion:0,target:e[e.length-1]*1.1,stopLoss:e[e.length-1]*.9};let d=t.detectPriceSwings(e);if(d.length<4)return{type:"Unknown",completion:0,target:e[e.length-1]*1.1,stopLoss:e[e.length-1]*.9};let i=d.slice(-5);if(i.length<5)return{type:"Unknown",completion:0,target:e[e.length-1]*1.1,stopLoss:e[e.length-1]*.9};let[a,n,r,o,s]=i,c=Math.abs(r-n),p=Math.abs(o-r),u=Math.abs(s-o),m=Math.abs(n-a),S=c/m,g=p/c,y=u/p;return t.isInRange(S,.618,.05)&&t.isInRange(g,.382,.05)&&t.isInRange(y,.886,.05)?{type:"Gartley",completion:t.calculatePatternCompletion(e),target:s+(s-o)*.618,stopLoss:s*.99}:t.isInRange(S,.382,.05)&&t.isInRange(g,.382,.05)&&t.isInRange(y,.886,.05)?{type:"Bat",completion:t.calculatePatternCompletion(e),target:s+(s-o)*.382,stopLoss:s*.99}:t.isInRange(S,.786,.05)&&t.isInRange(g,.382,.05)&&t.isInRange(y,1.618,.05)?{type:"Butterfly",completion:t.calculatePatternCompletion(e),target:s+(s-o)*1.618,stopLoss:s*.99}:t.isInRange(S,.382,.05)&&t.isInRange(g,.886,.05)&&t.isInRange(y,3.618,.1)?{type:"Crab",completion:t.calculatePatternCompletion(e),target:s+(s-o)*1.618,stopLoss:s*.99}:t.isInRange(S,.382,.05)&&t.isInRange(g,.113,.05)&&t.isInRange(y,Math.SQRT2,.05)?{type:"Cypher",completion:t.calculatePatternCompletion(e),target:s+(s-o)*.786,stopLoss:s*.99}:t.isInRange(S,.886,.05)&&t.isInRange(g,.886,.05)&&t.isInRange(y,1.13,.05)?{type:"Shark",completion:t.calculatePatternCompletion(e),target:s+(s-o)*1.13,stopLoss:s*.99}:{type:"Unknown",completion:0,target:e[e.length-1]*1.1,stopLoss:e[e.length-1]*.9}}static isInRange(e,d,i){return Math.abs(e-d)<=i}static calculatePatternCompletion(e){if(e.length<2)return 0;let d=e[e.length-1],i=Math.max(...e),a=Math.min(...e);if(i===a)return 50;let n=i-a,r=(d-a)/n;return Math.min(100,Math.max(0,r*100))}};var Ed=class{static calculateMACD(e){let d=Ne.calculateEMA(e,12),i=Ne.calculateEMA(e,26),a=[],n=[];for(let o=0;o<Math.min(d.length,i.length);o++)n.push(d[o]-i[o]);let r=Ne.calculateEMA(n,9);for(let o=0;o<Math.min(n.length,r.length);o++)a.push({macd:n[o],signal:r[o],histogram:n[o]-r[o]});return a}static calculateADX(e,d,i){if(e.length<14)return[];let a=14,n=[],r=[],o=[],s=[];r.push(d[0]-i[0]),o.push(0),s.push(0);for(let v=1;v<e.length;v++){let F=d[v]||e[v],D=i[v]||e[v],h=d[v-1]||e[v-1],X=i[v-1]||e[v-1],b=e[v-1],T=F-D,C=Math.abs(F-b),R=Math.abs(D-b);r.push(Math.max(T,C,R));let M=F-h,x=X-D;M>x&&M>0?(o.push(M),s.push(0)):x>M&&x>0?(o.push(0),s.push(x)):(o.push(0),s.push(0))}let c=[],p=[],u=[],m=0,S=0,g=0;for(let v=0;v<a;v++)m+=r[v],S+=o[v],g+=s[v];c.push(m),p.push(S),u.push(g);for(let v=a;v<r.length;v++){let F=c[c.length-1]-c[c.length-1]/a+r[v],D=p[p.length-1]-p[p.length-1]/a+o[v],h=u[u.length-1]-u[u.length-1]/a+s[v];c.push(F),p.push(D),u.push(h)}let y=[],P=[];for(let v=0;v<c.length;v++)y.push(p[v]/c[v]*100),P.push(u[v]/c[v]*100);let f=[];for(let v=0;v<y.length;v++){let F=y[v]+P[v],D=Math.abs(y[v]-P[v]);f.push(F>0?D/F*100:0)}if(f.length<a)return[];let E=0;for(let v=0;v<a;v++)E+=f[v];n.push(E/a);for(let v=a;v<f.length;v++){let F=n[n.length-1]-n[n.length-1]/a+f[v];n.push(F)}return n}static calculateDMI(e,d,i){if(e.length<14)return[];let a=14,n=[],r=[],o=[],s=[];r.push(d[0]-i[0]),o.push(0),s.push(0);for(let F=1;F<e.length;F++){let D=d[F]||e[F],h=i[F]||e[F],X=d[F-1]||e[F-1],b=i[F-1]||e[F-1],T=e[F-1],C=D-h,R=Math.abs(D-T),M=Math.abs(h-T);r.push(Math.max(C,R,M));let x=D-X,N=b-h;x>N&&x>0?(o.push(x),s.push(0)):N>x&&N>0?(o.push(0),s.push(N)):(o.push(0),s.push(0))}let c=[],p=[],u=[],m=0,S=0,g=0;for(let F=0;F<a;F++)m+=r[F],S+=o[F],g+=s[F];c.push(m),p.push(S),u.push(g);for(let F=a;F<r.length;F++){let D=c[c.length-1]-c[c.length-1]/a+r[F],h=p[p.length-1]-p[p.length-1]/a+o[F],X=u[u.length-1]-u[u.length-1]/a+s[F];c.push(D),p.push(h),u.push(X)}let y=[],P=[];for(let F=0;F<c.length;F++)y.push(p[F]/c[F]*100),P.push(u[F]/c[F]*100);let f=[];for(let F=0;F<y.length;F++){let D=y[F]+P[F],h=Math.abs(y[F]-P[F]);f.push(D>0?h/D*100:0)}if(f.length<a)return[];let E=[],v=0;for(let F=0;F<a;F++)v+=f[F];E.push(v/a);for(let F=a;F<f.length;F++){let D=E[E.length-1]-E[E.length-1]/a+f[F];E.push(D)}for(let F=0;F<E.length;F++)n.push({plusDI:y[F+a-1]||0,minusDI:P[F+a-1]||0,adx:E[F]});return n}static calculateIchimoku(e,d,i){if(e.length<52)return[];let a=[],n=[];for(let u=8;u<e.length;u++){let m=Math.max(...d.slice(u-8,u+1)),S=Math.min(...i.slice(u-8,u+1));n.push((m+S)/2)}let r=[];for(let u=25;u<e.length;u++){let m=Math.max(...d.slice(u-25,u+1)),S=Math.min(...i.slice(u-25,u+1));r.push((m+S)/2)}let o=[];for(let u=0;u<Math.min(n.length,r.length);u++)o.push((n[u]+r[u])/2);let s=[];for(let u=51;u<e.length;u++){let m=Math.max(...d.slice(u-51,u+1)),S=Math.min(...i.slice(u-51,u+1));s.push((m+S)/2)}let c=[];for(let u=26;u<e.length;u++)c.push(e[u-26]);let p=Math.min(n.length,r.length,o.length,s.length,c.length);for(let u=0;u<p;u++)a.push({tenkan:n[u],kijun:r[u],senkouA:o[u],senkouB:s[u],chikou:c[u]});return a}static calculateParabolicSAR(e,d,i){if(e.length<2)return[];let a=[],n=.02,r=.2,o=i[0],s=!0,c=n,p=d[0];a.push(o);for(let u=1;u<e.length;u++){let m=d[u]||e[u],S=i[u]||e[u];if(s){if(S<o)s=!1,o=p,p=S,c=n;else if(m>p&&(p=m,c=Math.min(c+n,r)),o=o+c*(p-o),u>0){let g=i[u-1]||e[u-1];o=Math.min(o,g)}}else if(m>o)s=!0,o=p,p=m,c=n;else if(S<p&&(p=S,c=Math.min(c+n,r)),o=o+c*(p-o),u>0){let g=d[u-1]||e[u-1];o=Math.max(o,g)}a.push(o)}return a}};var ed=class t{static calculateBollingerBands(e,d=20,i=2){if(e.length<d)return[];let a=Ne.calculateSMA(e,d),n=[];for(let r=0;r<a.length;r++){let o=e.slice(r,r+d),s=a[r],c=o.reduce((S,g)=>S+(g-s)**2,0)/d,p=Math.sqrt(c),u=s+p*i,m=s-p*i;n.push({upper:u,middle:s,lower:m,bandwidth:(u-m)/s*100,percentB:(e[r]-m)/(u-m)*100})}return n}static calculateATR(e,d,i){if(e.length<2)return[];let a=[];for(let r=1;r<e.length;r++){let o=d[r]||e[r],s=i[r]||e[r],c=e[r-1],p=o-s,u=Math.abs(o-c),m=Math.abs(s-c);a.push(Math.max(p,u,m))}let n=[];if(a.length>=14){let r=a.slice(0,14).reduce((o,s)=>o+s,0);n.push(r/14);for(let o=14;o<a.length;o++)r=r-a[o-14]+a[o],n.push(r/14)}return n}static calculateKeltnerChannels(e,d,i){let a=[];if(e.length<20)return[];let o=Ne.calculateEMA(e,20),s=t.calculateATR(e,d,i);for(let c=0;c<Math.min(o.length,s.length);c++){let p=o[c],u=s[c];a.push({upper:p+2*u,middle:p,lower:p-2*u})}return a}static calculateDonchianChannels(e){let d=[];for(let i=20;i<e.length;i++){let a=e.slice(i-20,i);d.push({upper:Math.max(...a),middle:(Math.max(...a)+Math.min(...a))/2,lower:Math.min(...a)})}return d}static calculateChaikinVolatility(e,d,i){let a=[];if(e.length<10*2)return[];let r=[];for(let s=0;s<e.length;s++){let c=d[s]||e[s],p=i[s]||e[s];r.push(c-p)}let o=Ne.calculateEMA(r,10);for(let s=10;s<o.length;s++){let c=o[s],p=o[s-10],u=p!==0?(c-p)/p*100:0;a.push(u)}return a}};var td=class{static calculateOBV(e,d){let i=[d[0]];for(let a=1;a<e.length;a++)e[a]>e[a-1]?i.push(i[a-1]+d[a]):e[a]<e[a-1]?i.push(i[a-1]-d[a]):i.push(i[a-1]);return i}static calculateCMF(e,d,i,a){let n=[];if(e.length<20)return[];for(let o=19;o<e.length;o++){let s=0,c=0;for(let u=o-20+1;u<=o;u++){let m=d[u]||e[u],S=i[u]||e[u],g=e[u],y=a[u]||1,f=(g-S-(m-g))/(m-S)*y;s+=f,c+=y}let p=c!==0?s/c:0;n.push(p)}return n}static calculateADL(e,d,i,a){let n=[0];for(let r=1;r<e.length;r++){let o=d[r]||e[r],s=i[r]||e[r],c=e[r],p=a[r]||1,m=(c-s-(o-c))/(o-s)*p;n.push(n[r-1]+m)}return n}static calculateVolumeROC(e){let d=[];for(let i=10;i<e.length;i++)d.push((e[i]-e[i-10])/e[i-10]*100);return d}static calculateMFI(e,d,i,a){let n=[];if(e.length<15)return[];for(let o=14;o<e.length;o++){let s=0,c=0;for(let m=o-14+1;m<=o;m++){let S=d[m]||e[m],g=i[m]||e[m],y=e[m],P=a[m]||1,f=(S+g+y)/3,E=f*P;if(m>o-14+1){let v=d[m-1]||e[m-1],F=i[m-1]||e[m-1],D=e[m-1],h=(v+F+D)/3;f>h?s+=E:f<h&&(c+=E)}}let u=100-100/(1+(c!==0?s/c:0));n.push(u)}return n}static calculateVWAP(e,d){let i=[],a=0,n=0;for(let r=0;r<e.length;r++)a+=e[r]*(d[r]||1),n+=d[r]||1,i.push(a/n);return i}};function Ag(t){return t.reduce((e,d)=>e+d,0)}var is=class{prices;volumes;highs;lows;constructor(e){this.prices=e.map(d=>d.trade>0?d.trade:d.midPrice),this.volumes=e.map(d=>d.volume),this.highs=e.map(d=>d.tradingSessionHighPrice>0?d.tradingSessionHighPrice:d.trade),this.lows=e.map(d=>d.tradingSessionLowPrice>0?d.tradingSessionLowPrice:d.trade)}calculatePriceChanges(){let e=[];for(let d=1;d<this.prices.length;d++)e.push((this.prices[d]-this.prices[d-1])/this.prices[d-1]);return e}analyze(){let e=this.prices[this.prices.length-1],d=this.prices[0],i=Math.max(...this.highs),a=Math.min(...this.lows),n=Ag(this.volumes),r=n/this.volumes.length,o=this.calculatePriceChanges(),s=o.length>0?Math.sqrt(o.reduce((T,C)=>T+C**2,0)/o.length)*Math.sqrt(252)*100:0,c=(e-d)/d*100,p=(e-a)/(i-a)*100,u=this.prices.reduce((T,C,R)=>T+C*this.volumes[R],0)/n,m=this.prices.length>5?(e-this.prices[Math.max(0,this.prices.length-6)])/this.prices[Math.max(0,this.prices.length-6)]*100:0,S=this.prices.length>10?(e-this.prices[Math.max(0,this.prices.length-11)])/this.prices[Math.max(0,this.prices.length-11)]*100:0,g=bd.calculateMaxDrawdown(this.prices),y=ed.calculateATR(this.prices,this.highs,this.lows),P=y.length>0?y[y.length-1]:0,f=s,E=s,v=c/s,F=c/E,D=c/g,h=bd.calculateMaxConsecutiveLosses(this.prices),X=bd.calculateWinRate(this.prices),b=bd.calculateProfitFactor(this.prices);return{currentPrice:e,startPrice:d,sessionHigh:i,sessionLow:a,totalVolume:n,avgVolume:r,volatility:s,sessionReturn:c,pricePosition:p,trueVWAP:u,momentum5:m,momentum10:S,maxDrawdown:g,atr:P,impliedVolatility:f,realizedVolatility:E,sharpeRatio:v,sortinoRatio:F,calmarRatio:D,maxConsecutiveLosses:h,winRate:X,profitFactor:b}}getTechnicalIndicators(){return{sma5:Ne.calculateSMA(this.prices,5),sma10:Ne.calculateSMA(this.prices,10),sma20:Ne.calculateSMA(this.prices,20),sma50:Ne.calculateSMA(this.prices,50),sma200:Ne.calculateSMA(this.prices,200),ema8:Ne.calculateEMA(this.prices,8),ema12:Ne.calculateEMA(this.prices,12),ema21:Ne.calculateEMA(this.prices,21),ema26:Ne.calculateEMA(this.prices,26),wma20:Ne.calculateWMA(this.prices,20),vwma20:Ne.calculateVWMA(this.prices,this.volumes,20),macd:Ed.calculateMACD(this.prices),adx:Ed.calculateADX(this.prices,this.highs,this.lows),dmi:Ed.calculateDMI(this.prices,this.highs,this.lows),ichimoku:Ed.calculateIchimoku(this.prices,this.highs,this.lows),parabolicSAR:Ed.calculateParabolicSAR(this.prices,this.highs,this.lows),rsi:Zt.calculateRSI(this.prices,14),stochastic:Zt.calculateStochastic(this.prices,this.highs,this.lows),cci:Zt.calculateCCI(this.prices,this.highs,this.lows),roc:Zt.calculateROC(this.prices),williamsR:Zt.calculateWilliamsR(this.prices),momentum:Zt.calculateMomentum(this.prices),bollinger:ed.calculateBollingerBands(this.prices,20,2),atr:ed.calculateATR(this.prices,this.highs,this.lows),keltner:ed.calculateKeltnerChannels(this.prices,this.highs,this.lows),donchian:ed.calculateDonchianChannels(this.prices),chaikinVolatility:ed.calculateChaikinVolatility(this.prices,this.highs,this.lows),obv:td.calculateOBV(this.prices,this.volumes),cmf:td.calculateCMF(this.prices,this.highs,this.lows,this.volumes),adl:td.calculateADL(this.prices,this.highs,this.lows,this.volumes),volumeROC:td.calculateVolumeROC(this.volumes),mfi:td.calculateMFI(this.prices,this.highs,this.lows,this.volumes),vwap:td.calculateVWAP(this.prices,this.volumes),pivotPoints:Fd.calculatePivotPoints(this.prices,this.highs,this.lows),fibonacci:Fd.calculateFibonacciLevels(this.prices),gannLevels:Fd.calculateGannLevels(this.prices),elliottWave:Fd.calculateElliottWave(this.prices),harmonicPatterns:Fd.calculateHarmonicPatterns(this.prices)}}generateJSONAnalysis(e){let d=this.analyze(),i=this.getTechnicalIndicators(),a=this.calculatePriceChanges(),n=i.sma5.length>0?i.sma5[i.sma5.length-1]:null,r=i.sma10.length>0?i.sma10[i.sma10.length-1]:null,o=i.sma20.length>0?i.sma20[i.sma20.length-1]:null,s=i.sma50.length>0?i.sma50[i.sma50.length-1]:null,c=i.sma200.length>0?i.sma200[i.sma200.length-1]:null,p=i.ema8[i.ema8.length-1],u=i.ema12[i.ema12.length-1],m=i.ema21[i.ema21.length-1],S=i.ema26[i.ema26.length-1],g=i.wma20.length>0?i.wma20[i.wma20.length-1]:null,y=i.vwma20.length>0?i.vwma20[i.vwma20.length-1]:null,P=i.macd.length>0?i.macd[i.macd.length-1]:null,f=i.adx.length>0?i.adx[i.adx.length-1]:null,E=i.dmi.length>0?i.dmi[i.dmi.length-1]:null,v=i.ichimoku.length>0?i.ichimoku[i.ichimoku.length-1]:null,F=i.parabolicSAR.length>0?i.parabolicSAR[i.parabolicSAR.length-1]:null,D=i.rsi.length>0?i.rsi[i.rsi.length-1]:null,h=i.stochastic.length>0?i.stochastic[i.stochastic.length-1]:null,X=i.cci.length>0?i.cci[i.cci.length-1]:null,b=i.roc.length>0?i.roc[i.roc.length-1]:null,T=i.williamsR.length>0?i.williamsR[i.williamsR.length-1]:null,C=i.momentum.length>0?i.momentum[i.momentum.length-1]:null,R=i.bollinger.length>0?i.bollinger[i.bollinger.length-1]:null,M=i.atr.length>0?i.atr[i.atr.length-1]:null,x=i.keltner.length>0?i.keltner[i.keltner.length-1]:null,N=i.donchian.length>0?i.donchian[i.donchian.length-1]:null,w=i.chaikinVolatility.length>0?i.chaikinVolatility[i.chaikinVolatility.length-1]:null,A=i.obv.length>0?i.obv[i.obv.length-1]:null,U=i.cmf.length>0?i.cmf[i.cmf.length-1]:null,L=i.adl.length>0?i.adl[i.adl.length-1]:null,j=i.volumeROC.length>0?i.volumeROC[i.volumeROC.length-1]:null,B=i.mfi.length>0?i.mfi[i.mfi.length-1]:null,H=i.vwap.length>0?i.vwap[i.vwap.length-1]:null,Y=i.pivotPoints.length>0?i.pivotPoints[i.pivotPoints.length-1]:null,Q=i.fibonacci.length>0?i.fibonacci[i.fibonacci.length-1]:null,W=i.gannLevels.length>0?i.gannLevels:[],G=i.elliottWave.length>0?i.elliottWave[i.elliottWave.length-1]:null,K=i.harmonicPatterns.length>0?i.harmonicPatterns:[],te=this.volumes[this.volumes.length-1],_=te/d.avgVolume,Z=(d.sessionHigh-d.currentPrice)/d.sessionHigh*100,de=(d.sessionHigh-d.sessionLow)/d.sessionLow*100,oe=(d.currentPrice-d.trueVWAP)/d.trueVWAP*100,pe=da.generateSignals(d.currentPrice,d.trueVWAP,d.momentum5,d.momentum10,d.sessionReturn,te,d.avgVolume,d.pricePosition,d.volatility),fe=da.calculateOverallSignal(pe.bullishSignals,pe.bearishSignals,pe.signals,d.volatility),me=Math.max(d.sessionLow*1.005,d.trueVWAP*.998),Pe=d.sessionLow*.995,dd=d.sessionHigh*.995,vi=(dd-d.currentPrice)/(d.currentPrice-Pe),Kd=bd.calculatePositionSize(me,Pe),k=Kd*(me-Pe),q=dt.calculateVAR(this.prices,this.volumes),ee=dt.calculateGaussianProcess(this.prices),ne=dt.calculatePairsTrading(this.prices,this.prices.map(_d=>_d*1.01)),$=dt.calculateFourierTransform(this.prices),ye=dt.calculateEMD(this.prices),Ae=Lt.calculateBlackScholes(d.currentPrice,d.startPrice,d.avgVolume),Tt=Lt.calculateBinomialTree(d.currentPrice,d.startPrice),id=Lt.calculateTrinomialTree(d.currentPrice,d.startPrice),Ci=Lt.calculateMonteCarlo(d.currentPrice,d.startPrice),Xi=Lt.calculateHestonModel(d.currentPrice,d.startPrice),Ti=Lt.calculateSABRModel(d.currentPrice,d.startPrice),Yd=Lt.calculateVarianceGamma(d.currentPrice,d.startPrice);return{symbol:e,timestamp:new Date().toISOString(),marketStructure:{currentPrice:d.currentPrice,startPrice:d.startPrice,sessionHigh:d.sessionHigh,sessionLow:d.sessionLow,rangeWidth:de,totalVolume:d.totalVolume,sessionPerformance:d.sessionReturn,positionInRange:d.pricePosition},volatility:{impliedVolatility:d.impliedVolatility,realizedVolatility:d.realizedVolatility,atr:d.atr,maxDrawdown:d.maxDrawdown*100,currentDrawdown:Z},technicalIndicators:{sma5:n,sma10:r,sma20:o,sma50:s,sma200:c,ema8:p,ema12:u,ema21:m,ema26:S,wma20:g,vwma20:y,macd:P,adx:f,dmi:E,ichimoku:v,parabolicSAR:F,rsi:D,stochastic:h,cci:X,roc:b,williamsR:T,momentum:C,bollingerBands:R?{upper:R.upper,middle:R.middle,lower:R.lower,bandwidth:R.bandwidth,percentB:R.percentB}:null,atr:M,keltnerChannels:x?{upper:x.upper,middle:x.middle,lower:x.lower}:null,donchianChannels:N?{upper:N.upper,middle:N.middle,lower:N.lower}:null,chaikinVolatility:w,obv:A,cmf:U,adl:L,volumeROC:j,mfi:B,vwap:H},volumeAnalysis:{currentVolume:te,averageVolume:Math.round(d.avgVolume),volumeRatio:_,trueVWAP:d.trueVWAP,priceVsVWAP:oe,obv:A,cmf:U,mfi:B},momentum:{momentum5:d.momentum5,momentum10:d.momentum10,sessionROC:d.sessionReturn,rsi:D,stochastic:h,cci:X},supportResistance:{pivotPoints:Y,fibonacci:Q,gannLevels:W,elliottWave:G,harmonicPatterns:K},tradingSignals:fe,statisticalModels:{zScore:dt.calculateZScore(d.currentPrice,d.startPrice),ornsteinUhlenbeck:dt.calculateOrnsteinUhlenbeck(d.currentPrice,d.startPrice,d.avgVolume,a),kalmanFilter:dt.calculateKalmanFilter(d.currentPrice,d.startPrice,d.avgVolume,a),pairsTrading:ne,arima:dt.calculateARIMA(d.currentPrice,a),garch:dt.calculateGARCH(d.avgVolume,a),var:q,gaussianProcess:ee,hilbertTransform:dt.calculateHilbertTransform(d.currentPrice,a),waveletTransform:dt.calculateWaveletTransform(d.currentPrice,a),fourierTransform:$,empiricalModeDecomposition:ye},optionsAnalysis:Ae?{blackScholes:Ae,binomialTree:Tt,trinomialTree:id,monteCarlo:Ci,hestonModel:Xi,sabrModel:Ti,varianceGamma:Yd,impliedVolatility:d.impliedVolatility,delta:Ae.delta,gamma:Ae.gamma,theta:Ae.theta,vega:Ae.vega,rho:Ae.rho,greeks:{delta:Ae.delta,gamma:Ae.gamma,theta:Ae.theta,vega:Ae.vega,rho:Ae.rho}}:null,riskManagement:{targetEntry:me,stopLoss:Pe,profitTarget:dd,riskRewardRatio:vi,positionSize:Kd,maxRisk:k},performance:{sharpeRatio:d.sharpeRatio,sortinoRatio:d.sortinoRatio,calmarRatio:d.calmarRatio,maxDrawdown:d.maxDrawdown*100,winRate:d.winRate,profitFactor:d.profitFactor,totalReturn:d.sessionReturn,volatility:d.volatility}}}},Tu=t=>async e=>{try{let d=e.symbol,i=t.get(d)||[];if(i.length===0)return{content:[{type:"text",text:`No price data available for ${d}. Please request market data first.`,uri:"technicalAnalysis"}]};if(!i.every(o=>typeof o.trade=="number"&&!Number.isNaN(o.trade)&&typeof o.midPrice=="number"&&!Number.isNaN(o.midPrice)))throw new Error("Invalid market data");let r=new is(i).generateJSONAnalysis(d);return{content:[{type:"text",text:`Technical Analysis for ${d}:
10113
+ The gateways may be offered by service providers simulating execution venues or offered directly by the venues.`,fieldRef:[{added:"FIX.Latest",addedEP:"295",id:3093,description:"Required if NoTestGatewayDetails(3092)>0."},{added:"FIX.Latest",addedEP:"295",id:3094,description:"Required if NoTestGatewayDetails(3092)>0."},{added:"FIX.Latest",addedEP:"295",id:3095,description:"Required if NoTestGatewayDetails(3092)>0."},{added:"FIX.Latest",addedEP:"295",id:3096,description:""}],numInGroup:{id:3092,added:"FIX.Latest",addedEP:"295",description:""}}],ug=class{groups=lg;cacheMap=new Map;cacheMapByName=new Map;constructor(){this.groups.forEach(t=>{this.cacheMap.set(t.id,t)}),this.groups.forEach(t=>{this.cacheMapByName.set(t.name,t)})}find(t){return this.cacheMap.get(t)}findByName(t){return this.cacheMapByName.get(t)}filterMapByNumInGroupId(t,e){if(t===O.NoMDEntries&&e===be.MarketDataSnapshotFullRefresh)return this.find(2031);if(t===O.NoMDEntries&&e===be.MarketDataIncrementalRefresh)return this.find(2032);for(let[,d]of this.cacheMap.entries())if(d.numInGroup?.id===t)return d}},Et=Object.freeze({FIX27:"0",FIX30:"1",FIX40:"2",FIX41:"3",FIX42:"4",FIX43:"5",FIX44:"6",FIX50:"7",FIX50SP1:"8",FIX50SP2:"9",FIXLatest:"10"}),mg=(t,e)=>{if(Number.isNaN(t.getTime()))return e.log({level:"error",message:"Invalid date specified!"}),"";let d=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())),i=d.getUTCFullYear(),a=String(d.getUTCMonth()+1).padStart(2,"0"),n=String(d.getUTCDate()).padStart(2,"0"),r=String(d.getUTCHours()).padStart(2,"0"),o=String(d.getUTCMinutes()).padStart(2,"0"),s=String(d.getUTCSeconds()).padStart(2,"0"),c=String(d.getUTCMilliseconds()).padStart(3,"0");return`${i}${a}${n}-${r}:${o}:${s}.${c}`},yg={version:"0.0.0",build:"2025-07-09T01:42:03.392Z"},ba=t=>bu[t]??t,bu={[Et.FIX27]:"FIX.2.7",[Et.FIX30]:"FIX.3.0",[Et.FIX40]:"FIX.4.0",[Et.FIX41]:"FIX.4.1",[Et.FIX42]:"FIX.4.2",[Et.FIX43]:"FIX.4.3",[Et.FIX44]:"FIX.4.4",[Et.FIX50]:"FIX.5.0",[Et.FIX50SP1]:"FIX.5.0SP1",[Et.FIX50SP2]:"FIX.5.0SP2",[Et.FIXLatest]:"FIXT.1.1"},xa=bu[Et.FIXLatest],Xc=30,Tc=1e5,Dc="utf8",ga="",Sg="=",Pg=/[.*+?^${}()|[\]\\]/g,gg=/8=FIXT?\.\d\.\d([^\d]+)/i,Rc=100,hg=(t,e)=>`0000000000000000${t}`.slice(-e),di="10=",Ar="35=",Nc="",Ac="",fg=t=>t.enumeration?.name??t.value,wc=(t,e,d=!1)=>{let i=d?fg(t):t.value,a=t.name??t.tag;e[a]?e[a]=Array.isArray(e[a])?[...e[a],i]:[e[a],i]:e[a]=i},Fu=class Eu{fixVersion=xa;data=[];messageString="";description="";messageType="";messageTypeDescription="";messageSequence=-1;structure=void 0;bodyLengthValid=!1;checksumValid=!1;checksumValue=void 0;checksumExpected=void 0;bodyLengthValue=void 0;bodyLengthExpected=void 0;#n=void 0;#i=void 0;#a=void 0;#e=void 0;#t=void 0;constructor(e=xa,...d){this.fixVersion=ba(e),this.reset(),d.forEach(i=>{i.tag===O.BeginString&&(this.fixVersion=String(i.value)),i.tag===O.MsgSeqNum&&(this.messageSequence=Number(i.value)),i.tag===O.MsgType?this.data.splice(0,0,i):this.data.push(i)})}#d=()=>{this.#n||(this.#n=new xr),this.#i||(this.#i=new Bc),this.#a||(this.#a=new qc),this.#e||(this.#e=new pg),this.#t||(this.#t=new ug)};#o=e=>{let d=e.indexOf(Ar)===-1?0:e.indexOf(Ar)+1;return(e.lastIndexOf(di)===-1?e.length:e.lastIndexOf(di)+1)-d};#r=e=>{let d=0;for(let i=0;i<e.length;i++)d+=e.charCodeAt(i);return hg(d%256,3)};#s=(e,...d)=>{let i=e[0],a=1;for(a;a<e.length;a++)(d[a-1]||d[a-1]==="0")&&(i+=d[a-1]),i+=e[a];return i.replace(/\s+/g," ")};#c=(e,d,i)=>{if(e?.data[d]&&e?.presence==="required"){let a=e?.data[d].filter(n=>n.presence==="required");for(let n of a)if(!i.has(Number(n.id)))return{field:{...n},name:n.name,tag:Number(n.id),value:null,error:`Missing field ${n.name}`}}};#p=(e,d=!0)=>{this.#d();let i=[],a=structuredClone(e.data),n=new Set(a.map(o=>o.tag)),r=(o,s,c)=>{let p=this.#i?.cacheMap.get(o.tag);i.push({field:p,name:o.name,tag:o.tag,value:o.value,error:s,expectedValue:c})};for(let o of a){let s=this.#n?.getEnumByTag(String(o.tag)),c=s&&this.#n?.getEnum(String(o.tag),o.value),p=this.#a?.validateDatatype(o.value,o.type?.name);(s&&!c||!p)&&r(o,"Incorrect data format for value"),o.tag===O.BodyLength&&!this.validateBodyLength(String(this.bodyLengthValue))&&r(o,"Incorrect value for BodyLength",this.bodyLengthExpected),o.tag===O.CheckSum&&!this.validateChecksum(String(this.checksumValue))&&r(o,"Incorrect value for CheckSum",this.checksumExpected)}if(this.structure)for(let o of this.structure){if(d&&o.presence!=="required")continue;let{id:s,name:c,fieldRef:p,groupRef:u,componentRef:m}=o.data,S=Number(s),g=!n.has(S)&&!p&&!u&&!m&&S!==1003,y=[1137,372,1130,1410,1128].includes(S)&&[1137,372,1130,1410,1128].some(P=>n.has(P));if(g&&!y)if(o.data.type==="component"){let P=this.#l(S),f=new Set(a.map(E=>E.tag));P.length>0&&!P.some(E=>f.has(E))&&i.push({field:{...o.data},tag:Number(o.data.id),name:o.data.name,value:null,error:`Missing block ${o.data.name}`})}else r({tag:S,name:c},`Missing field ${c}`);["fieldRef","componentRef","groupRef"].forEach(P=>{let f=this.#c(o,P,n);f&&i.push(f)})}return i};#l=e=>{let d=this.#e?.cacheMap.get(e);if(!d)return[];let{fieldRef:i=[],componentRef:a=[],groupRef:n=[]}=d;return[...i.map(r=>r.id),...a.map(r=>r.id),...n.map(r=>r.id)]};addField(e){this.data.push(e)}addFields(...e){e.forEach(d=>{d.tag===O.MsgType?this.data.splice(0,0,d):this.data.push(d)})}removeFieldByTag(e){let d=this.data.findIndex(i=>i.tag===e);d>-1&&this.data.splice(d,1)}getField(e){return this.data.find(d=>d.tag===e)}getFields(e){return this.data.filter(d=>d.tag===e)}getFieldExplains(){let e={};return this.data.forEach(d=>{wc(d,e,!0)}),e}getFieldNameValues(){let e={};return this.data.forEach(d=>{wc(d,e,!1)}),e}getFieldValues(){let e={};return this.data.forEach(d=>{e[d.tag]?Array.isArray(e[d.tag])?e[d.tag]=[...e[d.tag],d.value]:e[d.tag]=[e[d.tag],d.value]:e[d.tag]=d.value}),e}setField(e){let d=this.data.findIndex(i=>i.tag===e.tag);d>-1?this.data[d]=e:this.data.push(e),e.tag!==O.BodyLength&&e.tag!==O.CheckSum&&this.recalculateMessageLengths()}getEnum(e,d){return!this.getField(O.MsgType)?.tag||!this.getField(O.MsgType)?.value?void 0:new xr().getEnum(e.toString(),d)}getBriefDescription(){let e="",d=this.getField(O.Side),i="";if(d?.enumeration&&(i=d.enumeration.name,i=i?i.replace("Sell","SL").toUpperCase():void 0),this.getField(O.LeavesQty)!==void 0){let a="";this.getField(O.ContraTradeQty)?a=String(this.getField(O.ContraTradeQty)?.value):a=String(this.getField(O.OrderQty)?.value??"");let n=String(this.getField(O.LeavesQty)?.value),r=this.getField(O.LastPx)?Number(this.getField(O.LastPx)?.value):0;e=this.#s`${a} @${r||r===0?r.toFixed(2):"0.00"} ${this.getField(O.LeavesQty).name.replace("LeavesQty","LvsQty")} ${Number.parseInt(n,10).toString()}`}else if(this.getField(O.OrderQty)){let a=String(this.getField(O.OrderQty)?.value),n=this.getField(O.Symbol)?String(this.getField(O.Symbol)?.value):"",r=this.getField(O.OrdType),o="";r?.enumeration?.name&&(o=r.enumeration.name);let s=this.getField(O.TimeInForce),c="";s?.enumeration&&(c=String(s.enumeration.name));let p=this.getField(O.Price);if(p){let u=String(p.value),m=Number(p.value);m>=1?u=m.toFixed(2):m<1&&(u=m.toString().replace("0.","."));let S=i?`${i} `:"",g=a?`${a} `:"",y=n?`${n.toUpperCase()} `:"",P=o?`${o.replace("Market","MKT").replace("Limit","LMT").toUpperCase()} `:"",f=`@${u} `,E=c?c.toUpperCase():"",v=S+g+y+P+f+E;e=this.#s`${v}`}else e=this.#s`${i??""} ${a} ${n?n.toUpperCase():""} ${o?o.replace("Market","MKT").replace("Limit","LMT").toUpperCase():""} ${c?c.toUpperCase():""}`}else{let a=this.getField(O.MsgType);return a?.tag&&a.value?this.getEnum(a.tag,String(a.value))?.name??"":void 0}return e.trim()}validateBodyLength(e){let d=this.messageString.indexOf(Ar),i=this.messageString.lastIndexOf(di),a=d===-1?0:d,n=(i===-1?this.messageString.length:i)-a;return this.bodyLengthValue=Number(e),this.bodyLengthExpected=n,this.bodyLengthValid=Number(e)===n,this.bodyLengthValid}validateChecksum(e){let d=this.messageString.lastIndexOf(di),i=d===-1?this.messageString.length:d,a=this.messageString.substring(0,i),n=this.#r(a);return this.checksumValue=e,this.checksumExpected=n,this.checksumValid=e===n,this.checksumValid}recalculateMessageLengths(){let e=this.#o(this.messageString),d=this.messageString.lastIndexOf(di),i=d===-1?this.messageString.length:d,a=this.messageString.substring(0,i),n=this.#r(a);return this.bodyLengthValue=e,this.bodyLengthExpected=e,this.bodyLengthValid=!0,this.checksumValue=n,this.checksumExpected=n,this.checksumValid=!0,this.setField(new V(O.BodyLength,e)),this.setField(new V(O.CheckSum,n)),{bodyLength:e,checksum:n}}validate(e=!0){if(!Me.validateFreeLicense())throw new Error(Me.ERROR_MESSAGE_NO_FREE_LICENSE);return this.#p(this,e)}encode(e=ga){if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);let d=this.data.map(u=>new V(u.tag,u.value)),i=[],a=new V(O.BeginString,this.fixVersion).toString(),n=new V(O.BodyLength,Nc).toString(),r=new V(O.CheckSum,Ac).toString(),o=d.findIndex(u=>u.tag===O.BeginString);if(o>-1){let u=ba(d[o].value);a=new V(O.BeginString,u).toString(),d.splice(o,1)}o=d.findIndex(u=>u.tag===O.BodyLength),o>-1&&(n=d[o].toString(),d.splice(o,1)),o=d.findIndex(u=>u.tag===O.CheckSum),o>-1&&(r=d[o].toString(),d.splice(o,1)),i.push(a),i.push(n),d.forEach(u=>{i.push(u.toString())}),i.push(r);let s=`${i.join(e)}${e}`;s=s.replace(Nc,this.#o(s).toString());let c=s.lastIndexOf(di)===-1?s.length:s.lastIndexOf(di),p=this.#r(s.substring(0,c));return s=s.replace(Ac,p),s}toFIXJSON(){if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);this.#d();let e=this.#e?.getTagsByComponentName("StandardHeader"),d=this.#e?.getTagsByComponentName("StandardTrailer"),i={},a={},n={},r=0,o=[],s=()=>{m();let S=o[r],g=S.parentName==="Body"?a:o.find(y=>y.name===S.parentName);g&&(S.parentName==="Body"?a[S.name]=S.values:g.valueInstance[S.name]=S.values),o.splice(r,1),r--},c=S=>{for(;o.length>0&&!o[r].availableTagsInGroup.has(S.tag);)s()},p=(S,g)=>{let y=o.length>0?o[r].name:"Body",P={name:S.name??`${S.tag}`,parentName:y,availableTagsInGroup:new Set,valueInstanceFirstTag:this.data[g+1].tag,valueInstance:{},values:[]};o.push(P),r=o.length===1?0:r+1;let f=this.#t?.filterMapByNumInGroupId(S.tag,this.messageType);f&&u(f)},u=S=>{if(!S)return;let g=P=>o[r].availableTagsInGroup.add(Number(P.id));S.numInGroup&&g(S.numInGroup),S.fieldRef&&S.fieldRef.forEach(P=>{g(P)});let y=(P,f)=>{P.forEach(E=>{let v=f.find(Number(E.id));v&&u(v)})};S.groupRef&&this.#t&&y(S.groupRef,this.#t),S.componentRef&&this.#e&&y(S.componentRef,this.#e)},m=()=>{let{valueInstance:S,values:g}=o[r];Object.keys(S).length>0&&(g.push(S),o[r].valueInstance={})};return this.data.forEach((S,g)=>{let y=S.tag,P=S.enumeration?.name??S.value,f=S.name??`${S.tag}`;if(e?.includes(y)){i[f]=P;return}if(d?.includes(y)){c(S),n[f]=P;return}if(S?.type?.name==="NumInGroup"){o.length===0||o.length>0&&o[r]?.availableTagsInGroup.has(y)||s(),p(S,g);return}if(o.length>0&&o[r].availableTagsInGroup.has(y)){o[r].valueInstanceFirstTag===y?(m(),o[r].valueInstance[f]=P):o[r].valueInstance={...o[r].valueInstance,[S?.name??String(y)]:P};return}c(S),o[r]?.valueInstanceFirstTag===y&&(m(),o[r].valueInstance[f]=P),o[r]?.availableTagsInGroup.has(y)||(a[f]=P)}),{Header:i,Body:a,Trailer:n}}clone(){let e=new Eu(this.fixVersion,...this.data);return e.messageSequence=this.messageSequence,e.messageType=this.messageType,e}reset(){this.data=[],this.messageString="",this.description="",this.messageType="",this.messageSequence=-1,this.structure=void 0,this.bodyLengthValid=!1,this.checksumValid=!1,this.checksumValue=void 0,this.checksumExpected=void 0,this.bodyLengthValue=void 0,this.bodyLengthExpected=void 0}},Ig=class{fixVersion=xa;message=void 0;messageTags=[];messageString="";fields=new Bc;enums=new xr;proxy=void 0;tlsKey;tlsCert;tlsUseSNI;tlsSkipStdInPipe;skipValidation;processMessage(){let t=gg.exec(this.messageString);if(t&&t.length===2){let e=this.messageString.replace(new RegExp(t[1].replace(Pg,"\\$&"),"g"),ga);this.message&&(this.message.messageString=e),this.messageTags=e.split(ga)}else this.message=void 0,this.messageTags=[]}processFields(){let t,e,d=0,i,a;for(d;d<this.messageTags.length-1;d++)i=this.messageTags[d].indexOf(Sg),t=Number(this.messageTags[d].substring(0,i)),e=this.messageTags[d].substring(i+1),a=new V(t,e),this.fields.processField(this.message,a),this.enums.processEnum(a),a.tag===O.BeginString?this.message.fixVersion=String(a.value):a.tag===O.BodyLength?this.message?.validateBodyLength(e):a.tag===O.CheckSum&&this.message?.validateChecksum(e),this.message?.addField(a)}parse(t){if(!Me.validateFreeLicense())throw new Error(Me.ERROR_MESSAGE_NO_FREE_LICENSE);let e=0,d=t?t.split(/(?<!\d)8=FIX/):[],i=[];for(e;e<d.length;e++)this.message=new Fu(this.fixVersion),this.messageString=`8=FIX${d[e]}`,this.messageString.indexOf(ga)>-1?(this.message.messageString=this.messageString,this.messageTags=this.messageString.split(ga)):this.processMessage(),this.message&&(this.skipValidation||this.processFields(),i.push(this.message));return i}},bg=class{format;useStderr;constructor({format:t="json",useStderr:e=!1}){this.format=t,this.useStderr=e}configure(t){this.format=t.format||"json",t.useStderr!==void 0&&(this.useStderr=t.useStderr)}async send(t){let e=this.useStderr?console.error:console.log;if(this.format==="json")e(JSON.stringify(t));else if(this.format==="jsonrpc"){let{message:d,...i}=t,a={jsonrpc:"2.0",method:t.level,params:{message:d,...i}};e(JSON.stringify(a))}else{let{name:d,id:i,message:a,level:n,...r}=t,o=Object.entries(r).map(([c,p])=>`${c}: ${p}`),s="";d&&(s+=`${d} `),s+=`${i}: ${a}`,e(s,o.join(", "))}}async flush(){}async close(){}status(){return"connected"}},Fg=(t,e)=>e==="error"&&t.level==="error"||e==="warn"&&(t.level==="error"||t.level==="warn")?!0:e==="info"&&(t.level==="error"||t.level==="warn"||t.level==="info"),Mc=class{name;id;#n=!0;#i;#a;#e;constructor(t){this.name=t?.name??"",this.id=t?.id??Zu(),this.#e=t?.level??"info",this.#e=t?.level??"info",this.#a=t?.format??"json",this.#i=t?.transport??new bg({format:this.#a})}processMessage(t){if(this.#e==="silent"||!this.#n)return this;if(!Fg(t,this.#e))return this;let e={name:this.name,id:this.id,timestamp:Date.now(),...t};return this.#i.send(e),this}log(t){return this.processMessage({...t,level:t.level?t.level:"info"})}logWarning(t){return this.processMessage({...t,level:"warn"})}logError(t){return this.processMessage({...t,level:"error"})}set silent(t){this.#e=t?"silent":"info"}get silent(){return this.#e==="silent"}get level(){return this.#e}get format(){return this.#a}},Zg=Object.freeze({CarriedCustomerSide:1,CarriedNonCustomerSide:2,HouseTrader:3,FloorTrader:4,CarriedNonCustomerSideCrossMargined:6,HouseTraderCrossMargined:7,JointBackOfficeAccount:8,EquitiesSpecialist:9,OptionsMarketMaker:10,OptionsFirmAccount:11,AccountCustomerNonCustomerOrders:12,AccountOrdersMultipleCustomers:13}),eh=Object.freeze({BIC:1,SIDCode:2,TFM:3,OMGEO:4,DTCCCode:5,SPSAID:6,Other:99}),th=Object.freeze({Cancel:1,Error:2,Correction:3}),dh=Object.freeze({ProcessRequestAsMarginDisposition:0,DeltaPlus:1,DeltaMinus:2,Final:3,CustomerSpecificPosition:4}),ih=Object.freeze({Buy:"B",Sell:"S",Trade:"T",Cross:"X"}),ah=Object.freeze({New:"N",Cancel:"C",Replace:"R"}),nh=Object.freeze({Received:1,ConfirmRejected:2,Affirmed:3}),rh=Object.freeze({BookEntriesToBeAggregated:"Y",BookEntriesShouldNotBeAggregated:"N"}),oh=Object.freeze({OrderInitiatorIsAggressor:"Y",OrderInitiatorIsPassive:"N"}),sh=Object.freeze({Received:0,Accepted:1,Rejected:2}),ch=Object.freeze({New:0,Cancel:1,Replace:2}),ph=Object.freeze({CertificateInformation:0,CertificateStateChanged:1}),lh=Object.freeze({Received:0,Accepted:1,Rejected:2}),uh=Object.freeze({New:0,Cancel:1,Replace:2}),mh=Object.freeze({CertificateInformation:0,GenerateCertificate:1,ChangeCertificateStatus:2,ForwardCertificate:3}),yh=Object.freeze({Draft:0,Approved:1,Submitted:2,Registered:3}),Sh=Object.freeze({NonAlgorithmicTrade:0,AlgorithmicTrade:1}),Ph=Object.freeze({CarriedCustomerSide:1,CarriedNonCustomerSide:2,HouseTrader:3,FloorTrader:4,CarriedNonCustomerSideCrossMargined:6,HouseTraderCrossMargined:7,JointBackOfficeAccount:8}),gh=Object.freeze({Rollup:0,DoNotRollUp:1}),hh=Object.freeze({OriginalDetailsIncomplete:1,ChangeInUnderlyingOrderDetails:2,CancelledByGiveupFirm:3,Other:99}),fh=Object.freeze({Added:0,Canceled:1,Replaced:2,Changed:3,Pending:4}),Ih=Object.freeze({TradeType:1,TradePublicationIndicator:2,OrderHandlingInstruction:3}),bh=Object.freeze({Match:1,Forward:2,ForwardAndMatch:3,AutoClaimGiveUp:4}),Fh=Object.freeze({PendingAccept:1,PendingRelease:2,PendingReversal:3,Accept:4,BlockLevelReject:5,AccountLevelReject:6}),Eh=Object.freeze({FXNetting:0,FXSwap:1}),vh=Object.freeze({Automatic:1,Guarantor:2,Manual:3,BrokerAssigned:4}),Ch=Object.freeze({NotSpecified:0,ExplicitListProvided:1}),Xh=Object.freeze({Open:"O",Close:"C",Rolled:"R",FIFO:"F"}),Th=Object.freeze({UnknownAccount:0,IncorrectQuantity:1,IncorrectAveragePrice:2,UnknownExecutingBrokerMnemonic:3,CommissionDifference:4,UnknownOrderID:5,UnknownListID:6,OtherSeeText:7,IncorrectAllocatedQuantity:8,CalculationDifference:9,UnknownOrStaleExecID:10,MismatchedData:11,UnknownClOrdID:12,WarehouseRequestRejected:13,DuplicateOrMissingIndividualAllocID:14,TradeNotRecognized:15,DuplicateTrade:16,IncorrectOrMissingInstrument:17,IncorrectOrMissingSettlDate:18,IncorrectOrMissingFundIDOrFundName:19,IncorrectOrMissingSettlInstructions:20,IncorrectOrMissingFees:21,IncorrectOrMissingTax:22,UnknownOrMissingParty:23,IncorrectOrMissingSide:24,IncorrectOrMissingNetMoney:25,IncorrectOrMissingTradeDate:26,IncorrectOrMissingSettlCcyInstructions:27,IncorrectOrMissingProcessCode:28,Other:99}),Dh=Object.freeze({PreliminaryRequestToIntermediary:2,SellsideCalculatedUsingPreliminary:3,SellsideCalculatedWithoutPreliminary:4,WarehouseRecap:5,RequestToIntermediary:8,Accept:9,Reject:10,AcceptPending:11,Complete:12,ReversePending:14,Giveup:15,Takeup:16,Reversal:17,Alleged:18,SubAllocationGiveup:19}),Rh=Object.freeze({Accepted:0,Rejected:1}),Nh=Object.freeze({Completed:0,Refused:1,Cancelled:2}),Ah=Object.freeze({UseDefaultInstructions:0,DeriveFromParametersProvided:1,FullDetailsProvided:2,SSIDBIDsProvided:3,PhoneForInstructions:4}),wh=Object.freeze({Accepted:0,BlockLevelReject:1,AccountLevelReject:2,Received:3,Incomplete:4,RejectedByIntermediary:5,AllocationPending:6,Reversed:7,CancelledByIntermediary:8,Claimed:9,Refused:10,PendingGiveUpApproval:11,Cancelled:12,PendingTakeUpApproval:13,ReversalPending:14}),Mh=Object.freeze({New:"0",Replace:"1",Cancel:"2",Reversal:"6"}),xh=Object.freeze({Calculated:1,Preliminary:2,ReadyToBook:5,WarehouseInstruction:7,RequestToIntermediary:8,Accept:9,Reject:10,AcceptPending:11,IncompleteGroup:12,CompleteGroup:13,ReversalPending:14,ReopenGroup:15,CancelGroup:16,Giveup:17,Takeup:18,RefuseTakeup:19,InitiateReversal:20,Reverse:21,RefuseReversal:22,SubAllocationGiveup:23,ApproveGiveup:24,ApproveTakeup:25,NotionalValueAveragePxGroupAlloc:26}),Lh=Object.freeze({NoApplRecoveryNeeded:0,ApplRecoveryNeeded:1}),Oh=Object.freeze({NoActionTaken:0,QueueFlushed:1,OverlayLast:2,EndSession:3}),Uh=Object.freeze({NoActionTaken:0,QueueFlushed:1,OverlayLast:2,EndSession:3}),kh=Object.freeze({ApplSeqNumReset:0,LastMessageSent:1,ApplicationAlive:2,ResendComplete:3}),qh=Object.freeze({Retransmission:0,Subscription:1,RequestLastSeqNum:2,RequestApplications:3,Unsubscribe:4,CancelRetransmission:5,CancelRetransmissionUnsubscribe:6}),Bh=Object.freeze({ApplicationDoesNotExist:0,MessagesRequestedAreNotAvailable:1,UserNotAuthorizedForApplication:2}),jh=Object.freeze({RequestSuccessfullyProcessed:0,ApplicationDoesNotExist:1,MessagesNotAvailable:2}),Gh=Object.freeze({False:"0",True:"1"}),Qh=Object.freeze({InterestRate:1,Currency:2,Credit:3,Equity:4,Commodity:5,Other:6,Cash:7,Debt:8,Fund:9,LoanFacility:10,Index:11}),Vh=Object.freeze({Financials:1,Commodities:2,AlternativeInvestments:3}),zh=Object.freeze({SingleCurrency:1,CrossCurrency:2,Basket:3,SingleName:4,CreditIndex:5,IndexTranche:6,CreditBasket:7,Exotic:8,Common:9,Preferred:10,EquityIndex:11,EquityBasket:12,Metals:13,Bullion:14,Energy:15,CommodityIndex:16,Agricultural:17,Environmental:18,Freight:19,Government:20,Agency:21,Corporate:22,Financing:23,MoneyMarket:24,Mortgage:25,Municipal:26,MutualFund:27,CollectiveInvestmentVehicle:28,InvestmentProgram:29,SpecializedAccountProgram:30,TermLoan:31,BridgeLoan:32,LetterOfCredit:33,DividendIndex:34,StockDividend:35,ExchangeTradedFund:36,VolatilityIndex:37,FXCrossRates:38,FXEmergingMarkets:39,FXMajors:40,Fertilizer:41,IndustrialProduct:42,Inflation:43,Paper:44,Polypropylene:45,OfficialEconomicStatistics:46,OtherC10:47,Other:48}),Hh=Object.freeze({BlackScholes:1,Whaley:2,Bachelier:3,Kirk:4,Curran:5,Black76:6,Binomial:7,OtherModel:99}),Wh=Object.freeze({ProRata:"P",Random:"R"}),Kh=Object.freeze({Base64:0,RawBinary:1}),Yh=Object.freeze({AutomatedAuctionPermitted:0,AutomatedAuctionNotPermitted:1}),_h=Object.freeze({None:0,BlockOrderAuction:1,DirectedOrderAuction:2,ExposureOrderAuction:3,FlashOrderAuction:4,FacilitationOrderAuction:5,SolicitationOrderAuction:6,PriceImprovementMechanism:7,DirectedOrderPriceImprovementMechanism:8}),Jh=Object.freeze({TimeWeightedAveragePrice:0,VolumeWeightedAveragePrice:1,PercentOfVolumeAveragePrice:2,LimitOrderAveragePrice:3}),$h=Object.freeze({NoAveragePricing:0,Trade:1,LastTrade:2,NotionalValueAveragePxGroupTrade:3,AveragePricedTrade:4}),Zh=Object.freeze({ClosingPriceAtMorningSession:"2",ClosingPrice:"3",CurrentPrice:"4",SQ:"5",VWAPThroughADay:"6",VWAPThroughAMorningSession:"7",VWAPThroughAnAfternoonSession:"8",VWAPThroughADayExcept:"9",VWAPThroughAMorningSessionExcept:"A",VWAPThroughAnAfternoonSessionExcept:"B",Strike:"C",Open:"D",Others:"Z"}),ef=Object.freeze({Update:0,Snapshot:1}),tf=Object.freeze({FIX42:"FIX.4.2",FIX44:"FIX.4.4",FIXT11:"FIXT.1.1"}),df=Object.freeze({CURVE:"1",FiveYR:"2",OLD5:"3",TenYR:"4",OLD10:"5",ThirtyYR:"6",OLD30:"7",ThreeMOLIBOR:"8",SixMOLIBOR:"9"}),af=Object.freeze({EONIA:"EONIA",EUREPO:"EUREPO",Euribor:"Euribor",FutureSWAP:"FutureSWAP",LIBID:"LIBID",LIBOR:"LIBOR",MuniAAA:"MuniAAA",OTHER:"OTHER",Pfandbriefe:"Pfandbriefe",SONIA:"SONIA",SWAP:"SWAP",Treasury:"Treasury",FedFundRateEffective:"FEDEFF",FedOpen:"FEDOPEN",EURIBOR:"EURIBOR",AUBSW:"AUBSW",BUBOR:"BUBOR",CDOR:"CDOR",CIBOR:"CIBOR",EONIASWAP:"EONIASWAP",ESTR:"ESTR",EURODOLLAR:"EURODOLLAR",EUROSWISS:"EUROSWISS",GCFREPO:"GCFREPO",ISDAFIX:"ISDAFIX",JIBAR:"JIBAR",MOSPRIM:"MOSPRIM",NIBOR:"NIBOR",PRIBOR:"PRIBOR",SOFR:"SOFR",STIBOR:"STIBOR",TELBOR:"TELBOR",TIBOR:"TIBOR",WIBOR:"WIBOR",AONIA:"AONIA",AONIAR:"AONIA-R",BKBM:"BKBM",CD91D:"CD91D",CORRA:"CORRA",DIRRTN:"DIRR-TN",EIBOR:"EIBOR",FixingRepoRate:"FixingRepoRate",HIBOR:"HIBOR",IBR:"IBR",KLIBOR:"KLIBOR",MIBOR:"MIBOR",NZONIA:"NZONIA",PHIREF:"PHIREF",REIBOR:"REIBOR",SAIBOR:"SAIBOR",SARON:"SARON",SORA:"SORA",TLREF:"TLREF",TIIE:"TIIE",THBFIX:"THBFIX",TONAR:"TONAR"}),nf=Object.freeze({Sector:1,Country:2,Index:3}),rf=Object.freeze({Cancel:"C",New:"N"}),of=Object.freeze({Agency:"A",VWAPGuarantee:"G",GuaranteedClose:"J",RiskTrade:"R"}),sf=Object.freeze({NonDisclosed:1,Disclosed:2,NoBiddingProcess:3}),cf=Object.freeze({BlockToBeAllocated:0,BlockNotToBeAllocated:1,AllocatedTrade:2}),pf=Object.freeze({RegularBooking:0,CFD:1,TotalReturnSwap:2}),lf=Object.freeze({EachPartialExecutionIsABookableUnit:"0",AggregatePartialExecutionsOnThisOrder:"1",AggregateExecutionsForThisSymbol:"2"}),uf=Object.freeze({NotApplicable:0,None:1,FollowingDay:2,FloatingRateNote:3,ModifiedFollowingDay:4,PrecedingDay:5,ModifiedPrecedingDay:6,NearestDay:7}),mf=Object.freeze({Other:0,UnknownID:1,UnknownSecurity:2,UnsupportedMessageType:3,ApplicationNotAvailable:4,ConditionallyRequiredFieldMissing:5,NotAuthorized:6,DeliverToFirmNotAvailableAtThisTime:7,ThrottleLimitExceeded:8,ThrottleLimitExceededSessionDisconnected:9,ThrottledMessagesRejectedOnRequest:10,InvalidPriceIncrement:18}),yf=Object.freeze({Automatic:0,Manual:1}),Sf=Object.freeze({Yes:"Y",NoExecutionOnly:"N",NoWaiverAgreement:"M",NoInstitutional:"O"}),Pf=Object.freeze({Cash:"1",MarginOpen:"2",MarginClose:"3"}),gf=Object.freeze({Close:0,Hedge:1}),hf=Object.freeze({Bid:0,Mid:1,Offer:2}),ff=Object.freeze({Market:0,Highest:1,AverageMarket:2,AverageHighest:3,BlendedMarket:4,BlendedHighest:5,AverageBlendedMarket:6,AverageBlendedHighest:7}),If=Object.freeze({NotCleared:0,Cleared:1,Submitted:2,Rejected:3}),bf=Object.freeze({Customer:1,Firm:2,MarketMaker:3}),Ff=Object.freeze({FirstYearDelegate:"1",SecondYearDelegate:"2",ThirdYearDelegate:"3",FourthYearDelegate:"4",FifthYearDelegate:"5",SixthYearDelegate:"9",CBOEMember:"B",NonMemberAndCustomer:"C",EquityMemberAndClearingMember:"E",FullAndAssociateMember:"F",Firms106HAnd106J:"H",GIM:"I",Lessee106FEmployees:"L",AllOtherOwnershipTypes:"M"}),Ef=Object.freeze({ProcessNormally:0,ExcludeFromAllNetting:1,BilateralNettingOnly:2,ExClearing:3,SpecialTrade:4,MultilateralNetting:5,ClearAgainstCentralCounterparty:6,ExcludeFromCentralCounterparty:7,ManualMode:8,AutomaticPostingMode:9,AutomaticGiveUpMode:10,QualifiedServiceRepresentativeQSR:11,CustomerTrade:12,SelfClearing:13,BuyIn:14}),vf=Object.freeze({DoNotIntendToClear:0,IntendToClear:1}),Cf=Object.freeze({NoException:0,Exception:1,EndUserException:2,InterAffiliateException:3,TreasuryAffiliateException:4,CooperativeException:5}),Xf=Object.freeze({Retain:0,Add:1,Remove:2}),Tf=Object.freeze({SpecificDeposit:0,General:1}),Df=Object.freeze({Initial:0,Scheduled:1,TimeWarning:2,MarginDeficiency:3,MarginExcess:4,ForwardCollateralDemand:5,EventOfDefault:6,AdverseTaxEvent:7,TransferDeposit:8,TransferWithdrawal:9,Pledge:10}),Rf=Object.freeze({UnknownDeal:0,UnknownOrInvalidInstrument:1,UnauthorizedTransaction:2,InsufficientCollateral:3,InvalidTypeOfCollateral:4,ExcessiveSubstitution:5,Other:99}),Nf=Object.freeze({Received:0,Accepted:1,Declined:2,Rejected:3,TransactionPending:4,TransactionCompletedWithWarning:5}),Af=Object.freeze({New:0,Replace:1,Cancel:2,Release:3,Reverse:4}),wf=Object.freeze({MarketValuation:0,PortfolioValue:1,ValueConfirmed:2,CollateralCreditValue:3,AdditionalCollateralValue:4,EstimatedMarketValuation:5}),Mf=Object.freeze({MoneyMarketFund:0,OtherComingledPool:1,RepoMarket:2,DirectPurchaseOfSecurities:3,OtherInvestments:4}),xf=Object.freeze({TradeDate:0,GCInstrument:1,CollateralInstrument:2,SubstitutionEligible:3,NotAssigned:4,PartiallyAssigned:5,FullyAssigned:6,OutstandingTrades:7}),Lf=Object.freeze({Successful:0,InvalidOrUnknownInstrument:1,InvalidOrUnknownCollateralType:2,InvalidParties:3,InvalidTransportTypeRequested:4,InvalidDestinationRequested:5,NoCollateralFoundForTheTradeSpecified:6,NoCollateralFoundForTheOrderSpecified:7,CollateralInquiryTypeNotSupported:8,UnauthorizedForCollateralInquiry:9,Other:99}),Of=Object.freeze({Accepted:0,AcceptedWithWarnings:1,Completed:2,CompletedWithWarnings:3,Rejected:4}),Uf=Object.freeze({UnknownTrade:0,UnknownInstrument:1,UnknownCounterparty:2,UnknownPosition:3,UnacceptableCollateral:4,Other:99}),kf=Object.freeze({Accepted:0,Received:1,Rejected:2}),qf=Object.freeze({Unassigned:0,PartiallyAssigned:1,AssignmentProposed:2,Assigned:3,Challenged:4,Reused:5}),Bf=Object.freeze({ResearchPaymentAccount:0,CommissionSharingAgreement:1,OtherTypeResearchPayment:2}),jf=Object.freeze({Unspecified:0,Acceptance:1,Broker:2,ClearingBroker:3,Retail:4,SalesCommission:5,LocalCommission:6,ResearchPayment:7}),Gf=Object.freeze({ArgusMcCloskey:0,Baltic:1,Exchange:2,GlobalCoal:3,IHSMcCloskey:4,Platts:5,Other:99}),Qf=Object.freeze({PerUnit:"1",Percent:"2",Absolute:"3",PercentageWaivedCashDiscount:"4",PercentageWaivedEnhancedUnits:"5",PointsPerBondOrContract:"6",BasisPoints:"7",AmountPerContract:"8"}),Vf=Object.freeze({And:1,Or:2}),zf=Object.freeze({SellerNotifies:0,BuyerNotifies:1,SellerOrBuyerNotifies:2}),Hf=Object.freeze({Business:0,Calendar:1,CommodityBusiness:2,CurrencyBusiness:3,ExchangeBusiness:4,ScheduledTradingDay:5}),Wf=Object.freeze({AsianOut:0,AsianIn:1,BarrierCap:2,BarrierFloor:3,KnockOut:4,KnockIn:5}),Kf=Object.freeze({LessThanComplexEventPrice:1,LessThanOrEqualToComplexEventPrice:2,EqualToComplexEventPrice:3,GreaterThanOrEqualToComplexEventPrice:4,GreaterThanComplexEventPrice:5}),Yf=Object.freeze({Expiration:1,Immediate:2,SpecifiedDate:3,Close:4,Open:5,OfficialSettlPrice:6,DerivativesClose:7,AsSpecifiedMasterConfirmation:8}),_f=Object.freeze({Close:0,HedgeElection:1}),Jf=Object.freeze({Currency1PerCurrency2:0,Currency2PerCurrency1:1}),$f=Object.freeze({Capped:1,Trigger:2,KnockInUp:3,KnockInDown:4,KnockOutUp:5,KnockOutDown:6,Underlying:7,ResetBarrier:8,RollingBarrier:9,OneTouch:10,NoTouch:11,DblOneTouch:12,DblNoTouch:13,FXComposite:14,FXQuanto:15,FXCrssCcy:16,StrkSpread:17,ClndrSpread:18,PxObsvtn:19,PassThrough:20,StrkSched:21,EquityValuation:22,DividendValuation:23}),Zf=Object.freeze({Close:0,Open:1,OfficialSettl:2,ValuationTime:3,ExcahgneSettlTime:4,DerivativesClose:5,AsSpecified:6}),eI=Object.freeze({NonElectronic:0,Electronic:1,Unconfirmed:2}),tI=Object.freeze({MismatchedAccount:1,MissingSettlementInstructions:2,UnknownOrMissingIndividualAllocId:3,TransactionNotRecognized:4,DuplicateTransaction:5,IncorrectOrMissingInstrument:6,IncorrectOrMissingPrice:7,IncorrectOrMissingCommission:8,IncorrectOrMissingSettlDate:9,IncorrectOrMissingFundIDOrFundName:10,IncorrectOrMissingQuantity:11,IncorrectOrMissingFees:12,IncorrectOrMissingTax:13,IncorrectOrMissingParty:14,IncorrectOrMissingSide:15,IncorrectOrMissingNetMoney:16,IncorrectOrMissingTradeDate:17,IncorrectOrMissingSettlCcyInstructions:18,IncorrectOrMissingCapacity:19,Other:99}),dI=Object.freeze({Received:1,MismatchedAccount:2,MissingSettlementInstructions:3,Confirmed:4,RequestRejected:5}),iI=Object.freeze({New:0,Replace:1,Cancel:2}),aI=Object.freeze({Status:1,Confirmation:2,ConfirmationRequestRejected:3}),nI=Object.freeze({CommissionAmount:1,CommissionPercent:2,InitialChargeAmount:3,InitialChargePercent:4,DiscountAmount:5,DiscountPercent:6,DilutionLevyAmount:7,DilutionLevyPercent:8,ExitChargeAmount:9,ExitChargePercent:10,FundBasedRenewalCommissionPercent:11,ProjectedFundValue:12,FundBasedRenewalCommissionOnOrder:13,FundBasedRenewalCommissionOnFund:14,NetSettlementAmount:15}),rI=Object.freeze({OneCancelsTheOther:1,OneTriggersTheOther:2,OneUpdatesTheOtherAbsolute:3,OneUpdatesTheOtherProportional:4,BidAndOffer:5,BidAndOfferOCO:6}),oI=Object.freeze({Shares:0,Hours:1,Days:2}),sI=Object.freeze({TwoComponentIntercommoditySpread:0,IndexOrBasket:1,TwoComponentLocationBasis:2,Other:99}),cI=Object.freeze({ExDividend:"A",ExDistribution:"B",ExRights:"C",New:"D",ExInterest:"E",CashDividend:"F",StockDividend:"G",NonIntegerStockSplit:"H",ReverseStockSplit:"I",StandardIntegerStockSplit:"J",PositionConsolidation:"K",LiquidationReorganization:"L",MergerReorganization:"M",RightsOffering:"N",ShareholderMeeting:"O",Spinoff:"P",TenderOffer:"Q",Warrant:"R",SpecialAction:"S",SymbolConversion:"T",CUSIP:"U",LeapRollover:"V",SuccessionEvent:"W"}),pI=Object.freeze({OneOne:0,ThirtyThreeSixtyUS:1,ThirtyThreeSixtySIA:2,ThirtyThreeSixtyM:3,ThirtyEThreeSixty:4,ThirtyEThreeSixtyISDA:5,ActThreeSixty:6,ActThreeSixtyFiveFixed:7,ActActAFB:8,ActActICMA:9,ActActISMAUltimo:10,ActActISDA:11,BusTwoFiftyTwo:12,ThirtyEPlusThreeSixty:13,ActThreeSixtyFiveL:14,NLThreeSixtyFive:15,NLThreeSixty:16,Act364:17,ThirtyThreeSixtyFive:18,ThirtyActual:19,ThirtyThreeSixtyICMA:20,ThirtyETwoThreeSixty:21,ThirtyEThreeThreeSixty:22,Other:99}),lI=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr",Hour:"H",Minute:"Min",Second:"S",Term:"T"}),uI=Object.freeze({Zero:0,FixedRate:1,FloatingRate:2,Structured:3}),mI=Object.freeze({Covered:0,Uncovered:1}),yI=Object.freeze({Program3a3:1,Program42:2,Program3a2:3,Program3a3And3c7:4,Program3a4:5,Program3a5:6,Program3a7:7,Program3c7:8,Other:99}),SI=Object.freeze({NoCross:0,CrossRejected:1,CrossAccepted:2}),PI=Object.freeze({None:0,BuySideIsPrioritized:1,SellSideIsPrioritized:2}),gI=Object.freeze({CrossAON:1,CrossIOC:2,CrossOneSide:3,CrossSamePrice:4,BasisCross:5,ContingentCross:6,VWAPCross:7,STSCross:8,CustomerToCustomer:9}),hI=Object.freeze({CUSIP:"1",SEDOL:"2",ISINNumber:"4",ISOCurrencyCode:"6",FinancialInstrumentGlobalIdentifier:"S",DigitalTokenIdentifier:"Y"}),fI=Object.freeze({MemberTradingForTheirOwnAccount:1,ClearingFirmTradingForItsProprietaryAccount:2,MemberTradingForAnotherMember:3,AllOther:4,RetailCustomer:5}),II=Object.freeze({PhoneSimple:"A",GOrderAndFCMAPIorFIX:"G",PhoneComplex:"B",AddOnOrder:"ADD",FCMProvidedScreen:"C",AllOrNone:"AON",OtherProvidedScreen:"D",ConditionalOrder:"CND",ClientProvidedPlatformControlledByFCM:"E",CashNotHeld:"CNH",ClientProvidedPlatformDirectToExchange:"F",DeliveryInstructionsCash:"CSH",DirectedOrder:"DIR",AlgoEngine:"H",DiscretionaryLimitOrder:"DLO",PriceAtExecution:"J",ExchangeForPhysicalTransaction:"E.W",DeskElectronic:"W",FillOrKill:"FOK",DeskPit:"X",ClientElectronic:"Y",IntraDayCross:"IDX",ClientPit:"Z",ImbalanceOnly:"IO",ImmediateOrCancel:"IOC",IntermarketSweepOrder:"ISO",LimitOnOpen:"LOO",LimitOnClose:"LOC",MarketAtOpen:"MAO",MarketAtClose:"MAC",MarketOnOpen:"MOO",MarketOnClose:"MOC",MergerRelatedTransferPosition:"MPT",MinimumQuantity:"MQT",MarketToLimit:"MTL",DeliveryInstructionsNextDay:"ND",NotHeld:"NH",OptionsRelatedTransaction:"OPT",OverTheDay:"OVD",Pegged:"PEG",ReserveSizeOrder:"RSV",StopStockTransaction:"S.W",Scale:"SCL",DeliveryInstructionsSellersOption:"SLR",TimeOrder:"TMO",TrailingStop:"TS",Work:"WRK",StayOnOfferside:"F0",GoAlong:"F3",ParticipateDoNotInitiate:"F6",StrictScale:"F7",TryToScale:"F8",StayOnBidside:"F9",NoCross:"FA",OKToCross:"FB",CallFirst:"FC",PercentOfVolume:"FD",ReinstateOnSystemFailure:"FH",InstitutionOnly:"FI",ReinstateOnTradingHalt:"FJ",CancelOnTradingHalf:"FK",LastPeg:"FL",MidPricePeg:"FM",NonNegotiable:"FN",OpeningPeg:"FO",MarketPeg:"FP",CancelOnSystemFailure:"FQ",PrimaryPeg:"FR",Suspend:"FS",FixedPegToLocalBBO:"FT",PegToVWAP:"FW",TradeAlong:"FX",TryToStop:"FY",CancelIfNotBest:"FZ",StrictLimit:"Fb",IgnorePriceValidityChecks:"Fc",PegToLimitPrice:"Fd",WorkToTargetStrategy:"Fe"}),bI=Object.freeze({Customer:0,Firm:1}),FI=Object.freeze({NoPriority:0,UnconditionalPriority:1}),EI=Object.freeze({TooLateToCancel:0,UnknownOrder:1,BrokerCredit:2,OrderAlreadyInPendingStatus:3,UnableToProcessOrderMassCancelRequest:4,OrigOrdModTime:5,DuplicateClOrdID:6,PriceExceedsCurrentPrice:7,PriceExceedsCurrentPriceBand:8,InvalidPriceIncrement:18,Other:99}),vI=Object.freeze({OrderCancelRequest:"1",OrderCancelReplaceRequest:"2"}),CI=Object.freeze({FirstDay:"1",SecondDay:"2",ThirdDay:"3",FourthDay:"4",FifthDay:"5",SixthDay:"6",SeventhDay:"7",EighthDay:"8",NinthDay:"9",TenthDay:"10",EleventhDay:"11",TwelvthDay:"12",ThirteenthDay:"13",ForteenthDay:"14",FifteenthDay:"15",SixteenthDay:"16",SeventeenthDay:"17",EighteenthDay:"18",NineteenthDay:"19",TwentiethDay:"20",TwentyFirstDay:"21",TwentySecondDay:"22",TwentyThirdDay:"23",TwentyFourthDay:"24",TwentyFifthDay:"25",TwentySixthDay:"26",TwentySeventhDay:"27",TwentyEigthDa28y:"28",TwentyNinthDay:"29",ThirtiethDay:"30",EOM:"EOM",FRN:"FRN",IMM:"IMM",IMMCAD:"IMMCAD",IMMAUD:"IMMAUD",IMMNZD:"IMMNZD",SFE:"SFE",NONE:"NONE",TBILL:"TBILL",MON:"MON",TUE:"TUE",WED:"WED",THU:"THU",FRI:"FRI",SAT:"SAT",SUN:"SUN"}),XI=Object.freeze({Auto:"0",SpeakWithOrderInitiatorBeforeBooking:"1",Accumulate:"2"}),TI=Object.freeze({Agent:"A",Principal:"P",RisklessPrincipal:"R"}),DI=Object.freeze({Cancellation:"0",Error:"1"}),RI=Object.freeze({BookEntry:1,Bearer:2}),NI=Object.freeze({Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6,Sunday:7,AllWeekdays:8,AllDays:9,AllWeekends:10}),AI=Object.freeze({AllTimes:0,OnPeak:1,OffPeak:2,Base:3,BlockHours:4,Other:5}),wI=Object.freeze({DoNotIncludeHolidays:0,IncludeHolidays:1}),MI=Object.freeze({Hour:0,Timestamp:1}),xI=Object.freeze({Absolute:0,Percentage:1}),LI=Object.freeze({Notional:0,Delivery:1,PhysicalSettlPeriods:2}),OI=Object.freeze({Proprietary:0,EIC:1}),UI=Object.freeze({Firm:1,NonFirm:2,ForceMajeure:3,SystemFirm:4,UnitFirm:5}),kI=Object.freeze({Buyer:0,Seller:1}),qI=Object.freeze({Transfers:0,DoesNotTransfer:1}),BI=Object.freeze({Buyer:1,Seller:2}),jI=Object.freeze({Periodic:0,Initial:1,Single:2}),GI=Object.freeze({VersusPayment:0,Free:1,TriParty:2,HoldInCustody:3,DeliverByValue:4}),QI=Object.freeze({Agency:"A",Arbitrage:"AR",BlockTrading:"B",ConvertibleDesk:"C",CentralRiskBooks:"CR",Derivatives:"D",EquityCapitalMarkets:"EC",International:"IN",Institutional:"IS",Other:"O",PreferredTrading:"PF",Proprietary:"PR",ProgramTrading:"PT",Sales:"S",Swaps:"SW",TradingDeskSystem:"T",Treasury:"TR",FloorBroker:"FB"}),VI=Object.freeze({FINRAOATS:1}),zI=Object.freeze({No:0,Yes:1,UseDefaultSetting:2}),HI=Object.freeze({Volume:1,Price:2,Side:3,AON:4,General:5,ClearingAccount:6,CMTAAccount:7}),WI=Object.freeze({RelatedToDisplayedPrice:"0",RelatedToMarketPrice:"1",RelatedToPrimaryPrice:"2",RelatedToLocalPrimaryPrice:"3",RelatedToMidpointPrice:"4",RelatedToLastTradePrice:"5",RelatedToVWAP:"6",AveragePriceGuarantee:"7"}),KI=Object.freeze({OrBetter:0,Strict:1,OrWorse:2}),YI=Object.freeze({Floating:0,Fixed:1}),_I=Object.freeze({Price:0,BasisPoints:1,Ticks:2,PriceTier:3}),JI=Object.freeze({MoreAggressive:1,MorePassive:2}),$I=Object.freeze({Local:1,National:2,Global:3,NationalExcludingLocal:4}),ZI=Object.freeze({Initial:"1",New:"2",Random:"3",Undisclosed:"4"}),e4=Object.freeze({Immediate:"1",Exhaust:"2"}),t4=Object.freeze({CREST:1,NSCC:2,Euroclear:3,Clearstream:4,Cheque:5,TelegraphicTransfer:6,FedWire:7,DirectCredit:8,ACHCredit:9,BPAY:10,HighValueClearingSystemHVACS:11,ReinvestInFund:12,Other:999}),d4=Object.freeze({RecordAmount:0,ExAmount:1,PaidAmount:2,PerMasterConfirm:3}),i4=Object.freeze({EquityAmountReceiver:0,CalculationAgent:1}),a4=Object.freeze({ExDate:0,RecordDate:1}),n4=Object.freeze({UnknownSymbol:"A",WrongSide:"B",QuantityExceedsOrder:"C",NoMatchingOrder:"D",PriceExceedsLimit:"E",CalculationDifference:"F",NoMatchingExecutionReport:"G",Other:"Z"}),r4=Object.freeze({Cash:"C",Securities:"S"}),o4=Object.freeze({NotRelatedToSecurityHalt:"N",RelatedToSecurityHalt:"Y"}),s4=Object.freeze({UniqueClOrdID:"N",DuplicateClOrdID:"Y"}),c4=Object.freeze({New:"0",Reply:"1",AdminReply:"2"}),ds=Object.freeze({None:0,PKCS:1,DES:2,PKCSDES:3,PGPDES:4,PGPDESMD5:5,PEM:6}),p4=Object.freeze({Int:1,Length:2,NumInGroup:3,SeqNum:4,TagNum:5,Float:6,Qty:7,Price:8,PriceOffset:9,Amt:10,Percentage:11,Char:12,Boolean:13,String:14,MultipleCharValue:15,Currency:16,Exchange:17,MonthYear:18,UTCTimestamp:19,UTCTimeOnly:20,LocalMktDate:21,UTCDateOnly:22,Data:23,MultipleStringValue:24,Country:25,Language:26,TZTimeOnly:27,TZTimestamp:28,Tenor:29,DayOfMonth:30,XMLData:31,Pattern:32,Reserved100Plus:33,Reserved1000Plus:34,Reserved4000Plus:35}),l4=Object.freeze({Successful:0,InvalidParty:1,InvalidRelatedParty:2,InvalidEntitlementType:3,InvalidEntitlementID:4,InvalidEntitlementAttribute:5,InvalidInstrumentScope:6,InvalidMarketSegmentScope:7,InvalidStartDate:8,InvalidEndDate:9,InstrumentScopeNotSupported:10,MarketSegmentScopeNotSupported:11,EntitlementNotApprovedForParty:12,EntitlementAlreadyDefinedForParty:13,InstrumentNotApprovedForParty:14,NotAuthorized:98,Other:99}),u4=Object.freeze({Accepted:0,AcceptedWithChanges:1,Rejected:2,Pending:3,Requested:4,Deferred:5}),m4=Object.freeze({OrderEntry:1,HItLift:2,ViewIndicativePx:3,ViewExecutablePx:4,SingleQuote:5,StreamingQuotes:6,SingleBroker:7,MultiBrokers:8}),y4=Object.freeze({Trade:0,MakeMarkets:1,HoldPositions:2,PerformGiveUps:3,SubmitIOIs:4,SubscribeMarketData:5,ShortWithPreBorrow:6,SubmitQuoteRequests:7,RespondToQuoteRequests:8}),S4=Object.freeze({CustomerOrClient:"C",ExchangeOrExecutionVenue:"E",FirmOrBroker:"F"}),P4=Object.freeze({Hour:"H",Minute:"Min",Second:"S",Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),g4=Object.freeze({Put:1,Call:2,Tender:3,SinkingFundCall:4,Activation:5,Inactiviation:6,LastEligibleTradeDate:7,SwapStartDate:8,SwapEndDate:9,SwapRollDate:10,SwapNextStartDate:11,SwapNextRollDate:12,FirstDeliveryDate:13,LastDeliveryDate:14,InitialInventoryDueDate:15,FinalInventoryDueDate:16,FirstIntentDate:17,LastIntentDate:18,PositionRemovalDate:19,MinimumNotice:20,DeliveryStartTime:21,DeliveryEndTime:22,FirstNoticeDate:23,LastNoticeDate:24,FirstExerciseDate:25,RedemptionDate:26,TrdCntntnEfctvDt:27,Other:99}),h4=Object.freeze({False:"N",True:"Y"}),f4=Object.freeze({BIC:"B",GeneralIdentifier:"C",Proprietary:"D",ISOCountryCode:"E",MIC:"G"}),I4=Object.freeze({NoRestriction:0,TradedOnlyOnTradingVenue:1,TradedOnlyOnSI:2,TradedOnTradingVenueOrSI:3}),b4=Object.freeze({Received:"0",Accepted:"1",DontKnow:"2"}),F4=Object.freeze({StayOnOfferSide:"0",NotHeld:"1",Work:"2",GoAlong:"3",OverTheDay:"4",Held:"5",ParticipateDoNotInitiate:"6",StrictScale:"7",TryToScale:"8",StayOnBidSide:"9",NoCross:"A",OKToCross:"B",CallFirst:"C",PercentOfVolume:"D",DoNotIncrease:"E",DoNotReduce:"F",AllOrNone:"G",ReinstateOnSystemFailure:"H",InstitutionsOnly:"I",ReinstateOnTradingHalt:"J",CancelOnTradingHalt:"K",LastPeg:"L",MidPricePeg:"M",NonNegotiable:"N",OpeningPeg:"O",MarketPeg:"P",CancelOnSystemFailure:"Q",PrimaryPeg:"R",Suspend:"S",FixedPegToLocalBestBidOrOfferAtTimeOfOrder:"T",CustomerDisplayInstruction:"U",Netting:"V",PegToVWAP:"W",TradeAlong:"X",TryToStop:"Y",CancelIfNotBest:"Z",TrailingStopPeg:"a",StrictLimit:"b",IgnorePriceValidityChecks:"c",PegToLimitPrice:"d",WorkToTargetStrategy:"e",IntermarketSweep:"f",ExternalRoutingAllowed:"g",ExternalRoutingNotAllowed:"h",ImbalanceOnly:"i",SingleExecutionRequestedForBlockTrade:"j",BestExecution:"k",SuspendOnSystemFailure:"l",SuspendOnTradingHalt:"m",ReinstateOnConnectionLoss:"n",CancelOnConnectionLoss:"o",SuspendOnConnectionLoss:"p",Release:"q",ExecuteAsDeltaNeutral:"r",ExecuteAsDurationNeutral:"s",ExecuteAsFXNeutral:"t",MinGuaranteedFillEligible:"u",BypassNonDisplayLiquidity:"v",Lock:"w",IgnoreNotionalValueChecks:"x",TrdAtRefPx:"y",AllowFacilitation:"z"}),E4=Object.freeze({Unspecified:0,Manual:1,Automated:2,VoiceBrokered:3}),v4=Object.freeze({BidPrice:"B",CreationPrice:"C",CreationPricePlusAdjustmentPercent:"D",CreationPricePlusAdjustmentAmount:"E",OfferPrice:"O",OfferPriceMinusAdjustmentPercent:"P",OfferPriceMinusAdjustmentAmount:"Q",SinglePrice:"S"}),C4=Object.freeze({GTCorporateAction:0,GTRenewal:1,VerbalChange:2,RepricingOfOrder:3,BrokerOption:4,PartialDeclineOfOrderQty:5,CancelOnTradingHalt:6,CancelOnSystemFailure:7,Market:8,Canceled:9,WarehouseRecap:10,PegRefresh:11,CancelOnConnectionLoss:12,CancelOnLogout:13,AssignTimePriority:14,CancelledForTradePriceViolation:15,CancelledForCrossImbalance:16,CxldSMP:17,CxldSMPAggressive:18,CxldSMPPassive:19,CxldSMPAggressivePassive:20,Other:99}),X4=Object.freeze({New:"0",Cancel:"1",Correct:"2",Status:"3"}),T4=Object.freeze({New:"0",DoneForDay:"3",Canceled:"4",Replaced:"5",PendingCancel:"6",Stopped:"7",Rejected:"8",Suspended:"9",PendingNew:"A",Calculated:"B",Expired:"C",Restated:"D",PendingReplace:"E",Trade:"F",TradeCorrect:"G",TradeCancel:"H",OrderStatus:"I",TradeInAClearingHold:"J",TradeHasBeenReleasedToClearing:"K",TriggeredOrActivatedBySystem:"L",Locked:"M",Released:"N"}),D4=Object.freeze({OrdAddedOnRequest:1,OrdReplacedOnRequest:2,OrdCxldOnRequest:3,UnsolicitedOrdCxl:4,NonRestingOrdAddedOnRequest:5,OrdReplacedWithNonRestingOrdOnRequest:6,TriggerOrdReplacedOnRequest:7,SuspendedOrdReplacedOnRequest:8,SuspendedOrdCxldOnRequest:9,OrdCxlPending:10,PendingCxlExecuted:11,RestingOrdTriggered:12,SuspendedOrdActivated:13,ActiveOrdSuspended:14,OrdExpired:15}),R4=Object.freeze({NotRequired:0,NonElectronic:1,Electronic:2,Unknown:3}),N4=Object.freeze({Automatic:"A",Manual:"M"}),A4=Object.freeze({European:0,American:1,Bermuda:2,Other:99}),w4=Object.freeze({ExpireOnTradingSessionClose:0,ExpireOnTradingSessionOpen:1,SpecifiedExpiration:2}),M4=Object.freeze({AutoExercise:1,NonAutoExercise:2,FinalWillBeExercised:3,ContraryIntention:4,Difference:5}),x4=Object.freeze({CalculationAgent:0,OptionsExchange:1}),L4=Object.freeze({Bankrupt:"1",PendingDelisting:"2",Restricted:"3"}),O4=Object.freeze({NERCEasternOffPeak:0,NERCWesternOffPeak:1,NERCCalendarAllDaysInMonth:2,NERCEasternPeak:3,NERCWesternPeak:4,AllTimes:5,OnPeak:6,OffPeak:7,Base:8,Block:9,Other:99}),U4=Object.freeze({DoNotExecuteForexAfterSecurityTrade:"N",ExecuteForexAfterSecurityTrade:"Y"}),k4=Object.freeze({Repo:0,Cash:1,FreeCedits:2,CustomerShortSales:3,BrokerShortSales:4,UnsecuredBorrowing:5,Other:99}),q4=Object.freeze({No:"N",Yes:"Y"}),B4=Object.freeze({Bloomberg:1,CentralBank:2,WMR:3,MitsubishiUFJ:4,LondonBullionMarketAssociation:5,LondonMetalExchange:6,Other:99}),hn=Object.freeze({SequenceReset:"N",GapFillMessage:"Y"}),j4=Object.freeze({BookOutAllTradesOnDayOfExecution:0,AccumulateUntilFilledOrExpired:1,AccumulateUntilVerballyNotifiedOtherwise:2}),G4=Object.freeze({NewsDissemination:0,OrderInflux:1,OrderImbalance:2,AdditionalInformation:3,NewsPending:4,EquipmentChangeover:5}),Q4=Object.freeze({AutomatedExecutionNoIntervention:"1",AutomatedExecutionInterventionOK:"2",ManualOrder:"3"}),V4=Object.freeze({CUSIP:"1",SEDOL:"2",QUIK:"3",ISINNumber:"4",RICCode:"5",ISOCurrencyCode:"6",ISOCountryCode:"7",ExchangeSymbol:"8",ConsolidatedTapeAssociation:"9"}),z4=Object.freeze({NotImplied:0,ImpliedIn:1,ImpliedOut:2,BothImpliedInAndImpliedOut:3}),H4=Object.freeze({Net:1,Gross:2}),W4=Object.freeze({SubAllocate:1,ThirdPartyAllocation:2}),K4=Object.freeze({Flat:1,ZeroCoupon:2,InterestBearing:3,NoPeriodicPayments:4,VariableRate:5,LessFeeForPut:6,SteppedCoupon:7,CouponPeriod:8,When:9,OriginalIssueDiscount:10,Callable:11,EscrowedToMaturity:12,EscrowedToRedemptionDate:13,PreRefunded:14,InDefault:15,Unrated:16,Taxable:17,Indexed:18,SubjectToAlternativeMinimumTax:19,OriginalIssueDiscountPrice:20,CallableBelowMaturityValue:21,CallableWithoutNotice:22,PriceTickRulesForSecurity:23,TradeTypeEligibilityDetailsForSecurity:24,InstrumentDenominator:25,InstrumentNumerator:26,InstrumentPricePrecision:27,InstrumentStrikePrice:28,TradeableIndicator:29,InstrumentEligibleAnonOrders:30,MinGuaranteedFillVolume:31,MinGuaranteedFillStatus:32,TradeAtSettlementEligibility:33,TestInstrument:34,DummyInstrument:35,NegativeSettlementPriceEligibility:36,NegativeStrikePriceEligibility:37,USStdContractInd:38,AdmittedToTradingOnTradingVenue:39,AverageDailyNotionalAmount:40,AverageDailyNumberTrades:41,Text:99}),Y4=Object.freeze({ProRata:"P",Random:"R"}),_4=Object.freeze({Include:1,Exclude:2}),J4=Object.freeze({StandardITM:0,ATMITM:1,ATMCallITM:2,ATMPutITM:3}),$4=Object.freeze({HaltWasNotRelatedToAHaltOfTheCommonStock:"N",HaltWasDueToCommonStockBeingHalted:"Y"}),Z4=Object.freeze({NotNatural:"N",Natural:"Y"}),e5=Object.freeze({High:"H",Low:"L",Medium:"M"}),t5=Object.freeze({Small:"S",Medium:"M",Large:"L",UndisclosedQuantity:"U"}),d5=Object.freeze({AllOrNone:"A",MarketOnClose:"B",AtTheClose:"C",VWAP:"D",Axe:"E",AxeOnBid:"F",AxeOnOffer:"G",ClientNaturalWorking:"H",InTouchWith:"I",PositionWanted:"J",MarketMaking:"K",Limit:"L",MoreBehind:"M",ClientNaturalBlock:"N",AtTheOpen:"O",TakingAPosition:"P",AtTheMarket:"Q",ReadyToTrade:"R",PortfolioShown:"S",ThroughTheDay:"T",Unwind:"U",Versus:"V",Indication:"W",CrossingOpportunity:"X",AtTheMidpoint:"Y",PreOpen:"Z",QuantityNegotiable:"1",AllowLateBids:"2",ImmediateOrCounter:"3",AutoTrade:"4",AutomaticSpot:"a",PlatformCalculatedSpot:"b",OutsideSpread:"c",DeferredSpot:"d",NegotiatedSpot:"n"}),i5=Object.freeze({Large:"L",Medium:"M",Small:"S"}),a5=Object.freeze({New:"N",Cancel:"C",Replace:"R"}),n5=Object.freeze({Pay:"PAY",Rcv:"RCV",NA:"NA"}),r5=Object.freeze({Agent:"1",CrossAsAgent:"2",CrossAsPrincipal:"3",Principal:"4",RisklessPrincipal:"5"}),o5=Object.freeze({NotLastMessage:"N",LastMessage:"Y"}),s5=Object.freeze({NeitherAddedNorRemovedLiquidity:0,AddedLiquidity:1,RemovedLiquidity:2,LiquidityRoutedOut:3,Auction:4,TriggeredStopOrder:5,TriggeredContingencyOrder:6,TriggeredMarketOrder:7,RemovedLiquidityAfterFirmOrderCommitment:8,AuctionExecutionAfterFirmOrderCommitment:9,Unknown:10,Other:11}),c5=Object.freeze({NotLastMessage:"N",LastMessage:"Y"}),p5=Object.freeze({DoesNotConsituteALegalConfirm:"N",LegalConfirm:"Y"}),l5=Object.freeze({ParForPar:1,ModifiedDuration:2,Risk:4,Proceeds:5}),u5=Object.freeze({Unknown:0,FirstLien:1,SecondLien:2,ThirdLien:3}),m5=Object.freeze({CreditLimit:0,GrossPositionLimit:1,NetPositionLimit:2,RiskExposureLimit:3,LongPositionLimit:4,ShortPositionLimit:5}),y5=Object.freeze({FiveDayMovingAverage:1,TwentyDayMovingAverage:2,NormalMarketSize:3,Other:4}),S5=Object.freeze({Immediate:"1",WaitForInstruction:"2",SellDriven:"3",BuyDrivenCashTopUp:"4",BuyDrivenCashWithdraw:"5"}),P5=Object.freeze({PreListedOnly:0,UserRequested:1}),g5=Object.freeze({InBiddingProcess:1,ReceivedForExecution:2,Executing:3,Cancelling:4,Alert:5,AllDone:6,Reject:7}),h5=Object.freeze({BrokerCredit:0,ExchangeClosed:2,TooLateToEnter:4,UnknownOrder:5,DuplicateOrder:6,UnsupportedOrderCharacteristic:11,Other:99}),f5=Object.freeze({Ack:1,Response:2,Timed:3,ExecStarted:4,AllDone:5,Alert:6}),I5=Object.freeze({Add:"A",Delete:"D",Modify:"M",Snapshot:"S"}),b5=Object.freeze({BridgeLoan:0,LetterOfCredit:1,RevolvingLoan:2,SwinglineFunding:3,TermLoan:4,TradeClaim:5}),F5=Object.freeze({No:"N",Yes:"Y"}),E5=Object.freeze({NotLocked:0,AwayMarketNetter:1,ThreeTickLocked:2,LockedByMarketMaker:3,DirectedOrderLock:4,MultilegLock:5,MarketOrderLock:6,PreAssignmentLock:7}),v5=Object.freeze({OddLot:"1",RoundLot:"2",BlockLot:"3",RoundLotBasedUpon:"4"}),C5=Object.freeze({AdditionalMargin:1,AdjustedMargin:2,UnadjustedMargin:3,BinaryAddOnAmount:4,CashBalanceAmount:5,ConcentrationMargin:6,CoreMargin:7,DeliveryMargin:8,DiscretionaryMargin:9,FuturesSpreadMargin:10,InitialMargin:11,LiquidatingMargin:12,MarginCallAmount:13,MarginDeficitAmount:14,MarginExcessAmount:15,OptionPremiumAmount:16,PremiumMargin:17,ReserveMargin:18,SecurityCollateralAmount:19,StressTestAddOnAmount:20,SuperMargin:21,TotalMargin:22,VariationMargin:23,SecondaryVariationMargin:24,RolledUpMarginDeficit:25,SpreadResponseMargin:26,SystemicRiskMargin:27,CurveRiskMargin:28,IndexSpreadRiskMargin:29,SectorRiskMargin:30,JumpToDefaultRiskMargin:31,BasisRiskMargin:32,InterestRateRiskMargin:33,JumpToHealthRiskMargin:34,OtherRiskMargin:35}),X5=Object.freeze({Posted:0,Received:1}),T5=Object.freeze({Summary:0,Detail:1,ExcessDeficit:2,NetPosition:3}),D5=Object.freeze({Successful:0,InvalidOrUnknownInstrument:1,InvalidOrUnknownMarginClass:2,InvalidParties:3,InvalidTransportTypeReq:4,InvalidDestinationReq:5,NoMarginReqFound:6,MarginReqInquiryQualifierNotSupported:7,UnauthorizedForMarginReqInquiry:8,Other:99}),R5=Object.freeze({Summary:0,Detail:1,ExcessDeficit:2}),N5=Object.freeze({Normal:0,Stressed:1,Exceptional:2}),A5=Object.freeze({MasterAgreement:0,Confirmation:1}),w5=Object.freeze({Basket:0,Bond:1,Cash:2,Commodity:3,ConvertibleBond:4,Equity:5,ExchangeTradedFund:6,Future:7,Index:8,Loan:9,Mortgage:10,MutualFund:11}),M5=Object.freeze({NotApplicable:0,Applicable:1,AsInMasterAgreement:2,AsInConfirmation:3}),x5=Object.freeze({NoParticipation:0,BuyParticipation:1,SellParticipation:2,BothBuyAndSellParticipation:3}),L5=Object.freeze({MarketSegmentPoolMember:1,RetailSegment:2,WholesaleSegment:3}),O5=Object.freeze({Active:1,Inactive:2,Published:3}),U5=Object.freeze({InterProductSpread:1}),k5=Object.freeze({Pool:1,Retail:2,Wholesale:3}),q5=Object.freeze({None:0,TradingRiskControl:1,ClearingRiskControl:2,MarketMakerProtection:3,StopTrading:4,EmergencyAction:5,SessionLossLogout:6,DuplicateLogin:7,ProductNotTraded:8,InstrumentNotTraded:9,CompleInstrumentDeleted:10,CircuitBreakerActivated:11,Other:99}),B5=Object.freeze({MassActionNotSupported:0,InvalidOrUnknownSecurity:1,InvalidOrUnknownUnderlyingSecurity:2,InvalidOrUnknownProduct:3,InvalidOrUnknownCFICode:4,InvalidOrUnknownSecurityType:5,InvalidOrUnknownTradingSession:6,InvalidOrUnknownMarket:7,InvalidOrUnknownMarketSegment:8,InvalidOrUnknownSecurityGroup:9,InvalidOrUnknownSecurityIssuer:10,InvalidOrUnknownIssuerOfUnderlyingSecurity:11,Other:99}),j5=Object.freeze({Rejected:0,Accepted:1,Completed:2}),G5=Object.freeze({AllOrdersForASecurity:1,AllOrdersForAnUnderlyingSecurity:2,AllOrdersForAProduct:3,AllOrdersForACFICode:4,AllOrdersForASecurityType:5,AllOrdersForATradingSession:6,AllOrders:7,AllOrdersForAMarket:8,AllOrdersForAMarketSegment:9,AllOrdersForASecurityGroup:10,CancelForSecurityIssuer:11,CancelForIssuerOfUnderlyingSecurity:12}),Q5=Object.freeze({SuspendOrders:1,ReleaseOrdersFromSuspension:2,CancelOrders:3}),V5=Object.freeze({MassCancelNotSupported:0,InvalidOrUnknownSecurity:1,InvalidOrUnknownUnderlyingSecurity:2,InvalidOrUnknownProduct:3,InvalidOrUnknownCFICode:4,InvalidOrUnknownSecurityType:5,InvalidOrUnknownTradingSession:6,InvalidOrUnknownMarket:7,InvalidOrUnkownMarketSegment:8,InvalidOrUnknownSecurityGroup:9,InvalidOrUnknownSecurityIssuer:10,InvalidOrUnknownIssuerOfUnderlyingSecurity:11,Other:99}),z5=Object.freeze({CancelOrdersForASecurity:"1",CancelOrdersForAnUnderlyingSecurity:"2",CancelOrdersForAProduct:"3",CancelOrdersForACFICode:"4",CancelOrdersForASecurityType:"5",CancelOrdersForATradingSession:"6",CancelAllOrders:"7",CancelOrdersForAMarket:"8",CancelOrdersForAMarketSegment:"9",CancelOrdersForASecurityGroup:"A",CancelOrdersForSecurityIssuer:"B",CancelForIssuerOfUnderlyingSecurity:"C"}),H5=Object.freeze({CancelRequestRejected:"0",CancelOrdersForASecurity:"1",CancelOrdersForAnUnderlyingSecurity:"2",CancelOrdersForAProduct:"3",CancelOrdersForACFICode:"4",CancelOrdersForASecurityType:"5",CancelOrdersForATradingSession:"6",CancelAllOrders:"7",CancelOrdersForAMarket:"8",CancelOrdersForAMarketSegment:"9",CancelOrdersForASecurityGroup:"A",CancelOrdersForASecuritiesIssuer:"B",CancelOrdersForIssuerOfUnderlyingSecurity:"C"}),W5=Object.freeze({Successful:0,ResponseLevelNotSupported:1,InvalidMarket:2,InvalidMarketSegment:3,Other:99}),K5=Object.freeze({Accepted:1,AcceptedWithAdditionalEvents:2,Rejected:3}),Y5=Object.freeze({StatusForOrdersForASecurity:1,StatusForOrdersForAnUnderlyingSecurity:2,StatusForOrdersForAProduct:3,StatusForOrdersForACFICode:4,StatusForOrdersForASecurityType:5,StatusForOrdersForATradingSession:6,StatusForAllOrders:7,StatusForOrdersForAPartyID:8,StatusForSecurityIssuer:9,StatusForIssuerOfUnderlyingSecurity:10}),_5=Object.freeze({AccruedInterest:1,DealPrice:2,TradeDate:3,SettlementDate:4,SideIndicator:5,TradedCurrency:6,AccountID:7,ExecutingBrokerID:8,SettlementCurrencyAndAmount:9,InvestmentManagerID:10,NetAmount:11,PlaceOfSettlement:12,Commissions:13,SecurityIdentifier:14,QualityAllocated:15,Principal:16,Fees:17,Tax:18}),J5=Object.freeze({FixedAmount:1,Percentage:2}),$5=Object.freeze({NoMatchingConfirmation:0,NoMatchingAllocation:1,AllocationDataElementMissing:2,ConfirmationDataElementMissing:3,DataDifferenceNotWithinTolerance:4,MatchWithinTolerance:5,Other:99}),Z5=Object.freeze({Match:1,DoNotMatch:2}),eb=Object.freeze({Mandatory:1,Optional:2}),tb=Object.freeze({Compared:"0",Uncompared:"1",AdvisoryOrAlert:"2",Mismatched:"3"}),db=Object.freeze({ExactMatchPlus4BadgesExecTime:"A1",ExactMatchPlus4Badges:"A2",ACTAcceptedTrade:"M3",ExactMatchPlus2BadgesExecTime:"A3",ACTDefaultTrade:"M4",ExactMatchPlus2Badges:"A4",ACTDefaultAfterM2:"M5",ExactMatchPlusExecTime:"A5",ACTM6Match:"M6",StampedAdvisoriesOrSpecialistAccepts:"AQ",A1ExactMatchSummarizedQuantity:"S1",A2ExactMatchSummarizedQuantity:"S2",A3ExactMatchSummarizedQuantity:"S3",A4ExactMatchSummarizedQuantity:"S4",A5ExactMatchSummarizedQuantity:"S5",ExactMatchMinusBadgesTimes:"M1",SummarizedMatchMinusBadgesTimes:"M2",OCSLockedIn:"MT",OnePartyTradeReport:"1",TwoPartyTradeReport:"2",ConfirmedTradeReport:"3",AutoMatch:"4",CrossAuction:"5",CounterOrderSelection:"6",CallAuction:"7",Issuing:"8",SystematicInternaliser:"9",AutoMatchLastLook:"10",CrossAuctionLastLook:"11"}),ib=Object.freeze({YearMonthOnly:0,YearMonthDay:1,YearMonthWeek:2}),ab=Object.freeze({Months:0,Days:1,Weeks:2,Years:3}),nb=Object.freeze({TopOfBook:1,PriceDepth:2,OrderDepth:3}),z=Object.freeze({Bid:"0",Offer:"1",Trade:"2",IndexValue:"3",OpeningPrice:"4",ClosingPrice:"5",SettlementPrice:"6",TradingSessionHighPrice:"7",TradingSessionLowPrice:"8",VWAP:"9",Imbalance:"A",TradeVolume:"B",OpenInterest:"C",CompositeUnderlyingPrice:"D",SimulatedSellPrice:"E",SimulatedBuyPrice:"F",MarginRate:"G",MidPrice:"H",EmptyBook:"J",SettleHighPrice:"K",SettleLowPrice:"L",PriorSettlePrice:"M",SessionHighBid:"N",SessionLowOffer:"O",EarlyPrices:"P",AuctionClearingPrice:"Q",SwapValueFactor:"S",DailyValueAdjustmentForLongPositions:"R",CumulativeValueAdjustmentForLongPositions:"T",DailyValueAdjustmentForShortPositions:"U",CumulativeValueAdjustmentForShortPositions:"V",FixingPrice:"W",CashRate:"X",RecoveryRate:"Y",RecoveryRateForLong:"Z",RecoveryRateForShort:"a",MarketBid:"b",MarketOffer:"c",ShortSaleMinPrice:"d",PreviousClosingPrice:"e",ThresholdLimitPriceBanding:"g",DailyFinancingValue:"h",AccruedFinancingValue:"i",TWAP:"t"}),rb=Object.freeze({No:"N",Yes:"Y"}),ob=Object.freeze({Book:0,OffBook:1,Cross:2,QuoteDrivenMarket:3,DarkOrderBook:4,AuctionDrivenMarket:5,QuoteNegotiation:6,VoiceNegotiation:7,HybridMarket:8,OtherMarket:9}),sb=Object.freeze({StartInstrumentRefData:1,EndInstrumentRefData:2,StartOffMarketTrades:3,EndOffMarketTrades:4,StartOrderBookTrades:5,EndOrderBookTrades:6,StartOpenInterest:7,EndOpenInterest:8,StartSettlementPrices:9,EndSettlementPrices:10,StartStatsRefData:11,EndStatsRefData:12,StartStatistics:13,EndStatistics:14}),cb=Object.freeze({UnknownSymbol:"0",DuplicateMDReqID:"1",InsufficientBandwidth:"2",InsufficientPermissions:"3",UnsupportedSubscriptionRequestType:"4",UnsupportedMarketDepth:"5",UnsupportedMDUpdateType:"6",UnsupportedAggregatedBook:"7",UnsupportedMDEntryType:"8",UnsupportedTradingSessionID:"9",UnsupportedScope:"A",UnsupportedOpenCloseSettleFlag:"B",UnsupportedMDImplicitDelete:"C",InsufficientCredit:"D"}),pb=Object.freeze({Customer:1,CustomerProfessional:2,DoNotTradeThrough:3}),lb=Object.freeze({SlidingWindow:1,SlidingWindowPeak:2,FixedDateRange:3,FixedTimeRange:4,CurrentTimeUnit:5,PreviousTimeUnit:6,MaximumRange:7,MaximumRangeUpToPreviousTimeUnit:8}),ub=Object.freeze({BuyersToSellers:1,UpticksToDownticks:2,MarketMakerToNonMarketMaker:3,AutomatedToNonAutomated:4,OrdersToTrades:5,QuotesToTrades:6,OrdersAndQuotesToTrades:7,FailedToTotalTradedValue:8,BenefitsToTotalTradedValue:9,FeesToTotalTradedValue:10,TradeVolumeToTotalTradedVolume:11,OrdersToTotalNumberOrders:12}),mb=Object.freeze({Successful:0,InvalidOrUnknownMarket:1,InvalidOrUnknownMarketSegment:2,InvalidOrUnknownSecurityList:3,InvalidOrUnknownInstruments:4,InvalidParties:5,TradeDateOutOfSupportedRange:6,UnsupportedStatisticType:7,UnsupportedScopeOrSubScope:8,UnsupportedScopeType:9,MarketDepthNotSupported:10,FrequencyNotSupported:11,UnsupportedStatisticInterval:12,UnsupportedStatisticDateRange:13,UnsupportedStatisticTimeRange:14,UnsupportedRatioType:15,InvalidOrUnknownTradeInputSource:16,InvalidOrUnknownTradingSession:17,UnauthorizedForStatisticRequest:18,Other:99}),yb=Object.freeze({BidPrices:1,OfferPrices:2,BidDepth:3,OfferDepth:4,Orders:5,Quotes:6,OrdersAndQuotes:7,Trades:8,TradePrices:9,AuctionPrices:10,OpeningPrices:11,ClosingPrices:12,SettlementPrices:13,UnderlyingPrices:14,OpenInterest:15,IndexValues:16,MarginRates:17,Outages:18,ScheduledAuctions:19,ReferencePrices:20,TradeValue:21,MarketDataFeeItems:22,Rebates:23,Discounts:24,Payments:25,Taxes:26,Levies:27,Benefits:28,Fees:29,OrdersRFQs:30,MarketMakers:31,TradingInterruptions:32,TradingSuspensions:33,NoQuotes:34,RequestForQuotes:35,TradeVolume:36}),Sb=Object.freeze({EntryRate:1,ModificationRate:2,CancelRate:3,DownwardMove:4,UpwardMove:5}),Pb=Object.freeze({Active:1,Inactive:2}),gb=Object.freeze({Visible:1,Hidden:2,Indicative:3,Tradeable:4,Passive:5,MarketConsensus:6,Power:7,HardwareError:8,SoftwareError:9,NetworkError:10,Failed:11,Executed:12,Entered:13,Modified:14,Cancelled:15,MarketDataAccess:16,TerminalAccess:17,Volume:18,Cleared:19,Settled:20,Other:21,Monetary:22,NonMonetary:23,Gross:24,LargeInScale:25,NeitherHiddenNorLargeInScale:26,CorporateAction:27,VenueDecision:28,MinimumTimePeriod:29,Open:30,NotExecuted:31,Aggressive:32,Directed:33}),hb=Object.freeze({Count:1,AverageVolume:2,TotalVolume:3,Distribution:4,Ratio:5,Liquidity:6,VWAP:7,Volatility:8,Duration:9,Tick:10,AverageValue:11,TotalValue:12,High:13,Low:14,Midpoint:15,First:16,Last:17,Final:18,ExchangeBest:19,ExchangeBestWithVolume:20,ConsolidatedBest:21,ConsolidatedBestWithVolume:22,TWAP:23,AverageDuration:24,AveragePrice:25,TotalFees:26,TotalBenefits:27,MedianValue:28,AverageLiquidity:29,MedianDuration:30}),fb=Object.freeze({Absolute:1,Percentage:2}),Ib=Object.freeze({New:"0",Change:"1",Delete:"2",DeleteThru:"3",DeleteFrom:"4",Overlay:"5"}),bb=Object.freeze({FullRefresh:0,IncrementalRefresh:1}),Fb=Object.freeze({Range1:1,Range2:2,Range3:3}),Eb=Object.freeze({ISO2022JP:"ISO-2022-JP",EUCJP:"EUC-JP",ShiftJIS:"Shift_JIS",UTF8:"UTF-8"}),vb=Object.freeze({Realtime:1,EndOfDay:2}),Cb=Object.freeze({Once:1,Multiple:2}),Xb=Object.freeze({Absolute:0,PerUnit:1,Percentage:2}),Tb=Object.freeze({Contributes:0,DoesNotContribute:1}),Db=Object.freeze({Regulatory:"1",Tax:"2",LocalCommission:"3",ExchangeFees:"4",Stamp:"5",Levy:"6",Other:"7",Markup:"8",ConsumptionTax:"9",PerTransaction:"10",Conversion:"11",Agent:"12",TransferFee:"13",SecurityLending:"14",TradeReporting:"15",TaxOnPrincipalAmount:"16",TaxOnAccruedInterestAmount:"17",NewIssuanceFee:"18",ServiceFee:"19",OddLotFee:"20",AuctionFee:"21",ValueAddedTax:"22",SalesTax:"23",ExecutionFee:"24",OrderEntryFee:"25",OrderModificationFee:"26",OrdersCancellationFee:"27",MarketDataAccessFee:"28",MarketDataTerminalFee:"29",MarketDataVolumeFee:"30",ClearingFee:"31",SettlementFee:"32",Rebates:"33",Discounts:"34",Payments:"35",NonMonetaryPayments:"36"}),Rb=Object.freeze({UtilityProvidedStandardModel:0,ProprietaryModel:1}),Nb=Object.freeze({Passed:"Y",NotChecked:"N",ExemptBelowLimit:"1",ExemptMoneyType:"2",ExemptAuthorised:"3"}),Ab=Object.freeze({Receive:"R",Send:"S"}),kt=Object.freeze({Heartbeat:"0",TestRequest:"1",ResendRequest:"2",Reject:"3",SequenceReset:"4",Logout:"5",IOI:"6",Advertisement:"7",ExecutionReport:"8",OrderCancelReject:"9",Logon:"A",News:"B",Email:"C",NewOrderSingle:"D",NewOrderList:"E",OrderCancelRequest:"F",OrderCancelReplaceRequest:"G",OrderStatusRequest:"H",AllocationInstruction:"J",ListCancelRequest:"K",ListExecute:"L",ListStatusRequest:"M",ListStatus:"N",AllocationInstructionAck:"P",DontKnowTrade:"Q",QuoteRequest:"R",Quote:"S",SettlementInstructions:"T",MarketDataRequest:"V",MarketDataSnapshotFullRefresh:"W",MarketDataIncrementalRefresh:"X",MarketDataRequestReject:"Y",QuoteCancel:"Z",QuoteStatusRequest:"a",MassQuoteAck:"b",SecurityDefinitionRequest:"c",SecurityDefinition:"d",SecurityStatusRequest:"e",SecurityStatus:"f",TradingSessionStatusRequest:"g",TradingSessionStatus:"h",MassQuote:"i",BusinessMessageReject:"j",BidRequest:"k",BidResponse:"l",ListStrikePrice:"m",XMLnonFIX:"n",RegistrationInstructions:"o",RegistrationInstructionsResponse:"p",OrderMassCancelRequest:"q",OrderMassCancelReport:"r",NewOrderCross:"s",CrossOrderCancelReplaceRequest:"t",CrossOrderCancelRequest:"u",SecurityTypeRequest:"v",SecurityTypes:"w",SecurityListRequest:"x",SecurityList:"y",DerivativeSecurityListRequest:"z",DerivativeSecurityList:"AA",NewOrderMultileg:"AB",MultilegOrderCancelReplace:"AC",TradeCaptureReportRequest:"AD",TradeCaptureReport:"AE",OrderMassStatusRequest:"AF",QuoteRequestReject:"AG",RFQRequest:"AH",QuoteStatusReport:"AI",QuoteResponse:"AJ",Confirmation:"AK",PositionMaintenanceRequest:"AL",PositionMaintenanceReport:"AM",RequestForPositions:"AN",RequestForPositionsAck:"AO",PositionReport:"AP",TradeCaptureReportRequestAck:"AQ",TradeCaptureReportAck:"AR",AllocationReport:"AS",AllocationReportAck:"AT",ConfirmationAck:"AU",SettlementInstructionRequest:"AV",AssignmentReport:"AW",CollateralRequest:"AX",CollateralAssignment:"AY",CollateralResponse:"AZ",CollateralReport:"BA",CollateralInquiry:"BB",NetworkCounterpartySystemStatusRequest:"BC",NetworkCounterpartySystemStatusResponse:"BD",UserRequest:"BE",UserResponse:"BF",CollateralInquiryAck:"BG",ConfirmationRequest:"BH",ContraryIntentionReport:"BO",SecurityDefinitionUpdateReport:"BP",SecurityListUpdateReport:"BK",AdjustedPositionReport:"BL",AllocationInstructionAlert:"BM",ExecutionAck:"BN",TradingSessionList:"BJ",TradingSessionListRequest:"BI",SettlementObligationReport:"BQ",DerivativeSecurityListUpdateReport:"BR",TradingSessionListUpdateReport:"BS",MarketDefinitionRequest:"BT",MarketDefinition:"BU",MarketDefinitionUpdateReport:"BV",ApplicationMessageRequest:"BW",ApplicationMessageRequestAck:"BX",ApplicationMessageReport:"BY",OrderMassActionReport:"BZ",OrderMassActionRequest:"CA",UserNotification:"CB",StreamAssignmentRequest:"CC",StreamAssignmentReport:"CD",StreamAssignmentReportACK:"CE",PartyDetailsListRequest:"CF",PartyDetailsListReport:"CG",MarginRequirementInquiry:"CH",MarginRequirementInquiryAck:"CI",MarginRequirementReport:"CJ",PartyDetailsListUpdateReport:"CK",PartyRiskLimitsRequest:"CL",PartyRiskLimitsReport:"CM",SecurityMassStatusRequest:"CN",SecurityMassStatus:"CO",AccountSummaryReport:"CQ",PartyRiskLimitsUpdateReport:"CR",PartyRiskLimitsDefinitionRequest:"CS",PartyRiskLimitsDefinitionRequestAck:"CT",PartyEntitlementsRequest:"CU",PartyEntitlementsReport:"CV",QuoteAck:"CW",PartyDetailsDefinitionRequest:"CX",PartyDetailsDefinitionRequestAck:"CY",PartyEntitlementsUpdateReport:"CZ",PartyEntitlementsDefinitionRequest:"DA",PartyEntitlementsDefinitionRequestAck:"DB",TradeMatchReport:"DC",TradeMatchReportAck:"DD",PartyRiskLimitsReportAck:"DE",PartyRiskLimitCheckRequest:"DF",PartyRiskLimitCheckRequestAck:"DG",PartyActionRequest:"DH",PartyActionReport:"DI",MassOrder:"DJ",MassOrderAck:"DK",PositionTransferInstruction:"DL",PositionTransferInstructionAck:"DM",PositionTransferReport:"DN",MarketDataStatisticsRequest:"DO",MarketDataStatisticsReport:"DP",CollateralReportAck:"DQ",MarketDataReport:"DR",CrossRequest:"DS",CrossRequestAck:"DT",AllocationInstructionAlertRequest:"DU",AllocationInstructionAlertRequestAck:"DV",TradeAggregationRequest:"DW",TradeAggregationReport:"DX",PayManagementReport:"EA",PayManagementReportAck:"EB",PayManagementRequest:"DY",PayManagementRequestAck:"DZ",SettlementStatusRequest:"EC",SettlementStatusRequestAck:"ED",SettlementStatusReport:"EE",SettlementStatusReportAck:"EF",SecurityRiskMetricsReport:"EG",AlgoCertificateRequest:"EH",AlgoCertificateRequestAck:"EI",AlgoCertificateReport:"EJ",AlgoCertificateReportAck:"EK",TestSuiteDefinitionRequest:"EL",TestSuiteDefinitionRequestAck:"EM",TestActionRequest:"EN",TestActionRequestAck:"EO",TestActionReport:"EP"}),wb=Object.freeze({NotMultiJrsdctnEligible:0,MultiJrsdctnEligible:1}),Mb=Object.freeze({SingleSecurity:"1",IndividualLegOfAMultiLegSecurity:"2",MultiLegSecurity:"3"}),xb=Object.freeze({ReportByMulitlegSecurityOnly:0,ReportByMultilegSecurityAndInstrumentLegs:1,ReportByInstrumentLegsOnly:2}),Lb=Object.freeze({PredefinedMultilegSecurity:0,UserDefinedMultilegSecurity:1,UserDefined:2}),Ob=Object.freeze({NetPrice:0,ReversedNetPrice:1,YieldDifference:2,Individual:3,ContractWeightedAveragePrice:4,MultipliedPrice:5}),Ub=Object.freeze({Bid:0,Offer:1,MidPrice:2}),kb=Object.freeze({NotApplicable:0,Direct:1,SIP:2,Hybrid:3}),qb=Object.freeze({AutoSpot:0,NegotiatedSpot:1,PhoneSpot:2}),Bb=Object.freeze({Net:1,Gross:2}),jb=Object.freeze({Snapshot:1,Subscribe:2,StopSubscribing:4,LevelOfDetail:8}),Gb=Object.freeze({Full:1,IncrementalUpdate:2}),Qb=Object.freeze({CompanyNews:0,MarketplaceNews:1,FinancialMarketNews:2,TechnicalNews:3,OtherNews:99}),Vb=Object.freeze({Replacement:0,OtherLanguage:1,Complimentary:2,Withdrawal:3}),zb=Object.freeze({PotentialAdjustment:0,CashEquivalent:1}),Hb=Object.freeze({Unadjusted:0,Adjusted:1}),Wb=Object.freeze({OneSide:1,BothSides:2}),Kb=Object.freeze({OrderSuspended:0,InstrumentSuspended:1}),Yb=Object.freeze({DetailsShouldNotBeCommunicated:"N",DetailsShouldBeCommunicated:"Y"}),_b=Object.freeze({Bond:"0",ConvertBond:"1",Mortgage:"2",Loan:"3"}),Jb=Object.freeze({TreatAsRoundLot:"N",TreatAsOddLot:"Y"}),$b=Object.freeze({Offset:0,Onset:1}),Zb=Object.freeze({Regular:0,Offshore:1,Onshore:2}),eF=Object.freeze({Close:"C",Open:"O"}),tF=Object.freeze({DailyOpen:"0",SessionOpen:"1",DeliverySettlementEntry:"2"}),dF=Object.freeze({DailyOpen:"0",SessionOpen:"1",DeliverySettlementEntry:"2",ExpectedEntry:"3",EntryFromPreviousBusinessDay:"4",TheoreticalPriceValue:"5"}),iF=Object.freeze({Unadjusted:0,Adjusted:1}),aF=Object.freeze({Vanilla:1,Capped:2,Binary:3,Asian:4,Barrier:5,DigitalBarrier:6,Lookback:7,OtherPathDependent:8,Other:99}),nF=Object.freeze({AggregatedOrder:0,PendingAllocation:1,LiquidityProvisionActivityOrder:2,RiskReductionOrder:3,AlgorithmicOrder:4,SystematicInternaliserOrder:5,AllExecutionsSubmittedToAPA:6,OrderExecutionInstructedByClient:7,LargeInScale:8,Hidden:9,SubjectToEUSTO:10,SubjectToUKSTO:11,RepresentativeOrder:12,LinkageType:13,ExemptFromSTO:14}),rF=Object.freeze({Agency:"A",Proprietary:"G",Individual:"I",Principal:"P",RisklessPrincipal:"R",AgentForOtherMember:"W",MixedCapacity:"M"}),oF=Object.freeze({Order:"1",Quote:"2",PrivatelyNegotiatedTrade:"3",MultilegOrder:"4",LinkedOrder:"5",QuoteRequest:"6",ImpliedOrder:"7",CrossOrder:"8",StreamingPrice:"9",InternalCrossOrder:"A"}),sF=Object.freeze({Seconds:0,TenthsOfASecond:1,HundredthsOfASecond:2,Milliseconds:3,Microseconds:4,Nanoseconds:5,Minutes:10,Hours:11,Days:12,Weeks:13,Months:14,Years:15}),cF=Object.freeze({Add:"1",Modify:"2",Delete:"3",Suspend:"4",Release:"5"}),pF=Object.freeze({AddOrderRequest:1,ModifyOrderRequest:2,DeleteOrderRequest:3,OrderEnteredOOB:4,OrderModifiedOOB:5,OrderDeletedOOB:6,OrderActivatedOrTriggered:7,OrderExpired:8,ReserveOrderRefreshed:9,AwayMarketBetter:10,CorporateAction:11,StartOfDay:12,EndOfDay:13}),lF=Object.freeze({Added:1,Modified:2,Deleted:3,PartiallyFilled:4,Filled:5,Suspended:6,Released:7,Restated:8,Locked:9,Triggered:10,Activated:11}),uF=Object.freeze({FINRAOATS:1,FIAExecutionSourceCode:2}),mF=Object.freeze({OrderReceivedFromCustomer:1,OrderReceivedFromWithinFirm:2,OrderReceivedFromAnotherBrokerDealer:3,OrderReceivedFromCustomerOrWithFirm:4,OrderReceivedFromDirectAccessCustomer:5,OrderReceivedFromForeignDealerEquivalent:6,OrderReceivedFromExecutionOnlyService:7}),yF=Object.freeze({NoChange:0,ExecutingPartyChange:1,EnteringPartyChange:2,SpecifiedPartyChange:3}),SF=Object.freeze({NotSpecified:0,OrderAggregation:1,OrderSplit:2}),PF=Object.freeze({NoAck:0,MinimumAck:1,AckEach:2,SummaryAck:3}),gF=Object.freeze({ProgramTrade:"1",IndexArbitrage:"2",NonIndexArbitrage:"3",CompetingMarketMaker:"4",ActingAsMarketMakerOrSpecialistInSecurity:"5",ActingAsMarketMakerOrSpecialistInUnderlying:"6",ForeignEntity:"7",ExternalMarketParticipant:"8",ExternalInterConnectedMarketLinkage:"9",RisklessArbitrage:"A",IssuerHolding:"B",IssuePriceStabilization:"C",NonAlgorithmic:"D",Algorithmic:"E",Cross:"F",InsiderAccount:"G",SignificantShareholder:"H",NormalCourseIssuerBid:"I"}),hF=Object.freeze({BrokerCredit:0,UnknownSymbol:1,ExchangeClosed:2,OrderExceedsLimit:3,TooLateToEnter:4,UnknownOrder:5,DuplicateOrder:6,DuplicateOfAVerballyCommunicatedOrder:7,StaleOrder:8,TradeAlongRequired:9,InvalidInvestorID:10,UnsupportedOrderCharacteristic:11,SurveillanceOption:12,IncorrectQuantity:13,IncorrectAllocatedQuantity:14,UnknownAccount:15,PriceExceedsCurrentPriceBand:16,InvalidPriceIncrement:18,ReferencePriceNotAvailable:19,NotionalValueExceedsThreshold:20,AlgorithmRiskThresholdBreached:21,ShortSellNotPermitted:22,ShortSellSecurityPreBorrowRestriction:23,ShortSellAccountPreBorrowRestriction:24,InsufficientCreditLimit:25,ExceededClipSizeLimit:26,ExceededMaxNotionalOrderAmt:27,ExceededDV01PV01Limit:28,ExceededCS01Limit:29,LastLook:30,LastLookLatency:31,UnavailablePriceLiquidity:32,InvalidMissingEntitlements:33,Other:99}),fF=Object.freeze({New:"0",PartiallyFilled:"1",Filled:"2",DoneForDay:"3",Canceled:"4",Replaced:"5",PendingCancel:"6",Stopped:"7",Rejected:"8",Suspended:"9",PendingNew:"A",Calculated:"B",Expired:"C",AcceptedForBidding:"D",PendingReplace:"E"}),IF=Object.freeze({Market:"1",Limit:"2",Stop:"3",StopLimit:"4",MarketOnClose:"5",WithOrWithout:"6",LimitOrBetter:"7",LimitWithOrWithout:"8",OnBasis:"9",OnClose:"A",LimitOnClose:"B",ForexMarket:"C",PreviouslyQuoted:"D",PreviouslyIndicated:"E",ForexLimit:"F",ForexSwap:"G",ForexPreviouslyQuoted:"H",Funari:"I",MarketIfTouched:"J",MarketWithLeftOverAsLimit:"K",PreviousFundValuationPoint:"L",NextFundValuationPoint:"M",Pegged:"P",CounterOrderSelection:"Q",StopOnBidOrOffer:"R",StopLimitOnBidOrOffer:"S"}),bF=Object.freeze({MemberTradingForTheirOwnAccount:1,ClearingFirmTradingForItsProprietaryAccount:2,MemberTradingForAnotherMember:3,AllOther:4}),FF=Object.freeze({JointInvestors:"J",TenantsInCommon:"T",JointTrustees:"2"}),EF=Object.freeze({IndividualInvestor:1,PublicCompany:2,PrivateCompany:3,IndividualTrustee:4,CompanyTrustee:5,PensionPlan:6,CustodianUnderGiftsToMinorsAct:7,Trusts:8,Fiduciaries:9,NetworkingSubAccount:10,NonProfitOrganization:11,CorporateBody:12,Nominee:13,InstitutionalCustomer:14,Combined:15,MemberFirmEmployee:16,MarketMakingAccount:17,ProprietaryAccount:18,NonbrokerDealer:19,UnknownBeneficialOwnerType:20,FirmsErrorAccount:21,FirmAgencyAveragePriceAccount:22}),vF=Object.freeze({InvalidParty:0,UnkReqParty:1,NotAuthorized:98,Other:99}),CF=Object.freeze({Accepted:0,Completed:1,Rejected:2}),XF=Object.freeze({Suspend:0,HaltTrading:1,Reinstate:2}),TF=Object.freeze({Accepted:0,AcceptedWithChanges:1,Rejected:2}),DF=Object.freeze({Successful:0,InvalidParty:1,InvalidRelatedParty:2,InvalidPartyStatus:3,NotAuthorized:98,Other:99}),RF=Object.freeze({Accepted:0,AcceptedWithChanges:1,Rejected:2,AcceptancePending:3}),NF=Object.freeze({Agency:0,Principal:1,RisklessPrincipal:2,ExchangeOrderSubmitter:30,GeneralClearingMember:3,IndividualClearingMember:4,PreferredMarketMaker:5,DirectedMarketMaker:6,Bank:7,Hub:8,PrimaryTrdRepository:9,OrigTrdRepository:10,AddtnlIntlTrdRepository:11,AddtnlDomesticTrdRepository:12,RelatedExchange:13,OptionsExchange:14,SpecifiedExchange:15,ConstituentExchange:16,ExemptFromTradeReporting:17,Current:18,New:19,DesignatedSponsor:20,Specialist:21,Algorithm:22,FirmOrLegalEntity:23,NaturalPerson:24,RegularTrader:25,HeadTrader:26,Supervisor:27,TriParty:28,Lender:29}),AF=Object.freeze({Active:0,Suspended:1,Halted:2}),wF=Object.freeze({UKNationalInsuranceOrPensionNumber:"6",KoreanInvestorID:"1",ISITCAcronym:"I",BIC:"B",USSocialSecurityNumber:"7",TaiwaneseForeignInvestorID:"2",GeneralIdentifier:"C",USEmployerOrTaxIDNumber:"8",TaiwaneseTradingAcct:"3",Proprietary:"D",AustralianBusinessNumber:"9",MalaysianCentralDepository:"4",ISOCountryCode:"E",AustralianTaxFileNumber:"A",ChineseInvestorID:"5",SettlementEntityLocation:"F",TaxID:"J",MIC:"G",CSDParticipant:"H",AustralianCompanyNumber:"K",AustralianRegisteredBodyNumber:"L",CFTCReportingFirmIdentifier:"M",LegalEntityIdentifier:"N",InterimIdentifier:"O",ShortCodeIdentifier:"P",NationalIDNaturalPerson:"Q",IndiaPermanentAccountNumber:"R",FDID:"S",SPSAID:"T",MasterSPSAID:"U",KoreaShortSellingRegistrationNumber:"V"}),MF=Object.freeze({IsAlso:0,ClearsFor:1,ClearsThrough:2,TradesFor:3,TradesThrough:4,Sponsors:5,SponsoredThrough:6,ProvidesGuaranteeFor:7,IsGuaranteedBy:8,MemberOf:9,HasMembers:10,ProvidesMarketplaceFor:11,ParticipantOfMarketplace:12,CarriesPositionsFor:13,PostsTradesTo:14,EntersTradesFor:15,EntersTradesThrough:16,ProvidesQuotesTo:17,RequestsQuotesFrom:18,InvestsFor:19,InvestsThrough:20,BrokersTradesFor:21,BrokersTradesThrough:22,ProvidesTradingServicesFor:23,UsesTradingServicesOf:24,ApprovesOf:25,ApprovedBy:26,ParentFirmFor:27,SubsidiaryOf:28,RegulatoryOwnerOf:29,OwnedByRegulatory:30,Controls:31,IsControlledBy:32,LegalOwnerOf:33,OwnedByLegal:34,BeneficialOwnerOf:35,OwnedByBeneficial:36,SettlesFor:37,SettlesThrough:38}),xF=Object.freeze({Disabled:0,Enabled:1}),LF=Object.freeze({ExecutingFirm:1,BrokerOfCredit:2,ClientID:3,ClearingFirm:4,InvestorID:5,IntroducingFirm:6,EnteringFirm:7,Locate:8,FundManagerClientID:9,SettlementLocation:10,OrderOriginationTrader:11,ExecutingTrader:12,OrderOriginationFirm:13,GiveupClearingFirmDepr:14,CorrespondantClearingFirm:15,ExecutingSystem:16,ContraFirm:17,ContraClearingFirm:18,SponsoringFirm:19,UnderlyingContraFirm:20,ClearingOrganization:21,Exchange:22,CustomerAccount:24,CorrespondentClearingOrganization:25,CorrespondentBroker:26,Buyer:27,Custodian:28,Intermediary:29,Agent:30,SubCustodian:31,Beneficiary:32,InterestedParty:33,RegulatoryBody:34,LiquidityProvider:35,EnteringTrader:36,ContraTrader:37,PositionAccount:38,ContraInvestorID:39,TransferToFirm:40,ContraPositionAccount:41,ContraExchange:42,InternalCarryAccount:43,OrderEntryOperatorID:44,SecondaryAccountNumber:45,ForeignFirm:46,ThirdPartyAllocationFirm:47,ClaimingAccount:48,AssetManager:49,PledgorAccount:50,PledgeeAccount:51,LargeTraderReportableAccount:52,TraderMnemonic:53,SenderLocation:54,SessionID:55,AcceptableCounterparty:56,UnacceptableCounterparty:57,EnteringUnit:58,ExecutingUnit:59,IntroducingBroker:60,QuoteOriginator:61,ReportOriginator:62,SystematicInternaliser:63,MultilateralTradingFacility:64,RegulatedMarket:65,MarketMaker:66,InvestmentFirm:67,HostCompetentAuthority:68,HomeCompetentAuthority:69,CompetentAuthorityLiquidity:70,CompetentAuthorityTransactionVenue:71,ReportingIntermediary:72,ExecutionVenue:73,MarketDataEntryOriginator:74,LocationID:75,DeskID:76,MarketDataMarket:77,AllocationEntity:78,PrimeBroker:79,StepOutFirm:80,BrokerClearingID:81,CentralRegistrationDepository:82,ClearingAccount:83,AcceptableSettlingCounterparty:84,UnacceptableSettlingCounterparty:85,CLSMemberBank:86,InConcertGroup:87,InConcertControllingEntity:88,LargePositionsReportingAccount:89,SettlementFirm:90,SettlementAccount:91,ReportingMarketCenter:92,RelatedReportingMarketCenter:93,AwayMarket:94,GiveupTradingFirm:95,TakeupTradingFirm:96,GiveupClearingFirm:97,TakeupClearingFirm:98,OriginatingMarket:99,MarginAccount:100,CollateralAssetAccount:101,DataRepository:102,CalculationAgent:103,ExerciseNoticeSender:104,ExerciseNoticeReceiver:105,RateReferenceBank:106,Correspondent:107,BeneficiaryBank:109,Borrower:110,PrimaryObligator:111,Guarantor:112,ExcludedReferenceEntity:113,DeterminingParty:114,HedgingParty:115,ReportingEntity:116,SalesPerson:117,Operator:118,CSD:119,ICSD:120,TradingSubAccount:121,InvestmentDecisionMaker:122,PublishingIntermediary:123,CSDParticipant:124,Issuer:125,ContraCustomerAccount:126,ContraInvestmentDecisionMaker:127,AuthorizingPerson:128}),OF=Object.freeze({Firm:1,Person:2,System:3,Application:4,FullLegalNameOfFirm:5,PostalAddress:6,PhoneNumber:7,EmailAddress:8,ContactName:9,SecuritiesAccountNumber:10,RegistrationNumber:11,RegisteredAddressForConfirmation:12,RegulatoryStatus:13,RegistrationName:14,CashAccountNumber:15,BIC:16,CSDParticipantMemberCode:17,RegisteredAddress:18,FundAccountName:19,TelexNumber:20,FaxNumber:21,SecuritiesAccountName:22,CashAccountName:23,Department:24,LocationDesk:25,PositionAccountType:26,SecurityLocateID:27,MarketMaker:28,EligibleCounterparty:29,ProfessionalClient:30,Location:31,ExecutionVenue:32,CurrencyDeliveryIdentifier:33,AddressCity:34,AddressStateOrProvince:35,AddressPostalCode:36,AddressStreet:37,AddressISOCountryCode:38,ISOCountryCode:39,MarketSegment:40,CustomerAccountType:41,OmnibusAccount:42,FundsSegregationType:43,GuaranteeFund:44,SwapDealer:45,MajorParticipant:46,FinancialEntity:47,USPerson:48,ReportingEntityIndicator:49,ElectedClearingRequirementException:50,BusinessCenter:51,ReferenceText:52,ShortMarkingExemptAccount:53,ParentFirmIdentifier:54,ParentFirmName:55,DealIdentifier:56,SystemTradeID:57,SystemTradeSubID:58,FCMCode:59,DlvryTrmlCode:60,VolntyRptEntity:61,RptObligJursdctn:62,VolntyRptJursdctn:63,CompanyActivities:64,EEAreaDomiciled:65,ContractLinked:66,ContractAbove:67,VolntyRptPty:68,EndUser:69,LocationOrJurisdiction:70,DerivativesDealer:71,Domicile:72,ExemptFromRecognition:73,Payer:74,Receiver:75,SystematicInternaliser:76,PublishingEntityIndicator:77,FirstName:78,Surname:79,DateOfBirth:80,OrderTransmittingFirm:81,OrderTransmittingFirmBuyer:82,OrderTransmitterSeller:83,LegalEntityIdentifier:84,SubSectorClassification:85,PartySide:86,LegalRegistrationCountry:87}),UF=Object.freeze({Business:0,Calendar:1,Commodity:2,Currency:3,Exchange:4,Scheduled:5}),kF=Object.freeze({Prepaid:0,Postpaid:1,Variable:2,Fixed:3}),qF=Object.freeze({CREST:1,NSCC:2,Euroclear:3,Clearstream:4,Cheque:5,TelegraphicTransfer:6,FedWire:7,DebitCard:8,DirectDebit:9,DirectCredit:10,CreditCard:11,ACHDebit:12,ACHCredit:13,BPAY:14,HighValueClearingSystem:15,CHIPS:16,SWIFT:17,CHAPS:18,SIC:19,EuroSIC:20,Other:999}),BF=Object.freeze({Buy:1,Sell:2}),jF=Object.freeze({Initial:0,Previous:1}),GF=Object.freeze({Notional:0,CashFlow:1,FXLinkedNotional:2,FixedRate:3,FutureValueNotional:4,KnownAmount:5,FloatingRateMultiplier:6,Spread:7,CapRate:8,FloorRate:9,NonDeliverableSettlPaymentDates:10,NonDeliverableSettlCalculationDates:11,NonDeliverableFXFixingDates:12,SettlPeriodNotnl:13,SettlPeriodPx:14,CalcPeriod:15,DividendAccrualRateMultiplier:16,DividendAccrualRateSpread:17,DividendAccrualCapRate:18,DividendAccrualFloorRate:19,CompoundingRateMultiplier:20,CompoundingRateSpread:21,CompoundingCapRate:22,CompoundingFloorRate:23}),QF=Object.freeze({Standard:0,Net:1,StandardfNet:2}),VF=Object.freeze({Unweighted:0,Weighted:1}),zF=Object.freeze({Buyer:1,Seller:2}),HF=Object.freeze({None:0,Flat:1,Straight:2,SpreadExclusive:3}),WF=Object.freeze({Standard:0,FRA:1}),KF=Object.freeze({Buyer:1,Seller:2}),YF=Object.freeze({None:0,ISDA:1,AFMA:2}),_F=Object.freeze({None:0,LinearZeroYield:1}),JF=Object.freeze({Business:0,Calendar:1,CommodityBusiness:2,CurrencyBusiness:3,ExchangeBusiness:4,ScheduledTradingDay:5}),$F=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),ZF=Object.freeze({Initial:0,InitialAndFinal:1,Final:2,AnyPeriod:3}),eE=Object.freeze({Volatility:0,Variance:1}),tE=Object.freeze({ZeroInterestRateMethod:0,NegativeInterestRateMethod:1}),dE=Object.freeze({Business:0,Calendar:1,CommodityBusiness:2,CurrencyBusiness:3,ExchangeBusiness:4,ScheduledTradingDay:5}),iE=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),aE=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr",Term:"T"}),nE=Object.freeze({All:0,First:1,Last:2,Penultimate:3}),rE=Object.freeze({EveryDay:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6,Sunday:7}),oE=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),sE=Object.freeze({Bloomberg:0,Reuters:1,Telerate:2,Other:99}),cE=Object.freeze({Short:0,Long:1}),pE=Object.freeze({Absolute:0,Percentage:1}),lE=Object.freeze({BondEquivalentYield:0,MoneyMarketYield:1}),uE=Object.freeze({Previous:0,Last:1,Both:2}),mE=Object.freeze({Monday:"MON",Tuesday:"TUE",Wednesday:"WED",Thursday:"THU",Friday:"FRI",Saturday:"SAT",Sunday:"SUN"}),yE=Object.freeze({Average:0,Maximum:1,Minimum:2,Cumulative:3}),SE=Object.freeze({Periodic:0,Initial:1,Single:2,Dividend:3,Interest:4,DividendReturn:5,PriceReturn:6,TotalReturn:7,Variance:8,Correlation:9}),PE=Object.freeze({Short:0,Long:1}),gE=Object.freeze({Initial:0,Final:1,CompoundingInitial:2,CompoundingFinal:3}),hE=Object.freeze({Initial:0,Intermediate:1,Final:2,Prepaid:3,Postpaid:4,Variable:5,Fixed:6,Swap:7,Conditional:8,FixedRate:9,FloatingRate:10}),fE=Object.freeze({Brokerage:0,UpfrontFee:1,IndependentAmountCollateral:2,PrincipalExchange:3,NovationTermination:4,EarlyTerminationProvision:5,CancelableProvision:6,ExtendibleProvision:7,CapRateProvision:8,FloorRateProvision:9,OptionPremium:10,SettlementPayment:11,CashSettl:12,SecurityLending:13,Rebate:14,Other:99}),IE=Object.freeze({Received:0,Accepted:1,Rejected:2,Disputed:3}),bE=Object.freeze({New:0,Replace:1,Status:2}),FE=Object.freeze({Received:0,Accepted:1,Rejected:2,Disputed:3}),EE=Object.freeze({New:0,Cancel:1}),vE=Object.freeze({OrBetter:0,Strict:1,OrWorse:2}),CE=Object.freeze({Floating:0,Fixed:1}),XE=Object.freeze({Price:0,BasisPoints:1,Ticks:2,PriceTier:3,Percentage:4}),TE=Object.freeze({LastPeg:1,MidPricePeg:2,OpeningPeg:3,MarketPeg:4,PrimaryPeg:5,PegToVWAP:7,TrailingStopPeg:8,PegToLimitPrice:9,ShortSaleMinPricePeg:10}),DE=Object.freeze({MoreAggressive:1,MorePassive:2}),RE=Object.freeze({Local:1,National:2,Global:3,NationalExcludingLocal:4}),NE=Object.freeze({OptionsSettlement:0,PendingErosionAdjustment:1,FinalErosionAdjustment:2,TearUpCouponAmount:3,PriceAlignmentInterest:4,DeliveryInvoiceCharges:5,DeliveryStorageCharges:6}),AE=Object.freeze({CashAmount:"CASH",CashResidualAmount:"CRES",FinalMarkToMarketAmount:"FMTM",IncrementalMarkToMarketAmount:"IMTM",PremiumAmount:"PREM",StartOfDayMarkToMarketAmount:"SMTM",TradeVariationAmount:"TVAR",ValueAdjustedAmount:"VADJ",SettlementValue:"SETL",InitialTradeCouponAmount:"ICPN",AccruedCouponAmount:"ACPN",CouponAmount:"CPN",IncrementalAccruedCoupon:"IACPN",CollateralizedMarkToMarket:"CMTM",IncrementalCollateralizedMarkToMarket:"ICMTM",CompensationAmount:"DLV",TotalBankedAmount:"BANK",TotalCollateralizedAmount:"COLAT",LongPairedSwapNotionalValue:"LSNV",ShortPairedSwapNotionalValue:"SSNV",StartOfDayAccruedCoupon:"SACPN",NetPresentValue:"NPV",StartOfDayNetPresentValue:"SNPV",NetCashFlow:"NCF",PresentValueOfFees:"PVFEES",PresentValueOneBasisPoints:"PV01",FiveYearEquivalentNotional:"5YREN",UndiscountedMarkToMarket:"UMTM",MarkToModel:"MTD",MarkToMarketVariance:"VMTM",MarkToModelVariance:"VMTD",UpfrontPayment:"UPFRNT",EndVale:"ENDV",OutstandingMarginLoan:"MGNLN",LoanValue:"LNVL"}),wE=Object.freeze({Principal:0,Agent:1,Customer:2,Counterparty:3}),ME=Object.freeze({Close:"C",FIFO:"F",Open:"O",Rolled:"R",CloseButNotifyOnOpen:"N",Default:"D"}),xE=Object.freeze({New:1,Replace:2,Cancel:3,Reverse:4}),LE=Object.freeze({SuccessfulCompletion:0,Rejected:1,Other:99}),OE=Object.freeze({Accepted:0,AcceptedWithWarnings:1,Rejected:2,Completed:3,CompletedWithWarnings:4}),UE=Object.freeze({Submitted:0,Accepted:1,Rejected:2}),kE=Object.freeze({ValidRequest:0,InvalidOrUnsupportedRequest:1,NoPositionsFoundThatMatchCriteria:2,NotAuthorizedToRequestPositions:3,RequestForPositionNotSupported:4,Other:99}),qE=Object.freeze({Completed:0,CompletedWithWarnings:1,Rejected:2}),BE=Object.freeze({Positions:0,Trades:1,Exercises:2,Assignments:3,SettlementActivity:4,BackoutMessage:5,DeltaPositions:6,NetPosition:7,LargePositionsReporting:8,ExercisePositionReportingSubmission:9,PositionLimitReportingSubmissing:10}),Eg=Object.freeze({OriginalTransmission:"N",PossibleDuplicate:"Y"}),jE=Object.freeze({OriginalTransmission:"N",PossibleResend:"Y"}),GE=Object.freeze({Exercise:1,DoNotExercise:2,PositionAdjustment:3,PositionChangeSubmission:4,Pledge:5,LargeTraderSubmission:6,LargePositionsReportingSubmission:7,LongHoldings:8,InternalTransfer:9,TransferOfFirm:10,ExternalTransfer:11,CorporateAction:12,Notification:13,PositionCreation:14,Closeout:15,Reopen:16}),QE=Object.freeze({AllocationTradeQty:"ALC",OptionAssignment:"AS",AsOfTradeQty:"ASF",DeliveryQty:"DLV",ElectronicTradeQty:"ETR",OptionExerciseQty:"EX",EndOfDayQty:"FIN",IntraSpreadQty:"IAS",InterSpreadQty:"IES",AdjustmentQty:"PA",PitTradeQty:"PIT",StartOfDayQty:"SOD",IntegralSplit:"SPL",TransactionFromAssignment:"TA",TotalTransactionQty:"TOT",TransactionQuantity:"TQ",TransferTradeQty:"TRF",TransactionFromExercise:"TX",CrossMarginQty:"XM",ReceiveQuantity:"RCV",CorporateActionAdjustment:"CAA",DeliveryNoticeQty:"DN",ExchangeForPhysicalQty:"EP",PrivatelyNegotiatedTradeQty:"PNTN",NetDeltaQty:"DLT",CreditEventAdjustment:"CEA",SuccessionEventAdjustment:"SEA",NetQty:"NET",GrossQty:"GRS",IntradayQty:"ITD",GrossLongNonDeltaAdjustedSwaptionPosition:"NDAS",LongDeltaAdjustedPairedSwaptionPosition:"DAS",ExpiringQuantity:"EXP",QuantityNotExercised:"UNEX",RequestedExerciseQuantity:"REQ",CashFuturesEquivalentQuantity:"CFE",LoanOrBorrowedQuantity:"SECLN"}),VE=Object.freeze({DebitPay:0,CreditReceive:1}),zE=Object.freeze({New:0,Initiated:1,Pending:2,Confirmed:3,Rejected:4}),HE=Object.freeze({ProRata:"0",DoNotProRata:"1"}),WE=Object.freeze({NotReportedToCounterparty:"N",PreviouslyReportedToCounterparty:"Y"}),KE=Object.freeze({Price:0,Ticks:1,Percentage:2}),YE=Object.freeze({Amount:0,Percentage:1}),_E=Object.freeze({None:"0",Local:"1",National:"2",Global:"3"}),JE=Object.freeze({AccruedInterestIsFactored:0,TaxIsFactored:1,BondAmortizationIsFactored:2}),$E=Object.freeze({Standard:"STD",Index:"INX",InterestRateIndex:"INT",PercentOfPar:"PCTPAR"}),ZE=Object.freeze({Percentage:1,PerUnit:2,FixedAmount:3,Discount:4,Premium:5,Spread:6,TEDPrice:7,TEDYield:8,Yield:9,FixedCabinetTradePrice:10,VariableCabinetTradePrice:11,PriceSpread:12,ProductTicksInHalves:13,ProductTicksInFourths:14,ProductTicksInEighths:15,ProductTicksInSixteenths:16,ProductTicksInThirtySeconds:17,ProductTicksInSixtyFourths:18,ProductTicksInOneTwentyEighths:19,NormalRateRepresentation:20,InverseRateRepresentation:21,BasisPoints:22,UpfrontPoints:23,InterestRate:24,PercentageNotional:25}),ev=Object.freeze({PriorityUnchanged:0,LostPriorityAsResultOfOrderChange:1}),tv=Object.freeze({PrivateQuote:"Y",PublicQuote:"N"}),dv=Object.freeze({Regular:"0",SoftDollar:"1",StepIn:"2",StepOut:"3",SoftDollarStepIn:"4",SoftDollarStepOut:"5",PlanSponsor:"6"}),iv=Object.freeze({AGENCY:1,COMMODITY:2,CORPORATE:3,CURRENCY:4,EQUITY:5,GOVERNMENT:6,INDEX:7,LOAN:8,MONEYMARKET:9,MORTGAGE:10,MUNICIPAL:11,OTHER:12,FINANCING:13}),av=Object.freeze({BuySideRequests:1,SellSideSends:2,RealTimeExecutionReports:3}),nv=Object.freeze({Business:0,Calendar:1,CommodityBusiness:2,CurrencyBusiness:3,ExchangeBusiness:4,ScheduledTradingDay:5}),rv=Object.freeze({RestructuringMultipleHoldingObligations:"H",RestructuringMultipleCreditEventNotices:"E",FloatingRateInterestShortfall:"C"}),ov=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),sv=Object.freeze({FlatFee:0,AmortizedFee:1,FundingFee:2,FlatAndFundingFee:3,AmortizedAndFundingFee:4}),cv=Object.freeze({ExercisingParty:0,NonExercisingParty:1,MasterAgreeent:2,Supplement:3}),pv=Object.freeze({CashPrice:0,CashPriceAlternate:1,ParYieldCurveAdjusted:2,ZeroCouponYieldCurveAdjusted:3,ParYieldCurveUnadjusted:4,CrossCurrency:5,CollateralizedPrice:6}),lv=Object.freeze({Unadjusted:0,Adjusted:1}),uv=Object.freeze({Bid:0,Mid:1,Offer:2,ExercisingPartyPays:3}),mv=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),yv=Object.freeze({Day:"D",Week:"Wk",Month:"Mo",Year:"Yr"}),Sv=Object.freeze({Unadjusted:0,Adjusted:1}),Pv=Object.freeze({Buy:1,Sell:2}),gv=Object.freeze({MandatoryEarlyTermination:0,OptionalEarlyTermination:1,Cancelable:2,Extendable:3,MutualEarlyTermination:4,Evergreen:5,Callable:6,Puttable:7}),hv=Object.freeze({DoNotReportTrade:"N",ReportTrade:"Y"}),fv=Object.freeze({Put:0,Call:1,Other:2,Chooser:3}),Iv=Object.freeze({Units:0,Contracts:1,UnitsOfMeasurePerTimeUnit:2}),bv=Object.freeze({ReceivedNotYetProcessed:0,Accepted:1,Rejected:2}),Fv=Object.freeze({QuoteAboveStandardMarketSize:0,QuoteAboveSpecificInstrumentSize:1,QuoteApplicableForLiquidtyProvisionActivity:2,QuoteIssuerStatus:3,BidOrAskRequest:4}),Ev=Object.freeze({CancelForOneOrMoreSecurities:1,CancelForSecurityType:2,CancelForUnderlyingSecurity:3,CancelAllQuotes:4,CancelSpecifiedSingleQuote:5,CancelByTypeOfQuote:6,CancelForSecurityIssuer:7,CancelForIssuerOfUnderlyingSecurity:8}),vv=Object.freeze({Open:"A",Closed:"B",ExchangeBest:"C",ConsolidatedBest:"D",Locked:"E",Crossed:"F",Depth:"G",FastTrading:"H",NonFirm:"I",Manual:"L",OutrightPrice:"J",ImpliedPrice:"K",DepthOnOffer:"M",DepthOnBid:"N",Closing:"O",NewsDissemination:"P",TradingRange:"Q",OrderInflux:"R",DueToRelated:"S",NewsPending:"T",AdditionalInfo:"U",AdditionalInfoDueToRelated:"V",Resume:"W",ViewOfCommon:"X",VolumeAlert:"Y",OrderImbalance:"Z",EquipmentChangeover:"a",NoOpen:"b",RegularETH:"c",AutomaticExecution:"d",AutomaticExecutionETH:"e",FastMarketETH:"f",InactiveETH:"g",Rotation:"h",RotationETH:"i",Halt:"j",HaltETH:"k",DueToNewsDissemination:"l",DueToNewsPending:"m",TradingResume:"n",OutOfSequence:"o",BidSpecialist:"p",OfferSpecialist:"q",BidOfferSpecialist:"r",EndOfDaySAM:"s",ForbiddenSAM:"t",FrozenSAM:"u",PreOpeningSAM:"v",OpeningSAM:"w",OpenSAM:"x",SurveillanceSAM:"y",SuspendedSAM:"z",ReservedSAM:"0",NoActiveSAM:"1",Restricted:"2",RestOfBookVWAP:"3",BetterPricesInConditionalOrders:"4",MedianPrice:"5",FullCurve:"6",FlatCurve:"7"}),Cv=Object.freeze({UnknownSymbol:1,Exchange:2,QuoteExceedsLimit:3,TooLateToEnter:4,UnknownQuote:5,DuplicateQuote:6,InvalidBidAskSpread:7,InvalidPrice:8,NotAuthorizedToQuoteSecurity:9}),Xv=Object.freeze({Accepted:0,Rejected:5,RemovedFromMarket:6,Expired:7,LockedMarketWarning:12,CrossMarketWarning:13,CanceledDueToLockMarket:14,CanceledDueToCrossMarket:15,Active:16}),Tv=Object.freeze({QuoteEntry:1,QuoteModification:2}),Dv=Object.freeze({Percent:1,PerShare:2,FixedAmount:3,Discount:4,Premium:5,Spread:6,TEDPrice:7,TEDYield:8,YieldSpread:9,Yield:10,PriceSpread:12,ProductTicksInHalves:13,ProductTicksInFourths:14,ProductTicksInEighths:15,ProductTicksInSixteenths:16,ProductTicksInThirtySeconds:17,ProductTicksInSixtyFourths:18,ProductTicksInOneTwentyEighths:19,NormalRateRepresentation:20,InverseRateRepresentation:21,BasisPoints:22,UpFrontPoints:23,InterestRate:24,PercentageOfNotional:25}),Rv=Object.freeze({UnknownSymbol:1,Exchange:2,QuoteRequestExceedsLimit:3,TooLateToEnter:4,UnknownQuote:5,DuplicateQuote:6,InvalidBid:7,InvalidPrice:8,NotAuthorizedToQuoteSecurity:9,PriceExceedsCurrentPriceBand:10,QuoteLocked:11,InvalidOrUnknownSecurityIssuer:12,InvalidOrUnknownIssuerOfUnderlyingSecurity:13,NotionalValueExceedsThreshold:14,PriceExceedsCurrentPriceBandDepr:15,ReferencePriceNotAvailable:16,InsufficientCreditLimit:17,ExceededClipSizeLimit:18,ExceededMaxNotionalOrderAmt:19,ExceededDV01PV01Limit:20,ExceededCS01Limit:21,UnavailablePriceLiquidity:22,InvalidMissingEntitlements:23,UnknownAccounts:24,Other:99}),Nv=Object.freeze({UnknownSymbol:1,Exchange:2,QuoteRequestExceedsLimit:3,TooLateToEnter:4,InvalidPrice:5,NotAuthorizedToRequestQuote:6,NoMatchForInquiry:7,NoMarketForInstrument:8,NoInventory:9,Pass:10,InsufficientCredit:11,ExceededClipSizeLimit:12,ExceededMaxNotionalOrderAmt:13,ExceededDV01PV01Limit:14,ExceededCS01Limit:15,UnavailablePriceLiquidity:16,UnmetRegulatoryRequirement:17,UnknownAccounts:18,InvalidMissingEntitlements:19,Other:99}),Av=Object.freeze({Manual:1,Automatic:2,ConfirmQuote:3}),wv=Object.freeze({NoAcknowledgement:0,AcknowledgeOnlyNegativeOrErroneousQuotes:1,AcknowledgeEachQuoteMessage:2,SummaryAcknowledgement:3}),Mv=Object.freeze({Hit:1,Counter:2,Expired:3,Cover:4,DoneAway:5,Pass:6,EndTrade:7,TimedOut:8,Tied:9,TiedCover:10,Accept:11,TerminateContract:12}),xv=Object.freeze({No:"N",Yes:"Y"}),Lv=Object.freeze({Accepted:0,CancelForSymbol:1,CanceledForSecurityType:2,CanceledForUnderlying:3,CanceledAll:4,Rejected:5,RemovedFromMarket:6,Expired:7,Query:8,QuoteNotFound:9,Pending:10,Pass:11,LockedMarketWarning:12,CrossMarketWarning:13,CanceledDueToLockMarket:14,CanceledDueToCrossMarket:15,Active:16,Canceled:17,UnsolicitedQuoteReplenishment:18,PendingEndTrade:19,TooLateToEnd:20,Traded:21,TradedAndRemoved:22,ContractTerminates:23}),Ov=Object.freeze({Indicative:0,Tradeable:1,RestrictedTradeable:2,Counter:3,InitiallyTradeable:4}),Uv=Object.freeze({Bloomberg:0,Reuters:1,Telerate:2,ISDARateOption:3,Other:99}),kv=Object.freeze({Primary:0,Secondary:1}),qv=Object.freeze({AdmitToTradeRequestDate:0,AdmitToTradeApprovalDate:1,AdmitToTradeOrFirstTradeDate:2,TerminationDate:3}),Bv=Object.freeze({Asian:1,AustralianNewZealand:2,EuropeanEmergingMarkets:3,Japanese:4,NorthAmericanHighYield:5,NorthAmericanInsurance:6,NorthAmericanInvestmentGrade:7,Singaporean:8,WesternEuropean:9,WesternEuropeanInsurance:10}),jv=Object.freeze({SecondaryOrderID:"0",OrderID:"1",MDEntryID:"2",QuoteEntryID:"3",OriginalOrderID:"4",QuoteID:"5",QuoteReqID:"6",PreviousOrderIdentifier:"7",PreviousQuoteIdentifier:"8",ParentOrderIdentifier:"9",ManualOrderIdentifier:"A"}),Gv=Object.freeze({GTCFromPreviousDay:0,PartialFillRemaining:1,OrderChanged:2}),Qv=Object.freeze({RiskLimitRequestID:0,RiskLimitCheckID:1,OutOfBandID:3}),Vv=Object.freeze({InvalidAccountType:1,InvalidTaxExemptType:2,InvalidOwnershipType:3,NoRegDetails:4,InvalidRegSeqNo:5,InvalidRegDetails:6,InvalidMailingDetails:7,InvalidMailingInstructions:8,InvalidInvestorID:9,InvalidInvestorIDSource:10,InvalidDateOfBirth:11,InvalidCountry:12,InvalidDistribInstns:13,InvalidPercentage:14,InvalidPaymentMethod:15,InvalidAccountName:16,InvalidAgentCode:17,InvalidAccountNum:18,Other:99}),zv=Object.freeze({Accepted:"A",Rejected:"R",Held:"H",Reminder:"N"}),Hv=Object.freeze({New:"0",Cancel:"2",Replace:"1"}),Wv=Object.freeze({RT:0,PET:1,Snapshot:2,Confirmation:3,RTPET:4,PETConfirmation:5,RTPETConfirmation:6,PostTrade:7,Verification:8,PstTrdEvnt:9,PstTrdEvntRTReportable:10,LMTF:11,DATF:12,VOLO:13,FWAF:14,IDAF:15,VOLW:16,FULF:17,FULA:18,FULV:19,FULJ:20,COAF:21,Order:22,ChildOrder:23,OrderRoute:24,Trade:25,Quote:26,Supplement:27,NewTransaction:28,TransactionCorrection:29,TransactionModification:30,CollateralUpdate:31,MarginUpdate:32,TransactionReportedInError:33,TerminationEarlyTermination:34}),Kv=Object.freeze({InitialBlockTrade:0,Allocation:1,Clearing:2,Compression:3,Novation:4,Termination:5,PostTrdVal:6}),Yv=Object.freeze({ClearingMember:1,Client:2}),_v=Object.freeze({UniqueTransactionIdentifier:"1"}),Jv=Object.freeze({Current:0,Previous:1,Block:2,Related:3,ClearedBlockTrade:4,TradingVenueTransactionIdentifier:5,ReportTrackingNumber:6}),$v=Object.freeze({None:0,SEFRequiredTransaction:1,SEFPermittedTransaction:2}),Zv=Object.freeze({HedgesForInstrument:1,Underlier:2,EquityEquivalent:3,NearestExchangeTradedContract:4,RetailEquivalent:5,Leg:6}),eC=Object.freeze({NonFIXSource:0,SystemOrderIdentifier:1,ClientOrderIdentifier:2,SecondaryOrderIdentifier:3,SecondaryClientOrderIdentifier:4}),tC=Object.freeze({PosMaintRptID:1,TransferID:2,PositionEntityID:3}),dC=Object.freeze({NBBid:1,NBOffer:2}),iC=Object.freeze({NonFIXSource:0,TradeID:1,SecondaryTradeID:2,TradeReportID:3,FirmTradeID:4,SecondaryFirmTradeID:5,RegulatoryTradeID:6}),aC=Object.freeze({Bid:1,Mid:2,Offer:3}),nC=Object.freeze({ASWSpread:1,OIS:2,ZSpread:3,DiscountMargin:4,ISpread:5,OAS:6,GSpread:7,CDSBasis:8,CDSInterpolatedBasis:9,DV01:10,PV01:11,CS01:12}),rC=Object.freeze({ISO:1,NoAwayMarketBetterCheck:2}),oC=Object.freeze({NoRemunerationPaid:0,RemunerationPaid:1}),sC=Object.freeze({SenderReports:"N",ReceiverReports:"Y"}),cC=Object.freeze({ValidRequest:0,InvalidOrUnsupportedRequest:1,NoDataFound:2,NotAuthorized:3,DataTemporarilyUnavailable:4,RequestForDataNotSupported:5,Other:99}),On=Object.freeze({No:"N",Yes:"Y"}),pC=Object.freeze({AllMarketParticipants:1,SpecifiedMarketParticipants:2,AllMarketMakers:3,PrimaryMarketMaker:4}),lC=Object.freeze({Inband:0,OutOfBand:1}),uC=Object.freeze({FullRestructuring:"FR",ModifiedRestructuring:"MR",ModifiedModRestructuring:"MM",NoRestructuringSpecified:"XR"}),mC=Object.freeze({PriceValuation:0,DividendValuation:1}),yC=Object.freeze({Gross:0,Net:1,Accrued:2,CleanNet:3}),SC=Object.freeze({Initial:0,Interim:1,Final:2}),PC=Object.freeze({AbsoluteTerms:0,PercentageOfNotional:1}),gC=Object.freeze({Open:0,OfficialSettlPx:1,Xetra:2,Close:3,DerivativesClose:4,High:5,Low:6,AsSpecifiedInMasterConfirmation:7}),hC=Object.freeze({None:0,FuturesPrice:1,OptionsPrice:2}),fC=Object.freeze({Dividend:1,Variance:2,Volatility:3,TotalReturn:4,ContractForDifference:5,CreditDefault:6,SpreadBet:7,Price:8,ForwardPriceUnderlyingInstrument:9,Other:99}),IC=Object.freeze({QueueInbound:0,QueueOutbound:1,Reject:2,Disconnect:3,Warning:4,PingCreditCheckWithRevalidation:5,PingCreditCheckNoRevalidation:6,PushCreditCheckWithRevalidation:7,PushCreditCheckNoRevalidation:8,Suspend:9,HaltTrading:10}),bC=Object.freeze({None:0,PlusOneModel:1,PingModel:2,PushModel:3}),FC=Object.freeze({Successful:0,InvalidParty:1,ReqExceedsCreditLimit:2,ReqExceedsClipSizeLimit:3,ReqExceedsMaxNotional:4,Other:99}),EC=Object.freeze({Approved:0,PartiallyApproved:1,Rejected:2,ApprovalPending:3,Cancelled:4}),vC=Object.freeze({AllOrNone:0,Partial:1}),CC=Object.freeze({Accepted:0,Rejected:1,ClaimRequired:2,PreDefinedLimitCheckSucceeded:3,PreDefinedLimitCheckFailed:4,PreDefinedAutoAcceptRuleInvoked:5,PreDefinedAutoRejectRuleInvoked:6,AcceptedByClearingFirm:7,RejectedByClearingFirm:8,Pending:9,AcceptedByCreditHub:10,RejectedByCreditHub:11,PendingCreditHubCheck:12,AcceptedByExecVenue:13,RejectedByExecVenue:14}),XC=Object.freeze({New:0,Cancel:1,Replace:2}),TC=Object.freeze({Submit:0,LimitConsumed:1}),DC=Object.freeze({UnkRiskLmtRprtID:0,UnkPty:1,Other:99}),RC=Object.freeze({Accepted:0,Rejected:1}),NC=Object.freeze({Successful:0,InvalidParty:1,InvalidRelatedParty:2,InvalidRiskLimitType:3,InvalidRiskLimitID:4,InvalidRiskLimitAmount:5,InvalidRiskWarningLevelAction:6,InvalidRiskInstrumentScope:7,RiskLimitActionsNotSupported:8,WarningLevelsNotSupported:9,WarningLevelActionsNotSupported:10,RiskInstrumentScopeNotSupported:11,RiskLimitNotApprovedForParty:12,RiskLimitAlreadyDefinedForParty:13,InstrumentNotApprovedForParty:14,NotAuthorized:98,Other:99}),AC=Object.freeze({Definitions:1,Utilization:2,DefinitionsAndUtilizations:3}),wC=Object.freeze({CreditLimit:0,GrossLimit:1,NetLimit:2,Exposure:3,LongLimit:4,ShortLimit:5,CashMargin:6,AdditionalMargin:7,TotalMargin:8,LimitConsumed:9,ClipSize:10,MaxNotionalOrderSize:11,DV01PV01Limit:12,CS01Limit:13,VolumeLimitPerTimePeriod:14,VolFilledPctOrdVolTmPeriod:15,NotlFilledPctNotlTmPeriod:16,TransactionExecutionLimitPerTimePeriod:17}),MC=Object.freeze({RoundToNearest:"0",RoundDown:"1",RoundUp:"2"}),xC=Object.freeze({NoRoutingArrangementInPlace:0,RoutingArrangementInPlace:1}),LC=Object.freeze({TargetFirm:1,TargetList:2,BlockFirm:3,BlockList:4,TargetPerson:5,BlockPerson:6}),OC=Object.freeze({AgencySingleOrder:"A",ShortExemptTransactionAType:"B",ProprietaryNonAlgo:"C",ProgramOrderMember:"D",ShortExemptTransactionForPrincipal:"E",ShortExemptTransactionWType:"F",ShortExemptTransactionIType:"H",IndividualInvestor:"I",ProprietaryAlgo:"J",AgencyAlgo:"K",ShortExemptTransactionMemberAffliated:"L",ProgramOrderOtherMember:"M",AgentForOtherMember:"N",ProprietaryTransactionAffiliated:"O",Principal:"P",TransactionNonMember:"R",SpecialistTrades:"S",TransactionUnaffiliatedMember:"T",AgencyIndexArb:"U",AllOtherOrdersAsAgentForOtherMember:"W",ShortExemptTransactionMemberNotAffliated:"X",AgencyNonAlgo:"Y",ShortExemptTransactionNonMember:"Z"}),UC=Object.freeze({LocalMarket:"1",National:"2",Global:"3"}),kC=Object.freeze({Fee:0,CreditControls:1,Margin:2,EntitlementOrEligibility:3,MarketData:4,AccountSelection:5,DeliveryProcess:6,Sector:7}),qC=Object.freeze({CUSIP:"1",SEDOL:"2",QUIK:"3",ISINNumber:"4",RICCode:"5",ISOCurrencyCode:"6",ISOCountryCode:"7",ExchangeSymbol:"8",ConsolidatedTapeAssociation:"9",BloombergSymbol:"A",Wertpapier:"B",Dutch:"C",Valoren:"D",Sicovam:"E",Belgian:"F",Common:"G",ClearingHouse:"H",ISDAFpMLSpecification:"I",OptionPriceReportingAuthority:"J",ISDAFpMLURL:"K",LetterOfCredit:"L",MarketplaceAssignedIdentifier:"M",MarkitREDEntityCLIP:"N",MarkitREDPairCLIP:"P",CFTCCommodityCode:"Q",ISDACommodityReferencePrice:"R",FinancialInstrumentGlobalIdentifier:"S",LegalEntityIdentifier:"T",Synthetic:"U",FidessaInstrumentMnemonic:"V",IndexName:"W",UniformSymbol:"X",DigitalTokenIdentifier:"Y"}),BC=Object.freeze({Symbol:0,SecurityTypeAnd:1,Product:2,TradingSessionID:3,AllSecurities:4,MarketIDOrMarketID:5}),jC=Object.freeze({IndustryClassification:1,TradingList:2,Market:3,NewspaperList:4}),GC=Object.freeze({ICB:1,NAICS:2,GICS:3}),QC=Object.freeze({InvalidInstrumentRequested:1,InstrumentAlreadyExists:2,RequestTypeNotSupported:3,SystemUnavailableForInstrumentCreation:4,IneligibleInstrumentGroup:5,InstrumentIDUnavailable:6,InvalidOrMissingDataOnOptionLeg:7,InvalidOrMissingDataOnFutureLeg:8,InvalidOrMissingDataOnFXLeg:10,InvalidLegPriceSpecified:11,InvalidInstrumentStructureSpecified:12}),VC=Object.freeze({ValidRequest:0,InvalidOrUnsupportedRequest:1,NoInstrumentsFound:2,NotAuthorizedToRetrieveInstrumentData:3,InstrumentDataTemporarilyUnavailable:4,RequestForInstrumentDataNotSupported:5}),zC=Object.freeze({RequestSecurityIdentityAndSpecifications:0,RequestSecurityIdentityForSpecifications:1,RequestListSecurityTypes:2,RequestListSecurities:3,Symbol:4,SecurityTypeAndOrCFICode:5,Product:6,TradingSessionID:7,AllSecurities:8,MarketIDOrMarketID:9}),HC=Object.freeze({AcceptAsIs:1,AcceptWithRevisions:2,RejectSecurityProposal:5,CannotMatchSelectionCriteria:6}),WC=Object.freeze({Active:"1",Inactive:"2",ActiveClosingOrdersOnly:"3",Expired:"4",Delisted:"5",KnockedOut:"6",KnockOutRevoked:"7",PendingExpiry:"8",Suspended:"9",Published:"10",PendingDeletion:"11"}),KC=Object.freeze({OrderImbalance:1,TradingResumes:2,PriceVolatilityInterruption:3,ChangeOfTradingSession:4,ChangeOfTradingSubsession:5,ChangeOfSecurityTradingStatus:6,ChangeOfBookType:7,ChangeOfMarketDepth:8,CorporateAction:9}),YC=Object.freeze({OpeningDelay:1,TradingHalt:2,Resume:3,NoOpen:4,PriceIndication:5,TradingRangeIndication:6,MarketImbalanceBuy:7,MarketImbalanceSell:8,MarketOnCloseImbalanceBuy:9,MarketOnCloseImbalanceSell:10,NoMarketImbalance:12,NoMarketOnCloseImbalance:13,ITSPreOpening:14,NewPriceIndication:15,TradeDisseminationTime:16,ReadyToTrade:17,NotAvailableForTrading:18,NotTradedOnThisMarket:19,UnknownOrInvalid:20,PreOpen:21,OpeningRotation:22,FastMarket:23,PreCross:24,Cross:25,PostClose:26,NoCancel:27}),_C=Object.freeze({EuroSupranationalCoupons:"EUSUPRA",CorporateBond:"CORP",ForeignExchangeContract:"FOR",CommonStock:"CS",Repurchase:"REPO",BradyBond:"BRADY",TermLoan:"TERM",BankersAcceptance:"BA",AssetBackedSecurities:"ABS",OtherAnticipationNotes:"AN",MutualFund:"MF",FederalAgencyCoupon:"FAC",CorporatePrivatePlacement:"CPP",NonDeliverableForward:"FXNDF",Cap:"CAP",PreferredStock:"PS",Forward:"FORWARD",CanadianTreasuryNotes:"CAN",RevolverLoan:"RVLV",BankDepositoryNote:"BDN",CanadianMortgageBonds:"CMB",CertificateOfObligation:"COFO",MultilegInstrument:"MLEG",FederalAgencyDiscountNote:"FADN",ConvertibleBond:"CB",FXSpot:"FXSPOT",CreditDefaultSwap:"CDS",DepositoryReceipts:"DR",BuySellback:"BUYSELL",CanadianTreasuryBills:"CTB",Revolver:"RVLVTRM",BankNotes:"BN",Corp:"CMBS",CertificateOfParticipation:"COFP",NoSecurityType:"NONE",USTreasuryNoteOld:"UST",PrivateExportFunding:"PEF",DualCurrency:"DUAL",FXForward:"FXFWD",Collar:"CLLR",SecuritiesLoan:"SECLOAN",EuroSovereigns:"EUSOV",BridgeLoan:"BRIDGE",BillOfExchanges:"BOX",CollateralizedMortgageObligation:"CMO",GeneralObligationBonds:"GO",USTreasuryBillOld:"USTB",USDSupranationalCoupons:"SUPRA",EuroCorporateBond:"EUCORP",FXSwap:"FXSWAP",CommoditySwap:"CMDTYSWAP",SecuritiesPledge:"SECPLEDGE",CanadianProvincialBonds:"PROV",LetterOfCredit:"LOFC",CanadianMoneyMarkets:"CAMM",IOETTEMortgage:"IET",MandatoryTender:"MT",EuroCorporateFloatingRateNotes:"EUFRN",NonDeliverableSwap:"FXNDS",Exotic:"EXOTIC",DeliveryVersusPledge:"DVPLDG",TreasuryBill:"TB",SwingLineFacility:"SWING",CertificateOfDeposit:"CD",MortgageBackedSecurities:"MBS",RevenueAnticipationNote:"RAN",Wildcard:"?",USCorporateFloatingRateNotes:"FRN",FXBankNote:"FXBN",OptionsOnCombo:"OOC",Floor:"FLR",CollateralBasket:"COLLBSKT",USTreasuryBond:"TBOND",DebtorInPossession:"DINP",CallLoans:"CL",MortgageInterestOnly:"MIO",RevenueBonds:"REV",Cash:"CASH",IndexedLinked:"XLINKD",ForeignCurrencyDiscountNote:"FXDN",FRA:"FRA",StructuredFinanceProduct:"SFP",InterestStripFromAnyBondOrNote:"TINT",Defaulted:"DEFLTED",CommercialPaper:"CP",MortgagePrincipalOnly:"MPO",SpecialAssessment:"SPCLA",Other:"Other",StructuredNotes:"STRUCT",Future:"FUT",USTreasuryBill:"TBILL",TreasuryInflationProtectedSecurities:"TIPS",Withdrawn:"WITHDRN",DepositNotes:"DN",MortgagePrivatePlacement:"MPP",SpecialObligation:"SPCLO",ExchangeTradedNote:"ETN",YankeeCorporateBond:"YANK",DerivativeForward:"FWD",MarginLoan:"MRGNLOAN",PrincipalStripOfACallableBondOrNote:"TCAL",Replaced:"REPLACD",EuroCertificateOfDeposit:"EUCD",MiscellaneousPassThrough:"MPT",SpecialTax:"SPCLT",OffshoreIssuedChineseYuanCorporateBond:"DIMSUMCORP",InterestRateSwap:"IRS",TotalReturnSwap:"TRS",PrincipalStripFromANonCallableBondOrNote:"TPRN",Matured:"MATURED",EuroCommercialPaper:"EUCP",Pfandbrief:"PFAND",TaxAnticipationNote:"TAN",SecuritizedDerivative:"SECDERIV",PreferredCorporateBond:"PRCORP",LoanLease:"LOANLEASE",USTreasuryNote:"TNOTE",Amended:"AMENDED",LiquidityNote:"LQN",ToBeAnnounced:"TBA",TaxAllocation:"TAXA",ExchangeTradedFund:"ETF",OffshoreIssuedChineseYuanSovereignBond:"DIMSUMSOV",Retired:"RETIRED",MediumTermNotes:"MTN",TaxExemptCommercialPaper:"TECP",DigitalAsset:"DIGITAL",OptionsOnFutures:"OOF",SovereignBond:"SOV",Overnight:"ONITE",TaxableMunicipalCP:"TMCP",OptionsOnPhysical:"OOP",USTreasuryFloatingRateNote:"TFRN",PromissoryNote:"PN",ShortTermLoanNote:"STN",TaxRevenueAnticipationNote:"TRAN",Option:"OPT",PlazosFijos:"PZFJ",VariableRateDemandNote:"VRDN",SpotForward:"SPOTFWD",SecuredLiquidityNote:"SLQN",Warrant:"WAR",SwapOption:"SWAPTION",TimeDeposit:"TD",MunicipalInterestBearingCommercialPaper:"MCPIB",Transmission:"XMISSION",TaxableMunicipalBond:"TMB",Index:"INDEX",TermLiquidityNote:"TLQN",VariableRateDemandObligation:"VRDO",BondBasket:"BDBSKT",ExtendedCommNote:"XCN",ContractForDifference:"CFD",YankeeCertificateOfDeposit:"YCD",CorrelationSwap:"CRLTNSWAP",BankAcceptedBill:"BAB",DiviendSwap:"DVDNDSWAP",ShortTermBankNote:"BNST",EquityBasket:"EQBSKT",CallableCommercialPaper:"CLCP",EquityForward:"EQFWD",CommercialNote:"CN",ReturnSwap:"RTRNSWAP",InterestBearingCommercialPaper:"CPIB",VarianceSwap:"VARSWAP",EuroMediumTermNote:"EUMTN",PortfolioSwaps:"PRTFLIOSWAP",EuroNegotiableCommercialPaper:"EUNCP",FuturesOnASwap:"FUTSWAP",EuroStructuredLiquidityNote:"EUSTLQN",ForwardsOnASwap:"FWDSWAP",EuroTimeDeposit:"EUTD",ForwardFreightAgreement:"FWDFRTAGMT",JumboCertificateOfDeposit:"JCD",SpreadBetting:"SPREADBET",MoneyMarketFund:"MMF",ExchangeTradedCommodity:"ETC",MasterNote:"MN",NegotiableCertificateOfDeposit:"NCD",NegotiableCommercialPaper:"NCP",RetailCertificateOfDeposit:"RCD",TermDepositReceipt:"TDR"}),JC=Object.freeze({Add:"A",Delete:"D",Modify:"M"}),$C=Object.freeze({CancelAggressive:1,CancelPassive:2,CancelAggressivePassive:3}),ZC=Object.freeze({SeniorSecured:"SD",Senior:"SR",Subordinated:"SB",Junior:"JR",Mezzanine:"MZ",SeniorNonPreferred:"SN"}),e3=Object.freeze({InvalidTagNumber:0,RequiredTagMissing:1,TagNotDefinedForThisMessageType:2,UndefinedTag:3,TagSpecifiedWithoutAValue:4,ValueIsIncorrect:5,IncorrectDataFormatForValue:6,DecryptionProblem:7,SignatureProblem:8,CompIDProblem:9,SendingTimeAccuracyProblem:10,InvalidMsgType:11,XMLValidationError:12,TagAppearsMoreThanOnce:13,TagSpecifiedOutOfRequiredOrder:14,RepeatingGroupFieldsOutOfOrder:15,IncorrectNumInGroupCountForRepeatingGroup:16,NonDataValueIncludesFieldDelimiter:17,InvalidUnsupportedApplVer:18,Other:99}),t3=Object.freeze({SessionActive:0,SessionPasswordChanged:1,SessionPasswordDueToExpire:2,NewSessionPasswordDoesNotComplyWithPolicy:3,SessionLogoutComplete:4,InvalidUsernameOrPassword:5,AccountLocked:6,LogonsAreNotAllowedAtThisTime:7,PasswordExpired:8,ReceivedMsgSeqNumTooLow:9,ReceivedNextExpectedMsgSeqNumTooHigh:10}),d3=Object.freeze({Multiply:"M",Divide:"D"}),i3=Object.freeze({Versus:0,Free:1,TriParty:2,HoldInCustody:3}),a3=Object.freeze({Negotiation:1,Cancellation:2}),n3=Object.freeze({Default:"0",StandingInstructionsProvided:"1",SpecificAllocationAccountOverriding:"2",SpecificAllocationAccountStanding:"3",SpecificOrderForASingleAccount:"4",RequestReject:"5"}),r3=Object.freeze({UnableToProcessRequest:0,UnknownAccount:1,NoMatchingSettlementInstructionsFound:2,Other:99}),o3=Object.freeze({BrokerCredit:"1",Institution:"2",Investor:"3"}),s3=Object.freeze({New:"N",Cancel:"C",Replace:"R",Restate:"T"}),c3=Object.freeze({CEDEL:"CED",DepositoryTrustCompany:"DTC",EuroClear:"EUR",FederalBookEntry:"FED",LocalMarketSettleLocation:"ISO Country Code",Physical:"PNY",ParticipantTrustCompany:"PTC"}),p3=Object.freeze({CashSettlementRequired:"C",PhysicalSettlementRequired:"P",Election:"E"}),l3=Object.freeze({Regular:"0",Cash:"1",NextDay:"2",TPlus2:"3",TPlus3:"4",TPlus4:"5",Future:"6",WhenAndIfIssued:"7",SellersOption:"8",TPlus5:"9"}),u3=Object.freeze({Preliminary:1,Final:2}),m3=Object.freeze({InstructionsOfBroker:"1",InstructionsForInstitution:"2",Investor:"3",BuyersSettlementInstructions:"4",SellersSettlementInstructions:"5"}),y3=Object.freeze({Cancel:"C",New:"N",Replace:"R",Restate:"T"}),S3=Object.freeze({Unknown:0,LastTradePrice:1,LastBidPrice:2,LastOfferPrice:3,MidPrice:4,AverageLastTradePrice:5,AverageLastTradePeriod:6,UnderlyingPrice:7,CalculatedPrice:8,ManualPrice:9}),P3=Object.freeze({Final:1,Theoretical:2}),g3=Object.freeze({Intraday:"ITD",RegularTradingHours:"RTH",ElectronicTradingHours:"ETH",EndOfDay:"EOD"}),h3=Object.freeze({Received:0,Accepted:1,Rejected:2}),f3=Object.freeze({Received:0,Accepted:1,Rejected:2}),I3=Object.freeze({Shares:1,Derivatives:2,PaymentVsPayment:3,Notional:4,Cascade:5,Repurchase:6,Other:99}),b3=Object.freeze({Regular:"0",Cash:"1",NextDay:"2",TPlus2:"3",TPlus3:"4",TPlus4:"5",Future:"6",WhenAndIfIssued:"7",SellersOption:"8",TPlus5:"9",BrokenDate:"B",FXSpotNextSettlement:"C"}),F3=Object.freeze({ExemptionReasonUnknown:0,IncomingSSE:1,AboveNationalBestBid:2,DelayedDelivery:3,OddLot:4,DomesticArbitrage:5,InternationalArbitrage:6,UnderwriterOrSyndicateDistribution:7,RisklessPrincipal:8,VWAP:9}),E3=Object.freeze({DealerSoldShort:0,DealerSoldShortExempt:1,SellingCustomerSoldShort:2,SellingCustomerSoldShortExempt:3,QualifiedServiceRepresentative:4,QSROrAGUContraSideSoldShortExempt:5}),v3=Object.freeze({NoRestrictions:0,SecurityNotShortable:1,SecurityNotShortableAtOrBelowBestBid:2,SecurityNotShortableWithoutPreBorrow:3}),C3=Object.freeze({Buy:"1",Sell:"2",BuyMinus:"3",SellPlus:"4",SellShort:"5",SellShortExempt:"6",Undisclosed:"7",Cross:"8",CrossShort:"9",CrossShortExempt:"A",AsDefined:"B",Opposite:"C",Subscribe:"D",Redeem:"E",Lend:"F",Borrow:"G",SellUndisclosed:"H"}),X3=Object.freeze({TradeClearingAtExecutionPrice:0,TradeClearingAtAlternateClearingPrice:1}),T3=Object.freeze({SingleSecurity:1,IndividualLegOfAMultilegSecurity:2,MultilegSecurity:3}),D3=Object.freeze({SideValue1:1,SideValue2:2}),R3=Object.freeze({MultipleQuotesAllowed:"N",OnlyOneQuoteAllowed:"Y"}),N3=Object.freeze({WasNotSolicited:"N",WasSolicited:"Y"}),A3=Object.freeze({Other:0,DTCSID:1,ThomsonALERT:2,AGlobalCustodian:3,AccountNet:4}),w3=Object.freeze({ExchangeLast:1,High:2,AveragePrice:3,Turnover:4}),M3=Object.freeze({Connected:1,NotConnectedUnexpected:2,NotConnectedExpected:3,InProcess:4}),x3=Object.freeze({AlternativeMinimumTax:"AMT",IncurredRecovery:"INCURRCVY",AbsolutePrepaymentSpeed:"ABS",AutoReinvestment:"AUTOREINV",AdditionalTerm:"ADDTRM",ConstantPrepaymentPenalty:"CPP",BankQualified:"BANKQUAL",ModifiedEquityDelivery:"MODEQTYDLVY",ConstantPrepaymentRate:"CPR",BargainConditions:"BGNCON",NoReferenceOblication:"NOREFOBLIG",ConstantPrepaymentYield:"CPY",CouponRange:"COUPON",UnknownReferenceObligation:"UNKREFOBLIG",FinalCPROfHomeEquityPrepaymentCurve:"HEP",ISOCurrencyCode:"CURRENCY",AllGuarantees:"ALLGUARANTEES",PercentOfManufacturedHousingPrepaymentCurve:"MHP",CustomStart:"CUSTOMDATE",ReferencePrice:"REFPX",MonthlyPrepaymentRate:"MPR",Geographics:"GEOG",ReferencePolicy:"REFPOLICY",PercentOfProspectusPrepaymentCurve:"PPC",ValuationDiscount:"HAIRCUT",SecuredList:"SECRDLIST",PercentOfBMAPrepaymentCurve:"PSA",Insured:"INSURED",SingleMonthlyMortality:"SMM",IssueDate:"ISSUE",Issuer:"ISSUER",IssueSizeRange:"ISSUESIZE",LookbackDays:"LOOKBACK",ExplicitLotIdentifier:"LOT",LotVariance:"LOTVAR",MaturityYearAndMonth:"MAT",MaturityRange:"MATURITY",MaximumSubstitutions:"MAXSUBS",MinimumDenomination:"MINDNOM",MinimumIncrement:"MININCR",MinimumQuantity:"MINQTY",PaymentFrequency:"PAYFREQ",NumberOfPieces:"PIECES",PoolsMaximum:"PMAX",PoolsPerLot:"PPL",PoolsPerMillion:"PPM",PoolsPerTrade:"PPT",PriceRange:"PRICE",PricingFrequency:"PRICEFREQ",ProductionYear:"PROD",CallProtection:"PROTECT",Purpose:"PURPOSE",BenchmarkPriceSource:"PXSOURCE",RatingSourceAndRange:"RATING",TypeOfRedemption:"REDEMPTION",Restricted:"RESTRICTED",MarketSector:"SECTOR",SecurityTypeIncludedOrExcluded:"SECTYPE",Structure:"STRUCT",SubstitutionsFrequency:"SUBSFREQ",SubstitutionsLeft:"SUBSLEFT",FreeformText:"TEXT",TradeVariance:"TRDVAR",WeightedAverageCoupon:"WAC",WeightedAverageLifeCoupon:"WAL",WeightedAverageLoanAge:"WALA",WeightedAverageMaturity:"WAM",WholePool:"WHOLE",YieldRange:"YIELD",OriginalAmount:"ORIGAMT",AverageFICOScore:"AVFICO",PoolEffectiveDate:"POOLEFFDT",AverageLoanSize:"AVSIZE",PoolInitialFactor:"POOLINITFCTR",MaximumLoanBalance:"MAXBAL",Tranche:"TRANCHE",PoolIdentifier:"POOL",Substitution:"SUBSTITUTION",TypeOfRollTrade:"ROLLTYPE",MULTEXCHFLLBCK:"MULTEXCHFLLBCK",ReferenceToRollingOrClosingTrade:"REFTRADE",COMPSECFLLBCK:"COMPSECFLLBCK",PrincipalOfRollingOrClosingTrade:"REFPRIN",LOCLJRSDCTN:"LOCLJRSDCTN",InterestOfRollingOrClosingTrade:"REFINT",RELVJRSDCTN:"RELVJRSDCTN",AvailableOfferQuantityToBeShownToTheStreet:"AVAILQTY",BrokerCredit:"BROKERCREDIT",OfferPriceToBeShownToInternalBrokers:"INTERNALPX",OfferQuantityToBeShownToInternalBrokers:"INTERNALQTY",TheMinimumResidualOfferQuantity:"LEAVEQTY",MaximumOrderSize:"MAXORDQTY",OrderQuantityIncrement:"ORDRINCR",PrimaryOrSecondaryMarketIndicator:"PRIMARY",BrokerSalesCreditOverride:"SALESCREDITOVR",TraderCredit:"TRADERCREDIT",DiscountRate:"DISCOUNT",YieldToMaturity:"YTM",InterestPayoffOfRollingOrAmendingTrade:"PAYOFF"}),L3=Object.freeze({Int:1,Length:2,NumInGroup:3,SeqNum:4,TagNum:5,Float:6,Qty:7,Price:8,PriceOffset:9,Amt:10,Percentage:11,Char:12,Boolean:13,String:14,MultipleCharValue:15,Currency:16,Exchange:17,MonthYear:18,UTCTimestamp:19,UTCTimeOnly:20,LocalMktDate:21,UTCDateOnly:22,Data:23,MultipleStringValue:24,Country:25,Language:26,TZTimeOnly:27,TZTimestamp:28,Tenor:29}),O3=Object.freeze({Straddle:"STD",Strangle:"STG",Butterfly:"BF",Condor:"CNDR",CallableInversibleSnowball:"CISN",Other:"OTHER"}),U3=Object.freeze({AssignmentAccepted:0,AssignmentRejected:1}),k3=Object.freeze({UnknownClient:0,ExceedsMaximumSize:1,UnknownOrInvalidCurrencyPair:2,NoAvailableStream:3,Other:99}),q3=Object.freeze({StreamAssignmentForNewCustomer:1,StreamAssignmentForExistingCustomer:2}),B3=Object.freeze({Assignment:1,Rejected:2,Terminate:3}),j3=Object.freeze({City:0,Airport:1,WeatherStation:2,WeatherIndex:3}),G3=Object.freeze({Week:"Wk",Month:"Mo"}),Q3=Object.freeze({Day:"D"}),V3=Object.freeze({Execution:0,PortfolioRebalancing:1,Standard:2}),z3=Object.freeze({Term:0,PerBusinessDay:1,PerCalculationPeriod:2,PerSettlPeriod:3,PerCalendarDay:4,PerHour:5,PerMonth:6}),H3=Object.freeze({PaymentCashSettlement:0,PhysicalDelivery:1}),W3=Object.freeze({Bid:0,Mid:1,Offer:2}),K3=Object.freeze({LessThan:1,LessThanOrEqual:2,Equal:3,GreaterThanOrEqual:4,GreaterThan:5}),Y3=Object.freeze({FixedStrike:1,StrikeSetAtExpiration:2,StrikeSetToAverageAcrossLife:3,StrikeSetToOptimalValue:4}),_3=Object.freeze({Snapshot:"0",SnapshotAndUpdates:"1",DisablePreviousSnapshot:"2"}),J3=Object.freeze({BasisSwap:"BS",IndexSwap:"IX",BroadBasedSecuritySwap:"BB",BasketSwap:"SK"}),$3=Object.freeze({Amortizing:"AMTZ",Compounding:"COMP",ConstantNotionalSchedule:"CNST",AccretingNotionalSchedule:"ACRT",CustomNotionalSchedule:"CUST"}),Z3=Object.freeze({EUCPWithLumpSumInterest:"CD",WhenIssued:"WI"}),eX=Object.freeze({VWAP:1,Participate:2,MininizeMarketImpact:3}),tX=Object.freeze({None:0,MaxiISA:1,TESSA:2,MiniCashISA:3,MiniStocksAndSharesISA:4,MiniInsuranceISA:5,CurrentYearPayment:6,PriorYearPayment:7,AssetTransfer:8,EmployeePriorYear:9,EmployeeCurrentYear:10,EmployerPriorYear:11,EmployerCurrentYear:12,NonFundPrototypeIRA:13,NonFundQualifiedPlan:14,DefinedContributionPlan:15,IRA:16,IRARollover:17,KEOGH:18,ProfitSharingPlan:19,US401K:20,SelfDirectedIRA:21,US403b:22,US457:23,RothIRAPrototype:24,RothIRANonPrototype:25,RothConversionIRAPrototype:26,RothConversionIRANonPrototype:27,EducationIRAPrototype:28,EducationIRANonPrototype:29,Other:999}),dX=Object.freeze({ISINOrAltInstrmtID:"I",InterimTaxonomy:"E"}),iX=Object.freeze({Overnight:1,Term:2,Flexible:3,Open:4}),aX=Object.freeze({Received:0,Accepted:1,Rejected:2}),nX=Object.freeze({Start:0,Stop:1,State:2}),rX=Object.freeze({MarketDataGatewayIPAddress:0,MarketDataGatewayPortNumber:1,MarketDataGatewayDataFormat:2,MarketDataGatewayFormatVersion:3,MarketDataGatewayRoutingIPAddress:4,OrderEntryGatewayIPAddress:5,OrderEntryGatewayPortNumber:6,OrderEntryGatewaydataFormat:7,OrderEntryGatewayFormatVersion:8,OrderEntryGatewayRoutingIPAddress:9}),oX=Object.freeze({False:"N",True:"Y"}),sX=Object.freeze({Scheduled:0,Running:1,Completed:2,Cancelled:3}),cX=Object.freeze({Received:0,Accepted:1,Rejected:2}),pX=Object.freeze({New:0,Cancel:1}),lX=Object.freeze({Undefined:0,Pass:1,Fail:2,Warning:3}),uX=Object.freeze({Under:0,Over:1}),mX=Object.freeze({QueueInbound:0,QueueOutbound:1,Reject:2,Disconnect:3,Warning:4}),yX=Object.freeze({OutstandingRequestsUnchanged:0,OutstandingRequestsDecreased:1}),SX=Object.freeze({RejectIfThrottleLimitExceeded:0,QueueIfThrottleLimitExceeded:1}),PX=Object.freeze({ThrottleLimitNotExceededNotQueued:0,QueuedDueToThrottleLimitExceeded:1}),gX=Object.freeze({InboundRate:0,OutstandingRequests:1}),hX=Object.freeze({PlusTick:"0",ZeroPlusTick:"1",MinusTick:"2",ZeroMinusTick:"3"}),fX=Object.freeze({RegularTrading:0,VariableCabinet:1,FixedCabinet:2,TradedAsASpreadLeg:3,SettledAsASpreadLeg:4,TradedAsSpread:5}),IX=Object.freeze({Day:"0",GoodTillCancel:"1",AtTheOpening:"2",ImmediateOrCancel:"3",FillOrKill:"4",GoodTillCrossing:"5",GoodTillDate:"6",AtTheClose:"7",GoodThroughCrossing:"8",AtCrossing:"9",GoodForTime:"A",GoodForAuction:"B",GoodForMonth:"C"}),bX=Object.freeze({Hour:"H",Minute:"Min",Second:"S",Day:"D",Week:"Wk",Month:"Mo",Year:"Yr",Quarter:"Q",EndOfMonth:"EOM",Flexible:"F"}),FX=Object.freeze({UnknownOrders:0,UnknownExecutionFills:1,Other:99}),EX=Object.freeze({Accepted:0,Rejected:1}),vX=Object.freeze({New:0,Cancel:1,Replace:2}),CX=Object.freeze({Add:0,DoNotAdd:1}),XX=Object.freeze({AllocationNotRequired:0,AllocationRequired:1,UseAllocationProvidedWithTheTrade:2,AllocationGiveUpExecutor:3,AllocationFromExecutor:4,AllocationToClaimAccount:5,TradeSplit:6}),TX=Object.freeze({PendingClear:0,Claimed:1,Cleared:2,Rejected:3}),DX=Object.freeze({Uncollateralized:0,PartiallyCollateralized:1,OneWayCollaterallization:2,FullyCollateralized:3,NetExposure:4}),RX=Object.freeze({Cash:"A",AveragePriceTrade:"B",CashTrade:"C",NextDay:"D",Opening:"E",IntradayTradeDetail:"F",Rule127Trade:"G",Rule155Trade:"H",SoldLast:"I",NextDayTrade:"J",Opened:"K",Seller:"L",Sold:"M",StoppedStock:"N",ImbalanceMoreBuyers:"P",ImbalanceMoreSellers:"Q",OpeningPrice:"R",BargainCondition:"S",ConvertedPriceIndicator:"T",ExchangeLast:"U",FinalPriceOfSession:"V",ExPit:"W",Crossed:"X",TradesResultingFromManual:"Y",TradesResultingFromIntermarketSweep:"Z",VolumeOnly:"a",DirectPlus:"b",Acquisition:"c",Bunched:"d",Distribution:"e",BunchedSale:"f",SplitTrade:"g",CancelStopped:"h",CancelETH:"i",CancelStoppedETH:"j",OutOfSequenceETH:"k",CancelLastETH:"l",SoldLastSaleETH:"m",CancelLast:"n",SoldLastSale:"o",CancelOpen:"p",CancelOpenETH:"q",OpenedSaleETH:"r",CancelOnly:"s",CancelOnlyETH:"t",LateOpenETH:"u",AutoExecutionETH:"v",Reopen:"w",ReopenETH:"x",Adjusted:"y",AdjustedETH:"z",Spread:"AA",SpreadETH:"AB",Straddle:"AC",StraddleETH:"AD",Stopped:"AE",StoppedETH:"AF",RegularETH:"AG",Combo:"AH",ComboETH:"AI",OfficialClosingPrice:"AJ",PriorReferencePrice:"AK",StoppedSoldLast:"AL",StoppedOutOfSequence:"AM",OfficialClosingPriceDup:"AN",CrossedOld:"AO",FastMarket:"AP",AutomaticExecution:"AQ",FormT:"AR",BasketIndex:"AS",BurstBasket:"AT",TradeThroughExempt:"AU",QuoteSpread:"AV",LastAuctionPrice:"AW",HighPrice:"AX",LowPrice:"AY",SystematicInternaliser:"AZ",AwayMarket:"BA",MidpointPrice:"BB",TradedBeforeIssueDate:"BC",PreviousClosingPrice:"BD",NationalBestBidOffer:"BE",Cancel:"0",ImpliedTrade:"1",MarketplaceEnteredTrade:"2",MultiAssetClassMultilegTrade:"3",MultilegToMultilegTrade:"4",ShortSaleMinPrice:"5",Benchmark:"6"}),NX=Object.freeze({DoesNotApply:0,ContingentTrade:1,NonContingentTrade:2}),AX=Object.freeze({Novation:0,PartialNovation:1,TradeUnwind:2,PartialTradeUnwind:3,Exercise:4,Netting:5,FullNetting:6,PartialNetting:7,Amendment:8,Increase:9,CreditEvent:10,StrategicRestructuring:11,SuccessionEventReorganization:12,SuccessionEventRenaming:13,Porting:14,Withdrawl:15,Void:16,AccountTransfer:17,GiveUp:18,TakeUp:19,AveragePricing:20,Reversal:21,AllocTrdPosting:22,Cascade:23,Delivery:24,OptionAsgn:25,Expiration:26,Maturity:27,EqualPosAdj:28,UnequalPosAdj:29,Correction:30,EarlyTermination:31,Rerate:32,Other:99}),wX=Object.freeze({NotTradedFlat:"N",TradedFlat:"Y"}),MX=Object.freeze({TradeConfirmation:"0",TwoPartyReport:"1",OnePartyReportForMatching:"2",OnePartyReportForPassThrough:"3",AutomatedFloorOrderRouting:"4",TwoPartyReportForClaim:"5",OnePartyReport:"6",ThirdPtyRptForPassThrough:"7",OnePartyReportAutoMatch:"8"}),xX=Object.freeze({ReceivedNotProcessed:0,Accepted:1,Rejected:2}),LX=Object.freeze({Successful:0,InvalidPartyInformation:1,UnknownInstrument:2,Unauthorized:3,InvalidTradeType:4,Other:99}),OX=Object.freeze({SpecialCumDividend:0,SpecialCumRights:1,SpecialExDividend:2,SpecialExRights:3,SpecialCumCoupon:4,SpecialCumCapitalRepayments:5,SpecialExCoupon:6,SpecialExCapitalRepayments:7,CashSettlement:8,SpecialCumBonus:9,SpecialPrice:10,SpecialExBonus:11,GuaranteedDelivery:12,SpecialDividend:13,PriceImprovement:14,NonPriceFormingTrade:15,TradeExemptedFromTradingObligation:16,PricePending:17,PriceNotApplicable:18}),UX=Object.freeze({PercentPar:0,DealSpread:1,UpfrontPnts:2,UpfrontAmt:3,ParUpfrontAmt:4,SpreadUpfrontAmt:5,UpfrontPntsAmt:6}),kX=Object.freeze({DoNotPublishTrade:0,PublishTrade:1,DeferredPublication:2,Published:3}),qX=Object.freeze({ClearedQuantity:0,LongSideClaimedQuantity:1,ShortSideClaimedQuantity:2,LongSideRejectedQuantity:3,ShortSideRejectedQuantity:4,PendingQuantity:5,TransactionQuantity:6,RemainingQuantity:7,PreviousRemainingQuantity:8}),BX=Object.freeze({NotReported:0,OnBook:1,SISeller:2,SIBuyer:3,NonSISeller:4,SubDelegationByFirm:5,Reportable:6,NonSIBuyer:7,OffBook:8,NotReportable:9}),jX=Object.freeze({Successful:0,InvalidPartyInformation:1,UnknownInstrument:2,UnauthorizedToReportTrades:3,InvalidTradeType:4,PriceExceedsCurrentPriceBand:5,ReferencePriceNotAvailable:6,NotionalValueExceedsThreshold:7,Other:99}),GX=Object.freeze({New:0,Cancel:1,Replace:2,Release:3,Reverse:4,CancelDueToBackOutOfTrade:5}),QX=Object.freeze({Submit:0,Alleged:1,Accept:2,Decline:3,Addendum:4,No:5,TradeReportCancel:6,LockedIn:7,Defaulted:8,InvalidCMTA:9,Pended:10,AllegedNew:11,AllegedAddendum:12,AllegedNo:13,AllegedTradeReportCancel:14,AllegedTradeBreak:15,Verify:16,Dispute:17,NonMaterialUpdate:18}),VX=Object.freeze({Successful:0,InvalidOrUnknownInstrument:1,InvalidTypeOfTradeRequested:2,InvalidParties:3,InvalidTransportTypeRequested:4,InvalidDestinationRequested:5,TradeRequestTypeNotSupported:8,NotAuthorized:9,Other:99}),zX=Object.freeze({Accepted:0,Completed:1,Rejected:2}),HX=Object.freeze({AllTrades:0,MatchedTradesMatchingCriteria:1,UnmatchedTradesThatMatchCriteria:2,UnreportedTradesThatMatchCriteria:3,AdvisoriesThatMatchCriteria:4}),WX=Object.freeze({Agency:"A",VWAPGuarantee:"G",GuaranteedClose:"J",RiskTrade:"R"}),KX=Object.freeze({NumberOfUnits:0,NumberOfRoundLots:1}),YX=Object.freeze({Customer:1,CustomerProfessional:2,BrokerDealer:3,CustomerBrokerDealer:4,Principal:5,MarketMaker:6,AwayMarketMaker:7,SystematicInternaliser:8}),_X=Object.freeze({Day:"1",HalfDay:"2",Morning:"3",Afternoon:"4",Evening:"5",AfterHours:"6",Holiday:"7"}),JX=Object.freeze({PreTrading:"1",OpeningOrOpeningAuction:"2",Continuous:"3",ClosingOrClosingAuction:"4",PostTrading:"5",ScheduledIntradayAuction:"6",Quiescent:"7",AnyAuction:"8",UnscheduledIntradayAuction:"9",OutOfMainSessionTrading:"10",PrivateAuction:"11",PublicAuction:"12",GroupAuction:"13",OrderInitiatedAuction:"14"}),$X=Object.freeze({Automatic:0,Manual:1}),ZX=Object.freeze({TradingResumes:0,ChangeOfTradingSession:1,ChangeOfTradingSubsession:2,ChangeOfTradingStatus:3}),e6=Object.freeze({Electronic:1,OpenOutcry:2,TwoParty:3,Voice:4}),t6=Object.freeze({Testing:1,Simulated:2,Production:3}),d6=Object.freeze({Unknown:0,Halted:1,Open:2,Closed:3,PreOpen:4,PreClose:5,RequestRejected:6}),i6=Object.freeze({UnknownOrInvalidTradingSessionID:1,Other:99}),a6=Object.freeze({ExclusiveArrangement:0,CollateralReuse:1,CollateralArrangementType:2}),n6=Object.freeze({Success:0,InvalidParty:1,UnknownInstrument:2,UnauthorizedToSubmitXfer:3,UnknownPosition:4,Other:99}),r6=Object.freeze({Submit:0,Alleged:1}),o6=Object.freeze({InterFirmTransfer:0,IntraFirmTransfer:1,CMTA:2}),s6=Object.freeze({Received:0,RejectedByIntermediary:1,AcceptPending:2,Accepted:3,Declined:4,Cancelled:5}),c6=Object.freeze({New:0,Replace:1,Cancel:2}),p6=Object.freeze({RequestTransfer:0,AcceptTransfer:1,DeclineTransfer:2}),l6=Object.freeze({Accepted:0,Rejected:1,Received:2}),u6=Object.freeze({NoBookOrderDueToAverageSpreadPrice:0,NoBookOrderDueToRefPrice:1,NoBookOrderDueToOtherConditions:2,NoPublicPriceDueToRefPrice:3,NoPublicPriceDueToIlliquid:4,NoPublicPriceDueToOrderSize:5,DeferralDueToLargeInScale:6,DeferralDueToIlliquid:7,DeferralDueToSizeSpecific:8,NoPublicPriceDueToLargeInScale:9,NoPublicPriceSizeDueToOrderHidden:10,ExemptedDueToSecuritiesFinancingTransaction:11,ExemptedDueToESCBPolicyTransaction:12,ExceptionDueToReportByPaper:13,ExceptionDueToTradeExecutedWithNonReportingParty:14,ExceptionDueToIntraFirmOrder:15,ReportedOutsideReportingHours:16,NoPublicPxDueToPreTradeWaiver:17}),m6=Object.freeze({PreTradeTransparencyWaiver:0,PostTradeDeferral:1,ExemptFromPublication:2,OrderLevelPublicationToSubscribers:3,PriceLevelPublicationToSubscribers:4,OrderLevelPublicationToThePublic:5,PublicationInternalToExecutionVenue:6}),y6=Object.freeze({NotManuallyCaptured:"N",ManuallyCaptured:"Y"}),S6=Object.freeze({ExecutionTime:1,TimeIn:2,TimeOut:3,BrokerReceipt:4,BrokerExecution:5,DeskReceipt:6,SubmissionToClearing:7,TimePriority:8,OrderbookEntryTime:9,OrderSubmissionTime:10,PubliclyReported:11,PublicReportUpdated:12,NonPubliclyReported:13,NonPublicReportUpdated:14,SubmittedForConfirmation:15,UpdatedForConfirmation:16,Confirmed:17,UpdatedForClearing:18,Cleared:19,AllocationsSubmitted:20,AllocationsUpdated:21,AllocationsCompleted:22,SubmittedToRepository:23,PostTrdContntnEvnt:24,PostTradeValuation:25,PreviousTimePriority:26,IdentifierAssigned:27,PreviousIdentifierAssigned:28,OrderCancellationTime:29,OrderModificationTime:30,OrderRoutingTime:31,TradeCancellationTime:32,TradeModificationTime:33,ReferenceTimeForNBBO:34,Affirmed:35}),P6=Object.freeze({Accepted:0,Rejected:1,Cancelled:2,AcceptedWithErrors:3,PendingNew:4,PendingCancel:5,PendingReplace:6,Terminated:7,PendingVerification:8,DeemedVerified:9,Verified:10,Disputed:11}),g6=Object.freeze({CMTA:0,InternalTransferOrAdjustment:1,ExternalTransferOrTransferOfAccount:2,RejectForSubmittingSide:3,AdvisoryForContraSide:4,OffsetDueToAnAllocation:5,OnsetDueToAnAllocation:6,DifferentialSpread:7,ImpliedSpreadLegExecutedAgainstAnOutright:8,TransactionFromExercise:9,TransactionFromAssignment:10,ACATS:11,AI:14,B:15,K:16,LC:17,M:18,N:19,NM:20,NR:21,P:22,PA:23,PC:24,PN:25,R:26,RO:27,RT:28,SW:29,T:30,WN:31,WT:32,OffHoursTrade:33,OnHoursTrade:34,OTCQuote:35,ConvertedSWAP:36,CrossedTrade:37,InterimProtectedTrade:38,LargeInScale:39,WashTrade:40,TradeAtSettlement:41,AuctionTrade:42,TradeAtMarker:43,CreditDefault:44,CreditRestructuring:45,Merger:46,SpinOff:47,MultilateralCompression:48,Balancing:50,BasisTradeIndexClose:51,TradeAtCashOpen:52,TrdSubmitVenueClrSettl:53,BilateralCompression:54}),h6=Object.freeze({RegularTrade:0,BlockTrade:1,EFP:2,Transfer:3,LateTrade:4,TTrade:5,WeightedAveragePriceTrade:6,BunchedTrade:7,LateBunchedTrade:8,PriorReferencePriceTrade:9,AfterHoursTrade:10,ExchangeForRisk:11,ExchangeForSwap:12,ExchangeOfFuturesFor:13,ExchangeOfOptionsForOptions:14,TradingAtSettlement:15,AllOrNone:16,FuturesLargeOrderExecution:17,ExchangeOfFuturesForFutures:18,OptionInterimTrade:19,OptionCabinetTrade:20,PrivatelyNegotiatedTrades:22,SubstitutionOfFuturesForForwards:23,ErrorTrade:24,SpecialCumDividend:25,SpecialExDividend:26,SpecialCumCoupon:27,SpecialExCoupon:28,CashSettlement:29,SpecialPrice:30,GuaranteedDelivery:31,SpecialCumRights:32,SpecialExRights:33,SpecialCumCapitalRepayments:34,SpecialExCapitalRepayments:35,SpecialCumBonus:36,SpecialExBonus:37,LargeTrade:38,WorkedPrincipalTrade:39,BlockTrades:40,NameChange:41,PortfolioTransfer:42,ProrogationBuy:43,ProrogationSell:44,OptionExercise:45,DeltaNeutralTransaction:46,FinancingTransaction:47,NonStandardSettlement:48,DerivativeRelatedTransaction:49,PortfolioTrade:50,VolumeWeightedAverageTrade:51,ExchangeGrantedTrade:52,RepurchaseAgreement:53,OTC:54,ExchangeBasisFacility:55,OpeningTrade:56,NettedTrade:57,BlockSwapTrade:58,CreditEventTrade:59,SuccessionEventTrade:60,GiveUpGiveInTrade:61,DarkTrade:62,TechnicalTrade:63,Benchmark:64,PackageTrade:65,RollTrade:66,ClosingPriceTrade:67,InterFundTransferTrade:68,NetAssetValueCalculatedTrade:69}),f6=Object.freeze({Activate:"1",Modify:"2",Cancel:"3"}),I6=Object.freeze({NotTriggered:0,Triggered:1,StopOrderTriggered:2,OCOOrderTriggered:3,OTOOrderTriggered:4,OUOOrderTriggered:5}),b6=Object.freeze({Market:"1",Limit:"2"}),F6=Object.freeze({Up:"U",Down:"D"}),E6=Object.freeze({BestOffer:"1",LastTrade:"2",BestBid:"3",BestBidOrLastTrade:"4",BestOfferOrLastTrade:"5",BestMid:"6"}),v6=Object.freeze({None:"0",Local:"1",National:"2",Global:"3"}),C6=Object.freeze({ThisOrder:0,OtherOrder:1,AllOtherOrdersForGivenSecurity:2,AllOtherOrdersForGivenSecurityAndPrice:3,AllOtherOrdersForGivenSecurityAndSide:4,AllOtherOrdersForGivenSecurityPriceAndSide:5}),X6=Object.freeze({PartialExecution:"1",SpecifiedTradingSession:"2",NextAuction:"3",PriceMovement:"4",OnOrderEntryOrModification:"5"}),T6=Object.freeze({FIXED:"FIXED",DIFF:"DIFF"}),D6=Object.freeze({Divide:"D",Multiply:"M"}),R6=Object.freeze({Execution:0,PortfolioRebalancing:1,Standard:2}),N6=Object.freeze({Bond:"0",ConvertibleBond:"1",Mortgage:"2",Loan:"3"}),A6=Object.freeze({Regular:1,SpecialReference:2,OptimalValue:3,AverageValue:4}),w6=Object.freeze({TPlus1:2,TPlus3:4,TPlus4:5}),M6=Object.freeze({BillionCubicFeet:"Bcf",Allowances:"Alw",CubicMeters:"CBM",Barrels:"Bbl",Gigajoules:"GJ",BoardFeet:"BDFT",HeatRate:"kHR",Bushels:"Bu",KilowattHours:"kWh",Currency:"Ccy",MegaHeatRate:"MHR",CoolingDegreeDay:"CDD",OneMillionBTU:"MMBtu",CertifiedEmissionsReduction:"CER",MegawattHours:"MWh",CriticalPrecipDay:"CPD",Therms:"thm",ClimateReserveTonnes:"CRT",TonsOfCarbonDioxide:"tnCO2",Hundredweight:"cwt",Day:"day",DryMetricTons:"dt",EnvAllwncCert:"EnvAllwnc",EnvironmentalCredit:"EnvCrd",EnvironmentalOffset:"EnvOfst",Grams:"g",Gallons:"Gal",GrossTons:"GT",HeatingDegreeDay:"HDD",IndexPoint:"IPNT",Kilograms:"kg",Kiloliters:"kL",KilowattYear:"kW-a",KilowattDay:"kW-d",KilowattHour:"kW-h",KilowattMonth:"kW-M",KilowattMinute:"kW-min",Liters:"L",Pounds:"lbs",MegawattYear:"MW-a",MegawattDay:"MW-d",MegawattHour:"MW-h",MegawattMonth:"MW-M",MegawattMinute:"MW-min",TroyOunces:"oz_tr",PrincipalWithRelationToDebtInstrument:"PRINC",MetricTons:"t",Tons:"tn",Are:"a",Acre:"ac",Centiliter:"cL",Centimeter:"cM",DieselGallonEquivalent:"DGE",Foot:"ft",GBGallon:"Gal_gb",GasolineGallonEquivalent:"GGE",Hectare:"ha",Inch:"in",Kilometer:"kM",Meter:"M",Mile:"mi",Milliliter:"mL",Millimeter:"mM",USOunce:"oz",Piece:"pc",USPint:"pt",GBPint:"pt_gb",USQuart:"qt",GBQuart:"qt_gb",SquareCentimeter:"SqcM",SquareFoot:"Sqft",SquareInch:"Sqin",SquareKilometer:"SqkM",SquareMeter:"SqM",SquareMile:"Sqmi",SquareMillimeter:"SqmM",SquareYard:"Sqyd",Yard:"yd",MillionBarrels:"MMbbl",USDollars:"USD"}),x6=Object.freeze({MessageIsBeingSentAsAResultOfAPriorRequest:"N",MessageIsBeingSentUnsolicited:"Y"}),L6=Object.freeze({Percentage:1,FixedAmount:3}),O6=Object.freeze({Normal:"0",Flash:"1",Background:"2"}),U6=Object.freeze({LogOnUser:1,LogOffUser:2,ChangePasswordForUser:3,RequestIndividualUserStatus:4,RequestThrottleLimit:5}),k6=Object.freeze({LoggedIn:1,NotLoggedIn:2,UserNotRecognised:3,PasswordIncorrect:4,PasswordChanged:5,Other:6,ForcedUserLogoutByExchange:7,SessionShutdownWarning:8,ThrottleParametersChanged:9}),q6=Object.freeze({PremiumStyle:"EQTY",FuturesStyleMarkToMarket:"FUT",FuturesStyleWithAnAttachedCashAdjustment:"FUTDA",CDSStyleCollateralization:"CDS",CDSInDeliveryUseRecoveryRateToCalculate:"CDSD"}),B6=Object.freeze({DoNotCheck:0,Check:1,BestEffort:2}),j6=Object.freeze({PriceCheck:1,NotionalValueCheck:2,QuantityCheck:3}),G6=Object.freeze({Electronic:"E",Pit:"P",ExPit:"X",ClearingHouse:"C",RegisteredMarket:"R",OffMarket:"O",CentralLimitOrderBook:"B",QuoteDrivenMarket:"Q",DarkOrderBook:"D",AuctionDrivenMarket:"A",QuoteNegotiation:"N",VoiceNegotiation:"V",HybridMarket:"H",OtherMarket:"z"}),Q6=Object.freeze({NonElectronic:0,Electronic:1}),V6=Object.freeze({NotWorking:"N",Working:"Y"}),z6=Object.freeze({AfterTaxYield:"AFTERTAX",AnnualYield:"ANNUAL",YieldAtIssue:"ATISSUE",YieldToAverageMaturity:"AVGMATURITY",BookYield:"BOOK",YieldToNextCall:"CALL",YieldChangeSinceClose:"CHANGE",ClosingYield:"CLOSE",CompoundYield:"COMPOUND",CurrentYield:"CURRENT",GvntEquivalentYield:"GOVTEQUIV",TrueGrossYield:"GROSS",YieldWithInflationAssumption:"INFLATION",InverseFloaterBondYield:"INVERSEFLOATER",MostRecentClosingYield:"LASTCLOSE",ClosingYieldMostRecentMonth:"LASTMONTH",ClosingYieldMostRecentQuarter:"LASTQUARTER",ClosingYieldMostRecentYear:"LASTYEAR",YieldToLongestAverageLife:"LONGAVGLIFE",MarkToMarketYield:"MARK",YieldToMaturity:"MATURITY",YieldToNextRefund:"NEXTREFUND",OpenAverageYield:"OPENAVG",PreviousCloseYield:"PREVCLOSE",ProceedsYield:"PROCEEDS",YieldToNextPut:"PUT",SemiAnnualYield:"SEMIANNUAL",YieldToShortestAverageLife:"SHORTAVGLIFE",SimpleYield:"SIMPLE",TaxEquivalentYield:"TAXEQUIV",YieldToTenderDate:"TENDER",TrueYield:"TRUE",YieldValueOf32nds:"VALUE1_32",YieldToWorst:"WORST"}),So=(t,e)=>{if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);let d=[new V(O.BeginString,t.fixVersion),new V(O.MsgType,be.Heartbeat),new V(O.MsgSeqNum,t.getNextTargetMsgSeqNum()),new V(O.SenderCompID,t.sender),new V(O.TargetCompID,t.target),new V(O.SendingTime,t.getTimestamp(new Date))];return e&&d.push(e),t.createMessage(...d)},wr=(t,e,d,i=hn.GapFillMessage)=>{if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);let a=[new V(O.BeginString,t.fixVersion),new V(O.MsgType,be.SequenceReset),new V(O.MsgSeqNum,e),new V(O.SenderCompID,t.sender),new V(O.TargetCompID,t.target),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.GapFillFlag,i),new V(O.NewSeqNo,d+1)];return t.createMessage(...a)},vg=(t,e,d)=>{if(t.isLoggedIn)return t.connectionType==="acceptor"?d.getField(O.ResetSeqNumFlag)&&d.getField(O.ResetSeqNumFlag).value.toString()==="Y"&&(t.logger.log({level:"info",message:`FIXServer (${t.protocol.toUpperCase()}): -- Logon acknowledged by acceptor.`,fix:d.encode("|")}),t.messageStoreIn.setNextMsgSeqNum(1)):t.logger.log({level:"info",message:`FIXServer (${t.protocol.toUpperCase()}): -- Logon acknowledged by initiator.`,fix:d.encode("|")}),!0;let i=String(d.getField(O.BeginString)?.value),a=!0,n=!0;i&&(t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): -- FIX version set to ${i}`,fix:d.encode("|")}),t.fixVersion=i,t.fixParser&&(t.fixParser.fixVersion=i));let r=d.getField(O.TargetCompID)?.value?.toString()??t.sender,o=d.getField(O.SenderCompID)?.value?.toString()??t.target;if(r&&r!==t.sender&&(t.logger.logWarning({message:`FIXServer (${t.protocol.toUpperCase()}): -- Expected TargetCompID=${t.sender}, but got ${r}`,fix:d.encode("|")}),n=!1),o&&o!==t.target&&(t.logger.logWarning({message:`FIXServer (${t.protocol?.toUpperCase()}): -- Expected SenderCompID=${t.target}, but got ${o}`,fix:d.encode("|")}),a=!1),a&&n){if(t.connectionType==="acceptor"){let p=t.createMessage(new V(O.MsgType,be.Logon),new V(O.MsgSeqNum,d.getField(O.MsgSeqNum)?.value?.toString()),new V(O.SenderCompID,r),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.TargetCompID,o),new V(O.ResetSeqNumFlag,d.getField(O.ResetSeqNumFlag)?.value?.toString()==="Y"?On.Yes:On.No),new V(O.EncryptMethod,ds.None),new V(O.HeartBtInt,d.getField(O.HeartBtInt)?d.getField(O.HeartBtInt)?.value:t.heartBeatInterval));t.send(p),t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): >> sent Logon acknowledge`,fix:p.encode("|")})}d.getField(O.ResetSeqNumFlag)&&d.getField(O.ResetSeqNumFlag)?.value?.toString()==="Y"&&(t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): -- Logon contains ResetSeqNumFlag=Y, resetting sequence numbers to 1`,fix:d.encode("|")}),t.messageStoreIn.setNextMsgSeqNum(1),t.setNextTargetMsgSeqNum(2)),t.isLoggedIn=!0,t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): >> Logon successful by ${t.connectionType}`,fix:d.encode("|")});let c=d.getField(O.HeartBtInt)?Number(d.getField(O.HeartBtInt)?.value):t.heartBeatInterval;return t.heartBeatInterval=c,t.fixParser&&(t.fixParser.heartBeatInterval=c),t.startHeartbeat(c),!0}let s=t.createMessage(new V(O.MsgType,be.Logout),new V(O.MsgSeqNum,t.getNextTargetMsgSeqNum()),new V(O.SenderCompID,a?o:"INVALID_SENDER"),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.TargetCompID,n?r:"INVALID_TARGET"),new V(O.Text,"Invalid Logon TARGET or SENDER."));return t.isLoggedIn=!1,t.send(s),t.logger.logWarning({message:`FIXServer (${t.protocol?.toUpperCase()}): >> sent Logout due to invalid Logon`,fix:d.encode("|")}),t.stopHeartbeat(),t.close(),!1},Cg=(t,e)=>{if(t.isLoggedIn=!1,!t.requestedLogout){let d=t.createMessage(new V(O.MsgType,be.Logout),new V(O.MsgSeqNum,t.getNextTargetMsgSeqNum()),new V(O.SenderCompID,e.getField(O.SenderCompID)?e.getField(O.SenderCompID).value.toString():t.sender),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.TargetCompID,e.getField(O.TargetCompID)?e.getField(O.TargetCompID).value.toString():t.target),new V(O.Text,"Logout acknowledgement"));t.send(d),t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): >> sent Logout acknowledge`,fix:d.encode("|")})}t.stopHeartbeat(),t.close()},Xg=(t,e,d)=>{let i=d.getField(O.BeginSeqNo)?Number(d.getField(O.BeginSeqNo)?.value):void 0,a=d.getField(O.EndSeqNo)?Number(d.getField(O.EndSeqNo)?.value):void 0;if(i===void 0||a===void 0){t.logger.logWarning({message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- Ignoring ResendRequest - Invalid BeginSeqNo or EndSeqNo`});return}if(a===0&&(a=t.getNextTargetMsgSeqNum()>i?t.getNextTargetMsgSeqNum()-1:i),e.size()===0){t.logger.logWarning({message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- Message Store does not contain the messages requested by the ResendRequest. Sending SequenceReset.`}),t.send(wr(t,i,a,hn.SequenceReset)),t.setNextTargetMsgSeqNum(a+1);return}if(i>=1&&a>=i){let n=i,r=a;for(n;n<=a;n++){let o=e.getByMsgSequence(n);if(o){let s=o,c=s.getField(O.MsgType)?.value;if(c===kt.Heartbeat||c===kt.Logon||c===kt.Logout||c===kt.Reject||c===kt.ResendRequest||c===kt.SequenceReset||c===kt.TestRequest||c===kt.XMLnonFIX||c===kt.MarketDataSnapshotFullRefresh||c===kt.SecurityDefinition){if(i===a||n<a){let p=wr(t,n,n,hn.GapFillMessage);t.send(p),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> resending message with sequence ${n} (replaced administrative message)`,fix:p.encode("|")})}}else{if(s.removeFieldByTag(O.PossDupFlag),s.addField(new V(O.PossDupFlag,Eg.PossibleDuplicate)),s.getField(O.SendingTime)){let p=`${s.getField(O.SendingTime)?.value}`;s.removeFieldByTag(O.SendingTime),s.addField(new V(O.SendingTime,t.getTimestamp(new Date))),s.removeFieldByTag(O.OrigSendingTime),s.addField(new V(O.OrigSendingTime,p))}t.send(s),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> resending message with sequence ${n}`,fix:s.encode("|")})}r=n+1}else{t.send(wr(t,n,a,hn.GapFillMessage)),t.logger.logWarning({message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- Could not find message with sequence ${n}. Sending SequenceReset-GapFill from ${n} to ${a}...`}),r=a+1;break}}t.setNextTargetMsgSeqNum(r),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> sent message sequence from ${i} to ${a}`})}else t.logger.logWarning({message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- BeginSeqNo<${i}> or EndSeqNo<${a}> out of range`})},Tg=(t,e)=>{if(e.messageSequence!==t.messageStoreIn.getNextMsgSeqNum()&&e.messageType!==be.Logon&&e.messageType!==be.SequenceReset){t.logger.logWarning({message:`FIXServer (${t.protocol?.toUpperCase()}): Expected MsgSeqNum ${t.messageStoreIn.getNextMsgSeqNum()}, but got ${e.messageSequence}`,fix:e.encode("|")});let d=t.createMessage(new V(O.MsgType,be.ResendRequest),new V(O.MsgSeqNum,t.getNextTargetMsgSeqNum()),new V(O.SenderCompID,t.sender),new V(O.SendingTime,t.getTimestamp(new Date)),new V(O.TargetCompID,t.target),new V(O.BeginSeqNo,t.messageStoreIn.getNextMsgSeqNum()),new V(O.EndSeqNo,0));return t.logger.log({level:"info",message:`FIXServer (${t.protocol?.toUpperCase()}): Sending ResendRequest from ${t.messageStoreIn.getNextMsgSeqNum()} to 0`,fix:d.encode("|")}),t.send(d),!1}return!0},Dg=(t,e)=>{let d=e.getField(O.NewSeqNo)?.value;d&&Number.isFinite(d)&&(t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): -- SequenceReset: new sequence number ${d}`,fix:e.encode("|")}),t.messageStoreIn.setNextMsgSeqNum(Number(d)-1))},Rg=(t,e)=>{let d=So(t),i=e.getField(O.TestReqID)?.value??null;if(i!==null&&i!==""){let a=new V(O.TestReqID,i);d=So(t,a),t.send(d),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> responded to TestRequest with Heartbeat<TestReqID=${i}>`,fix:d.encode("|")})}else t.send(d),t.logger.log({level:"info",message:`${t.parserName} (${t.protocol?.toUpperCase()}): >> responded to TestRequest with Heartbeat`,fix:d.encode("|")})},Mr=(t,e)=>{Tg(t,e),t.logger.log({level:"info",message:`FIXParser (${t.protocol?.toUpperCase()}): << received ${e.description}`,fix:e.encode("|")}),t.restartHeartbeat(),e.messageType===be.SequenceReset?Dg(t,e):e.messageType===be.TestRequest?Rg(t,e):e.messageType===be.Logon?vg(t,t.messageStoreOut,e):e.messageType===be.Logout?Cg(t,e):e.messageType===be.ResendRequest&&Xg(t,t.messageStoreOut,e),t.messageStoreIn.setNextMsgSeqNum(t.messageStoreIn.getNextMsgSeqNum()+1)},xc=class extends Ng{data;constructor(t){super(t),this.data=""}_transform(t,e,d){let i=(String(this.data)+t).split(/(8=.+?\x0110=\d\d\d\x01)/gs),a=0;for(a;a<i.length-1;a++)this.push(i[a]);this.data=i[i.length-1],d()}destroy(t){return this.data=void 0,super.destroy(t)}},vu=class{static version=yg;parserName="FIXParser";fixParserBase=new Ig;heartBeatIntervalId=void 0;socket=void 0;connected=!1;host;port;protocol="tcp";sender=void 0;target=void 0;heartBeatInterval=Xc;fixVersion=xa;messageStoreIn=new Ka;messageStoreOut=new Ka;requestedLogout=!1;connectionType="initiator";logger=new Mc;logging=!0;logOptions;proxy;tlsOptions;tlsSkipStdInPipe;tlsTimeout;tlsEncoding=Dc;onMessageCallbacks=[];onOpenCallbacks=[];onErrorCallbacks=[];onCloseCallbacks=[];onReadyCallbacks=[];constructor(t={logging:!0,logOptions:void 0,fixVersion:xa,skipValidation:!1,plugins:[]}){if(this.logging=t.logging??!0,this.logOptions=t.logOptions,this.fixParserBase.fixVersion=ba(t.fixVersion),this.fixVersion=this.fixParserBase.fixVersion,this.fixParserBase.skipValidation=t.skipValidation,t.plugins)for(let e of t.plugins)e.register(this)}addOnMessageCallback(t){this.onMessageCallbacks.push(t)}addOnOpenCallback(t){this.onOpenCallbacks.push(t)}addOnErrorCallback(t){this.onErrorCallbacks.push(t)}addOnCloseCallback(t){this.onCloseCallbacks.push(t)}addOnReadyCallback(t){this.onReadyCallbacks.push(t)}triggerOnMessage(t){for(let e of this.onMessageCallbacks)e?.(t)}triggerOnOpen(){for(let t of this.onOpenCallbacks)t?.()}triggerOnError(t){for(let e of this.onErrorCallbacks)e?.(t)}triggerOnClose(){for(let t of this.onCloseCallbacks)t?.()}triggerOnReady(){for(let t of this.onReadyCallbacks)t?.()}onMessageCallback=()=>{};onOpenCallback=()=>{};onErrorCallback=()=>{};onCloseCallback=()=>{};onReadyCallback=()=>{};connect(t={}){let{host:e="localhost",port:d=9878,protocol:i="tcp",sender:a="SENDER",target:n="TARGET",heartbeatIntervalSeconds:r=Xc,fixVersion:o=this.fixVersion,messageStoreIn:s=new Ka,messageStoreOut:c=new Ka,tlsOptions:p={},tlsSkipStdInPipe:u=!1,tlsTimeout:m=Tc,tlsEncoding:S=Dc,proxy:g=void 0,onMessage:y=this.onMessageCallback,onOpen:P=this.onOpenCallback,onError:f=this.onErrorCallback,onClose:E=this.onCloseCallback,onReady:v=this.onReadyCallback}=t;if(this.logger=new Mc(this.logOptions?{name:this.logOptions.name??"fixparser",...this.logOptions}:{name:"fixparser",format:"json"}),this.logging||(this.logger.silent=!0),Me.setLogger(this.logger),!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);switch(this.connectionType="initiator",this.fixVersion=ba(o),this.fixParserBase.fixVersion=ba(o),this.messageStoreIn=s,this.messageStoreOut=c,this.protocol=i,this.sender=a,this.target=n,this.port=d,this.host=e,this.proxy=g,p&&(this.tlsOptions=p),u&&(this.tlsSkipStdInPipe=u),m&&(this.tlsTimeout=m),S&&(this.tlsEncoding=S),this.heartBeatInterval=r,this.onMessageCallback=y,this.onOpenCallback=P,this.onErrorCallback=f,this.onCloseCallback=E,this.onReadyCallback=v,i){case"tcp":this.connectTcp();break;case"ssl-tcp":case"tls-tcp":this.connectTlsTcp();break;case"websocket":this.connectWebsocket();break;default:throw new Error(`Unsupported protocol: ${i}`)}}connectTcp(){this.socket=new _u,this.socket.setEncoding(this.tlsEncoding),this.socket.pipe(new xc).on("data",t=>{let e=this.parse(t.toString()),d=0;for(d;d<e.length;d++)Mr(this,e[d]),this.messageStoreIn.add(e[d]),this.onMessageCallback?.(e[d]),this.triggerOnMessage(e[d])}),this.socket.connect(Number(this.port),String(this.host),()=>{this.connected=!0,this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connected to ${this.host}:${this.port}`}),this.onOpenCallback?.(),this.triggerOnOpen()}),this.socket.on("close",()=>{this.connected=!1,this.onCloseCallback?.(),this.triggerOnClose(),this.stopHeartbeat()}),this.socket.on("ready",()=>{setTimeout(()=>{this.onReadyCallback?.(),this.triggerOnReady()},Rc)}),this.socket.on("timeout",()=>{this.connected=!1;let t=this.socket;this.onCloseCallback?.(),this.triggerOnClose(),t.end(),this.stopHeartbeat()}),this.socket.on("error",t=>{this.connected=!1,this.onErrorCallback?.(t),this.triggerOnError(t),this.stopHeartbeat()})}connectTlsTcp(){this.tlsOptions||(this.tlsOptions={}),this.tlsOptions.host||(this.tlsOptions.host=this.host),this.tlsOptions.port||(this.tlsOptions.port=this.port);let t=Number(this.tlsOptions.port),e=String(this.tlsOptions.host);try{let d=Ju(t,e,this.tlsOptions,()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connected to ${e}:${t} via TLS.`}),this.tlsSkipStdInPipe||(process.stdin.pipe(d),process.stdin.resume()),this.addTcpListeners(d),this.connected=!0,this.onOpenCallback?.(),this.triggerOnOpen()});this.socket=d,d.setEncoding(this.tlsEncoding),d.setTimeout(this.tlsTimeout??Tc),this.addTlsListener(d)}catch(d){d instanceof Error?this.logger.logError({level:"error",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Client connection to ${this.host}:${this.port} failed with error: ${d.message}.`}):this.logger.logError({level:"error",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Client connection to ${this.host}:${this.port} failed with unspecified error.`}),this.connected=!1;return}}addTcpListeners(t){let e=new xc;e.setEncoding(this.tlsEncoding),t.on("ready",()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connection ready to ${this.host}:${this.port}.`})}),t.pipe(e).on("data",d=>{try{let i=this.parse(d);for(let a of i)Mr(this,a),this.messageStoreIn.add(a),this.onMessageCallback?.(a),this.triggerOnMessage(a)}catch(i){this.logger.logError({level:"warn",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Failed to parse/process incoming data \u2014 ${i.message}`})}}),t.on("end",()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Server closed the connection (END). ${this.host}:${this.port}.`}),this.disconnectTlsTcp(t)}),t.on("close",d=>{this.logger.log({level:d?"error":"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connection closed: ${this.host}:${this.port}. HadError? '${d}`}),this.disconnectTlsTcp(t)}),t.on("timeout",()=>{this.logger.logError({level:"warn",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connection timeout for ${this.host}:${this.port}.`}),this.disconnectTlsTcp(t)}),t.on("error",d=>{this.logger.logError({level:"error",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connection error for ${this.host}:${this.port}. error: ${d.message}`}),this.onErrorCallback?.(d),this.triggerOnError(d),this.disconnectTlsTcp(t)})}addTlsListener(t){t.on("secureConnect",()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- TLS handshake completed to ${this.host}:${this.port}.`}),this.onReadyCallback?.(),this.triggerOnReady()})}disconnectTlsTcp(t){t?(this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Disconnected from ${this.host}:${this.port}.`}),this.connected=!1,t.removeAllListeners(),t.destroy(),this.onCloseCallback?.(),this.triggerOnClose(),this.stopHeartbeat(),this.socket=void 0):this.logger.logError({level:"error",message:`FIXParser (${this.protocol?.toUpperCase()}): -- No active connection to disconnect.`})}connectWebsocket(){let t=String(this.host).indexOf("ws://")===-1&&String(this.host).indexOf("wss://")===-1?`ws://${String(this.host)}:${Number(this.port)}`:`${String(this.host)}:${Number(this.port)}`;this.proxy?this.socket=new Jd.default(t,{agent:this.proxy}):this.socket=new Jd.default(t),this.socket.on("message",e=>{let d=this.parse(e.toString()),i=0;for(i;i<d.length;i++)Mr(this,d[i]),this.messageStoreIn.add(d[i]),this.onMessageCallback?.(d[i]),this.triggerOnMessage(d[i])}),this.socket.on("open",()=>{this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Connected to ${this.host}:${this.port}`}),this.connected=!0,this.onOpenCallback?.(),this.triggerOnOpen()}),this.socket.on("close",()=>{this.connected=!1,this.onCloseCallback?.(),this.triggerOnClose(),this.stopHeartbeat()}),this.socket.readyState===(Jd.default.OPEN||Jd.default.CLOSED||Jd.default.CLOSING||Jd.default.CONNECTING)&&setTimeout(()=>{this.onReadyCallback?.(),this.triggerOnReady()},Rc)}getNextTargetMsgSeqNum(){return this.messageStoreOut.getNextMsgSeqNum()}setNextTargetMsgSeqNum(t){return this.messageStoreOut.setNextMsgSeqNum(t)}getNextSenderMsgSeqNum(){return this.messageStoreIn.getNextMsgSeqNum()}setNextSenderMsgSeqNum(t){return this.messageStoreIn.setNextMsgSeqNum(t)}getTimestamp(t=new Date){return mg(t,this.logger)}createMessage(...t){let e=new Fu(this.fixVersion,...t);return e.messageSequence=this.getNextTargetMsgSeqNum(),e}parse(t){if(!Me.validateFreeLicense())throw new Error(Me.ERROR_MESSAGE_NO_FREE_LICENSE);return this.fixParserBase.parse(t)}send(t){if(!Me.validateLicense())throw new Error(Me.ERROR_MESSAGE_NO_LICENSE);let e=t.getField(O.MsgType);e&&e.value===be.Logout&&(this.requestedLogout=!0);let d=t.encode();this.protocol==="tcp"&&this.connected?(this.setNextTargetMsgSeqNum(this.getNextTargetMsgSeqNum()+1),this.socket.write(d),this.messageStoreOut.add(t.clone()),this.restartHeartbeat(),this.logger.log({level:"info",message:`FIXParser (${this.protocol.toUpperCase()}): >> sent`,fix:d.replace(/\x01/g,"|")})):this.protocol==="websocket"&&this.socket.readyState===Jd.default.OPEN?(this.setNextTargetMsgSeqNum(this.getNextTargetMsgSeqNum()+1),this.socket.send(d),this.messageStoreOut.add(t.clone()),this.restartHeartbeat(),this.logger.log({level:"info",message:`FIXParser (${this.protocol.toUpperCase()}): >> sent`,fix:d.replace(/\x01/g,"|")})):(this.protocol==="ssl-tcp"||this.protocol==="tls-tcp")&&this.connected?(this.setNextTargetMsgSeqNum(this.getNextTargetMsgSeqNum()+1),this.socket.write(d),this.messageStoreOut.add(t.clone()),this.restartHeartbeat(),this.logger.log({level:"info",message:`FIXParser (${this.protocol.toUpperCase()}): >> sent`,fix:d.replace(/\x01/g,"|")})):this.logger.logError({message:`FIXParser (${this.protocol?.toUpperCase()}): -- Could not send message, no connection`,fix:d.replace(/\x01/g,"|")})}isConnected(){return this.connected}close(){if(this.protocol==="tcp"){let t=this.socket;t?(t.destroy(),this.connected=!1):this.logger.logError({message:`FIXParser (${this.protocol.toUpperCase()}): -- Could not close socket, connection not open`})}else if(this.protocol==="websocket"){let t=this.socket;if(t){try{t.close()}catch(e){this.logger.logError({message:`FIXParser (${this.protocol.toUpperCase()}): -- Could not close socket,`,error:e})}this.connected=!1}else this.logger.logError({message:`FIXParser (${this.protocol.toUpperCase()}): -- Could not close socket, connection not open`})}else if(this.protocol==="ssl-tcp"||this.protocol==="tls-tcp"){let t=this.socket;t?(t.destroy(),this.connected=!1):this.logger.logError({message:`FIXParser (${this.protocol.toUpperCase()}): -- Could not close socket, connection not open`})}}stopHeartbeat(){clearInterval(this.heartBeatIntervalId)}restartHeartbeat(){this.stopHeartbeat(),this.startHeartbeat(this.heartBeatInterval,!0)}startHeartbeat(t=this.heartBeatInterval,e){this.stopHeartbeat(),e||this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): -- Heartbeat configured to ${t} seconds`}),this.heartBeatInterval=t,this.heartBeatIntervalId=setInterval(()=>{let d=So(this);this.send(d);let i=d.encode();this.logger.log({level:"info",message:`FIXParser (${this.protocol?.toUpperCase()}): >> sent Heartbeat`,fix:i.replace(/\x01/g,"|")})},this.heartBeatInterval*1e3)}};var Cu=class{format;useStderr;constructor({format:t="json",useStderr:e=!1}){this.format=t,this.useStderr=e}configure(t){this.format=t.format||"json",t.useStderr!==void 0&&(this.useStderr=t.useStderr)}async send(t){let e=this.useStderr?console.error:console.log;if(this.format==="json")e(JSON.stringify(t));else if(this.format==="jsonrpc"){let{message:d,...i}=t,a={jsonrpc:"2.0",method:t.level,params:{message:d,...i}};e(JSON.stringify(a))}else{let{name:d,id:i,message:a,level:n,...r}=t,o=Object.entries(r).map(([c,p])=>`${c}: ${p}`),s="";d&&(s+=`${d} `),s+=`${i}: ${a}`,e(s,o.join(", "))}}async flush(){}async close(){}status(){return"connected"}};import{randomUUID as kg}from"node:crypto";import{createServer as qg}from"node:http";import{McpServer as Bg}from"@modelcontextprotocol/sdk/server/mcp.js";import{StreamableHTTPServerTransport as jg}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{isInitializeRequest as Gg}from"@modelcontextprotocol/sdk/types.js";import{z as bt}from"zod";var dr=class{logger;parser;onReady=void 0;verifiedOrders=new Map;pendingRequests=new Map;marketDataPrices=new Map;MAX_PRICE_HISTORY=1e5;constructor({logger:e,onReady:d}){this.logger=e,this.onReady=d}};var Xu={parse:{description:"Parses a FIX message and describes it in plain language",schema:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},parseToJSON:{description:"Parses a FIX message into JSON",schema:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},verifyOrder:{description:"Verifies order parameters before execution. verifyOrder must be called before executeOrder.",schema:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"],description:"Handling Instructions: 1=Automated Execution No Intervention, 2=Automated Execution Intervention OK, 3=Manual Order"},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"],description:"Order Type: 1=Market, 2=Limit, 3=Stop, 4=StopLimit, 5=MarketOnClose, 6=WithOrWithout, 7=LimitOrBetter, 8=LimitWithOrWithout, 9=OnBasis, A=OnClose, B=LimitOnClose, C=ForexMarket, D=PreviouslyQuoted, E=PreviouslyIndicated, F=ForexLimit, G=ForexSwap, H=ForexPreviouslyQuoted, I=Funari, J=MarketIfTouched, K=MarketWithLeftOverAsLimit, L=PreviousFundValuationPoint, M=NextFundValuationPoint, P=Pegged, Q=CounterOrderSelection, R=StopOnBidOrOffer, S=StopLimitOnBidOrOffer"},side:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"],description:"Side: 1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed"},symbol:{type:"string"},timeInForce:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C"],description:"Time In Force: 0=Day, 1=GoodTillCancel, 2=AtTheOpening, 3=ImmediateOrCancel, 4=FillOrKill, 5=GoodTillCrossing, 6=GoodTillDate, 7=AtTheClose, 8=GoodThroughCrossing, 9=AtCrossing, A=GoodForTime, B=GoodForAuction, C=GoodForMonth"}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},executeOrder:{description:"Executes a verified order. verifyOrder must be called before executeOrder.",schema:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"],description:"Handling Instructions: 1=Automated Execution No Intervention, 2=Automated Execution Intervention OK, 3=Manual Order"},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"],description:"Order Type: 1=Market, 2=Limit, 3=Stop, 4=StopLimit, 5=MarketOnClose, 6=WithOrWithout, 7=LimitOrBetter, 8=LimitWithOrWithout, 9=OnBasis, A=OnClose, B=LimitOnClose, C=ForexMarket, D=PreviouslyQuoted, E=PreviouslyIndicated, F=ForexLimit, G=ForexSwap, H=ForexPreviouslyQuoted, I=Funari, J=MarketIfTouched, K=MarketWithLeftOverAsLimit, L=PreviousFundValuationPoint, M=NextFundValuationPoint, P=Pegged, Q=CounterOrderSelection, R=StopOnBidOrOffer, S=StopLimitOnBidOrOffer"},side:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"],description:"Side: 1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed"},symbol:{type:"string"},timeInForce:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C"],description:"Time In Force: 0=Day, 1=GoodTillCancel, 2=AtTheOpening, 3=ImmediateOrCancel, 4=FillOrKill, 5=GoodTillCrossing, 6=GoodTillDate, 7=AtTheClose, 8=GoodThroughCrossing, 9=AtCrossing, A=GoodForTime, B=GoodForAuction, C=GoodForMonth"}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},marketDataRequest:{description:"Requests market data for specified symbols",schema:{type:"object",properties:{mdUpdateType:{type:"string",enum:["0","1"],description:"Market Data Update Type: 0=Full Refresh, 1=Incremental Refresh"},symbols:{type:"array",items:{type:"string"}},mdReqID:{type:"string"},subscriptionRequestType:{type:"string",enum:["0","1","2"],description:"Subscription Request Type: 0=Snapshot, 1=Snapshot + Updates, 2=Disable Previous Snapshot + Update Request"},mdEntryTypes:{type:"array",items:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},description:"Market Data Entry Types: 0=Bid, 1=Offer, 2=Trade, 3=Index Value, 4=Opening Price, 5=Closing Price, 6=Settlement Price, 7=High Price, 8=Low Price, 9=Trade Volume, A=Open Interest, B=Simulated Sell Price, C=Simulated Buy Price, D=Empty Book, E=Session High Bid, F=Session Low Offer, G=Fixing Price, H=Electronic Volume, I=Threshold Limits and Price Band Variation, J=Clearing Price, K=Open Interest Change, L=Last Trade Price, M=Last Trade Volume, N=Last Trade Time, O=Last Trade Tick, P=Last Trade Exchange, Q=Last Trade ID, R=Last Trade Side, S=Last Trade Price Change, T=Last Trade Price Change Percent, U=Last Trade Price Change Basis Points, V=Last Trade Price Change Points, W=Last Trade Price Change Ticks, X=Last Trade Price Change Ticks Percent, Y=Last Trade Price Change Ticks Basis Points, Z=Last Trade Price Change Ticks Points"}},required:["mdUpdateType","symbols","mdReqID","subscriptionRequestType"]}},getStockGraph:{description:"Generates a price chart for a given symbol",schema:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}},getStockPriceHistory:{description:"Returns price history for a given symbol",schema:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}},technicalAnalysis:{description:"Performs comprehensive technical analysis on market data for a given symbol, including indicators like SMA, EMA, RSI, Bollinger Bands, and trading signals",schema:{type:"object",properties:{symbol:{type:"string",description:"The trading symbol to analyze (e.g., AAPL, MSFT, EURUSD)"}},required:["symbol"]}}};var Zt=class{static calculateRSI(e,d=14){if(e.length<d+1)return[];let i=[];for(let c=1;c<e.length;c++)i.push(e[c]-e[c-1]);let a=i.map(c=>c>0?c:0),n=i.map(c=>c<0?Math.abs(c):0),r=a.slice(0,d).reduce((c,p)=>c+p,0)/d,o=n.slice(0,d).reduce((c,p)=>c+p,0)/d,s=[];for(let c=d;c<i.length;c++){let p=r/o;s.push(100-100/(1+p)),r=(r*(d-1)+a[c])/d,o=(o*(d-1)+n[c])/d}return s}static calculateStochastic(e,d,i){let a=[];if(e.length<14)return[];let s=[];for(let p=13;p<e.length;p++){let u=Math.max(...d.slice(p-14+1,p+1)),m=Math.min(...i.slice(p-14+1,p+1)),g=(e[p]-m)/(u-m)*100;s.push(g)}let c=[];for(let p=2;p<s.length;p++){let u=s.slice(p-3+1,p+1).reduce((m,S)=>m+S,0);c.push(u/3)}for(let p=2;p<c.length;p++){let m=c.slice(p-3+1,p+1).reduce((S,g)=>S+g,0)/3;a.push({k:c[p],d:m})}return a}static calculateCCI(e,d,i){let a=[];if(e.length<20)return[];for(let r=19;r<e.length;r++){let s=e.slice(r-20+1,r+1).map((S,g)=>{let y=d[r-20+1+g]||S,P=i[r-20+1+g]||S;return(y+P+S)/3}),c=s.reduce((S,g)=>S+g,0)/20,p=s.reduce((S,g)=>S+Math.abs(g-c),0)/20,u=(d[r]+i[r]+e[r])/3,m=p!==0?(u-c)/(.015*p):0;a.push(m)}return a}static calculateROC(e){let d=[];for(let i=10;i<e.length;i++)d.push((e[i]-e[i-10])/e[i-10]*100);return d}static calculateWilliamsR(e){let d=[];if(e.length<14)return[];for(let a=13;a<e.length;a++){let n=e.slice(a-14+1,a+1),r=Math.max(...n),o=Math.min(...n),s=e[a],c=(r-s)/(r-o)*-100;d.push(c)}return d}static calculateMomentum(e){let d=[];for(let i=10;i<e.length;i++)d.push(e[i]-e[i-10]);return d}};var Ne=class{static calculateSMA(e,d){let i=[];for(let a=d-1;a<e.length;a++){let n=e.slice(a-d+1,a+1).reduce((r,o)=>r+o,0);i.push(n/d)}return i}static calculateEMA(e,d){let i=2/(d+1),a=[e[0]];for(let n=1;n<e.length;n++)a.push(e[n]*i+a[n-1]*(1-i));return a}static calculateWMA(e,d){let i=[],a=Array.from({length:d},(r,o)=>o+1),n=a.reduce((r,o)=>r+o,0);for(let r=d-1;r<e.length;r++){let o=0;for(let s=0;s<d;s++)o+=e[r-s]*a[s];i.push(o/n)}return i}static calculateVWMA(e,d,i){let a=[];for(let n=i-1;n<e.length;n++){let r=0,o=0;for(let s=0;s<i;s++){let c=d[n-s]||1;r+=c,o+=e[n-s]*c}a.push(o/r)}return a}};var Lt=class t{static calculateBlackScholes(e,d,i){let a=e,n=d,r=1,o=.05,s=i*.01,c=(Math.log(a/n)+(o+s*s/2)*r)/(s*Math.sqrt(r)),p=c-s*Math.sqrt(r),u=a*t.normalCDF(c)-n*Math.exp(-o*r)*t.normalCDF(p),m=n*Math.exp(-o*r)*t.normalCDF(-p)-a*t.normalCDF(-c);return{callPrice:u,putPrice:m,delta:t.normalCDF(c),gamma:t.normalPDF(c)/(a*s*Math.sqrt(r)),theta:-a*t.normalPDF(c)*s/(2*Math.sqrt(r))-o*n*Math.exp(-o*r)*t.normalCDF(p),vega:a*Math.sqrt(r)*t.normalPDF(c),rho:n*r*Math.exp(-o*r)*t.normalCDF(p)}}static calculateBinomialTree(e,d,i=1,a=.05,n=.2,r=100){let o=i/r,s=Math.exp(n*Math.sqrt(o)),c=1/s,p=(Math.exp(a*o)-c)/(s-c),u=[];for(let D=0;D<=r;D++){u[D]=[];for(let h=0;h<=D;h++)u[D][h]=e*s**h*c**(D-h)}let m=[];m[r]=[];for(let D=0;D<=r;D++){let h=Math.max(0,u[r][D]-d);m[r][D]=h}let S=[];S[r]=[];for(let D=0;D<=r;D++){let h=Math.max(0,d-u[r][D]);S[r][D]=h}for(let D=r-1;D>=0;D--){m[D]=[];for(let h=0;h<=D;h++){let X=m[D+1][h+1],b=m[D+1][h],T=Math.exp(-a*o)*(p*X+(1-p)*b);m[D][h]=Math.max(T,u[D][h]-d)}}for(let D=r-1;D>=0;D--){S[D]=[];for(let h=0;h<=D;h++){let X=S[D+1][h+1],b=S[D+1][h],T=Math.exp(-a*o)*(p*X+(1-p)*b);S[D][h]=Math.max(T,d-u[D][h])}}let g=m[0][0],y=S[0][0],P=(m[1][1]-m[1][0])/(u[1][1]-u[1][0]),f=((m[1][1]-m[1][0])/(u[1][1]-u[1][0])-(m[1][0]-m[1][0])/(u[1][0]-u[1][0]))/(u[1][1]-u[1][0]),E=(m[1][0]-m[0][0])/o,v=(g-g*1.01)/(n*.01),F=(g-g*1.01)/(a*.01);return{callPrice:g,putPrice:y,delta:P,gamma:f,theta:E,vega:v,rho:F}}static calculateTrinomialTree(e,d,i=1,a=.05,n=.2,r=50){let o=i/r,s=n*Math.sqrt(3*o),c=Math.exp(s),p=.5*((a-.5*n*n)*o/s+n*n*o/(s*s)),u=.5*((a-.5*n*n)*o/s-n*n*o/(s*s)),m=1-p-u,S=[];for(let X=0;X<=r;X++){S[X]=[];for(let b=0;b<=2*X+1;b++){let T=b-X;S[X][b]=e*c**T}}let g=[];g[r]=[];for(let X=0;X<=2*r;X++){let b=Math.max(0,S[r][X]-d);g[r][X]=b}let y=[];y[r]=[];for(let X=0;X<=2*r;X++){let b=Math.max(0,d-S[r][X]);y[r][X]=b}for(let X=r-1;X>=0;X--){g[X]=[];for(let b=0;b<=2*X;b++){let T=g[X+1][b+2],C=g[X+1][b+1],R=g[X+1][b],M=Math.exp(-a*o)*(p*T+m*C+u*R);g[X][b]=Math.max(M,S[X][b]-d)}}for(let X=r-1;X>=0;X--){y[X]=[];for(let b=0;b<=2*X;b++){let T=y[X+1][b+2],C=y[X+1][b+1],R=y[X+1][b],M=Math.exp(-a*o)*(p*T+m*C+u*R);y[X][b]=Math.max(M,d-S[X][b])}}let P=g[0][0],f=y[0][0],E=(g[1][2]-g[1][0])/(S[1][2]-S[1][0]),v=((g[1][2]-g[1][1])/(S[1][2]-S[1][1])-(g[1][1]-g[1][0])/(S[1][1]-S[1][0]))/(S[1][2]-S[1][0]),F=(g[1][1]-g[0][0])/o,D=(P-P*1.01)/(n*.01),h=(P-P*1.01)/(a*.01);return{callPrice:P,putPrice:f,delta:E,gamma:v,theta:F,vega:D,rho:h}}static calculateMonteCarlo(e,d,i=1,a=.05,n=.2,r=1e4){let o=0,s=0,c=0,p=0;for(let D=0;D<r;D++){let h=t.boxMuller(),X=e*Math.exp((a-.5*n*n)*i+n*Math.sqrt(i)*h),b=Math.max(0,X-d),T=Math.max(0,d-X);o+=b,s+=T,X>d&&(c+=1,p+=0)}let u=Math.exp(-a*i),m=o/r*u,S=s/r*u,g=c/r*u,y=p/r*u,P=-(m*a),f=(m-m*1.01)/(n*.01),E=(m-m*1.01)/(a*.01),v=Math.sqrt(m*(1-m)/r),F={lower:m-1.96*v,upper:m+1.96*v};return{callPrice:m,putPrice:S,delta:g,gamma:y,theta:P,vega:f,rho:E,confidenceInterval:F}}static calculateHestonModel(e,d,i=1,a=.05,n=.2,r=.2,o=2,s=.3,c=-.5){let p=e*.6-d*Math.exp(-a*i)*.4,u=p-e+d*Math.exp(-a*i),m=Math.sqrt(2*Math.PI/i)*(p/e)*(1+.5*(p/e)),S=.6,g=.01/e,y=-(p*a),P=p*Math.sqrt(i),f=d*i*Math.exp(-a*i)*.4;return{callPrice:p,putPrice:u,impliedVolatility:m,delta:S,gamma:g,theta:y,vega:P,rho:f}}static calculateSABRModel(e,d,i=1,a=.05,n=.2,r=.5,o=-.5,s=.3){let c=e,p=d,u=i,m=s/n*Math.log(c/p),S=Math.log((Math.sqrt(1-2*o*m+m*m)+m-o)/(1-o)),g;Math.abs(c-p)<1e-8?g=n/c**(1-r)*(1+((1-r)**2/24*n**2/c**(2-2*r)+o*r*n*s/(4*c**(1-r))+(2-3*o**2)*s**2/24)*u):g=n/(c*p)**((1-r)/2)*(1+((1-r)**2/24*n**2/(c*p)**(1-r)+o*r*n*s/(4*(c*p)**((1-r)/2))+(2-3*o**2)*s**2/24)*u)*m/S;let y=(Math.log(c/p)+(a+g*g/2)*u)/(g*Math.sqrt(u)),P=y-g*Math.sqrt(u),f=c*t.normalCDF(y)-p*Math.exp(-a*u)*t.normalCDF(P),E=p*Math.exp(-a*u)*t.normalCDF(-P)-c*t.normalCDF(-y),v=t.normalCDF(y),F=t.normalPDF(y)/(c*g*Math.sqrt(u)),D=-c*t.normalPDF(y)*g/(2*Math.sqrt(u))-a*p*Math.exp(-a*u)*t.normalCDF(P),h=c*Math.sqrt(u)*t.normalPDF(y),X=p*u*Math.exp(-a*u)*t.normalCDF(P);return{callPrice:f,putPrice:E,impliedVolatility:g,delta:v,gamma:F,theta:D,vega:h,rho:X}}static calculateVarianceGamma(e,d,i=1,a=.05,n=.2,r=-.1,o=.3){let s=e,c=d,p=i,u=a,m=s*.55-c*Math.exp(-u*p)*.45,S=m-s+c*Math.exp(-u*p),g=Math.sqrt(2*Math.PI/p)*(m/s)*(1+.5*(m/s)),y=.55,P=.01/s,f=-(m*u),E=m*Math.sqrt(p),v=c*p*Math.exp(-u*p)*.45;return{callPrice:m,putPrice:S,impliedVolatility:g,delta:y,gamma:P,theta:f,vega:E,rho:v}}static normalCDF(e){return .5*(1+t.erf(e/Math.sqrt(2)))}static normalPDF(e){return Math.exp(-e*e/2)/Math.sqrt(2*Math.PI)}static erf(e){let d=.254829592,i=-.284496736,a=1.421413741,n=-1.453152027,r=1.061405429,o=.3275911,s=e>=0?1:-1,c=Math.abs(e),p=1/(1+o*c),u=1-((((r*p+n)*p+a)*p+i)*p+d)*p*Math.exp(-c*c);return s*u}static boxMuller(){let e=Math.random(),d=Math.random();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*d)}};var bd=class{static calculateMaxDrawdown(e){let d=e[0],i=0;for(let a=1;a<e.length;a++){e[a]>d&&(d=e[a]);let n=(d-e[a])/d;n>i&&(i=n)}return i}static calculateMaxConsecutiveLosses(e){let d=0,i=0;for(let a=1;a<e.length;a++)e[a]<e[a-1]?(i++,d=Math.max(d,i)):i=0;return d}static calculateWinRate(e){let d=0,i=0;for(let a=1;a<e.length;a++)e[a]!==e[a-1]&&(i++,e[a]>e[a-1]&&d++);return i>0?d/i:0}static calculateProfitFactor(e){let d=0,i=0;for(let a=1;a<e.length;a++){let n=e[a]-e[a-1];n>0?d+=n:i+=Math.abs(n)}return i>0?d/i:0}static calculateSharpeRatio(e,d=.02){if(e.length===0)return 0;let i=e.reduce((o,s)=>o+s,0)/e.length,a=i-d,n=e.reduce((o,s)=>o+(s-i)**2,0)/e.length,r=Math.sqrt(n);return r>0?a/r:0}static calculateSortinoRatio(e,d=.02){if(e.length===0)return 0;let i=e.reduce((s,c)=>s+c,0)/e.length,a=i-d,r=e.filter(s=>s<i).reduce((s,c)=>s+(c-i)**2,0)/e.length,o=Math.sqrt(r);return o>0?a/o:0}static calculateCalmarRatio(e,d){return d===0?0:e.reduce((a,n)=>a+n,0)/e.length/d}static calculatePositionSize(e,d){let i=Math.abs(e-d);return i>0?100/i:1}static calculateConfidence(e){return Math.min(e.length*10,100)}static calculateRiskLevel(e){return e<20?"LOW":e<40?"MEDIUM":"HIGH"}};var da=class t{static generateSignals(e,d,i,a,n,r,o,s,c){let p=0,u=0,m=[];e>d?(m.push(`\u2713 BULLISH: Price above VWAP (+${((e-d)/d*100).toFixed(2)}%)`),p++):(m.push(`\u2717 BEARISH: Price below VWAP (${((e-d)/d*100).toFixed(2)}%)`),u++),i>0&&a>0?(m.push("\u2713 BULLISH: Positive momentum on both timeframes"),p++):i<0&&a<0?(m.push("\u2717 BEARISH: Negative momentum on both timeframes"),u++):m.push("\u25D0 MIXED: Conflicting momentum signals");let S=r/o;return S>1.2&&n>0?(m.push("\u2713 BULLISH: Above-average volume supporting upward move"),p++):S>1.2&&n<0?(m.push("\u2717 BEARISH: Above-average volume supporting downward move"),u++):m.push("\u25D0 NEUTRAL: Volume not providing clear direction"),s>65&&c>30?(m.push("\u2717 BEARISH: High in range with elevated volatility - reversal risk"),u++):s<35&&c>30?(m.push("\u2713 BULLISH: Low in range with volatility - potential bounce"),p++):m.push("\u25D0 NEUTRAL: Price position and volatility not extreme"),{bullishSignals:p,bearishSignals:u,signals:m}}static calculateOverallSignal(e,d,i,a){let n=e-d,r=n>0?"BULLISH_BIAS":n<0?"BEARISH_BIAS":"NEUTRAL",o=t.calculateConfidence(i),s=t.calculateRiskLevel(a);return{bullishSignals:e,bearishSignals:d,signals:i,overallSignal:r,signalScore:n,confidence:o,riskLevel:s}}static calculateConfidence(e){return Math.min(e.length*10,100)}static calculateRiskLevel(e){return e<20?"LOW":e<40?"MEDIUM":"HIGH"}};function $e(t,e=500){if(t.length<=e)return t;let d=[],i=t.length/e;d.push(t[0]);for(let a=1;a<e-1;a++){let n=Math.floor(a*i),r=Math.floor((a+1)*i),o=t.slice(n,r);if(o.length===0)continue;let s=Math.floor(o.length/2);d.push(o[s])}return d.push(t[t.length-1]),d}var dt=class{static calculateZScore(e,d){return(e-d)/(d*.1)}static calculateOrnsteinUhlenbeck(e,d,i,a){let n=d,r=.1;if(a.length>1){let s=a.reduce((c,p)=>c+p*p,0)/a.length;r=Math.max(.01,Math.min(1,s*10))}let o=i*.01;return{mean:n,speed:r,volatility:o,currentValue:e}}static calculateKalmanFilter(e,d,i,a){let n=i*.001,r=i*1e-4,o=d,s=n;if(a.length>0){let c=o,p=s+r,u=p/(p+n);return o=c+u*(e-c),s=(1-u)*p,{state:o,covariance:s,gain:u}}return{state:e,covariance:s,gain:.5}}static calculateARIMA(e,d){if(d.length<3)return{forecast:[e*1.01,e*1.02],residuals:[0,0],aic:100};let i=d.length,a=0,n=0,r=0,o=0;for(let P=1;P<i;P++){let f=d[P],E=d[P-1];a+=f,n+=E,r+=f*E,o+=E*E}let s=(i*r-a*n)/(i*o-n*n),c=(a-s*n)/i,p=[];for(let P=1;P<i;P++){let f=c+s*d[P-1];p.push(d[P]-f)}let u=p.reduce((P,f)=>P+f*f,0),m=i*Math.log(u/i)+2*2,S=d[d.length-1],g=e+(c+s*S),y=g+(c+s*(c+s*S));return{forecast:[g,y],residuals:$e(p),aic:m}}static calculateGARCH(e,d){if(d.length<5)return{volatility:e*.01,persistence:.9,meanReversion:.1};let i=d.map(s=>s*s),a=i.reduce((s,c)=>s+c,0)/i.length,n=.9;if(i.length>1){let s=i.reduce((c,p)=>c+p,0)/i.length;n=Math.min(.99,Math.max(.5,s/a))}let r=a*(1-n);return{volatility:Math.sqrt(a),persistence:n,meanReversion:r}}static calculateVAR(e,d,i=2){if(e.length<i+5||d.length<i+5)return{priceForecast:[e[e.length-1]*1.01],volumeForecast:[d[d.length-1]*1.01],coefficients:[[.5,.3],[.2,.6]],residuals:[[0],[0]]};let a=[],n=[];for(let P=1;P<e.length;P++)a.push((e[P]-e[P-1])/e[P-1]),n.push((d[P]-d[P-1])/d[P-1]);let r=[],o=[],s=[];for(let P=i;P<a.length;P++){let f=[1];for(let E=1;E<=i;E++)f.push(a[P-E]),f.push(n[P-E]);r.push(f),o.push(a[P]),s.push(n[P])}let c=[[.5,.3,.2,.1],[.2,.1,.6,.3]],p=[],u=[];for(let P=0;P<o.length;P++){let f=c[0].reduce((v,F,D)=>v+F*r[P][D],0),E=c[1].reduce((v,F,D)=>v+F*r[P][D],0);p.push(o[P]-f),u.push(s[P]-E)}let m=a[a.length-1],S=n[n.length-1],g=[e[e.length-1]*(1+m*.5)],y=[d[d.length-1]*(1+S*.5)];return{priceForecast:g,volumeForecast:y,coefficients:c,residuals:[$e(p),$e(u)]}}static calculateGaussianProcess(e,d=5){if(e.length<10)return{mean:[e[e.length-1]*1.01,e[e.length-1]*1.02],variance:[.01,.02],confidenceInterval:{lower:[e[e.length-1]*.99,e[e.length-1]*.98],upper:[e[e.length-1]*1.03,e[e.length-1]*1.04]}};let i=[],a=[],n=[],r=[],o=e[e.length-1],s=Math.sqrt(e.reduce((c,p)=>c+(p-o)**2,0)/e.length);for(let c=1;c<=d;c++){let p=(e[e.length-1]-e[e.length-10])/10,u=o+p*c;i.push(u);let m=s*(1+c*.1);a.push(m);let S=1.96*m;n.push(u-S),r.push(u+S)}return{mean:i,variance:a,confidenceInterval:{lower:n,upper:r}}}static calculatePairsTrading(e,d){if(e.length<20||d.length<20)return{spread:[0],zScore:[0],hedgeRatio:1,entrySignal:"NEUTRAL",exitSignal:"NEUTRAL",position:"FLAT"};let i=Math.min(e.length,d.length),a=0,n=0,r=0,o=0;for(let f=0;f<i;f++)a+=e[f],n+=d[f],r+=e[f]*d[f],o+=e[f]*e[f];let s=(i*r-a*n)/(i*o-a*a),c=[];for(let f=0;f<i;f++)c.push(d[f]-s*e[f]);let p=c.reduce((f,E)=>f+E,0)/c.length,u=Math.sqrt(c.reduce((f,E)=>f+(E-p)**2,0)/c.length),m=[];for(let f=0;f<c.length;f++)m.push((c[f]-p)/u);let S=m[m.length-1],g="NEUTRAL",y="NEUTRAL",P="FLAT";return S>2?(g="SHORT_SPREAD",P="SHORT"):S<-2?(g="LONG_SPREAD",P="LONG"):Math.abs(S)<.5&&(y="CLOSE_POSITION",P="FLAT"),{spread:$e(c),zScore:$e(m),hedgeRatio:s,entrySignal:g,exitSignal:y,position:P}}static calculateHilbertTransform(e,d){if(d.length<10)return{analytic:[e],phase:[0],amplitude:[e]};let i=[],a=[],n=[],r=[e-d[d.length-1],e];r.push(...d.map(o=>e+o));for(let o=0;o<r.length;o++){let s=r[o],c=o>0?(r[o]-r[o-1])*.5:0;i.push(s+c),a.push(Math.atan2(c,s)),n.push(Math.sqrt(s*s+c*c))}return{analytic:$e(i),phase:$e(a),amplitude:$e(n)}}static calculateWaveletTransform(e,d){if(d.length<8)return{coefficients:[e],scales:[1]};let i=[e,...d.map(r=>e+r)],a=[],n=[];for(let r=1;r<=Math.min(4,Math.floor(Math.log2(i.length)));r++){let o=2**(r-1);n.push(r);for(let s=0;s<i.length-o;s+=o*2)if(s+o<i.length){let c=(i[s]-i[s+o])/2;a.push(c)}}return{coefficients:$e(a),scales:$e(n)}}static calculateFourierTransform(e){if(e.length<8)return{frequencies:[.1,.2],amplitudes:[e[e.length-1],e[e.length-1]*.5],phases:[0,Math.PI/4],dominantFrequencies:[.1]};let d=e.length,i=[],a=[],n=[];for(let c=0;c<d;c++){let p=c/d;i.push(p);let u=0,m=0;for(let y=0;y<d;y++){let P=-2*Math.PI*c*y/d;u+=e[y]*Math.cos(P),m+=e[y]*Math.sin(P)}let S=Math.sqrt(u*u+m*m)/d,g=Math.atan2(m,u);a.push(S),n.push(g)}let o=[...a].sort((c,p)=>p-c)[Math.floor(d*.1)],s=i.filter((c,p)=>a[p]>o);return{frequencies:$e(i),amplitudes:$e(a),phases:$e(n),dominantFrequencies:$e(s)}}static calculateEMD(e){if(e.length<10)return{imfs:[e],residual:[0],frequencies:[.1]};let d=[],i=[...e];for(let r=0;r<3&&i.length>5;r++){let o=[...i],s=0,c=10;for(;s<c;){let p=[];for(let m=1;m<o.length-1;m++)(o[m]>o[m-1]&&o[m]>o[m+1]||o[m]<o[m-1]&&o[m]<o[m+1])&&p.push(o[m]);if(p.length<3)break;let u=p.map((m,S)=>S===0?p[0]:S===p.length-1?p[p.length-1]:(p[S-1]+p[S+1])/2);for(let m=0;m<o.length;m++){let S=Math.floor(m*p.length/o.length);o[m]-=u[Math.min(S,u.length-1)]}s++}d.push($e([...o]));for(let p=0;p<i.length;p++)i[p]-=o[p]}let a=$e(i),n=$e(d.map((r,o)=>.1/(o+1)));return{imfs:d,residual:a,frequencies:n}}};var Fd=class t{static calculatePivotPoints(e,d,i){let a=[];for(let n=0;n<e.length;n++){let r=d[n]||e[n],o=i[n]||e[n],s=e[n],c=(r+o+s)/3,p=2*c-o,u=2*c-r,m=c+(r-o),S=c-(r-o),g=r+2*(c-o),y=o-2*(r-c);a.push({pp:c,r1:p,r2:m,r3:g,s1:u,s2:S,s3:y})}return a}static calculateFibonacciPivotPoints(e,d,i){let a=[];for(let n=0;n<e.length;n++){let r=d[n]||e[n],o=i[n]||e[n],s=e[n],c=(r+o+s)/3,p=r-o,u=c+.382*p,m=c+.618*p,S=c+1*p,g=c-.382*p,y=c-.618*p,P=c-1*p;a.push({pp:c,r1:u,r2:m,r3:S,s1:g,s2:y,s3:P})}return a}static calculateCamarillaPivotPoints(e,d,i){let a=[];for(let n=0;n<e.length;n++){let r=d[n]||e[n],o=i[n]||e[n],s=e[n],c=(r+o+s)/3,p=r-o,u=s+1.1/12*p,m=s+1.1/6*p,S=s+1.1/4*p,g=s-1.1/12*p,y=s-1.1/6*p,P=s-1.1/4*p;a.push({pp:c,r1:u,r2:m,r3:S,s1:g,s2:y,s3:P})}return a}static calculateFibonacciLevels(e){let d=[];for(let i=0;i<e.length;i++){let a=e[i];d.push({retracement:{level0:a,level236:a*.764,level382:a*.618,level500:a*.5,level618:a*.382,level786:a*.214,level100:a*0},extension:{level1272:a*1.272,level1618:a*1.618,level2618:a*2.618,level4236:a*4.236}})}return d}static calculateGannLevels(e){let d=[];if(e.length===0)return[];if(e.length<=500){for(let n=0;n<e.length;n++)d.push(e[n]*(1+n*.01));return d}let i=e.length/500;d.push(e[0]*1.01);for(let n=1;n<499;n++){let r=Math.floor(n*i),o=Math.floor((n+1)*i),s=e.slice(r,o);if(s.length===0)continue;let c=Math.floor(s.length/2),u=s[c]*(1+(r+c)*.01);d.push(u)}let a=e.length-1;return d.push(e[a]*(1+a*.01)),d}static calculateElliottWave(e){let d=[];if(e.length<10)return[];for(let i=0;i<e.length;i++){let a=[],n=1,r=.5;if(i>=4){let o=e.slice(i-4,i+1),s=t.detectPriceSwings(o);s.length>=3&&(a.push(...s.slice(0,3)),n=Math.min(s.length,5),r=t.calculateWavePosition(o))}d.push({waves:a.length>0?a:[e[i]],currentWave:n,wavePosition:r})}return d}static detectPriceSwings(e){let d=[];for(let i=1;i<e.length-1;i++){let a=e[i-1],n=e[i],r=e[i+1];(n>a&&n>r||n<a&&n<r)&&d.push(n)}return d}static calculateWavePosition(e){if(e.length<2)return .5;let d=e[e.length-1],i=Math.min(...e),a=Math.max(...e);return a!==i?(d-i)/(a-i):.5}static calculateHarmonicPatterns(e){let d=[];if(e.length<5)return[];let i=[];for(let n=4;n<e.length;n++){let r=e.slice(n-4,n+1),o=t.detectHarmonicPattern(r);i.push(o)}if(i.length<=500)return i;let a=i.length/500;d.push(i[0]);for(let n=1;n<499;n++){let r=Math.floor(n*a),o=Math.floor((n+1)*a),s=i.slice(r,o);if(s.length===0)continue;let c=s.reduce((p,u)=>u.completion>p.completion?u:p);d.push(c)}return d.push(i[i.length-1]),d}static detectHarmonicPattern(e){if(e.length<5)return{type:"Unknown",completion:0,target:e[e.length-1]*1.1,stopLoss:e[e.length-1]*.9};let d=t.detectPriceSwings(e);if(d.length<4)return{type:"Unknown",completion:0,target:e[e.length-1]*1.1,stopLoss:e[e.length-1]*.9};let i=d.slice(-5);if(i.length<5)return{type:"Unknown",completion:0,target:e[e.length-1]*1.1,stopLoss:e[e.length-1]*.9};let[a,n,r,o,s]=i,c=Math.abs(r-n),p=Math.abs(o-r),u=Math.abs(s-o),m=Math.abs(n-a),S=c/m,g=p/c,y=u/p;return t.isInRange(S,.618,.05)&&t.isInRange(g,.382,.05)&&t.isInRange(y,.886,.05)?{type:"Gartley",completion:t.calculatePatternCompletion(e),target:s+(s-o)*.618,stopLoss:s*.99}:t.isInRange(S,.382,.05)&&t.isInRange(g,.382,.05)&&t.isInRange(y,.886,.05)?{type:"Bat",completion:t.calculatePatternCompletion(e),target:s+(s-o)*.382,stopLoss:s*.99}:t.isInRange(S,.786,.05)&&t.isInRange(g,.382,.05)&&t.isInRange(y,1.618,.05)?{type:"Butterfly",completion:t.calculatePatternCompletion(e),target:s+(s-o)*1.618,stopLoss:s*.99}:t.isInRange(S,.382,.05)&&t.isInRange(g,.886,.05)&&t.isInRange(y,3.618,.1)?{type:"Crab",completion:t.calculatePatternCompletion(e),target:s+(s-o)*1.618,stopLoss:s*.99}:t.isInRange(S,.382,.05)&&t.isInRange(g,.113,.05)&&t.isInRange(y,Math.SQRT2,.05)?{type:"Cypher",completion:t.calculatePatternCompletion(e),target:s+(s-o)*.786,stopLoss:s*.99}:t.isInRange(S,.886,.05)&&t.isInRange(g,.886,.05)&&t.isInRange(y,1.13,.05)?{type:"Shark",completion:t.calculatePatternCompletion(e),target:s+(s-o)*1.13,stopLoss:s*.99}:{type:"Unknown",completion:0,target:e[e.length-1]*1.1,stopLoss:e[e.length-1]*.9}}static isInRange(e,d,i){return Math.abs(e-d)<=i}static calculatePatternCompletion(e){if(e.length<2)return 0;let d=e[e.length-1],i=Math.max(...e),a=Math.min(...e);if(i===a)return 50;let n=i-a,r=(d-a)/n;return Math.min(100,Math.max(0,r*100))}};var Ed=class{static calculateMACD(e){let d=Ne.calculateEMA(e,12),i=Ne.calculateEMA(e,26),a=[],n=[];for(let o=0;o<Math.min(d.length,i.length);o++)n.push(d[o]-i[o]);let r=Ne.calculateEMA(n,9);for(let o=0;o<Math.min(n.length,r.length);o++)a.push({macd:n[o],signal:r[o],histogram:n[o]-r[o]});return a}static calculateADX(e,d,i){if(e.length<14)return[];let a=14,n=[],r=[],o=[],s=[];r.push(d[0]-i[0]),o.push(0),s.push(0);for(let v=1;v<e.length;v++){let F=d[v]||e[v],D=i[v]||e[v],h=d[v-1]||e[v-1],X=i[v-1]||e[v-1],b=e[v-1],T=F-D,C=Math.abs(F-b),R=Math.abs(D-b);r.push(Math.max(T,C,R));let M=F-h,x=X-D;M>x&&M>0?(o.push(M),s.push(0)):x>M&&x>0?(o.push(0),s.push(x)):(o.push(0),s.push(0))}let c=[],p=[],u=[],m=0,S=0,g=0;for(let v=0;v<a;v++)m+=r[v],S+=o[v],g+=s[v];c.push(m),p.push(S),u.push(g);for(let v=a;v<r.length;v++){let F=c[c.length-1]-c[c.length-1]/a+r[v],D=p[p.length-1]-p[p.length-1]/a+o[v],h=u[u.length-1]-u[u.length-1]/a+s[v];c.push(F),p.push(D),u.push(h)}let y=[],P=[];for(let v=0;v<c.length;v++)y.push(p[v]/c[v]*100),P.push(u[v]/c[v]*100);let f=[];for(let v=0;v<y.length;v++){let F=y[v]+P[v],D=Math.abs(y[v]-P[v]);f.push(F>0?D/F*100:0)}if(f.length<a)return[];let E=0;for(let v=0;v<a;v++)E+=f[v];n.push(E/a);for(let v=a;v<f.length;v++){let F=n[n.length-1]-n[n.length-1]/a+f[v];n.push(F)}return n}static calculateDMI(e,d,i){if(e.length<14)return[];let a=14,n=[],r=[],o=[],s=[];r.push(d[0]-i[0]),o.push(0),s.push(0);for(let F=1;F<e.length;F++){let D=d[F]||e[F],h=i[F]||e[F],X=d[F-1]||e[F-1],b=i[F-1]||e[F-1],T=e[F-1],C=D-h,R=Math.abs(D-T),M=Math.abs(h-T);r.push(Math.max(C,R,M));let x=D-X,N=b-h;x>N&&x>0?(o.push(x),s.push(0)):N>x&&N>0?(o.push(0),s.push(N)):(o.push(0),s.push(0))}let c=[],p=[],u=[],m=0,S=0,g=0;for(let F=0;F<a;F++)m+=r[F],S+=o[F],g+=s[F];c.push(m),p.push(S),u.push(g);for(let F=a;F<r.length;F++){let D=c[c.length-1]-c[c.length-1]/a+r[F],h=p[p.length-1]-p[p.length-1]/a+o[F],X=u[u.length-1]-u[u.length-1]/a+s[F];c.push(D),p.push(h),u.push(X)}let y=[],P=[];for(let F=0;F<c.length;F++)y.push(p[F]/c[F]*100),P.push(u[F]/c[F]*100);let f=[];for(let F=0;F<y.length;F++){let D=y[F]+P[F],h=Math.abs(y[F]-P[F]);f.push(D>0?h/D*100:0)}if(f.length<a)return[];let E=[],v=0;for(let F=0;F<a;F++)v+=f[F];E.push(v/a);for(let F=a;F<f.length;F++){let D=E[E.length-1]-E[E.length-1]/a+f[F];E.push(D)}for(let F=0;F<E.length;F++)n.push({plusDI:y[F+a-1]||0,minusDI:P[F+a-1]||0,adx:E[F]});return n}static calculateIchimoku(e,d,i){if(e.length<52)return[];let a=[],n=[];for(let u=8;u<e.length;u++){let m=Math.max(...d.slice(u-8,u+1)),S=Math.min(...i.slice(u-8,u+1));n.push((m+S)/2)}let r=[];for(let u=25;u<e.length;u++){let m=Math.max(...d.slice(u-25,u+1)),S=Math.min(...i.slice(u-25,u+1));r.push((m+S)/2)}let o=[];for(let u=0;u<Math.min(n.length,r.length);u++)o.push((n[u]+r[u])/2);let s=[];for(let u=51;u<e.length;u++){let m=Math.max(...d.slice(u-51,u+1)),S=Math.min(...i.slice(u-51,u+1));s.push((m+S)/2)}let c=[];for(let u=26;u<e.length;u++)c.push(e[u-26]);let p=Math.min(n.length,r.length,o.length,s.length,c.length);for(let u=0;u<p;u++)a.push({tenkan:n[u],kijun:r[u],senkouA:o[u],senkouB:s[u],chikou:c[u]});return a}static calculateParabolicSAR(e,d,i){if(e.length<2)return[];let a=[],n=.02,r=.2,o=i[0],s=!0,c=n,p=d[0];a.push(o);for(let u=1;u<e.length;u++){let m=d[u]||e[u],S=i[u]||e[u];if(s){if(S<o)s=!1,o=p,p=S,c=n;else if(m>p&&(p=m,c=Math.min(c+n,r)),o=o+c*(p-o),u>0){let g=i[u-1]||e[u-1];o=Math.min(o,g)}}else if(m>o)s=!0,o=p,p=m,c=n;else if(S<p&&(p=S,c=Math.min(c+n,r)),o=o+c*(p-o),u>0){let g=d[u-1]||e[u-1];o=Math.max(o,g)}a.push(o)}return a}};var ed=class t{static calculateBollingerBands(e,d=20,i=2){if(e.length<d)return[];let a=Ne.calculateSMA(e,d),n=[];for(let r=0;r<a.length;r++){let o=e.slice(r,r+d),s=a[r],c=o.reduce((S,g)=>S+(g-s)**2,0)/d,p=Math.sqrt(c),u=s+p*i,m=s-p*i;n.push({upper:u,middle:s,lower:m,bandwidth:(u-m)/s*100,percentB:(e[r]-m)/(u-m)*100})}return n}static calculateATR(e,d,i){if(e.length<2)return[];let a=[];for(let r=1;r<e.length;r++){let o=d[r]||e[r],s=i[r]||e[r],c=e[r-1],p=o-s,u=Math.abs(o-c),m=Math.abs(s-c);a.push(Math.max(p,u,m))}let n=[];if(a.length>=14){let r=a.slice(0,14).reduce((o,s)=>o+s,0);n.push(r/14);for(let o=14;o<a.length;o++)r=r-a[o-14]+a[o],n.push(r/14)}return n}static calculateKeltnerChannels(e,d,i){let a=[];if(e.length<20)return[];let o=Ne.calculateEMA(e,20),s=t.calculateATR(e,d,i);for(let c=0;c<Math.min(o.length,s.length);c++){let p=o[c],u=s[c];a.push({upper:p+2*u,middle:p,lower:p-2*u})}return a}static calculateDonchianChannels(e){let d=[];for(let i=20;i<e.length;i++){let a=e.slice(i-20,i);d.push({upper:Math.max(...a),middle:(Math.max(...a)+Math.min(...a))/2,lower:Math.min(...a)})}return d}static calculateChaikinVolatility(e,d,i){let a=[];if(e.length<10*2)return[];let r=[];for(let s=0;s<e.length;s++){let c=d[s]||e[s],p=i[s]||e[s];r.push(c-p)}let o=Ne.calculateEMA(r,10);for(let s=10;s<o.length;s++){let c=o[s],p=o[s-10],u=p!==0?(c-p)/p*100:0;a.push(u)}return a}};var td=class{static calculateOBV(e,d){let i=[d[0]];for(let a=1;a<e.length;a++)e[a]>e[a-1]?i.push(i[a-1]+d[a]):e[a]<e[a-1]?i.push(i[a-1]-d[a]):i.push(i[a-1]);return i}static calculateCMF(e,d,i,a){let n=[];if(e.length<20)return[];for(let o=19;o<e.length;o++){let s=0,c=0;for(let u=o-20+1;u<=o;u++){let m=d[u]||e[u],S=i[u]||e[u],g=e[u],y=a[u]||1,f=(g-S-(m-g))/(m-S)*y;s+=f,c+=y}let p=c!==0?s/c:0;n.push(p)}return n}static calculateADL(e,d,i,a){let n=[0];for(let r=1;r<e.length;r++){let o=d[r]||e[r],s=i[r]||e[r],c=e[r],p=a[r]||1,m=(c-s-(o-c))/(o-s)*p;n.push(n[r-1]+m)}return n}static calculateVolumeROC(e){let d=[];for(let i=10;i<e.length;i++)d.push((e[i]-e[i-10])/e[i-10]*100);return d}static calculateMFI(e,d,i,a){let n=[];if(e.length<15)return[];for(let o=14;o<e.length;o++){let s=0,c=0;for(let m=o-14+1;m<=o;m++){let S=d[m]||e[m],g=i[m]||e[m],y=e[m],P=a[m]||1,f=(S+g+y)/3,E=f*P;if(m>o-14+1){let v=d[m-1]||e[m-1],F=i[m-1]||e[m-1],D=e[m-1],h=(v+F+D)/3;f>h?s+=E:f<h&&(c+=E)}}let u=100-100/(1+(c!==0?s/c:0));n.push(u)}return n}static calculateVWAP(e,d){let i=[],a=0,n=0;for(let r=0;r<e.length;r++)a+=e[r]*(d[r]||1),n+=d[r]||1,i.push(a/n);return i}};function Ag(t){return t.reduce((e,d)=>e+d,0)}var is=class{prices;volumes;highs;lows;constructor(e){this.prices=e.map(d=>d.trade>0?d.trade:d.midPrice),this.volumes=e.map(d=>d.volume),this.highs=e.map(d=>d.tradingSessionHighPrice>0?d.tradingSessionHighPrice:d.trade),this.lows=e.map(d=>d.tradingSessionLowPrice>0?d.tradingSessionLowPrice:d.trade)}calculatePriceChanges(){let e=[];for(let d=1;d<this.prices.length;d++)e.push((this.prices[d]-this.prices[d-1])/this.prices[d-1]);return e}analyze(){let e=this.prices[this.prices.length-1],d=this.prices[0],i=Math.max(...this.highs),a=Math.min(...this.lows),n=Ag(this.volumes),r=n/this.volumes.length,o=this.calculatePriceChanges(),s=o.length>0?Math.sqrt(o.reduce((T,C)=>T+C**2,0)/o.length)*Math.sqrt(252)*100:0,c=(e-d)/d*100,p=(e-a)/(i-a)*100,u=this.prices.reduce((T,C,R)=>T+C*this.volumes[R],0)/n,m=this.prices.length>5?(e-this.prices[Math.max(0,this.prices.length-6)])/this.prices[Math.max(0,this.prices.length-6)]*100:0,S=this.prices.length>10?(e-this.prices[Math.max(0,this.prices.length-11)])/this.prices[Math.max(0,this.prices.length-11)]*100:0,g=bd.calculateMaxDrawdown(this.prices),y=ed.calculateATR(this.prices,this.highs,this.lows),P=y.length>0?y[y.length-1]:0,f=s,E=s,v=c/s,F=c/E,D=c/g,h=bd.calculateMaxConsecutiveLosses(this.prices),X=bd.calculateWinRate(this.prices),b=bd.calculateProfitFactor(this.prices);return{currentPrice:e,startPrice:d,sessionHigh:i,sessionLow:a,totalVolume:n,avgVolume:r,volatility:s,sessionReturn:c,pricePosition:p,trueVWAP:u,momentum5:m,momentum10:S,maxDrawdown:g,atr:P,impliedVolatility:f,realizedVolatility:E,sharpeRatio:v,sortinoRatio:F,calmarRatio:D,maxConsecutiveLosses:h,winRate:X,profitFactor:b}}getTechnicalIndicators(){return{sma5:Ne.calculateSMA(this.prices,5),sma10:Ne.calculateSMA(this.prices,10),sma20:Ne.calculateSMA(this.prices,20),sma50:Ne.calculateSMA(this.prices,50),sma200:Ne.calculateSMA(this.prices,200),ema8:Ne.calculateEMA(this.prices,8),ema12:Ne.calculateEMA(this.prices,12),ema21:Ne.calculateEMA(this.prices,21),ema26:Ne.calculateEMA(this.prices,26),wma20:Ne.calculateWMA(this.prices,20),vwma20:Ne.calculateVWMA(this.prices,this.volumes,20),macd:Ed.calculateMACD(this.prices),adx:Ed.calculateADX(this.prices,this.highs,this.lows),dmi:Ed.calculateDMI(this.prices,this.highs,this.lows),ichimoku:Ed.calculateIchimoku(this.prices,this.highs,this.lows),parabolicSAR:Ed.calculateParabolicSAR(this.prices,this.highs,this.lows),rsi:Zt.calculateRSI(this.prices,14),stochastic:Zt.calculateStochastic(this.prices,this.highs,this.lows),cci:Zt.calculateCCI(this.prices,this.highs,this.lows),roc:Zt.calculateROC(this.prices),williamsR:Zt.calculateWilliamsR(this.prices),momentum:Zt.calculateMomentum(this.prices),bollinger:ed.calculateBollingerBands(this.prices,20,2),atr:ed.calculateATR(this.prices,this.highs,this.lows),keltner:ed.calculateKeltnerChannels(this.prices,this.highs,this.lows),donchian:ed.calculateDonchianChannels(this.prices),chaikinVolatility:ed.calculateChaikinVolatility(this.prices,this.highs,this.lows),obv:td.calculateOBV(this.prices,this.volumes),cmf:td.calculateCMF(this.prices,this.highs,this.lows,this.volumes),adl:td.calculateADL(this.prices,this.highs,this.lows,this.volumes),volumeROC:td.calculateVolumeROC(this.volumes),mfi:td.calculateMFI(this.prices,this.highs,this.lows,this.volumes),vwap:td.calculateVWAP(this.prices,this.volumes),pivotPoints:Fd.calculatePivotPoints(this.prices,this.highs,this.lows),fibonacci:Fd.calculateFibonacciLevels(this.prices),gannLevels:Fd.calculateGannLevels(this.prices),elliottWave:Fd.calculateElliottWave(this.prices),harmonicPatterns:Fd.calculateHarmonicPatterns(this.prices)}}generateJSONAnalysis(e){let d=this.analyze(),i=this.getTechnicalIndicators(),a=this.calculatePriceChanges(),n=i.sma5.length>0?i.sma5[i.sma5.length-1]:null,r=i.sma10.length>0?i.sma10[i.sma10.length-1]:null,o=i.sma20.length>0?i.sma20[i.sma20.length-1]:null,s=i.sma50.length>0?i.sma50[i.sma50.length-1]:null,c=i.sma200.length>0?i.sma200[i.sma200.length-1]:null,p=i.ema8[i.ema8.length-1],u=i.ema12[i.ema12.length-1],m=i.ema21[i.ema21.length-1],S=i.ema26[i.ema26.length-1],g=i.wma20.length>0?i.wma20[i.wma20.length-1]:null,y=i.vwma20.length>0?i.vwma20[i.vwma20.length-1]:null,P=i.macd.length>0?i.macd[i.macd.length-1]:null,f=i.adx.length>0?i.adx[i.adx.length-1]:null,E=i.dmi.length>0?i.dmi[i.dmi.length-1]:null,v=i.ichimoku.length>0?i.ichimoku[i.ichimoku.length-1]:null,F=i.parabolicSAR.length>0?i.parabolicSAR[i.parabolicSAR.length-1]:null,D=i.rsi.length>0?i.rsi[i.rsi.length-1]:null,h=i.stochastic.length>0?i.stochastic[i.stochastic.length-1]:null,X=i.cci.length>0?i.cci[i.cci.length-1]:null,b=i.roc.length>0?i.roc[i.roc.length-1]:null,T=i.williamsR.length>0?i.williamsR[i.williamsR.length-1]:null,C=i.momentum.length>0?i.momentum[i.momentum.length-1]:null,R=i.bollinger.length>0?i.bollinger[i.bollinger.length-1]:null,M=i.atr.length>0?i.atr[i.atr.length-1]:null,x=i.keltner.length>0?i.keltner[i.keltner.length-1]:null,N=i.donchian.length>0?i.donchian[i.donchian.length-1]:null,w=i.chaikinVolatility.length>0?i.chaikinVolatility[i.chaikinVolatility.length-1]:null,A=i.obv.length>0?i.obv[i.obv.length-1]:null,U=i.cmf.length>0?i.cmf[i.cmf.length-1]:null,L=i.adl.length>0?i.adl[i.adl.length-1]:null,j=i.volumeROC.length>0?i.volumeROC[i.volumeROC.length-1]:null,B=i.mfi.length>0?i.mfi[i.mfi.length-1]:null,H=i.vwap.length>0?i.vwap[i.vwap.length-1]:null,Y=i.pivotPoints.length>0?i.pivotPoints[i.pivotPoints.length-1]:null,Q=i.fibonacci.length>0?i.fibonacci[i.fibonacci.length-1]:null,W=i.gannLevels.length>0?i.gannLevels:[],G=i.elliottWave.length>0?i.elliottWave[i.elliottWave.length-1]:null,K=i.harmonicPatterns.length>0?i.harmonicPatterns:[],te=this.volumes[this.volumes.length-1],_=te/d.avgVolume,Z=(d.sessionHigh-d.currentPrice)/d.sessionHigh*100,de=(d.sessionHigh-d.sessionLow)/d.sessionLow*100,oe=(d.currentPrice-d.trueVWAP)/d.trueVWAP*100,pe=da.generateSignals(d.currentPrice,d.trueVWAP,d.momentum5,d.momentum10,d.sessionReturn,te,d.avgVolume,d.pricePosition,d.volatility),fe=da.calculateOverallSignal(pe.bullishSignals,pe.bearishSignals,pe.signals,d.volatility),me=Math.max(d.sessionLow*1.005,d.trueVWAP*.998),Pe=d.sessionLow*.995,dd=d.sessionHigh*.995,vi=(dd-d.currentPrice)/(d.currentPrice-Pe),Kd=bd.calculatePositionSize(me,Pe),k=Kd*(me-Pe),q=dt.calculateVAR(this.prices,this.volumes),ee=dt.calculateGaussianProcess(this.prices),ne=dt.calculatePairsTrading(this.prices,this.prices.map(_d=>_d*1.01)),$=dt.calculateFourierTransform(this.prices),ye=dt.calculateEMD(this.prices),Ae=Lt.calculateBlackScholes(d.currentPrice,d.startPrice,d.avgVolume),Tt=Lt.calculateBinomialTree(d.currentPrice,d.startPrice),id=Lt.calculateTrinomialTree(d.currentPrice,d.startPrice),Ci=Lt.calculateMonteCarlo(d.currentPrice,d.startPrice),Xi=Lt.calculateHestonModel(d.currentPrice,d.startPrice),Ti=Lt.calculateSABRModel(d.currentPrice,d.startPrice),Yd=Lt.calculateVarianceGamma(d.currentPrice,d.startPrice);return{symbol:e,timestamp:new Date().toISOString(),marketStructure:{currentPrice:d.currentPrice,startPrice:d.startPrice,sessionHigh:d.sessionHigh,sessionLow:d.sessionLow,rangeWidth:de,totalVolume:d.totalVolume,sessionPerformance:d.sessionReturn,positionInRange:d.pricePosition},volatility:{impliedVolatility:d.impliedVolatility,realizedVolatility:d.realizedVolatility,atr:d.atr,maxDrawdown:d.maxDrawdown*100,currentDrawdown:Z},technicalIndicators:{sma5:n,sma10:r,sma20:o,sma50:s,sma200:c,ema8:p,ema12:u,ema21:m,ema26:S,wma20:g,vwma20:y,macd:P,adx:f,dmi:E,ichimoku:v,parabolicSAR:F,rsi:D,stochastic:h,cci:X,roc:b,williamsR:T,momentum:C,bollingerBands:R?{upper:R.upper,middle:R.middle,lower:R.lower,bandwidth:R.bandwidth,percentB:R.percentB}:null,atr:M,keltnerChannels:x?{upper:x.upper,middle:x.middle,lower:x.lower}:null,donchianChannels:N?{upper:N.upper,middle:N.middle,lower:N.lower}:null,chaikinVolatility:w,obv:A,cmf:U,adl:L,volumeROC:j,mfi:B,vwap:H},volumeAnalysis:{currentVolume:te,averageVolume:Math.round(d.avgVolume),volumeRatio:_,trueVWAP:d.trueVWAP,priceVsVWAP:oe,obv:A,cmf:U,mfi:B},momentum:{momentum5:d.momentum5,momentum10:d.momentum10,sessionROC:d.sessionReturn,rsi:D,stochastic:h,cci:X},supportResistance:{pivotPoints:Y,fibonacci:Q,gannLevels:W,elliottWave:G,harmonicPatterns:K},tradingSignals:fe,statisticalModels:{zScore:dt.calculateZScore(d.currentPrice,d.startPrice),ornsteinUhlenbeck:dt.calculateOrnsteinUhlenbeck(d.currentPrice,d.startPrice,d.avgVolume,a),kalmanFilter:dt.calculateKalmanFilter(d.currentPrice,d.startPrice,d.avgVolume,a),pairsTrading:ne,arima:dt.calculateARIMA(d.currentPrice,a),garch:dt.calculateGARCH(d.avgVolume,a),var:q,gaussianProcess:ee,hilbertTransform:dt.calculateHilbertTransform(d.currentPrice,a),waveletTransform:dt.calculateWaveletTransform(d.currentPrice,a),fourierTransform:$,empiricalModeDecomposition:ye},optionsAnalysis:Ae?{blackScholes:Ae,binomialTree:Tt,trinomialTree:id,monteCarlo:Ci,hestonModel:Xi,sabrModel:Ti,varianceGamma:Yd,impliedVolatility:d.impliedVolatility,delta:Ae.delta,gamma:Ae.gamma,theta:Ae.theta,vega:Ae.vega,rho:Ae.rho,greeks:{delta:Ae.delta,gamma:Ae.gamma,theta:Ae.theta,vega:Ae.vega,rho:Ae.rho}}:null,riskManagement:{targetEntry:me,stopLoss:Pe,profitTarget:dd,riskRewardRatio:vi,positionSize:Kd,maxRisk:k},performance:{sharpeRatio:d.sharpeRatio,sortinoRatio:d.sortinoRatio,calmarRatio:d.calmarRatio,maxDrawdown:d.maxDrawdown*100,winRate:d.winRate,profitFactor:d.profitFactor,totalReturn:d.sessionReturn,volatility:d.volatility}}}},Tu=t=>async e=>{try{let d=e.symbol,i=t.get(d)||[];if(i.length===0)return{content:[{type:"text",text:`No price data available for ${d}. Please request market data first.`,uri:"technicalAnalysis"}]};if(!i.every(o=>typeof o.trade=="number"&&!Number.isNaN(o.trade)&&typeof o.midPrice=="number"&&!Number.isNaN(o.midPrice)))throw new Error("Invalid market data");let r=new is(i).generateJSONAnalysis(d);return{content:[{type:"text",text:`Technical Analysis for ${d}:
10114
10114
 
10115
10115
  ${JSON.stringify(r,null,2)}`,uri:"technicalAnalysis"}]}}catch(d){return{content:[{type:"text",text:`Error performing technical analysis: ${d instanceof Error?d.message:"Unknown error"}`,uri:"technicalAnalysis"}],isError:!0}}};import wg from"quickchart-js";var Du=(t,e)=>async d=>{try{t.logger.log({level:"info",message:`Sending market data request for symbols: ${d.symbols.join(", ")}`});let i=new Promise(s=>{e.set(d.mdReqID,s),t.logger.log({level:"info",message:`Registered callback for market data request ID: ${d.mdReqID}`})}),a=d.mdEntryTypes||[z.Bid,z.Offer,z.Trade,z.IndexValue,z.OpeningPrice,z.ClosingPrice,z.SettlementPrice,z.TradingSessionHighPrice,z.TradingSessionLowPrice,z.VWAP,z.Imbalance,z.TradeVolume,z.OpenInterest,z.CompositeUnderlyingPrice,z.SimulatedSellPrice,z.SimulatedBuyPrice,z.MarginRate,z.MidPrice,z.EmptyBook,z.SettleHighPrice,z.SettleLowPrice,z.PriorSettlePrice,z.SessionHighBid,z.SessionLowOffer,z.EarlyPrices,z.AuctionClearingPrice,z.SwapValueFactor,z.DailyValueAdjustmentForLongPositions,z.CumulativeValueAdjustmentForLongPositions,z.DailyValueAdjustmentForShortPositions,z.CumulativeValueAdjustmentForShortPositions,z.FixingPrice,z.CashRate,z.RecoveryRate,z.RecoveryRateForLong,z.RecoveryRateForShort,z.MarketBid,z.MarketOffer,z.ShortSaleMinPrice,z.PreviousClosingPrice,z.ThresholdLimitPriceBanding,z.DailyFinancingValue,z.AccruedFinancingValue,z.TWAP],n=[new V(O.MsgType,be.MarketDataRequest),new V(O.SenderCompID,t.sender),new V(O.MsgSeqNum,t.getNextTargetMsgSeqNum()),new V(O.TargetCompID,t.target),new V(O.SendingTime,t.getTimestamp()),new V(O.MDReqID,d.mdReqID),new V(O.SubscriptionRequestType,d.subscriptionRequestType),new V(O.MarketDepth,0),new V(O.MDUpdateType,d.mdUpdateType)];n.push(new V(O.NoRelatedSym,d.symbols.length)),d.symbols.forEach(s=>{n.push(new V(O.Symbol,s))}),n.push(new V(O.NoMDEntryTypes,a.length)),a.forEach(s=>{n.push(new V(O.MDEntryType,s))});let r=t.createMessage(...n);if(!t.connected)return t.logger.log({level:"error",message:"Not connected. Cannot send market data request."}),{content:[{type:"text",text:"Error: Not connected. Ignoring message.",uri:"marketDataRequest"}],isError:!0};t.logger.log({level:"info",message:`Sending market data request message: ${JSON.stringify(r?.toFIXJSON())}`}),t.send(r);let o=await i;return t.logger.log({level:"info",message:`Received market data response for request ID: ${d.mdReqID}`}),{content:[{type:"text",text:`Market data for ${d.symbols.join(", ")}: ${JSON.stringify(o.toFIXJSON())}`,uri:"marketDataRequest"}]}}catch(i){return{content:[{type:"text",text:`Error: ${i instanceof Error?i.message:"Failed to request market data"}`,uri:"marketDataRequest"}],isError:!0}}},Ru=(t,e=240)=>{if(t.length<=e)return t;let d=[],i=t.length/e;d.push(t[0]);for(let a=1;a<e-1;a++){let n=Math.floor(a*i),r=Math.floor((a+1)*i),o=t.slice(n,r);if(o.length===0)continue;let s={timestamp:o[0].timestamp,bid:o.reduce((c,p)=>c+p.bid,0)/o.length,offer:o.reduce((c,p)=>c+p.offer,0)/o.length,spread:o.reduce((c,p)=>c+p.spread,0)/o.length,volume:o.reduce((c,p)=>c+p.volume,0)/o.length,trade:o.reduce((c,p)=>c+p.trade,0)/o.length,indexValue:o.reduce((c,p)=>c+p.indexValue,0)/o.length,openingPrice:o.reduce((c,p)=>c+p.openingPrice,0)/o.length,closingPrice:o.reduce((c,p)=>c+p.closingPrice,0)/o.length,settlementPrice:o.reduce((c,p)=>c+p.settlementPrice,0)/o.length,tradingSessionHighPrice:o.reduce((c,p)=>c+p.tradingSessionHighPrice,0)/o.length,tradingSessionLowPrice:o.reduce((c,p)=>c+p.tradingSessionLowPrice,0)/o.length,vwap:o.reduce((c,p)=>c+p.vwap,0)/o.length,imbalance:o.reduce((c,p)=>c+p.imbalance,0)/o.length,openInterest:o.reduce((c,p)=>c+p.openInterest,0)/o.length,compositeUnderlyingPrice:o.reduce((c,p)=>c+p.compositeUnderlyingPrice,0)/o.length,simulatedSellPrice:o.reduce((c,p)=>c+p.simulatedSellPrice,0)/o.length,simulatedBuyPrice:o.reduce((c,p)=>c+p.simulatedBuyPrice,0)/o.length,marginRate:o.reduce((c,p)=>c+p.marginRate,0)/o.length,midPrice:o.reduce((c,p)=>c+p.midPrice,0)/o.length,emptyBook:o.reduce((c,p)=>c+p.emptyBook,0)/o.length,settleHighPrice:o.reduce((c,p)=>c+p.settleHighPrice,0)/o.length,settleLowPrice:o.reduce((c,p)=>c+p.settleLowPrice,0)/o.length,priorSettlePrice:o.reduce((c,p)=>c+p.priorSettlePrice,0)/o.length,sessionHighBid:o.reduce((c,p)=>c+p.sessionHighBid,0)/o.length,sessionLowOffer:o.reduce((c,p)=>c+p.sessionLowOffer,0)/o.length,earlyPrices:o.reduce((c,p)=>c+p.earlyPrices,0)/o.length,auctionClearingPrice:o.reduce((c,p)=>c+p.auctionClearingPrice,0)/o.length,swapValueFactor:o.reduce((c,p)=>c+p.swapValueFactor,0)/o.length,dailyValueAdjustmentForLongPositions:o.reduce((c,p)=>c+p.dailyValueAdjustmentForLongPositions,0)/o.length,cumulativeValueAdjustmentForLongPositions:o.reduce((c,p)=>c+p.cumulativeValueAdjustmentForLongPositions,0)/o.length,dailyValueAdjustmentForShortPositions:o.reduce((c,p)=>c+p.dailyValueAdjustmentForShortPositions,0)/o.length,cumulativeValueAdjustmentForShortPositions:o.reduce((c,p)=>c+p.cumulativeValueAdjustmentForShortPositions,0)/o.length,fixingPrice:o.reduce((c,p)=>c+p.fixingPrice,0)/o.length,cashRate:o.reduce((c,p)=>c+p.cashRate,0)/o.length,recoveryRate:o.reduce((c,p)=>c+p.recoveryRate,0)/o.length,recoveryRateForLong:o.reduce((c,p)=>c+p.recoveryRateForLong,0)/o.length,recoveryRateForShort:o.reduce((c,p)=>c+p.recoveryRateForShort,0)/o.length,marketBid:o.reduce((c,p)=>c+p.marketBid,0)/o.length,marketOffer:o.reduce((c,p)=>c+p.marketOffer,0)/o.length,shortSaleMinPrice:o.reduce((c,p)=>c+p.shortSaleMinPrice,0)/o.length,previousClosingPrice:o.reduce((c,p)=>c+p.previousClosingPrice,0)/o.length,thresholdLimitPriceBanding:o.reduce((c,p)=>c+p.thresholdLimitPriceBanding,0)/o.length,dailyFinancingValue:o.reduce((c,p)=>c+p.dailyFinancingValue,0)/o.length,accruedFinancingValue:o.reduce((c,p)=>c+p.accruedFinancingValue,0)/o.length,twap:o.reduce((c,p)=>c+p.twap,0)/o.length};d.push(s)}return d.push(t[t.length-1]),d},Nu=t=>async e=>{try{let d=e.symbol,i=t.get(d)||[];if(i.length===0)return{content:[{type:"text",text:`No price data available for ${d}`,uri:"getStockGraph"}]};let a=Ru(i,500),n=new wg;n.setWidth(1200),n.setHeight(600),n.setBackgroundColor("transparent");let r=a.map(F=>new Date(F.timestamp).toLocaleTimeString()),o=a.map(F=>F.bid),s=a.map(F=>F.offer),c=a.map(F=>F.spread),p=a.map(F=>F.volume),u=a.map(F=>F.trade),m=a.map(F=>F.vwap),S=a.map(F=>F.twap),g=Math.max(...p.filter(F=>F>0)),y=Math.max(...o,...s,...u,...m,...S),P=p.map(F=>F/g*y*.3),f={type:"line",data:{labels:r,datasets:[{label:"Bid",data:o,borderColor:"#28a745",backgroundColor:"rgba(40, 167, 69, 0.1)",fill:!1,tension:.4},{label:"Offer",data:s,borderColor:"#dc3545",backgroundColor:"rgba(220, 53, 69, 0.1)",fill:!1,tension:.4},{label:"Spread",data:c,borderColor:"#6c757d",backgroundColor:"rgba(108, 117, 125, 0.1)",fill:!1,tension:.4},{label:"Trade",data:u,borderColor:"#ffc107",backgroundColor:"rgba(255, 193, 7, 0.1)",fill:!1,tension:.4},{label:"VWAP",data:m,borderColor:"#17a2b8",backgroundColor:"rgba(23, 162, 184, 0.1)",fill:!1,tension:.4},{label:"TWAP",data:S,borderColor:"#6610f2",backgroundColor:"rgba(102, 16, 242, 0.1)",fill:!1,tension:.4},{label:"Volume (Normalized)",data:P,borderColor:"#007bff",backgroundColor:"rgba(0, 123, 255, 0.1)",fill:!0,tension:.4}]},options:{responsive:!0,plugins:{title:{display:!0,text:`${d} Market Data (Volume normalized to 30% of max price)`}},scales:{y:{beginAtZero:!1,title:{display:!0,text:"Price / Normalized Volume"}}}}};return n.setConfig(f),{content:[{type:"resource",resource:{uri:"resource://graph",mimeType:"image/png",blob:(await n.toBinary()).toString("base64")}}]}}catch(d){return{content:[{type:"text",text:`Error: ${d instanceof Error?d.message:"Failed to generate graph"}`,uri:"getStockGraph"}],isError:!0}}},Au=t=>async e=>{try{let d=e.symbol,i=t.get(d)||[];if(i.length===0)return{content:[{type:"text",text:`No price data available for ${d}`,uri:"getStockPriceHistory"}]};let a=Ru(i,500);return{content:[{type:"text",text:JSON.stringify({symbol:d,count:a.length,originalCount:i.length,data:a.map(n=>({timestamp:new Date(n.timestamp).toISOString(),bid:n.bid,offer:n.offer,spread:n.spread,volume:n.volume,trade:n.trade,indexValue:n.indexValue,openingPrice:n.openingPrice,closingPrice:n.closingPrice,settlementPrice:n.settlementPrice,tradingSessionHighPrice:n.tradingSessionHighPrice,tradingSessionLowPrice:n.tradingSessionLowPrice,vwap:n.vwap,imbalance:n.imbalance,openInterest:n.openInterest,compositeUnderlyingPrice:n.compositeUnderlyingPrice,simulatedSellPrice:n.simulatedSellPrice,simulatedBuyPrice:n.simulatedBuyPrice,marginRate:n.marginRate,midPrice:n.midPrice,emptyBook:n.emptyBook,settleHighPrice:n.settleHighPrice,settleLowPrice:n.settleLowPrice,priorSettlePrice:n.priorSettlePrice,sessionHighBid:n.sessionHighBid,sessionLowOffer:n.sessionLowOffer,earlyPrices:n.earlyPrices,auctionClearingPrice:n.auctionClearingPrice,swapValueFactor:n.swapValueFactor,dailyValueAdjustmentForLongPositions:n.dailyValueAdjustmentForLongPositions,cumulativeValueAdjustmentForLongPositions:n.cumulativeValueAdjustmentForLongPositions,dailyValueAdjustmentForShortPositions:n.dailyValueAdjustmentForShortPositions,cumulativeValueAdjustmentForShortPositions:n.cumulativeValueAdjustmentForShortPositions,fixingPrice:n.fixingPrice,cashRate:n.cashRate,recoveryRate:n.recoveryRate,recoveryRateForLong:n.recoveryRateForLong,recoveryRateForShort:n.recoveryRateForShort,marketBid:n.marketBid,marketOffer:n.marketOffer,shortSaleMinPrice:n.shortSaleMinPrice,previousClosingPrice:n.previousClosingPrice,thresholdLimitPriceBanding:n.thresholdLimitPriceBanding,dailyFinancingValue:n.dailyFinancingValue,accruedFinancingValue:n.accruedFinancingValue,twap:n.twap}))},null,2),uri:"getStockPriceHistory"}]}}catch(d){return{content:[{type:"text",text:`Error: ${d instanceof Error?d.message:"Failed to get price history"}`,uri:"getStockPriceHistory"}],isError:!0}}};var Mg={1:"Market",2:"Limit",3:"Stop",4:"StopLimit",5:"MarketOnClose",6:"WithOrWithout",7:"LimitOrBetter",8:"LimitWithOrWithout",9:"OnBasis",A:"OnClose",B:"LimitOnClose",C:"ForexMarket",D:"PreviouslyQuoted",E:"PreviouslyIndicated",F:"ForexLimit",G:"ForexSwap",H:"ForexPreviouslyQuoted",I:"Funari",J:"MarketIfTouched",K:"MarketWithLeftOverAsLimit",L:"PreviousFundValuationPoint",M:"NextFundValuationPoint",P:"Pegged",Q:"CounterOrderSelection",R:"StopOnBidOrOffer",S:"StopLimitOnBidOrOffer"},xg={1:"Buy",2:"Sell",3:"BuyMinus",4:"SellPlus",5:"SellShort",6:"SellShortExempt",7:"Undisclosed",8:"Cross",9:"CrossShort",A:"CrossShortExempt",B:"AsDefined",C:"Opposite",D:"Subscribe",E:"Redeem",F:"Lend",G:"Borrow",H:"SellUndisclosed"},Lg={0:"Day",1:"GoodTillCancel",2:"AtTheOpening",3:"ImmediateOrCancel",4:"FillOrKill",5:"GoodTillCrossing",6:"GoodTillDate",7:"AtTheClose",8:"GoodThroughCrossing",9:"AtCrossing",A:"GoodForTime",B:"GoodForAuction",C:"GoodForMonth"},Og={1:"AutomatedExecutionNoIntervention",2:"AutomatedExecutionInterventionOK",3:"ManualOrder"},wu=(t,e)=>async d=>{try{return e.set(d.clOrdID,{clOrdID:d.clOrdID,handlInst:d.handlInst,quantity:Number.parseFloat(String(d.quantity)),price:Number.parseFloat(String(d.price)),ordType:d.ordType,side:d.side,symbol:d.symbol,timeInForce:d.timeInForce}),{content:[{type:"text",text:`VERIFICATION: All parameters valid. Ready to proceed with order execution.
10116
10116