avo-inspector 3.0.1-alpha.1 → 3.0.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.0.1] - 2025-12-11
9
+
10
+ ### Fixed
11
+
12
+ - Fixed cache invalidation logic for branch changes in event spec fetching
13
+
8
14
  ## [3.0.0] - 2025-12-11
9
15
 
10
16
  ### Changed
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,()=>(()=>{"use strict";var e={54:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.p521_hasher=t.secp521r1=t.secp384r1=t.secp256r1=t.p521=t.p384_hasher=t.p384=t.p256_hasher=t.p256=void 0;const r=n(76),o=n(562),s=n(761),i=n(967),a=n(705),c={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},f={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},u={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},l=(0,i.Field)(c.p),h=(0,i.Field)(f.p),d=(0,i.Field)(u.p);function p(e,t){const n=(0,a.mapToCurveSimpleSWU)(e.Fp,t);return e=>n(e[0])}t.p256=(0,o.createCurve)({...c,Fp:l,lowS:!1},r.sha256),t.p256_hasher=(0,s.createHasher)(t.p256.Point,p(t.p256.Point,{A:c.a,B:c.b,Z:t.p256.Point.Fp.create(BigInt("-10"))}),{DST:"P256_XMD:SHA-256_SSWU_RO_",encodeDST:"P256_XMD:SHA-256_SSWU_NU_",p:c.p,m:1,k:128,expand:"xmd",hash:r.sha256}),t.p384=(0,o.createCurve)({...f,Fp:h,lowS:!1},r.sha384),t.p384_hasher=(0,s.createHasher)(t.p384.Point,p(t.p384.Point,{A:f.a,B:f.b,Z:t.p384.Point.Fp.create(BigInt("-12"))}),{DST:"P384_XMD:SHA-384_SSWU_RO_",encodeDST:"P384_XMD:SHA-384_SSWU_NU_",p:f.p,m:1,k:192,expand:"xmd",hash:r.sha384}),t.p521=(0,o.createCurve)({...u,Fp:d,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},r.sha512),t.secp256r1=t.p256,t.secp384r1=t.p384,t.secp521r1=t.p521,t.p521_hasher=(0,s.createHasher)(t.p521.Point,p(t.p521.Point,{A:u.a,B:u.b,Z:t.p521.Point.Fp.create(BigInt("-4"))}),{DST:"P521_XMD:SHA-512_SSWU_RO_",encodeDST:"P521_XMD:SHA-512_SSWU_NU_",p:u.p,m:1,k:256,expand:"xmd",hash:r.sha512})},76:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha512_224=t.sha512_256=t.sha384=t.sha512=t.sha224=t.sha256=t.SHA512_256=t.SHA512_224=t.SHA384=t.SHA512=t.SHA224=t.SHA256=void 0;const r=n(202),o=n(318),s=n(175),i=Uint32Array.from([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]),a=new Uint32Array(64);class c extends r.HashMD{constructor(e=32){super(64,e,8,!1),this.A=0|r.SHA256_IV[0],this.B=0|r.SHA256_IV[1],this.C=0|r.SHA256_IV[2],this.D=0|r.SHA256_IV[3],this.E=0|r.SHA256_IV[4],this.F=0|r.SHA256_IV[5],this.G=0|r.SHA256_IV[6],this.H=0|r.SHA256_IV[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:s,G:i,H:a}=this;return[e,t,n,r,o,s,i,a]}set(e,t,n,r,o,s,i,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|s,this.G=0|i,this.H=0|a}process(e,t){for(let n=0;n<16;n++,t+=4)a[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=a[e-15],n=a[e-2],r=(0,s.rotr)(t,7)^(0,s.rotr)(t,18)^t>>>3,o=(0,s.rotr)(n,17)^(0,s.rotr)(n,19)^n>>>10;a[e]=o+a[e-7]+r+a[e-16]|0}let{A:n,B:o,C:c,D:f,E:u,F:l,G:h,H:d}=this;for(let e=0;e<64;e++){const t=d+((0,s.rotr)(u,6)^(0,s.rotr)(u,11)^(0,s.rotr)(u,25))+(0,r.Chi)(u,l,h)+i[e]+a[e]|0,p=((0,s.rotr)(n,2)^(0,s.rotr)(n,13)^(0,s.rotr)(n,22))+(0,r.Maj)(n,o,c)|0;d=h,h=l,l=u,u=f+t|0,f=c,c=o,o=n,n=t+p|0}n=n+this.A|0,o=o+this.B|0,c=c+this.C|0,f=f+this.D|0,u=u+this.E|0,l=l+this.F|0,h=h+this.G|0,d=d+this.H|0,this.set(n,o,c,f,u,l,h,d)}roundClean(){(0,s.clean)(a)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,s.clean)(this.buffer)}}t.SHA256=c;class f extends c{constructor(){super(28),this.A=0|r.SHA224_IV[0],this.B=0|r.SHA224_IV[1],this.C=0|r.SHA224_IV[2],this.D=0|r.SHA224_IV[3],this.E=0|r.SHA224_IV[4],this.F=0|r.SHA224_IV[5],this.G=0|r.SHA224_IV[6],this.H=0|r.SHA224_IV[7]}}t.SHA224=f;const u=(()=>o.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(e=>BigInt(e))))(),l=(()=>u[0])(),h=(()=>u[1])(),d=new Uint32Array(80),p=new Uint32Array(80);class v extends r.HashMD{constructor(e=64){super(128,e,16,!1),this.Ah=0|r.SHA512_IV[0],this.Al=0|r.SHA512_IV[1],this.Bh=0|r.SHA512_IV[2],this.Bl=0|r.SHA512_IV[3],this.Ch=0|r.SHA512_IV[4],this.Cl=0|r.SHA512_IV[5],this.Dh=0|r.SHA512_IV[6],this.Dl=0|r.SHA512_IV[7],this.Eh=0|r.SHA512_IV[8],this.El=0|r.SHA512_IV[9],this.Fh=0|r.SHA512_IV[10],this.Fl=0|r.SHA512_IV[11],this.Gh=0|r.SHA512_IV[12],this.Gl=0|r.SHA512_IV[13],this.Hh=0|r.SHA512_IV[14],this.Hl=0|r.SHA512_IV[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:s,Dh:i,Dl:a,Eh:c,El:f,Fh:u,Fl:l,Gh:h,Gl:d,Hh:p,Hl:v}=this;return[e,t,n,r,o,s,i,a,c,f,u,l,h,d,p,v]}set(e,t,n,r,o,s,i,a,c,f,u,l,h,d,p,v){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|s,this.Dh=0|i,this.Dl=0|a,this.Eh=0|c,this.El=0|f,this.Fh=0|u,this.Fl=0|l,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|v}process(e,t){for(let n=0;n<16;n++,t+=4)d[n]=e.getUint32(t),p[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|d[e-15],n=0|p[e-15],r=o.rotrSH(t,n,1)^o.rotrSH(t,n,8)^o.shrSH(t,n,7),s=o.rotrSL(t,n,1)^o.rotrSL(t,n,8)^o.shrSL(t,n,7),i=0|d[e-2],a=0|p[e-2],c=o.rotrSH(i,a,19)^o.rotrBH(i,a,61)^o.shrSH(i,a,6),f=o.rotrSL(i,a,19)^o.rotrBL(i,a,61)^o.shrSL(i,a,6),u=o.add4L(s,f,p[e-7],p[e-16]),l=o.add4H(u,r,c,d[e-7],d[e-16]);d[e]=0|l,p[e]=0|u}let{Ah:n,Al:r,Bh:s,Bl:i,Ch:a,Cl:c,Dh:f,Dl:u,Eh:v,El:y,Fh:g,Fl:b,Gh:m,Gl:w,Hh:E,Hl:S}=this;for(let e=0;e<80;e++){const t=o.rotrSH(v,y,14)^o.rotrSH(v,y,18)^o.rotrBH(v,y,41),I=o.rotrSL(v,y,14)^o.rotrSL(v,y,18)^o.rotrBL(v,y,41),A=v&g^~v&m,x=y&b^~y&w,B=o.add5L(S,I,x,h[e],p[e]),_=o.add5H(B,E,t,A,l[e],d[e]),O=0|B,H=o.rotrSH(n,r,28)^o.rotrBH(n,r,34)^o.rotrBH(n,r,39),P=o.rotrSL(n,r,28)^o.rotrBL(n,r,34)^o.rotrBL(n,r,39),F=n&s^n&a^s&a,T=r&i^r&c^i&c;E=0|m,S=0|w,m=0|g,w=0|b,g=0|v,b=0|y,({h:v,l:y}=o.add(0|f,0|u,0|_,0|O)),f=0|a,u=0|c,a=0|s,c=0|i,s=0|n,i=0|r;const L=o.add3L(O,P,T);n=o.add3H(L,_,H,F),r=0|L}({h:n,l:r}=o.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:s,l:i}=o.add(0|this.Bh,0|this.Bl,0|s,0|i)),({h:a,l:c}=o.add(0|this.Ch,0|this.Cl,0|a,0|c)),({h:f,l:u}=o.add(0|this.Dh,0|this.Dl,0|f,0|u)),({h:v,l:y}=o.add(0|this.Eh,0|this.El,0|v,0|y)),({h:g,l:b}=o.add(0|this.Fh,0|this.Fl,0|g,0|b)),({h:m,l:w}=o.add(0|this.Gh,0|this.Gl,0|m,0|w)),({h:E,l:S}=o.add(0|this.Hh,0|this.Hl,0|E,0|S)),this.set(n,r,s,i,a,c,f,u,v,y,g,b,m,w,E,S)}roundClean(){(0,s.clean)(d,p)}destroy(){(0,s.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=v;class y extends v{constructor(){super(48),this.Ah=0|r.SHA384_IV[0],this.Al=0|r.SHA384_IV[1],this.Bh=0|r.SHA384_IV[2],this.Bl=0|r.SHA384_IV[3],this.Ch=0|r.SHA384_IV[4],this.Cl=0|r.SHA384_IV[5],this.Dh=0|r.SHA384_IV[6],this.Dl=0|r.SHA384_IV[7],this.Eh=0|r.SHA384_IV[8],this.El=0|r.SHA384_IV[9],this.Fh=0|r.SHA384_IV[10],this.Fl=0|r.SHA384_IV[11],this.Gh=0|r.SHA384_IV[12],this.Gl=0|r.SHA384_IV[13],this.Hh=0|r.SHA384_IV[14],this.Hl=0|r.SHA384_IV[15]}}t.SHA384=y;const g=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),b=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class m extends v{constructor(){super(28),this.Ah=0|g[0],this.Al=0|g[1],this.Bh=0|g[2],this.Bl=0|g[3],this.Ch=0|g[4],this.Cl=0|g[5],this.Dh=0|g[6],this.Dl=0|g[7],this.Eh=0|g[8],this.El=0|g[9],this.Fh=0|g[10],this.Fl=0|g[11],this.Gh=0|g[12],this.Gl=0|g[13],this.Hh=0|g[14],this.Hl=0|g[15]}}t.SHA512_224=m;class w extends v{constructor(){super(32),this.Ah=0|b[0],this.Al=0|b[1],this.Bh=0|b[2],this.Bl=0|b[3],this.Ch=0|b[4],this.Cl=0|b[5],this.Dh=0|b[6],this.Dl=0|b[7],this.Eh=0|b[8],this.El=0|b[9],this.Fh=0|b[10],this.Fl=0|b[11],this.Gh=0|b[12],this.Gl=0|b[13],this.Hh=0|b[14],this.Hl=0|b[15]}}t.SHA512_256=w,t.sha256=(0,s.createHasher)(()=>new c),t.sha224=(0,s.createHasher)(()=>new f),t.sha512=(0,s.createHasher)(()=>new v),t.sha384=(0,s.createHasher)(()=>new y),t.sha512_256=(0,s.createHasher)(()=>new w),t.sha512_224=(0,s.createHasher)(()=>new m)},145:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},175:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=o,t.anumber=s,t.abytes=i,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");s(e.outputLen),s(e.blockLen)},t.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},t.aoutput=function(e,t){i(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.clean=function(...e){for(let t=0;t<e.length;t++)e[t].fill(0)},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=a,t.byteSwap32=c,t.bytesToHex=function(e){if(i(e),f)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=u[e[n]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(f)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){const n=h(e.charCodeAt(o)),s=h(e.charCodeAt(o+1));if(void 0===n||void 0===s){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}r[t]=16*n+s}return r},t.asyncLoop=async function(e,n,r){let o=Date.now();for(let s=0;s<e;s++){r(s);const e=Date.now()-o;e>=0&&e<n||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=d,t.bytesToUtf8=function(e){return(new TextDecoder).decode(e)},t.toBytes=p,t.kdfInputToBytes=function(e){return"string"==typeof e&&(e=d(e)),i(e),e},t.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];i(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("options should be object or undefined");return Object.assign(e,t)},t.createHasher=v,t.createOptHasher=y,t.createXOFer=g,t.randomBytes=function(e=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));if(r.crypto&&"function"==typeof r.crypto.randomBytes)return Uint8Array.from(r.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")};const r=n(145);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function i(e,...t){if(!o(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function a(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function c(e){for(let t=0;t<e.length;t++)e[t]=a(e[t]);return e}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.swap8IfBE=t.isLE?e=>e:e=>a(e),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?e=>e:c;const f=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),l={_0:48,_9:57,A:65,F:70,a:97,f:102};function h(e){return e>=l._0&&e<=l._9?e-l._0:e>=l.A&&e<=l.F?e-(l.A-10):e>=l.a&&e<=l.f?e-(l.a-10):void 0}function d(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function p(e){return"string"==typeof e&&(e=d(e)),i(e),e}function v(e){const t=t=>e().update(p(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function y(e){const t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function g(e){const t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}t.nextTick=async()=>{},t.Hash=class{},t.wrapConstructor=v,t.wrapConstructorWithOpts=y,t.wrapXOFConstructorWithOpts=g},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isValueEmpty=void 0,t.deepEquals=function e(t,n){if(t===n)return!0;if(!(t instanceof Object&&n instanceof Object))return!1;if(t.constructor!==n.constructor)return!1;for(var r in t)if(t.hasOwnProperty(r)){if(!n.hasOwnProperty(r))return!1;if(t[r]!==n[r]){if("object"!=typeof t[r])return!1;if(!e(t[r],n[r]))return!1}}for(r in n)if(n.hasOwnProperty(r)&&!t.hasOwnProperty(r))return!1;return!0},t.isValueEmpty=function(e){return null==e||0==e.trim().length}},190:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoEventSpecFetcher=void 0;var o=function(){function e(e,t,n,r){void 0===e&&(e=2e3),void 0===t&&(t=!1),void 0===r&&(r="https://api.avo.app"),this.baseUrl=r,this.timeout=e,this.shouldLog=t,this.env=n,this.inFlightRequests=new Map}return e.prototype.generateRequestKey=function(e){return"".concat(e.streamId,":").concat(e.eventName)},e.prototype.fetch=function(e){return n(this,void 0,void 0,function(){var t,n,o;return r(this,function(r){switch(r.label){case 0:if(t=this.generateRequestKey(e),n=this.inFlightRequests.get(t))return this.shouldLog&&console.log("[EventSpecFetcher] Returning existing in-flight request for streamId=".concat(e.streamId,", eventName=").concat(e.eventName)),[2,n];o=this.fetchInternal(e),this.inFlightRequests.set(t,o),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,o];case 2:return[2,r.sent()];case 3:return this.inFlightRequests.delete(t),[7];case 4:return[2]}})})},e.prototype.fetchInternal=function(t){return n(this,void 0,void 0,function(){var n,o,s,i;return r(this,function(r){switch(r.label){case 0:if("dev"!==this.env&&"staging"!==this.env)return[2,null];n=this.buildUrl(t),this.shouldLog&&(console.log("[EventSpecFetcher] Fetching event spec for: ".concat(t.eventName)),console.log("[EventSpecFetcher] Using base URL: ".concat(this.baseUrl))),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.makeRequest(n)];case 2:return(o=r.sent())?this.hasExpectedShape(o)?(s=e.parseEventSpecResponse(o),this.shouldLog&&console.log("[EventSpecFetcher] Successfully fetched event spec for: ".concat(t.eventName)),[2,s]):(this.shouldLog&&console.warn("[EventSpecFetcher] Invalid event spec response for: ".concat(t.eventName)),[2,null]):(this.shouldLog&&console.warn("[EventSpecFetcher] Failed to fetch event spec for: ".concat(t.eventName)),[2,null]);case 3:return i=r.sent(),this.shouldLog&&console.error("[EventSpecFetcher] Error fetching event spec for: ".concat(t.eventName),i),[2,null];case 4:return[2]}})})},e.prototype.buildUrl=function(e){var t=new URLSearchParams({apiKey:e.apiKey,streamId:e.streamId,eventName:e.eventName});return"".concat(this.baseUrl,"/trackingPlan/eventSpec?").concat(t.toString())},e.prototype.makeRequest=function(e){var t=this;return new Promise(function(n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.timeout=t.timeout,r.onload=function(){if(200===r.status)try{var e=JSON.parse(r.responseText);n(e)}catch(e){t.shouldLog&&console.error("[EventSpecFetcher] Failed to parse response:",e),n(null)}else t.shouldLog&&console.warn("[EventSpecFetcher] Request failed with status: ".concat(r.status)),n(null)},r.onerror=function(){t.shouldLog&&console.error("[EventSpecFetcher] Network error occurred"),n(null)},r.ontimeout=function(){t.shouldLog&&console.error("[EventSpecFetcher] Request timed out after ".concat(t.timeout,"ms")),n(null)},r.send()})},e.prototype.hasExpectedShape=function(e){return e&&"object"==typeof e&&Array.isArray(e.events)&&e.metadata&&"object"==typeof e.metadata&&"string"==typeof e.metadata.schemaId&&"string"==typeof e.metadata.branchId&&"string"==typeof e.metadata.latestActionId},e.parseEventSpecResponse=function(t){return{events:t.events.map(e.parseEventSpecEntry),metadata:t.metadata}},e.parseEventSpecEntry=function(t){for(var n={},r=0,o=Object.entries(t.p);r<o.length;r++){var s=o[r],i=Reflect.get(s,"0"),a=Reflect.get(s,"1");Reflect.set(n,i,e.parsePropertyConstraints(a))}return{branchId:t.b,baseEventId:t.id,variantIds:t.vids,props:n}},e.parsePropertyConstraints=function(t){var n={type:t.t,required:t.r};if(t.l&&(n.isList=t.l),t.p&&(n.pinnedValues=t.p),t.v&&(n.allowedValues=t.v),t.rx&&(n.regexPatterns=t.rx),t.minmax&&(n.minMaxRanges=t.minmax),t.children){n.children={};for(var r=0,o=Object.entries(t.children);r<o.length;r++){var s=o[r],i=s[0],a=s[1];n.children[i]=e.parsePropertyConstraints(a)}}return n},e}();t.AvoEventSpecFetcher=o},202:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SHA512_IV=t.SHA384_IV=t.SHA224_IV=t.SHA256_IV=t.HashMD=void 0,t.setBigUint64=o,t.Chi=function(e,t,n){return e&t^~e&n},t.Maj=function(e,t,n){return e&t^e&n^t&n};const r=n(175);function o(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),a=Number(n&s),c=r?4:0,f=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+f,a,r)}class s extends r.Hash{constructor(e,t,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(e),this.view=(0,r.createView)(this.buffer)}update(e){(0,r.aexists)(this),e=(0,r.toBytes)(e),(0,r.abytes)(e);const{view:t,buffer:n,blockLen:o}=this,s=e.length;for(let i=0;i<s;){const a=Math.min(o-this.pos,s-i);if(a===o){const t=(0,r.createView)(e);for(;o<=s-i;i+=o)this.process(t,i);continue}n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,r.aexists)(this),(0,r.aoutput)(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:s,isLE:i}=this;let{pos:a}=this;t[a++]=128,(0,r.clean)(this.buffer.subarray(a)),this.padOffset>s-a&&(this.process(n,0),a=0);for(let e=a;e<s;e++)t[e]=0;o(n,s-8,BigInt(8*this.length),i),this.process(n,0);const c=(0,r.createView)(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=f/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<u;e++)c.setUint32(4*e,l[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:s,pos:i}=this;return e.destroyed=s,e.finished=o,e.length=r,e.pos=i,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}t.HashMD=s,t.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),t.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),t.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),t.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])},243:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoNetworkCallsHandler=void 0;var r=n(249),o=n(611),s=n(829),i=function(){function e(e,t,n,r,o,s){this.samplingRate=1,this.sending=!1,this.apiKey=e,this.envName=t,this.appName=n,this.appVersion=r,this.libVersion=o,this.publicEncryptionKey=s}return e.prototype.callInspectorWithBatchBody=function(e,t){var n=this;if(this.sending)t(new Error("Batch sending cancelled because another batch sending is in progress. Your events will be sent with next batch."));else{var r=e.filter(function(e){return null!=e});this.fixStreamIds(r),0!==r.length&&(this.shouldDropBySampling()?o.AvoInspector.shouldLog&&console.log("Avo Inspector: last event schema dropped due to sampling rate."):(o.AvoInspector.shouldLog&&(console.log("Avo Inspector: events",r),r.forEach(function(e){"sessionStarted"===e.type?console.log("Avo Inspector: sending session started event."):"event"===e.type&&console.log("Avo Inspector: sending event "+e.eventName+" with schema "+JSON.stringify(e.eventProperties))})),this.sending=!0,this.callInspectorApi(r,function(e){n.sending=!1,t(e)})))}},e.prototype.fixStreamIds=function(e){var t=null;e.forEach(function(e){null!==e.streamId&&void 0!==e.streamId&&"unknown"!==e.streamId&&(t=e.streamId)}),e.forEach(function(e){"unknown"===e.streamId&&(e.streamId=null!=t?t:s.AvoStreamId.streamId)})},e.prototype.bodyForSessionStartedCall=function(){var e=this.createBaseCallBody();return e.type="sessionStarted",e},e.prototype.bodyForEventSchemaCall=function(e,t,n,r,o,s){var i=this.createBaseCallBody();return i.type="event",i.eventName=e,i.eventProperties=t,null!=n?(i.avoFunction=!0,i.eventId=n,i.eventHash=r):(i.avoFunction=!1,i.eventId=null,i.eventHash=null),o&&(i.eventSpecMetadata=o),s&&(i.validatedBranchId=s),i},e.prototype.createBaseCallBody=function(){var e={apiKey:this.apiKey,appName:this.appName,appVersion:this.appVersion,libVersion:this.libVersion,env:this.envName,libPlatform:"web",messageId:r.default.newGuid(),trackingId:"",createdAt:(new Date).toISOString(),sessionId:"",streamId:s.AvoStreamId.streamId,samplingRate:this.samplingRate};return this.publicEncryptionKey&&(e.publicEncryptionKey=this.publicEncryptionKey),e},e.prototype.callInspectorImmediately=function(e,t){"unknown"===e.streamId&&(e.streamId=s.AvoStreamId.streamId),o.AvoInspector.shouldLog&&(console.log("Avo Inspector: calling inspector immediately (with validation)",e.eventName),console.log("Avo Inspector: event body",e)),this.callInspectorApi([e],t)},e.prototype.shouldDropBySampling=function(){return Math.random()>this.samplingRate},e.prototype.callInspectorApi=function(t,n){var r=this,s=new XMLHttpRequest;s.open("POST",e.trackingEndpoint,!0),s.setRequestHeader("Content-Type","text/plain"),s.timeout=o.AvoInspector.networkTimeout,s.send(JSON.stringify(t)),s.onload=function(){if(200!==s.status)n(new Error("Error ".concat(s.status,": ").concat(s.statusText)));else{var e=void 0;try{e=JSON.parse(s.response)}catch(e){return void n(new Error("Failed to parse response: ".concat(e instanceof Error?e.message:String(e))))}null==e||"number"!=typeof e.samplingRate||isNaN(e.samplingRate)||(r.samplingRate=e.samplingRate),n(null)}},s.onerror=function(){n(new Error("Request failed"))},s.ontimeout=function(){n(new Error("Request timed out"))}},e.trackingEndpoint="https://api.avo.app/inspector/v1/track",e}();t.AvoNetworkCallsHandler=i},249:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}();t.default=n},318:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toBig=t.shrSL=t.shrSH=t.rotrSL=t.rotrSH=t.rotrBL=t.rotrBH=t.rotr32L=t.rotr32H=t.rotlSL=t.rotlSH=t.rotlBL=t.rotlBH=t.add5L=t.add5H=t.add4L=t.add4H=t.add3L=t.add3H=void 0,t.add=m,t.fromBig=o,t.split=s;const n=BigInt(2**32-1),r=BigInt(32);function o(e,t=!1){return t?{h:Number(e&n),l:Number(e>>r&n)}:{h:0|Number(e>>r&n),l:0|Number(e&n)}}function s(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:a}=o(e[i],t);[r[i],s[i]]=[n,a]}return[r,s]}const i=(e,t)=>BigInt(e>>>0)<<r|BigInt(t>>>0);t.toBig=i;const a=(e,t,n)=>e>>>n;t.shrSH=a;const c=(e,t,n)=>e<<32-n|t>>>n;t.shrSL=c;const f=(e,t,n)=>e>>>n|t<<32-n;t.rotrSH=f;const u=(e,t,n)=>e<<32-n|t>>>n;t.rotrSL=u;const l=(e,t,n)=>e<<64-n|t>>>n-32;t.rotrBH=l;const h=(e,t,n)=>e>>>n-32|t<<64-n;t.rotrBL=h;const d=(e,t)=>t;t.rotr32H=d;const p=(e,t)=>e;t.rotr32L=p;const v=(e,t,n)=>e<<n|t>>>32-n;t.rotlSH=v;const y=(e,t,n)=>t<<n|e>>>32-n;t.rotlSL=y;const g=(e,t,n)=>t<<n-32|e>>>64-n;t.rotlBH=g;const b=(e,t,n)=>e<<n-32|t>>>64-n;function m(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}t.rotlBL=b;const w=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);t.add3L=w;const E=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;t.add3H=E;const S=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);t.add4L=S;const I=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0;t.add4H=I;const A=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0);t.add5L=A;const x=(e,t,n,r,o,s)=>t+n+r+o+s+(e/2**32|0)|0;t.add5H=x;const B={fromBig:o,split:s,toBig:i,shrSH:a,shrSL:c,rotrSH:f,rotrSL:u,rotrBH:l,rotrBL:h,rotr32H:d,rotr32L:p,rotlSH:v,rotlSL:y,rotlBH:g,rotlBL:b,add:m,add3L:w,add3H:E,add4L:S,add4H:I,add5H:x,add5L:A};t.default=B},330:e=>{e.exports=JSON.parse('{"rE":"3.0.1-alpha.1"}')},422:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wNAF=void 0,t.negateCt=a,t.normalizeZ=function(e,t){const n=(0,o.FpInvertBatch)(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))},t.mulEndoUnsafe=function(e,t,n,r){let o=t,a=e.ZERO,c=e.ZERO;for(;n>s||r>s;)n&i&&(a=a.add(o)),r&i&&(c=c.add(o)),o=o.double(),n>>=i,r>>=i;return{p1:a,p2:c}},t.pippenger=function(e,t,n,o){l(n,e),h(o,t);const s=n.length,i=o.length;if(s!==i)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,c=(0,r.bitLen)(BigInt(s));let f=1;c>12?f=c-3:c>4?f=c-2:c>0&&(f=2);const u=(0,r.bitMask)(f),d=new Array(Number(u)+1).fill(a);let p=a;for(let e=Math.floor((t.BITS-1)/f)*f;e>=0;e-=f){d.fill(a);for(let t=0;t<i;t++){const r=o[t],s=Number(r>>BigInt(e)&u);d[s]=d[s].add(n[t])}let t=a;for(let e=d.length-1,n=a;e>0;e--)n=n.add(d[e]),t=t.add(n);if(p=p.add(t),0!==e)for(let e=0;e<f;e++)p=p.double()}return p},t.precomputeMSMUnsafe=function(e,t,n,o){c(o,t.BITS),l(n,e);const s=e.ZERO,i=2**o-1,a=Math.ceil(t.BITS/o),f=(0,r.bitMask)(o),u=n.map(e=>{const t=[];for(let n=0,r=e;n<i;n++)t.push(r),r=r.add(e);return t});return e=>{if(h(e,t),e.length>n.length)throw new Error("array of scalars must be smaller than array of points");let r=s;for(let t=0;t<a;t++){if(r!==s)for(let e=0;e<o;e++)r=r.double();const n=BigInt(a*o-(t+1)*o);for(let t=0;t<e.length;t++){const o=e[t],s=Number(o>>n&f);s&&(r=r.add(u[t][s-1]))}}return r}},t.validateBasic=function(e){return(0,o.validateField)(e.Fp),(0,r.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,o.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})},t._createCurveFields=function(e,t,n={},r){if(void 0===r&&(r="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const n=t[e];if(!("bigint"==typeof n&&n>s))throw new Error(`CURVE.${e} must be positive bigint`)}const o=g(t.p,n.Fp,r),i=g(t.n,n.Fn,r),a=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of a)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}};const r=n(627),o=n(967),s=BigInt(0),i=BigInt(1);function a(e,t){const n=t.negate();return e?n:t}function c(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function f(e,t){c(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:(0,r.bitMask)(e),maxNumber:n,shiftBy:BigInt(e)}}function u(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:a}=n;let c=Number(e&o),f=e>>a;c>r&&(c-=s,f+=i);const u=t*r;return{nextN:f,offset:u+Math.abs(c)-1,isZero:0===c,isNeg:c<0,isNegF:t%2!=0,offsetF:u}}function l(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}function h(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}const d=new WeakMap,p=new WeakMap;function v(e){return p.get(e)||1}function y(e){if(e!==s)throw new Error("invalid wNAF")}function g(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,o.validateField)(t),t}return(0,o.Field)(e,{isLE:n})}t.wNAF=class{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>s;)t&i&&(n=n.add(r)),r=r.double(),t>>=i;return n}precomputeWindow(e,t){const{windows:n,windowSize:r}=f(t,this.bits),o=[];let s=e,i=s;for(let e=0;e<n;e++){i=s,o.push(i);for(let e=1;e<r;e++)i=i.add(s),o.push(i);s=i.double()}return o}wNAF(e,t,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let r=this.ZERO,o=this.BASE;const s=f(e,this.bits);for(let e=0;e<s.windows;e++){const{nextN:i,offset:c,isZero:f,isNeg:l,isNegF:h,offsetF:d}=u(n,e,s);n=i,f?o=o.add(a(h,t[d])):r=r.add(a(l,t[c]))}return y(n),{p:r,f:o}}wNAFUnsafe(e,t,n,r=this.ZERO){const o=f(e,this.bits);for(let e=0;e<o.windows&&n!==s;e++){const{nextN:s,offset:i,isZero:a,isNeg:c}=u(n,e,o);if(n=s,!a){const e=t[i];r=r.add(c?e.negate():e)}}return y(n),r}getPrecomputes(e,t,n){let r=d.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&("function"==typeof n&&(r=n(r)),d.set(t,r))),r}cached(e,t,n){const r=v(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){const o=v(e);return 1===o?this._unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)}createCache(e,t){c(t,this.bits),p.set(e,t),d.delete(e)}hasCache(e){return 1!==v(e)}}},491:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoStorage=void 0;var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.useFallbackStorage=!1,t.fallbackStorage={},t.storageInitialized=!1,t.onStorageInitFuncs=[],t.shouldLog=!1,t.suffix="",t}return r(t,e),t.prototype.init=function(e,t){this.shouldLog=e,this.suffix=t,this.initializeStorageWeb(this.isLocalStorageAvailable())},t.prototype.initializeStorageWeb=function(e){this.storageInitialized=!0,e||(this.useFallbackStorage=!0),this.onStorageInitFuncs.forEach(function(e){e()})},t.prototype.isLocalStorageAvailable=function(){var e=(new Date).toISOString();try{return window.localStorage.setItem(e,e),window.localStorage.getItem(e)===e&&(window.localStorage.removeItem(e),!0)}catch(e){return!1}},t.prototype.isInitialized=function(){return this.storageInitialized},t.prototype.getItemAsync=function(e){return o(this,void 0,void 0,function(){var t=this;return s(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n,r){t.runAfterInit(function(){if(t.useFallbackStorage){var r=t.fallbackStorage[e+t.suffix];n(t.parseJson(r))}else if("undefined"!=typeof window){r=void 0;try{r=window.localStorage.getItem(e+t.suffix)}catch(e){t.shouldLog&&console.error("Avo Inspector Storage getItemAsync error:",e),n(null)}n(t.parseJson(r))}else n(null)})})];case 1:return[2,n.sent()]}})})},t.prototype.getItem=function(e){var t;if(this.storageInitialized){if(this.useFallbackStorage)t=this.fallbackStorage[e+this.suffix];else if("undefined"!=typeof window)try{t=window.localStorage.getItem(e+this.suffix)}catch(e){this.shouldLog&&console.error("Avo Inspector Storage getItem error:",e)}}else t=null;return this.parseJson(t)},t.prototype.setItem=function(e,t){var n=this;this.runAfterInit(function(){if(n.useFallbackStorage)n.fallbackStorage[e+n.suffix]=JSON.stringify(t);else if("undefined"!=typeof window)try{window.localStorage.setItem(e+n.suffix,JSON.stringify(t))}catch(e){n.shouldLog&&console.error("Avo Inspector Storage setItem error:",e)}})},t.prototype.removeItem=function(e){var t=this;this.runAfterInit(function(){if(t.useFallbackStorage)t.fallbackStorage[e+t.suffix]=null;else if("undefined"!=typeof window)try{window.localStorage.removeItem(e+t.suffix)}catch(e){t.shouldLog&&console.error("Avo Inspector Storage removeItem error:",e)}})},t.prototype.runAfterInit=function(e){this.storageInitialized?e():this.onStorageInitFuncs.push(e)},t}(function(){function e(){}return e.prototype.parseJson=function(e){return null!=e?JSON.parse(e):null},e}()),a=function(){function e(e,t){void 0===t&&(t=""),this.Platform=null,this.Platform="browser",this.storageImpl=new i,this.storageImpl.init(e,t)}return e.prototype.isInitialized=function(){return this.storageImpl.isInitialized()},e.prototype.getItemAsync=function(e){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this.storageImpl.getItemAsync(e)];case 1:return[2,t.sent()]}})})},e.prototype.getItem=function(e){return this.storageImpl.getItem(e)},e.prototype.setItem=function(e,t){this.storageImpl.setItem(e,t)},e.prototype.removeItem=function(e){this.storageImpl.removeItem(e)},e.prototype.runAfterInit=function(e){this.storageImpl.runAfterInit(e)},e}();t.AvoStorage=a},492:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoDeduplicator=void 0;var s=n(924),i=n(185),a=function(){function e(){this.avoFunctionsEvents={},this.manualEvents={},this.avoFunctionsEventsParams={},this.manualEventsParams={}}return e.prototype.shouldRegisterEvent=function(e,t,n){this.clearOldEvents(),n?(this.avoFunctionsEvents[Date.now()]=e,this.avoFunctionsEventsParams[e]=t):(this.manualEvents[Date.now()]=e,this.manualEventsParams[e]=t);var r=!n;return!this.hasSameEventAs(e,t,r)},e.prototype.hasSameEventAs=function(e,t,n){var r=!1;return n?this.lookForEventIn(e,t,this.avoFunctionsEventsParams)&&(r=!0):this.lookForEventIn(e,t,this.manualEventsParams)&&(r=!0),r&&(delete this.avoFunctionsEventsParams[e],delete this.manualEventsParams[e]),r},e.prototype.lookForEventIn=function(e,t,n){for(var r in n)if(n.hasOwnProperty(r)&&r===e){var o=n[e];if(o&&(0,i.deepEquals)(t,o))return!0}return!1},e.prototype.hasSeenEventParams=function(e,t){var n=!1;return t?this.lookForEventParamsIn(e,this.avoFunctionsEventsParams)&&(n=!0):this.lookForEventParamsIn(e,this.manualEventsParams)&&(n=!0),n},e.prototype.lookForEventParamsIn=function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(r&&(0,i.deepEquals)(e,r))return!0}return!1},e.prototype.shouldRegisterSchemaFromManually=function(e,t){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return this.clearOldEvents(),[4,this.hasSameShapeInAvoFunctionsAs(e,t)];case 1:return[2,!n.sent()]}})})},e.prototype.hasSameShapeInAvoFunctionsAs=function(e,t){return r(this,void 0,void 0,function(){var n;return o(this,function(r){switch(r.label){case 0:return n=!1,[4,this.lookForEventSchemaIn(e,t,this.avoFunctionsEventsParams)];case 1:return r.sent()&&(n=!0),n&&delete this.avoFunctionsEventsParams[e],[2,n]}})})},e.prototype.lookForEventSchemaIn=function(e,t,n){return r(this,void 0,void 0,function(){var r,a,c,f,u,l;return o(this,function(o){switch(o.label){case 0:for(c in a=[],r=n)a.push(c);f=0,o.label=1;case 1:return f<a.length?(c=a[f])in r?(u=c,n.hasOwnProperty(u)?u!==e?[3,3]:[4,s.AvoSchemaParser.extractSchema(n[e])]:[3,3]):[3,3]:[3,4];case 2:if((l=o.sent())&&(0,i.deepEquals)(t,l))return[2,!0];o.label=3;case 3:return f++,[3,1];case 4:return[2,!1]}})})},e.prototype.clearOldEvents=function(){var e=Date.now();for(var t in this.avoFunctionsEvents)if(this.avoFunctionsEvents.hasOwnProperty(t)&&e-(Number(t)||0)>300){var n=this.avoFunctionsEvents[t];delete this.avoFunctionsEvents[t],delete this.avoFunctionsEventsParams[n]}for(var t in this.manualEvents)this.manualEvents.hasOwnProperty(t)&&e-(Number(t)||0)>300&&(n=this.manualEvents[t],delete this.manualEvents[t],delete this.manualEventsParams[n])},e.prototype._clearEvents=function(){this.avoFunctionsEvents={},this.manualEvents={},this.avoFunctionsEventsParams={},this.manualEventsParams={}},e}();t.AvoDeduplicator=a},499:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventSpecCache=void 0;var n=function(){function e(e){void 0===e&&(e=!1),this.TTL_MS=6e4,this.MAX_EVENT_COUNT=50,this.globalEventCount=0,this.cache=new Map,this.shouldLog=e}return e.prototype.generateKey=function(e,t,n){return"".concat(e,":").concat(t,":").concat(n)},e.prototype.get=function(e,t,n){var r=this.generateKey(e,t,n),o=this.cache.get(r);return o?this.shouldEvict(o)?(this.shouldLog&&console.log("[EventSpecCache] Cache entry expired for key: ".concat(r)),this.cache.delete(r),null):(this.shouldLog&&console.log("[EventSpecCache] Cache hit for key: ".concat(r)),o.lastAccessed=Date.now(),o.eventCount++,this.globalEventCount++,this.globalEventCount>=this.MAX_EVENT_COUNT&&(this.evictOldest(),this.globalEventCount=0),o.spec):(this.shouldLog&&console.log("[EventSpecCache] Cache miss for key: ".concat(r)),null)},e.prototype.set=function(e,t,n,r){var o=this.generateKey(e,t,n),s=Date.now(),i={spec:r,timestamp:s,lastAccessed:s,eventCount:0};this.cache.set(o,i),this.shouldLog&&console.log("[EventSpecCache] Cached spec for key: ".concat(o))},e.prototype.shouldEvict=function(e){var t=Date.now()-e.timestamp>this.TTL_MS,n=e.eventCount>=this.MAX_EVENT_COUNT;return t||n},e.prototype.evictOldest=function(){if(0!==this.cache.size){var e=null,t=1/0;this.cache.forEach(function(n,r){n.lastAccessed<t&&(t=n.lastAccessed,e=r)}),null!==e&&(this.cache.delete(e),this.shouldLog&&console.log("[EventSpecCache] Evicted LRU entry: ".concat(e)))}},e.prototype.clear=function(){this.cache.clear(),this.globalEventCount=0,this.shouldLog&&console.log("[EventSpecCache] Cache cleared")},e.prototype.size=function(){return this.cache.size},e.prototype.getStats=function(){var e=[],t=Date.now();return this.cache.forEach(function(n,r){e.push({key:r,age:t-n.timestamp,lastAccessedAgo:t-n.lastAccessed,eventCount:n.eventCount})}),{size:this.cache.size,globalEventCount:this.globalEventCount,entries:e}},e}();t.EventSpecCache=n},562:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHash=function(e){return{hash:e}},t.createCurve=function(e,t){const n=t=>(0,r.weierstrass)({...e,hash:t});return{...n(t),create:n}};const r=n(705)},611:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoInspector=void 0;var s=n(844),i=n(924),a=n(669),c=n(243),f=n(491),u=n(492),l=n(499),h=n(190),d=n(829),p=n(916),v=n(185),y=n(330).rE,g=function(){function e(t){if(this.currentBranchId=null,(0,v.isValueEmpty)(t.env)?(this.environment=s.AvoInspectorEnv.Dev,console.warn("[Avo Inspector] No environment provided. Defaulting to dev.")):Object.values(s.AvoInspectorEnv).includes(t.env)?this.environment=t.env:(this.environment=s.AvoInspectorEnv.Dev,console.warn("[Avo Inspector] Unsupported environment provided. Defaulting to dev. Supported environments - Dev, Staging, Prod.")),(0,v.isValueEmpty)(t.apiKey))throw new Error("[Avo Inspector] No API key provided. Inspector can't operate without API key.");if(this.apiKey=t.apiKey,(0,v.isValueEmpty)(t.version))throw new Error("[Avo Inspector] No version provided. Many features of Inspector rely on versioning. Please provide comparable string version, i.e. integer or semantic.");this.version=t.version,this.environment===s.AvoInspectorEnv.Dev?(e._batchSize=1,e._shouldLog=!0):(e._batchSize=30,e._batchFlushSeconds=30,e._shouldLog=!1),e.avoStorage=new f.AvoStorage(e._shouldLog,null!=t.suffix?t.suffix:""),this.publicEncryptionKey=t.publicEncryptionKey,this.avoNetworkCallsHandler=new c.AvoNetworkCallsHandler(this.apiKey,this.environment.toString(),t.appName||"",this.version,y,this.publicEncryptionKey),this.avoBatcher=new a.AvoBatcher(this.avoNetworkCallsHandler),this.avoDeduplicator=new u.AvoDeduplicator,this.streamId=d.AvoStreamId.streamId,this.streamId&&(this.eventSpecCache=new l.EventSpecCache(e._shouldLog),this.eventSpecFetcher=new h.AvoEventSpecFetcher(e._networkTimeout,e._shouldLog,this.environment),e._shouldLog&&(console.log("[Avo Inspector] Event spec fetching and validation enabled"),this.publicEncryptionKey&&console.log("[Avo Inspector] Property value encryption enabled")))}return Object.defineProperty(e,"batchSize",{get:function(){return this._batchSize},set:function(e){this._batchSize=e<1?1:e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"batchFlushSeconds",{get:function(){return this._batchFlushSeconds},enumerable:!1,configurable:!0}),Object.defineProperty(e,"shouldLog",{get:function(){return this._shouldLog},set:function(e){this._shouldLog=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"networkTimeout",{get:function(){return this._networkTimeout},set:function(e){this._networkTimeout=e},enumerable:!1,configurable:!0}),e.prototype.trackSchemaFromEvent=function(t,n){return r(this,void 0,void 0,function(){var r,s,i,a;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),this.avoDeduplicator.shouldRegisterEvent(t,n,!1)?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with params "+JSON.stringify(n)),[4,this.extractSchema(n,!1)]):[3,3];case 1:return r=o.sent(),[4,this.fetchAndValidateEvent(t,n)];case 2:return(s=o.sent())?(i=this.mergeValidationResults(r,s),this.sendEventWithValidation(t,i,null,null,s)):this.trackSchemaInternal(t,r,null,null),[2,r];case 3:return e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),[2,[]];case 4:return[3,6];case 5:return a=o.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",a),[2,[]];case 6:return[2]}})})},e.prototype._avoFunctionTrackSchemaFromEvent=function(t,n,s,i){return r(this,void 0,void 0,function(){var r,a,c,f;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),this.avoDeduplicator.shouldRegisterEvent(t,n,!0)?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with params "+JSON.stringify(n)),[4,this.extractSchema(n,!1)]):[3,3];case 1:return r=o.sent(),[4,this.fetchAndValidateEvent(t,n)];case 2:return(a=o.sent())?(c=this.mergeValidationResults(r,a),this.sendEventWithValidation(t,c,s,i,a)):this.trackSchemaInternal(t,r,s,i),[2,r];case 3:return e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),[2,[]];case 4:return[3,6];case 5:return f=o.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",f),[2,[]];case 6:return[2]}})})},e.prototype.trackSchema=function(t,n){return r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.avoDeduplicator.shouldRegisterSchemaFromManually(t,n)];case 1:return o.sent()?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with schema "+JSON.stringify(n)),[4,this.fetchEventSpecIfNeeded(t)]):[3,3];case 2:return o.sent(),this.trackSchemaInternal(t,n,null,null),[3,4];case 3:e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),o.label=4;case 4:return[3,6];case 5:return r=o.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",r),[3,6];case 6:return[2]}})})},e.prototype.trackSchemaInternal=function(e,t,n,r){try{this.avoBatcher.handleTrackSchema(e,t,n,r)}catch(e){console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",e)}},e.prototype.enableLogging=function(t){e._shouldLog=t},e.prototype.extractSchema=function(t){return r(this,arguments,void 0,function(t,n){var r;return void 0===n&&(n=!0),o(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.avoDeduplicator.hasSeenEventParams(t,!0)&&n&&e.shouldLog&&console.warn("Avo Inspector: WARNING! You are trying to extract schema shape that was just reported by your Avo Codegen. This is an indicator of duplicate inspector reporting. Please reach out to support@avo.app for advice if you are not sure how to handle this."),e.shouldLog&&console.log("Avo Inspector: extracting schema from "+JSON.stringify(t)),[4,i.AvoSchemaParser.extractSchema(t,this.publicEncryptionKey,this.environment)];case 1:return[2,o.sent()];case 2:return r=o.sent(),console.error("Avo Inspector: something went wrong in extractSchema. Please report to support@avo.app.",r),[2,[]];case 3:return[2]}})})},e.prototype.setBatchSize=function(t){e._batchSize=t},e.prototype.setBatchFlushSeconds=function(t){e._batchFlushSeconds=t},e.prototype.handleBranchChangeAndCache=function(t,n){var r,o=t.metadata.branchId;null!==this.currentBranchId&&this.currentBranchId!==o&&(e.shouldLog&&console.log("[Avo Inspector] Branch changed from ".concat(this.currentBranchId," to ").concat(o,". Flushing cache.")),null===(r=this.eventSpecCache)||void 0===r||r.clear()),this.currentBranchId=o,this.eventSpecCache&&this.streamId&&this.eventSpecCache.set(this.apiKey,this.streamId,n,t)},e.prototype.fetchEventSpecIfNeeded=function(t){return r(this,void 0,void 0,function(){var n,r;return o(this,function(o){switch(o.label){case 0:if(this.environment===s.AvoInspectorEnv.Prod)return[2];if(!this.eventSpecCache||!this.eventSpecFetcher||!this.streamId)return[2];o.label=1;case 1:return o.trys.push([1,4,,5]),n=null,this.eventSpecCache&&(n=this.eventSpecCache.get(this.apiKey,this.streamId,t)),n?[3,3]:[4,this.eventSpecFetcher.fetch({apiKey:this.apiKey,streamId:this.streamId,eventName:t})];case 2:(n=o.sent())&&this.handleBranchChangeAndCache(n,t),o.label=3;case 3:return[3,5];case 4:return r=o.sent(),e.shouldLog&&console.error("[Avo Inspector] Error fetching event spec for ".concat(t,":"),r),[3,5];case 5:return[2]}})})},e.prototype.fetchAndValidateEvent=function(t,n){return r(this,void 0,void 0,function(){var r,i;return o(this,function(o){switch(o.label){case 0:if(this.environment===s.AvoInspectorEnv.Prod)return[2,null];if(!this.eventSpecCache||!this.eventSpecFetcher||!this.streamId)return[2,null];o.label=1;case 1:return o.trys.push([1,4,,5]),r=null,this.eventSpecCache&&(r=this.eventSpecCache.get(this.apiKey,this.streamId,t)),r?[3,3]:[4,this.eventSpecFetcher.fetch({apiKey:this.apiKey,streamId:this.streamId,eventName:t})];case 2:(r=o.sent())&&this.handleBranchChangeAndCache(r,t),o.label=3;case 3:return r?[2,(0,p.validateEvent)(n,r)]:[2,null];case 4:return i=o.sent(),e.shouldLog&&console.error("[Avo Inspector] Error validating event ".concat(t,":"),i),[2,null];case 5:return[2]}})})},e.prototype.mergeValidationResults=function(e,t){var n=this;return e.map(function(e){var r=t.propertyResults[e.propertyName];return n.mergePropertyValidation(e,r)})},e.prototype.mergePropertyValidation=function(e,t){var n=this,r={propertyName:e.propertyName,propertyType:e.propertyType};return e.encryptedPropertyValue&&(r.encryptedPropertyValue=e.encryptedPropertyValue),e.children&&Array.isArray(e.children)&&(r.children=e.children.map(function(e){var r;if("string"==typeof e)return e;if(e&&"object"==typeof e&&e.propertyName){var o=null===(r=null==t?void 0:t.children)||void 0===r?void 0:r[e.propertyName];return n.mergePropertyValidation(e,o)}return e})),t&&(t.failedEventIds&&(r.failedEventIds=t.failedEventIds),t.passedEventIds&&(r.passedEventIds=t.passedEventIds)),r},e.prototype.sendEventWithValidation=function(t,n,r,o,s){var i,a,c=this;e.shouldLog&&n.some(function(e){return e.failedEventIds&&e.failedEventIds.length>0})&&console.log('[Avo Inspector] Validation failures for event "'.concat(t,'":'),n.filter(function(e){return e.failedEventIds&&e.failedEventIds.length>0}).map(function(e){return{property:e.propertyName,failedEventIds:e.failedEventIds}}));var f=this.avoNetworkCallsHandler.bodyForEventSchemaCall(t,n,r,o,null!==(i=s.metadata)&&void 0!==i?i:void 0,null===(a=s.metadata)||void 0===a?void 0:a.branchId);this.avoNetworkCallsHandler.callInspectorImmediately(f,function(s){s?(e.shouldLog&&console.error('[Avo Inspector] Failed to send event "'.concat(t,'" with validation:'),s),c.avoBatcher.handleTrackSchema(t,n,r,o)):e.shouldLog&&console.log('[Avo Inspector] Event "'.concat(t,'" sent successfully with validation'))})},e._batchSize=30,e._batchFlushSeconds=30,e._shouldLog=!1,e._networkTimeout=2e3,e}();t.AvoInspector=g},615:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const r=n(175);class o extends r.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,r.ahash)(e);const n=(0,r.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?e.create().update(n).digest():n);for(let e=0;e<s.length;e++)s[e]^=54;this.iHash.update(s),this.oHash=e.create();for(let e=0;e<s.length;e++)s[e]^=106;this.oHash.update(s),(0,r.clean)(s)}update(e){return(0,r.aexists)(this),this.iHash.update(e),this}digestInto(e){(0,r.aexists)(this),(0,r.abytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:s,outputLen:i}=this;return e.finished=r,e.destroyed=o,e.blockLen=s,e.outputLen=i,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=o,t.hmac=(e,t,n)=>new o(e,t).update(n).digest(),t.hmac.create=(e,t)=>new o(e,t)},627:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.notImplemented=t.bitMask=t.utf8ToBytes=t.randomBytes=t.isBytes=t.hexToBytes=t.concatBytes=t.bytesToUtf8=t.bytesToHex=t.anumber=t.abytes=void 0,t.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},t._abool2=function(e,t=""){if("boolean"!=typeof e)throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e);return e},t._abytes2=function(e,t,n=""){const o=(0,r.isBytes)(e),s=e?.length,i=void 0!==t;if(!o||i&&s!==t)throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(i?` of length ${t}`:"")+", got "+(o?`length=${s}`:"type="+typeof e));return e},t.numberToHexUnpadded=a,t.hexToNumber=c,t.bytesToNumberBE=function(e){return c((0,r.bytesToHex)(e))},t.bytesToNumberLE=function(e){return(0,r.abytes)(e),c((0,r.bytesToHex)(Uint8Array.from(e).reverse()))},t.numberToBytesBE=f,t.numberToBytesLE=function(e,t){return f(e,t).reverse()},t.numberToVarBytesBE=function(e){return(0,r.hexToBytes)(a(e))},t.ensureBytes=function(e,t,n){let o;if("string"==typeof t)try{o=(0,r.hexToBytes)(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!(0,r.isBytes)(t))throw new Error(e+" must be hex string or Uint8Array");o=Uint8Array.from(t)}const s=o.length;if("number"==typeof n&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return o},t.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},t.copyBytes=function(e){return Uint8Array.from(e)},t.asciiToBytes=function(e){return Uint8Array.from(e,(t,n)=>{const r=t.charCodeAt(0);if(1!==t.length||r>127)throw new Error(`string contains non-ASCII character "${e[n]}" with code ${r} at position ${n}`);return r})},t.inRange=l,t.aInRange=function(e,t,n,r){if(!l(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)},t.bitLen=function(e){let t;for(t=0;e>s;e>>=i,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&i},t.bitSet=function(e,t,n){return e|(n?i:s)<<BigInt(t)},t.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");const o=e=>new Uint8Array(e),s=e=>Uint8Array.of(e);let i=o(e),a=o(e),c=0;const f=()=>{i.fill(1),a.fill(0),c=0},u=(...e)=>n(a,i,...e),l=(e=o(0))=>{a=u(s(0),e),i=u(),0!==e.length&&(a=u(s(1),e),i=u())},h=()=>{if(c++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){i=u();const t=i.slice();n.push(t),e+=i.length}return(0,r.concatBytes)(...n)};return(e,t)=>{let n;for(f(),l(e);!(n=t(h()));)l();return f(),n}},t.validateObject=function(e,t,n={}){const r=(t,n,r)=>{const o=h[n];if("function"!=typeof o)throw new Error("invalid validator function");const s=e[t];if(!(r&&void 0===s||o(s,e)))throw new Error("param "+String(t)+" is invalid. Expected "+n+", got "+s)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e},t.isHash=function(e){return"function"==typeof e&&Number.isSafeInteger(e.outputLen)},t._validateObject=function(e,t,n={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function r(t,n,r){const o=e[t];if(r&&void 0===o)return;const s=typeof o;if(s!==n||null===o)throw new Error(`param "${t}" is invalid: expected ${n}, got ${s}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))},t.memoized=function(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(void 0!==o)return o;const s=e(n,...r);return t.set(n,s),s}};const r=n(175);var o=n(175);Object.defineProperty(t,"abytes",{enumerable:!0,get:function(){return o.abytes}}),Object.defineProperty(t,"anumber",{enumerable:!0,get:function(){return o.anumber}}),Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(t,"bytesToUtf8",{enumerable:!0,get:function(){return o.bytesToUtf8}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(t,"hexToBytes",{enumerable:!0,get:function(){return o.hexToBytes}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return o.isBytes}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return o.randomBytes}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}});const s=BigInt(0),i=BigInt(1);function a(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function c(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?s:BigInt("0x"+e)}function f(e,t){return(0,r.hexToBytes)(e.toString(16).padStart(2*t,"0"))}const u=e=>"bigint"==typeof e&&s<=e;function l(e,t,n){return u(e)&&u(t)&&u(n)&&t<=e&&e<n}t.bitMask=e=>(i<<BigInt(e))-i;const h={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||(0,r.isBytes)(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};t.notImplemented=()=>{throw new Error("not implemented")}},669:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoBatcher=void 0;var r=n(611),o=function(){function e(t){var n=this;this.events=[],this.networkCallsHandler=t,this.batchFlushAttemptTimestamp=Date.now(),r.AvoInspector.avoStorage.getItemAsync(e.cacheKey).then(function(e){if(null!==e){var t=e.filter(function(e){return null!==e});n.events=n.events.concat(t),n.checkIfBatchNeedsToBeSent()}}).catch(function(e){console.error("Avo Inspector: error getting events from cache",e)})}return e.prototype.handleSessionStarted=function(){this.events.push(this.networkCallsHandler.bodyForSessionStartedCall()),this.saveEvents(),this.checkIfBatchNeedsToBeSent()},e.prototype.handleTrackSchema=function(e,t,n,o,s){this.events.push(this.networkCallsHandler.bodyForEventSchemaCall(e,t,n,o,s)),this.saveEvents(),r.AvoInspector.shouldLog&&console.log("Avo Inspector: saved event "+e+" with schema "+JSON.stringify(t)),this.checkIfBatchNeedsToBeSent()},e.prototype.checkIfBatchNeedsToBeSent=function(){var e=this.events.length,t=Date.now(),n=t-this.batchFlushAttemptTimestamp,o=e%r.AvoInspector.batchSize==0,s=n>=1e3*r.AvoInspector.batchFlushSeconds,i=this;if(o||s){this.batchFlushAttemptTimestamp=t;var a=i.events;i.events=[],this.networkCallsHandler.callInspectorWithBatchBody(a,function(e){null!=e?(i.events=i.events.concat(a),r.AvoInspector.shouldLog&&console.log("Avo Inspector: batch sending failed: "+e.message+". We will attempt to send your schemas with next batch")):r.AvoInspector.shouldLog&&console.log("Avo Inspector: batch sent successfully."),i.saveEvents()})}},e.prototype.saveEvents=function(){if(this.events.length>1e3){var t=this.events.length-1e3;this.events.splice(0,t)}r.AvoInspector.avoStorage.setItem(e.cacheKey,this.events)},Object.defineProperty(e,"cacheKey",{get:function(){return"AvoInspectorEvents"},enumerable:!1,configurable:!0}),e}();t.AvoBatcher=o},705:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DER=t.DERErr=void 0,t._splitEndoScalar=f,t._normFnElement=b,t.weierstrassN=m,t.SWUFpSqrtRatio=E,t.mapToCurveSimpleSWU=function(e,t){(0,a.validateField)(e);const{A:n,B:r,Z:o}=t;if(!e.isValid(n)||!e.isValid(r)||!e.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");const s=E(e,o);if(!e.isOdd)throw new Error("Field does not have .isOdd()");return t=>{let i,c,f,u,l,h,d,p;i=e.sqr(t),i=e.mul(i,o),c=e.sqr(i),c=e.add(c,i),f=e.add(c,e.ONE),f=e.mul(f,r),u=e.cmov(o,e.neg(c),!e.eql(c,e.ZERO)),u=e.mul(u,n),c=e.sqr(f),h=e.sqr(u),l=e.mul(h,n),c=e.add(c,l),c=e.mul(c,f),h=e.mul(h,u),l=e.mul(h,r),c=e.add(c,l),d=e.mul(i,f);const{isValid:v,value:y}=s(c,h);p=e.mul(i,t),p=e.mul(p,y),d=e.cmov(d,f,v),p=e.cmov(p,y,v);const g=e.isOdd(t)===e.isOdd(p);p=e.cmov(e.neg(p),p,g);const b=(0,a.FpInvertBatch)(e,[u],!0)[0];return d=e.mul(d,b),{x:d,y:p}}},t.ecdh=I,t.ecdsa=A,t.weierstrassPoints=function(e){const{CURVE:t,curveOpts:n}=x(e);return function(e,t){const{Fp:n,Fn:r}=t;const o=B(n,e.a,e.b);return Object.assign({},{CURVE:e,Point:t,ProjectivePoint:t,normPrivateKeyToScalar:e=>b(r,e),weierstrassEquation:o,isWithinCurveOrder:function(e){return(0,s.inRange)(e,p,r.ORDER)}})}(e,m(t,n))},t._legacyHelperEquat=B,t.weierstrass=function(e){const{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:o}=function(e){const{CURVE:t,curveOpts:n}=x(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}(e);return function(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,(0,a.nLength)(n.Fn.ORDER,n.Fn.BITS))})}(e,A(m(t,n),r,o))};const r=n(615),o=n(175),s=n(627),i=n(422),a=n(967),c=(e,t)=>(e+(e>=0?t:-t)/v)/t;function f(e,t,n){const[[r,o],[i,a]]=t,f=c(a*e,n),u=c(-o*e,n);let l=e-f*r-u*i,h=-f*o-u*a;const v=l<d,y=h<d;v&&(l=-l),y&&(h=-h);const g=(0,s.bitMask)(Math.ceil((0,s.bitLen)(n)/2))+p;if(l<d||l>=g||h<d||h>=g)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:v,k1:l,k2neg:y,k2:h}}function u(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function l(e,t){const n={};for(let r of Object.keys(t))n[r]=void 0===e[r]?t[r]:e[r];return(0,s._abool2)(n.lowS,"lowS"),(0,s._abool2)(n.prehash,"prehash"),void 0!==n.format&&u(n.format),n}class h extends Error{constructor(e=""){super(e)}}t.DERErr=h,t.DER={Err:h,_tlv:{encode:(e,n)=>{const{Err:r}=t.DER;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&n.length)throw new r("tlv.encode: unpadded data");const o=n.length/2,i=(0,s.numberToHexUnpadded)(o);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const a=o>127?(0,s.numberToHexUnpadded)(i.length/2|128):"";return(0,s.numberToHexUnpadded)(e)+a+i+n},decode(e,n){const{Err:r}=t.DER;let o=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(n.length<2||n[o++]!==e)throw new r("tlv.decode: wrong tlv");const s=n[o++];let i=0;if(128&s){const e=127&s;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const t=n.subarray(o,o+e);if(t.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===t[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of t)i=i<<8|e;if(o+=e,i<128)throw new r("tlv.decode(long): not minimal encoding")}else i=s;const a=n.subarray(o,o+i);if(a.length!==i)throw new r("tlv.decode: wrong value length");return{v:a,l:n.subarray(o+i)}}},_int:{encode(e){const{Err:n}=t.DER;if(e<d)throw new n("integer: negative integers are not allowed");let r=(0,s.numberToHexUnpadded)(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new n("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:n}=t.DER;if(128&e[0])throw new n("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new n("invalid signature integer: unnecessary leading zero");return(0,s.bytesToNumberBE)(e)}},toSig(e){const{Err:n,_int:r,_tlv:o}=t.DER,i=(0,s.ensureBytes)("signature",e),{v:a,l:c}=o.decode(48,i);if(c.length)throw new n("invalid signature: left bytes after parsing");const{v:f,l:u}=o.decode(2,a),{v:l,l:h}=o.decode(2,u);if(h.length)throw new n("invalid signature: left bytes after parsing");return{r:r.decode(f),s:r.decode(l)}},hexFromSig(e){const{_tlv:n,_int:r}=t.DER,o=n.encode(2,r.encode(e.r))+n.encode(2,r.encode(e.s));return n.encode(48,o)}};const d=BigInt(0),p=BigInt(1),v=BigInt(2),y=BigInt(3),g=BigInt(4);function b(e,t){const{BYTES:n}=e;let r;if("bigint"==typeof t)r=t;else{let o=(0,s.ensureBytes)("private key",t);try{r=e.fromBytes(o)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function m(e,t={}){const n=(0,i._createCurveFields)("weierstrass",e,t),{Fp:r,Fn:o}=n;let a=n.CURVE;const{h:c,n:u}=a;(0,s._validateObject)(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:l}=t;if(l&&(!r.is0(a.a)||"bigint"!=typeof l.beta||!Array.isArray(l.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const h=S(r,o);function v(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const m=t.toBytes||function(e,t,n){const{x:o,y:i}=t.toAffine(),a=r.toBytes(o);if((0,s._abool2)(n,"isCompressed"),n){v();const e=!r.isOdd(i);return(0,s.concatBytes)(w(e),a)}return(0,s.concatBytes)(Uint8Array.of(4),a,r.toBytes(i))},E=t.fromBytes||function(e){(0,s._abytes2)(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:n}=h,o=e.length,i=e[0],a=e.subarray(1);if(o!==t||2!==i&&3!==i){if(o===n&&4===i){const e=r.BYTES,t=r.fromBytes(a.subarray(0,e)),n=r.fromBytes(a.subarray(e,2*e));if(!A(t,n))throw new Error("bad point: is not on curve");return{x:t,y:n}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${n}`)}{const e=r.fromBytes(a);if(!r.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=I(e);let n;try{n=r.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}return v(),!(1&~i)!==r.isOdd(n)&&(n=r.neg(n)),{x:e,y:n}}};function I(e){const t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,a.a)),a.b)}function A(e,t){const n=r.sqr(t),o=I(e);return r.eql(n,o)}if(!A(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const x=r.mul(r.pow(a.a,y),g),B=r.mul(r.sqr(a.b),BigInt(27));if(r.is0(r.add(x,B)))throw new Error("bad curve params: a or b");function _(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function O(e){if(!(e instanceof L))throw new Error("ProjectivePoint expected")}function H(e){if(!l||!l.basises)throw new Error("no endo");return f(e,l.basises,o.ORDER)}const P=(0,s.memoized)((e,t)=>{const{X:n,Y:o,Z:s}=e;if(r.eql(s,r.ONE))return{x:n,y:o};const i=e.is0();null==t&&(t=i?r.ONE:r.inv(s));const a=r.mul(n,t),c=r.mul(o,t),f=r.mul(s,t);if(i)return{x:r.ZERO,y:r.ZERO};if(!r.eql(f,r.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),F=(0,s.memoized)(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:n,y:o}=e.toAffine();if(!r.isValid(n)||!r.isValid(o))throw new Error("bad point: x or y not field elements");if(!A(n,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function T(e,t,n,o,s){return n=new L(r.mul(n.X,e),n.Y,n.Z),t=(0,i.negateCt)(o,t),n=(0,i.negateCt)(s,n),t.add(n)}class L{constructor(e,t,n){this.X=_("x",e),this.Y=_("y",t,!0),this.Z=_("z",n),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof L)throw new Error("projective point not allowed");return r.is0(t)&&r.is0(n)?L.ZERO:new L(t,n,r.ONE)}static fromBytes(e){const t=L.fromAffine(E((0,s._abytes2)(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return L.fromBytes((0,s.ensureBytes)("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return V.createCache(this,e),t||this.multiply(y),this}assertValidity(){F(this)}hasEvenY(){const{y:e}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(e)}equals(e){O(e);const{X:t,Y:n,Z:o}=this,{X:s,Y:i,Z:a}=e,c=r.eql(r.mul(t,a),r.mul(s,o)),f=r.eql(r.mul(n,a),r.mul(i,o));return c&&f}negate(){return new L(this.X,r.neg(this.Y),this.Z)}double(){const{a:e,b:t}=a,n=r.mul(t,y),{X:o,Y:s,Z:i}=this;let c=r.ZERO,f=r.ZERO,u=r.ZERO,l=r.mul(o,o),h=r.mul(s,s),d=r.mul(i,i),p=r.mul(o,s);return p=r.add(p,p),u=r.mul(o,i),u=r.add(u,u),c=r.mul(e,u),f=r.mul(n,d),f=r.add(c,f),c=r.sub(h,f),f=r.add(h,f),f=r.mul(c,f),c=r.mul(p,c),u=r.mul(n,u),d=r.mul(e,d),p=r.sub(l,d),p=r.mul(e,p),p=r.add(p,u),u=r.add(l,l),l=r.add(u,l),l=r.add(l,d),l=r.mul(l,p),f=r.add(f,l),d=r.mul(s,i),d=r.add(d,d),l=r.mul(d,p),c=r.sub(c,l),u=r.mul(d,h),u=r.add(u,u),u=r.add(u,u),new L(c,f,u)}add(e){O(e);const{X:t,Y:n,Z:o}=this,{X:s,Y:i,Z:c}=e;let f=r.ZERO,u=r.ZERO,l=r.ZERO;const h=a.a,d=r.mul(a.b,y);let p=r.mul(t,s),v=r.mul(n,i),g=r.mul(o,c),b=r.add(t,n),m=r.add(s,i);b=r.mul(b,m),m=r.add(p,v),b=r.sub(b,m),m=r.add(t,o);let w=r.add(s,c);return m=r.mul(m,w),w=r.add(p,g),m=r.sub(m,w),w=r.add(n,o),f=r.add(i,c),w=r.mul(w,f),f=r.add(v,g),w=r.sub(w,f),l=r.mul(h,m),f=r.mul(d,g),l=r.add(f,l),f=r.sub(v,l),l=r.add(v,l),u=r.mul(f,l),v=r.add(p,p),v=r.add(v,p),g=r.mul(h,g),m=r.mul(d,m),v=r.add(v,g),g=r.sub(p,g),g=r.mul(h,g),m=r.add(m,g),p=r.mul(v,m),u=r.add(u,p),p=r.mul(w,m),f=r.mul(b,f),f=r.sub(f,p),p=r.mul(b,v),l=r.mul(w,l),l=r.add(l,p),new L(f,u,l)}subtract(e){return this.add(e.negate())}is0(){return this.equals(L.ZERO)}multiply(e){const{endo:n}=t;if(!o.isValidNot0(e))throw new Error("invalid scalar: out of range");let r,s;const a=e=>V.cached(this,e,e=>(0,i.normalizeZ)(L,e));if(n){const{k1neg:t,k1:o,k2neg:i,k2:c}=H(e),{p:f,f:u}=a(o),{p:l,f:h}=a(c);s=u.add(h),r=T(n.beta,f,l,t,i)}else{const{p:t,f:n}=a(e);r=t,s=n}return(0,i.normalizeZ)(L,[r,s])[0]}multiplyUnsafe(e){const{endo:n}=t,r=this;if(!o.isValid(e))throw new Error("invalid scalar: out of range");if(e===d||r.is0())return L.ZERO;if(e===p)return r;if(V.hasCache(this))return this.multiply(e);if(n){const{k1neg:t,k1:o,k2neg:s,k2:a}=H(e),{p1:c,p2:f}=(0,i.mulEndoUnsafe)(L,r,o,a);return T(n.beta,c,f,t,s)}return V.unsafe(r,e)}multiplyAndAddUnsafe(e,t,n){const r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return P(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return c===p||(e?e(L,this):V.unsafe(this,u).is0())}clearCofactor(){const{clearCofactor:e}=t;return c===p?this:e?e(L,this):this.multiplyUnsafe(c)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}toBytes(e=!0){return(0,s._abool2)(e,"isCompressed"),this.assertValidity(),m(L,this,e)}toHex(e=!0){return(0,s.bytesToHex)(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return(0,i.normalizeZ)(L,e)}static msm(e,t){return(0,i.pippenger)(L,o,e,t)}static fromPrivateKey(e){return L.BASE.multiply(b(o,e))}}L.BASE=new L(a.Gx,a.Gy,r.ONE),L.ZERO=new L(r.ZERO,r.ONE,r.ZERO),L.Fp=r,L.Fn=o;const R=o.BITS,V=new i.wNAF(L,t.endo?Math.ceil(R/2):R);return L.BASE.precompute(8),L}function w(e){return Uint8Array.of(e?2:3)}function E(e,t){const n=e.ORDER;let r=d;for(let e=n-p;e%v===d;e/=v)r+=p;const o=r,s=v<<o-p-p,i=s*v,a=(n-p)/i,c=(a-p)/v,f=i-p,u=s,l=e.pow(t,a),h=e.pow(t,(a+p)/v);let b=(t,n)=>{let r=l,s=e.pow(n,f),i=e.sqr(s);i=e.mul(i,n);let a=e.mul(t,i);a=e.pow(a,c),a=e.mul(a,s),s=e.mul(a,n),i=e.mul(a,t);let d=e.mul(i,s);a=e.pow(d,u);let y=e.eql(a,e.ONE);s=e.mul(i,h),a=e.mul(d,r),i=e.cmov(s,i,y),d=e.cmov(a,d,y);for(let t=o;t>p;t--){let n=t-v;n=v<<n-p;let o=e.pow(d,n);const a=e.eql(o,e.ONE);s=e.mul(i,r),r=e.mul(r,r),o=e.mul(d,r),i=e.cmov(s,i,a),d=e.cmov(o,d,a)}return{isValid:y,value:i}};if(e.ORDER%g===y){const n=(e.ORDER-y)/g,r=e.sqrt(e.neg(t));b=(t,o)=>{let s=e.sqr(o);const i=e.mul(t,o);s=e.mul(s,i);let a=e.pow(s,n);a=e.mul(a,i);const c=e.mul(a,r),f=e.mul(e.sqr(a),o),u=e.eql(f,t);return{isValid:u,value:e.cmov(c,a,u)}}}return b}function S(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function I(e,t={}){const{Fn:n}=e,r=t.randomBytes||s.randomBytes,o=Object.assign(S(e.Fp,n),{seed:(0,a.getMinHashLength)(n.ORDER)});function i(e){try{return!!b(n,e)}catch(e){return!1}}function c(e=r(o.seed)){return(0,a.mapHashToField)((0,s._abytes2)(e,o.seed,"seed"),n.ORDER)}function f(t,r=!0){return e.BASE.multiply(b(n,t)).toBytes(r)}function u(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:r,publicKey:i,publicKeyUncompressed:a}=o;if(n.allowedLengths||r===i)return;const c=(0,s.ensureBytes)("key",t).length;return c===i||c===a}const l={isValidSecretKey:i,isValidPublicKey:function(t,n){const{publicKey:r,publicKeyUncompressed:s}=o;try{const o=t.length;return!(!0===n&&o!==r||!1===n&&o!==s||!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:c,isValidPrivateKey:i,randomPrivateKey:c,normPrivateKeyToScalar:e=>b(n,e),precompute:(t=8,n=e.BASE)=>n.precompute(t,!1)};return Object.freeze({getPublicKey:f,getSharedSecret:function(t,r,o=!0){if(!0===u(t))throw new Error("first arg must be private key");if(!1===u(r))throw new Error("second arg must be public key");const s=b(n,t);return e.fromHex(r).multiply(s).toBytes(o)},keygen:function(e){const t=c(e);return{secretKey:t,publicKey:f(t)}},Point:e,utils:l,lengths:o})}function A(e,n,i={}){(0,o.ahash)(n),(0,s._validateObject)(i,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const a=i.randomBytes||s.randomBytes,c=i.hmac||((e,...t)=>(0,r.hmac)(n,e,(0,s.concatBytes)(...t))),{Fp:f,Fn:h}=e,{ORDER:y,BITS:g}=h,{keygen:m,getPublicKey:E,getSharedSecret:S,utils:A,lengths:x}=I(e,i),B={prehash:!1,lowS:"boolean"==typeof i.lowS&&i.lowS,format:void 0,extraEntropy:!1},_="compact";function O(e){return e>y>>p}function H(e,t){if(!h.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class P{constructor(e,t,n){this.r=H("r",e),this.s=H("s",t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e,n=_){let r;if(function(e,t){u(t);const n=x.signature,r="compact"===t?n:"recovered"===t?n+1:void 0;(0,s._abytes2)(e,r,`${t} signature`)}(e,n),"der"===n){const{r:n,s:r}=t.DER.toSig((0,s._abytes2)(e));return new P(n,r)}"recovered"===n&&(r=e[0],n="compact",e=e.subarray(1));const o=h.BYTES,i=e.subarray(0,o),a=e.subarray(o,2*o);return new P(h.fromBytes(i),h.fromBytes(a),r)}static fromHex(e,t){return this.fromBytes((0,s.hexToBytes)(e),t)}addRecoveryBit(e){return new P(this.r,this.s,e)}recoverPublicKey(t){const n=f.ORDER,{r,s:o,recovery:i}=this;if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");if(y*v<n&&i>1)throw new Error("recovery id is ambiguous for h>1 curve");const a=2===i||3===i?r+y:r;if(!f.isValid(a))throw new Error("recovery id 2 or 3 invalid");const c=f.toBytes(a),u=e.fromBytes((0,s.concatBytes)(w(!(1&i)),c)),l=h.inv(a),d=T((0,s.ensureBytes)("msgHash",t)),p=h.create(-d*l),g=h.create(o*l),b=e.BASE.multiplyUnsafe(p).add(u.multiplyUnsafe(g));if(b.is0())throw new Error("point at infinify");return b.assertValidity(),b}hasHighS(){return O(this.s)}toBytes(e=_){if(u(e),"der"===e)return(0,s.hexToBytes)(t.DER.hexFromSig(this));const n=h.toBytes(this.r),r=h.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return(0,s.concatBytes)(Uint8Array.of(this.recovery),n,r)}return(0,s.concatBytes)(n,r)}toHex(e){return(0,s.bytesToHex)(this.toBytes(e))}assertValidity(){}static fromCompact(e){return P.fromBytes((0,s.ensureBytes)("sig",e),"compact")}static fromDER(e){return P.fromBytes((0,s.ensureBytes)("sig",e),"der")}normalizeS(){return this.hasHighS()?new P(this.r,h.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,s.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,s.bytesToHex)(this.toBytes("compact"))}}const F=i.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=(0,s.bytesToNumberBE)(e),n=8*e.length-g;return n>0?t>>BigInt(n):t},T=i.bits2int_modN||function(e){return h.create(F(e))},L=(0,s.bitMask)(g);function R(e){return(0,s.aInRange)("num < 2^"+g,e,d,L),h.toBytes(e)}function V(e,t){return(0,s._abytes2)(e,void 0,"message"),t?(0,s._abytes2)(n(e),void 0,"prehashed message"):e}return Object.freeze({keygen:m,getPublicKey:E,getSharedSecret:S,utils:A,lengths:x,Point:e,sign:function(t,r,o={}){t=(0,s.ensureBytes)("message",t);const{seed:i,k2sig:f}=function(t,n,r){if(["recovered","canonical"].some(e=>e in r))throw new Error("sign() legacy options not supported");const{lowS:o,prehash:i,extraEntropy:c}=l(r,B);t=V(t,i);const f=T(t),u=b(h,n),v=[R(u),R(f)];if(null!=c&&!1!==c){const e=!0===c?a(x.secretKey):c;v.push((0,s.ensureBytes)("extraEntropy",e))}const y=(0,s.concatBytes)(...v),g=f;return{seed:y,k2sig:function(t){const n=F(t);if(!h.isValidNot0(n))return;const r=h.inv(n),s=e.BASE.multiply(n).toAffine(),i=h.create(s.x);if(i===d)return;const a=h.create(r*h.create(g+i*u));if(a===d)return;let c=(s.x===i?0:2)|Number(s.y&p),f=a;return o&&O(a)&&(f=h.neg(a),c^=1),new P(i,f,c)}}}(t,r,o);return(0,s.createHmacDrbg)(n.outputLen,h.BYTES,c)(i,f)},verify:function(n,r,o,i={}){const{lowS:a,prehash:c,format:f}=l(i,B);if(o=(0,s.ensureBytes)("publicKey",o),r=V((0,s.ensureBytes)("message",r),c),"strict"in i)throw new Error("options.strict was renamed to lowS");const u=void 0===f?function(e){let n;const r="string"==typeof e||(0,s.isBytes)(e),o=!r&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!r&&!o)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(o)n=new P(e.r,e.s);else if(r){try{n=P.fromBytes((0,s.ensureBytes)("sig",e),"der")}catch(e){if(!(e instanceof t.DER.Err))throw e}if(!n)try{n=P.fromBytes((0,s.ensureBytes)("sig",e),"compact")}catch(e){return!1}}return n||!1}(n):P.fromBytes((0,s.ensureBytes)("sig",n),f);if(!1===u)return!1;try{const t=e.fromBytes(o);if(a&&u.hasHighS())return!1;const{r:n,s}=u,i=T(r),c=h.inv(s),f=h.create(i*c),l=h.create(n*c),d=e.BASE.multiplyUnsafe(f).add(t.multiplyUnsafe(l));return!d.is0()&&h.create(d.x)===n}catch(e){return!1}},recoverPublicKey:function(e,t,n={}){const{prehash:r}=l(n,B);return t=V(t,r),P.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:P,hash:n})}function x(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:(0,a.Field)(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function B(e,t,n){return function(r){const o=e.sqr(r),s=e.mul(o,r);return e.add(e.add(s,e.mul(r,t)),n)}}},761:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._DST_scalar=void 0,t.expand_message_xmd=u,t.expand_message_xof=l,t.hash_to_field=h,t.isogenyMap=function(e,t){const n=t.map(e=>Array.from(e).reverse());return(t,r)=>{const[s,i,a,c]=n.map(n=>n.reduce((n,r)=>e.add(e.mul(n,t),r))),[f,u]=(0,o.FpInvertBatch)(e,[i,c],!0);return t=e.mul(s,f),r=e.mul(r,e.mul(a,u)),{x:t,y:r}}},t.createHasher=function(e,n,r){if("function"!=typeof n)throw new Error("mapToCurve() must be defined");function o(t){return e.fromAffine(n(t))}function s(t){const n=t.clearCofactor();return n.equals(e.ZERO)?e.ZERO:(n.assertValidity(),n)}return{defaults:r,hashToCurve(e,t){const n=h(e,2,Object.assign({},r,t)),i=o(n[0]),a=o(n[1]);return s(i.add(a))},encodeToCurve(e,t){const n=r.encodeDST?{DST:r.encodeDST}:{};return s(o(h(e,1,Object.assign({},r,n,t))[0]))},mapToCurve(e){if(!Array.isArray(e))throw new Error("expected array of bigints");for(const t of e)if("bigint"!=typeof t)throw new Error("expected array of bigints");return s(o(e))},hashToScalar(n,o){const s=e.Fn.ORDER;return h(n,1,Object.assign({},r,{p:s,m:1,DST:t._DST_scalar},o))[0][0]}}};const r=n(627),o=n(967),s=r.bytesToNumberBE;function i(e,t){if(c(e),c(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function a(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}function c(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function f(e){if(!(0,r.isBytes)(e)&&"string"!=typeof e)throw new Error("DST must be Uint8Array or string");return"string"==typeof e?(0,r.utf8ToBytes)(e):e}function u(e,t,n,o){(0,r.abytes)(e),c(n),(t=f(t)).length>255&&(t=o((0,r.concatBytes)((0,r.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:s,blockLen:u}=o,l=Math.ceil(n/s);if(n>65535||l>255)throw new Error("expand_message_xmd: invalid lenInBytes");const h=(0,r.concatBytes)(t,i(t.length,1)),d=i(0,u),p=i(n,2),v=new Array(l),y=o((0,r.concatBytes)(d,e,p,i(0,1),h));v[0]=o((0,r.concatBytes)(y,i(1,1),h));for(let e=1;e<=l;e++){const t=[a(y,v[e-1]),i(e+1,1),h];v[e]=o((0,r.concatBytes)(...t))}return(0,r.concatBytes)(...v).slice(0,n)}function l(e,t,n,o,s){if((0,r.abytes)(e),c(n),(t=f(t)).length>255){const e=Math.ceil(2*o/8);t=s.create({dkLen:e}).update((0,r.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:n}).update(e).update(i(n,2)).update(t).update(i(t.length,1)).digest()}function h(e,t,n){(0,r._validateObject)(n,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:i,k:a,m:f,hash:h,expand:d,DST:p}=n;if(!(0,r.isHash)(n.hash))throw new Error("expected valid hash");(0,r.abytes)(e),c(t);const v=i.toString(2).length,y=Math.ceil((v+a)/8),g=t*f*y;let b;if("xmd"===d)b=u(e,p,g,h);else if("xof"===d)b=l(e,p,g,a,h);else{if("_internal_pass"!==d)throw new Error('expand must be "xmd" or "xof"');b=e}const m=new Array(t);for(let e=0;e<t;e++){const t=new Array(f);for(let n=0;n<f;n++){const r=y*(n+e*f),a=b.subarray(r,r+y);t[n]=(0,o.mod)(s(a),i)}m[e]=t}return m}t._DST_scalar=(0,r.utf8ToBytes)("HashToScalar-")},829:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoStreamId=void 0;var r=n(249),o=n(611),s=function(){function e(){}return Object.defineProperty(e,"streamId",{get:function(){return null===e._streamId||e.shouldReset()?o.AvoInspector.avoStorage.isInitialized()?(e.loadFromStorage(),null!==e._streamId&&e.shouldReset()||null===e._streamId?e.generateAndStoreNew():(e.updateLastActivity(),e._streamId)):"unknown":(e.updateLastActivity(),e._streamId)},enumerable:!1,configurable:!0}),e.shouldReset=function(){if(null===e._createdAt||null===e._lastActivityAt)return!1;var t=Date.now(),n=t-e._createdAt,r=t-e._lastActivityAt;return n>e.MAX_AGE_MS&&r>e.IDLE_THRESHOLD_MS},e.loadFromStorage=function(){try{var t=o.AvoInspector.avoStorage.getItem(e.STREAM_ID_KEY),n=o.AvoInspector.avoStorage.getItem(e.CREATED_AT_KEY),r=o.AvoInspector.avoStorage.getItem(e.LAST_ACTIVITY_KEY);null!=t&&(e._streamId=t,e._createdAt=null!=n?n:Date.now(),e._lastActivityAt=null!=r?r:Date.now())}catch(e){console.error("Avo Inspector: Error reading stream ID from storage. Please report to support@avo.app.",e)}},e.generateAndStoreNew=function(){var t=Date.now();e._streamId=r.default.newGuid(),e._createdAt=t,e._lastActivityAt=t;try{o.AvoInspector.avoStorage.setItem(e.STREAM_ID_KEY,e._streamId),o.AvoInspector.avoStorage.setItem(e.CREATED_AT_KEY,e._createdAt),o.AvoInspector.avoStorage.setItem(e.LAST_ACTIVITY_KEY,e._lastActivityAt)}catch(e){console.error("Avo Inspector: Error saving stream ID to storage. Please report to support@avo.app.",e)}return e._streamId},e.updateLastActivity=function(){var t=Date.now();e._lastActivityAt=t;try{o.AvoInspector.avoStorage.setItem(e.LAST_ACTIVITY_KEY,t)}catch(e){}},Object.defineProperty(e,"storageKey",{get:function(){return e.STREAM_ID_KEY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"createdAtKey",{get:function(){return e.CREATED_AT_KEY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"lastActivityKey",{get:function(){return e.LAST_ACTIVITY_KEY},enumerable:!1,configurable:!0}),e.clearCache=function(){e._streamId=null,e._createdAt=null,e._lastActivityAt=null},e._streamId=null,e._createdAt=null,e._lastActivityAt=null,e.MAX_AGE_MS=144e5,e.IDLE_THRESHOLD_MS=72e5,e.STREAM_ID_KEY="AvoInspectorStreamId",e.CREATED_AT_KEY="AvoInspectorStreamIdCreatedAt",e.LAST_ACTIVITY_KEY="AvoInspectorStreamIdLastActivityAt",e}();t.AvoStreamId=s},844:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoInspectorEnv=void 0,t.AvoInspectorEnv={Prod:"prod",Dev:"dev",Staging:"staging"}},897:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.secp256r1=t.p256=void 0;const r=n(54);t.p256=r.p256,t.secp256r1=r.p256,t.hashToCurve=r.p256_hasher.hashToCurve,t.encodeToCurve=r.p256_hasher.encodeToCurve},916:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function o(e){for(var t={},n=0,o=Object.entries(e);n<o.length;n++){var s=o[n],i=s[0],a=s[1];t[i]=r([],a,!0)}return t}function s(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],a=i[0],c=i[1];t[a]={type:c.type,required:c.required,pinnedValues:c.pinnedValues?o(c.pinnedValues):void 0,allowedValues:c.allowedValues?o(c.allowedValues):void 0,regexPatterns:c.regexPatterns?o(c.regexPatterns):void 0,minMaxRanges:c.minMaxRanges?o(c.minMaxRanges):void 0,children:c.children?s(c.children):void 0}}return t}function i(e,t){for(var n=0,r=Object.entries(t);n<r.length;n++){var c=r[n],f=c[0],u=c[1];if(e[f]){var l=e[f];a(l,u),u.children&&(l.children?i(l.children,u.children):l.children=s(u.children))}else e[f]={type:u.type,required:u.required,pinnedValues:u.pinnedValues?o(u.pinnedValues):void 0,allowedValues:u.allowedValues?o(u.allowedValues):void 0,regexPatterns:u.regexPatterns?o(u.regexPatterns):void 0,minMaxRanges:u.minMaxRanges?o(u.minMaxRanges):void 0,children:u.children?s(u.children):void 0}}}function a(e,t){if(t.pinnedValues){e.pinnedValues||(e.pinnedValues={});for(var n=0,o=Object.keys(t.pinnedValues);n<o.length;n++){var s=o[n];if(e.pinnedValues[s]){for(var i=new Set(e.pinnedValues[s]),a=0,c=t.pinnedValues[s];a<c.length;a++){var f=c[a];i.add(f)}e.pinnedValues[s]=Array.from(i)}else e.pinnedValues[s]=r([],t.pinnedValues[s],!0)}}if(t.allowedValues){e.allowedValues||(e.allowedValues={});for(var u=0,l=Object.keys(t.allowedValues);u<l.length;u++)if(s=l[u],e.allowedValues[s]){i=new Set(e.allowedValues[s]);for(var h=0,d=t.allowedValues[s];h<d.length;h++)f=d[h],i.add(f);e.allowedValues[s]=Array.from(i)}else e.allowedValues[s]=r([],t.allowedValues[s],!0)}if(t.regexPatterns){e.regexPatterns||(e.regexPatterns={});for(var p=0,v=Object.keys(t.regexPatterns);p<v.length;p++)if(s=v[p],e.regexPatterns[s]){i=new Set(e.regexPatterns[s]);for(var y=0,g=t.regexPatterns[s];y<g.length;y++)f=g[y],i.add(f);e.regexPatterns[s]=Array.from(i)}else e.regexPatterns[s]=r([],t.regexPatterns[s],!0)}if(t.minMaxRanges){e.minMaxRanges||(e.minMaxRanges={});for(var b=0,m=Object.keys(t.minMaxRanges);b<m.length;b++)if(s=m[b],e.minMaxRanges[s]){i=new Set(e.minMaxRanges[s]);for(var w=0,E=t.minMaxRanges[s];w<E.length;w++)f=E[w],i.add(f);e.minMaxRanges[s]=Array.from(i)}else e.minMaxRanges[s]=r([],t.minMaxRanges[s],!0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.validateEvent=function(e,t){for(var r=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var o=r[n];t.push(o.baseEventId);for(var s=0;s<o.variantIds.length;s++)t.push(o.variantIds[s])}return t}(t.events),o=function(e){if(0===e.length)return{};if(1===e.length)return e[0].props;for(var t={},r=0,o=e;r<o.length;r++)for(var c=o[r],f=0,u=Object.entries(c.props);f<u.length;f++){var l=u[f],h=l[0],d=l[1];if(t[h]){var p=t[h];a(p,d),d.children&&(p.children?i(p.children,d.children):p.children=s(d.children))}else t[h]={type:d.type,required:d.required,pinnedValues:d.pinnedValues?n({},d.pinnedValues):void 0,allowedValues:d.allowedValues?n({},d.allowedValues):void 0,regexPatterns:d.regexPatterns?n({},d.regexPatterns):void 0,minMaxRanges:d.minMaxRanges?n({},d.minMaxRanges):void 0,children:d.children?s(d.children):void 0}}return t}(t.events),c={},f=0,u=Object.keys(e);f<u.length;f++){var l=u[f],h=e[l],p=o[l];if(p){var v=d(h,p,r);c[l]=v}else c[l]={}}return{metadata:t.metadata,propertyResults:c}};var c=new Map;function f(e){var t=c.get(e);return t||(t=new RegExp(e),c.set(e,t)),t}var u=new Map;function l(e){var t=u.get(e);if(!t)try{var n=JSON.parse(e);t=new Set(n),u.set(e,t)}catch(e){return null}return t}var h=2;function d(e,t,n,r){void 0===r&&(r=0);var o={};return r>=h?o:t.isList?function(e,t,n,r){var o={};if(!Array.isArray(e))return o;if(t.children){for(var s={},i=function(t,o){for(var i=new Set,a=0,c=e;a<c.length;a++){var f=c[a],u=d(("object"!=typeof f||null===f||Array.isArray(f)?{}:f)[t],o,n,r+1);if(u.failedEventIds)for(var l=0,h=u.failedEventIds;l<h.length;l++){var p=h[l];i.add(p)}if(u.passedEventIds)for(var v=new Set(u.passedEventIds),y=0,g=n;y<g.length;y++)p=g[y],v.has(p)||i.add(p)}if(i.size>0){var b=Array.from(i),m=n.filter(function(e){return!i.has(e)});m.length<b.length&&m.length>0?s[t]={passedEventIds:m}:s[t]={failedEventIds:b}}},a=0,c=Object.entries(t.children);a<c.length;a++){var f=c[a];i(f[0],f[1])}return Object.keys(s).length>0&&(o.children=s),o}for(var u=new Set,l=0,h=e;l<h.length;l++){var v=h[l];t.pinnedValues&&g(v,t.pinnedValues,u),t.allowedValues&&b(v,t.allowedValues,u),t.regexPatterns&&m(v,t.regexPatterns,u),t.minMaxRanges&&w(v,t.minMaxRanges,u)}return p(u,n)}(e,t,n,r):t.children?function(e,t,n,r){for(var o={},s={},i="object"!=typeof e||null===e||Array.isArray(e)?{}:e,a=0,c=Object.entries(t.children);a<c.length;a++){var f=c[a],u=f[0],l=f[1],h=d(i[u],l,n,r+1);(h.failedEventIds||h.passedEventIds||h.children)&&(s[u]=h)}return Object.keys(s).length>0&&(o.children=s),o}(e,t,n,r):null!=e||t.required?function(e,t,n){var r=new Set;return t.pinnedValues&&g(e,t.pinnedValues,r),t.allowedValues&&b(e,t.allowedValues,r),t.regexPatterns&&m(e,t.regexPatterns,r),t.minMaxRanges&&w(e,t.minMaxRanges,r),p(r,n)}(e,t,n):o}function p(e,t){var n=t.filter(function(t){return!e.has(t)}),r=Array.from(e);return 0===r.length&&0===n.length?{}:n.length<r.length&&n.length>0?{passedEventIds:n}:r.length>0?{failedEventIds:r}:{}}function v(e,t){for(var n=0,r=e;n<r.length;n++){var o=r[n];t.add(o)}}function y(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e)return String(e);if(Array.isArray(e)||"object"==typeof e)try{return JSON.stringify(e)}catch(t){return console.warn("[Avo Inspector] Failed to stringify value: ".concat(t)),String(e)}return String(e)}function g(e,t,n){for(var r=y(e),o=0,s=Object.entries(t);o<s.length;o++){var i=s[o],a=i[0],c=i[1];r!==a&&v(c,n)}}function b(e,t,n){for(var r=y(e),o=0,s=Object.entries(t);o<s.length;o++){var i=s[o],a=i[0],c=i[1],f=l(a);null!==f?f.has(r)||v(c,n):console.warn("[Avo Inspector] Invalid allowed values JSON: ".concat(a))}}function m(e,t,n){if("string"==typeof e)for(var r=0,o=Object.entries(t);r<o.length;r++){var s=o[r],i=s[0];u=s[1];try{f(i).test(e)||v(u,n)}catch(e){console.warn("[Avo Inspector] Invalid regex pattern: ".concat(i))}}else for(var a=0,c=Object.values(t);a<c.length;a++){var u;v(u=c[a],n)}}function w(e,t,n){if("number"==typeof e)if(Number.isNaN(e)){console.warn("[Avo Inspector] NaN value fails min/max constraint");for(var r=0,o=Object.values(t);r<o.length;r++)v(m=o[r],n)}else for(var s=0,i=Object.entries(t);s<i.length;s++){var a=i[s],c=a[0],f=(m=a[1],c.split(",")),u=f[0],l=f[1],h=""!==u&&void 0!==u,d=""!==l&&void 0!==l,p=h?parseFloat(u):-1/0,y=d?parseFloat(l):1/0;h&&isNaN(p)||d&&isNaN(y)?console.warn("[Avo Inspector] Invalid min/max range: ".concat(c)):(e<p||e>y)&&v(m,n)}else for(var g=0,b=Object.values(t);g<b.length;g++){var m;v(m=b[g],n)}}},924:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoSchemaParser=void 0;var s=n(945),i=function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(){function e(){}return e.canSendEncryptedValues=function(e,t){return null!=e&&""!==e&&("dev"===t||"staging"===t)},e.getEncryptedPropertyValueIfEnabled=function(e,t,n){return r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:if(!t||!n)return[2,void 0];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,(0,s.encryptValue)(e,n)];case 2:return[2,o.sent()];case 3:return r=o.sent(),console.error("[Avo Inspector] Failed to encrypt property value:",r instanceof Error?r.message:String(r)),[2,void 0];case 4:return[2]}})})},e.extractSchema=function(e,t,n){return r(this,void 0,void 0,function(){var s,a,c=this;return o(this,function(f){switch(f.label){case 0:return null==e?[2,[]]:(s=this.canSendEncryptedValues(t,n),a=function(e){return r(c,void 0,void 0,function(){var n,c,f,u,l,h,d,p,v,y,g,b=this;return o(this,function(m){switch(m.label){case 0:return i(e)?[4,Promise.all(e.map(function(e){return r(b,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,a(e)];case 1:return[2,t.sent()]}})})}))]:[3,2];case 1:return n=m.sent(),[2,this.removeDuplicates(n)];case 2:if("object"!=typeof e)return[3,10];for(l in c=[],u=[],f=e)u.push(l);h=0,m.label=3;case 3:return h<u.length?(l=u[h])in f?(d=l,e.hasOwnProperty(d)?(p=e[d],v={propertyName:d,propertyType:this.getPropValueType(p)},"object"!=typeof p||null==p?[3,5]:(y=v,[4,a(p)])):[3,8]):[3,8]:[3,9];case 4:return y.children=m.sent(),[3,7];case 5:return void 0===p?[3,7]:[4,this.getEncryptedPropertyValueIfEnabled(p,s,t)];case 6:void 0!==(g=m.sent())&&(v.encryptedPropertyValue=g),m.label=7;case 7:c.push(v),m.label=8;case 8:return h++,[3,3];case 9:return[2,c];case 10:return[2,this.getPropValueType(e)]}})})},[4,a(e)]);case 1:return[2,f.sent()]}})})},e.removeDuplicates=function(e){var t={boolean:{},number:{},string:{}},n=[];return e.filter(function(e){var r=typeof e;return r in t&&"string"==typeof e?!t[r].hasOwnProperty(e)&&(t[r][e]=!0):!n.includes(e)&&n.push(e)})},e.getPropValueType=function(e){var t=typeof e;return null==e?"null":"string"===t?"string":"number"===t||"bigint"===t?(e+"").includes(".")?"float":"int":"boolean"===t?"boolean":"object"===t?i(e)?"list":"object":"unknown"},e}();t.AvoSchemaParser=a},945:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generateKeyPair=function(){var e=s.p256.utils.randomPrivateKey(),t=s.p256.getPublicKey(e,!1);return{privateKey:i(e).padStart(64,"0"),publicKey:i(t)}},t.encryptValue=function(e,t){return r(this,void 0,void 0,function(){var n,r,i,l,h,d,p,v,y,g,b,m,w,E,S,I,A,x,B,_;return o(this,function(o){switch(o.label){case 0:if(o.trys.push([0,4,,5]),void 0===(n=void 0===e?"null":JSON.stringify(e)))throw new Error("Cannot encrypt undefined value");return r="string"==typeof t?t:String(t),i=a(r),l=s.p256.utils.randomPrivateKey(),h=s.p256.getPublicKey(l,!1),[4,f(s.p256.getSharedSecret(l,i).slice(-32))];case 1:return d=o.sent(),[4,(p=c()).subtle.importKey("raw",d,{name:"AES-GCM"},!1,["encrypt"])];case 2:return v=o.sent(),y=p.getRandomValues(new Uint8Array(16)),g=(new TextEncoder).encode(n),[4,p.subtle.encrypt({name:"AES-GCM",iv:y,tagLength:128},v,g)];case 3:return b=o.sent(),m=new Uint8Array(b),w=m.length-16,E=m.slice(0,w),S=m.slice(w),I=new Uint8Array([0]),A=1+h.length+16+16+E.length,x=new Uint8Array(A),B=0,x.set(I,B),B+=1,x.set(h,B),B+=h.length,x.set(y,B),B+=16,x.set(S,B),B+=16,x.set(E,B),[2,u(x)];case 4:throw _=o.sent(),new Error("Failed to encrypt value. Please check that the public key is valid. Error: ".concat(_ instanceof Error?_.message:String(_)));case 5:return[2]}})})},t.decryptValue=function(e,t){return r(this,void 0,void 0,function(){var n,r,i,u,l,h,d,p,v,y,g,b,m,w,E,S,I,A,x,B,_,O,H;return o(this,function(o){switch(o.label){case 0:for(o.trys.push([0,4,,5]),n=atob(e),r=new Uint8Array(n.length),i=0;i<n.length;i++)r[i]=n.charCodeAt(i);if(r.length<67)throw new Error("Invalid encrypted data: payload too short");if(u="string"==typeof t?t:String(t),h=r[l=0],l+=1,0!==h)throw new Error("Unsupported encryption version: ".concat(h));if(d=r[l],v=1+(p=2===d||3===d?33:65)+16+16+1,r.length<v)throw new Error("Invalid encrypted data: expected at least ".concat(v," bytes, got ").concat(r.length));return y=r.slice(l,l+p),l+=p,g=r.slice(l,l+16),l+=16,b=r.slice(l,l+16),l+=16,m=r.slice(l),w=a(u),[4,f(s.p256.getSharedSecret(w,y).slice(-32))];case 1:return E=o.sent(),[4,(S=c()).subtle.importKey("raw",E,{name:"AES-GCM"},!1,["decrypt"])];case 2:return I=o.sent(),A=m.length+b.length,(x=new Uint8Array(A)).set(m,0),x.set(b,m.length),[4,S.subtle.decrypt({name:"AES-GCM",iv:g,tagLength:128},I,x)];case 3:return B=o.sent(),_=new TextDecoder,O=_.decode(B),[2,JSON.parse(O)];case 4:throw H=o.sent(),new Error("Failed to decrypt value. Please check that the private key is valid and matches the public key used for encryption. Error: ".concat(H instanceof Error?H.message:String(H)));case 5:return[2]}})})};var s=n(897);function i(e){return Array.from(e).map(function(e){return e.toString(16).padStart(2,"0")}).join("")}function a(e){for(var t=new Uint8Array(e.length/2),n=0;n<e.length;n+=2)t[n/2]=parseInt(e.substr(n,2),16);return t}var c=function(){if("undefined"!=typeof globalThis&&globalThis.crypto){var e=globalThis.crypto;if(e&&e.subtle)return e}if("undefined"!=typeof window&&window.crypto){var t=window.crypto;if(t&&t.subtle)return t}if(void 0!==n.g&&n.g.crypto){var r=n.g.crypto;if(r&&r.subtle)return r}var o={hasGlobalThis:"undefined"!=typeof globalThis,hasGlobalThisCrypto:"undefined"!=typeof globalThis&&!!globalThis.crypto,hasGlobalThisCryptoSubtle:"undefined"!=typeof globalThis&&!!globalThis.crypto&&!!globalThis.crypto.subtle,hasWindow:"undefined"!=typeof window,hasWindowCrypto:"undefined"!=typeof window&&!!window.crypto,hasGlobal:void 0!==n.g,hasGlobalCrypto:void 0!==n.g&&!!n.g.crypto,hasGlobalCryptoSubtle:void 0!==n.g&&!!n.g.crypto&&!!n.g.crypto.subtle};throw new Error("crypto.subtle not available. Debug: "+JSON.stringify(o))};function f(e){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,c().subtle.digest("SHA-256",e)];case 1:return[2,t.sent()]}})})}function u(e){if("undefined"!=typeof Buffer&&Buffer.from)return Buffer.from(e).toString("base64");for(var t="",n=0;n<e.length;n+=8192){var r=e.slice(n,n+8192);t+=String.fromCharCode.apply(null,Array.from(r))}return btoa(t)}},967:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativeLE=void 0,t.mod=p,t.pow=function(e,t,n){return S(B(n),e,t)},t.pow2=function(e,t,n){let r=e;for(;t-- >o;)r*=r,r%=n;return r},t.invert=v,t.tonelliShanks=m,t.FpSqrt=w,t.validateField=function(e){const t=E.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});return(0,r._validateObject)(e,t),e},t.FpPow=S,t.FpInvertBatch=I,t.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?v(n,e.ORDER):e.inv(n))},t.FpLegendre=A,t.FpIsSquare=function(e,t){return 1===A(e,t)},t.nLength=x,t.Field=B,t.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)},t.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n},t.hashToPrivateScalar=function(e,t,n=!1){const o=(e=(0,r.ensureBytes)("privateHash",e)).length,i=x(t).nByteLength+8;if(i<24||o<i||o>1024)throw new Error("hashToPrivateScalar: expected "+i+"-1024 bytes of input, got "+o);return p(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-s)+s},t.getFieldBytesLength=_,t.getMinHashLength=O,t.mapHashToField=function(e,t,n=!1){const o=e.length,i=_(t),a=O(t);if(o<16||o<a||o>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+o);const c=p(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-s)+s;return n?(0,r.numberToBytesLE)(c,i):(0,r.numberToBytesBE)(c,i)};const r=n(627),o=BigInt(0),s=BigInt(1),i=BigInt(2),a=BigInt(3),c=BigInt(4),f=BigInt(5),u=BigInt(7),l=BigInt(8),h=BigInt(9),d=BigInt(16);function p(e,t){const n=e%t;return n>=o?n:t+n}function v(e,t){if(e===o)throw new Error("invert: expected non-zero number");if(t<=o)throw new Error("invert: expected positive modulus, got "+t);let n=p(e,t),r=t,i=o,a=s,c=s,f=o;for(;n!==o;){const e=r/n,t=r%n,o=i-c*e,s=a-f*e;r=n,n=t,i=c,a=f,c=o,f=s}if(r!==s)throw new Error("invert: does not exist");return p(i,t)}function y(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function g(e,t){const n=(e.ORDER+s)/c,r=e.pow(t,n);return y(e,r,t),r}function b(e,t){const n=(e.ORDER-f)/l,r=e.mul(t,i),o=e.pow(r,n),s=e.mul(t,o),a=e.mul(e.mul(s,i),o),c=e.mul(s,e.sub(a,e.ONE));return y(e,c,t),c}function m(e){if(e<a)throw new Error("sqrt is not defined for small field");let t=e-s,n=0;for(;t%i===o;)t/=i,n++;let r=i;const c=B(e);for(;1===A(c,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return g;let f=c.pow(r,t);const u=(t+s)/i;return function(e,r){if(e.is0(r))return r;if(1!==A(e,r))throw new Error("Cannot find square root");let o=n,i=e.mul(e.ONE,f),a=e.pow(r,t),c=e.pow(r,u);for(;!e.eql(a,e.ONE);){if(e.is0(a))return e.ZERO;let t=1,n=e.sqr(a);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===o)throw new Error("Cannot find square root");const r=s<<BigInt(o-t-1),f=e.pow(i,r);o=t,i=e.sqr(f),a=e.mul(a,i),c=e.mul(c,f)}return c}}function w(e){return e%c===a?g:e%l===f?b:e%d===h?function(e){const t=B(e),n=m(e),r=n(t,t.neg(t.ONE)),o=n(t,r),s=n(t,t.neg(r)),i=(e+u)/d;return(e,t)=>{let n=e.pow(t,i),a=e.mul(n,r);const c=e.mul(n,o),f=e.mul(n,s),u=e.eql(e.sqr(a),t),l=e.eql(e.sqr(c),t);n=e.cmov(n,a,u),a=e.cmov(f,c,l);const h=e.eql(e.sqr(a),t),d=e.cmov(n,a,h);return y(e,d,t),d}}(e):m(e)}t.isNegativeLE=(e,t)=>(p(e,t)&s)===s;const E=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function S(e,t,n){if(n<o)throw new Error("invalid exponent, negatives unsupported");if(n===o)return e.ONE;if(n===s)return t;let r=e.ONE,i=t;for(;n>o;)n&s&&(r=e.mul(r,i)),i=e.sqr(i),n>>=s;return r}function I(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n)),e.ONE),s=e.inv(o);return t.reduceRight((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n)),s),r}function A(e,t){const n=(e.ORDER-s)/i,r=e.pow(t,n),o=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),c=e.eql(r,e.neg(e.ONE));if(!o&&!a&&!c)throw new Error("invalid Legendre symbol result");return o?1:a?0:-1}function x(e,t){void 0!==t&&(0,r.anumber)(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function B(e,t,n=!1,i={}){if(e<=o)throw new Error("invalid field: expected ORDER > 0, got "+e);let a,c,f,u=!1;if("object"==typeof t&&null!=t){if(i.sqrt||n)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(a=e.BITS),e.sqrt&&(c=e.sqrt),"boolean"==typeof e.isLE&&(n=e.isLE),"boolean"==typeof e.modFromBytes&&(u=e.modFromBytes),f=e.allowedLengths}else"number"==typeof t&&(a=t),i.sqrt&&(c=i.sqrt);const{nBitLength:l,nByteLength:h}=x(e,a);if(h>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let d;const y=Object.freeze({ORDER:e,isLE:n,BITS:l,BYTES:h,MASK:(0,r.bitMask)(l),ZERO:o,ONE:s,allowedLengths:f,create:t=>p(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return o<=t&&t<e},is0:e=>e===o,isValidNot0:e=>!y.is0(e)&&y.isValid(e),isOdd:e=>(e&s)===s,neg:t=>p(-t,e),eql:(e,t)=>e===t,sqr:t=>p(t*t,e),add:(t,n)=>p(t+n,e),sub:(t,n)=>p(t-n,e),mul:(t,n)=>p(t*n,e),pow:(e,t)=>S(y,e,t),div:(t,n)=>p(t*v(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>v(t,e),sqrt:c||(t=>(d||(d=w(e)),d(y,t))),toBytes:e=>n?(0,r.numberToBytesLE)(e,h):(0,r.numberToBytesBE)(e,h),fromBytes:(t,o=!0)=>{if(f){if(!f.includes(t.length)||t.length>h)throw new Error("Field.fromBytes: expected "+f+" bytes, got "+t.length);const e=new Uint8Array(h);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==h)throw new Error("Field.fromBytes: expected "+h+" bytes, got "+t.length);let s=n?(0,r.bytesToNumberLE)(t):(0,r.bytesToNumberBE)(t);if(u&&(s=p(s,e)),!o&&!y.isValid(s))throw new Error("invalid field element: outside of range 0..ORDER");return s},invertBatch:e=>I(y,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(y)}function _(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function O(e){const t=_(e);return t+Math.ceil(t/2)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.AvoInspectorEnv=e.AvoInspector=void 0;var t=n(611);Object.defineProperty(e,"AvoInspector",{enumerable:!0,get:function(){return t.AvoInspector}});var o=n(844);Object.defineProperty(e,"AvoInspectorEnv",{enumerable:!0,get:function(){return o.AvoInspectorEnv}})})(),r})());
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,()=>(()=>{"use strict";var e={54:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.p521_hasher=t.secp521r1=t.secp384r1=t.secp256r1=t.p521=t.p384_hasher=t.p384=t.p256_hasher=t.p256=void 0;const r=n(76),o=n(562),s=n(761),i=n(967),a=n(705),c={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},f={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},u={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},l=(0,i.Field)(c.p),h=(0,i.Field)(f.p),d=(0,i.Field)(u.p);function p(e,t){const n=(0,a.mapToCurveSimpleSWU)(e.Fp,t);return e=>n(e[0])}t.p256=(0,o.createCurve)({...c,Fp:l,lowS:!1},r.sha256),t.p256_hasher=(0,s.createHasher)(t.p256.Point,p(t.p256.Point,{A:c.a,B:c.b,Z:t.p256.Point.Fp.create(BigInt("-10"))}),{DST:"P256_XMD:SHA-256_SSWU_RO_",encodeDST:"P256_XMD:SHA-256_SSWU_NU_",p:c.p,m:1,k:128,expand:"xmd",hash:r.sha256}),t.p384=(0,o.createCurve)({...f,Fp:h,lowS:!1},r.sha384),t.p384_hasher=(0,s.createHasher)(t.p384.Point,p(t.p384.Point,{A:f.a,B:f.b,Z:t.p384.Point.Fp.create(BigInt("-12"))}),{DST:"P384_XMD:SHA-384_SSWU_RO_",encodeDST:"P384_XMD:SHA-384_SSWU_NU_",p:f.p,m:1,k:192,expand:"xmd",hash:r.sha384}),t.p521=(0,o.createCurve)({...u,Fp:d,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},r.sha512),t.secp256r1=t.p256,t.secp384r1=t.p384,t.secp521r1=t.p521,t.p521_hasher=(0,s.createHasher)(t.p521.Point,p(t.p521.Point,{A:u.a,B:u.b,Z:t.p521.Point.Fp.create(BigInt("-4"))}),{DST:"P521_XMD:SHA-512_SSWU_RO_",encodeDST:"P521_XMD:SHA-512_SSWU_NU_",p:u.p,m:1,k:256,expand:"xmd",hash:r.sha512})},76:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha512_224=t.sha512_256=t.sha384=t.sha512=t.sha224=t.sha256=t.SHA512_256=t.SHA512_224=t.SHA384=t.SHA512=t.SHA224=t.SHA256=void 0;const r=n(202),o=n(318),s=n(175),i=Uint32Array.from([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]),a=new Uint32Array(64);class c extends r.HashMD{constructor(e=32){super(64,e,8,!1),this.A=0|r.SHA256_IV[0],this.B=0|r.SHA256_IV[1],this.C=0|r.SHA256_IV[2],this.D=0|r.SHA256_IV[3],this.E=0|r.SHA256_IV[4],this.F=0|r.SHA256_IV[5],this.G=0|r.SHA256_IV[6],this.H=0|r.SHA256_IV[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:s,G:i,H:a}=this;return[e,t,n,r,o,s,i,a]}set(e,t,n,r,o,s,i,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|s,this.G=0|i,this.H=0|a}process(e,t){for(let n=0;n<16;n++,t+=4)a[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=a[e-15],n=a[e-2],r=(0,s.rotr)(t,7)^(0,s.rotr)(t,18)^t>>>3,o=(0,s.rotr)(n,17)^(0,s.rotr)(n,19)^n>>>10;a[e]=o+a[e-7]+r+a[e-16]|0}let{A:n,B:o,C:c,D:f,E:u,F:l,G:h,H:d}=this;for(let e=0;e<64;e++){const t=d+((0,s.rotr)(u,6)^(0,s.rotr)(u,11)^(0,s.rotr)(u,25))+(0,r.Chi)(u,l,h)+i[e]+a[e]|0,p=((0,s.rotr)(n,2)^(0,s.rotr)(n,13)^(0,s.rotr)(n,22))+(0,r.Maj)(n,o,c)|0;d=h,h=l,l=u,u=f+t|0,f=c,c=o,o=n,n=t+p|0}n=n+this.A|0,o=o+this.B|0,c=c+this.C|0,f=f+this.D|0,u=u+this.E|0,l=l+this.F|0,h=h+this.G|0,d=d+this.H|0,this.set(n,o,c,f,u,l,h,d)}roundClean(){(0,s.clean)(a)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,s.clean)(this.buffer)}}t.SHA256=c;class f extends c{constructor(){super(28),this.A=0|r.SHA224_IV[0],this.B=0|r.SHA224_IV[1],this.C=0|r.SHA224_IV[2],this.D=0|r.SHA224_IV[3],this.E=0|r.SHA224_IV[4],this.F=0|r.SHA224_IV[5],this.G=0|r.SHA224_IV[6],this.H=0|r.SHA224_IV[7]}}t.SHA224=f;const u=(()=>o.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(e=>BigInt(e))))(),l=(()=>u[0])(),h=(()=>u[1])(),d=new Uint32Array(80),p=new Uint32Array(80);class v extends r.HashMD{constructor(e=64){super(128,e,16,!1),this.Ah=0|r.SHA512_IV[0],this.Al=0|r.SHA512_IV[1],this.Bh=0|r.SHA512_IV[2],this.Bl=0|r.SHA512_IV[3],this.Ch=0|r.SHA512_IV[4],this.Cl=0|r.SHA512_IV[5],this.Dh=0|r.SHA512_IV[6],this.Dl=0|r.SHA512_IV[7],this.Eh=0|r.SHA512_IV[8],this.El=0|r.SHA512_IV[9],this.Fh=0|r.SHA512_IV[10],this.Fl=0|r.SHA512_IV[11],this.Gh=0|r.SHA512_IV[12],this.Gl=0|r.SHA512_IV[13],this.Hh=0|r.SHA512_IV[14],this.Hl=0|r.SHA512_IV[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:s,Dh:i,Dl:a,Eh:c,El:f,Fh:u,Fl:l,Gh:h,Gl:d,Hh:p,Hl:v}=this;return[e,t,n,r,o,s,i,a,c,f,u,l,h,d,p,v]}set(e,t,n,r,o,s,i,a,c,f,u,l,h,d,p,v){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|s,this.Dh=0|i,this.Dl=0|a,this.Eh=0|c,this.El=0|f,this.Fh=0|u,this.Fl=0|l,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|v}process(e,t){for(let n=0;n<16;n++,t+=4)d[n]=e.getUint32(t),p[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|d[e-15],n=0|p[e-15],r=o.rotrSH(t,n,1)^o.rotrSH(t,n,8)^o.shrSH(t,n,7),s=o.rotrSL(t,n,1)^o.rotrSL(t,n,8)^o.shrSL(t,n,7),i=0|d[e-2],a=0|p[e-2],c=o.rotrSH(i,a,19)^o.rotrBH(i,a,61)^o.shrSH(i,a,6),f=o.rotrSL(i,a,19)^o.rotrBL(i,a,61)^o.shrSL(i,a,6),u=o.add4L(s,f,p[e-7],p[e-16]),l=o.add4H(u,r,c,d[e-7],d[e-16]);d[e]=0|l,p[e]=0|u}let{Ah:n,Al:r,Bh:s,Bl:i,Ch:a,Cl:c,Dh:f,Dl:u,Eh:v,El:y,Fh:g,Fl:b,Gh:m,Gl:w,Hh:E,Hl:S}=this;for(let e=0;e<80;e++){const t=o.rotrSH(v,y,14)^o.rotrSH(v,y,18)^o.rotrBH(v,y,41),I=o.rotrSL(v,y,14)^o.rotrSL(v,y,18)^o.rotrBL(v,y,41),A=v&g^~v&m,x=y&b^~y&w,B=o.add5L(S,I,x,h[e],p[e]),_=o.add5H(B,E,t,A,l[e],d[e]),O=0|B,H=o.rotrSH(n,r,28)^o.rotrBH(n,r,34)^o.rotrBH(n,r,39),P=o.rotrSL(n,r,28)^o.rotrBL(n,r,34)^o.rotrBL(n,r,39),T=n&s^n&a^s&a,V=r&i^r&c^i&c;E=0|m,S=0|w,m=0|g,w=0|b,g=0|v,b=0|y,({h:v,l:y}=o.add(0|f,0|u,0|_,0|O)),f=0|a,u=0|c,a=0|s,c=0|i,s=0|n,i=0|r;const L=o.add3L(O,P,V);n=o.add3H(L,_,H,T),r=0|L}({h:n,l:r}=o.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:s,l:i}=o.add(0|this.Bh,0|this.Bl,0|s,0|i)),({h:a,l:c}=o.add(0|this.Ch,0|this.Cl,0|a,0|c)),({h:f,l:u}=o.add(0|this.Dh,0|this.Dl,0|f,0|u)),({h:v,l:y}=o.add(0|this.Eh,0|this.El,0|v,0|y)),({h:g,l:b}=o.add(0|this.Fh,0|this.Fl,0|g,0|b)),({h:m,l:w}=o.add(0|this.Gh,0|this.Gl,0|m,0|w)),({h:E,l:S}=o.add(0|this.Hh,0|this.Hl,0|E,0|S)),this.set(n,r,s,i,a,c,f,u,v,y,g,b,m,w,E,S)}roundClean(){(0,s.clean)(d,p)}destroy(){(0,s.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=v;class y extends v{constructor(){super(48),this.Ah=0|r.SHA384_IV[0],this.Al=0|r.SHA384_IV[1],this.Bh=0|r.SHA384_IV[2],this.Bl=0|r.SHA384_IV[3],this.Ch=0|r.SHA384_IV[4],this.Cl=0|r.SHA384_IV[5],this.Dh=0|r.SHA384_IV[6],this.Dl=0|r.SHA384_IV[7],this.Eh=0|r.SHA384_IV[8],this.El=0|r.SHA384_IV[9],this.Fh=0|r.SHA384_IV[10],this.Fl=0|r.SHA384_IV[11],this.Gh=0|r.SHA384_IV[12],this.Gl=0|r.SHA384_IV[13],this.Hh=0|r.SHA384_IV[14],this.Hl=0|r.SHA384_IV[15]}}t.SHA384=y;const g=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),b=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class m extends v{constructor(){super(28),this.Ah=0|g[0],this.Al=0|g[1],this.Bh=0|g[2],this.Bl=0|g[3],this.Ch=0|g[4],this.Cl=0|g[5],this.Dh=0|g[6],this.Dl=0|g[7],this.Eh=0|g[8],this.El=0|g[9],this.Fh=0|g[10],this.Fl=0|g[11],this.Gh=0|g[12],this.Gl=0|g[13],this.Hh=0|g[14],this.Hl=0|g[15]}}t.SHA512_224=m;class w extends v{constructor(){super(32),this.Ah=0|b[0],this.Al=0|b[1],this.Bh=0|b[2],this.Bl=0|b[3],this.Ch=0|b[4],this.Cl=0|b[5],this.Dh=0|b[6],this.Dl=0|b[7],this.Eh=0|b[8],this.El=0|b[9],this.Fh=0|b[10],this.Fl=0|b[11],this.Gh=0|b[12],this.Gl=0|b[13],this.Hh=0|b[14],this.Hl=0|b[15]}}t.SHA512_256=w,t.sha256=(0,s.createHasher)(()=>new c),t.sha224=(0,s.createHasher)(()=>new f),t.sha512=(0,s.createHasher)(()=>new v),t.sha384=(0,s.createHasher)(()=>new y),t.sha512_256=(0,s.createHasher)(()=>new w),t.sha512_224=(0,s.createHasher)(()=>new m)},145:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},175:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=o,t.anumber=s,t.abytes=i,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");s(e.outputLen),s(e.blockLen)},t.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},t.aoutput=function(e,t){i(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.clean=function(...e){for(let t=0;t<e.length;t++)e[t].fill(0)},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=a,t.byteSwap32=c,t.bytesToHex=function(e){if(i(e),f)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=u[e[n]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(f)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){const n=h(e.charCodeAt(o)),s=h(e.charCodeAt(o+1));if(void 0===n||void 0===s){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}r[t]=16*n+s}return r},t.asyncLoop=async function(e,n,r){let o=Date.now();for(let s=0;s<e;s++){r(s);const e=Date.now()-o;e>=0&&e<n||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=d,t.bytesToUtf8=function(e){return(new TextDecoder).decode(e)},t.toBytes=p,t.kdfInputToBytes=function(e){return"string"==typeof e&&(e=d(e)),i(e),e},t.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];i(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("options should be object or undefined");return Object.assign(e,t)},t.createHasher=v,t.createOptHasher=y,t.createXOFer=g,t.randomBytes=function(e=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));if(r.crypto&&"function"==typeof r.crypto.randomBytes)return Uint8Array.from(r.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")};const r=n(145);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function i(e,...t){if(!o(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function a(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function c(e){for(let t=0;t<e.length;t++)e[t]=a(e[t]);return e}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.swap8IfBE=t.isLE?e=>e:e=>a(e),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?e=>e:c;const f=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),l={_0:48,_9:57,A:65,F:70,a:97,f:102};function h(e){return e>=l._0&&e<=l._9?e-l._0:e>=l.A&&e<=l.F?e-(l.A-10):e>=l.a&&e<=l.f?e-(l.a-10):void 0}function d(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function p(e){return"string"==typeof e&&(e=d(e)),i(e),e}function v(e){const t=t=>e().update(p(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function y(e){const t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function g(e){const t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}t.nextTick=async()=>{},t.Hash=class{},t.wrapConstructor=v,t.wrapConstructorWithOpts=y,t.wrapXOFConstructorWithOpts=g},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isValueEmpty=void 0,t.deepEquals=function e(t,n){if(t===n)return!0;if(!(t instanceof Object&&n instanceof Object))return!1;if(t.constructor!==n.constructor)return!1;for(var r in t)if(t.hasOwnProperty(r)){if(!n.hasOwnProperty(r))return!1;if(t[r]!==n[r]){if("object"!=typeof t[r])return!1;if(!e(t[r],n[r]))return!1}}for(r in n)if(n.hasOwnProperty(r)&&!t.hasOwnProperty(r))return!1;return!0},t.isValueEmpty=function(e){return null==e||0==e.trim().length}},190:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoEventSpecFetcher=void 0;var o=function(){function e(e,t,n,r){void 0===e&&(e=2e3),void 0===t&&(t=!1),void 0===r&&(r="https://api.avo.app"),this.baseUrl=r,this.timeout=e,this.shouldLog=t,this.env=n,this.inFlightRequests=new Map}return e.prototype.generateRequestKey=function(e){return"".concat(e.streamId,":").concat(e.eventName)},e.prototype.fetch=function(e){return n(this,void 0,void 0,function(){var t,n,o;return r(this,function(r){switch(r.label){case 0:if(t=this.generateRequestKey(e),n=this.inFlightRequests.get(t))return[2,n];o=this.fetchInternal(e),this.inFlightRequests.set(t,o),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,o];case 2:return[2,r.sent()];case 3:return this.inFlightRequests.delete(t),[7];case 4:return[2]}})})},e.prototype.fetchInternal=function(t){return n(this,void 0,void 0,function(){var n,o,s;return r(this,function(r){switch(r.label){case 0:if("dev"!==this.env&&"staging"!==this.env)return[2,null];n=this.buildUrl(t),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.makeRequest(n)];case 2:return(o=r.sent())?this.hasExpectedShape(o)?[2,e.parseEventSpecResponse(o)]:(this.shouldLog&&console.warn("[Avo Inspector] Invalid event spec response for: ".concat(t.eventName)),[2,null]):(this.shouldLog&&console.warn("[Avo Inspector] Failed to fetch event spec for: ".concat(t.eventName)),[2,null]);case 3:return s=r.sent(),this.shouldLog&&console.error("[Avo Inspector] Error fetching event spec for: ".concat(t.eventName),s),[2,null];case 4:return[2]}})})},e.prototype.buildUrl=function(e){var t=new URLSearchParams({apiKey:e.apiKey,streamId:e.streamId,eventName:e.eventName});return"".concat(this.baseUrl,"/trackingPlan/eventSpec?").concat(t.toString())},e.prototype.makeRequest=function(e){var t=this;return new Promise(function(n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.timeout=t.timeout,r.onload=function(){if(200===r.status)try{var e=JSON.parse(r.responseText);n(e)}catch(e){t.shouldLog&&console.error("[Avo Inspector] Failed to parse response:",e),n(null)}else t.shouldLog&&console.warn("[Avo Inspector] Request failed with status: ".concat(r.status)),n(null)},r.onerror=function(){t.shouldLog&&console.error("[Avo Inspector] Network error occurred"),n(null)},r.ontimeout=function(){t.shouldLog&&console.error("[Avo Inspector] Request timed out after ".concat(t.timeout,"ms")),n(null)},r.send()})},e.prototype.hasExpectedShape=function(e){return e&&"object"==typeof e&&Array.isArray(e.events)&&e.metadata&&"object"==typeof e.metadata&&"string"==typeof e.metadata.schemaId&&"string"==typeof e.metadata.branchId&&"string"==typeof e.metadata.latestActionId},e.parseEventSpecResponse=function(t){return{events:t.events.map(e.parseEventSpecEntry),metadata:t.metadata}},e.parseEventSpecEntry=function(t){for(var n={},r=0,o=Object.entries(t.p);r<o.length;r++){var s=o[r],i=Reflect.get(s,"0"),a=Reflect.get(s,"1");Reflect.set(n,i,e.parsePropertyConstraints(a))}return{branchId:t.b,baseEventId:t.id,variantIds:t.vids,props:n}},e.parsePropertyConstraints=function(t){var n={type:t.t,required:t.r};if(t.l&&(n.isList=t.l),t.p&&(n.pinnedValues=t.p),t.v&&(n.allowedValues=t.v),t.rx&&(n.regexPatterns=t.rx),t.minmax&&(n.minMaxRanges=t.minmax),t.children){n.children={};for(var r=0,o=Object.entries(t.children);r<o.length;r++){var s=o[r],i=s[0],a=s[1];n.children[i]=e.parsePropertyConstraints(a)}}return n},e}();t.AvoEventSpecFetcher=o},202:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SHA512_IV=t.SHA384_IV=t.SHA224_IV=t.SHA256_IV=t.HashMD=void 0,t.setBigUint64=o,t.Chi=function(e,t,n){return e&t^~e&n},t.Maj=function(e,t,n){return e&t^e&n^t&n};const r=n(175);function o(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),a=Number(n&s),c=r?4:0,f=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+f,a,r)}class s extends r.Hash{constructor(e,t,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(e),this.view=(0,r.createView)(this.buffer)}update(e){(0,r.aexists)(this),e=(0,r.toBytes)(e),(0,r.abytes)(e);const{view:t,buffer:n,blockLen:o}=this,s=e.length;for(let i=0;i<s;){const a=Math.min(o-this.pos,s-i);if(a===o){const t=(0,r.createView)(e);for(;o<=s-i;i+=o)this.process(t,i);continue}n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,r.aexists)(this),(0,r.aoutput)(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:s,isLE:i}=this;let{pos:a}=this;t[a++]=128,(0,r.clean)(this.buffer.subarray(a)),this.padOffset>s-a&&(this.process(n,0),a=0);for(let e=a;e<s;e++)t[e]=0;o(n,s-8,BigInt(8*this.length),i),this.process(n,0);const c=(0,r.createView)(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=f/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<u;e++)c.setUint32(4*e,l[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:s,pos:i}=this;return e.destroyed=s,e.finished=o,e.length=r,e.pos=i,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}t.HashMD=s,t.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),t.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),t.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),t.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])},243:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoNetworkCallsHandler=void 0;var r=n(249),o=n(611),s=n(829),i=function(){function e(e,t,n,r,o,s){this.samplingRate=1,this.sending=!1,this.apiKey=e,this.envName=t,this.appName=n,this.appVersion=r,this.libVersion=o,this.publicEncryptionKey=s}return e.prototype.callInspectorWithBatchBody=function(e,t){var n=this;if(this.sending)t(new Error("Batch sending cancelled because another batch sending is in progress. Your events will be sent with next batch."));else{var r=e.filter(function(e){return null!=e});this.fixStreamIds(r),0!==r.length&&(this.shouldDropBySampling()?o.AvoInspector.shouldLog&&console.log("Avo Inspector: last event schema dropped due to sampling rate."):(o.AvoInspector.shouldLog&&(console.log("Avo Inspector: events",r),r.forEach(function(e){"sessionStarted"===e.type?console.log("Avo Inspector: sending session started event."):"event"===e.type&&console.log("Avo Inspector: sending event "+e.eventName+" with schema "+JSON.stringify(e.eventProperties))})),this.sending=!0,this.callInspectorApi(r,function(e){n.sending=!1,t(e)})))}},e.prototype.fixStreamIds=function(e){var t=null;e.forEach(function(e){null!==e.streamId&&void 0!==e.streamId&&"unknown"!==e.streamId&&(t=e.streamId)}),e.forEach(function(e){"unknown"===e.streamId&&(e.streamId=null!=t?t:s.AvoStreamId.streamId)})},e.prototype.bodyForSessionStartedCall=function(){var e=this.createBaseCallBody();return e.type="sessionStarted",e},e.prototype.bodyForEventSchemaCall=function(e,t,n,r,o,s){var i=this.createBaseCallBody();return i.type="event",i.eventName=e,i.eventProperties=t,null!=n?(i.avoFunction=!0,i.eventId=n,i.eventHash=r):(i.avoFunction=!1,i.eventId=null,i.eventHash=null),o&&(i.eventSpecMetadata=o),s&&(i.validatedBranchId=s),i},e.prototype.createBaseCallBody=function(){var e={apiKey:this.apiKey,appName:this.appName,appVersion:this.appVersion,libVersion:this.libVersion,env:this.envName,libPlatform:"web",messageId:r.default.newGuid(),trackingId:"",createdAt:(new Date).toISOString(),sessionId:"",streamId:s.AvoStreamId.streamId,samplingRate:this.samplingRate};return this.publicEncryptionKey&&(e.publicEncryptionKey=this.publicEncryptionKey),e},e.prototype.callInspectorImmediately=function(e,t){"unknown"===e.streamId&&(e.streamId=s.AvoStreamId.streamId),o.AvoInspector.shouldLog&&(console.log("Avo Inspector: calling inspector immediately (with validation)",e.eventName),console.log("Avo Inspector: event body",e)),this.callInspectorApi([e],t)},e.prototype.shouldDropBySampling=function(){return Math.random()>this.samplingRate},e.prototype.callInspectorApi=function(t,n){var r=this,s=new XMLHttpRequest;s.open("POST",e.trackingEndpoint,!0),s.setRequestHeader("Content-Type","text/plain"),s.timeout=o.AvoInspector.networkTimeout,s.send(JSON.stringify(t)),s.onload=function(){if(200!==s.status)n(new Error("Error ".concat(s.status,": ").concat(s.statusText)));else{var e=void 0;try{e=JSON.parse(s.response)}catch(e){return void n(new Error("Failed to parse response: ".concat(e instanceof Error?e.message:String(e))))}null==e||"number"!=typeof e.samplingRate||isNaN(e.samplingRate)||(r.samplingRate=e.samplingRate),n(null)}},s.onerror=function(){n(new Error("Request failed"))},s.ontimeout=function(){n(new Error("Request timed out"))}},e.trackingEndpoint="https://api.avo.app/inspector/v1/track",e}();t.AvoNetworkCallsHandler=i},249:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}();t.default=n},318:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toBig=t.shrSL=t.shrSH=t.rotrSL=t.rotrSH=t.rotrBL=t.rotrBH=t.rotr32L=t.rotr32H=t.rotlSL=t.rotlSH=t.rotlBL=t.rotlBH=t.add5L=t.add5H=t.add4L=t.add4H=t.add3L=t.add3H=void 0,t.add=m,t.fromBig=o,t.split=s;const n=BigInt(2**32-1),r=BigInt(32);function o(e,t=!1){return t?{h:Number(e&n),l:Number(e>>r&n)}:{h:0|Number(e>>r&n),l:0|Number(e&n)}}function s(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:a}=o(e[i],t);[r[i],s[i]]=[n,a]}return[r,s]}const i=(e,t)=>BigInt(e>>>0)<<r|BigInt(t>>>0);t.toBig=i;const a=(e,t,n)=>e>>>n;t.shrSH=a;const c=(e,t,n)=>e<<32-n|t>>>n;t.shrSL=c;const f=(e,t,n)=>e>>>n|t<<32-n;t.rotrSH=f;const u=(e,t,n)=>e<<32-n|t>>>n;t.rotrSL=u;const l=(e,t,n)=>e<<64-n|t>>>n-32;t.rotrBH=l;const h=(e,t,n)=>e>>>n-32|t<<64-n;t.rotrBL=h;const d=(e,t)=>t;t.rotr32H=d;const p=(e,t)=>e;t.rotr32L=p;const v=(e,t,n)=>e<<n|t>>>32-n;t.rotlSH=v;const y=(e,t,n)=>t<<n|e>>>32-n;t.rotlSL=y;const g=(e,t,n)=>t<<n-32|e>>>64-n;t.rotlBH=g;const b=(e,t,n)=>e<<n-32|t>>>64-n;function m(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}t.rotlBL=b;const w=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);t.add3L=w;const E=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;t.add3H=E;const S=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);t.add4L=S;const I=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0;t.add4H=I;const A=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0);t.add5L=A;const x=(e,t,n,r,o,s)=>t+n+r+o+s+(e/2**32|0)|0;t.add5H=x;const B={fromBig:o,split:s,toBig:i,shrSH:a,shrSL:c,rotrSH:f,rotrSL:u,rotrBH:l,rotrBL:h,rotr32H:d,rotr32L:p,rotlSH:v,rotlSL:y,rotlBH:g,rotlBL:b,add:m,add3L:w,add3H:E,add4L:S,add4H:I,add5H:x,add5L:A};t.default=B},330:e=>{e.exports={rE:"3.0.1"}},422:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wNAF=void 0,t.negateCt=a,t.normalizeZ=function(e,t){const n=(0,o.FpInvertBatch)(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))},t.mulEndoUnsafe=function(e,t,n,r){let o=t,a=e.ZERO,c=e.ZERO;for(;n>s||r>s;)n&i&&(a=a.add(o)),r&i&&(c=c.add(o)),o=o.double(),n>>=i,r>>=i;return{p1:a,p2:c}},t.pippenger=function(e,t,n,o){l(n,e),h(o,t);const s=n.length,i=o.length;if(s!==i)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,c=(0,r.bitLen)(BigInt(s));let f=1;c>12?f=c-3:c>4?f=c-2:c>0&&(f=2);const u=(0,r.bitMask)(f),d=new Array(Number(u)+1).fill(a);let p=a;for(let e=Math.floor((t.BITS-1)/f)*f;e>=0;e-=f){d.fill(a);for(let t=0;t<i;t++){const r=o[t],s=Number(r>>BigInt(e)&u);d[s]=d[s].add(n[t])}let t=a;for(let e=d.length-1,n=a;e>0;e--)n=n.add(d[e]),t=t.add(n);if(p=p.add(t),0!==e)for(let e=0;e<f;e++)p=p.double()}return p},t.precomputeMSMUnsafe=function(e,t,n,o){c(o,t.BITS),l(n,e);const s=e.ZERO,i=2**o-1,a=Math.ceil(t.BITS/o),f=(0,r.bitMask)(o),u=n.map(e=>{const t=[];for(let n=0,r=e;n<i;n++)t.push(r),r=r.add(e);return t});return e=>{if(h(e,t),e.length>n.length)throw new Error("array of scalars must be smaller than array of points");let r=s;for(let t=0;t<a;t++){if(r!==s)for(let e=0;e<o;e++)r=r.double();const n=BigInt(a*o-(t+1)*o);for(let t=0;t<e.length;t++){const o=e[t],s=Number(o>>n&f);s&&(r=r.add(u[t][s-1]))}}return r}},t.validateBasic=function(e){return(0,o.validateField)(e.Fp),(0,r.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,o.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})},t._createCurveFields=function(e,t,n={},r){if(void 0===r&&(r="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const n=t[e];if(!("bigint"==typeof n&&n>s))throw new Error(`CURVE.${e} must be positive bigint`)}const o=g(t.p,n.Fp,r),i=g(t.n,n.Fn,r),a=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of a)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}};const r=n(627),o=n(967),s=BigInt(0),i=BigInt(1);function a(e,t){const n=t.negate();return e?n:t}function c(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function f(e,t){c(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:(0,r.bitMask)(e),maxNumber:n,shiftBy:BigInt(e)}}function u(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:a}=n;let c=Number(e&o),f=e>>a;c>r&&(c-=s,f+=i);const u=t*r;return{nextN:f,offset:u+Math.abs(c)-1,isZero:0===c,isNeg:c<0,isNegF:t%2!=0,offsetF:u}}function l(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}function h(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}const d=new WeakMap,p=new WeakMap;function v(e){return p.get(e)||1}function y(e){if(e!==s)throw new Error("invalid wNAF")}function g(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,o.validateField)(t),t}return(0,o.Field)(e,{isLE:n})}t.wNAF=class{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>s;)t&i&&(n=n.add(r)),r=r.double(),t>>=i;return n}precomputeWindow(e,t){const{windows:n,windowSize:r}=f(t,this.bits),o=[];let s=e,i=s;for(let e=0;e<n;e++){i=s,o.push(i);for(let e=1;e<r;e++)i=i.add(s),o.push(i);s=i.double()}return o}wNAF(e,t,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let r=this.ZERO,o=this.BASE;const s=f(e,this.bits);for(let e=0;e<s.windows;e++){const{nextN:i,offset:c,isZero:f,isNeg:l,isNegF:h,offsetF:d}=u(n,e,s);n=i,f?o=o.add(a(h,t[d])):r=r.add(a(l,t[c]))}return y(n),{p:r,f:o}}wNAFUnsafe(e,t,n,r=this.ZERO){const o=f(e,this.bits);for(let e=0;e<o.windows&&n!==s;e++){const{nextN:s,offset:i,isZero:a,isNeg:c}=u(n,e,o);if(n=s,!a){const e=t[i];r=r.add(c?e.negate():e)}}return y(n),r}getPrecomputes(e,t,n){let r=d.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&("function"==typeof n&&(r=n(r)),d.set(t,r))),r}cached(e,t,n){const r=v(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){const o=v(e);return 1===o?this._unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)}createCache(e,t){c(t,this.bits),p.set(e,t),d.delete(e)}hasCache(e){return 1!==v(e)}}},491:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoStorage=void 0;var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.useFallbackStorage=!1,t.fallbackStorage={},t.storageInitialized=!1,t.onStorageInitFuncs=[],t.shouldLog=!1,t.suffix="",t}return r(t,e),t.prototype.init=function(e,t){this.shouldLog=e,this.suffix=t,this.initializeStorageWeb(this.isLocalStorageAvailable())},t.prototype.initializeStorageWeb=function(e){this.storageInitialized=!0,e||(this.useFallbackStorage=!0),this.onStorageInitFuncs.forEach(function(e){e()})},t.prototype.isLocalStorageAvailable=function(){var e=(new Date).toISOString();try{return window.localStorage.setItem(e,e),window.localStorage.getItem(e)===e&&(window.localStorage.removeItem(e),!0)}catch(e){return!1}},t.prototype.isInitialized=function(){return this.storageInitialized},t.prototype.getItemAsync=function(e){return o(this,void 0,void 0,function(){var t=this;return s(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n,r){t.runAfterInit(function(){if(t.useFallbackStorage){var r=t.fallbackStorage[e+t.suffix];n(t.parseJson(r))}else if("undefined"!=typeof window){r=void 0;try{r=window.localStorage.getItem(e+t.suffix)}catch(e){t.shouldLog&&console.error("Avo Inspector Storage getItemAsync error:",e),n(null)}n(t.parseJson(r))}else n(null)})})];case 1:return[2,n.sent()]}})})},t.prototype.getItem=function(e){var t;if(this.storageInitialized){if(this.useFallbackStorage)t=this.fallbackStorage[e+this.suffix];else if("undefined"!=typeof window)try{t=window.localStorage.getItem(e+this.suffix)}catch(e){this.shouldLog&&console.error("Avo Inspector Storage getItem error:",e)}}else t=null;return this.parseJson(t)},t.prototype.setItem=function(e,t){var n=this;this.runAfterInit(function(){if(n.useFallbackStorage)n.fallbackStorage[e+n.suffix]=JSON.stringify(t);else if("undefined"!=typeof window)try{window.localStorage.setItem(e+n.suffix,JSON.stringify(t))}catch(e){n.shouldLog&&console.error("Avo Inspector Storage setItem error:",e)}})},t.prototype.removeItem=function(e){var t=this;this.runAfterInit(function(){if(t.useFallbackStorage)t.fallbackStorage[e+t.suffix]=null;else if("undefined"!=typeof window)try{window.localStorage.removeItem(e+t.suffix)}catch(e){t.shouldLog&&console.error("Avo Inspector Storage removeItem error:",e)}})},t.prototype.runAfterInit=function(e){this.storageInitialized?e():this.onStorageInitFuncs.push(e)},t}(function(){function e(){}return e.prototype.parseJson=function(e){return null!=e?JSON.parse(e):null},e}()),a=function(){function e(e,t){void 0===t&&(t=""),this.Platform=null,this.Platform="browser",this.storageImpl=new i,this.storageImpl.init(e,t)}return e.prototype.isInitialized=function(){return this.storageImpl.isInitialized()},e.prototype.getItemAsync=function(e){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this.storageImpl.getItemAsync(e)];case 1:return[2,t.sent()]}})})},e.prototype.getItem=function(e){return this.storageImpl.getItem(e)},e.prototype.setItem=function(e,t){this.storageImpl.setItem(e,t)},e.prototype.removeItem=function(e){this.storageImpl.removeItem(e)},e.prototype.runAfterInit=function(e){this.storageImpl.runAfterInit(e)},e}();t.AvoStorage=a},492:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoDeduplicator=void 0;var s=n(924),i=n(185),a=function(){function e(){this.avoFunctionsEvents={},this.manualEvents={},this.avoFunctionsEventsParams={},this.manualEventsParams={}}return e.prototype.shouldRegisterEvent=function(e,t,n){this.clearOldEvents(),n?(this.avoFunctionsEvents[Date.now()]=e,this.avoFunctionsEventsParams[e]=t):(this.manualEvents[Date.now()]=e,this.manualEventsParams[e]=t);var r=!n;return!this.hasSameEventAs(e,t,r)},e.prototype.hasSameEventAs=function(e,t,n){var r=!1;return n?this.lookForEventIn(e,t,this.avoFunctionsEventsParams)&&(r=!0):this.lookForEventIn(e,t,this.manualEventsParams)&&(r=!0),r&&(delete this.avoFunctionsEventsParams[e],delete this.manualEventsParams[e]),r},e.prototype.lookForEventIn=function(e,t,n){for(var r in n)if(n.hasOwnProperty(r)&&r===e){var o=n[e];if(o&&(0,i.deepEquals)(t,o))return!0}return!1},e.prototype.hasSeenEventParams=function(e,t){var n=!1;return t?this.lookForEventParamsIn(e,this.avoFunctionsEventsParams)&&(n=!0):this.lookForEventParamsIn(e,this.manualEventsParams)&&(n=!0),n},e.prototype.lookForEventParamsIn=function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(r&&(0,i.deepEquals)(e,r))return!0}return!1},e.prototype.shouldRegisterSchemaFromManually=function(e,t){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return this.clearOldEvents(),[4,this.hasSameShapeInAvoFunctionsAs(e,t)];case 1:return[2,!n.sent()]}})})},e.prototype.hasSameShapeInAvoFunctionsAs=function(e,t){return r(this,void 0,void 0,function(){var n;return o(this,function(r){switch(r.label){case 0:return n=!1,[4,this.lookForEventSchemaIn(e,t,this.avoFunctionsEventsParams)];case 1:return r.sent()&&(n=!0),n&&delete this.avoFunctionsEventsParams[e],[2,n]}})})},e.prototype.lookForEventSchemaIn=function(e,t,n){return r(this,void 0,void 0,function(){var r,a,c,f,u,l;return o(this,function(o){switch(o.label){case 0:for(c in a=[],r=n)a.push(c);f=0,o.label=1;case 1:return f<a.length?(c=a[f])in r?(u=c,n.hasOwnProperty(u)?u!==e?[3,3]:[4,s.AvoSchemaParser.extractSchema(n[e])]:[3,3]):[3,3]:[3,4];case 2:if((l=o.sent())&&(0,i.deepEquals)(t,l))return[2,!0];o.label=3;case 3:return f++,[3,1];case 4:return[2,!1]}})})},e.prototype.clearOldEvents=function(){var e=Date.now();for(var t in this.avoFunctionsEvents)if(this.avoFunctionsEvents.hasOwnProperty(t)&&e-(Number(t)||0)>300){var n=this.avoFunctionsEvents[t];delete this.avoFunctionsEvents[t],delete this.avoFunctionsEventsParams[n]}for(var t in this.manualEvents)this.manualEvents.hasOwnProperty(t)&&e-(Number(t)||0)>300&&(n=this.manualEvents[t],delete this.manualEvents[t],delete this.manualEventsParams[n])},e.prototype._clearEvents=function(){this.avoFunctionsEvents={},this.manualEvents={},this.avoFunctionsEventsParams={},this.manualEventsParams={}},e}();t.AvoDeduplicator=a},499:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventSpecCache=void 0;var n=function(){function e(e){void 0===e&&(e=!1),this.TTL_MS=6e4,this.MAX_EVENT_COUNT=50,this.globalEventCount=0,this.cache=new Map,this.shouldLog=e}return e.prototype.generateKey=function(e,t,n){return"".concat(e,":").concat(t,":").concat(n)},e.prototype.get=function(e,t,n){var r=this.generateKey(e,t,n),o=this.cache.get(r);return o?this.shouldEvict(o)?(this.cache.delete(r),null):(this.shouldLog&&console.log("[Avo Inspector] Cache hit for key: ".concat(r)),o.lastAccessed=Date.now(),o.eventCount++,this.globalEventCount++,this.globalEventCount>=this.MAX_EVENT_COUNT&&(this.evictOldest(),this.globalEventCount=0),o.spec):null},e.prototype.set=function(e,t,n,r){var o=this.generateKey(e,t,n),s=Date.now(),i={spec:r,timestamp:s,lastAccessed:s,eventCount:0};this.cache.set(o,i)},e.prototype.shouldEvict=function(e){var t=Date.now()-e.timestamp>this.TTL_MS,n=e.eventCount>=this.MAX_EVENT_COUNT;return t||n},e.prototype.evictOldest=function(){if(0!==this.cache.size){var e=null,t=1/0;this.cache.forEach(function(n,r){n.lastAccessed<t&&(t=n.lastAccessed,e=r)}),null!==e&&this.cache.delete(e)}},e.prototype.clear=function(){this.cache.clear(),this.globalEventCount=0,this.shouldLog&&console.log("[Avo Inspector] Cache cleared")},e.prototype.size=function(){return this.cache.size},e.prototype.getStats=function(){var e=[],t=Date.now();return this.cache.forEach(function(n,r){e.push({key:r,age:t-n.timestamp,lastAccessedAgo:t-n.lastAccessed,eventCount:n.eventCount})}),{size:this.cache.size,globalEventCount:this.globalEventCount,entries:e}},e}();t.EventSpecCache=n},562:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHash=function(e){return{hash:e}},t.createCurve=function(e,t){const n=t=>(0,r.weierstrass)({...e,hash:t});return{...n(t),create:n}};const r=n(705)},611:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoInspector=void 0;var s=n(844),i=n(924),a=n(669),c=n(243),f=n(491),u=n(492),l=n(499),h=n(190),d=n(829),p=n(916),v=n(185),y=n(330).rE,g=function(){function e(t){if(this.currentBranchId=null,(0,v.isValueEmpty)(t.env)?(this.environment=s.AvoInspectorEnv.Dev,console.warn("[Avo Inspector] No environment provided. Defaulting to dev.")):Object.values(s.AvoInspectorEnv).includes(t.env)?this.environment=t.env:(this.environment=s.AvoInspectorEnv.Dev,console.warn("[Avo Inspector] Unsupported environment provided. Defaulting to dev. Supported environments - Dev, Staging, Prod.")),(0,v.isValueEmpty)(t.apiKey))throw new Error("[Avo Inspector] No API key provided. Inspector can't operate without API key.");if(this.apiKey=t.apiKey,(0,v.isValueEmpty)(t.version))throw new Error("[Avo Inspector] No version provided. Many features of Inspector rely on versioning. Please provide comparable string version, i.e. integer or semantic.");this.version=t.version,this.environment===s.AvoInspectorEnv.Dev?(e._batchSize=1,e._shouldLog=!0):(e._batchSize=30,e._batchFlushSeconds=30,e._shouldLog=!1),e.avoStorage=new f.AvoStorage(e._shouldLog,null!=t.suffix?t.suffix:""),this.publicEncryptionKey=t.publicEncryptionKey,this.avoNetworkCallsHandler=new c.AvoNetworkCallsHandler(this.apiKey,this.environment.toString(),t.appName||"",this.version,y,this.publicEncryptionKey),this.avoBatcher=new a.AvoBatcher(this.avoNetworkCallsHandler),this.avoDeduplicator=new u.AvoDeduplicator,this.streamId=d.AvoStreamId.streamId,this.streamId&&(this.eventSpecCache=new l.EventSpecCache(e._shouldLog),this.eventSpecFetcher=new h.AvoEventSpecFetcher(e._networkTimeout,e._shouldLog,this.environment),e._shouldLog&&(console.log("[Avo Inspector] Event spec fetching and validation enabled"),this.publicEncryptionKey&&console.log("[Avo Inspector] Property value encryption enabled")))}return Object.defineProperty(e,"batchSize",{get:function(){return this._batchSize},set:function(e){this._batchSize=e<1?1:e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"batchFlushSeconds",{get:function(){return this._batchFlushSeconds},enumerable:!1,configurable:!0}),Object.defineProperty(e,"shouldLog",{get:function(){return this._shouldLog},set:function(e){this._shouldLog=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"networkTimeout",{get:function(){return this._networkTimeout},set:function(e){this._networkTimeout=e},enumerable:!1,configurable:!0}),e.prototype.trackSchemaFromEvent=function(t,n){return r(this,void 0,void 0,function(){var r,s,i,a;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),this.avoDeduplicator.shouldRegisterEvent(t,n,!1)?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with params "+JSON.stringify(n)),[4,this.extractSchema(n,!1)]):[3,3];case 1:return r=o.sent(),[4,this.fetchAndValidateEvent(t,n)];case 2:return(s=o.sent())?(i=this.mergeValidationResults(r,s),this.sendEventWithValidation(t,i,null,null,s)):this.trackSchemaInternal(t,r,null,null),[2,r];case 3:return e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),[2,[]];case 4:return[3,6];case 5:return a=o.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",a),[2,[]];case 6:return[2]}})})},e.prototype._avoFunctionTrackSchemaFromEvent=function(t,n,s,i){return r(this,void 0,void 0,function(){var r,a,c,f;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),this.avoDeduplicator.shouldRegisterEvent(t,n,!0)?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with params "+JSON.stringify(n)),[4,this.extractSchema(n,!1)]):[3,3];case 1:return r=o.sent(),[4,this.fetchAndValidateEvent(t,n)];case 2:return(a=o.sent())?(c=this.mergeValidationResults(r,a),this.sendEventWithValidation(t,c,s,i,a)):this.trackSchemaInternal(t,r,s,i),[2,r];case 3:return e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),[2,[]];case 4:return[3,6];case 5:return f=o.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",f),[2,[]];case 6:return[2]}})})},e.prototype.trackSchema=function(t,n){return r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.avoDeduplicator.shouldRegisterSchemaFromManually(t,n)];case 1:return o.sent()?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with schema "+JSON.stringify(n)),[4,this.fetchEventSpecIfNeeded(t)]):[3,3];case 2:return o.sent(),this.trackSchemaInternal(t,n,null,null),[3,4];case 3:e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),o.label=4;case 4:return[3,6];case 5:return r=o.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",r),[3,6];case 6:return[2]}})})},e.prototype.trackSchemaInternal=function(e,t,n,r){try{this.avoBatcher.handleTrackSchema(e,t,n,r)}catch(e){console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",e)}},e.prototype.enableLogging=function(t){e._shouldLog=t},e.prototype.extractSchema=function(t){return r(this,arguments,void 0,function(t,n){var r;return void 0===n&&(n=!0),o(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.avoDeduplicator.hasSeenEventParams(t,!0)&&n&&e.shouldLog&&console.warn("Avo Inspector: WARNING! You are trying to extract schema shape that was just reported by your Avo Codegen. This is an indicator of duplicate inspector reporting. Please reach out to support@avo.app for advice if you are not sure how to handle this."),e.shouldLog&&console.log("Avo Inspector: extracting schema from "+JSON.stringify(t)),[4,i.AvoSchemaParser.extractSchema(t,this.publicEncryptionKey,this.environment)];case 1:return[2,o.sent()];case 2:return r=o.sent(),console.error("Avo Inspector: something went wrong in extractSchema. Please report to support@avo.app.",r),[2,[]];case 3:return[2]}})})},e.prototype.setBatchSize=function(t){e._batchSize=t},e.prototype.setBatchFlushSeconds=function(t){e._batchFlushSeconds=t},e.prototype.handleBranchChangeAndCache=function(t,n){var r,o=t.metadata.branchId;null!==this.currentBranchId&&this.currentBranchId!==o&&(e.shouldLog&&console.log("[Avo Inspector] Branch changed from ".concat(this.currentBranchId," to ").concat(o,". Flushing cache.")),null===(r=this.eventSpecCache)||void 0===r||r.clear()),this.currentBranchId=o,this.eventSpecCache&&this.streamId&&this.eventSpecCache.set(this.apiKey,this.streamId,n,t)},e.prototype.fetchEventSpecIfNeeded=function(t){return r(this,void 0,void 0,function(){var n,r;return o(this,function(o){switch(o.label){case 0:if(this.environment===s.AvoInspectorEnv.Prod)return[2];if(!this.eventSpecCache||!this.eventSpecFetcher||!this.streamId)return[2];o.label=1;case 1:return o.trys.push([1,4,,5]),n=null,this.eventSpecCache&&(n=this.eventSpecCache.get(this.apiKey,this.streamId,t)),n?[3,3]:[4,this.eventSpecFetcher.fetch({apiKey:this.apiKey,streamId:this.streamId,eventName:t})];case 2:(n=o.sent())&&this.handleBranchChangeAndCache(n,t),o.label=3;case 3:return[3,5];case 4:return r=o.sent(),e.shouldLog&&console.error("[Avo Inspector] Error fetching event spec for ".concat(t,":"),r),[3,5];case 5:return[2]}})})},e.prototype.fetchAndValidateEvent=function(t,n){return r(this,void 0,void 0,function(){var r,i;return o(this,function(o){switch(o.label){case 0:if(this.environment===s.AvoInspectorEnv.Prod)return[2,null];if(!this.eventSpecCache||!this.eventSpecFetcher||!this.streamId)return[2,null];o.label=1;case 1:return o.trys.push([1,4,,5]),r=null,this.eventSpecCache&&(r=this.eventSpecCache.get(this.apiKey,this.streamId,t)),r?[3,3]:[4,this.eventSpecFetcher.fetch({apiKey:this.apiKey,streamId:this.streamId,eventName:t})];case 2:(r=o.sent())&&this.handleBranchChangeAndCache(r,t),o.label=3;case 3:return r?[2,(0,p.validateEvent)(n,r)]:[2,null];case 4:return i=o.sent(),e.shouldLog&&console.error("[Avo Inspector] Error validating event ".concat(t,":"),i),[2,null];case 5:return[2]}})})},e.prototype.mergeValidationResults=function(e,t){var n=this;return e.map(function(e){var r=t.propertyResults[e.propertyName];return n.mergePropertyValidation(e,r)})},e.prototype.mergePropertyValidation=function(e,t){var n=this,r={propertyName:e.propertyName,propertyType:e.propertyType};return e.encryptedPropertyValue&&(r.encryptedPropertyValue=e.encryptedPropertyValue),e.children&&Array.isArray(e.children)&&(r.children=e.children.map(function(e){var r;if("string"==typeof e)return e;if(e&&"object"==typeof e&&e.propertyName){var o=null===(r=null==t?void 0:t.children)||void 0===r?void 0:r[e.propertyName];return n.mergePropertyValidation(e,o)}return e})),t&&(t.failedEventIds&&(r.failedEventIds=t.failedEventIds),t.passedEventIds&&(r.passedEventIds=t.passedEventIds)),r},e.prototype.sendEventWithValidation=function(t,n,r,o,s){var i,a,c=this;e.shouldLog&&n.some(function(e){return e.failedEventIds&&e.failedEventIds.length>0})&&console.log('[Avo Inspector] Validation failures for event "'.concat(t,'":'),n.filter(function(e){return e.failedEventIds&&e.failedEventIds.length>0}).map(function(e){return{property:e.propertyName,failedEventIds:e.failedEventIds}}));var f=this.avoNetworkCallsHandler.bodyForEventSchemaCall(t,n,r,o,null!==(i=s.metadata)&&void 0!==i?i:void 0,null===(a=s.metadata)||void 0===a?void 0:a.branchId);this.avoNetworkCallsHandler.callInspectorImmediately(f,function(s){s?(e.shouldLog&&console.error('[Avo Inspector] Failed to send event "'.concat(t,'" with validation:'),s),c.avoBatcher.handleTrackSchema(t,n,r,o)):e.shouldLog&&console.log('[Avo Inspector] Event "'.concat(t,'" sent successfully with validation'))})},e._batchSize=30,e._batchFlushSeconds=30,e._shouldLog=!1,e._networkTimeout=2e3,e}();t.AvoInspector=g},615:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const r=n(175);class o extends r.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,r.ahash)(e);const n=(0,r.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?e.create().update(n).digest():n);for(let e=0;e<s.length;e++)s[e]^=54;this.iHash.update(s),this.oHash=e.create();for(let e=0;e<s.length;e++)s[e]^=106;this.oHash.update(s),(0,r.clean)(s)}update(e){return(0,r.aexists)(this),this.iHash.update(e),this}digestInto(e){(0,r.aexists)(this),(0,r.abytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:s,outputLen:i}=this;return e.finished=r,e.destroyed=o,e.blockLen=s,e.outputLen=i,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=o,t.hmac=(e,t,n)=>new o(e,t).update(n).digest(),t.hmac.create=(e,t)=>new o(e,t)},627:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.notImplemented=t.bitMask=t.utf8ToBytes=t.randomBytes=t.isBytes=t.hexToBytes=t.concatBytes=t.bytesToUtf8=t.bytesToHex=t.anumber=t.abytes=void 0,t.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},t._abool2=function(e,t=""){if("boolean"!=typeof e)throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e);return e},t._abytes2=function(e,t,n=""){const o=(0,r.isBytes)(e),s=e?.length,i=void 0!==t;if(!o||i&&s!==t)throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(i?` of length ${t}`:"")+", got "+(o?`length=${s}`:"type="+typeof e));return e},t.numberToHexUnpadded=a,t.hexToNumber=c,t.bytesToNumberBE=function(e){return c((0,r.bytesToHex)(e))},t.bytesToNumberLE=function(e){return(0,r.abytes)(e),c((0,r.bytesToHex)(Uint8Array.from(e).reverse()))},t.numberToBytesBE=f,t.numberToBytesLE=function(e,t){return f(e,t).reverse()},t.numberToVarBytesBE=function(e){return(0,r.hexToBytes)(a(e))},t.ensureBytes=function(e,t,n){let o;if("string"==typeof t)try{o=(0,r.hexToBytes)(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!(0,r.isBytes)(t))throw new Error(e+" must be hex string or Uint8Array");o=Uint8Array.from(t)}const s=o.length;if("number"==typeof n&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return o},t.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},t.copyBytes=function(e){return Uint8Array.from(e)},t.asciiToBytes=function(e){return Uint8Array.from(e,(t,n)=>{const r=t.charCodeAt(0);if(1!==t.length||r>127)throw new Error(`string contains non-ASCII character "${e[n]}" with code ${r} at position ${n}`);return r})},t.inRange=l,t.aInRange=function(e,t,n,r){if(!l(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)},t.bitLen=function(e){let t;for(t=0;e>s;e>>=i,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&i},t.bitSet=function(e,t,n){return e|(n?i:s)<<BigInt(t)},t.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");const o=e=>new Uint8Array(e),s=e=>Uint8Array.of(e);let i=o(e),a=o(e),c=0;const f=()=>{i.fill(1),a.fill(0),c=0},u=(...e)=>n(a,i,...e),l=(e=o(0))=>{a=u(s(0),e),i=u(),0!==e.length&&(a=u(s(1),e),i=u())},h=()=>{if(c++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){i=u();const t=i.slice();n.push(t),e+=i.length}return(0,r.concatBytes)(...n)};return(e,t)=>{let n;for(f(),l(e);!(n=t(h()));)l();return f(),n}},t.validateObject=function(e,t,n={}){const r=(t,n,r)=>{const o=h[n];if("function"!=typeof o)throw new Error("invalid validator function");const s=e[t];if(!(r&&void 0===s||o(s,e)))throw new Error("param "+String(t)+" is invalid. Expected "+n+", got "+s)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e},t.isHash=function(e){return"function"==typeof e&&Number.isSafeInteger(e.outputLen)},t._validateObject=function(e,t,n={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function r(t,n,r){const o=e[t];if(r&&void 0===o)return;const s=typeof o;if(s!==n||null===o)throw new Error(`param "${t}" is invalid: expected ${n}, got ${s}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))},t.memoized=function(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(void 0!==o)return o;const s=e(n,...r);return t.set(n,s),s}};const r=n(175);var o=n(175);Object.defineProperty(t,"abytes",{enumerable:!0,get:function(){return o.abytes}}),Object.defineProperty(t,"anumber",{enumerable:!0,get:function(){return o.anumber}}),Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(t,"bytesToUtf8",{enumerable:!0,get:function(){return o.bytesToUtf8}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(t,"hexToBytes",{enumerable:!0,get:function(){return o.hexToBytes}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return o.isBytes}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return o.randomBytes}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}});const s=BigInt(0),i=BigInt(1);function a(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function c(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?s:BigInt("0x"+e)}function f(e,t){return(0,r.hexToBytes)(e.toString(16).padStart(2*t,"0"))}const u=e=>"bigint"==typeof e&&s<=e;function l(e,t,n){return u(e)&&u(t)&&u(n)&&t<=e&&e<n}t.bitMask=e=>(i<<BigInt(e))-i;const h={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||(0,r.isBytes)(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};t.notImplemented=()=>{throw new Error("not implemented")}},669:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoBatcher=void 0;var r=n(611),o=function(){function e(t){var n=this;this.events=[],this.networkCallsHandler=t,this.batchFlushAttemptTimestamp=Date.now(),r.AvoInspector.avoStorage.getItemAsync(e.cacheKey).then(function(e){if(null!==e){var t=e.filter(function(e){return null!==e});n.events=n.events.concat(t),n.checkIfBatchNeedsToBeSent()}}).catch(function(e){console.error("Avo Inspector: error getting events from cache",e)})}return e.prototype.handleSessionStarted=function(){this.events.push(this.networkCallsHandler.bodyForSessionStartedCall()),this.saveEvents(),this.checkIfBatchNeedsToBeSent()},e.prototype.handleTrackSchema=function(e,t,n,o,s){this.events.push(this.networkCallsHandler.bodyForEventSchemaCall(e,t,n,o,s)),this.saveEvents(),r.AvoInspector.shouldLog&&console.log("Avo Inspector: saved event "+e+" with schema "+JSON.stringify(t)),this.checkIfBatchNeedsToBeSent()},e.prototype.checkIfBatchNeedsToBeSent=function(){var e=this.events.length,t=Date.now(),n=t-this.batchFlushAttemptTimestamp,o=e%r.AvoInspector.batchSize==0,s=n>=1e3*r.AvoInspector.batchFlushSeconds,i=this;if(o||s){this.batchFlushAttemptTimestamp=t;var a=i.events;i.events=[],this.networkCallsHandler.callInspectorWithBatchBody(a,function(e){null!=e?(i.events=i.events.concat(a),r.AvoInspector.shouldLog&&console.log("Avo Inspector: batch sending failed: "+e.message+". We will attempt to send your schemas with next batch")):r.AvoInspector.shouldLog&&console.log("Avo Inspector: batch sent successfully."),i.saveEvents()})}},e.prototype.saveEvents=function(){if(this.events.length>1e3){var t=this.events.length-1e3;this.events.splice(0,t)}r.AvoInspector.avoStorage.setItem(e.cacheKey,this.events)},Object.defineProperty(e,"cacheKey",{get:function(){return"AvoInspectorEvents"},enumerable:!1,configurable:!0}),e}();t.AvoBatcher=o},705:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DER=t.DERErr=void 0,t._splitEndoScalar=f,t._normFnElement=b,t.weierstrassN=m,t.SWUFpSqrtRatio=E,t.mapToCurveSimpleSWU=function(e,t){(0,a.validateField)(e);const{A:n,B:r,Z:o}=t;if(!e.isValid(n)||!e.isValid(r)||!e.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");const s=E(e,o);if(!e.isOdd)throw new Error("Field does not have .isOdd()");return t=>{let i,c,f,u,l,h,d,p;i=e.sqr(t),i=e.mul(i,o),c=e.sqr(i),c=e.add(c,i),f=e.add(c,e.ONE),f=e.mul(f,r),u=e.cmov(o,e.neg(c),!e.eql(c,e.ZERO)),u=e.mul(u,n),c=e.sqr(f),h=e.sqr(u),l=e.mul(h,n),c=e.add(c,l),c=e.mul(c,f),h=e.mul(h,u),l=e.mul(h,r),c=e.add(c,l),d=e.mul(i,f);const{isValid:v,value:y}=s(c,h);p=e.mul(i,t),p=e.mul(p,y),d=e.cmov(d,f,v),p=e.cmov(p,y,v);const g=e.isOdd(t)===e.isOdd(p);p=e.cmov(e.neg(p),p,g);const b=(0,a.FpInvertBatch)(e,[u],!0)[0];return d=e.mul(d,b),{x:d,y:p}}},t.ecdh=I,t.ecdsa=A,t.weierstrassPoints=function(e){const{CURVE:t,curveOpts:n}=x(e);return function(e,t){const{Fp:n,Fn:r}=t;const o=B(n,e.a,e.b);return Object.assign({},{CURVE:e,Point:t,ProjectivePoint:t,normPrivateKeyToScalar:e=>b(r,e),weierstrassEquation:o,isWithinCurveOrder:function(e){return(0,s.inRange)(e,p,r.ORDER)}})}(e,m(t,n))},t._legacyHelperEquat=B,t.weierstrass=function(e){const{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:o}=function(e){const{CURVE:t,curveOpts:n}=x(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}(e);return function(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,(0,a.nLength)(n.Fn.ORDER,n.Fn.BITS))})}(e,A(m(t,n),r,o))};const r=n(615),o=n(175),s=n(627),i=n(422),a=n(967),c=(e,t)=>(e+(e>=0?t:-t)/v)/t;function f(e,t,n){const[[r,o],[i,a]]=t,f=c(a*e,n),u=c(-o*e,n);let l=e-f*r-u*i,h=-f*o-u*a;const v=l<d,y=h<d;v&&(l=-l),y&&(h=-h);const g=(0,s.bitMask)(Math.ceil((0,s.bitLen)(n)/2))+p;if(l<d||l>=g||h<d||h>=g)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:v,k1:l,k2neg:y,k2:h}}function u(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function l(e,t){const n={};for(let r of Object.keys(t))n[r]=void 0===e[r]?t[r]:e[r];return(0,s._abool2)(n.lowS,"lowS"),(0,s._abool2)(n.prehash,"prehash"),void 0!==n.format&&u(n.format),n}class h extends Error{constructor(e=""){super(e)}}t.DERErr=h,t.DER={Err:h,_tlv:{encode:(e,n)=>{const{Err:r}=t.DER;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&n.length)throw new r("tlv.encode: unpadded data");const o=n.length/2,i=(0,s.numberToHexUnpadded)(o);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const a=o>127?(0,s.numberToHexUnpadded)(i.length/2|128):"";return(0,s.numberToHexUnpadded)(e)+a+i+n},decode(e,n){const{Err:r}=t.DER;let o=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(n.length<2||n[o++]!==e)throw new r("tlv.decode: wrong tlv");const s=n[o++];let i=0;if(128&s){const e=127&s;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const t=n.subarray(o,o+e);if(t.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===t[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of t)i=i<<8|e;if(o+=e,i<128)throw new r("tlv.decode(long): not minimal encoding")}else i=s;const a=n.subarray(o,o+i);if(a.length!==i)throw new r("tlv.decode: wrong value length");return{v:a,l:n.subarray(o+i)}}},_int:{encode(e){const{Err:n}=t.DER;if(e<d)throw new n("integer: negative integers are not allowed");let r=(0,s.numberToHexUnpadded)(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new n("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:n}=t.DER;if(128&e[0])throw new n("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new n("invalid signature integer: unnecessary leading zero");return(0,s.bytesToNumberBE)(e)}},toSig(e){const{Err:n,_int:r,_tlv:o}=t.DER,i=(0,s.ensureBytes)("signature",e),{v:a,l:c}=o.decode(48,i);if(c.length)throw new n("invalid signature: left bytes after parsing");const{v:f,l:u}=o.decode(2,a),{v:l,l:h}=o.decode(2,u);if(h.length)throw new n("invalid signature: left bytes after parsing");return{r:r.decode(f),s:r.decode(l)}},hexFromSig(e){const{_tlv:n,_int:r}=t.DER,o=n.encode(2,r.encode(e.r))+n.encode(2,r.encode(e.s));return n.encode(48,o)}};const d=BigInt(0),p=BigInt(1),v=BigInt(2),y=BigInt(3),g=BigInt(4);function b(e,t){const{BYTES:n}=e;let r;if("bigint"==typeof t)r=t;else{let o=(0,s.ensureBytes)("private key",t);try{r=e.fromBytes(o)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function m(e,t={}){const n=(0,i._createCurveFields)("weierstrass",e,t),{Fp:r,Fn:o}=n;let a=n.CURVE;const{h:c,n:u}=a;(0,s._validateObject)(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:l}=t;if(l&&(!r.is0(a.a)||"bigint"!=typeof l.beta||!Array.isArray(l.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const h=S(r,o);function v(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const m=t.toBytes||function(e,t,n){const{x:o,y:i}=t.toAffine(),a=r.toBytes(o);if((0,s._abool2)(n,"isCompressed"),n){v();const e=!r.isOdd(i);return(0,s.concatBytes)(w(e),a)}return(0,s.concatBytes)(Uint8Array.of(4),a,r.toBytes(i))},E=t.fromBytes||function(e){(0,s._abytes2)(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:n}=h,o=e.length,i=e[0],a=e.subarray(1);if(o!==t||2!==i&&3!==i){if(o===n&&4===i){const e=r.BYTES,t=r.fromBytes(a.subarray(0,e)),n=r.fromBytes(a.subarray(e,2*e));if(!A(t,n))throw new Error("bad point: is not on curve");return{x:t,y:n}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${n}`)}{const e=r.fromBytes(a);if(!r.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=I(e);let n;try{n=r.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}return v(),!(1&~i)!==r.isOdd(n)&&(n=r.neg(n)),{x:e,y:n}}};function I(e){const t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,a.a)),a.b)}function A(e,t){const n=r.sqr(t),o=I(e);return r.eql(n,o)}if(!A(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const x=r.mul(r.pow(a.a,y),g),B=r.mul(r.sqr(a.b),BigInt(27));if(r.is0(r.add(x,B)))throw new Error("bad curve params: a or b");function _(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function O(e){if(!(e instanceof L))throw new Error("ProjectivePoint expected")}function H(e){if(!l||!l.basises)throw new Error("no endo");return f(e,l.basises,o.ORDER)}const P=(0,s.memoized)((e,t)=>{const{X:n,Y:o,Z:s}=e;if(r.eql(s,r.ONE))return{x:n,y:o};const i=e.is0();null==t&&(t=i?r.ONE:r.inv(s));const a=r.mul(n,t),c=r.mul(o,t),f=r.mul(s,t);if(i)return{x:r.ZERO,y:r.ZERO};if(!r.eql(f,r.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),T=(0,s.memoized)(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:n,y:o}=e.toAffine();if(!r.isValid(n)||!r.isValid(o))throw new Error("bad point: x or y not field elements");if(!A(n,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function V(e,t,n,o,s){return n=new L(r.mul(n.X,e),n.Y,n.Z),t=(0,i.negateCt)(o,t),n=(0,i.negateCt)(s,n),t.add(n)}class L{constructor(e,t,n){this.X=_("x",e),this.Y=_("y",t,!0),this.Z=_("z",n),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof L)throw new Error("projective point not allowed");return r.is0(t)&&r.is0(n)?L.ZERO:new L(t,n,r.ONE)}static fromBytes(e){const t=L.fromAffine(E((0,s._abytes2)(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return L.fromBytes((0,s.ensureBytes)("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return F.createCache(this,e),t||this.multiply(y),this}assertValidity(){T(this)}hasEvenY(){const{y:e}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(e)}equals(e){O(e);const{X:t,Y:n,Z:o}=this,{X:s,Y:i,Z:a}=e,c=r.eql(r.mul(t,a),r.mul(s,o)),f=r.eql(r.mul(n,a),r.mul(i,o));return c&&f}negate(){return new L(this.X,r.neg(this.Y),this.Z)}double(){const{a:e,b:t}=a,n=r.mul(t,y),{X:o,Y:s,Z:i}=this;let c=r.ZERO,f=r.ZERO,u=r.ZERO,l=r.mul(o,o),h=r.mul(s,s),d=r.mul(i,i),p=r.mul(o,s);return p=r.add(p,p),u=r.mul(o,i),u=r.add(u,u),c=r.mul(e,u),f=r.mul(n,d),f=r.add(c,f),c=r.sub(h,f),f=r.add(h,f),f=r.mul(c,f),c=r.mul(p,c),u=r.mul(n,u),d=r.mul(e,d),p=r.sub(l,d),p=r.mul(e,p),p=r.add(p,u),u=r.add(l,l),l=r.add(u,l),l=r.add(l,d),l=r.mul(l,p),f=r.add(f,l),d=r.mul(s,i),d=r.add(d,d),l=r.mul(d,p),c=r.sub(c,l),u=r.mul(d,h),u=r.add(u,u),u=r.add(u,u),new L(c,f,u)}add(e){O(e);const{X:t,Y:n,Z:o}=this,{X:s,Y:i,Z:c}=e;let f=r.ZERO,u=r.ZERO,l=r.ZERO;const h=a.a,d=r.mul(a.b,y);let p=r.mul(t,s),v=r.mul(n,i),g=r.mul(o,c),b=r.add(t,n),m=r.add(s,i);b=r.mul(b,m),m=r.add(p,v),b=r.sub(b,m),m=r.add(t,o);let w=r.add(s,c);return m=r.mul(m,w),w=r.add(p,g),m=r.sub(m,w),w=r.add(n,o),f=r.add(i,c),w=r.mul(w,f),f=r.add(v,g),w=r.sub(w,f),l=r.mul(h,m),f=r.mul(d,g),l=r.add(f,l),f=r.sub(v,l),l=r.add(v,l),u=r.mul(f,l),v=r.add(p,p),v=r.add(v,p),g=r.mul(h,g),m=r.mul(d,m),v=r.add(v,g),g=r.sub(p,g),g=r.mul(h,g),m=r.add(m,g),p=r.mul(v,m),u=r.add(u,p),p=r.mul(w,m),f=r.mul(b,f),f=r.sub(f,p),p=r.mul(b,v),l=r.mul(w,l),l=r.add(l,p),new L(f,u,l)}subtract(e){return this.add(e.negate())}is0(){return this.equals(L.ZERO)}multiply(e){const{endo:n}=t;if(!o.isValidNot0(e))throw new Error("invalid scalar: out of range");let r,s;const a=e=>F.cached(this,e,e=>(0,i.normalizeZ)(L,e));if(n){const{k1neg:t,k1:o,k2neg:i,k2:c}=H(e),{p:f,f:u}=a(o),{p:l,f:h}=a(c);s=u.add(h),r=V(n.beta,f,l,t,i)}else{const{p:t,f:n}=a(e);r=t,s=n}return(0,i.normalizeZ)(L,[r,s])[0]}multiplyUnsafe(e){const{endo:n}=t,r=this;if(!o.isValid(e))throw new Error("invalid scalar: out of range");if(e===d||r.is0())return L.ZERO;if(e===p)return r;if(F.hasCache(this))return this.multiply(e);if(n){const{k1neg:t,k1:o,k2neg:s,k2:a}=H(e),{p1:c,p2:f}=(0,i.mulEndoUnsafe)(L,r,o,a);return V(n.beta,c,f,t,s)}return F.unsafe(r,e)}multiplyAndAddUnsafe(e,t,n){const r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return P(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return c===p||(e?e(L,this):F.unsafe(this,u).is0())}clearCofactor(){const{clearCofactor:e}=t;return c===p?this:e?e(L,this):this.multiplyUnsafe(c)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}toBytes(e=!0){return(0,s._abool2)(e,"isCompressed"),this.assertValidity(),m(L,this,e)}toHex(e=!0){return(0,s.bytesToHex)(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return(0,i.normalizeZ)(L,e)}static msm(e,t){return(0,i.pippenger)(L,o,e,t)}static fromPrivateKey(e){return L.BASE.multiply(b(o,e))}}L.BASE=new L(a.Gx,a.Gy,r.ONE),L.ZERO=new L(r.ZERO,r.ONE,r.ZERO),L.Fp=r,L.Fn=o;const R=o.BITS,F=new i.wNAF(L,t.endo?Math.ceil(R/2):R);return L.BASE.precompute(8),L}function w(e){return Uint8Array.of(e?2:3)}function E(e,t){const n=e.ORDER;let r=d;for(let e=n-p;e%v===d;e/=v)r+=p;const o=r,s=v<<o-p-p,i=s*v,a=(n-p)/i,c=(a-p)/v,f=i-p,u=s,l=e.pow(t,a),h=e.pow(t,(a+p)/v);let b=(t,n)=>{let r=l,s=e.pow(n,f),i=e.sqr(s);i=e.mul(i,n);let a=e.mul(t,i);a=e.pow(a,c),a=e.mul(a,s),s=e.mul(a,n),i=e.mul(a,t);let d=e.mul(i,s);a=e.pow(d,u);let y=e.eql(a,e.ONE);s=e.mul(i,h),a=e.mul(d,r),i=e.cmov(s,i,y),d=e.cmov(a,d,y);for(let t=o;t>p;t--){let n=t-v;n=v<<n-p;let o=e.pow(d,n);const a=e.eql(o,e.ONE);s=e.mul(i,r),r=e.mul(r,r),o=e.mul(d,r),i=e.cmov(s,i,a),d=e.cmov(o,d,a)}return{isValid:y,value:i}};if(e.ORDER%g===y){const n=(e.ORDER-y)/g,r=e.sqrt(e.neg(t));b=(t,o)=>{let s=e.sqr(o);const i=e.mul(t,o);s=e.mul(s,i);let a=e.pow(s,n);a=e.mul(a,i);const c=e.mul(a,r),f=e.mul(e.sqr(a),o),u=e.eql(f,t);return{isValid:u,value:e.cmov(c,a,u)}}}return b}function S(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function I(e,t={}){const{Fn:n}=e,r=t.randomBytes||s.randomBytes,o=Object.assign(S(e.Fp,n),{seed:(0,a.getMinHashLength)(n.ORDER)});function i(e){try{return!!b(n,e)}catch(e){return!1}}function c(e=r(o.seed)){return(0,a.mapHashToField)((0,s._abytes2)(e,o.seed,"seed"),n.ORDER)}function f(t,r=!0){return e.BASE.multiply(b(n,t)).toBytes(r)}function u(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:r,publicKey:i,publicKeyUncompressed:a}=o;if(n.allowedLengths||r===i)return;const c=(0,s.ensureBytes)("key",t).length;return c===i||c===a}const l={isValidSecretKey:i,isValidPublicKey:function(t,n){const{publicKey:r,publicKeyUncompressed:s}=o;try{const o=t.length;return!(!0===n&&o!==r||!1===n&&o!==s||!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:c,isValidPrivateKey:i,randomPrivateKey:c,normPrivateKeyToScalar:e=>b(n,e),precompute:(t=8,n=e.BASE)=>n.precompute(t,!1)};return Object.freeze({getPublicKey:f,getSharedSecret:function(t,r,o=!0){if(!0===u(t))throw new Error("first arg must be private key");if(!1===u(r))throw new Error("second arg must be public key");const s=b(n,t);return e.fromHex(r).multiply(s).toBytes(o)},keygen:function(e){const t=c(e);return{secretKey:t,publicKey:f(t)}},Point:e,utils:l,lengths:o})}function A(e,n,i={}){(0,o.ahash)(n),(0,s._validateObject)(i,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const a=i.randomBytes||s.randomBytes,c=i.hmac||((e,...t)=>(0,r.hmac)(n,e,(0,s.concatBytes)(...t))),{Fp:f,Fn:h}=e,{ORDER:y,BITS:g}=h,{keygen:m,getPublicKey:E,getSharedSecret:S,utils:A,lengths:x}=I(e,i),B={prehash:!1,lowS:"boolean"==typeof i.lowS&&i.lowS,format:void 0,extraEntropy:!1},_="compact";function O(e){return e>y>>p}function H(e,t){if(!h.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class P{constructor(e,t,n){this.r=H("r",e),this.s=H("s",t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e,n=_){let r;if(function(e,t){u(t);const n=x.signature,r="compact"===t?n:"recovered"===t?n+1:void 0;(0,s._abytes2)(e,r,`${t} signature`)}(e,n),"der"===n){const{r:n,s:r}=t.DER.toSig((0,s._abytes2)(e));return new P(n,r)}"recovered"===n&&(r=e[0],n="compact",e=e.subarray(1));const o=h.BYTES,i=e.subarray(0,o),a=e.subarray(o,2*o);return new P(h.fromBytes(i),h.fromBytes(a),r)}static fromHex(e,t){return this.fromBytes((0,s.hexToBytes)(e),t)}addRecoveryBit(e){return new P(this.r,this.s,e)}recoverPublicKey(t){const n=f.ORDER,{r,s:o,recovery:i}=this;if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");if(y*v<n&&i>1)throw new Error("recovery id is ambiguous for h>1 curve");const a=2===i||3===i?r+y:r;if(!f.isValid(a))throw new Error("recovery id 2 or 3 invalid");const c=f.toBytes(a),u=e.fromBytes((0,s.concatBytes)(w(!(1&i)),c)),l=h.inv(a),d=V((0,s.ensureBytes)("msgHash",t)),p=h.create(-d*l),g=h.create(o*l),b=e.BASE.multiplyUnsafe(p).add(u.multiplyUnsafe(g));if(b.is0())throw new Error("point at infinify");return b.assertValidity(),b}hasHighS(){return O(this.s)}toBytes(e=_){if(u(e),"der"===e)return(0,s.hexToBytes)(t.DER.hexFromSig(this));const n=h.toBytes(this.r),r=h.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return(0,s.concatBytes)(Uint8Array.of(this.recovery),n,r)}return(0,s.concatBytes)(n,r)}toHex(e){return(0,s.bytesToHex)(this.toBytes(e))}assertValidity(){}static fromCompact(e){return P.fromBytes((0,s.ensureBytes)("sig",e),"compact")}static fromDER(e){return P.fromBytes((0,s.ensureBytes)("sig",e),"der")}normalizeS(){return this.hasHighS()?new P(this.r,h.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,s.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,s.bytesToHex)(this.toBytes("compact"))}}const T=i.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=(0,s.bytesToNumberBE)(e),n=8*e.length-g;return n>0?t>>BigInt(n):t},V=i.bits2int_modN||function(e){return h.create(T(e))},L=(0,s.bitMask)(g);function R(e){return(0,s.aInRange)("num < 2^"+g,e,d,L),h.toBytes(e)}function F(e,t){return(0,s._abytes2)(e,void 0,"message"),t?(0,s._abytes2)(n(e),void 0,"prehashed message"):e}return Object.freeze({keygen:m,getPublicKey:E,getSharedSecret:S,utils:A,lengths:x,Point:e,sign:function(t,r,o={}){t=(0,s.ensureBytes)("message",t);const{seed:i,k2sig:f}=function(t,n,r){if(["recovered","canonical"].some(e=>e in r))throw new Error("sign() legacy options not supported");const{lowS:o,prehash:i,extraEntropy:c}=l(r,B);t=F(t,i);const f=V(t),u=b(h,n),v=[R(u),R(f)];if(null!=c&&!1!==c){const e=!0===c?a(x.secretKey):c;v.push((0,s.ensureBytes)("extraEntropy",e))}const y=(0,s.concatBytes)(...v),g=f;return{seed:y,k2sig:function(t){const n=T(t);if(!h.isValidNot0(n))return;const r=h.inv(n),s=e.BASE.multiply(n).toAffine(),i=h.create(s.x);if(i===d)return;const a=h.create(r*h.create(g+i*u));if(a===d)return;let c=(s.x===i?0:2)|Number(s.y&p),f=a;return o&&O(a)&&(f=h.neg(a),c^=1),new P(i,f,c)}}}(t,r,o);return(0,s.createHmacDrbg)(n.outputLen,h.BYTES,c)(i,f)},verify:function(n,r,o,i={}){const{lowS:a,prehash:c,format:f}=l(i,B);if(o=(0,s.ensureBytes)("publicKey",o),r=F((0,s.ensureBytes)("message",r),c),"strict"in i)throw new Error("options.strict was renamed to lowS");const u=void 0===f?function(e){let n;const r="string"==typeof e||(0,s.isBytes)(e),o=!r&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!r&&!o)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(o)n=new P(e.r,e.s);else if(r){try{n=P.fromBytes((0,s.ensureBytes)("sig",e),"der")}catch(e){if(!(e instanceof t.DER.Err))throw e}if(!n)try{n=P.fromBytes((0,s.ensureBytes)("sig",e),"compact")}catch(e){return!1}}return n||!1}(n):P.fromBytes((0,s.ensureBytes)("sig",n),f);if(!1===u)return!1;try{const t=e.fromBytes(o);if(a&&u.hasHighS())return!1;const{r:n,s}=u,i=V(r),c=h.inv(s),f=h.create(i*c),l=h.create(n*c),d=e.BASE.multiplyUnsafe(f).add(t.multiplyUnsafe(l));return!d.is0()&&h.create(d.x)===n}catch(e){return!1}},recoverPublicKey:function(e,t,n={}){const{prehash:r}=l(n,B);return t=F(t,r),P.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:P,hash:n})}function x(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:(0,a.Field)(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function B(e,t,n){return function(r){const o=e.sqr(r),s=e.mul(o,r);return e.add(e.add(s,e.mul(r,t)),n)}}},761:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._DST_scalar=void 0,t.expand_message_xmd=u,t.expand_message_xof=l,t.hash_to_field=h,t.isogenyMap=function(e,t){const n=t.map(e=>Array.from(e).reverse());return(t,r)=>{const[s,i,a,c]=n.map(n=>n.reduce((n,r)=>e.add(e.mul(n,t),r))),[f,u]=(0,o.FpInvertBatch)(e,[i,c],!0);return t=e.mul(s,f),r=e.mul(r,e.mul(a,u)),{x:t,y:r}}},t.createHasher=function(e,n,r){if("function"!=typeof n)throw new Error("mapToCurve() must be defined");function o(t){return e.fromAffine(n(t))}function s(t){const n=t.clearCofactor();return n.equals(e.ZERO)?e.ZERO:(n.assertValidity(),n)}return{defaults:r,hashToCurve(e,t){const n=h(e,2,Object.assign({},r,t)),i=o(n[0]),a=o(n[1]);return s(i.add(a))},encodeToCurve(e,t){const n=r.encodeDST?{DST:r.encodeDST}:{};return s(o(h(e,1,Object.assign({},r,n,t))[0]))},mapToCurve(e){if(!Array.isArray(e))throw new Error("expected array of bigints");for(const t of e)if("bigint"!=typeof t)throw new Error("expected array of bigints");return s(o(e))},hashToScalar(n,o){const s=e.Fn.ORDER;return h(n,1,Object.assign({},r,{p:s,m:1,DST:t._DST_scalar},o))[0][0]}}};const r=n(627),o=n(967),s=r.bytesToNumberBE;function i(e,t){if(c(e),c(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function a(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}function c(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function f(e){if(!(0,r.isBytes)(e)&&"string"!=typeof e)throw new Error("DST must be Uint8Array or string");return"string"==typeof e?(0,r.utf8ToBytes)(e):e}function u(e,t,n,o){(0,r.abytes)(e),c(n),(t=f(t)).length>255&&(t=o((0,r.concatBytes)((0,r.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:s,blockLen:u}=o,l=Math.ceil(n/s);if(n>65535||l>255)throw new Error("expand_message_xmd: invalid lenInBytes");const h=(0,r.concatBytes)(t,i(t.length,1)),d=i(0,u),p=i(n,2),v=new Array(l),y=o((0,r.concatBytes)(d,e,p,i(0,1),h));v[0]=o((0,r.concatBytes)(y,i(1,1),h));for(let e=1;e<=l;e++){const t=[a(y,v[e-1]),i(e+1,1),h];v[e]=o((0,r.concatBytes)(...t))}return(0,r.concatBytes)(...v).slice(0,n)}function l(e,t,n,o,s){if((0,r.abytes)(e),c(n),(t=f(t)).length>255){const e=Math.ceil(2*o/8);t=s.create({dkLen:e}).update((0,r.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:n}).update(e).update(i(n,2)).update(t).update(i(t.length,1)).digest()}function h(e,t,n){(0,r._validateObject)(n,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:i,k:a,m:f,hash:h,expand:d,DST:p}=n;if(!(0,r.isHash)(n.hash))throw new Error("expected valid hash");(0,r.abytes)(e),c(t);const v=i.toString(2).length,y=Math.ceil((v+a)/8),g=t*f*y;let b;if("xmd"===d)b=u(e,p,g,h);else if("xof"===d)b=l(e,p,g,a,h);else{if("_internal_pass"!==d)throw new Error('expand must be "xmd" or "xof"');b=e}const m=new Array(t);for(let e=0;e<t;e++){const t=new Array(f);for(let n=0;n<f;n++){const r=y*(n+e*f),a=b.subarray(r,r+y);t[n]=(0,o.mod)(s(a),i)}m[e]=t}return m}t._DST_scalar=(0,r.utf8ToBytes)("HashToScalar-")},829:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoStreamId=void 0;var r=n(249),o=n(611),s=function(){function e(){}return Object.defineProperty(e,"streamId",{get:function(){return null===e._streamId||e.shouldReset()?o.AvoInspector.avoStorage.isInitialized()?(e.loadFromStorage(),null!==e._streamId&&e.shouldReset()||null===e._streamId?e.generateAndStoreNew():(e.updateLastActivity(),e._streamId)):"unknown":(e.updateLastActivity(),e._streamId)},enumerable:!1,configurable:!0}),e.shouldReset=function(){if(null===e._createdAt||null===e._lastActivityAt)return!1;var t=Date.now(),n=t-e._createdAt,r=t-e._lastActivityAt;return n>e.MAX_AGE_MS&&r>e.IDLE_THRESHOLD_MS},e.loadFromStorage=function(){try{var t=o.AvoInspector.avoStorage.getItem(e.STREAM_ID_KEY),n=o.AvoInspector.avoStorage.getItem(e.CREATED_AT_KEY),r=o.AvoInspector.avoStorage.getItem(e.LAST_ACTIVITY_KEY);null!=t&&(e._streamId=t,e._createdAt=null!=n?n:Date.now(),e._lastActivityAt=null!=r?r:Date.now())}catch(e){console.error("Avo Inspector: Error reading stream ID from storage. Please report to support@avo.app.",e)}},e.generateAndStoreNew=function(){var t=Date.now();e._streamId=r.default.newGuid(),e._createdAt=t,e._lastActivityAt=t;try{o.AvoInspector.avoStorage.setItem(e.STREAM_ID_KEY,e._streamId),o.AvoInspector.avoStorage.setItem(e.CREATED_AT_KEY,e._createdAt),o.AvoInspector.avoStorage.setItem(e.LAST_ACTIVITY_KEY,e._lastActivityAt)}catch(e){console.error("Avo Inspector: Error saving stream ID to storage. Please report to support@avo.app.",e)}return e._streamId},e.updateLastActivity=function(){var t=Date.now();e._lastActivityAt=t;try{o.AvoInspector.avoStorage.setItem(e.LAST_ACTIVITY_KEY,t)}catch(e){}},Object.defineProperty(e,"storageKey",{get:function(){return e.STREAM_ID_KEY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"createdAtKey",{get:function(){return e.CREATED_AT_KEY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"lastActivityKey",{get:function(){return e.LAST_ACTIVITY_KEY},enumerable:!1,configurable:!0}),e.clearCache=function(){e._streamId=null,e._createdAt=null,e._lastActivityAt=null},e._streamId=null,e._createdAt=null,e._lastActivityAt=null,e.MAX_AGE_MS=144e5,e.IDLE_THRESHOLD_MS=72e5,e.STREAM_ID_KEY="AvoInspectorStreamId",e.CREATED_AT_KEY="AvoInspectorStreamIdCreatedAt",e.LAST_ACTIVITY_KEY="AvoInspectorStreamIdLastActivityAt",e}();t.AvoStreamId=s},844:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoInspectorEnv=void 0,t.AvoInspectorEnv={Prod:"prod",Dev:"dev",Staging:"staging"}},897:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.secp256r1=t.p256=void 0;const r=n(54);t.p256=r.p256,t.secp256r1=r.p256,t.hashToCurve=r.p256_hasher.hashToCurve,t.encodeToCurve=r.p256_hasher.encodeToCurve},916:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function o(e){for(var t={},n=0,o=Object.entries(e);n<o.length;n++){var s=o[n],i=s[0],a=s[1];t[i]=r([],a,!0)}return t}function s(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],a=i[0],c=i[1];t[a]={type:c.type,required:c.required,pinnedValues:c.pinnedValues?o(c.pinnedValues):void 0,allowedValues:c.allowedValues?o(c.allowedValues):void 0,regexPatterns:c.regexPatterns?o(c.regexPatterns):void 0,minMaxRanges:c.minMaxRanges?o(c.minMaxRanges):void 0,children:c.children?s(c.children):void 0}}return t}function i(e,t){for(var n=0,r=Object.entries(t);n<r.length;n++){var c=r[n],f=c[0],u=c[1];if(e[f]){var l=e[f];a(l,u),u.children&&(l.children?i(l.children,u.children):l.children=s(u.children))}else e[f]={type:u.type,required:u.required,pinnedValues:u.pinnedValues?o(u.pinnedValues):void 0,allowedValues:u.allowedValues?o(u.allowedValues):void 0,regexPatterns:u.regexPatterns?o(u.regexPatterns):void 0,minMaxRanges:u.minMaxRanges?o(u.minMaxRanges):void 0,children:u.children?s(u.children):void 0}}}function a(e,t){if(t.pinnedValues){e.pinnedValues||(e.pinnedValues={});for(var n=0,o=Object.keys(t.pinnedValues);n<o.length;n++){var s=o[n];if(e.pinnedValues[s]){for(var i=new Set(e.pinnedValues[s]),a=0,c=t.pinnedValues[s];a<c.length;a++){var f=c[a];i.add(f)}e.pinnedValues[s]=Array.from(i)}else e.pinnedValues[s]=r([],t.pinnedValues[s],!0)}}if(t.allowedValues){e.allowedValues||(e.allowedValues={});for(var u=0,l=Object.keys(t.allowedValues);u<l.length;u++)if(s=l[u],e.allowedValues[s]){i=new Set(e.allowedValues[s]);for(var h=0,d=t.allowedValues[s];h<d.length;h++)f=d[h],i.add(f);e.allowedValues[s]=Array.from(i)}else e.allowedValues[s]=r([],t.allowedValues[s],!0)}if(t.regexPatterns){e.regexPatterns||(e.regexPatterns={});for(var p=0,v=Object.keys(t.regexPatterns);p<v.length;p++)if(s=v[p],e.regexPatterns[s]){i=new Set(e.regexPatterns[s]);for(var y=0,g=t.regexPatterns[s];y<g.length;y++)f=g[y],i.add(f);e.regexPatterns[s]=Array.from(i)}else e.regexPatterns[s]=r([],t.regexPatterns[s],!0)}if(t.minMaxRanges){e.minMaxRanges||(e.minMaxRanges={});for(var b=0,m=Object.keys(t.minMaxRanges);b<m.length;b++)if(s=m[b],e.minMaxRanges[s]){i=new Set(e.minMaxRanges[s]);for(var w=0,E=t.minMaxRanges[s];w<E.length;w++)f=E[w],i.add(f);e.minMaxRanges[s]=Array.from(i)}else e.minMaxRanges[s]=r([],t.minMaxRanges[s],!0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.validateEvent=function(e,t){for(var r=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var o=r[n];t.push(o.baseEventId);for(var s=0;s<o.variantIds.length;s++)t.push(o.variantIds[s])}return t}(t.events),o=function(e){if(0===e.length)return{};if(1===e.length)return e[0].props;for(var t={},r=0,o=e;r<o.length;r++)for(var c=o[r],f=0,u=Object.entries(c.props);f<u.length;f++){var l=u[f],h=l[0],d=l[1];if(t[h]){var p=t[h];a(p,d),d.children&&(p.children?i(p.children,d.children):p.children=s(d.children))}else t[h]={type:d.type,required:d.required,pinnedValues:d.pinnedValues?n({},d.pinnedValues):void 0,allowedValues:d.allowedValues?n({},d.allowedValues):void 0,regexPatterns:d.regexPatterns?n({},d.regexPatterns):void 0,minMaxRanges:d.minMaxRanges?n({},d.minMaxRanges):void 0,children:d.children?s(d.children):void 0}}return t}(t.events),c={},f=0,u=Object.keys(e);f<u.length;f++){var l=u[f],h=e[l],p=o[l];if(p){var v=d(h,p,r);c[l]=v}else c[l]={}}return{metadata:t.metadata,propertyResults:c}};var c=new Map;function f(e){var t=c.get(e);return t||(t=new RegExp(e),c.set(e,t)),t}var u=new Map;function l(e){var t=u.get(e);if(!t)try{var n=JSON.parse(e);t=new Set(n),u.set(e,t)}catch(e){return null}return t}var h=2;function d(e,t,n,r){void 0===r&&(r=0);var o={};return r>=h?o:t.isList?function(e,t,n,r){var o={};if(!Array.isArray(e))return o;if(t.children){for(var s={},i=function(t,o){for(var i=new Set,a=0,c=e;a<c.length;a++){var f=c[a],u=d(("object"!=typeof f||null===f||Array.isArray(f)?{}:f)[t],o,n,r+1);if(u.failedEventIds)for(var l=0,h=u.failedEventIds;l<h.length;l++){var p=h[l];i.add(p)}if(u.passedEventIds)for(var v=new Set(u.passedEventIds),y=0,g=n;y<g.length;y++)p=g[y],v.has(p)||i.add(p)}if(i.size>0){var b=Array.from(i),m=n.filter(function(e){return!i.has(e)});m.length<b.length&&m.length>0?s[t]={passedEventIds:m}:s[t]={failedEventIds:b}}},a=0,c=Object.entries(t.children);a<c.length;a++){var f=c[a];i(f[0],f[1])}return Object.keys(s).length>0&&(o.children=s),o}for(var u=new Set,l=0,h=e;l<h.length;l++){var v=h[l];t.pinnedValues&&g(v,t.pinnedValues,u),t.allowedValues&&b(v,t.allowedValues,u),t.regexPatterns&&m(v,t.regexPatterns,u),t.minMaxRanges&&w(v,t.minMaxRanges,u)}return p(u,n)}(e,t,n,r):t.children?function(e,t,n,r){for(var o={},s={},i="object"!=typeof e||null===e||Array.isArray(e)?{}:e,a=0,c=Object.entries(t.children);a<c.length;a++){var f=c[a],u=f[0],l=f[1],h=d(i[u],l,n,r+1);(h.failedEventIds||h.passedEventIds||h.children)&&(s[u]=h)}return Object.keys(s).length>0&&(o.children=s),o}(e,t,n,r):null!=e||t.required?function(e,t,n){var r=new Set;return t.pinnedValues&&g(e,t.pinnedValues,r),t.allowedValues&&b(e,t.allowedValues,r),t.regexPatterns&&m(e,t.regexPatterns,r),t.minMaxRanges&&w(e,t.minMaxRanges,r),p(r,n)}(e,t,n):o}function p(e,t){var n=t.filter(function(t){return!e.has(t)}),r=Array.from(e);return 0===r.length&&0===n.length?{}:n.length<r.length&&n.length>0?{passedEventIds:n}:r.length>0?{failedEventIds:r}:{}}function v(e,t){for(var n=0,r=e;n<r.length;n++){var o=r[n];t.add(o)}}function y(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e)return String(e);if(Array.isArray(e)||"object"==typeof e)try{return JSON.stringify(e)}catch(t){return console.warn("[Avo Inspector] Failed to stringify value: ".concat(t)),String(e)}return String(e)}function g(e,t,n){for(var r=y(e),o=0,s=Object.entries(t);o<s.length;o++){var i=s[o],a=i[0],c=i[1];r!==a&&v(c,n)}}function b(e,t,n){for(var r=y(e),o=0,s=Object.entries(t);o<s.length;o++){var i=s[o],a=i[0],c=i[1],f=l(a);null!==f?f.has(r)||v(c,n):console.warn("[Avo Inspector] Invalid allowed values JSON: ".concat(a))}}function m(e,t,n){if("string"==typeof e)for(var r=0,o=Object.entries(t);r<o.length;r++){var s=o[r],i=s[0];u=s[1];try{f(i).test(e)||v(u,n)}catch(e){console.warn("[Avo Inspector] Invalid regex pattern: ".concat(i))}}else for(var a=0,c=Object.values(t);a<c.length;a++){var u;v(u=c[a],n)}}function w(e,t,n){if("number"==typeof e)if(Number.isNaN(e)){console.warn("[Avo Inspector] NaN value fails min/max constraint");for(var r=0,o=Object.values(t);r<o.length;r++)v(m=o[r],n)}else for(var s=0,i=Object.entries(t);s<i.length;s++){var a=i[s],c=a[0],f=(m=a[1],c.split(",")),u=f[0],l=f[1],h=""!==u&&void 0!==u,d=""!==l&&void 0!==l,p=h?parseFloat(u):-1/0,y=d?parseFloat(l):1/0;h&&isNaN(p)||d&&isNaN(y)?console.warn("[Avo Inspector] Invalid min/max range: ".concat(c)):(e<p||e>y)&&v(m,n)}else for(var g=0,b=Object.values(t);g<b.length;g++){var m;v(m=b[g],n)}}},924:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoSchemaParser=void 0;var s=n(945),i=function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(){function e(){}return e.canSendEncryptedValues=function(e,t){return null!=e&&""!==e&&("dev"===t||"staging"===t)},e.getEncryptedPropertyValueIfEnabled=function(e,t,n){return r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:if(!t||!n)return[2,void 0];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,(0,s.encryptValue)(e,n)];case 2:return[2,o.sent()];case 3:return r=o.sent(),console.error("[Avo Inspector] Failed to encrypt property value:",r instanceof Error?r.message:String(r)),[2,void 0];case 4:return[2]}})})},e.extractSchema=function(e,t,n){return r(this,void 0,void 0,function(){var s,a,c=this;return o(this,function(f){switch(f.label){case 0:return null==e?[2,[]]:(s=this.canSendEncryptedValues(t,n),a=function(e){return r(c,void 0,void 0,function(){var n,c,f,u,l,h,d,p,v,y,g,b=this;return o(this,function(m){switch(m.label){case 0:return i(e)?[4,Promise.all(e.map(function(e){return r(b,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,a(e)];case 1:return[2,t.sent()]}})})}))]:[3,2];case 1:return n=m.sent(),[2,this.removeDuplicates(n)];case 2:if("object"!=typeof e)return[3,10];for(l in c=[],u=[],f=e)u.push(l);h=0,m.label=3;case 3:return h<u.length?(l=u[h])in f?(d=l,e.hasOwnProperty(d)?(p=e[d],v={propertyName:d,propertyType:this.getPropValueType(p)},"object"!=typeof p||null==p?[3,5]:(y=v,[4,a(p)])):[3,8]):[3,8]:[3,9];case 4:return y.children=m.sent(),[3,7];case 5:return void 0===p?[3,7]:[4,this.getEncryptedPropertyValueIfEnabled(p,s,t)];case 6:void 0!==(g=m.sent())&&(v.encryptedPropertyValue=g),m.label=7;case 7:c.push(v),m.label=8;case 8:return h++,[3,3];case 9:return[2,c];case 10:return[2,this.getPropValueType(e)]}})})},[4,a(e)]);case 1:return[2,f.sent()]}})})},e.removeDuplicates=function(e){var t={boolean:{},number:{},string:{}},n=[];return e.filter(function(e){var r=typeof e;return r in t&&"string"==typeof e?!t[r].hasOwnProperty(e)&&(t[r][e]=!0):!n.includes(e)&&n.push(e)})},e.getPropValueType=function(e){var t=typeof e;return null==e?"null":"string"===t?"string":"number"===t||"bigint"===t?(e+"").includes(".")?"float":"int":"boolean"===t?"boolean":"object"===t?i(e)?"list":"object":"unknown"},e}();t.AvoSchemaParser=a},945:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generateKeyPair=function(){var e=s.p256.utils.randomPrivateKey(),t=s.p256.getPublicKey(e,!1);return{privateKey:i(e).padStart(64,"0"),publicKey:i(t)}},t.encryptValue=function(e,t){return r(this,void 0,void 0,function(){var n,r,i,l,h,d,p,v,y,g,b,m,w,E,S,I,A,x,B,_;return o(this,function(o){switch(o.label){case 0:if(o.trys.push([0,4,,5]),void 0===(n=void 0===e?"null":JSON.stringify(e)))throw new Error("Cannot encrypt undefined value");return r="string"==typeof t?t:String(t),i=a(r),l=s.p256.utils.randomPrivateKey(),h=s.p256.getPublicKey(l,!1),[4,f(s.p256.getSharedSecret(l,i).slice(-32))];case 1:return d=o.sent(),[4,(p=c()).subtle.importKey("raw",d,{name:"AES-GCM"},!1,["encrypt"])];case 2:return v=o.sent(),y=p.getRandomValues(new Uint8Array(16)),g=(new TextEncoder).encode(n),[4,p.subtle.encrypt({name:"AES-GCM",iv:y,tagLength:128},v,g)];case 3:return b=o.sent(),m=new Uint8Array(b),w=m.length-16,E=m.slice(0,w),S=m.slice(w),I=new Uint8Array([0]),A=1+h.length+16+16+E.length,x=new Uint8Array(A),B=0,x.set(I,B),B+=1,x.set(h,B),B+=h.length,x.set(y,B),B+=16,x.set(S,B),B+=16,x.set(E,B),[2,u(x)];case 4:throw _=o.sent(),new Error("Failed to encrypt value. Please check that the public key is valid. Error: ".concat(_ instanceof Error?_.message:String(_)));case 5:return[2]}})})},t.decryptValue=function(e,t){return r(this,void 0,void 0,function(){var n,r,i,u,l,h,d,p,v,y,g,b,m,w,E,S,I,A,x,B,_,O,H;return o(this,function(o){switch(o.label){case 0:for(o.trys.push([0,4,,5]),n=atob(e),r=new Uint8Array(n.length),i=0;i<n.length;i++)r[i]=n.charCodeAt(i);if(r.length<67)throw new Error("Invalid encrypted data: payload too short");if(u="string"==typeof t?t:String(t),h=r[l=0],l+=1,0!==h)throw new Error("Unsupported encryption version: ".concat(h));if(d=r[l],v=1+(p=2===d||3===d?33:65)+16+16+1,r.length<v)throw new Error("Invalid encrypted data: expected at least ".concat(v," bytes, got ").concat(r.length));return y=r.slice(l,l+p),l+=p,g=r.slice(l,l+16),l+=16,b=r.slice(l,l+16),l+=16,m=r.slice(l),w=a(u),[4,f(s.p256.getSharedSecret(w,y).slice(-32))];case 1:return E=o.sent(),[4,(S=c()).subtle.importKey("raw",E,{name:"AES-GCM"},!1,["decrypt"])];case 2:return I=o.sent(),A=m.length+b.length,(x=new Uint8Array(A)).set(m,0),x.set(b,m.length),[4,S.subtle.decrypt({name:"AES-GCM",iv:g,tagLength:128},I,x)];case 3:return B=o.sent(),_=new TextDecoder,O=_.decode(B),[2,JSON.parse(O)];case 4:throw H=o.sent(),new Error("Failed to decrypt value. Please check that the private key is valid and matches the public key used for encryption. Error: ".concat(H instanceof Error?H.message:String(H)));case 5:return[2]}})})};var s=n(897);function i(e){return Array.from(e).map(function(e){return e.toString(16).padStart(2,"0")}).join("")}function a(e){for(var t=new Uint8Array(e.length/2),n=0;n<e.length;n+=2)t[n/2]=parseInt(e.substr(n,2),16);return t}var c=function(){if("undefined"!=typeof globalThis&&globalThis.crypto){var e=globalThis.crypto;if(e&&e.subtle)return e}if("undefined"!=typeof window&&window.crypto){var t=window.crypto;if(t&&t.subtle)return t}if(void 0!==n.g&&n.g.crypto){var r=n.g.crypto;if(r&&r.subtle)return r}var o={hasGlobalThis:"undefined"!=typeof globalThis,hasGlobalThisCrypto:"undefined"!=typeof globalThis&&!!globalThis.crypto,hasGlobalThisCryptoSubtle:"undefined"!=typeof globalThis&&!!globalThis.crypto&&!!globalThis.crypto.subtle,hasWindow:"undefined"!=typeof window,hasWindowCrypto:"undefined"!=typeof window&&!!window.crypto,hasGlobal:void 0!==n.g,hasGlobalCrypto:void 0!==n.g&&!!n.g.crypto,hasGlobalCryptoSubtle:void 0!==n.g&&!!n.g.crypto&&!!n.g.crypto.subtle};throw new Error("crypto.subtle not available. Debug: "+JSON.stringify(o))};function f(e){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,c().subtle.digest("SHA-256",e)];case 1:return[2,t.sent()]}})})}function u(e){if("undefined"!=typeof Buffer&&Buffer.from)return Buffer.from(e).toString("base64");for(var t="",n=0;n<e.length;n+=8192){var r=e.slice(n,n+8192);t+=String.fromCharCode.apply(null,Array.from(r))}return btoa(t)}},967:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativeLE=void 0,t.mod=p,t.pow=function(e,t,n){return S(B(n),e,t)},t.pow2=function(e,t,n){let r=e;for(;t-- >o;)r*=r,r%=n;return r},t.invert=v,t.tonelliShanks=m,t.FpSqrt=w,t.validateField=function(e){const t=E.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});return(0,r._validateObject)(e,t),e},t.FpPow=S,t.FpInvertBatch=I,t.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?v(n,e.ORDER):e.inv(n))},t.FpLegendre=A,t.FpIsSquare=function(e,t){return 1===A(e,t)},t.nLength=x,t.Field=B,t.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)},t.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n},t.hashToPrivateScalar=function(e,t,n=!1){const o=(e=(0,r.ensureBytes)("privateHash",e)).length,i=x(t).nByteLength+8;if(i<24||o<i||o>1024)throw new Error("hashToPrivateScalar: expected "+i+"-1024 bytes of input, got "+o);return p(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-s)+s},t.getFieldBytesLength=_,t.getMinHashLength=O,t.mapHashToField=function(e,t,n=!1){const o=e.length,i=_(t),a=O(t);if(o<16||o<a||o>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+o);const c=p(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-s)+s;return n?(0,r.numberToBytesLE)(c,i):(0,r.numberToBytesBE)(c,i)};const r=n(627),o=BigInt(0),s=BigInt(1),i=BigInt(2),a=BigInt(3),c=BigInt(4),f=BigInt(5),u=BigInt(7),l=BigInt(8),h=BigInt(9),d=BigInt(16);function p(e,t){const n=e%t;return n>=o?n:t+n}function v(e,t){if(e===o)throw new Error("invert: expected non-zero number");if(t<=o)throw new Error("invert: expected positive modulus, got "+t);let n=p(e,t),r=t,i=o,a=s,c=s,f=o;for(;n!==o;){const e=r/n,t=r%n,o=i-c*e,s=a-f*e;r=n,n=t,i=c,a=f,c=o,f=s}if(r!==s)throw new Error("invert: does not exist");return p(i,t)}function y(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function g(e,t){const n=(e.ORDER+s)/c,r=e.pow(t,n);return y(e,r,t),r}function b(e,t){const n=(e.ORDER-f)/l,r=e.mul(t,i),o=e.pow(r,n),s=e.mul(t,o),a=e.mul(e.mul(s,i),o),c=e.mul(s,e.sub(a,e.ONE));return y(e,c,t),c}function m(e){if(e<a)throw new Error("sqrt is not defined for small field");let t=e-s,n=0;for(;t%i===o;)t/=i,n++;let r=i;const c=B(e);for(;1===A(c,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return g;let f=c.pow(r,t);const u=(t+s)/i;return function(e,r){if(e.is0(r))return r;if(1!==A(e,r))throw new Error("Cannot find square root");let o=n,i=e.mul(e.ONE,f),a=e.pow(r,t),c=e.pow(r,u);for(;!e.eql(a,e.ONE);){if(e.is0(a))return e.ZERO;let t=1,n=e.sqr(a);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===o)throw new Error("Cannot find square root");const r=s<<BigInt(o-t-1),f=e.pow(i,r);o=t,i=e.sqr(f),a=e.mul(a,i),c=e.mul(c,f)}return c}}function w(e){return e%c===a?g:e%l===f?b:e%d===h?function(e){const t=B(e),n=m(e),r=n(t,t.neg(t.ONE)),o=n(t,r),s=n(t,t.neg(r)),i=(e+u)/d;return(e,t)=>{let n=e.pow(t,i),a=e.mul(n,r);const c=e.mul(n,o),f=e.mul(n,s),u=e.eql(e.sqr(a),t),l=e.eql(e.sqr(c),t);n=e.cmov(n,a,u),a=e.cmov(f,c,l);const h=e.eql(e.sqr(a),t),d=e.cmov(n,a,h);return y(e,d,t),d}}(e):m(e)}t.isNegativeLE=(e,t)=>(p(e,t)&s)===s;const E=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function S(e,t,n){if(n<o)throw new Error("invalid exponent, negatives unsupported");if(n===o)return e.ONE;if(n===s)return t;let r=e.ONE,i=t;for(;n>o;)n&s&&(r=e.mul(r,i)),i=e.sqr(i),n>>=s;return r}function I(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n)),e.ONE),s=e.inv(o);return t.reduceRight((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n)),s),r}function A(e,t){const n=(e.ORDER-s)/i,r=e.pow(t,n),o=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),c=e.eql(r,e.neg(e.ONE));if(!o&&!a&&!c)throw new Error("invalid Legendre symbol result");return o?1:a?0:-1}function x(e,t){void 0!==t&&(0,r.anumber)(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function B(e,t,n=!1,i={}){if(e<=o)throw new Error("invalid field: expected ORDER > 0, got "+e);let a,c,f,u=!1;if("object"==typeof t&&null!=t){if(i.sqrt||n)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(a=e.BITS),e.sqrt&&(c=e.sqrt),"boolean"==typeof e.isLE&&(n=e.isLE),"boolean"==typeof e.modFromBytes&&(u=e.modFromBytes),f=e.allowedLengths}else"number"==typeof t&&(a=t),i.sqrt&&(c=i.sqrt);const{nBitLength:l,nByteLength:h}=x(e,a);if(h>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let d;const y=Object.freeze({ORDER:e,isLE:n,BITS:l,BYTES:h,MASK:(0,r.bitMask)(l),ZERO:o,ONE:s,allowedLengths:f,create:t=>p(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return o<=t&&t<e},is0:e=>e===o,isValidNot0:e=>!y.is0(e)&&y.isValid(e),isOdd:e=>(e&s)===s,neg:t=>p(-t,e),eql:(e,t)=>e===t,sqr:t=>p(t*t,e),add:(t,n)=>p(t+n,e),sub:(t,n)=>p(t-n,e),mul:(t,n)=>p(t*n,e),pow:(e,t)=>S(y,e,t),div:(t,n)=>p(t*v(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>v(t,e),sqrt:c||(t=>(d||(d=w(e)),d(y,t))),toBytes:e=>n?(0,r.numberToBytesLE)(e,h):(0,r.numberToBytesBE)(e,h),fromBytes:(t,o=!0)=>{if(f){if(!f.includes(t.length)||t.length>h)throw new Error("Field.fromBytes: expected "+f+" bytes, got "+t.length);const e=new Uint8Array(h);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==h)throw new Error("Field.fromBytes: expected "+h+" bytes, got "+t.length);let s=n?(0,r.bytesToNumberLE)(t):(0,r.bytesToNumberBE)(t);if(u&&(s=p(s,e)),!o&&!y.isValid(s))throw new Error("invalid field element: outside of range 0..ORDER");return s},invertBatch:e=>I(y,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(y)}function _(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function O(e){const t=_(e);return t+Math.ceil(t/2)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.AvoInspectorEnv=e.AvoInspector=void 0;var t=n(611);Object.defineProperty(e,"AvoInspector",{enumerable:!0,get:function(){return t.AvoInspector}});var o=n(844);Object.defineProperty(e,"AvoInspectorEnv",{enumerable:!0,get:function(){return o.AvoInspectorEnv}})})(),r})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avo-inspector",
3
- "version": "3.0.1-alpha.1",
3
+ "version": "3.0.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "browser": "dist/index.js",