@formo/analytics 1.38.2 → 1.40.0

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.
Files changed (74) hide show
  1. package/dist/cjs/src/FormoAnalytics.d.ts +4 -1
  2. package/dist/cjs/src/FormoAnalytics.js +56 -36
  3. package/dist/cjs/src/FormoAnalyticsProvider.js +20 -0
  4. package/dist/cjs/src/event/EventFactory.d.ts +9 -1
  5. package/dist/cjs/src/event/EventFactory.js +31 -16
  6. package/dist/cjs/src/event/EventManager.d.ts +3 -1
  7. package/dist/cjs/src/event/EventManager.js +33 -4
  8. package/dist/cjs/src/event/cancellation.d.ts +4 -0
  9. package/dist/cjs/src/event/cancellation.js +7 -0
  10. package/dist/cjs/src/event/type.d.ts +1 -0
  11. package/dist/cjs/src/event/utils.d.ts +5 -1
  12. package/dist/cjs/src/event/utils.js +57 -2
  13. package/dist/cjs/src/evm/EvmEventTracker.d.ts +7 -0
  14. package/dist/cjs/src/evm/EvmEventTracker.js +31 -5
  15. package/dist/cjs/src/queue/EventQueue.d.ts +1 -0
  16. package/dist/cjs/src/queue/EventQueue.js +11 -6
  17. package/dist/cjs/src/solana/SolanaManager.d.ts +37 -9
  18. package/dist/cjs/src/solana/SolanaManager.js +135 -20
  19. package/dist/cjs/src/solana/SolanaStoreHandler.d.ts +6 -0
  20. package/dist/cjs/src/solana/SolanaStoreHandler.js +17 -8
  21. package/dist/cjs/src/solana/SolanaWalletStandardRegistry.d.ts +163 -0
  22. package/dist/cjs/src/solana/SolanaWalletStandardRegistry.js +447 -0
  23. package/dist/cjs/src/solana/index.d.ts +10 -5
  24. package/dist/cjs/src/solana/index.js +12 -6
  25. package/dist/cjs/src/solana/storeTypes.d.ts +20 -1
  26. package/dist/cjs/src/solana/types.d.ts +32 -9
  27. package/dist/cjs/src/solana/types.js +15 -0
  28. package/dist/cjs/src/solana/walletStandardTypes.d.ts +54 -0
  29. package/dist/cjs/src/solana/walletStandardTypes.js +21 -0
  30. package/dist/cjs/src/storage/StorageManager.d.ts +2 -0
  31. package/dist/cjs/src/storage/StorageManager.js +6 -0
  32. package/dist/cjs/src/storage/index.d.ts +1 -0
  33. package/dist/cjs/src/storage/index.js +7 -1
  34. package/dist/cjs/src/types/base.d.ts +15 -5
  35. package/dist/cjs/src/version.d.ts +1 -1
  36. package/dist/cjs/src/version.js +1 -1
  37. package/dist/esm/src/FormoAnalytics.d.ts +4 -1
  38. package/dist/esm/src/FormoAnalytics.js +54 -34
  39. package/dist/esm/src/FormoAnalyticsProvider.js +20 -0
  40. package/dist/esm/src/event/EventFactory.d.ts +9 -1
  41. package/dist/esm/src/event/EventFactory.js +31 -16
  42. package/dist/esm/src/event/EventManager.d.ts +3 -1
  43. package/dist/esm/src/event/EventManager.js +33 -4
  44. package/dist/esm/src/event/cancellation.d.ts +4 -0
  45. package/dist/esm/src/event/cancellation.js +4 -0
  46. package/dist/esm/src/event/type.d.ts +1 -0
  47. package/dist/esm/src/event/utils.d.ts +5 -1
  48. package/dist/esm/src/event/utils.js +56 -3
  49. package/dist/esm/src/evm/EvmEventTracker.d.ts +7 -0
  50. package/dist/esm/src/evm/EvmEventTracker.js +31 -5
  51. package/dist/esm/src/queue/EventQueue.d.ts +1 -0
  52. package/dist/esm/src/queue/EventQueue.js +11 -6
  53. package/dist/esm/src/solana/SolanaManager.d.ts +37 -9
  54. package/dist/esm/src/solana/SolanaManager.js +135 -20
  55. package/dist/esm/src/solana/SolanaStoreHandler.d.ts +6 -0
  56. package/dist/esm/src/solana/SolanaStoreHandler.js +18 -9
  57. package/dist/esm/src/solana/SolanaWalletStandardRegistry.d.ts +163 -0
  58. package/dist/esm/src/solana/SolanaWalletStandardRegistry.js +444 -0
  59. package/dist/esm/src/solana/index.d.ts +10 -5
  60. package/dist/esm/src/solana/index.js +10 -5
  61. package/dist/esm/src/solana/storeTypes.d.ts +20 -1
  62. package/dist/esm/src/solana/types.d.ts +32 -9
  63. package/dist/esm/src/solana/types.js +14 -0
  64. package/dist/esm/src/solana/walletStandardTypes.d.ts +54 -0
  65. package/dist/esm/src/solana/walletStandardTypes.js +18 -0
  66. package/dist/esm/src/storage/StorageManager.d.ts +2 -0
  67. package/dist/esm/src/storage/StorageManager.js +6 -0
  68. package/dist/esm/src/storage/index.d.ts +1 -0
  69. package/dist/esm/src/storage/index.js +5 -0
  70. package/dist/esm/src/types/base.d.ts +15 -5
  71. package/dist/esm/src/version.d.ts +1 -1
  72. package/dist/esm/src/version.js +1 -1
  73. package/dist/index.umd.min.js +1 -1
  74. package/package.json +2 -2
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see index.umd.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("FormoAnalytics",[],t):"object"==typeof exports?exports.FormoAnalytics=t():e.FormoAnalytics=t()}(self,()=>(()=>{"use strict";var e={6839(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.notImplemented=t.bitMask=void 0,t.isBytes=i,t.abytes=a,t.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},t.numberToHexUnpadded=o,t.hexToNumber=s,t.bytesToHex=l,t.hexToBytes=h,t.bytesToNumberBE=function(e){return s(l(e))},t.bytesToNumberLE=function(e){return a(e),s(l(Uint8Array.from(e).reverse()))},t.numberToBytesBE=f,t.numberToBytesLE=function(e,t){return f(e,t).reverse()},t.numberToVarBytesBE=function(e){return h(o(e))},t.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=h(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!i(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const a=n.length;if("number"==typeof r&&a!==r)throw new Error(e+" of length "+r+" expected, got "+a);return n},t.concatBytes=p,t.equalBytes=function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r},t.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))},t.inRange=g,t.aInRange=function(e,t,r,n){if(!g(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)},t.bitLen=function(e){let t;for(t=0;e>r;e>>=n,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&n},t.bitSet=function(e,t,i){return e|(i?n:r)<<BigInt(t)},t.createHmacDrbg=function(e,t,r){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 r)throw new Error("hmacFn must be a function");let n=y(e),i=y(e),a=0;const o=()=>{n.fill(1),i.fill(0),a=0},s=(...e)=>r(i,n,...e),c=(e=y(0))=>{i=s(m([0]),e),n=s(),0!==e.length&&(i=s(m([1]),e),n=s())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=s();const t=n.slice();r.push(t),e+=n.length}return p(...r)};return(e,t)=>{let r;for(o(),c(e);!(r=t(u()));)c();return o(),r}},t.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=b[r];if("function"!=typeof i)throw new Error("invalid validator function");const a=e[t];if(!(n&&void 0===a||i(a,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+a)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e},t.memoized=function(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(void 0!==i)return i;const a=e(r,...n);return t.set(r,a),a}};const r=BigInt(0),n=BigInt(1);function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function a(e){if(!i(e))throw new Error("Uint8Array expected")}function o(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function s(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?r:BigInt("0x"+e)}const c="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){if(a(e),c)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=u[e[r]];return t}function d(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function h(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(c)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=d(e.charCodeAt(i)),a=d(e.charCodeAt(i+1));if(void 0===r||void 0===a){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+a}return n}function f(e,t){return h(e.toString(16).padStart(2*t,"0"))}function p(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];a(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const v=e=>"bigint"==typeof e&&r<=e;function g(e,t,r){return v(e)&&v(t)&&v(r)&&t<=e&&e<r}t.bitMask=e=>(n<<BigInt(e))-n;const y=e=>new Uint8Array(e),m=e=>Uint8Array.from(e),b={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||i(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")}},681(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.aoutput=t.anumber=t.aexists=t.abytes=void 0;const n=r(11);t.abytes=n.abytes,t.aexists=n.aexists,t.anumber=n.anumber,t.aoutput=n.aoutput},7734(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.SHA512_IV=t.SHA384_IV=t.SHA224_IV=t.SHA256_IV=t.HashMD=void 0,t.setBigUint64=i,t.Chi=function(e,t,r){return e&t^~e&r},t.Maj=function(e,t,r){return e&t^e&r^t&r};const n=r(11);function i(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),a=BigInt(4294967295),o=Number(r>>i&a),s=Number(r&a),c=n?4:0,u=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+u,s,n)}class a extends n.Hash{constructor(e,t,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=(0,n.createView)(this.buffer)}update(e){(0,n.aexists)(this),e=(0,n.toBytes)(e),(0,n.abytes)(e);const{view:t,buffer:r,blockLen:i}=this,a=e.length;for(let o=0;o<a;){const s=Math.min(i-this.pos,a-o);if(s===i){const t=(0,n.createView)(e);for(;i<=a-o;o+=i)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.aexists)(this),(0,n.aoutput)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:a,isLE:o}=this;let{pos:s}=this;t[s++]=128,(0,n.clean)(this.buffer.subarray(s)),this.padOffset>a-s&&(this.process(r,0),s=0);for(let e=s;e<a;e++)t[e]=0;i(r,a-8,BigInt(8*this.length),o),this.process(r,0);const c=(0,n.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)c.setUint32(4*e,d[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=n,e.pos=o,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}t.HashMD=a,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])},3842(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=b,t.fromBig=i,t.split=a;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function a(e,t=!1){const r=e.length;let n=new Uint32Array(r),a=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:s}=i(e[o],t);[n[o],a[o]]=[r,s]}return[n,a]}const o=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=o;const s=(e,t,r)=>e>>>r;t.shrSH=s;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;const l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;const d=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=d;const h=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=h;const f=(e,t)=>t;t.rotr32H=f;const p=(e,t)=>e;t.rotr32L=p;const v=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=v;const g=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=g;const y=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=y;const m=(e,t,r)=>e<<r-32|t>>>64-r;function b(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.rotlBL=m;const A=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=A;const S=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=S;const w=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=w;const E=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;t.add4H=E;const _=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=_;const C=(e,t,r,n,i,a)=>t+r+n+i+a+(e/2**32|0)|0;t.add5H=C;const I={fromBig:i,split:a,toBig:o,shrSH:s,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:d,rotrBL:h,rotr32H:f,rotr32L:p,rotlSH:v,rotlSL:g,rotlBH:y,rotlBL:m,add:b,add3L:A,add3H:S,add4L:w,add4H:E,add5H:C,add5L:_};t.default=I},9517(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},4072(e,t,r){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 n=r(7734),i=r(3842),a=r(11),o=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]),s=new Uint32Array(64);class c extends n.HashMD{constructor(e=32){super(64,e,8,!1),this.A=0|n.SHA256_IV[0],this.B=0|n.SHA256_IV[1],this.C=0|n.SHA256_IV[2],this.D=0|n.SHA256_IV[3],this.E=0|n.SHA256_IV[4],this.F=0|n.SHA256_IV[5],this.G=0|n.SHA256_IV[6],this.H=0|n.SHA256_IV[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:a,G:o,H:s}=this;return[e,t,r,n,i,a,o,s]}set(e,t,r,n,i,a,o,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|a,this.G=0|o,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)s[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=s[e-15],r=s[e-2],n=(0,a.rotr)(t,7)^(0,a.rotr)(t,18)^t>>>3,i=(0,a.rotr)(r,17)^(0,a.rotr)(r,19)^r>>>10;s[e]=i+s[e-7]+n+s[e-16]|0}let{A:r,B:i,C:c,D:u,E:l,F:d,G:h,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,a.rotr)(l,6)^(0,a.rotr)(l,11)^(0,a.rotr)(l,25))+(0,n.Chi)(l,d,h)+o[e]+s[e]|0,p=((0,a.rotr)(r,2)^(0,a.rotr)(r,13)^(0,a.rotr)(r,22))+(0,n.Maj)(r,i,c)|0;f=h,h=d,d=l,l=u+t|0,u=c,c=i,i=r,r=t+p|0}r=r+this.A|0,i=i+this.B|0,c=c+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,h=h+this.G|0,f=f+this.H|0,this.set(r,i,c,u,l,d,h,f)}roundClean(){(0,a.clean)(s)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,a.clean)(this.buffer)}}t.SHA256=c;class u extends c{constructor(){super(28),this.A=0|n.SHA224_IV[0],this.B=0|n.SHA224_IV[1],this.C=0|n.SHA224_IV[2],this.D=0|n.SHA224_IV[3],this.E=0|n.SHA224_IV[4],this.F=0|n.SHA224_IV[5],this.G=0|n.SHA224_IV[6],this.H=0|n.SHA224_IV[7]}}t.SHA224=u;const l=(()=>i.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))))(),d=(()=>l[0])(),h=(()=>l[1])(),f=new Uint32Array(80),p=new Uint32Array(80);class v extends n.HashMD{constructor(e=64){super(128,e,16,!1),this.Ah=0|n.SHA512_IV[0],this.Al=0|n.SHA512_IV[1],this.Bh=0|n.SHA512_IV[2],this.Bl=0|n.SHA512_IV[3],this.Ch=0|n.SHA512_IV[4],this.Cl=0|n.SHA512_IV[5],this.Dh=0|n.SHA512_IV[6],this.Dl=0|n.SHA512_IV[7],this.Eh=0|n.SHA512_IV[8],this.El=0|n.SHA512_IV[9],this.Fh=0|n.SHA512_IV[10],this.Fl=0|n.SHA512_IV[11],this.Gh=0|n.SHA512_IV[12],this.Gl=0|n.SHA512_IV[13],this.Hh=0|n.SHA512_IV[14],this.Hl=0|n.SHA512_IV[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:h,Gl:f,Hh:p,Hl:v}=this;return[e,t,r,n,i,a,o,s,c,u,l,d,h,f,p,v]}set(e,t,r,n,i,a,o,s,c,u,l,d,h,f,p,v){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|a,this.Dh=0|o,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|v}process(e,t){for(let r=0;r<16;r++,t+=4)f[r]=e.getUint32(t),p[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|f[e-15],r=0|p[e-15],n=i.rotrSH(t,r,1)^i.rotrSH(t,r,8)^i.shrSH(t,r,7),a=i.rotrSL(t,r,1)^i.rotrSL(t,r,8)^i.shrSL(t,r,7),o=0|f[e-2],s=0|p[e-2],c=i.rotrSH(o,s,19)^i.rotrBH(o,s,61)^i.shrSH(o,s,6),u=i.rotrSL(o,s,19)^i.rotrBL(o,s,61)^i.shrSL(o,s,6),l=i.add4L(a,u,p[e-7],p[e-16]),d=i.add4H(l,n,c,f[e-7],f[e-16]);f[e]=0|d,p[e]=0|l}let{Ah:r,Al:n,Bh:a,Bl:o,Ch:s,Cl:c,Dh:u,Dl:l,Eh:v,El:g,Fh:y,Fl:m,Gh:b,Gl:A,Hh:S,Hl:w}=this;for(let e=0;e<80;e++){const t=i.rotrSH(v,g,14)^i.rotrSH(v,g,18)^i.rotrBH(v,g,41),E=i.rotrSL(v,g,14)^i.rotrSL(v,g,18)^i.rotrBL(v,g,41),_=v&y^~v&b,C=g&m^~g&A,I=i.add5L(w,E,C,h[e],p[e]),k=i.add5H(I,S,t,_,d[e],f[e]),P=0|I,O=i.rotrSH(r,n,28)^i.rotrBH(r,n,34)^i.rotrBH(r,n,39),T=i.rotrSL(r,n,28)^i.rotrBL(r,n,34)^i.rotrBL(r,n,39),x=r&a^r&s^a&s,R=n&o^n&c^o&c;S=0|b,w=0|A,b=0|y,A=0|m,y=0|v,m=0|g,({h:v,l:g}=i.add(0|u,0|l,0|k,0|P)),u=0|s,l=0|c,s=0|a,c=0|o,a=0|r,o=0|n;const L=i.add3L(P,T,R);r=i.add3H(L,k,O,x),n=0|L}({h:r,l:n}=i.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:a,l:o}=i.add(0|this.Bh,0|this.Bl,0|a,0|o)),({h:s,l:c}=i.add(0|this.Ch,0|this.Cl,0|s,0|c)),({h:u,l}=i.add(0|this.Dh,0|this.Dl,0|u,0|l)),({h:v,l:g}=i.add(0|this.Eh,0|this.El,0|v,0|g)),({h:y,l:m}=i.add(0|this.Fh,0|this.Fl,0|y,0|m)),({h:b,l:A}=i.add(0|this.Gh,0|this.Gl,0|b,0|A)),({h:S,l:w}=i.add(0|this.Hh,0|this.Hl,0|S,0|w)),this.set(r,n,a,o,s,c,u,l,v,g,y,m,b,A,S,w)}roundClean(){(0,a.clean)(f,p)}destroy(){(0,a.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 g extends v{constructor(){super(48),this.Ah=0|n.SHA384_IV[0],this.Al=0|n.SHA384_IV[1],this.Bh=0|n.SHA384_IV[2],this.Bl=0|n.SHA384_IV[3],this.Ch=0|n.SHA384_IV[4],this.Cl=0|n.SHA384_IV[5],this.Dh=0|n.SHA384_IV[6],this.Dl=0|n.SHA384_IV[7],this.Eh=0|n.SHA384_IV[8],this.El=0|n.SHA384_IV[9],this.Fh=0|n.SHA384_IV[10],this.Fl=0|n.SHA384_IV[11],this.Gh=0|n.SHA384_IV[12],this.Gl=0|n.SHA384_IV[13],this.Hh=0|n.SHA384_IV[14],this.Hl=0|n.SHA384_IV[15]}}t.SHA384=g;const y=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),m=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class b extends v{constructor(){super(28),this.Ah=0|y[0],this.Al=0|y[1],this.Bh=0|y[2],this.Bl=0|y[3],this.Ch=0|y[4],this.Cl=0|y[5],this.Dh=0|y[6],this.Dl=0|y[7],this.Eh=0|y[8],this.El=0|y[9],this.Fh=0|y[10],this.Fl=0|y[11],this.Gh=0|y[12],this.Gl=0|y[13],this.Hh=0|y[14],this.Hl=0|y[15]}}t.SHA512_224=b;class A extends v{constructor(){super(32),this.Ah=0|m[0],this.Al=0|m[1],this.Bh=0|m[2],this.Bl=0|m[3],this.Ch=0|m[4],this.Cl=0|m[5],this.Dh=0|m[6],this.Dl=0|m[7],this.Eh=0|m[8],this.El=0|m[9],this.Fh=0|m[10],this.Fl=0|m[11],this.Gh=0|m[12],this.Gl=0|m[13],this.Hh=0|m[14],this.Hl=0|m[15]}}t.SHA512_256=A,t.sha256=(0,a.createHasher)(()=>new c),t.sha224=(0,a.createHasher)(()=>new u),t.sha512=(0,a.createHasher)(()=>new v),t.sha384=(0,a.createHasher)(()=>new g),t.sha512_256=(0,a.createHasher)(()=>new A),t.sha512_224=(0,a.createHasher)(()=>new b)},5391(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=void 0,t.keccakP=b;const n=r(3842),i=r(11),a=BigInt(0),o=BigInt(1),s=BigInt(2),c=BigInt(7),u=BigInt(256),l=BigInt(113),d=[],h=[],f=[];for(let e=0,t=o,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],d.push(2*(5*n+r)),h.push((e+1)*(e+2)/2%64);let i=a;for(let e=0;e<7;e++)t=(t<<o^(t>>c)*l)%u,t&s&&(i^=o<<(o<<BigInt(e))-o);f.push(i)}const p=(0,n.split)(f,!0),v=p[0],g=p[1],y=(e,t,r)=>r>32?(0,n.rotlBH)(e,t,r):(0,n.rotlSH)(e,t,r),m=(e,t,r)=>r>32?(0,n.rotlBL)(e,t,r):(0,n.rotlSL)(e,t,r);function b(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,a=r[i],o=r[i+1],s=y(a,o,1)^r[n],c=m(a,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=s,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=h[r],a=y(t,i,n),o=m(t,i,n),s=d[r];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=v[n],e[1]^=g[n]}(0,i.clean)(r)}class A extends i.Hash{constructor(e,t,r,n=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=a,(0,i.anumber)(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.swap32IfBE)(this.state32),b(this.state32,this.rounds),(0,i.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(e){(0,i.aexists)(this),e=(0,i.toBytes)(e),(0,i.abytes)(e);const{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){const a=Math.min(t-this.pos,n-i);for(let t=0;t<a;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,i.aexists)(this,!1),(0,i.abytes)(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const a=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,i.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,i.aoutput)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,i.clean)(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:a}=this;return e||(e=new A(t,r,n,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=a,e.destroyed=this.destroyed,e}}t.Keccak=A;const S=(e,t,r)=>(0,i.createHasher)(()=>new A(t,e,r));t.sha3_224=S(6,144,28),t.sha3_256=S(6,136,32),t.sha3_384=S(6,104,48),t.sha3_512=S(6,72,64),t.keccak_224=S(1,144,28),t.keccak_256=S(1,136,32),t.keccak_384=S(1,104,48),t.keccak_512=S(1,72,64);const w=(e,t,r)=>(0,i.createXOFer)((n={})=>new A(t,e,void 0===n.dkLen?r:n.dkLen,!0));t.shake128=w(31,168,16),t.shake256=w(31,136,32)},11(e,t,r){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=i,t.anumber=a,t.abytes=o,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");a(e.outputLen),a(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){o(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},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=s,t.byteSwap32=c,t.bytesToHex=function(e){if(o(e),u)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=l[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(u)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=d(e.charCodeAt(i)),a=d(e.charCodeAt(i+1));if(void 0===r||void 0===a){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+a}return n},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let a=0;a<e;a++){n(a);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=h,t.bytesToUtf8=function(e){return(new TextDecoder).decode(e)},t.toBytes=f,t.kdfInputToBytes=function(e){return"string"==typeof e&&(e=h(e)),o(e),e},t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];o(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},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=p,t.createOptHasher=v,t.createXOFer=g,t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return Uint8Array.from(n.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")};const n=r(9517);function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function a(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function o(e,...t){if(!i(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 s(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]=s(e[t]);return e}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.swap8IfBE=t.isLE?e=>e:e=>s(e),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?e=>e:c;const u=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),l=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function h(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function f(e){return"string"==typeof e&&(e=h(e)),o(e),e}function p(e){const t=t=>e().update(f(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function v(e){const t=(t,r)=>e(r).update(f(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function g(e){const t=(t,r)=>e(r).update(f(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}t.nextTick=async()=>{},t.Hash=class{},t.wrapConstructor=p,t.wrapConstructorWithOpts=v,t.wrapXOFConstructorWithOpts=g},5628(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.keccak512=t.keccak384=t.keccak256=t.keccak224=void 0;const n=r(5391),i=r(7393);t.keccak224=(0,i.wrapHash)(n.keccak_224),t.keccak256=(()=>{const e=(0,i.wrapHash)(n.keccak_256);return e.create=n.keccak_256.create,e})(),t.keccak384=(0,i.wrapHash)(n.keccak_384),t.keccak512=(0,i.wrapHash)(n.keccak_512)},6997(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(4072),i=r(7393);t.sha256=(0,i.wrapHash)(n.sha256)},7393(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.assertBytes=t.assertBool=t.utf8ToBytes=t.toHex=t.createView=t.concatBytes=t.bytesToHex=void 0,t.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},t.hexToBytes=function(e){const t=e.startsWith("0x")?e.substring(2):e;return(0,a.hexToBytes)(t)},t.equalsBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.wrapHash=function(e){return t=>((0,i.abytes)(t),e(t))};const n=r(6839);Object.defineProperty(t,"assertBool",{enumerable:!0,get:function(){return n.abool}});const i=r(681);Object.defineProperty(t,"assertBytes",{enumerable:!0,get:function(){return i.abytes}});const a=r(11);var o=r(11);Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return o.createView}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}})},1757(e,t){var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(e,t,n){var i=null;if(void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:i,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=i,t.jsxs=i},2942(e,t){var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),p=Symbol.iterator,v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,y={};function m(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||v}function b(){}function A(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||v}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=m.prototype;var S=A.prototype=new b;S.constructor=A,g(S,m.prototype),S.isPureReactComponent=!0;var w=Array.isArray;function E(){}var _={H:null,A:null,T:null,S:null},C=Object.prototype.hasOwnProperty;function I(e,t,n){var i=n.ref;return{$$typeof:r,type:e,key:t,ref:void 0!==i?i:null,props:n}}function k(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var P=/\/+/g;function O(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function T(e,t,i,a,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c,u,l=!1;if(null===e)l=!0;else switch(s){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case r:case n:l=!0;break;case h:return T((l=e._init)(e._payload),t,i,a,o)}}if(l)return o=o(e),l=""===a?"."+O(e,0):a,w(o)?(i="",null!=l&&(i=l.replace(P,"$&/")+"/"),T(o,t,i,"",function(e){return e})):null!=o&&(k(o)&&(c=o,u=i+(null==o.key||e&&e.key===o.key?"":(""+o.key).replace(P,"$&/")+"/")+l,o=I(c.type,u,c.props)),t.push(o)),1;l=0;var d,f=""===a?".":a+":";if(w(e))for(var v=0;v<e.length;v++)l+=T(a=e[v],t,i,s=f+O(a,v),o);else if("function"==typeof(v=null===(d=e)||"object"!=typeof d?null:"function"==typeof(d=p&&d[p]||d["@@iterator"])?d:null))for(e=v.call(e),v=0;!(a=e.next()).done;)l+=T(a=a.value,t,i,s=f+O(a,v++),o);else if("object"===s){if("function"==typeof e.then)return T(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(E,E):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,i,a,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function x(e,t,r){if(null==e)return e;var n=[],i=0;return T(e,n,"","",function(e){return t.call(r,e,i++)}),n}function R(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var L="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},H={map:x,forEach:function(e,t,r){x(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return x(e,function(){t++}),t},toArray:function(e){return x(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=f,t.Children=H,t.Component=m,t.Fragment=i,t.Profiler=o,t.PureComponent=A,t.StrictMode=a,t.Suspense=l,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return _.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=g({},e.props),i=e.key;if(null!=t)for(a in void 0!==t.key&&(i=""+t.key),t)!C.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(n[a]=t[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];n.children=o}return I(e.type,i,n)},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:s,_context:e},e},t.createElement=function(e,t,r){var n,i={},a=null;if(null!=t)for(n in void 0!==t.key&&(a=""+t.key),t)C.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(i[n]=t[n]);var o=arguments.length-2;if(1===o)i.children=r;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(n in o=e.defaultProps)void 0===i[n]&&(i[n]=o[n]);return I(e,a,i)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:R}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=_.T,r={};_.T=r;try{var n=e(),i=_.S;null!==i&&i(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(E,L)}catch(e){L(e)}finally{null!==t&&null!==r.types&&(t.types=r.types),_.T=t}},t.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},t.use=function(e){return _.H.use(e)},t.useActionState=function(e,t,r){return _.H.useActionState(e,t,r)},t.useCallback=function(e,t){return _.H.useCallback(e,t)},t.useContext=function(e){return _.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return _.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return _.H.useEffect(e,t)},t.useEffectEvent=function(e){return _.H.useEffectEvent(e)},t.useId=function(){return _.H.useId()},t.useImperativeHandle=function(e,t,r){return _.H.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return _.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return _.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return _.H.useMemo(e,t)},t.useOptimistic=function(e,t){return _.H.useOptimistic(e,t)},t.useReducer=function(e,t,r){return _.H.useReducer(e,t,r)},t.useRef=function(e){return _.H.useRef(e)},t.useState=function(e){return _.H.useState(e)},t.useSyncExternalStore=function(e,t,r){return _.H.useSyncExternalStore(e,t,r)},t.useTransition=function(){return _.H.useTransition()},t.version="19.2.6"},489(e,t,r){e.exports=r(2942)},1325(e,t,r){e.exports=r(1757)},8718(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.FormoAnalytics=void 0;var o=r(49),s=r(6517),c=r(2257),u=r(4992),l=r(4203),d=r(3312),h=r(9582),f=r(5896),p=r(4657),v=r(8834),g=r(2690),y=r(2598),m=r(6653),b=r(5620),A=r(7295),S=r(7392),w=r(5707),E=r(9308),_=r(1951),C=r(6053),I=function(){function e(e,t){void 0===t&&(t={});var r,n,i,a=this;if(this.writeKey=e,this.options=t,this._announcedConnect=new WeakMap,this.isWagmiMode=!1,this.isEvmDisabled=!1,this._currentUrl="",this._pageHooksDisposed=!1,this.currentUserId="",this.isCleanedUp=!1,this.config={writeKey:e},this.options=t,this.isWagmiMode=!!t.wagmi,this.isEvmDisabled=!1===t.evm,this.crossSubdomainCookies=null===(r=t.crossSubdomainCookies)||void 0===r||r,t.crossSubdomainCookies=this.crossSubdomainCookies,this.session=new f.FormoAnalyticsSession,this.currentUserId=(0,s.cookie)().get(o.SESSION_USER_ID_KEY)||void 0,this.identify=this.identify.bind(this),this.connect=this.connect.bind(this),this.disconnect=this.disconnect.bind(this),this.chain=this.chain.bind(this),this.signature=this.signature.bind(this),this.transaction=this.transaction.bind(this),this.detect=this.detect.bind(this),this.track=this.track.bind(this),this.registerProvider=this.registerProvider.bind(this),this.page=this.page.bind(this),this.reset=this.reset.bind(this),this.cleanup=this.cleanup.bind(this),this.optOutTracking=this.optOutTracking.bind(this),this.optInTracking=this.optInTracking.bind(this),this.hasOptedOutTracking=this.hasOptedOutTracking.bind(this),this.isAutocaptureEnabled=this.isAutocaptureEnabled.bind(this),this.syncPrivyActiveChain=this.syncPrivyActiveChain.bind(this),this.isTrackingSuppressed=this.isTrackingSuppressed.bind(this),this.getTrackedProvidersCount=this.getTrackedProvidersCount.bind(this),this.getProviderState=this.getProviderState.bind(this),this.syncWalletState=this.syncWalletState.bind(this),d.Logger.init({enabled:(null===(n=t.logger)||void 0===n?void 0:n.enabled)||!1,enabledLevels:(null===(i=t.logger)||void 0===i?void 0:i.levels)||[]}),this.evm=new y.EvmProviderRegistry({activeProvider:function(){return a.wallet.provider},activeChainId:function(){return a.wallet.evmChainId},knownEvmAddress:function(){return a.wallet.evmAddress},onChainObserved:function(e,t){e===a.wallet.provider&&"evm"===a.wallet.activeNamespace&&a.wallet.evmChainId!==t&&a.wallet.set("evm",{chainId:t})}}),this.wallet=new g.WalletStateStore({isPersistedIdentityPurgeRequired:function(){return a.trackingPolicy.isPersistedIdentityPurgeRequired()},isPageExcluded:function(){return a.trackingPolicy.isPageExcluded()},isTrackingSuppressed:function(){return a.trackingPolicy.isTrackingSuppressed()},crossSubdomainCookies:function(){return a.crossSubdomainCookies},providerChainId:function(e){return a.evm.chainIdOf(e)},onProviderDisplaced:function(e){return a.evmEvents.forgetAnnouncedConnect(e)}}),this.evmRequests=new A.EvmRequestTracker(this.wallet,this.evm,{isAutocaptureEnabled:function(e){return a.isAutocaptureEnabled(e)},signature:function(e,t){return a.signature(e,t)},transaction:function(e,t){return a.transaction(e,t)},shouldSkipRequestCapture:function(e,t){var r,n;return null!==(n=null===(r=a.wagmiHandler)||void 0===r?void 0:r.hasMatchingPendingMutation(e,t))&&void 0!==n&&n}}),this.evmEvents=new b.EvmEventTracker(this.wallet,this.evm,{isAutocaptureEnabled:function(e){return a.isAutocaptureEnabled(e)},isTrackingSuppressed:function(){return a.isTrackingSuppressed()},willTrackEvent:function(e){return a.willTrackEvent(e)},isWagmiMode:function(){return a.isWagmiMode},connect:function(e,t){return a.connect(e,t)},disconnect:function(e){return a.disconnect(e)},chain:function(e,t){return a.chain(e,t)},detect:function(e){return a.detect(e)},registerRequestListeners:function(e){return a.evmRequests.registerRequestListeners(e)}}),this.trackingPolicy=new v.TrackingPolicy({options:function(){return a.options},hasOptedOut:function(){return a.hasOptedOutTracking()},currentChainId:function(){return a.currentChainId}}),this.eventManager=new u.EventManager(new l.EventQueue(this.config.writeKey,{apiHost:t.apiHost||o.EVENTS_API_HOST,flushAt:t.flushAt,retryCount:t.retryCount,maxQueueSize:t.maxQueueSize,flushInterval:t.flushInterval,errorHandler:t.errorHandler,canSend:function(){return!a.hasOptedOutTracking()}}),t),this.hasOptedOutTracking()&&d.logger.info("User has previously opted out of tracking"),this.isEvmDisabled)d.logger.info("FormoAnalytics: EVM provider tracking disabled");else if(this.isWagmiMode&&t.wagmi)d.logger.info("FormoAnalytics: Initializing in Wagmi mode"),this.wagmiHandler=new w.WagmiEventHandler(this,t.wagmi.config,t.wagmi.queryClient);else{var c=void 0,h=t.provider;h?c=h:"undefined"!=typeof window&&window.ethereum&&(c=window.ethereum),c&&this.evmEvents.trackEIP1193Provider(c)}t.solana&&(this.solanaManager=new _.SolanaManager(this,t.solana)),this._currentUrl=window.location.href,this.wallet.load(),this.trackPageHit(),this.trackPageHits()}return Object.defineProperty(e.prototype,"_provider",{get:function(){return this.wallet.provider},set:function(e){this.wallet.provider=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_evmAddress",{get:function(){return this.wallet.evmAddress},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_evmChainId",{get:function(){return this.wallet.evmChainId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentAddress",{get:function(){return this.wallet.address},set:function(e){this.wallet.setActiveAddress(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentChainId",{get:function(){return this.wallet.chainId},set:function(e){this.wallet.setActiveChainId(e)},enumerable:!1,configurable:!0}),e.init=function(t,r){return i(this,void 0,void 0,function(){var n,i;return a(this,function(a){switch(a.label){case 0:return(0,s.initStorageManager)(t),(n=new e(t,r)).isEvmDisabled?(d.logger.info("FormoAnalytics: Skipping provider detection (EVM disabled)"),[3,5]):[3,1];case 1:return n.isWagmiMode?[3,4]:[4,n.evmEvents.getProviders()];case 2:return i=a.sent(),[4,n.evmEvents.detectWallets(i)];case 3:return a.sent(),n.evmEvents.trackProviders(i),[3,5];case 4:d.logger.info("FormoAnalytics: Skipping provider detection (Wagmi mode)"),a.label=5;case 5:return[2,n]}})})},e.prototype.page=function(e,t,r,n,o){return i(this,void 0,void 0,function(){return a(this,function(i){switch(i.label){case 0:return[4,this.trackPageHit(e,t,r,n,o)];case 1:return i.sent(),[2]}})})},e.prototype.reset=function(){this.currentUserId=void 0,this.wallet.reset(),(0,s.cookie)().remove(o.LOCAL_ANONYMOUS_ID_KEY),(0,s.cookie)().remove(o.SESSION_USER_ID_KEY),(0,s.cookie)().remove(f.SESSION_WALLET_DETECTED_KEY),(0,s.cookie)().remove(f.SESSION_WALLET_IDENTIFIED_KEY),(0,s.cookie)().remove(o.ACTIVE_WALLET_KEY),(0,s.session)().remove(o.SESSION_TRAFFIC_SOURCE_KEY)},e.prototype.cleanup=function(){if(this.isCleanedUp=!0,d.logger.debug("FormoAnalytics: Cleaning up resources"),this.eventManager.close(),this.evmRequests.cleanup(),this.evmEvents.cleanup(),this.wagmiHandler&&(this.wagmiHandler.cleanup(),this.wagmiHandler=void 0),this.solanaManager&&(this.solanaManager.cleanup(),this.solanaManager=void 0),!this.isWagmiMode)for(var e=0,t=this.evm.trackedProviders();e<t.length;e++){var r=t[e];this.evmEvents.untrackProvider(r)}this._pageHooksDisposed=!0,"undefined"!=typeof window&&(this._onPopStateListener&&(window.removeEventListener("popstate",this._onPopStateListener),this._onPopStateListener=void 0),this._onLocationChangeListener&&(window.removeEventListener("locationchange",this._onLocationChangeListener),this._onLocationChangeListener=void 0)),d.logger.debug("FormoAnalytics: Cleanup complete")},e.prototype.connect=function(e,t,r,n){return i(this,arguments,void 0,function(e,t,r,n){var i,s=e.chainId,c=e.address;return a(this,function(e){switch(e.label){case 0:return null==s?(d.logger.warn("Connect: Chain ID cannot be null or undefined"),[2]):c?(i=(0,p.validateAddress)(c,s))?this.isTrackingSuppressed()?(d.logger.info("connect() skipped: tracking is suppressed for this visitor or environment"),[2]):(this.wallet.observe(this.wallet.namespaceOf(s)),this.setChainState(s,{address:i}),[4,this.trackEvent(o.EventType.CONNECT,{chainId:s,address:i},t,r,n)]):(d.logger.warn('Connect: Invalid address provided ("'.concat(c,'"). Please provide a valid EVM or Solana address.')),[2]):(d.logger.warn("Connect: Address cannot be empty"),[2]);case 1:return e.sent(),[2]}})})},e.prototype.disconnect=function(e,t,r,s){return i(this,void 0,void 0,function(){var i,c,u,l,h,f,p;return a(this,function(a){switch(a.label){case 0:return i=(null==e?void 0:e.chainId)||this.currentChainId,c=(null==e?void 0:e.address)||this.currentAddress,u=(0,E.isSolanaChainId)(i),l=!u&&this._provider?this.getProviderInfo(this._provider):null,d.logger.info("Disconnect: Emitting disconnect event with:",{chainId:i,address:c,providerName:null==l?void 0:l.name,rdns:null==l?void 0:l.rdns}),h=n(n({},l&&{providerName:l.name,rdns:l.rdns}),t),f=this.wallet.namespaceOf(i),this.wallet.beginDisconnect(f),p=this.wallet.snapshot(f),[4,this.trackEvent(o.EventType.DISCONNECT,n(n({},i&&{chainId:i}),c&&{address:c}),h,r,s)];case 1:return a.sent(),this.wallet.isUnchangedSince(f,p)?(this.clearChainState(i),d.logger.info("Wallet disconnected: Cleared currentAddress, currentChainId, and provider"),[2]):(d.logger.info("Disconnect: A new session claimed this namespace while the event was in flight; leaving its state intact"),[2])}})})},e.prototype.setChainState=function(e,t){this.wallet.set(e,t)},e.prototype.clearChainState=function(e){this.wallet.clear(e)},e.prototype.syncWalletState=function(e){this.wallet.syncWalletState(e)},e.prototype.clearActiveProvider=function(){this.wallet.clearProvider()},e.prototype.backfillActiveWallet=function(e,t,r){this.wallet.backfill(e,t,r)},e.prototype.clearStaleEvmWalletOnSwitchWhileSuppressed=function(e){this.wallet.clearStaleEvmWalletOnSwitchWhileSuppressed(e)},e.prototype.addProviderListener=function(e,t,r){this.evm.addListener(e,t,r)},e.prototype.removeProviderListeners=function(e){this.evm.removeListeners(e)},e.prototype.getProviderInfo=function(e){return this.evm.infoFor(e)},e.prototype.isProviderAlreadyWrapped=function(e,t){return this.evm.isWrapped(e,t)},e.prototype.resolveChainIdForProvider=function(e){return this.evm.resolveChainId(e)},e.prototype.rememberProviderChain=function(e,t){this.evm.rememberChain(e,t)},e.prototype.getAddress=function(e){return i(this,void 0,void 0,function(){return a(this,function(t){return[2,this.evm.addressOf(e)]})})},e.prototype.getAccounts=function(e){return i(this,void 0,void 0,function(){return a(this,function(t){return[2,this.evm.accountsOf(e)]})})},e.prototype.chain=function(e,t,r,n){return i(this,arguments,void 0,function(e,t,r,n){var i=e.chainId,s=e.address;return a(this,function(e){switch(e.label){case 0:return i&&0!==Number(i)?isNaN(Number(i))?(d.logger.warn("FormoAnalytics::chain: chainId must be a valid decimal number"),[2]):s||this.currentAddress?(this.setChainState(i,{}),[4,this.trackEvent(o.EventType.CHAIN,{chainId:i,address:s||this.currentAddress},t,r,n)]):(d.logger.warn("FormoAnalytics::chain: address was empty and no previous address has been recorded"),[2]):(d.logger.warn("FormoAnalytics::chain: chainId cannot be empty or 0"),[2]);case 1:return e.sent(),[2]}})})},e.prototype.signature=function(e,t,r,n){return i(this,arguments,void 0,function(e,t,r,n){var i=e.status,s=e.chainId,c=e.address,u=e.message;return a(this,function(e){switch(e.label){case 0:return[4,this.trackEvent(o.EventType.SIGNATURE,{status:i,chainId:s,address:c,message:u},t,r,n)];case 1:return e.sent(),[2]}})})},e.prototype.transaction=function(e,t,r,s){return i(this,arguments,void 0,function(e,t,r,i){var s=e.status,c=e.chainId,u=e.address,l=e.data,d=e.to,h=e.value,f=e.transactionHash,p=e.function_name,v=e.function_args;return a(this,function(e){switch(e.label){case 0:return[4,this.trackEvent(o.EventType.TRANSACTION,n(n(n({status:s,chainId:c,address:u,data:l,to:d,value:h},f&&{transactionHash:f}),p&&{function_name:p}),v&&{function_args:v}),t,r,i)];case 1:return e.sent(),[2]}})})},e.prototype.identify=function(e,t,r,u){return i(this,void 0,void 0,function(){var i,l,h,f,v,g,y,m,b,A,S,w,E,_,I,k,P,O,T,x,R,L;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,14,,15]),(i=e)&&"string"==typeof i.id&&void 0===i.address?(l=null!=t?t:{},[4,(0,C.identifyPrivyUser)(this,i,{activeAddress:l.activeAddress,properties:l.properties})]):[3,2];case 1:return a.sent(),[2];case 2:if(h=e,f=t,this.isTrackingSuppressed()||this.trackingPolicy.isChainExcluded())return d.logger.info("identify() skipped: tracking is suppressed for this visitor, environment, or chain"),[2];if(h)return[3,12];d.logger.info("Auto-identifying with providers:",this.evm.all.map(function(e){return e.info.name})),v=0,g=this.evm.all,a.label=3;case 3:if(!(v<g.length))return[3,11];if(y=g[v],!(m=y.provider))return[3,10];a.label=4;case 4:return a.trys.push([4,9,,10]),[4,this.getAddress(m)];case 5:return(b=a.sent())?(A=(0,p.validateAndChecksumAddress)(b),d.logger.info("Auto-identify: Checking deduplication",{validAddress:A,rdns:y.info.rdns,providerName:y.info.name,isAlreadyIdentified:!!A&&this.session.isWalletIdentified(A,y.info.rdns,void 0,f)}),!A||this.session.isWalletIdentified(A,y.info.rdns,void 0,f)?[3,7]:(d.logger.info("Auto-identifying",A,y.info.name,y.info.rdns),[4,this.identify({address:A,providerName:y.info.name,rdns:y.info.rdns},f,r,u)])):[3,8];case 6:return a.sent(),[3,8];case 7:A&&d.logger.info("Auto-identify: Skipping already identified wallet",A,y.info.name,y.info.rdns),a.label=8;case 8:return[3,10];case 9:return S=a.sent(),d.logger.error("Failed to identify provider ".concat(y.info.name,":"),S),[3,10];case 10:return v++,[3,3];case 11:return[2];case 12:return w=h.address,E=h.providerName,_=h.userId,I=h.rdns,k=h.setActive,w?(d.logger.info("Identify",w,_,E,I),(P=(0,p.validateAddress)(w))?(!1!==k&&(this.wallet.setActiveAddress(P),_&&(this.currentUserId=_,O=(0,c.getIdentityCookieDomain)(this.crossSubdomainCookies),(0,s.cookie)().set(o.SESSION_USER_ID_KEY,_,n(n({path:"/"},(0,c.getIdentityCookieSecurity)()),O?{domain:O}:{})))),T=this.session.isWalletIdentified(P,I||"",_,f),d.logger.debug("Identify: Checking deduplication",{validAddress:P,rdns:I,providerName:E,userId:_,isAlreadyIdentified:T}),T?(d.logger.info("Identify: Wallet ".concat(E||"Unknown"," with address ").concat(P," already identified in this session (rdns: ").concat(I||"empty",")")),[2]):(this.session.markWalletIdentified(P,I||"",_,f),[4,this.trackEvent(o.EventType.IDENTIFY,{address:P,providerName:E,userId:_,rdns:I},f,r,u)])):(null===(L=d.logger.warn)||void 0===L||L.call(d.logger,"Invalid address provided to identify:",w),[2])):(null===(R=d.logger.warn)||void 0===R||R.call(d.logger,"identify() called without address - address is required"),[2]);case 13:return a.sent(),[3,15];case 14:return x=a.sent(),d.logger.log("identify error",x),[3,15];case 15:return[2]}})})},e.prototype.syncPrivyActiveChain=function(e,t){if(void 0!==this.currentChainId&&null!==this.currentChainId){var r,n=null==e?void 0:e.toLowerCase();"solana"===n?r=!0:("ethereum"===n||!n&&t&&/^0x[0-9a-f]{40}$/i.test(t))&&(r=!1),void 0!==r&&r!==(0,E.isSolanaChainId)(this.currentChainId)&&this.wallet.setActiveChainId(void 0)}},e.prototype.detect=function(e,t,r,n){return i(this,arguments,void 0,function(e,t,r,n){var i=e.providerName,s=e.rdns;return a(this,function(e){switch(e.label){case 0:return this.isTrackingSuppressed()?(d.logger.info("detect() skipped: tracking is suppressed for this visitor or environment"),[2]):this.session.isWalletDetected(s)?[2,d.logger.warn("Detect: Wallet ".concat(i," already detected in this session"))]:(this.session.markWalletDetected(s),[4,this.trackEvent(o.EventType.DETECT,{providerName:i,rdns:s},t,r,n)]);case 1:return e.sent(),[2]}})})},e.prototype.track=function(e,t,r,n){return i(this,void 0,void 0,function(){return a(this,function(i){switch(i.label){case 0:return[4,this.trackEvent(o.EventType.TRACK,{event:e},t,r,n)];case 1:return i.sent(),[2]}})})},e.prototype.willTrackEvent=function(e){return this.shouldTrack(e)},e.prototype.optOutTracking=function(){d.logger.info("Opting out of tracking"),(0,h.setConsentFlag)(this.writeKey,o.CONSENT_OPT_OUT_KEY,"true"),this.eventManager.clear(),this.evmEvents.markRegisteredAdoptionsPending(),this.reset(),d.logger.info("Successfully opted out of tracking")},e.prototype.optInTracking=function(){var e,t=this;setTimeout(function(){if(!t.isCleanedUp)try{t.evmEvents.retryExternalAdoptions()}catch(e){}},0),d.logger.info("Opting back into tracking"),(0,h.removeConsentFlag)(this.writeKey,o.CONSENT_OPT_OUT_KEY),null===(e=this.wagmiHandler)||void 0===e||e.retryAdoption(),d.logger.info("Successfully opted back into tracking")},e.prototype.hasOptedOutTracking=function(){return"true"===(0,h.getConsentFlag)(this.writeKey,o.CONSENT_OPT_OUT_KEY)},e.prototype.onLocationChange=function(){return i(this,void 0,void 0,function(){var e;return a(this,function(t){return this._currentUrl!==window.location.href&&(this._currentUrl=window.location.href,null===(e=this.wagmiHandler)||void 0===e||e.retryAdoption(),this.trackPageHit()),[2]})})},e.prototype.trackPageHits=function(){var t=this;e.installHistoryHooksOnce(),this._onPopStateListener=function(){return t.onLocationChange()},this._onLocationChangeListener=function(){return t.onLocationChange()},window.addEventListener("popstate",this._onPopStateListener),window.addEventListener("locationchange",this._onLocationChangeListener)},e.installHistoryHooksOnce=function(){if("undefined"!=typeof history&&"undefined"!=typeof window){var e=Symbol.for("formo.historyWrapped");if(!history[e]){history[e]=!0;var t=function(){return window.dispatchEvent(new window.Event("locationchange"))},r=history.pushState;history.pushState=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=r.apply(this,e);return t(),i};var n=history.replaceState;history.replaceState=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=n.apply(this,e);return t(),i}}}},e.prototype.trackPageHit=function(e,t,r,n,s){return i(this,void 0,void 0,function(){var c=this;return a(this,function(u){if(!this.isCleanedUp)try{this.evmEvents.retryExternalAdoptions()}catch(e){}return this.shouldTrack()?(setTimeout(function(){c._pageHooksDisposed||i(c,void 0,void 0,function(){var i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.trackEvent(o.EventType.PAGE,{category:e,name:t},r,n,s)];case 1:return a.sent(),[3,3];case 2:return i=a.sent(),d.logger.error("Formo: Failed to track page hit",i),[3,3];case 3:return[2]}})})},300),[2]):(d.logger.info("Track page hit: Skipping event due to tracking configuration"),[2])})})},e.prototype.trackEvent=function(e,t,r,o,s){return i(this,void 0,void 0,function(){var i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),this.shouldTrack(null==t?void 0:t.chainId)?[4,this.eventManager.addEvent(n(n({type:e},t),{properties:r,context:o,callback:s}),this.currentAddress,this.currentUserId)]:(d.logger.info("Skipping ".concat(e," event due to tracking configuration")),[2]);case 1:return a.sent(),[3,3];case 2:return i=a.sent(),d.logger.error("Error tracking event:",i),[3,3];case 3:return[2]}})})},e.prototype.isTrackingSuppressed=function(){return this.trackingPolicy.isTrackingSuppressed()},e.prototype.shouldTrack=function(e){return this.trackingPolicy.shouldTrack({chainId:e})},e.prototype.isAutocaptureEnabled=function(e){return this.trackingPolicy.isAutocaptureEnabled(e)},Object.defineProperty(e.prototype,"providers",{get:function(){return this.evm.all},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"provider",{get:function(){return this._provider},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"solana",{get:function(){return this.solanaManager||(this.solanaManager=new _.SolanaManager(this)),this.solanaManager},enumerable:!1,configurable:!0}),e.prototype.getCurrentChainId=function(e){return i(this,void 0,void 0,function(){var t,r,n;return a(this,function(i){switch(i.label){case 0:if(!(t=e||this.provider))return d.logger.error("Provider not set for chain ID"),[2,0];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,t.request({method:"eth_chainId"})];case 2:return(r=i.sent())?[2,(0,S.parseChainId)(r)]:(d.logger.info("Chain id not found"),[2,0]);case 3:return n=i.sent(),d.logger.error("eth_chainId threw an error:",n),[2,0];case 4:return[2]}})})},e.prototype._wrapWagmiProvider=function(e,t,r){if(this.isCleanedUp||!(0,m.isValidProvider)(e))return!1;try{return!!this.evmRequests.registerRequestListeners(e)&&(this.evm.rememberAttribution(e,r),void 0!==t&&this.evm.rememberChain(e,t),!0)}catch(e){return d.logger.warn("Failed to wrap wagmi provider for hybrid capture",e),!1}},e.prototype._rememberWagmiProviderChain=function(e,t){if(!this.isCleanedUp)try{this.evm.rememberChain(e,t)}catch(e){}},e.prototype.registerProvider=function(t,r){var n,i,a;if(this.isCleanedUp)return d.logger.warn("registerProvider: instance is cleaned up; refusing"),!1;if(this.isEvmDisabled)return d.logger.warn("registerProvider: EVM tracking is disabled; refusing"),!1;if(this.isWagmiMode)return d.logger.warn("registerProvider: wagmi mode tracks connectors already; registering the provider here would double-report its events. Refusing."),!1;if(!(0,m.isValidProvider)(t))return d.logger.warn("registerProvider: not a valid EIP-1193 provider; refusing"),!1;var o=(0,m.detectInjectedProviderInfo)(t),s=(0,m.readWalletConnectPeer)(t),c=null!==(n=null==r?void 0:r.rdns)&&void 0!==n?n:s&&"io.injected.provider"===o.rdns?"com.walletconnect":o.rdns,u=null!==(i=null==r?void 0:r.name)&&void 0!==i?i:s?"WalletConnect":o.name,l="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"registered-".concat(c.replace(/[^a-zA-Z0-9]/g,"-"),"-").concat(e.registeredProviderSeq+=1);return this.evmEvents.adoptExternalProvider({info:{name:u,rdns:c,uuid:l,icon:null!==(a=null==r?void 0:r.icon)&&void 0!==a?a:o.icon},provider:t})},e.prototype.getTrackedProvidersCount=function(){return this.evm.counts.trackedProviders},e.prototype.getProviderState=function(){return n(n({},this.evm.counts),{activeProvider:!!this._provider})},e.registeredProviderSeq=0,e}();t.FormoAnalytics=I},4245(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFormo=t.FormoAnalyticsProvider=t.computeOptionsKey=t.FormoAnalyticsContext=void 0;var o=r(1325),s=r(489),c=r(8718),u=r(6517),l=r(3312),d={chain:function(){return Promise.resolve()},page:function(){return Promise.resolve()},reset:function(){},cleanup:function(){},registerProvider:function(){return!1},detect:function(){return Promise.resolve()},connect:function(){return Promise.resolve()},disconnect:function(){return Promise.resolve()},signature:function(){return Promise.resolve()},transaction:function(){return Promise.resolve()},identify:function(){return Promise.resolve()},track:function(){return Promise.resolve()},optOutTracking:function(){},optInTracking:function(){},hasOptedOutTracking:function(){return!1}};t.FormoAnalyticsContext=(0,s.createContext)(d),t.computeOptionsKey=function(e){var t;if(!e)return"undefined";var r={tracking:e.tracking,autocapture:e.autocapture,crossSubdomainCookies:e.crossSubdomainCookies,apiHost:e.apiHost,flushAt:e.flushAt,flushInterval:e.flushInterval,retryCount:e.retryCount,maxQueueSize:e.maxQueueSize,logger:e.logger,referral:e.referral,evm:e.evm,hasProvider:!!e.provider,hasWagmi:!!e.wagmi,wagmiEip1193Fallback:!!(null===(t=e.wagmi)||void 0===t?void 0:t.eip1193Fallback),hasReady:!!e.ready};try{return JSON.stringify(r)}catch(e){return l.logger.warn("Failed to serialize options, using timestamp",e),Date.now().toString()}},t.FormoAnalyticsProvider=function(e){var t=e.writeKey,r=e.disabled,i=void 0!==r&&r,a=e.children;return t?i?(l.logger.warn("FormoAnalytics is disabled"),(0,o.jsx)(o.Fragment,{children:a})):(0,o.jsx)(h,n({},e)):(l.logger.error("FormoAnalyticsProvider: No Write Key provided"),(0,o.jsx)(o.Fragment,{children:a}))};var h=function(e){var r=e.writeKey,n=e.options,h=e.children,f=(0,s.useState)(d),p=f[0],v=f[1],g=(0,s.useRef)(d);(0,u.initStorageManager)(r);var y=(0,s.useMemo)(function(){return(0,t.computeOptionsKey)(n)},[n]);return(0,s.useEffect)(function(){var e=!1;return i(void 0,void 0,void 0,function(){var t,i;return a(this,function(a){switch(a.label){case 0:g.current&&g.current!==d&&(l.logger.log("Cleaning up existing FormoAnalytics SDK instance before re-initialization"),g.current.cleanup(),g.current=d,v(d)),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,c.FormoAnalytics.init(r,n)];case 2:return t=a.sent(),e?(l.logger.log("Component unmounted during initialization, cleaning up SDK"),t.cleanup()):(v(t),g.current=t,l.logger.log("Successfully initialized FormoAnalytics SDK")),[3,4];case 3:return i=a.sent(),e||l.logger.error("Failed to initialize FormoAnalytics SDK",i),[3,4];case 4:return[2]}})}),function(){e=!0,g.current&&g.current!==d&&(l.logger.log("Cleaning up FormoAnalytics SDK instance"),g.current.cleanup(),g.current=d)}},[r,y]),(0,o.jsx)(t.FormoAnalyticsContext.Provider,{value:p,children:h})};t.useFormo=function(){var e=(0,s.useContext)(t.FormoAnalyticsContext);return e||l.logger.warn("useFormo called without a valid context"),e}},6079(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.detectBrowser=function(){var e=this;return a?Promise.resolve(a):i||(i=r(e,void 0,void 0,function(){var e,t;return n(this,function(r){switch(r.label){case 0:return e=function(){try{return void 0!==globalThis.navigator?globalThis.navigator.userAgent:""}catch(e){return""}}(),[4,o().catch(function(){return!1})];case 1:return t=r.sent(),a=t?"brave":function(e){return/Firefox\/\d+/i.test(e)?"firefox":/Edg\/\d+/i.test(e)?"edge":/OPR\/\d+/i.test(e)?"opera":/Safari\/\d+/i.test(e)&&!/Chrome\/\d+/i.test(e)?"safari":/Chrome\/\d+/i.test(e)?"chrome":"unknown"}(e),[2,a]}})}).finally(function(){i=null}))};var i=null,a=null;function o(){return r(this,void 0,void 0,function(){var e,t,r,i;return n(this,function(n){switch(n.label){case 0:if(!(e=void 0!==globalThis.navigator?globalThis.navigator:void 0))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(r=e.brave)||void 0===r?void 0:r.isBrave)?[4,e.brave.isBrave().catch(function(){return!1})]:[3,3];case 2:if(n.sent())return[2,!0];n.label=3;case 3:return[3,5];case 4:return n.sent(),[3,5];case 5:try{if(null==(t=null===(i=e.userAgentData)||void 0===i?void 0:i.brands)?void 0:t.some(function(e){return/Brave/i.test(e.brand)}))return[2,!0]}catch(e){}try{if(/Brave/i.test(e.userAgent))return[2,!0]}catch(e){}return[2,!1]}})})}},9582(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setConsentFlag=function(e,t,r){var n;if("undefined"!=typeof document){var o=a(e,t),s=new Date(Date.now()+31536e6).toUTCString(),c="https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol),u=(0,i.getApexDomain)(),l=u?"; domain=.".concat(u):"";u&&(document.cookie="".concat(o,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;")),document.cookie="".concat(o,"=").concat(encodeURIComponent(r),"; expires=").concat(s,"; path=/").concat(l,"; SameSite=Strict").concat(c?"; Secure":"")}},t.getConsentFlag=function(e,t){if("undefined"==typeof document)return null;for(var r=a(e,t),n=0,i=document.cookie.split(";");n<i.length;n++){var o=i[n].trim(),s=o.indexOf("=");if(-1!==s){var c=o.substring(0,s),u=o.substring(s+1);if(c===r)return decodeURIComponent(u||"")}}return null},t.removeConsentFlag=function(e,t){!function(e){if("undefined"!=typeof document){document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;");var t=(0,i.getApexDomain)();t&&(document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=.").concat(t,";"))}}(a(e,t))};var n=r(625),i=r(9037);function a(e,t){return"formo_".concat((0,n.secureHash)(e),"_").concat(t)}},88(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BLOCKED_ADDRESSES=t.DEAD_ADDRESS=t.ZERO_ADDRESS=t.CONSENT_OPT_OUT_KEY=t.LOCAL_ANONYMOUS_ID_KEY=t.ACTIVE_WALLET_TTL_MS=t.ACTIVE_WALLET_KEY=t.SESSION_USER_ID_KEY=t.SESSION_TRAFFIC_SOURCE_KEY=void 0,t.SESSION_TRAFFIC_SOURCE_KEY="traffic-source",t.SESSION_USER_ID_KEY="user-id",t.ACTIVE_WALLET_KEY="active-wallet",t.ACTIVE_WALLET_TTL_MS=864e5,t.LOCAL_ANONYMOUS_ID_KEY="anonymous-id",t.CONSENT_OPT_OUT_KEY="opt-out-tracking",t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000",t.DEAD_ADDRESS="0x000000000000000000000000000000000000dEaD",t.BLOCKED_ADDRESSES=[t.ZERO_ADDRESS,t.DEAD_ADDRESS]},3787(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.COUNTRY_LIST=t.EVENTS_API_REQUEST_HEADER=t.EVENTS_API_HOST=t.EVENTS_API_ORIGIN=void 0,t.EVENTS_API_ORIGIN="https://events.formo.so",t.EVENTS_API_HOST="".concat(t.EVENTS_API_ORIGIN,"/v0/raw_events"),t.EVENTS_API_REQUEST_HEADER=function(e){return{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}},t.COUNTRY_LIST={"Africa/Abidjan":"CI","Africa/Accra":"GH","Africa/Addis_Ababa":"ET","Africa/Algiers":"DZ","Africa/Asmara":"ER","Africa/Asmera":"ER","Africa/Bamako":"ML","Africa/Bangui":"CF","Africa/Banjul":"GM","Africa/Bissau":"GW","Africa/Blantyre":"MW","Africa/Brazzaville":"CG","Africa/Bujumbura":"BI","Africa/Cairo":"EG","Africa/Casablanca":"MA","Africa/Ceuta":"ES","Africa/Conakry":"GN","Africa/Dakar":"SN","Africa/Dar_es_Salaam":"TZ","Africa/Djibouti":"DJ","Africa/Douala":"CM","Africa/El_Aaiun":"EH","Africa/Freetown":"SL","Africa/Gaborone":"BW","Africa/Harare":"ZW","Africa/Johannesburg":"ZA","Africa/Juba":"SS","Africa/Kampala":"UG","Africa/Khartoum":"SD","Africa/Kigali":"RW","Africa/Kinshasa":"CD","Africa/Lagos":"NG","Africa/Libreville":"GA","Africa/Lome":"TG","Africa/Luanda":"AO","Africa/Lubumbashi":"CD","Africa/Lusaka":"ZM","Africa/Malabo":"GQ","Africa/Maputo":"MZ","Africa/Maseru":"LS","Africa/Mbabane":"SZ","Africa/Mogadishu":"SO","Africa/Monrovia":"LR","Africa/Nairobi":"KE","Africa/Ndjamena":"TD","Africa/Niamey":"NE","Africa/Nouakchott":"MR","Africa/Ouagadougou":"BF","Africa/Porto-Novo":"BJ","Africa/Sao_Tome":"ST","Africa/Timbuktu":"ML","Africa/Tripoli":"LY","Africa/Tunis":"TN","Africa/Windhoek":"NA","America/Adak":"US","America/Anchorage":"US","America/Anguilla":"AI","America/Antigua":"AG","America/Araguaina":"BR","America/Argentina/Buenos_Aires":"AR","America/Argentina/Catamarca":"AR","America/Argentina/ComodRivadavia":"AR","America/Argentina/Cordoba":"AR","America/Argentina/Jujuy":"AR","America/Argentina/La_Rioja":"AR","America/Argentina/Mendoza":"AR","America/Argentina/Rio_Gallegos":"AR","America/Argentina/Salta":"AR","America/Argentina/San_Juan":"AR","America/Argentina/San_Luis":"AR","America/Argentina/Tucuman":"AR","America/Argentina/Ushuaia":"AR","America/Aruba":"AW","America/Asuncion":"PY","America/Atikokan":"CA","America/Atka":"US","America/Bahia":"BR","America/Bahia_Banderas":"MX","America/Barbados":"BB","America/Belem":"BR","America/Belize":"BZ","America/Blanc-Sablon":"CA","America/Boa_Vista":"BR","America/Bogota":"CO","America/Boise":"US","America/Buenos_Aires":"AR","America/Cambridge_Bay":"CA","America/Campo_Grande":"BR","America/Cancun":"MX","America/Caracas":"VE","America/Catamarca":"AR","America/Cayenne":"GF","America/Cayman":"KY","America/Chicago":"US","America/Chihuahua":"MX","America/Ciudad_Juarez":"MX","America/Coral_Harbour":"CA","America/Cordoba":"AR","America/Costa_Rica":"CR","America/Creston":"CA","America/Cuiaba":"BR","America/Curacao":"CW","America/Danmarkshavn":"GL","America/Dawson":"CA","America/Dawson_Creek":"CA","America/Denver":"US","America/Detroit":"US","America/Dominica":"DM","America/Edmonton":"CA","America/Eirunepe":"BR","America/El_Salvador":"SV","America/Ensenada":"MX","America/Fort_Nelson":"CA","America/Fort_Wayne":"US","America/Fortaleza":"BR","America/Glace_Bay":"CA","America/Godthab":"GL","America/Goose_Bay":"CA","America/Grand_Turk":"TC","America/Grenada":"GD","America/Guadeloupe":"GP","America/Guatemala":"GT","America/Guayaquil":"EC","America/Guyana":"GY","America/Halifax":"CA","America/Havana":"CU","America/Hermosillo":"MX","America/Indiana/Indianapoli":"US","America/Indiana/Knox":"US","America/Indiana/Marengo":"US","America/Indiana/Petersburg":"US","America/Indiana/Tell_City":"US","America/Indiana/Vevay":"US","America/Indiana/Vincennes":"US","America/Indiana/Winamac":"US","America/Indianapoli":"US","America/Inuvik":"CA","America/Iqaluit":"CA","America/Jamaica":"JM","America/Jujuy":"AR","America/Juneau":"US","America/Kentucky/Louisville":"US","America/Kentucky/Monticello":"US","America/Knox_IN":"US","America/Kralendijk":"BQ","America/La_Paz":"BO","America/Lima":"PE","America/Los_Angeles":"US","America/Louisville":"US","America/Lower_Princes":"SX","America/Maceio":"BR","America/Managua":"NI","America/Manaus":"BR","America/Marigot":"MF","America/Martinique":"MQ","America/Matamoros":"MX","America/Mazatlan":"MX","America/Mendoza":"AR","America/Menominee":"US","America/Merida":"MX","America/Metlakatla":"US","America/Mexico_City":"MX","America/Miquelon":"PM","America/Moncton":"CA","America/Monterrey":"MX","America/Montevideo":"UY","America/Montreal":"CA","America/Montserrat":"MS","America/Nassau":"BS","America/New_York":"US","America/Nipigon":"CA","America/Nome":"US","America/Noronha":"BR","America/North_Dakota/Beulah":"US","America/North_Dakota/Center":"US","America/North_Dakota/New_Salem":"US","America/Nuuk":"GL","America/Ojinaga":"MX","America/Panama":"PA","America/Pangnirtung":"CA","America/Paramaribo":"SR","America/Phoenix":"US","America/Port-au-Prince":"HT","America/Port_of_Spain":"TT","America/Porto_Acre":"BR","America/Porto_Velho":"BR","America/Puerto_Rico":"PR","America/Punta_Arenas":"CL","America/Rainy_River":"CA","America/Rankin_Inlet":"CA","America/Recife":"BR","America/Regina":"CA","America/Resolute":"CA","America/Rio_Branco":"BR","America/Rosario":"AR","America/Santa_Isabel":"MX","America/Santarem":"BR","America/Santiago":"CL","America/Santo_Domingo":"DO","America/Sao_Paulo":"BR","America/Scoresbysund":"GL","America/Shiprock":"US","America/Sitka":"US","America/St_Barthelemy":"BL","America/St_Johns":"CA","America/St_Kitts":"KN","America/St_Lucia":"LC","America/St_Thomas":"VI","America/St_Vincent":"VC","America/Swift_Current":"CA","America/Tegucigalpa":"HN","America/Thule":"GL","America/Thunder_Bay":"CA","America/Tijuana":"MX","America/Toronto":"CA","America/Tortola":"VG","America/Vancouver":"CA","America/Virgin":"VI","America/Whitehorse":"CA","America/Winnipeg":"CA","America/Yakutat":"US","America/Yellowknife":"CA","Antarctica/Casey":"AQ","Antarctica/Davis":"AQ","Antarctica/DumontDUrville":"AQ","Antarctica/Macquarie":"AU","Antarctica/Mawson":"AQ","Antarctica/McMurdo":"AQ","Antarctica/Palmer":"AQ","Antarctica/Rothera":"AQ","Antarctica/South_Pole":"AQ","Antarctica/Syowa":"AQ","Antarctica/Troll":"AQ","Antarctica/Vostok":"AQ","Arctic/Longyearbyen":"SJ","Asia/Aden":"YE","Asia/Almaty":"KZ","Asia/Amman":"JO","Asia/Anadyr":"RU","Asia/Aqtau":"KZ","Asia/Aqtobe":"KZ","Asia/Ashgabat":"TM","Asia/Ashkhabad":"TM","Asia/Atyrau":"KZ","Asia/Baghdad":"IQ","Asia/Bahrain":"BH","Asia/Baku":"AZ","Asia/Bangkok":"TH","Asia/Barnaul":"RU","Asia/Beirut":"LB","Asia/Bishkek":"KG","Asia/Brunei":"BN","Asia/Calcutta":"IN","Asia/Chita":"RU","Asia/Choibalsan":"MN","Asia/Chongqing":"CN","Asia/Chungking":"CN","Asia/Colombo":"LK","Asia/Dacca":"BD","Asia/Damascus":"SY","Asia/Dhaka":"BD","Asia/Dili":"TL","Asia/Dubai":"AE","Asia/Dushanbe":"TJ","Asia/Famagusta":"CY","Asia/Gaza":"PS","Asia/Harbin":"CN","Asia/Hebron":"PS","Asia/Ho_Chi_Minh":"VN","Asia/Hong_Kong":"HK","Asia/Hovd":"MN","Asia/Irkutsk":"RU","Asia/Istanbul":"TR","Asia/Jakarta":"ID","Asia/Jayapura":"ID","Asia/Jerusalem":"IL","Asia/Kabul":"AF","Asia/Kamchatka":"RU","Asia/Karachi":"PK","Asia/Kashgar":"CN","Asia/Kathmandu":"NP","Asia/Katmandu":"NP","Asia/Khandyga":"RU","Asia/Kolkata":"IN","Asia/Kostanay":"KZ","Asia/Krasnoyarsk":"RU","Asia/Kuala_Lumpur":"MY","Asia/Kuching":"MY","Asia/Kuwait":"KW","Asia/Macao":"MO","Asia/Macau":"MO","Asia/Magadan":"RU","Asia/Makassar":"ID","Asia/Manila":"PH","Asia/Muscat":"OM","Asia/Nicosia":"CY","Asia/Novokuznetsk":"RU","Asia/Novosibirsk":"RU","Asia/Omsk":"RU","Asia/Oral":"KZ","Asia/Phnom_Penh":"KH","Asia/Pontianak":"ID","Asia/Pyongyang":"KP","Asia/Qatar":"QA","Asia/Qostanay":"KZ","Asia/Qyzylorda":"KZ","Asia/Rangoon":"MM","Asia/Riyadh":"SA","Asia/Saigon":"VN","Asia/Sakhalin":"RU","Asia/Samarkand":"UZ","Asia/Seoul":"KR","Asia/Shanghai":"CN","Asia/Singapore":"SG","Asia/Srednekolymsk":"RU","Asia/Taipei":"TW","Asia/Tashkent":"UZ","Asia/Tbilisi":"GE","Asia/Tehran":"IR","Asia/Tel_Aviv":"IL","Asia/Thimbu":"BT","Asia/Thimphu":"BT","Asia/Tokyo":"JP","Asia/Tomsk":"RU","Asia/Ujung_Pandang":"ID","Asia/Ulaanbaatar":"MN","Asia/Ulan_Bator":"MN","Asia/Urumqi":"CN","Asia/Ust-Nera":"RU","Asia/Vientiane":"LA","Asia/Vladivostok":"RU","Asia/Yakutsk":"RU","Asia/Yangon":"MM","Asia/Yekaterinburg":"RU","Asia/Yerevan":"AM","Atlantic/Azores":"PT","Atlantic/Bermuda":"BM","Atlantic/Canary":"ES","Atlantic/Cape_Verde":"CV","Atlantic/Faeroe":"FO","Atlantic/Faroe":"FO","Atlantic/Jan_Mayen":"SJ","Atlantic/Madeira":"PT","Atlantic/Reykjavik":"IS","Atlantic/South_Georgia":"GS","Atlantic/St_Helena":"SH","Atlantic/Stanley":"FK","Australia/ACT":"AU","Australia/Adelaide":"AU","Australia/Brisbane":"AU","Australia/Broken_Hill":"AU","Australia/Canberra":"AU","Australia/Currie":"AU","Australia/Darwin":"AU","Australia/Eucla":"AU","Australia/Hobart":"AU","Australia/LHI":"AU","Australia/Lindeman":"AU","Australia/Lord_Howe":"AU","Australia/Melbourne":"AU","Australia/North":"AU","Australia/NSW":"AU","Australia/Perth":"AU","Australia/Queensland":"AU","Australia/South":"AU","Australia/Sydney":"AU","Australia/Tasmania":"AU","Australia/Victoria":"AU","Australia/West":"AU","Australia/Yancowinna":"AU","Brazil/Acre":"BR","Brazil/DeNoronha":"BR","Brazil/East":"BR","Brazil/West":"BR","Canada/Atlantic":"CA","Canada/Central":"CA","Canada/Eastern":"CA","Canada/Mountain":"CA","Canada/Newfoundland":"CA","Canada/Pacific":"CA","Canada/Saskatchewan":"CA","Canada/Yukon":"CA","Chile/Continental":"CL","Chile/EasterIsland":"CL",Cuba:"CU",Egypt:"EG",Eire:"IE","Europe/Amsterdam":"NL","Europe/Andorra":"AD","Europe/Astrakhan":"RU","Europe/Athens":"GR","Europe/Belfast":"GB","Europe/Belgrade":"RS","Europe/Berlin":"DE","Europe/Bratislava":"SK","Europe/Brussels":"BE","Europe/Bucharest":"RO","Europe/Budapest":"HU","Europe/Busingen":"DE","Europe/Chisinau":"MD","Europe/Copenhagen":"DK","Europe/Dublin":"IE","Europe/Gibraltar":"GI","Europe/Guernsey":"GG","Europe/Helsinki":"FI","Europe/Isle_of_Man":"IM","Europe/Istanbul":"TR","Europe/Jersey":"JE","Europe/Kaliningrad":"RU","Europe/Kiev":"UA","Europe/Kirov":"RU","Europe/Kyiv":"UA","Europe/Lisbon":"PT","Europe/Ljubljana":"SI","Europe/London":"GB","Europe/Luxembourg":"LU","Europe/Madrid":"ES","Europe/Malta":"MT","Europe/Mariehamn":"AX","Europe/Minsk":"BY","Europe/Monaco":"MC","Europe/Moscow":"RU","Europe/Nicosia":"CY","Europe/Oslo":"NO","Europe/Paris":"FR","Europe/Podgorica":"ME","Europe/Prague":"CZ","Europe/Riga":"LV","Europe/Rome":"IT","Europe/Samara":"RU","Europe/San_Marino":"SM","Europe/Sarajevo":"BA","Europe/Saratov":"RU","Europe/Simferopol":"RU","Europe/Skopje":"MK","Europe/Sofia":"BG","Europe/Stockholm":"SE","Europe/Tallinn":"EE","Europe/Tirane":"AL","Europe/Tiraspol":"MD","Europe/Ulyanovsk":"RU","Europe/Uzhgorod":"UA","Europe/Vaduz":"LI","Europe/Vatican":"VA","Europe/Vienna":"AT","Europe/Vilnius":"LT","Europe/Volgograd":"RU","Europe/Warsaw":"PL","Europe/Zagreb":"HR","Europe/Zaporozhye":"UA","Europe/Zurich":"CH",GB:"GB","GB-Eire":"GB",Hongkong:"HK",Iceland:"IS","Indian/Antananarivo":"MG","Indian/Chagos":"IO","Indian/Christmas":"CX","Indian/Cocos":"CC","Indian/Comoro":"KM","Indian/Kerguelen":"TF","Indian/Mahe":"SC","Indian/Maldives":"MV","Indian/Mauritius":"MU","Indian/Mayotte":"YT","Indian/Reunion":"RE",Iran:"IR",Israel:"IL",Jamaica:"JM",Japan:"JP",Kwajalein:"MH",Libya:"LY","Mexico/BajaNorte":"MX","Mexico/BajaSur":"MX","Mexico/General":"MX",Navajo:"US",NZ:"NZ","NZ-CHAT":"NZ","Pacific/Apia":"WS","Pacific/Auckland":"NZ","Pacific/Bougainville":"PG","Pacific/Chatham":"NZ","Pacific/Chuuk":"FM","Pacific/Easter":"CL","Pacific/Efate":"VU","Pacific/Enderbury":"KI","Pacific/Fakaofo":"TK","Pacific/Fiji":"FJ","Pacific/Funafuti":"TV","Pacific/Galapagos":"EC","Pacific/Gambier":"PF","Pacific/Guadalcanal":"SB","Pacific/Guam":"GU","Pacific/Honolulu":"US","Pacific/Johnston":"UM","Pacific/Kanton":"KI","Pacific/Kiritimati":"KI","Pacific/Kosrae":"FM","Pacific/Kwajalein":"MH","Pacific/Majuro":"MH","Pacific/Marquesas":"PF","Pacific/Midway":"UM","Pacific/Nauru":"NR","Pacific/Niue":"NU","Pacific/Norfolk":"NF","Pacific/Noumea":"NC","Pacific/Pago_Pago":"AS","Pacific/Palau":"PW","Pacific/Pitcairn":"PN","Pacific/Pohnpei":"FM","Pacific/Ponape":"FM","Pacific/Port_Moresby":"PG","Pacific/Rarotonga":"CK","Pacific/Saipan":"MP","Pacific/Samoa":"AS","Pacific/Tahiti":"PF","Pacific/Tarawa":"KI","Pacific/Tongatapu":"TO","Pacific/Truk":"FM","Pacific/Wake":"UM","Pacific/Wallis":"WF","Pacific/Yap":"FM",Poland:"PL",Portugal:"PT",PRC:"CN",ROC:"TW",ROK:"KR",Singapore:"SG",Turkey:"TR","US/Alaska":"US","US/Aleutian":"US","US/Arizona":"US","US/Central":"US","US/East-Indiana":"US","US/Eastern":"US","US/Hawaii":"US","US/Indiana-Starke":"US","US/Michigan":"US","US/Mountain":"US","US/Pacific":"US","US/Samoa":"AS","W-SU":"RU"}},1556(e,t){var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.EventChannel=t.EventType=void 0,function(e){e.PAGE="page",e.IDENTIFY="identify",e.DETECT="detect",e.CONNECT="connect",e.DISCONNECT="disconnect",e.CHAIN="chain",e.SIGNATURE="signature",e.TRANSACTION="transaction",e.TRACK="track"}(r||(t.EventType=r={})),function(e){e.WEB="web",e.MOBILE="mobile",e.SERVER="server",e.SOURCE="source"}(n||(t.EventChannel=n={}))},49(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(88),t),i(r(3787),t),i(r(1556),t)},5164(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isSolanaChainId=t.DEFAULT_SOLANA_CHAIN_ID=t.SOLANA_CHAIN_IDS=t.SolanaManager=t.parsePrivyProperties=t.formofy=void 0,i(r(8718),t),i(r(2657),t);var a=r(6271);Object.defineProperty(t,"formofy",{enumerable:!0,get:function(){return a.formofy}});var o=r(4328);Object.defineProperty(t,"parsePrivyProperties",{enumerable:!0,get:function(){return o.parsePrivyProperties}});var s=r(9308);Object.defineProperty(t,"SolanaManager",{enumerable:!0,get:function(){return s.SolanaManager}});var c=r(9308);Object.defineProperty(t,"SOLANA_CHAIN_IDS",{enumerable:!0,get:function(){return c.SOLANA_CHAIN_IDS}}),Object.defineProperty(t,"DEFAULT_SOLANA_CHAIN_ID",{enumerable:!0,get:function(){return c.DEFAULT_SOLANA_CHAIN_ID}}),Object.defineProperty(t,"isSolanaChainId",{enumerable:!0,get:function(){return c.isSolanaChainId}})},4416(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EventFactory=void 0;var c=r(49),u=r(9629),l=r(4657),d=r(8081),h=r(9879),f=r(3312),p=s(r(2817)),v=r(6517),g=r(5479),y=r(9165),m=r(6949),b=r(9293),A=r(6079),S=/^[A-Z]{2}$/,w=function(){function e(e){var t,r,i=this;this.extractUTMParameters=function(e){var t={utm_campaign:"",utm_content:"",utm_medium:"",utm_source:"",utm_term:""};try{new URL(e).searchParams.forEach(function(e,r){r.startsWith("utm_")&&(t[r]=e.trim())})}catch(e){}return t},this.extractClickIdParameters=function(e){for(var t={},r=0,n=y.CLICK_ID_PARAMS;r<n.length;r++){var i=n[r],a=e.searchParams.get(i);t[i]=a?a.trim():""}return t},this.extractReferralParameter=function(e){for(var t,r,n,a=0,o=(null===(t=i.options)||void 0===t?void 0:t.referral)&&null!==(r=i.options.referral.queryParams)&&void 0!==r?r:y.DEFAULT_REFERRAL_PARAMS;a<o.length;a++){var s=o[a],c=null===(n=e.searchParams.get(s))||void 0===n?void 0:n.trim();if(c)return c}if(i.compiledPathPattern){var u=e.pathname.match(i.compiledPathPattern);if(u&&u[1]){var l=u[1].trim();if(l)return l}}return""},this.getExternalReferrer=function(){var e,t=document.referrer;if(!t)return"";try{var r=null===(e=globalThis.location)||void 0===e?void 0:e.hostname;if(r&&new URL(t).hostname===r)return""}catch(e){}return i.redactUrl(t)},this.getTrafficSources=function(e){for(var t=new URL(e),r=(0,m.sanitizeTrafficSources)(n(n(n({},i.extractUTMParameters(e)),i.extractClickIdParameters(t)),{ref:i.extractReferralParameter(t),referrer:i.getExternalReferrer()})),a=(0,m.sanitizeTrafficSources)(i.redactStoredTrafficSources((0,v.session)().get(c.SESSION_TRAFFIC_SOURCE_KEY)||{})),o={},s=0,u=y.CLICK_ID_PARAMS;s<u.length;s++){var l=u[s];o[l]=r[l]||(null==a?void 0:a[l])||""}var d=n({ref:r.ref||(null==a?void 0:a.ref)||"",referrer:(null==a?void 0:a.referrer)||r.referrer||"",utm_campaign:r.utm_campaign||(null==a?void 0:a.utm_campaign)||"",utm_content:r.utm_content||(null==a?void 0:a.utm_content)||"",utm_medium:r.utm_medium||(null==a?void 0:a.utm_medium)||"",utm_source:r.utm_source||(null==a?void 0:a.utm_source)||"",utm_term:r.utm_term||(null==a?void 0:a.utm_term)||""},o),f=Object.keys(d).reduce(function(e,t){var r=d[t];return(0,h.isUndefined)(r)||""===r||(e[t]=r),e},{});return Object.keys(f).length&&(0,v.session)().set(c.SESSION_TRAFFIC_SOURCE_KEY,f),d},this.getPageProperties=function(e){var t=n({},e),r=null;try{r=new URL(globalThis.location.href),i.redactQueryParams(r),i.normalizeUrlPath(r)}catch(e){}(0,h.isUndefined)(t.url)&&(t.url=r?r.href:globalThis.location.href),(0,h.isUndefined)(t.path)&&(t.path=r?r.pathname:globalThis.location.pathname),(0,h.isUndefined)(t.hash)&&(t.hash=globalThis.location.hash),(0,h.isUndefined)(t.query)&&(t.query=r?r.search.slice(1):globalThis.location.search.slice(1));try{r&&r.searchParams.forEach(function(e,r){(0,h.isUndefined)(t[r])&&!y.PAGE_PROPERTIES_EXCLUDED_FIELDS.has(r)&&(t[r]=e)})}catch(e){f.logger.error("Error parsing query parameters for page properties:",e)}return t},this.options=e;var a=null==e?void 0:e.tracking,s="object"==typeof a&&null!==(t=a.excludeQueryParams)&&void 0!==t?t:[];if(this.excludedQueryParams=new Set(o(o([],y.DEFAULT_EXCLUDED_QUERY_PARAMS,!0),s,!0).map(function(e){return e.toLowerCase()})),null===(r=null==e?void 0:e.referral)||void 0===r?void 0:r.pathPattern)try{this.compiledPathPattern=new RegExp(e.referral.pathPattern)}catch(t){f.logger.warn("Invalid referral path pattern: ".concat(e.referral.pathPattern,". Error: ").concat(t))}}return e.prototype.validateEventAddress=function(e,t){return e&&(0,l.validateAddress)(e,t)||null},e.prototype.getTimezone=function(){return(0,u.getTimezone)()},e.prototype.getLocation=function(){try{var e=this.getTimezone();if(!e)return"";var t=c.COUNTRY_LIST[e];return"string"==typeof t&&S.test(t)?t:""}catch(e){return f.logger.error("Error resolving location:",e),""}},e.prototype.getLanguage=function(){try{return(navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language)||"en"}catch(e){return f.logger.error("Error resolving language:",e),"en"}},e.prototype.getLibraryVersion=function(){return g.version},e.prototype.isExcludedQueryParam=function(e){return this.excludedQueryParams.has(e.toLowerCase())},e.prototype.normalizeUrlPath=function(e){"/"!==e.pathname&&(e.pathname=e.pathname.replace(/\/+$/,""))},e.prototype.redactQueryParams=function(e){var t=this,r=new Set;e.searchParams.forEach(function(e,n){t.isExcludedQueryParam(n)&&r.add(n)}),r.forEach(function(t){return e.searchParams.delete(t)})},e.prototype.redactUrl=function(e){if(!e)return e;try{var t=new URL(e);return this.redactQueryParams(t),this.normalizeUrlPath(t),t.href}catch(t){return e}},e.prototype.redactStoredTrafficSources=function(e){for(var t={},r=0,n=Object.keys(e);r<n.length;r++){var i=n[r],a=e[i];"referrer"===i?t[i]=this.redactUrl(a||""):this.isExcludedQueryParam(i)?t[i]="":t[i]=a}return t},e.prototype.getScreen=function(){var e,t;try{return{screen_width:(null===(e=globalThis.screen)||void 0===e?void 0:e.width)||0,screen_height:(null===(t=globalThis.screen)||void 0===t?void 0:t.height)||0,screen_density:globalThis.devicePixelRatio||1,viewport_width:globalThis.innerWidth||0,viewport_height:globalThis.innerHeight||0}}catch(e){return f.logger.error("Error resolving screen properties:",e),{screen_width:0,screen_height:0,screen_density:1,viewport_width:0,viewport_height:0}}},e.prototype.generateContext=function(e){return i(this,void 0,void 0,function(){var t,r,i,o,s,c,u;return a(this,function(a){switch(a.label){case 0:return[4,(0,A.detectBrowser)()];case 1:return t=a.sent(),r=this.getLanguage(),i=this.getTimezone(),o=this.getLocation(),s=this.getLibraryVersion(),c=this.redactUrl(globalThis.location.href),u=n(n(n({user_agent:globalThis.navigator.userAgent,locale:r,timezone:i,location:o},this.getTrafficSources(c)),{page_title:document.title,page_url:c,library_name:"Formo Web SDK",library_version:s,browser:t}),this.getScreen()),[2,(0,p.default)(u,e||{})]}})})},e.prototype.getEnrichedEvent=function(e,t){return i(this,void 0,void 0,function(){var r,n,i,o,s,l,h;return a(this,function(a){switch(a.label){case 0:return s={},[4,this.generateContext(t)];case 1:return s.context=a.sent(),s.original_timestamp=(0,d.getCurrentTimeFormatted)(),s.user_id=e.user_id,s.type=e.type,s.channel=y.CHANNEL,s.version=y.VERSION,(r=s).anonymous_id=(0,b.generateAnonymousId)(c.LOCAL_ANONYMOUS_ID_KEY,null===(l=this.options)||void 0===l?void 0:l.crossSubdomainCookies),n=null===(h=e.properties)||void 0===h?void 0:h.chainId,i=this.validateEventAddress(e.address,n),r.address=i,void 0===(o=(0,p.default)(e,r)).event&&(o.event=null),void 0===o.properties&&(o.properties=null),[2,(0,u.toSnakeCase)(o)]}})})},e.prototype.generatePageEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i,s;return a(this,function(a){return(i=n({},null!=r?r:{})).category=e,i.name=t,i=this.getPageProperties(i),s={properties:i,type:"page"},[2,this.getEnrichedEvent(s,o)]})})},e.prototype.generateDetectWalletEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({providerName:e,rdns:t},r),type:"detect"},[2,this.getEnrichedEvent(i,o)]})})},e.prototype.generateIdentifyEvent=function(e,t,r,o,s,c){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n(n(n({},void 0!==e&&{providerName:e}),void 0!==t&&{rdns:t}),s),user_id:o,address:r,type:"identify"},[2,this.getEnrichedEvent(i,c)]})})},e.prototype.generateConnectEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({chainId:e},r),address:t,type:"connect"},[2,this.getEnrichedEvent(i,o)]})})},e.prototype.generateDisconnectEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({chainId:e},r),address:t,type:"disconnect"},[2,this.getEnrichedEvent(i,o)]})})},e.prototype.generateChainChangedEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({chainId:e},r),address:t,type:"chain"},[2,this.getEnrichedEvent(i,o)]})})},e.prototype.generateSignatureEvent=function(e,t,r,o,s,c){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({status:e,chainId:t,message:o},s),address:r,type:"signature"},[2,this.getEnrichedEvent(i,c)]})})},e.prototype.generateTransactionEvent=function(e,t,r,o,s,c,u,l,d,h,f){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n(n(n(n(n(n(n({status:e,chainId:t},o&&{data:o}),s&&{to:s}),c&&{value:c}),u&&{transactionHash:u}),l&&{function_name:l}),d&&{function_args:d}),h),address:r,type:"transaction"},[2,this.getEnrichedEvent(i,f)]})})},e.prototype.generateTrackEvent=function(e,t,r){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n(n(n(n({},t),void 0!==(null==t?void 0:t.revenue)&&{revenue:Number(t.revenue),currency:("string"==typeof(null==t?void 0:t.currency)?t.currency:"USD").toLowerCase()}),void 0!==(null==t?void 0:t.points)&&{points:Number(t.points)}),void 0!==(null==t?void 0:t.volume)&&{volume:Number(t.volume)}),event:e,type:"track"},[2,this.getEnrichedEvent(i,r)]})})},e.prototype.create=function(e,t,r){return i(this,void 0,void 0,function(){var n,i,o,s;return a(this,function(a){switch(a.label){case 0:switch(n={},e.type){case"page":return[3,1];case"detect":return[3,3];case"identify":return[3,5];case"chain":return[3,7];case"connect":return[3,9];case"disconnect":return[3,11];case"signature":return[3,13];case"transaction":return[3,15];case"track":return[3,17]}return[3,17];case 1:return[4,this.generatePageEvent(e.category,e.name,e.properties,e.context)];case 2:case 4:case 6:case 8:case 10:case 12:case 14:case 16:case 18:return n=a.sent(),[3,19];case 3:return[4,this.generateDetectWalletEvent(e.providerName,e.rdns,e.properties,e.context)];case 5:return[4,this.generateIdentifyEvent(e.providerName,e.rdns,e.address,e.userId,e.properties,e.context)];case 7:return[4,this.generateChainChangedEvent(e.chainId,e.address,e.properties,e.context)];case 9:return[4,this.generateConnectEvent(e.chainId,e.address,e.properties,e.context)];case 11:return[4,this.generateDisconnectEvent(e.chainId,e.address,e.properties,e.context)];case 13:return[4,this.generateSignatureEvent(e.status,e.chainId,e.address,e.message,e.properties,e.context)];case 15:return[4,this.generateTransactionEvent(e.status,e.chainId,e.address,e.data,e.to,e.value,e.transactionHash,e.function_name,e.function_args,e.properties,e.context)];case 17:return[4,this.generateTrackEvent(e.event,e.properties,e.context)];case 19:return void 0!==n.address&&null!==n.address||"identify"===e.type||(i="chainId"in e?e.chainId:void 0,n.address=this.validateEventAddress(t,i)),n.user_id="identify"===e.type?null!==(s=null!==(o=n.user_id)&&void 0!==o?o:r)&&void 0!==s?s:null:r||null,[2,n]}})})},e}();t.EventFactory=w},1457(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;var o=r(3312),s=r(4416),c=r(4657),u=function(){function e(e,t){this.eventQueue=e,this.eventFactory=new s.EventFactory(t)}return e.prototype.addEvent=function(e,t,r){return n(this,void 0,void 0,function(){var n,s,u;return i(this,function(i){switch(i.label){case 0:return n=e.callback,s=a(e,["callback"]),[4,this.eventFactory.create(s,t,r)];case 1:return(u=i.sent()).address&&(0,c.isBlockedAddress)(u.address)?(o.logger.warn("Event blocked: Address ".concat(u.address," is in the blocked list and cannot emit events")),[2]):(this.eventQueue.enqueue(u,function(e,t,r){e?o.logger.error("Error sending events:",e):o.logger.info("Events sent successfully: ".concat(r.length," events")),null==n||n(e,t,r)}),[2])}})})},e.prototype.clear=function(){this.eventQueue.clear()},e.prototype.close=function(){this.eventQueue.close()},e}();t.EventManager=u},9165(e,t){var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.PAGE_PROPERTIES_EXCLUDED_FIELDS=t.DEFAULT_REFERRAL_PARAMS=t.DEFAULT_EXCLUDED_QUERY_PARAMS=t.CLICK_ID_PARAMS=t.VERSION=t.CHANNEL=void 0,t.CHANNEL="web",t.VERSION="0";var n=["gclid","gad_source","fbclid","msclkid","twclid","li_fat_id","rdt_cid","ttclid"];t.CLICK_ID_PARAMS=n,t.DEFAULT_EXCLUDED_QUERY_PARAMS=["privy_oauth_code","privy_oauth_state","privy_oauth_provider"];var i=["ref","referral","refcode","af","referrer"];t.DEFAULT_REFERRAL_PARAMS=i;var a=new Set(r(r(r(["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],i,!0),n,!0),["category","name","url","path","hash","query"],!1));t.PAGE_PROPERTIES_EXCLUDED_FIELDS=a},4992(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4416),t),i(r(1457),t),i(r(8962),t)},6949(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeTrafficSources=t.sanitizeUtm=t.sanitizeRef=t.sanitizeClickId=void 0;var i=r(9165),a=/^[A-Za-z0-9._-]{1,255}$/,o=/^[A-Za-z0-9._-]{1,64}$/,s=/[<>"'`\\\u0000-\u001f\u007f-\u009f\u200b-\u200f\u2028-\u202e\u2060\ufeff\ufffd]/,c=/^\s*(javascript|data|vbscript):/i,u=function(e){return a.test(e)?e:""};t.sanitizeClickId=u;var l=function(e){return o.test(e)?e:""};t.sanitizeRef=l;var d=function(e){return e.length<=255&&!s.test(e)&&!c.test(e)?e:""};t.sanitizeUtm=d;var h=new Set(i.CLICK_ID_PARAMS);t.sanitizeTrafficSources=function(e){for(var t=n({},e),r=0,i=Object.keys(t);r<i.length;r++){var a=i[r],o=t[a];"string"==typeof o&&""!==o&&"referrer"!==a&&(h.has(a)?t[a]=u(o):t[a]="ref"===a?l(o):d(o))}return t}},8962(e,t){Object.defineProperty(t,"__esModule",{value:!0})},9293(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.generateAnonymousId=void 0;var i=r(9629),a=r(6517),o=r(2257);t.generateAnonymousId=function(e,t){var r=(0,a.cookie)().get(e),s=r&&"string"==typeof r?r:(0,i.generateNativeUUID)(),c=(0,o.getIdentityCookieDomain)(t);return(0,a.cookie)().set(e,s,n(n({expires:new Date(Date.now()+31536e6).toUTCString(),path:"/"},(0,o.getIdentityCookieSecurity)()),c?{domain:c}:{})),s}},5620(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EvmEventTracker=void 0;var s=r(9478),c=r(3312),u=r(7392),l=r(4657),d=r(6653);function h(e){var t,r=e.accounts;if(Array.isArray(r)&&r.length>0&&r.every(function(e){return"string"==typeof e}))return r;var n=e.session,i=null===(t=null==n?void 0:n.namespaces)||void 0===t?void 0:t.eip155,a=e.chainId,s="number"==typeof a?a:"string"==typeof a?(0,u.parseChainId)(a):void 0,c=s?"eip155:".concat(s,":"):void 0,l=[],d=[];if(Array.isArray(null==i?void 0:i.accounts))for(var h=0,f=i.accounts;h<f.length;h++){var p=f[h];if("string"==typeof p&&p.startsWith("eip155:")){var v=p.split(":")[2];if(v){var g=c&&p.startsWith(c)?l:d;g.includes(v)||g.push(v)}}}return o(o([],l,!0),d.filter(function(e){return!l.includes(e)}),!0)}var f=function(){function e(e,t,r){this.wallet=e,this.registry=t,this.deps=r,this.externallyRegistered=new Set,this.pendingAdoptions=new Set,this.awaitingNewSession=new Set,this.retryInFlight=!1,this.retryRequested=!1,this._announcedConnect=new WeakMap,this.disposed=!1,this.sessionGenerations=new WeakMap}return e.prototype.dropRefusal=function(e){this.latestRefused===e&&(this.latestRefused=void 0)},e.prototype.markRegisteredAdoptionsPending=function(){var e=this;this.externallyRegistered.forEach(function(t){return e.pendingAdoptions.add(t)})},e.prototype.noteRefusalIfSuppressed=function(e){if(this.deps.isTrackingSuppressed()&&this.externallyRegistered.has(e)){this.pendingAdoptions.add(e);var t=!1;try{t=h(e).length>0}catch(e){}t&&(this.latestRefused=e)}},e.prototype.settleAdoption=function(e){this.pendingAdoptions.delete(e),this.awaitingNewSession.delete(e),this.dropRefusal(e)},e.prototype.reopenAdoption=function(e){var t;this.externallyRegistered.has(e)&&(this.pendingAdoptions.add(e),this.awaitingNewSession.add(e),this.sessionGenerations.set(e,(null!==(t=this.sessionGenerations.get(e))&&void 0!==t?t:0)+1),this.dropRefusal(e))},e.prototype.cleanup=function(){var e;this.disposed=!0,this.pendingAdoptions.clear(),this.awaitingNewSession.clear(),this.latestRefused=void 0,this.retryRequested=!1;try{null===(e=this.unsubscribeDiscovery)||void 0===e||e.call(this)}catch(e){c.logger.warn("Failed to unsubscribe from provider discovery",e)}this.unsubscribeDiscovery=void 0},e.prototype.sessionGeneration=function(e){var t;return null!==(t=this.sessionGenerations.get(e))&&void 0!==t?t:0},e.prototype.forgetAnnouncedConnect=function(e){this._announcedConnect.delete(e)},e.prototype.isProviderMismatch=function(e){return null!=this.wallet.provider&&this.wallet.provider!==e},e.prototype.trackEIP1193Provider=function(e){if(c.logger.info("trackEIP1193Provider",e),this.deps.isWagmiMode())c.logger.debug("trackEIP1193Provider: Skipping EIP-1193 provider tracking (Wagmi mode - using connector system instead)");else try{if(!(0,d.isValidProvider)(e))return void c.logger.warn("trackEIP1193Provider: Invalid provider - missing required methods");if(this.registry.isTracked(e))return void c.logger.warn("trackEIP1193Provider: Provider already tracked");if(this.registerAccountsChangedListener(e),this.registerChainChangedListener(e),this.deps.isAutocaptureEnabled("connect")?this.registerConnectListener(e):this.registerConnectChainObserver(e),this.seedProviderChainFromState(e),!this.deps.registerRequestListeners(e))return void c.logger.warn("TrackProvider: Could not wrap provider; leaving it untracked");this.registerDisconnectListener(e),this.registry.markTracked(e)}catch(e){c.logger.error("Error tracking provider:",e)}},e.prototype.trackProviders=function(e){try{for(var t=0,r=e;t<r.length;t++){var n=r[t],i=null==n?void 0:n.provider;i&&!this.registry.isTracked(i)&&this.trackEIP1193Provider(i)}}catch(e){c.logger.error("Failed to track EIP-6963 providers during initialization:",e)}},e.prototype.adoptExternalProvider=function(e){var t=e.provider;if(this.externallyRegistered.add(t),this.registry.add(e),this.trackProviders([e]),!this.registry.isTracked(t))return this.externallyRegistered.delete(t),this.untrackProvider(t),c.logger.warn("adoptExternalProvider: provider could not be tracked"),!1;if(!this.deps.registerRequestListeners(t))return this.externallyRegistered.delete(t),this.untrackProvider(t),c.logger.warn("adoptExternalProvider: request wrapper could not be ensured"),!1;this.detectWallets([n(n({},e),{info:n(n({},e.info),this.registry.infoFor(t))})]),this.pendingAdoptions.add(t);var r=h(t);return r.length>0&&this.onAccountsChanged(t,r),!0},e.prototype.retryExternalAdoptions=function(){var e=this;this.externallyRegistered.forEach(function(t){var r=e.registry.infoFor(t);"com.walletconnect"===r.rdns&&e.detectWallets([{info:{name:r.name,rdns:r.rdns,uuid:"corrected-com-walletconnect",icon:d.DEFAULT_PROVIDER_ICON},provider:t}])}),this.disposed||0===this.pendingAdoptions.size||this.deps.isTrackingSuppressed()||(this.retryInFlight?this.retryRequested=!0:(this.retryInFlight=!0,i(e,void 0,void 0,function(){var e,t,r,n,i,s,c=this;return a(this,function(a){switch(a.label){case 0:a.trys.push([0,,9,10]),a.label=1;case 1:this.retryRequested=!1,e=[this.wallet.provider,this.latestRefused].filter(function(e){return!!e&&c.pendingAdoptions.has(e)}),t=Array.from(new Set(o(o([],e,!0),Array.from(this.pendingAdoptions),!0))),r=0,n=t,a.label=2;case 2:if(!(r<n.length))return[3,7];if(i=n[r],this.disposed||this.deps.isTrackingSuppressed())return[3,7];s=void 0;try{s=h(i)}catch(e){return[3,6]}if(0===s.length||this.awaitingNewSession.has(i))return[3,6];if(void 0!==this.wallet.provider&&this.wallet.provider!==i&&this.latestRefused!==i)return[3,6];a.label=3;case 3:return a.trys.push([3,5,,6]),[4,this.onAccountsChanged(i,s)];case 4:case 5:return a.sent(),[3,6];case 6:return r++,[3,2];case 7:if(this.retryRequested&&!this.disposed&&!this.deps.isTrackingSuppressed())return[3,1];a.label=8;case 8:return[3,10];case 9:return this.retryInFlight=!1,this.retryRequested=!1,[7];case 10:return[2]}})})))},e.prototype.registerAccountsChangedListener=function(e){var t=this;c.logger.info("registerAccountsChangedListener");var r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.onAccountsChanged(e,r[0])};e.on("accountsChanged",r),this.registry.addListener(e,"accountsChanged",r)},e.prototype.onAccountsChanged=function(e,t){return i(this,void 0,void 0,function(){var r,n;return a(this,function(i){switch(i.label){case 0:return this.disposed?[2]:(c.logger.info("onAccountsChanged",t),r=t.length>0||this.wallet.provider===e,n=r?this.wallet.observe("evm"):this.wallet.currentObservation("evm"),[4,this._handleAccountsChanged(e,t,n)]);case 1:return i.sent(),[2]}})})},e.prototype._handleAccountsChanged=function(e,t,r){return i(this,void 0,void 0,function(){var n,i,o,s,u,d,h,f,p,v,g;return a(this,function(a){switch(a.label){case 0:if(0!==t.length)return[3,9];if(this.reopenAdoption(e),this.wallet.provider!==e)return[3,7];if(c.logger.info("OnAccountsChanged: Detecting disconnect, current state:",{evmAddress:this.wallet.evmAddress,evmChainId:this.wallet.evmChainId,providerMatch:this.wallet.provider===e}),this._announcedConnect.delete(e),!this.deps.isAutocaptureEnabled("disconnect"))return[3,5];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})];case 2:return a.sent(),this.disposed?[2]:[3,4];case 3:return n=a.sent(),c.logger.error("Failed to disconnect provider on accountsChanged",n),[3,4];case 4:return[3,6];case 5:c.logger.debug("OnAccountsChanged: Disconnect event skipped (autocapture.disconnect: false)"),this.wallet.beginDisconnect("evm"),this.wallet.clear("evm"),a.label=6;case 6:return[3,8];case 7:c.logger.info("OnAccountsChanged: Ignoring disconnect for non-active provider"),a.label=8;case 8:return[2];case 9:if(!(i=(0,l.validateAndChecksumAddress)(t[0])))return c.logger.warn("onAccountsChanged: Invalid address received",t[0]),[2];if(this.awaitingNewSession.delete(e),this.noteRefusalIfSuppressed(e),o=this.sessionGeneration(e),!this.wallet.provider||this.wallet.provider===e)return[3,26];s=this.wallet.evmAddress,u=(0,l.validateAndChecksumAddress)(i),c.logger.info("OnAccountsChanged: Different provider attempting to connect",{activeProvider:this.registry.infoFor(this.wallet.provider).name,eventProvider:this.registry.infoFor(e).name,currentStoredAddress:s,newProviderAddress:u}),a.label=10;case 10:return a.trys.push([10,22,,26]),[4,this.registry.accountsOf(this.wallet.provider)];case 11:return d=a.sent(),this.disposed?[2]:this.sessionGeneration(e)!==o?(this.dropRefusal(e),[2]):this.wallet.isCurrent(r)?(c.logger.info("OnAccountsChanged: Checking current provider accounts",{activeProvider:this.registry.infoFor(this.wallet.provider).name,accountsLength:d?d.length:0,accounts:d}),d&&d.length>0?u&&s&&u!==s?(c.logger.info("OnAccountsChanged: Different address detected, switching providers despite current provider having accounts",{activeProvider:this.registry.infoFor(this.wallet.provider).name,eventProvider:this.registry.infoFor(e).name,currentAddress:s,newAddress:u,reason:"Address mismatch indicates wallet switch"}),this.deps.isAutocaptureEnabled("disconnect")?[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})]:[3,13]):[3,15]:[3,17]):(this.dropRefusal(e),[2]);case 12:return a.sent(),this.disposed?[2]:[3,14];case 13:c.logger.debug("OnAccountsChanged: Disconnect event skipped during provider switch (autocapture.disconnect: false)"),this.wallet.clear("evm"),a.label=14;case 14:return this.wallet.isCurrent(r)?(this.wallet.clearProvider(),[3,16]):(this.dropRefusal(e),[2]);case 15:return this.deps.isTrackingSuppressed()||this.dropRefusal(e),c.logger.info("OnAccountsChanged: Current provider still has accounts and same address, ignoring new provider",{activeProvider:this.registry.infoFor(this.wallet.provider).name,eventProvider:this.registry.infoFor(e).name,activeProviderAccountsCount:d.length,currentAddress:s,newAddress:u}),[2];case 16:return[3,21];case 17:return c.logger.info("OnAccountsChanged: Current provider has no accounts, switching to new provider",{oldProvider:this.registry.infoFor(this.wallet.provider).name,newProvider:this.registry.infoFor(e).name,reason:"Current provider has no accounts"}),this.deps.isAutocaptureEnabled("disconnect")?[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})]:[3,19];case 18:return a.sent(),this.disposed?[2]:[3,20];case 19:c.logger.debug("OnAccountsChanged: Disconnect event skipped for old provider (autocapture.disconnect: false)"),this.wallet.clear("evm"),a.label=20;case 20:if(!this.wallet.isCurrent(r))return this.dropRefusal(e),[2];a.label=21;case 21:return[3,26];case 22:return h=a.sent(),c.logger.warn("OnAccountsChanged: Could not check current provider accounts, switching to new provider",{error:h instanceof Error?h.message:String(h),errorType:h instanceof Error?h.constructor.name:typeof h,oldProvider:this.wallet.provider?this.registry.infoFor(this.wallet.provider).name:"unknown",newProvider:this.registry.infoFor(e).name,reason:"Could not check current provider accounts"}),this.deps.isAutocaptureEnabled("disconnect")?[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})]:[3,24];case 23:return a.sent(),this.disposed?[2]:[3,25];case 24:c.logger.debug("OnAccountsChanged: Disconnect event skipped for failed provider check (autocapture.disconnect: false)"),this.wallet.clear("evm"),a.label=25;case 25:return this.wallet.isCurrent(r)?[3,26]:(this.dropRefusal(e),[2]);case 26:return this.wallet.provider||(this.wallet.provider=e),this.wallet.provider===e&&i===this.wallet.evmAddress?(this.settleAdoption(e),[2]):(f=this.registry.resolveChainId(e),p=!this.wallet.evmAddress,this.deps.isTrackingSuppressed()?(this.wallet.clearStaleEvmWalletOnSwitchWhileSuppressed(i),this.noteRefusalIfSuppressed(e)):(this.wallet.set("evm",{address:i,chainId:f}),this.settleAdoption(e)),v=this.registry.infoFor(e),g=f||0,this.deps.isAutocaptureEnabled("connect")&&this.shouldReportConnect(e,i)?(c.logger.info("OnAccountsChanged: Detected wallet connection, emitting connect event",{chainId:f,address:i,wasDisconnected:p,providerName:v.name,rdns:v.rdns,hasChainId:!!f}),0===g&&c.logger.info("OnAccountsChanged: Using fallback chainId 0 for connect event"),this.markConnectReported(e,i,g),this.deps.connect({chainId:g,address:i},{providerName:v.name,rdns:v.rdns}).catch(function(e){c.logger.error("Failed to track connect event during account change:",e)})):c.logger.debug("OnAccountsChanged: Connect event skipped (autocapture.connect: false)",{chainId:f,address:i,providerName:v.name}),[2])}})})},e.prototype.registerChainChangedListener=function(e){var t=this;c.logger.info("registerChainChangedListener");var r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.onChainChanged(e,r[0])};e.on("chainChanged",r),this.registry.addListener(e,"chainChanged",r)},e.prototype.onChainChanged=function(e,t){return i(this,void 0,void 0,function(){var r,n;return a(this,function(i){switch(i.label){case 0:if(this.disposed)return[2];if(c.logger.info("onChainChanged",t),r=(0,u.parseChainId)(t),this.registry.rememberChain(e,r),!this.deps.isAutocaptureEnabled("chain")&&e!==this.wallet.provider)return[2];if(this.isProviderMismatch(e)){if("solana"===this.wallet.activeNamespace)return[2];this.handleProviderMismatch(e)}if(!this.wallet.evmAddress)return c.logger.info("OnChainChanged: No current address, user appears disconnected"),[2,Promise.resolve()];this.wallet.provider||(this.wallet.provider=e),this.wallet.set("evm",{chainId:r}),i.label=1;case 1:return i.trys.push([1,5,,6]),this.deps.isAutocaptureEnabled("chain")?[4,this.deps.chain({chainId:r,address:this.wallet.evmAddress})]:[3,3];case 2:return i.sent(),[3,4];case 3:c.logger.debug("OnChainChanged: Chain event skipped (autocapture.chain: false)",{chainId:this.wallet.evmChainId,address:this.wallet.evmAddress}),i.label=4;case 4:return[3,6];case 5:return n=i.sent(),c.logger.error("OnChainChanged: Failed to emit chain event:",n),[3,6];case 6:return[2]}})})},e.prototype.registerConnectChainObserver=function(e){var t=this,r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r[0];t.disposed||"string"==typeof(null==i?void 0:i.chainId)&&(t.registry.rememberChain(e,(0,u.parseChainId)(i.chainId)),t.awaitingNewSession.delete(e),t.noteRefusalIfSuppressed(e))};e.on("connect",r),this.registry.addListener(e,"connect",r)},e.prototype.shouldReportConnect=function(e,t){var r=this._announcedConnect.get(e);return!r||r.address.toLowerCase()!==t.toLowerCase()},e.prototype.markConnectReported=function(e,t,r){this.deps.willTrackEvent(r)&&this._announcedConnect.set(e,{address:t,chainId:r})},e.prototype.registerConnectListener=function(e){var t=this;c.logger.info("registerConnectListener");var r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r[0];t.onConnected(e,i)};e.on("connect",r),this.registry.addListener(e,"connect",r)},e.prototype.registerDisconnectListener=function(e){var t=this;c.logger.info("registerDisconnectListener");var r=function(r){return i(t,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:if(this.disposed)return[2];if(this.reopenAdoption(e),this.wallet.provider!==e)return[2];if(this._announcedConnect.delete(e),c.logger.info("OnDisconnect: Wallet disconnect event received, current state:",{currentAddress:this.wallet.evmAddress,currentChainId:this.wallet.evmChainId}),!this.deps.isAutocaptureEnabled("disconnect"))return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})];case 2:return r.sent(),this.disposed?[2]:[3,4];case 3:return t=r.sent(),c.logger.error("Error during disconnect in disconnect listener",t),[3,4];case 4:return[3,6];case 5:c.logger.debug("OnDisconnect: Disconnect event skipped (autocapture.disconnect: false)"),this.wallet.beginDisconnect("evm"),this.wallet.clear("evm"),r.label=6;case 6:return[2]}})})};e.on("disconnect",r),this.registry.addListener(e,"disconnect",r)},e.prototype.onConnected=function(e,t){return i(this,void 0,void 0,function(){var r,n,i,o,s,d,h,f,p,v,g,y;return a(this,function(a){switch(a.label){case 0:if(this.disposed)return[2];c.logger.info("onConnected",t),this.awaitingNewSession.delete(e),this.noteRefusalIfSuppressed(e),r=this.wallet.disconnectsSoFar("evm"),n=this.wallet.currentObservation("evm"),a.label=1;case 1:return a.trys.push([1,3,,4]),(null==t?void 0:t.chainId)&&"string"==typeof t.chainId?(i=(0,u.parseChainId)(t.chainId),this.registry.rememberChain(e,i),o=this.sessionGeneration(e),[4,this.registry.addressOf(e)]):[2];case 2:return s=a.sent(),this.disposed?[2]:this.sessionGeneration(e)!==o?(this.dropRefusal(e),[2]):this.wallet.disconnectsSoFar("evm")!==r?(c.logger.info("onConnected: The wallet disconnected after this observation began; dropping it"),this.dropRefusal(e),[2]):(d=this.wallet.evmAddress,h=!!d&&!!s&&d.toLowerCase()!==s.toLowerCase(),e===this.wallet.provider&&!this.wallet.isCurrent(n)&&h?(c.logger.info("onConnected: A newer signal from this provider has overtaken this connect observation; dropping it"),this.dropRefusal(e),[2]):(i&&s&&(f=!this.wallet.evmAddress,this.noteRefusalIfSuppressed(e),this.wallet.provider||(this.wallet.provider=e),(p=this.wallet.provider===e)&&(this.deps.isTrackingSuppressed()?(this.wallet.clearStaleEvmWalletOnSwitchWhileSuppressed(s),this.noteRefusalIfSuppressed(e)):(this.wallet.set("evm",{chainId:i,address:(0,l.validateAndChecksumAddress)(s)||void 0}),this.settleAdoption(e))),p&&this.wallet.evmAddress&&this.shouldReportConnect(e,s)?(g=this.registry.infoFor(e),v=i||0,this.deps.isAutocaptureEnabled("connect")?(c.logger.info("OnConnected: Detected wallet connection, emitting connect event",{chainId:i,wasDisconnected:f,providerName:g.name,rdns:g.rdns,hasChainId:!!i,isActiveProvider:p}),0===v&&c.logger.info("OnConnected: Using fallback chainId 0 for connect event"),this.markConnectReported(e,s,v),this.deps.connect({chainId:v,address:s},{providerName:g.name,rdns:g.rdns}).catch(function(e){c.logger.error("Failed to track connect event during provider connection:",e)})):c.logger.debug("OnConnected: Connect event skipped (autocapture.connect: false)",{chainId:i,address:s,providerName:g.name})):s&&!p&&(g=this.registry.infoFor(e),c.logger.debug("OnConnected: Skipping connect event for non-active provider",{chainId:i,providerName:g.name,rdns:g.rdns,isActiveProvider:p,activeProviderInfo:this.wallet.provider?this.registry.infoFor(this.wallet.provider):null}))),[3,4]));case 3:return y=a.sent(),c.logger.error("Error handling connect event",y),[3,4];case 4:return[2]}})})},e.prototype.getProviders=function(){return i(this,void 0,void 0,function(){var e,t,r,n,o,u,l,h,f,p=this;return a(this,function(v){if(e=(0,s.createStore)(),t=e.getProviders(),this.unsubscribeDiscovery=e.subscribe(function(e){t=e;for(var r=e.filter(function(e){var t=null==e?void 0:e.provider;return t&&!p.registry.isSeen(t)}),n=0,o=r;n<o.length;n++){var s=o[n];p.registry.add(s)}var u=e.filter(function(e){var t=null==e?void 0:e.provider;return!!t&&!p.registry.isTracked(t)});u.length>0&&(p.trackProviders(u),i(p,void 0,void 0,function(){var e;return a(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.detectWallets(u)];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),c.logger.error("Formo: Failed to detect wallets",e),[3,3];case 3:return[2]}})})),p.cleanupUnavailableProviders(e)}),0===t.length){if(r="undefined"!=typeof window?window.ethereum:void 0){if(this.registry.injected&&this.registry.injected.provider===r)return this.registry.isTracked(r)||this.trackEIP1193Provider(r),this.registry.add(this.registry.injected),[2,this.registry.all];this.registry.isTracked(r)||this.trackEIP1193Provider(r),n=(0,d.detectInjectedProviderInfo)(r),o={provider:r,info:n},this.registry.injected=o,this.registry.add(o)}return[2,this.registry.all]}for(u=t.filter(function(e){var t=null==e?void 0:e.provider;return t&&!p.registry.isSeen(t)}),l=0,h=u;l<h.length;l++)f=h[l],this.registry.add(f);return[2,this.registry.all]})})},e.prototype.detectWallets=function(e){return i(this,void 0,void 0,function(){var t,r,n,i;return a(this,function(a){switch(a.label){case 0:a.trys.push([0,5,,6]),t=0,r=e,a.label=1;case 1:return t<r.length?(n=r[t],[4,this.deps.detect({providerName:null==n?void 0:n.info.name,rdns:null==n?void 0:n.info.rdns})]):[3,4];case 2:a.sent(),a.label=3;case 3:return t++,[3,1];case 4:return[3,6];case 5:return i=a.sent(),c.logger.error("Error detect all wallets:",i),[3,6];case 6:return[2]}})})},e.prototype.seedProviderChainFromState=function(e){var t=e.chainId,r="string"==typeof t?(0,u.parseChainId)(t):"number"==typeof t?t:void 0;this.registry.rememberChain(e,r)},e.prototype.untrackProvider=function(e){this.settleAdoption(e);try{this.registry.removeListeners(e),0===this.registry.attachedEvents(e).length&&this.registry.forgetTracked(e),this.wallet.provider===e&&this.wallet.clearProvider()}catch(e){c.logger.warn("Failed to untrack provider",e)}},e.prototype.cleanupUnavailableProviders=function(e){for(var t=new Set(e.map(function(e){return e.provider})),r=0,n=this.registry.trackedProviders();r<n.length;r++){var i=n[r];this.externallyRegistered.has(i)||t.has(i)||(c.logger.info("Cleaning up unavailable provider: ".concat(i.constructor.name)),this.untrackProvider(i))}},e.prototype.handleProviderMismatch=function(e){this.wallet.provider?this.wallet.set("evm",{address:void 0,chainId:void 0,provider:e}):this.wallet.provider=e},e}();t.EvmEventTracker=f},2598(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EvmProviderRegistry=void 0;var o=r(3312),s=r(4657),c=r(6653),u=r(2657),l=function(){function e(e){this.deps=e,this.details=[],this.tracked=new Set,this.seen=new Set,this.chainIds=new WeakMap,this.chainGenerations=new WeakMap,this.listeners=new Map,this.attributions=new WeakMap}return Object.defineProperty(e.prototype,"all",{get:function(){return this.details},enumerable:!1,configurable:!0}),e.prototype.isTracked=function(e){return this.tracked.has(e)},e.prototype.markTracked=function(e){this.tracked.add(e)},e.prototype.forgetTracked=function(e){this.tracked.delete(e)},e.prototype.trackedProviders=function(){return Array.from(this.tracked)},e.prototype.isSeen=function(e){return this.seen.has(e)},Object.defineProperty(e.prototype,"injected",{get:function(){return this.injectedDetail},set:function(e){this.injectedDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"counts",{get:function(){return{totalProviders:this.details.length,trackedProviders:this.tracked.size,seenProviders:this.seen.size}},enumerable:!1,configurable:!0}),e.prototype.add=function(e){var t=null==e?void 0:e.provider;return!!t&&!this.details.some(function(e){return e.provider===t})&&(this.details=a(a([],this.details,!0),[e],!1),this.seen.add(t),!0)},e.prototype.rememberAttribution=function(e,t){e&&(t?this.attributions.set(e,t):this.attributions.delete(e))},e.prototype.suppliedAttributionFor=function(e){var t=this.attributions.get(e);if(t)try{var r=t();return(null==r?void 0:r.name)?r:void 0}catch(e){return}},e.prototype.infoFor=function(e){var t,r,n=this.details.find(function(t){return t.provider===e}),i=n?void 0:this.suppliedAttributionFor(e),a=n?{name:n.info.name,rdns:n.info.rdns}:(r=(0,c.detectInjectedProviderInfo)(e),i?{name:i.name,rdns:null!==(t=i.rdns)&&void 0!==t?t:r.rdns}:{name:r.name,rdns:r.rdns});if("WalletConnect"===a.name||"Injected Provider"===a.name){var o=(0,c.readWalletConnectPeer)(e);if(null==o?void 0:o.name)return{name:o.name,rdns:"io.injected.provider"===a.rdns?"com.walletconnect":a.rdns}}return a},e.prototype.addListener=function(e,t,r){var n=this.listeners.get(e)||{};n[t]=r,this.listeners.set(e,n)},e.prototype.removeListeners=function(e){var t=this.listeners.get(e);if(t){for(var r={},n=0,i=Object.entries(t);n<i.length;n++){var a=i[n],s=a[0],c=a[1];try{e.removeListener(s,c)}catch(e){o.logger.warn("Failed to remove listener for ".concat(String(s)),e),r[s]=c}}Object.keys(r).length>0?this.listeners.set(e,r):this.listeners.delete(e)}},e.prototype.attachedEvents=function(e){var t;return Object.keys(null!==(t=this.listeners.get(e))&&void 0!==t?t:{})},e.prototype.isWrapped=function(e,t){return!(!t||"function"!=typeof t||!t[u.WRAPPED_REQUEST_SYMBOL]||e[u.WRAPPED_REQUEST_REF_SYMBOL]!==t)},e.prototype.chainIdOf=function(e){return this.chainIds.get(e)},e.prototype.bumpChainGeneration=function(e){var t,r=(null!==(t=this.chainGenerations.get(e))&&void 0!==t?t:0)+1;return this.chainGenerations.set(e,r),r},e.prototype.chainGeneration=function(e){var t;return null!==(t=this.chainGenerations.get(e))&&void 0!==t?t:0},e.prototype.rememberChain=function(e,t){e&&t&&(this.bumpChainGeneration(e),this.chainIds.set(e,t),this.deps.onChainObserved(e,t))},e.prototype.resolveChainId=function(e){if(e){var t=this.chainIds.get(e);if(t)return t;var r=this.deps.activeChainId();return e===this.deps.activeProvider()&&r?r:0}return this.deps.activeChainId()||0},e.prototype.addressOf=function(e){return n(this,void 0,void 0,function(){var t,r,n,a;return i(this,function(i){switch(i.label){case 0:return t=this.deps.activeProvider(),r=e||t,e&&e!==t||!(n=this.deps.knownEvmAddress())?r?[4,this.accountsOf(r)]:(o.logger.info("The provider is not set"),[2,null]):[2,n];case 1:return(a=i.sent())&&a.length>0?[2,(0,s.validateAndChecksumAddress)(a[0])||null]:[2,null]}})})},e.prototype.accountsOf=function(e){return n(this,void 0,void 0,function(){var t,r,n;return i(this,function(i){switch(i.label){case 0:t=e||this.deps.activeProvider(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,null==t?void 0:t.request({method:"eth_accounts"})];case 2:return(r=i.sent())&&0!==r.length?[2,r.map(function(e){return(0,s.validateAndChecksumAddress)(e)}).filter(function(e){return void 0!==e})]:[2,null];case 3:return 4001!==(null==(n=i.sent())?void 0:n.code)&&o.logger.error("EvmProviderRegistry::accountsOf: eth_accounts threw an error",n),[2,null];case 4:return[2]}})})},e}();t.EvmProviderRegistry=l},7295(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EvmRequestTracker=void 0;var c=r(3312),u=r(6653),l=r(7392),d=r(4657),h=r(2657),f=r(8694);function p(e){var t="string"==typeof e&&e.startsWith("0x")?e.slice(2):e;if("string"!=typeof t||0===t.length)return"";for(var r=Math.floor(t.length/2),n=new Uint8Array(r),i=0;i<r;i++){var a=Number.parseInt(t.substring(2*i,2*i+2),16);if(Number.isNaN(a))return(new TextDecoder).decode(n.subarray(0,i));n[i]=a}return(new TextDecoder).decode(n)}var v=new WeakSet,g=function(){function e(t,r,n){this.wallet=t,this.registry=r,this.deps=n,this.polls=new Set,this.disposed=!1,this.wrappedProviders=new Set,this.creationSeq=e.nextCreationSeq++}return e.prototype.cleanup=function(){var e=this;this.disposed=!0,this.polls.forEach(function(e){return clearTimeout(e)}),this.polls.clear(),this.wrappedProviders.forEach(function(t){var r=t[h.WRAPPED_REQUEST_OWNER_SYMBOL];if(Array.isArray(r)){var n=r.indexOf(e);-1!==n&&r.splice(n,1)}}),this.wrappedProviders.clear()},e.prototype.schedulePoll=function(e,t){var r=this;if(!this.disposed){var n=setTimeout(function(){r.polls.delete(n),e()},t);this.polls.add(n)}},e.prototype.insertBySeniority=function(e){var t=this,r=e.indexOf(this);-1!==r&&e.splice(r,1);var n=e.findIndex(function(e){return e.creationSeq>t.creationSeq});-1===n?e.push(this):e.splice(n,0,this)},e.prototype.registerRequestListeners=function(e){var t=this;if(c.logger.info("registerRequestListeners"),!e)return c.logger.error("Provider not found for request (signature, transaction) tracking"),!1;var r=e.request;if(this.registry.isWrapped(e,r)){var n=e[h.WRAPPED_REQUEST_OWNER_SYMBOL];return Array.isArray(n)?(this.insertBySeniority(n),this.wrappedProviders.add(e),c.logger.info("Provider already wrapped; rebinding the wrapper to this instance."),!0):(c.logger.warn("wrapped without owner list; cannot rebind"),!1)}var o=e.request.bind(e);try{var u=e,l=u[h.WRAPPED_REQUEST_OWNER_SYMBOL];n=Array.isArray(l)?l:[],this.insertBySeniority(n),Array.isArray(l)||(u[h.WRAPPED_REQUEST_OWNER_SYMBOL]=n),this.wrappedProviders.add(e)}catch(e){}return this.installWrappedRequest(e,function(r){return i(t,[r],void 0,function(t){var r,n,i=t.method,c=t.params;return a(this,function(t){if(r=e[h.WRAPPED_REQUEST_OWNER_SYMBOL],v.has(e))return[2,o({method:i,params:c})];n=Array.isArray(r)?s([],r,!0).reverse().find(function(e){return!e.disposed}):void 0,v.add(e);try{return[2,(null!=n?n:this).dispatchWrappedRequest({method:i,params:c},e,o)]}finally{v.delete(e)}})})})},e.prototype.installWrappedRequest=function(e,t){t[h.WRAPPED_REQUEST_SYMBOL]=!0;try{return e[h.WRAPPED_REQUEST_REF_SYMBOL]=t,e.request=t,e.request===t||(c.logger.warn("request assignment swallowed; not wrapped"),!1)}catch(e){return c.logger.warn("Failed to wrap provider.request; skipping",e),!1}},e.prototype.dispatchWrappedRequest=function(e,t,r){return i(this,arguments,void 0,function(e,t,r){var o,s,d,f,p,v,g,y,m,b,A,S,w,E,_,C,I=this,k=e.method,P=e.params;return a(this,function(e){switch(e.label){case 0:if("eth_chainId"===k)return o=this.registry.chainGeneration(t),[2,r({method:k,params:P}).then(function(e){return o===I.registry.chainGeneration(t)&&"string"==typeof e&&I.registry.rememberChain(t,(0,l.parseChainId)(e)),e})];if(!Array.isArray(P)||!["eth_signTypedData_v4","personal_sign"].includes(k))return[3,4];if(!this.deps.isAutocaptureEnabled("signature"))return c.logger.debug("Signature event skipped (autocapture.signature: false)",{method:k}),[2,r({method:k,params:P})];if(null===(E=(w=this.deps).shouldSkipRequestCapture)||void 0===E?void 0:E.call(w,k,P))return[2,r({method:k,params:P})];(s=r({method:k,params:P})).catch(function(){}),d=this.registry.resolveChainId(t),f=this.attributionFor(t),i(I,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.deps.signature(n({status:h.SignatureStatus.REQUESTED},this.buildSignatureEventPayload(k,P,void 0,d,t)),f)];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),c.logger.error("Formo: Failed to track signature request",e),[3,3];case 3:return[2]}})}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s];case 2:return(p=e.sent())&&i(I,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.deps.signature(n({status:h.SignatureStatus.CONFIRMED},this.buildSignatureEventPayload(k,P,p,d,t)),f)];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),c.logger.error("Formo: Failed to track signature confirmation",e),[3,3];case 3:return[2]}})}),[2,p];case 3:throw v=e.sent(),S=v,(0,u.isUserRejectionError)(S)&&i(I,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.deps.signature(n({status:h.SignatureStatus.REJECTED},this.buildSignatureEventPayload(k,P,void 0,d,t)),f)];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),c.logger.error("Formo: Failed to track signature rejection",e),[3,3];case 3:return[2]}})}),v;case 4:if("wallet_sendCalls"===k&&Array.isArray(P)&&P[0])return[2,this.trackBatchedCalls(t,r,P)];if(!Array.isArray(P)||"eth_sendTransaction"!==k||!P[0])return[3,8];if(!this.deps.isAutocaptureEnabled("transaction"))return c.logger.debug("Transaction event skipped (autocapture.transaction: false)",{method:k}),[2,r({method:k,params:P})];if(null===(C=(_=this.deps).shouldSkipRequestCapture)||void 0===C?void 0:C.call(_,k,P))return[2,r({method:k,params:P})];(g=r({method:k,params:P})).catch(function(){}),y=this.registry.resolveChainId(t),m=this.attributionFor(t),i(I,void 0,void 0,function(){var e,r;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.buildTransactionEventPayload(P,t,y)];case 1:return e=i.sent(),[4,this.deps.transaction(n({status:h.TransactionStatus.STARTED},e),m)];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),c.logger.error("Formo: Failed to track transaction start",r),[3,4];case 4:return[2]}})}),e.label=5;case 5:return e.trys.push([5,7,,8]),[4,g];case 6:return b=e.sent(),i(I,void 0,void 0,function(){var e,r;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.buildTransactionEventPayload(P,t,y)];case 1:return e=i.sent(),[4,this.deps.transaction(n(n({status:h.TransactionStatus.BROADCASTED},e),{transactionHash:b}),m)];case 2:return i.sent(),this.pollTransactionReceipt(t,b,e,m),[3,4];case 3:return r=i.sent(),c.logger.error("Formo: Failed to track transaction broadcast",r),[3,4];case 4:return[2]}})}),[2,b];case 7:throw A=e.sent(),S=A,(0,u.isUserRejectionError)(S)&&i(I,void 0,void 0,function(){var e,r;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.buildTransactionEventPayload(P,t,y)];case 1:return e=i.sent(),[4,this.deps.transaction(n({status:h.TransactionStatus.REJECTED},e),m)];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),c.logger.error("Formo: Failed to track transaction rejection",r),[3,4];case 4:return[2]}})}),A;case 8:return[2,r({method:k,params:P})]}})})},e.prototype.attributionFor=function(e){var t=this.registry.infoFor(e);return{providerName:t.name,rdns:t.rdns}},e.prototype.buildSignatureEventPayload=function(e,t,r,i,a){var o,s="personal_sign"===e?t[1]:t[0],c=(0,d.validateAndChecksumAddress)(s);if(!c)throw new Error("Invalid address in signature payload: ".concat(s));var u=null!==(o=null!=i?i:this.wallet.evmChainId)&&void 0!==o?o:void 0;return a&&a!==this.wallet.provider&&this.wallet.provider||this.wallet.backfill(c,u,a),n(n({},{chainId:u,address:c}),"personal_sign"===e?{message:p(t[0])}:{message:t[1]})},e.prototype.buildTransactionEventPayload=function(e,t,r){return i(this,void 0,void 0,function(){var n,i,o,s,c,u,l;return a(this,function(a){if(n=e[0],i=n.data,o=n.from,s=n.to,c=n.value,!(u=(0,d.validateAndChecksumAddress)(o)))throw new Error("Invalid address in transaction payload: ".concat(o));return l=null!=r?r:this.registry.resolveChainId(t),t&&t!==this.wallet.provider&&this.wallet.provider||this.wallet.backfill(u,l,t),[2,{chainId:l,data:i,address:u,to:s,value:c}]})})},e.prototype.pollTransactionReceipt=function(e,t,r,o){return i(this,arguments,void 0,function(e,t,r,o,s,u){var l,d,f=this;return void 0===s&&(s=10),void 0===u&&(u=3e3),a(this,function(p){return l=0,e?(d=function(){return i(f,void 0,void 0,function(){var i,f;return a(this,function(a){switch(a.label){case 0:if(this.disposed)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.request({method:"eth_getTransactionReceipt",params:[t]})];case 2:if(i=a.sent()){if("0x1"===i.status||1===i.status)return this.deps.transaction(n(n({status:h.TransactionStatus.CONFIRMED},r),{transactionHash:t}),o).catch(function(e){return c.logger.error("Formo: Failed to track transaction confirmation",e)}),[2];if("0x0"===i.status||0===i.status)return this.deps.transaction(n(n({status:h.TransactionStatus.REVERTED},r),{transactionHash:t}),o).catch(function(e){return c.logger.error("Formo: Failed to track transaction revert",e)}),[2]}return[3,4];case 3:return f=a.sent(),c.logger.error("Error polling transaction receipt",f),[3,4];case 4:return++l<s&&this.schedulePoll(d,u),[2]}})})},d(),[2]):[2]})})},e.prototype.trackBatchedCalls=function(e,t,r){return i(this,void 0,void 0,function(){var i,s,p,v,g,y,m,b,A,S,w,E,_,C,I,k,P,O,T,x,R,L,H,M;return a(this,function(a){switch(a.label){case 0:if(!this.deps.isAutocaptureEnabled("transaction"))return c.logger.debug("Transaction event skipped (autocapture.transaction: false)",{method:"wallet_sendCalls"}),[2,t({method:"wallet_sendCalls",params:r})];if(null===(H=(L=this.deps).shouldSkipRequestCapture)||void 0===H?void 0:H.call(L,"wallet_sendCalls",r))return[2,t({method:"wallet_sendCalls",params:r})];if((i=t({method:"wallet_sendCalls",params:r})).catch(function(){}),s=r[0],p=Array.isArray(null==s?void 0:s.calls)?s.calls:[],v="string"==typeof(null==s?void 0:s.chainId)?(0,l.parseChainId)(s.chainId):void 0,g=v||this.registry.resolveChainId(e),!(y=(0,d.validateAndChecksumAddress)(null!==(M=null==s?void 0:s.from)&&void 0!==M?M:"")))return c.logger.warn("Formo: wallet_sendCalls has no valid `from`; not tracking",{from:null==s?void 0:s.from}),[2,i];if(0===p.length)return c.logger.debug("Formo: wallet_sendCalls carried no calls"),[2,i];for(e&&e!==this.wallet.provider&&this.wallet.provider||this.wallet.backfill(y,g,e),m=this.attributionFor(e),b=p.map(function(e,t){return{chainId:g,address:y,to:null==e?void 0:e.to,value:null==e?void 0:e.value,data:null==e?void 0:e.data,properties:n({batch_size:p.length,batch_index:t},m)}}),A=0,S=b;A<S.length;A++)T=S[A],x=T.properties,R=o(T,["properties"]),this.deps.transaction(n({status:h.TransactionStatus.STARTED},R),x).catch(function(e){return c.logger.error("Formo: Failed to track batch call start",e)});a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i];case 2:for(w=a.sent(),E=(0,f.readBatchId)(w),_=0,C=b;_<C.length;_++)T=C[_],x=T.properties,R=o(T,["properties"]),this.deps.transaction(n({status:h.TransactionStatus.BROADCASTED},R),n(n({},x),E?{batch_id:E}:{})).catch(function(e){return c.logger.error("Formo: Failed to track batch call broadcast",e)});return E&&this.pollBatchStatus(e,E,b),[2,w];case 3:if(I=a.sent(),k=I,(0,u.isUserRejectionError)(k))for(P=0,O=b;P<O.length;P++)T=O[P],x=T.properties,R=o(T,["properties"]),this.deps.transaction(n({status:h.TransactionStatus.REJECTED},R),x).catch(function(e){return c.logger.error("Formo: Failed to track batch call rejection",e)});throw I;case 4:return[2]}})})},e.prototype.pollBatchStatus=function(e,t,r){return i(this,arguments,void 0,function(e,t,r,s,u){var l,d,h=this;return void 0===s&&(s=10),void 0===u&&(u=3e3),a(this,function(p){return e?(l=0,d=function(){return i(h,void 0,void 0,function(){var i,h,p,v=this;return a(this,function(a){switch(a.label){case 0:if(this.disposed)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.request({method:"wallet_getCallsStatus",params:[t]})];case 2:return i=a.sent(),void 0!==(h=(0,f.readBatchStatusCode)(i))&&h>=200?(r.forEach(function(e,a){var s=(0,f.batchReceiptForCall)(i,a,r.length),u=(0,f.batchCallOutcome)(h,s);if(void 0!==u){var l=e.properties,d=o(e,["properties"]);v.deps.transaction(n(n({status:u},d),(null==s?void 0:s.transactionHash)?{transactionHash:s.transactionHash}:{}),n(n({},l),{batch_id:t})).catch(function(e){return c.logger.error("Formo: Failed to track batch call outcome",e)})}}),[2]):[3,4];case 3:return p=a.sent(),c.logger.error("Error polling batch call status",p),[3,4];case 4:return++l<s&&this.schedulePoll(d,u),[2]}})})},d(),[2]):[2]})})},e.nextCreationSeq=0,e}();t.EvmRequestTracker=g},8694(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.readBatchId=function(e){if("string"==typeof e&&e.length>0)return e;if(e&&"object"==typeof e){var t=e.id;if("string"==typeof t&&t.length>0)return t}},t.readBatchStatusCode=i,t.readBatchChainId=function(e){var t=null==e?void 0:e.chainId;if("number"==typeof t&&Number.isFinite(t)&&t>0)return t;if("string"==typeof t){var r=parseInt(t,16);if(Number.isFinite(r)&&r>0)return r}},t.batchCallOutcome=function(e,t){var r=null==t?void 0:t.status;return void 0!==r?"0x0"===r||0===r||"reverted"===r?n.TransactionStatus.REVERTED:n.TransactionStatus.CONFIRMED:e>=600?void 0:e>=500?n.TransactionStatus.REVERTED:e>=400?n.TransactionStatus.REJECTED:n.TransactionStatus.CONFIRMED},t.batchReceiptForCall=function(e,t,r){var n,a=Array.isArray(null==e?void 0:e.receipts)?e.receipts:[],o=null!==(n=i(e))&&void 0!==n?n:0;return!0===(null==e?void 0:e.atomic)||void 0===(null==e?void 0:e.atomic)&&1===a.length&&r>1&&o<600?a[0]:a[t]};var n=r(4164);function i(e){return"number"==typeof(null==e?void 0:e.statusCode)?e.statusCode:"number"==typeof(null==e?void 0:e.status)?e.status:void 0}},7688(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return r(this,void 0,void 0,function(){var r,a,o,s,c,u,l,d,h;return n(this,function(f){switch(f.label){case 0:a=(r=t||{}).retries,o=void 0===a?0:a,s=r.retryDelay,c=r.retryOn,u=i(r,["retries","retryDelay","retryOn"]),l=function(t){var r,i,a,l;return n(this,function(n){switch(n.label){case 0:r=t===o,n.label=1;case 1:return n.trys.push([1,6,,10]),[4,globalThis.fetch(e,u)];case 2:return(i=n.sent()).ok||r?[2,{value:i}]:((a=new Error(i.statusText)).response=i,(null==c?void 0:c(t,a,i))?s?[4,new Promise(function(e){return setTimeout(e,s(t))})]:[3,4]:[3,5]);case 3:n.sent(),n.label=4;case 4:return[2,"continue"];case 5:return[2,{value:i}];case 6:if(l=n.sent(),r)throw l;return(null==c?void 0:c(t,l,null))?s?[4,new Promise(function(e){return setTimeout(e,s(t))})]:[3,8]:[3,9];case 7:n.sent(),n.label=8;case 8:return[2,"continue"];case 9:throw l;case 10:return[2]}})},d=0,f.label=1;case 1:return d<=o?[5,l(d)]:[3,4];case 2:if("object"==typeof(h=f.sent()))return[2,h.value];f.label=3;case 3:return d++,[3,1];case 4:throw new Error("Unexpected: retry loop exited without returning or throwing")}})})}},5135(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});var a=r(6271);i(r(5164),t),i(r(4245),t),"undefined"!=typeof window&&(window.formofy=a.formofy)},6271(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.formofy=function(e,t){e&&"undefined"!=typeof window?n.FormoAnalytics.init(e,t).then(function(e){if(window.formo=e,null==t?void 0:t.ready)try{t.ready(e)}catch(e){console.error("Error in FormoAnalytics ready callback:",e)}}).catch(function(e){return console.error("Error initializing FormoAnalytics:",e)}):console.warn("FormoAnalytics not found")};var n=r(8718)},7378(e,t){var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.Logger=void 0;var n=function(){function e(e,t){void 0===e&&(e=!1),void 0===t&&(t=[]),this.enabled=e,this.enabledLevels=new Set(t)}return e.init=function(t){var r=e.getInstance();void 0!==t.enabled&&r.setEnabled(t.enabled),void 0!==t.enabledLevels&&r.setEnabledLevels(t.enabledLevels)},e.getInstance=function(t){var r,n;return e.instance||(e.instance=new e(null!==(r=null==t?void 0:t.enabled)&&void 0!==r&&r,null!==(n=null==t?void 0:t.enabledLevels)&&void 0!==n?n:[])),e.instance},e.prototype.setEnabled=function(e){this.enabled=e},e.prototype.isLoggingEnabled=function(){return this.enabled},e.prototype.setEnabledLevels=function(e){this.enabledLevels=new Set(e)},e.prototype.getEnabledLevels=function(){return Array.from(this.enabledLevels)},e.prototype.shouldLog=function(e){return!!this.enabled&&this.enabledLevels.has(e)},e.prototype.formatMessage=function(e){var t=(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return"[Formo SDK][".concat(t,"] ").concat(e)},e.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("debug")&&console.debug.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("info")&&console.info.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("warn")&&console.warn.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("error")&&console.error.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.trace=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("trace")&&console.trace.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.log=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.info.apply(this,r([e],t,!1))},e}();t.Logger=n,t.logger=n.getInstance()},3312(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7378),t),i(r(9954),t)},9954(e,t){Object.defineProperty(t,"__esModule",{value:!0})},4328(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parsePrivyProperties=void 0;var n=r(6053);Object.defineProperty(t,"parsePrivyProperties",{enumerable:!0,get:function(){return n.parsePrivyProperties}})},6053(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.parsePrivyProperties=f,t.identifyPrivyUser=function(e,t){return i(this,arguments,void 0,function(e,t,r){var i,o,s,u,l,d,p,v,g,y,m,b,A,S,w;return void 0===r&&(r={}),a(this,function(a){switch(a.label){case 0:if(!e||!t)return[2,void 0];if(null===(b=(i=e).isTrackingSuppressed)||void 0===b?void 0:b.call(i))return[2,void 0];if(o=f(t),s=o.properties,0===(u=o.wallets).length)return c.logger.info("identifyPrivyUser: user has no linked wallets; nothing to identify",t.id),[2,void 0];l=n(n({},s),r.properties),d=function(e,t,r){if(t)return e.find(function(e){return h(e.address,t)});if(r){var n=e.find(function(e){return h(e.address,r)});if(n)return n}var i=e.filter(function(e){return!e.isEmbedded});return i.length>0?i[i.length-1]:e[e.length-1]}(u,null!==(A=r.activeAddress)&&void 0!==A?A:i.currentAddress,null===(S=t.wallet)||void 0===S?void 0:S.address),null===(w=i.syncPrivyActiveChain)||void 0===w||w.call(i,null==d?void 0:d.chainType,null==d?void 0:d.address),p=i.identify.bind(e),v=0,g=u,a.label=1;case 1:return v<g.length?(y=g[v],m=n(n({},l),{is_embedded:y.isEmbedded}),y.walletClient&&(m.wallet_client=y.walletClient),y.chainType&&(m.chain_type=y.chainType),[4,p({address:y.address,userId:t.id,setActive:y===d},m)]):[3,4];case 2:a.sent(),a.label=3;case 3:return v++,[3,1];case 4:return[2,d?{address:d.address,chainType:d.chainType}:void 0]}})})};var c=r(3312);function u(e){return("wallet"===e.type||"smart_wallet"===e.type)&&!!e.address}function l(e){if(e instanceof Date){var t=e.getTime();return Number.isNaN(t)?void 0:t}if("number"==typeof e){if(!Number.isFinite(e))return;return e<1e11?1e3*e:e}if("string"==typeof e){var r=Date.parse(e);return Number.isNaN(r)?void 0:r}}var d=/^0x[0-9a-f]{40}$/i;function h(e,t){return d.test(e)&&d.test(t)?e.toLowerCase()===t.toLowerCase():e===t}function f(e){var t,r,n,i,a,c,h,f,p,v,g,y,m,b,A,S,w,E,_=e.linkedAccounts||[],C={privyDid:e.id,privyCreatedAt:l(e.createdAt)};if((null===(t=e.email)||void 0===t?void 0:t.address)&&(C.email=e.email.address),(null===(r=e.phone)||void 0===r?void 0:r.number)&&(C.phone=e.phone.number),(null===(n=e.apple)||void 0===n?void 0:n.email)&&(C.apple=e.apple.email),(null===(i=e.discord)||void 0===i?void 0:i.username)&&(C.discord=e.discord.username),(null===(a=e.farcaster)||void 0===a?void 0:a.username)&&(C.farcaster=e.farcaster.username),(null===(c=e.github)||void 0===c?void 0:c.username)&&(C.github=e.github.username),(null===(h=e.google)||void 0===h?void 0:h.email)&&(C.google=e.google.email),(null===(f=e.instagram)||void 0===f?void 0:f.username)&&(C.instagram=e.instagram.username),(null===(p=e.line)||void 0===p?void 0:p.email)&&(C.line=e.line.email),(null===(v=e.linkedin)||void 0===v?void 0:v.email)&&(C.linkedin=e.linkedin.email),(null===(g=e.spotify)||void 0===g?void 0:g.email)&&(C.spotify=e.spotify.email),(null===(y=e.telegram)||void 0===y?void 0:y.username)&&(C.telegram=e.telegram.username),(null===(m=e.tiktok)||void 0===m?void 0:m.username)&&(C.tiktok=e.tiktok.username),(null===(b=e.twitch)||void 0===b?void 0:b.username)&&(C.twitch=e.twitch.username),(null===(A=e.twitter)||void 0===A?void 0:A.username)&&(C.twitter=e.twitter.username),!C.email){var I=_.find(function(e){return"email"===e.type});(null==I?void 0:I.address)&&(C.email=I.address)}if(!C.phone){var k=_.find(function(e){return"phone"===e.type});(null==k?void 0:k.number)&&(C.phone=k.number)}if(!C.apple){var P=_.find(function(e){return"apple_oauth"===e.type});(null==P?void 0:P.email)&&(C.apple=P.email)}if(!C.discord){var O=_.find(function(e){return"discord_oauth"===e.type});(null==O?void 0:O.username)&&(C.discord=O.username)}if(!C.farcaster){var T=_.find(function(e){return"farcaster"===e.type});(null==T?void 0:T.username)?C.farcaster=T.username:(null==T?void 0:T.displayName)&&(C.farcaster=T.displayName)}if(!C.github){var x=_.find(function(e){return"github_oauth"===e.type});(null==x?void 0:x.username)&&(C.github=x.username)}if(!C.google){var R=_.find(function(e){return"google_oauth"===e.type});(null==R?void 0:R.email)&&(C.google=R.email)}if(!C.instagram){var L=_.find(function(e){return"instagram_oauth"===e.type});(null==L?void 0:L.username)&&(C.instagram=L.username)}if(!C.line){var H=_.find(function(e){return"line_oauth"===e.type});(null==H?void 0:H.email)&&(C.line=H.email)}if(!C.linkedin){var M=_.find(function(e){return"linkedin_oauth"===e.type});(null==M?void 0:M.email)&&(C.linkedin=M.email)}if(!C.spotify){var D=_.find(function(e){return"spotify_oauth"===e.type});(null==D?void 0:D.email)&&(C.spotify=D.email)}if(!C.telegram){var j=_.find(function(e){return"telegram"===e.type});(null==j?void 0:j.username)?C.telegram=j.username:(null==j?void 0:j.telegramUserId)&&(C.telegram=j.telegramUserId)}if(!C.tiktok){var U=_.find(function(e){return"tiktok_oauth"===e.type});(null==U?void 0:U.username)&&(C.tiktok=U.username)}if(!C.twitch){var N=_.find(function(e){return"twitch_oauth"===e.type});(null==N?void 0:N.username)?C.twitch=N.username:(null==N?void 0:N.email)&&(C.twitch=N.email)}if(!C.twitter){var W=_.find(function(e){return"twitter_oauth"===e.type});(null==W?void 0:W.username)&&(C.twitter=W.username)}var F=_.find(function(e){return"custom_auth"===e.type});(null==F?void 0:F.customUserId)&&(C.customUserId=F.customUserId),C.email||(C.google?C.email=C.google:C.apple?C.email=C.apple:C.linkedin&&(C.email=C.linkedin));for(var B=[],K=0,V=_;K<V.length;K++){var G=V[K];if(u(G))B.push({address:G.address,walletClient:null!==(S=G.walletClientType||G.walletClient)&&void 0!==S?S:void 0,chainType:null!==(w=G.chainType)&&void 0!==w?w:void 0,isEmbedded:"privy"===G.walletClientType||"privy"===G.walletClient});else if("cross_app"===G.type)for(var q=0,Y=s(s([],G.embeddedWallets||[],!0),G.smartWallets||[],!0);q<Y.length;q++){var z=Y[q];(null==z?void 0:z.address)&&B.push({address:z.address,walletClient:"cross_app",chainType:null!==(E=z.chainType)&&void 0!==E?E:void 0,isEmbedded:!0,fromCrossApp:!0})}}for(var Q=new Map,J=[],X=0,Z=B;X<Z.length;X++){var $=Z[X],ee=d.test($.address)?$.address.toLowerCase():$.address,te=Q.get(ee);void 0!==te?!$.fromCrossApp&&J[te].fromCrossApp&&(J[te]=$):(Q.set(ee,J.length),J.push($))}var re=J.map(function(e){return e.fromCrossApp,o(e,["fromCrossApp"])});return{properties:C,wallets:re}}},1794(e,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PROVIDER_ICON=void 0,t.detectInjectedProviderInfo=function(e){for(var r="Injected Provider",i="io.injected.provider",a=e,o=0,s=n;o<s.length;o++){var c=s[o];if(a[c.flag]){r=c.name,i=c.rdns;break}}return{name:r,rdns:i,uuid:"injected-".concat(i.replace(/[^a-zA-Z0-9]/g,"-")),icon:t.DEFAULT_PROVIDER_ICON}},t.isUserRejectionError=function(e){for(var t=e,r=0;t&&r<5;r++){var n=t.code;if(4001===n||"number"==typeof n&&n>=5e3&&n<=5005||"UserRejectedRequestError"===t.name)return!0;t=t.cause}return!1},t.readWalletConnectPeer=function(e){var t,n=e.session,i=null===(t=null==n?void 0:n.peer)||void 0===t?void 0:t.metadata;if(i&&"string"==typeof i.name&&0!==i.name.length)return r({name:i.name},"string"==typeof i.url&&i.url.length>0?{url:i.url}:{})},t.isValidProvider=function(e){return!!e&&"function"==typeof e.request&&"function"==typeof e.on&&"function"==typeof e.removeListener},t.DEFAULT_PROVIDER_ICON="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiBmaWxsPSIjRkZGIi8+CjxwYXRoIGQ9Ik0xNiA4TDggMjRoMTZMMTYgOHoiIGZpbGw9IiMzMzMiLz4KPC9zdmc+Cg==";var n=[{flag:"isMetaMask",name:"MetaMask",rdns:"io.metamask"},{flag:"isCoinbaseWallet",name:"Coinbase Wallet",rdns:"com.coinbase.wallet"},{flag:"isWalletConnect",name:"WalletConnect",rdns:"com.walletconnect"},{flag:"isTrust",name:"Trust Wallet",rdns:"com.trustwallet"},{flag:"isBraveWallet",name:"Brave Wallet",rdns:"com.brave.wallet"},{flag:"isPhantom",name:"Phantom",rdns:"app.phantom"}]},6653(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PROVIDER_ICON=t.isUserRejectionError=t.readWalletConnectPeer=t.isValidProvider=t.detectInjectedProviderInfo=void 0;var n=r(1794);Object.defineProperty(t,"detectInjectedProviderInfo",{enumerable:!0,get:function(){return n.detectInjectedProviderInfo}}),Object.defineProperty(t,"isValidProvider",{enumerable:!0,get:function(){return n.isValidProvider}}),Object.defineProperty(t,"readWalletConnectPeer",{enumerable:!0,get:function(){return n.readWalletConnectPeer}}),Object.defineProperty(t,"isUserRejectionError",{enumerable:!0,get:function(){return n.isUserRejectionError}}),Object.defineProperty(t,"DEFAULT_PROVIDER_ICON",{enumerable:!0,get:function(){return n.DEFAULT_PROVIDER_ICON}})},5796(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EventQueue=void 0;var s=r(9879),c=r(9629),u=r(3312),l=r(49),d=o(r(7688)),h=function(){},f=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];try{e.apply(void 0,t)}catch(e){}},p=65536,v=function(){function e(e,t){var r=this;this.queue=[],this.queueByteSize=0,this.payloadHashes=new Set,this.closed=!1,this.disposePageLeave=null,this.onPageLeave=function(e){var t=!1,r=!1,n=null;function i(){t||(t=!0,e(r),n=setTimeout(function(){n=null,t=!1},0))}var a=function(){r=!1,i()},o=function(){r=!0,i()},s=function(){t=!1},c=function(){r="hidden"!==document.visibilityState,i()},u=function(){r="hidden"!==document.visibilityState,"hidden"===document.visibilityState?i():t=!1},l=globalThis,d=document;return l.addEventListener("beforeunload",a),l.addEventListener("blur",o),l.addEventListener("focus",s),d.addEventListener("pagehide",c),d.addEventListener("visibilitychange",u),function(){n&&(clearTimeout(n),n=null),l.removeEventListener("beforeunload",a),l.removeEventListener("blur",o),l.removeEventListener("focus",s),d.removeEventListener("pagehide",c),d.removeEventListener("visibilitychange",u)}},t=t||{},this.queue=[],this.writeKey=e,this.apiHost=t.apiHost,this.canSend=t.canSend,this.retryCount=(0,c.clampNumber)(t.retryCount||3,5,1),this.flushAt=(0,c.clampNumber)(t.flushAt||20,20,1),this.maxQueueSize=(0,c.clampNumber)(t.maxQueueSize||512e3,512e3,200),this.flushIntervalMs=(0,c.clampNumber)(t.flushInterval||3e4,3e5,1e4),this.flushed=!1,this.errorHandler=t.errorHandler,this.pendingFlush=null,this.timer=null,this.disposePageLeave=this.onPageLeave(function(e){return i(r,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return!1!==e?[3,2]:[4,this.flush(void 0,!0)];case 1:t.sent(),t.label=2;case 2:return[2]}})})})}return e.prototype.generateMessageId=function(e){return i(this,void 0,void 0,function(){var t,r,i;return a(this,function(a){return t=(0,c.toDateHourMinute)(new Date(e.original_timestamp)),r=n(n({},e),{original_timestamp:t}),i=JSON.stringify(r),[2,(0,c.hash)(i)]})})},e.prototype.clear=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.queue=[],this.queueByteSize=0,this.payloadHashes.clear()},e.prototype.close=function(){this.closed=!0,this.clear(),this.disposePageLeave&&(f(this.disposePageLeave),this.disposePageLeave=null)},Object.defineProperty(e.prototype,"isClosed",{get:function(){return this.closed},enumerable:!1,configurable:!0}),e.prototype.enqueue=function(e,t){return i(this,void 0,void 0,function(){var r,i,o,s;return a(this,function(a){switch(a.label){case 0:return t=t||h,this.closed?[2]:this.canSend&&!this.canSend()?(this.clear(),[2]):[4,this.generateMessageId(e)];case 1:return r=a.sent(),this.closed?[2]:this.isDuplicate(r)?(u.logger.warn("Event already enqueued, try again after ".concat((0,c.millisecondsToSecond)(this.flushIntervalMs)," seconds.")),[2]):((i={message:n(n({},e),{message_id:r}),callback:t,byteSize:0}).byteSize=JSON.stringify({message:i.message}).length,this.queue.push(i),this.queueByteSize+=i.byteSize,u.logger.log("Event enqueued: ".concat((0,c.getActionDescriptor)(e.type,e.properties))),this.flushed?(o=this.queue.length>=this.flushAt,s=this.queueByteSize>=this.maxQueueSize,o||s?(this.flush(),[2]):(this.flushIntervalMs&&!this.timer&&(this.timer=setTimeout(this.flush.bind(this),this.flushIntervalMs)),[2])):(this.flushed=!0,this.flush(),[2]))}})})},e.prototype.flush=function(e){return i(this,arguments,void 0,function(e,t){var r,i,o,s,c,u,l,d=this;return void 0===t&&(t=!1),a(this,function(a){switch(a.label){case 0:return e=e||h,this.timer&&(clearTimeout(this.timer),this.timer=null),this.canSend&&!this.canSend()?(this.clear(),f(e),[2,Promise.resolve()]):this.queue.length?this.pendingFlush?t?[3,2]:[4,this.pendingFlush]:[3,2]:(f(e),[2,Promise.resolve()]);case 1:a.sent(),a.label=2;case 2:for(r=this.queue.splice(0,t?this.queue.length:this.flushAt),i=0,o=r;i<o.length;i++)s=o[i],this.payloadHashes.delete(s.message.message_id),this.queueByteSize-=s.byteSize;return 0===this.queue.length&&(this.queueByteSize=0),c=(new Date).toISOString(),u=r.map(function(e){return n(n({},e.message),{sent_at:c})}),l=this.splitIntoBatches(r,u),[2,this.pendingFlush=this.sendBatches(l,u).then(function(t){return t?(f(e,t,u),"function"==typeof d.errorHandler&&f(d.errorHandler,t)):f(e,void 0,u),Promise.resolve(u)}).catch(function(t){f(e,t,u),"function"==typeof d.errorHandler&&f(d.errorHandler,t)})]}})})},e.byteLength=function(e){return(new TextEncoder).encode(e).byteLength},e.prototype.splitIntoBatches=function(t,r){var n=JSON.stringify(r);if(e.byteLength(n)<=p)return[{data:r,items:t,keepalive:!0}];for(var i=[],a=[],o=[],s=2,c=0;c<r.length;c++){var u=r[c],l=e.byteLength(JSON.stringify(u)),d=s+(a.length>0?1:0)+l;d>p?(a.length>0&&i.push({data:a,items:o,keepalive:!0}),l+2>p?(i.push({data:[u],items:[t[c]],keepalive:!1}),a=[],o=[],s=2):(a=[u],o=[t[c]],s=2+l)):(a.push(u),o.push(t[c]),s=d)}return a.length>0&&i.push({data:a,items:o,keepalive:!0}),i},e.prototype.sendBatches=function(e,t){return i(this,void 0,void 0,function(){var r,n,i,o,s,c,u,h,p=this;return a(this,function(a){switch(a.label){case 0:n=0,i=e,a.label=1;case 1:if(!(n<i.length))return[3,6];if(o=i[n],this.canSend&&!this.canSend())return[3,6];a.label=2;case 2:return a.trys.push([2,4,,5]),s=JSON.stringify(o.data),[4,(0,d.default)("".concat(this.apiHost),{headers:(0,l.EVENTS_API_REQUEST_HEADER)(this.writeKey),method:"POST",body:s,keepalive:o.keepalive,retries:this.retryCount,retryDelay:function(e){return 1e3*Math.pow(2,e)},retryOn:function(e,t,r){return p.isErrorRetryable(t,r)}})];case 3:if(!(c=a.sent()).ok)throw(u=new Error(c.statusText||"HTTP ".concat(c.status))).response=c,u;return o.items.forEach(function(e){var r=e.message,n=e.callback;return f(n,void 0,r,t)}),[3,5];case 4:return h=a.sent(),r=r||h,o.items.forEach(function(e){var r=e.message,n=e.callback;return f(n,h,r,t)}),[3,5];case 5:return n++,[3,1];case 6:return[2,r]}})})},e.prototype.isErrorRetryable=function(e,t){var r,n;if(e&&(0,s.isNetworkError)(e))return!0;var i=null!==(r=null==t?void 0:t.status)&&void 0!==r?r:null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.status;return!!i&&(i>=500&&i<=599||429===i)},e.prototype.isDuplicate=function(e){return!!this.payloadHashes.has(e)||(this.payloadHashes.add(e),!1)},e}();t.EventQueue=v},4203(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5796),t),i(r(4407),t)},4407(e,t){Object.defineProperty(t,"__esModule",{value:!0})},5896(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.FormoAnalyticsSession=t.SESSION_WALLET_IDENTIFIED_KEY=t.SESSION_WALLET_DETECTED_KEY=void 0;var i=r(6517),a=r(2257),o=r(3312);function s(e,t){if(void 0===t&&(t=new Set),void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e){if(null===e)return"null";if("bigint"==typeof e)return"bigint:".concat(e.toString());if("number"==typeof e)return Number.isFinite(e)?JSON.stringify(e):"null";if("object"!=typeof e)return JSON.stringify(e);if(t.has(e))return'"[circular]"';t.add(e);try{var r=e.toJSON;if("function"==typeof r)return s(r.call(e),t);if(Array.isArray(e))return"[".concat(e.map(function(e){var r;return null!==(r=s(e,t))&&void 0!==r?r:"null"}).join(","),"]");for(var n=e,i=[],a=0,o=Object.keys(n).sort();a<o.length;a++){var c=o[a],u=s(n[c],t);void 0!==u&&i.push("".concat(JSON.stringify(c),":").concat(u))}return"{".concat(i.join(","),"}")}finally{t.delete(e)}}}function c(e){var t;if(e){var r;try{var n=s(e);if(void 0===n||"{}"===n)return;r=n}catch(e){return null===(t=o.logger.warn)||void 0===t||t.call(o.logger,"Session: failed to fingerprint identify properties",e),"nohash"}for(var i=2166136261,a=16777619,c=0;c<r.length;c++){var u=r.charCodeAt(c);i^=u,i=Math.imul(i,16777619),a^=u+c,a=Math.imul(a,2246822507)}return"".concat((i>>>0).toString(36)).concat((a>>>0).toString(36))}}function u(e){return encodeURIComponent(e).length}t.SESSION_WALLET_DETECTED_KEY="wallet-detected",t.SESSION_WALLET_IDENTIFIED_KEY="wallet-identified";var l=function(){function e(){}return e.prototype.generateIdentificationKey=function(e,t,r,n){return this.buildIdentificationKey(e,t,r,n).key},e.prototype.buildIdentificationKey=function(e,t,r,n){var i=c(n),a=[encodeURIComponent(e)];if(r||i){a.push(encodeURIComponent(t||"")),a.push(encodeURIComponent(r||""));var o=a.join(":");return i&&a.push(i),{key:a.join(":"),identityPrefix:o}}return t&&a.push(encodeURIComponent(t)),{key:a.join(":")}},e.prototype.isWalletDetected=function(e){var r;return((null===(r=(0,i.cookie)().get(t.SESSION_WALLET_DETECTED_KEY))||void 0===r?void 0:r.split(","))||[]).includes(e)},e.prototype.markWalletDetected=function(e){var r,o=(null===(r=(0,i.cookie)().get(t.SESSION_WALLET_DETECTED_KEY))||void 0===r?void 0:r.split(","))||[];o.includes(e)||(o.push(e),o.length>20&&o.splice(0,o.length-20),(0,i.cookie)().set(t.SESSION_WALLET_DETECTED_KEY,o.join(","),n({expires:new Date(Date.now()+864e5).toUTCString(),path:"/"},(0,a.getIdentityCookieSecurity)())))},e.prototype.isWalletIdentified=function(e,r,n,a){var s=this.generateIdentificationKey(e,r,n,a),c=(0,i.cookie)().get(t.SESSION_WALLET_IDENTIFIED_KEY),u=((null==c?void 0:c.split(","))||[]).includes(s);return o.logger.debug("Session: Checking wallet identification",{identifiedKey:s,isIdentified:u,hasRdns:!!r}),u},e.prototype.markWalletIdentified=function(e,r,s,c){var l,d=this.buildIdentificationKey(e,r,s,c),h=d.key,f=d.identityPrefix,p=(null===(l=(0,i.cookie)().get(t.SESSION_WALLET_IDENTIFIED_KEY))||void 0===l?void 0:l.split(","))||[];if(p.includes(h))o.logger.info("Session: Wallet already marked as identified",{identifiedKey:h,existingWallets:p,hasRdns:!!r});else{f&&(p=p.filter(function(e){return e!==f&&!e.startsWith("".concat(f,":"))})),p.push(h);for(var v=p.join(",");p.length>1&&u(v)>3584;)p.shift(),v=p.join(",");(0,i.cookie)().set(t.SESSION_WALLET_IDENTIFIED_KEY,v,n({expires:new Date(Date.now()+864e5).toUTCString(),path:"/"},(0,a.getIdentityCookieSecurity)())),o.logger.debug("Session: Marked wallet as identified",{identifiedKey:h,hasRdns:!!r})}},e}();t.FormoAnalyticsSession=l},1951(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaManager=void 0;var n=r(3312),i=r(8898),a=function(){function e(e,t){this.formo=e,(null==t?void 0:t.store)?(n.logger.info("SolanaManager: Initializing store-based Solana tracking"),this.storeHandler=new i.SolanaStoreHandler(e,t.store,{cluster:t.cluster})):(null==t?void 0:t.cluster)&&(this.pendingCluster=t.cluster)}return e.prototype.setStore=function(e,t){var r;null===(r=this.storeHandler)||void 0===r||r.cleanup(),this.storeHandler=new i.SolanaStoreHandler(this.formo,e,{cluster:(null==t?void 0:t.cluster)||this.pendingCluster}),this.pendingCluster=void 0},e.prototype.setCluster=function(e){this.storeHandler?this.storeHandler.setCluster(e):this.pendingCluster=e},e.prototype.cleanup=function(){var e;null===(e=this.storeHandler)||void 0===e||e.cleanup(),this.storeHandler=void 0},e}();t.SolanaManager=a},8898(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaStoreHandler=void 0;var i=r(4164),a=r(3312),o=r(9485),s=r(3236);function c(e,t,r){if(void 0===t&&(t=1e3),void 0===r&&(r=500),e.size>t)for(var n=Array.from(e),i=0;i<r&&i<n.length;i++)e.delete(n[i])}var u=function(){function e(e,t,r){this.unsubscribers=[],this.lastWalletStatus="disconnected",this.processedTransactions=new Set,this.startedTransactions=new Set,this.transactionSenders=new Map,this.formo=e,this.store=t,this.explicitCluster=!!(null==r?void 0:r.cluster),this.cluster=(null==r?void 0:r.cluster)||this.detectClusterFromStore(t)||"mainnet-beta",this.chainId=o.SOLANA_CHAIN_IDS[this.cluster],a.logger.info("SolanaStoreHandler: Initializing framework-kit store integration",{cluster:this.cluster,chainId:this.chainId}),this.setupWalletSubscription(),this.setupTransactionSubscription(),this.setupClusterSubscription(),this.checkInitialWalletState()}return e.prototype.setCluster=function(e){this.explicitCluster=!0;var t=this.cluster;this.cluster=e,this.chainId=o.SOLANA_CHAIN_IDS[e],t!==e&&this.lastAddress&&(this.lastChainId=this.chainId,this.formo.isAutocaptureEnabled("chain")&&this.formo.chain({chainId:this.chainId,address:this.lastAddress}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting chain event",e)}))},e.prototype.getChainId=function(){return this.chainId},e.prototype.resolveCurrentChainId=function(){if(!this.explicitCluster){var e=this.detectClusterFromStore(this.store);e&&(this.cluster=e,this.chainId=o.SOLANA_CHAIN_IDS[e])}return this.chainId},e.prototype.setupWalletSubscription=function(){var e=this,t=this.store.getState().wallet,r=this.store.subscribe(function(r){var n=r.wallet;if(n!==t){var i=t;t=n,e.handleWalletChange(n,i)}});this.unsubscribers.push(r),a.logger.info("SolanaStoreHandler: Wallet subscription set up")},e.prototype.checkInitialWalletState=function(){var e,t=this.store.getState().wallet;if("connected"===t.status){var r=t.session.account.address;if(r&&!(0,s.isBlockedSolanaAddress)(r)&&(this.lastWalletStatus="connected",this.lastAddress=r,this.lastChainId=this.chainId,a.logger.info("SolanaStoreHandler: Already connected on initialization",{address:r,chainId:this.chainId}),this.formo.isAutocaptureEnabled("connect"))){var n=(null===(e=t.session.connector)||void 0===e?void 0:e.name)||t.connectorId;this.formo.connect({chainId:this.chainId,address:r},{providerName:n,rdns:"sol.wallet.".concat(n.toLowerCase().replace(/\s+/g,""))}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting initial connect",e)})}}this.lastWalletStatus=t.status},e.prototype.handleWalletChange=function(e,t){if("connected"===t.status&&"connected"!==e.status&&this.handleDisconnect(),"connected"===e.status&&"connected"!==t.status)this.handleConnect(e);else if("connected"===e.status&&"connected"===t.status){var r=e.session.account.address!==t.session.account.address,n=e.connectorId!==t.connectorId;(r||n)&&(this.handleDisconnect(),this.handleConnect(e))}this.lastWalletStatus=e.status},e.prototype.handleConnect=function(e){var t,r=e.session.account.address;if(r&&!(0,s.isBlockedSolanaAddress)(r)){var n=this.resolveCurrentChainId();if(this.lastAddress=r,this.lastChainId=n,a.logger.info("SolanaStoreHandler: Wallet connected",{address:r,chainId:n,connector:e.connectorId}),this.formo.isAutocaptureEnabled("connect")){var i=(null===(t=e.session.connector)||void 0===t?void 0:t.name)||e.connectorId;this.formo.connect({chainId:n,address:r},{providerName:i,rdns:"sol.wallet.".concat(i.toLowerCase().replace(/\s+/g,""))}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting connect",e)})}}},e.prototype.handleDisconnect=function(){this.lastAddress&&(a.logger.info("SolanaStoreHandler: Wallet disconnected",{address:this.lastAddress,chainId:this.lastChainId}),this.formo.isAutocaptureEnabled("disconnect")&&this.formo.disconnect({chainId:this.lastChainId,address:this.lastAddress}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting disconnect",e)}),this.lastAddress=void 0,this.lastChainId=void 0)},e.prototype.setupClusterSubscription=function(){var e=this,t=this.store.getState().cluster.endpoint,r=this.store.subscribe(function(r){var n=r.cluster.endpoint;n!==t&&(t=n,e.handleClusterChange(n))});this.unsubscribers.push(r),a.logger.info("SolanaStoreHandler: Cluster subscription set up")},e.prototype.handleClusterChange=function(e){if(!this.explicitCluster){var t=this.detectClusterFromEndpoint(e);if(t){var r=this.cluster;t!==r&&(this.cluster=t,this.chainId=o.SOLANA_CHAIN_IDS[t],a.logger.info("SolanaStoreHandler: Cluster changed",{from:r,to:t,chainId:this.chainId}),this.lastAddress&&(this.lastChainId=this.chainId,this.formo.isAutocaptureEnabled("chain")&&this.formo.chain({chainId:this.chainId,address:this.lastAddress}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting chain event",e)})))}}},e.prototype.setupTransactionSubscription=function(){var e=this,t=this.store.getState().transactions,r=this.store.subscribe(function(r){var n=r.transactions;if(n!==t){var i=t;t=n,e.handleTransactionChanges(n,i)}});this.unsubscribers.push(r),a.logger.info("SolanaStoreHandler: Transaction subscription set up")},e.prototype.handleTransactionChanges=function(e,t){for(var r,n=0,i=Object.entries(e);n<i.length;n++){var a=i[n],o=a[0],s=a[1],c=t[o];if(!c||c.status!==s.status){var u=this.lastAddress||(null===(r=this.transactionSenders.get(o))||void 0===r?void 0:r.address);u&&this.handleTransactionStatusChange(o,s,c,u)}}},e.prototype.handleTransactionStatusChange=function(e,t,r,o){var s=this.chainId,u="".concat(e,":").concat(t.status);if(!this.processedTransactions.has(u)&&(this.processedTransactions.add(u),c(this.processedTransactions),this.formo.isAutocaptureEnabled("transaction")))switch(t.status){case"sending":this.startedTransactions.has(e)||(this.startedTransactions.add(e),c(this.startedTransactions),this.transactionSenders.set(e,{address:o,chainId:s}),this.formo.transaction({status:i.TransactionStatus.STARTED,chainId:s,address:o}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting transaction STARTED",e)}));break;case"waiting":if(f=t.signature){this.transactionSenders.has(e)||this.transactionSenders.set(e,{address:o,chainId:s});var l=this.transactionSenders.get(e);this.formo.transaction({status:i.TransactionStatus.BROADCASTED,chainId:l.chainId,address:l.address,transactionHash:f}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting transaction BROADCASTED",e)})}break;case"confirmed":var d=(null==(l=this.transactionSenders.get(e))?void 0:l.address)||o,h=(null==l?void 0:l.chainId)||s,f=t.signature;a.logger.info("SolanaStoreHandler: Transaction confirmed",{key:e,signature:f}),this.formo.transaction(n({status:i.TransactionStatus.CONFIRMED,chainId:h,address:d},f&&{transactionHash:f})).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting transaction CONFIRMED",e)}),this.transactionSenders.delete(e);break;case"failed":d=(null==(l=this.transactionSenders.get(e))?void 0:l.address)||o,h=(null==l?void 0:l.chainId)||s,f=t.signature;var p=null==r?void 0:r.status,v="waiting"===p?i.TransactionStatus.REVERTED:i.TransactionStatus.REJECTED;a.logger.info("SolanaStoreHandler: Transaction failed",{key:e,signature:f,status:v,prevStatus:p}),this.formo.transaction(n({status:v,chainId:h,address:d},f&&{transactionHash:f})).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting transaction event",e)}),this.transactionSenders.delete(e)}},e.prototype.detectClusterFromStore=function(e){try{var t=e.getState().cluster.endpoint;return this.detectClusterFromEndpoint(t)}catch(e){return null}},e.prototype.detectClusterFromEndpoint=function(e){if(!e)return null;var t=e.toLowerCase();return t.includes("devnet")?"devnet":t.includes("testnet")?"testnet":t.includes("localhost")||t.includes("127.0.0.1")?"localnet":t.includes("mainnet")?"mainnet-beta":null},e.prototype.cleanup=function(){a.logger.debug("SolanaStoreHandler: Cleaning up");for(var e=0,t=this.unsubscribers;e<t.length;e++){var r=t[e];try{r()}catch(e){a.logger.error("SolanaStoreHandler: Error during cleanup",e)}}this.unsubscribers=[],this.processedTransactions.clear(),this.startedTransactions.clear(),this.transactionSenders.clear(),this.lastAddress=void 0,this.lastChainId=void 0,a.logger.debug("SolanaStoreHandler: Cleanup complete")},e}();t.SolanaStoreHandler=u},3236(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SOLANA_SYSTEM_ADDRESSES=void 0,t.isSolanaAddress=n,t.getValidSolanaAddress=i,t.isSolanaSystemAddress=a,t.isBlockedSolanaAddress=function(e){var t=i(e);return!!t&&!!a(t)},t.publicKeyToAddress=function(e){if(!e)return null;try{var t=e.toBase58();return n(t)?t:null}catch(e){return null}},t.areSolanaAddressesEqual=function(e,t){var r=i(e),n=i(t);return!(!r||!n)&&r===n};var r=new Set("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function n(e){if("string"!=typeof e)return!1;var t=e.trim();return!(t.length<32||t.length>44)&&function(e){for(var t=0;t<e.length;t++)if(!r.has(e[t]))return!1;return!0}(t)}function i(e){if(!e)return null;if("object"==typeof e&&"toBase58"in e)try{var t=e.toBase58();return n(t)?t:null}catch(e){return null}if("string"==typeof e){var r=e.trim();return n(r)?r:null}return null}function a(e){var r=i(e);return!!r&&Object.values(t.SOLANA_SYSTEM_ADDRESSES).includes(r)}t.SOLANA_SYSTEM_ADDRESSES={SYSTEM_PROGRAM:"11111111111111111111111111111111",TOKEN_PROGRAM:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",TOKEN_2022_PROGRAM:"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",ASSOCIATED_TOKEN_PROGRAM:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",RENT_SYSVAR:"SysvarRent111111111111111111111111111111111",CLOCK_SYSVAR:"SysvarC1ock11111111111111111111111111111111"}},9308(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaManager=t.SolanaStoreHandler=void 0;var a=r(8898);Object.defineProperty(t,"SolanaStoreHandler",{enumerable:!0,get:function(){return a.SolanaStoreHandler}});var o=r(1951);Object.defineProperty(t,"SolanaManager",{enumerable:!0,get:function(){return o.SolanaManager}}),i(r(9485),t),i(r(6720),t),i(r(3236),t)},6720(e,t){Object.defineProperty(t,"__esModule",{value:!0})},9485(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SOLANA_CHAIN_ID=t.SOLANA_CLUSTERS_BY_ID=t.SOLANA_CHAIN_IDS=void 0,t.isSolanaChainId=function(e){return null!=e&&Object.values(t.SOLANA_CHAIN_IDS).includes(e)},t.SOLANA_CHAIN_IDS={"mainnet-beta":900001,testnet:900002,devnet:900003,localnet:900004},t.SOLANA_CLUSTERS_BY_ID={900001:"mainnet-beta",900002:"testnet",900003:"devnet",900004:"localnet"},t.DEFAULT_SOLANA_CHAIN_ID=t.SOLANA_CHAIN_IDS["mainnet-beta"]},2073(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageManager=void 0;var i=r(3312),a=n(r(8410)),o=n(r(7363)),s=n(r(7772)),c=["cookieStorage","localStorage","sessionStorage","memoryStorage"],u=function(){function e(e){this.writeKey=e,this.storages=new Map}return e.prototype.getStorage=function(e){if(!this.storages.has(e)){for(var t=this.createStorage(e),r=e;!t.isAvailable();){var n=c.indexOf(r);if(-1===n||n+1>=c.length){t=this.createStorage("memoryStorage");break}var a=r;r=c[n+1],i.logger.warn("Storage ".concat(a," is not available, trying ").concat(r)),t=this.createStorage(r)}this.storages.set(e,t)}return this.storages.get(e)},e.prototype.createStorage=function(e){switch(e){case"cookieStorage":return new a.default(this.writeKey);case"localStorage":case"sessionStorage":return new s.default(this.writeKey,this.getWebStorage(e));default:return new o.default(this.writeKey)}},e.prototype.getWebStorage=function(e){try{var t="localStorage"===e?localStorage:sessionStorage;return null!=t?t:null}catch(e){return null}},e}();t.StorageManager=u},701(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(9693),i=r(625),a=function(){function e(e){this.writeKey=e}return e.prototype.getKey=function(e){return"".concat(n.KEY_PREFIX,"_").concat((0,i.secureHash)(this.writeKey),"_").concat(e)},e}();t.default=a},8410(e,t,r){var n,i=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 r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},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)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=a(r(701)),s=r(9037),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.isAvailable=function(){return"undefined"!=typeof document&&"string"==typeof document.cookie},t.prototype.set=function(e,t,r){var n=null==r?void 0:r.expires,i=null==r?void 0:r.maxAge,a=(null==r?void 0:r.path)||"/",o=(null==r?void 0:r.domain)||"",c=null==r?void 0:r.sameSite,u=(null==r?void 0:r.secure)||!1,l=encodeURIComponent(this.getKey(e));if(o)document.cookie="".concat(l,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=").concat(a,";");else{var d=(0,s.getApexDomain)();d&&(document.cookie="".concat(l,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=").concat(a,"; domain=.").concat(d))}var h="".concat(l,"=").concat(encodeURIComponent(t));i?h+="; max-age="+i:n&&(h+="; expires="+n),a&&(h+="; path="+a),o&&(h+="; domain="+o),c&&(h+="; samesite="+c),u&&(h+="; secure"),document.cookie=h},t.prototype.get=function(e){var t=document.cookie.match(new RegExp("(?:^|; )".concat(encodeURIComponent(this.getKey(e)),"=([^;]*)")));return t?decodeURIComponent(t[1]):null},t.prototype.remove=function(e){var t=encodeURIComponent(this.getKey(e));document.cookie="".concat(t,"=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT");var r=(0,s.getApexDomain)();r&&(document.cookie="".concat(t,"=; path=/; domain=.").concat(r,"; expires=Thu, 01 Jan 1970 00:00:00 GMT"))},t}(o.default);t.default=c},7363(e,t,r){var n,i=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 r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},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)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.memoryStorage={},t}return i(t,e),t.prototype.isAvailable=function(){return!0},t.prototype.set=function(e,t){this.memoryStorage[this.getKey(e)]=t},t.prototype.get=function(e){return this.memoryStorage[this.getKey(e)]||null},t.prototype.remove=function(e){delete this.memoryStorage[this.getKey(e)]},t}(a(r(701)).default);t.default=o},7772(e,t,r){var n,i=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 r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},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)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(3312),s=r(9693),c=function(e){function t(t,r){var n=e.call(this,t)||this;return n.backend=r,n}return i(t,e),t.prototype.isAvailable=function(){try{var e="__storage_test__";return this.backend.setItem(e,"1"),this.backend.removeItem(e),!0}catch(e){return!1}},t.prototype.set=function(e,t){"boolean"==typeof t&&(t=!0===t?"true":"false"),"object"==typeof t&&(t=s.JSON_PREFIX+JSON.stringify(t)),this.backend.setItem(this.getKey(e),t)},t.prototype.get=function(e){var t=this.backend.getItem(this.getKey(e));if(!t||"string"!=typeof t)return null;if(["null","undefined"].some(function(e){return e==t}))return null;if(t.startsWith(s.JSON_PREFIX))try{return JSON.parse(t.slice(s.JSON_PREFIX.length))}catch(e){return o.logger.error("[FORMO_ERROR] ".concat(this.backend.constructor.name," failed to parse JSON"),e),null}return["true","false"].some(function(e){return e==t})?JSON.parse(t):t},t.prototype.remove=function(e){this.backend.removeItem(this.getKey(e))},t}(a(r(701)).default);t.default=c},9693(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_PREFIX=t.JSON_PREFIX=void 0,t.JSON_PREFIX="__json=",t.KEY_PREFIX="formo"},2257(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getIdentityCookieDomain=function(e){if(void 0===e&&(e=!0),!e)return"";var t=(0,n.getApexDomain)();return t?".".concat(t):""},t.getIdentityCookieSecurity=function(){var e;return{sameSite:"lax",secure:"undefined"!=typeof window&&"https:"===(null===(e=window.location)||void 0===e?void 0:e.protocol)}};var n=r(9037)},6517(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.memory=t.session=t.local=t.cookie=void 0,t.initStorageManager=function(e){o||(o=new a.StorageManager(e))};var a=r(2073);i(r(2305),t);var o=null;function s(e){if(!o)throw new Error("StorageManager not initialized. Call initStorageManager(writeKey) first.");return o.getStorage(e)}t.cookie=function(){return s("cookieStorage")},t.local=function(){return s("localStorage")},t.session=function(){return s("sessionStorage")},t.memory=function(){return s("memoryStorage")}},2305(e,t){Object.defineProperty(t,"__esModule",{value:!0})},8834(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.TrackingPolicy=void 0;var n=r(4586),i=r(9879),a=function(){function e(e){this.deps=e}return e.prototype.trackingOptions=function(){var e=this.deps.options().tracking;return null===e||"object"!=typeof e||Array.isArray(e)?null:e},e.prototype.isTrackingSuppressed=function(){return this.deps.hasOptedOut()||this.isEnvironmentExcluded()},e.prototype.isEnvironmentExcluded=function(){return this.isTimezoneExcluded()||this.isHostExcluded()||this.isPathExcluded()},e.prototype.isHostExcluded=function(){var e=this.trackingOptions();if(!e)return!1;if("undefined"==typeof window)return!1;var t=e.excludeHosts;return(void 0===t?[]:t).includes(window.location.hostname)},e.prototype.isPathExcluded=function(){var e=this.trackingOptions();if(!e)return!1;if("undefined"==typeof window)return!1;var t=e.excludePaths;return(void 0===t?[]:t).includes(window.location.pathname)},e.prototype.isTimezoneExcluded=function(){var e=this.trackingOptions();if(!e)return!1;var t=e.excludeTimezones,r=void 0===t?[]:t;if(0===r.length)return!1;var i=(0,n.getTimezone)();if(!i)return!1;var a=i.toLowerCase();return r.some(function(e){return"string"==typeof e&&e.toLowerCase()===a})},e.prototype.isPageExcluded=function(){return this.isHostExcluded()||this.isPathExcluded()},e.prototype.isPersistedIdentityPurgeRequired=function(){return this.deps.hasOptedOut()||this.isTimezoneExcluded()},e.prototype.isChainExcluded=function(e){var t=this.trackingOptions();if(!t)return!1;var r=t.excludeChains,n=void 0===r?[]:r;return 0!==n.length&&this.isChainRefused(n,e)},e.prototype.isChainRefused=function(e,t){var r,n=null!==(r=null==t?void 0:t.chainId)&&void 0!==r?r:this.deps.currentChainId();return 0===n||void 0!==n&&e.includes(n)},e.prototype.shouldTrack=function(e){if(this.deps.hasOptedOut())return!1;var t=this.deps.options().tracking;if("boolean"==typeof t)return t;var r=this.trackingOptions();if(r){if(this.isEnvironmentExcluded())return!1;var n=r.excludeChains,a=void 0===n?[]:n;return!(a.length>0&&this.isChainRefused(a,e))}return!(0,i.isLocalhost)()},e.prototype.isAutocaptureEnabled=function(e){var t=this.deps.options().autocapture;return void 0===t||("boolean"==typeof t?t:null===t||"object"!=typeof t||!1!==t[e])},e}();t.TrackingPolicy=a},4312(e,t){Object.defineProperty(t,"__esModule",{value:!0})},4164(e,t){var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionStatus=t.SignatureStatus=void 0,function(e){e.REQUESTED="requested",e.REJECTED="rejected",e.CONFIRMED="confirmed"}(r||(t.SignatureStatus=r={})),function(e){e.STARTED="started",e.REJECTED="rejected",e.BROADCASTED="broadcasted",e.CONFIRMED="confirmed",e.REVERTED="reverted"}(n||(t.TransactionStatus=n={}))},2657(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4312),t),i(r(4164),t),i(r(7896),t)},7896(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.WRAPPED_REQUEST_OWNER_SYMBOL=t.WRAPPED_REQUEST_REF_SYMBOL=t.WRAPPED_REQUEST_SYMBOL=void 0,t.WRAPPED_REQUEST_SYMBOL=Symbol("formoWrappedRequest"),t.WRAPPED_REQUEST_REF_SYMBOL=Symbol("formoWrappedRequestRef"),t.WRAPPED_REQUEST_OWNER_SYMBOL=Symbol("formoWrappedRequestOwner")},4657(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.validateAddress=t.validateAndChecksumAddress=t.toChecksumAddress=t.isBlockedAddress=t.getValidAddress=t.isValidAddress=void 0;var n=r(5628),i=r(7393),a=r(9879),o=r(1592),s=r(49),c=r(3236),u=r(9485),l=function(e){return"string"==typeof e&&""!==e.trim()&&(0,a.isAddress)(e.trim())?e.trim():null};t.isValidAddress=function(e){return null!==l(e)},t.getValidAddress=function(e){return l(e)},t.isBlockedAddress=function(e){if(!e||"string"!=typeof e)return!1;var t=e.trim().toLowerCase();return!(!t||!t.startsWith("0x")||42!==t.length)&&s.BLOCKED_ADDRESSES.some(function(e){return e.toLowerCase()===t})},t.toChecksumAddress=function(e){if(!(0,a.isAddress)(e,!1))throw new Error("Invalid address "+e);var t=e.toLowerCase().replace(/^0x/i,""),r=(0,a.uint8ArrayToHexString)((0,n.keccak256)((0,a.ensureIfUint8Array)((0,i.utf8ToBytes)(t))));if((0,o.isNullish)(r)||"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"===r)return"";for(var s="0x",c=r.replace(/^0x/i,""),u=0;u<t.length;u+=1)parseInt(c[u],16)>7?s+=t[u].toUpperCase():s+=t[u];return s},t.validateAndChecksumAddress=function(e){var r=(0,t.getValidAddress)(e);return r?(0,t.toChecksumAddress)(r):void 0},t.validateAddress=function(e,r){var n=Object.values(u.SOLANA_CHAIN_IDS);return null!=r&&n.includes(r)?(0,c.getValidSolanaAddress)(e)||void 0:null!=r?(0,t.validateAndChecksumAddress)(e):(0,t.validateAndChecksumAddress)(e)||(0,c.isSolanaAddress)(e)&&(0,c.getValidSolanaAddress)(e)||void 0}},7916(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getActionDescriptor=void 0,t.getActionDescriptor=function(e,t){var r=e;return(null==t?void 0:t.status)&&(r+=" ".concat(t.status)),"connect"!==e&&"disconnect"!==e||!(null==t?void 0:t.rdns)||(r+=" (".concat(t.rdns,")")),r}},7392(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseChainId=function(e){return"string"!=typeof e?0:e.startsWith("0x")||e.startsWith("0X")?parseInt(e,16):parseInt(e,10)}},1349(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.clampNumber=t.toDateHourMinute=t.millisecondsToSecond=void 0,t.toSnakeCase=function(e,t){void 0===t&&(t=[]);var r=function(e){return Array.isArray(e)?e.map(r):null!==e&&"object"==typeof e?Object.keys(e).reduce(function(n,i){return n[t.includes(i)?i:i.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()]=t.includes(i)?e[i]:r(e[i]),n},{}):e};return r(e)},t.millisecondsToSecond=function(e){return Math.ceil(e/1e3)},t.toDateHourMinute=function(e){return e.getUTCFullYear()+"-"+("0"+(e.getUTCMonth()+1)).slice(-2)+"-"+("0"+e.getUTCDate()).slice(-2)+" "+("0"+e.getUTCHours()).slice(-2)+":"+("0"+e.getUTCMinutes()).slice(-2)},t.clampNumber=function(e,t,r){return Math.min(Math.max(e,r),t)}},9037(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getApexDomain=function(){if("undefined"==typeof window)return null;if(void 0!==r)return r;var e=window.location.hostname;if("localhost"===e||/^\d+\.\d+\.\d+\.\d+$/.test(e))return r=null,null;var t=e.split(".");if(t.length<2)return r=null,null;for(var n=2;n<=t.length;n++){var a=t.slice(-n).join(".");if(i(a))return r=a,a}return r=null,null},t._resetApexDomainCache=function(){r=void 0};var r,n="__formo_domain_probe";function i(e){var t="probe";document.cookie="".concat(n,"=").concat(t,"; domain=.").concat(e,"; path=/; max-age=10");var r=-1!==document.cookie.indexOf("".concat(n,"=").concat(t));return document.cookie="".concat(n,"=; domain=.").concat(e,"; path=/; max-age=0"),r}},6262(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.hash=function(e){return n(this,void 0,void 0,function(){var t,r;return i(this,function(n){return t=(0,o.utf8ToBytes)(e),r=(0,a.sha256)(t),[2,(0,o.bytesToHex)(r)]})})},t.generateNativeUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;var t=Array.from(e).map(function(e){return e.toString(16).padStart(2,"0")}).join("");return"".concat(t.slice(0,8),"-").concat(t.slice(8,12),"-").concat(t.slice(12,16),"-").concat(t.slice(16,20),"-").concat(t.slice(20))}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)})};var a=r(6997),o=r(7393)},625(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.secureHash=function(e){var t=(0,i.utf8ToBytes)(e),r=(0,n.sha256)(t);return(0,i.bytesToHex)(r).slice(0,8)};var n=r(6997),i=r(7393)},9629(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4657),t),i(r(7916),t),i(r(1349),t),i(r(6262),t),i(r(625),t),i(r(4586),t)},2817(e,t){function r(e,t){var r=null!=e?e:{},i=null!=t?t:{},a={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(a[o]=Object.prototype.hasOwnProperty.call(i,o)?n(r[o],i[o]):r[o]);for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(Object.prototype.hasOwnProperty.call(a,o)||(a[o]=i[o]));return a}function n(e,t){return i(e)&&i(t)?r(e,t):t}function i(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.mergeDeepRight=r,t.default=r},8081(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getFormattedTimestamp=t.getCurrentTimeFormatted=void 0;var r=function(e){return e.toISOString()};t.getFormattedTimestamp=r,t.getCurrentTimeFormatted=function(){return r(new Date)}},4586(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getTimezone=void 0;var n=r(3312);t.getTimezone=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){return n.logger.error("Error resolving timezone:",e),""}}},8939(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.checkAddressChecksum=t.isAddress=void 0,t.ensureIfUint8Array=s;var n=r(9874),i=r(5628),a=r(7393),o=r(8090);function s(e){var t;return e instanceof Uint8Array||"Uint8Array"!==(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)?e:Uint8Array.from(e)}t.isAddress=function(e,r){return void 0===r&&(r=!0),!("string"!=typeof e&&!(0,n.isUint8Array)(e))&&(i=(0,n.isUint8Array)(e)?(0,n.uint8ArrayToHexString)(e):"string"!=typeof e||(0,o.isHexStrict)(e)||e.toLowerCase().startsWith("0x")?e:"0x".concat(e),!!/^(0x)?[0-9a-f]{40}$/i.test(i)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(i)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(i))||!r||(0,t.checkAddressChecksum)(i)));var i},t.checkAddressChecksum=function(e){if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;for(var t=e.slice(2),r=(0,a.utf8ToBytes)(t.toLowerCase()),o=(0,n.uint8ArrayToHexString)((0,i.keccak256)(s(r))).slice(2),c=0;c<40;c+=1)if(parseInt(o[c],16)>7&&t[c].toUpperCase()!==t[c]||parseInt(o[c],16)<=7&&t[c].toLowerCase()!==t[c])return!1;return!0}},2886(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isLocalhost=void 0,t.isLocalhost=function(){return/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*:)*?:?0*1$/.test(window.location.hostname)||"file:"===window.location.protocol}},9090(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectToString=t.isPrimitive=t.isError=t.isDate=t.isRegExp=t.isObjectAndNotNull=t.isObject=t.isNumber=t.isBoolean=t.isArray=t.isBigInt=t.isDefinedNotNullAndNotEmptyString=t.isDefinedAndNotNull=t.isDefined=t.isTypeOfError=t.isNullOrUndefined=t.isUndefined=t.isNull=t.isString=t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e&&Boolean(e.constructor&&e.call&&e.apply)},t.isString=function(e){return"string"==typeof e};var r=function(e){return null===e};t.isNull=r;var n=function(e){return void 0===e};t.isUndefined=n;var i=function(e){return r(e)||n(e)};t.isNullOrUndefined=i,t.isBigInt=function(e){return"bigint"==typeof e},t.isDefined=function(e){return!n(e)};var a=function(e){return!i(e)};t.isDefinedAndNotNull=a,t.isDefinedNotNullAndNotEmptyString=function(e){return a(e)&&""!==e},t.isTypeOfError=function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}};var o=function(e){return Array.isArray(e)};t.isArray=o,t.isBoolean=function(e){return"boolean"==typeof e},t.isNumber=function(e){return"number"==typeof e};var s=function(e){return"object"==typeof e};t.isObject=s,t.isObjectAndNotNull=function(e){return!r(e)&&s(e)&&!o(e)},t.isRegExp=function(e){return s(e)&&"[object RegExp]"===c(e)},t.isDate=function(e){return s(e)&&"[object Date]"===c(e)},t.isError=function(e){return s(e)&&("[object Error]"===c(e)||e instanceof Error)},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e};var c=function(e){return Object.prototype.toString.call(e)};t.objectToString=c},9879(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8939),t),i(r(2886),t),i(r(9090),t),i(r(2921),t),i(r(1592),t),i(r(8090),t),i(r(9874),t)},2921(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isNetworkError=function(e){return!(!e||(t=e,a=r.call(t),"[object Error]"!==a&&"[object DOMException]"!==a)||!n.has(e.name)||"string"!=typeof e.message)&&("Load failed"===e.message?void 0===e.stack:i.has(e.message));var t,a};var r=Object.prototype.toString,n=new Set(["TypeError","TimeoutError","NetworkError"]),i=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated","The operation was aborted due to timeout"])},1592(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isNullish=void 0,t.isNullish=function(e){return null==e}},8090(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isHexStrict=void 0,t.isHexStrict=function(e){return"string"==typeof e&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e)}},9874(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=function(e){var t,r;return e instanceof Uint8Array||"Uint8Array"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)||"Buffer"===(null===(r=null==e?void 0:e.constructor)||void 0===r?void 0:r.name)},t.uint8ArrayToHexString=function(e){for(var t="0x",r=0,n=e;r<n.length;r++){var i=n[r].toString(16);t+=1===i.length?"0".concat(i):i}return t}},5479(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="1.38.2"},8788(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.WagmiEventHandler=t.MARKER_GRACE_MS=void 0,t.__resetSeededWallet=function(){y.clear(),I.forEach(function(e){return clearTimeout(e)}),I.clear(),_.clear(),C.clear(),h.clear(),v.clear(),g.forEach(function(e){return clearTimeout(e)}),g.clear()};var o=r(4164),s=r(3312),c=r(6653),u=r(8694),l=r(5170),d=new Set(["status","chainId","address","data","to","value","transactionHash","function_name","function_args","providerName","rdns"]),h=new Set,f=new WeakMap,p=function(e,t){return"".concat(e,":").concat(t.toLowerCase())};t.MARKER_GRACE_MS=3e3;var v=new Map,g=new Map,y=new Map,m=new WeakMap,b=0,A=c.isUserRejectionError,S=new WeakMap,w=new WeakSet,E=new WeakMap,_=new Map,C=new Map,I=new Map;function k(e,t){var r;return t&&(null===(r=f.get(t))||void 0===r?void 0:r.has(e))?"exact":h.has(e)?"recent":"none"}function P(e,t){var r;h.delete(e),t&&(null===(r=f.get(t))||void 0===r||r.delete(e))}function O(e,t){var r;if(t){var n=null!==(r=f.get(t))&&void 0!==r?r:new Set;n.add(e),f.set(t,n)}h.add(e)}function T(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("bigint"==typeof e)return Number(e);if("string"==typeof e&&""!==e.trim()){var t=(e.startsWith("0x"),Number(e));return Number.isFinite(t)?t:void 0}}function x(e){if("string"==typeof e)return e;if(e&&"object"==typeof e){var t=e.address;if("string"==typeof t)return t}}function R(e,t,r){if(void 0===t&&(t=1e3),void 0===r&&(r=500),e.size>t)for(var n=Array.from(e),i=0;i<r&&i<n.length;i++)e.delete(n[i])}var L=function(){function e(e,t,r){this.unsubscribers=[],this.trackingState={isProcessing:!1},this.disposed=!1,this.reconciling=!1,this.transitionGeneration=0,this.missedDisconnect=!1,this.processedMutations=new Set,this.processedQueries=new Set,this.wrapEpochs=new WeakMap,this.wrapRetryCounts=new WeakMap,this.wrapRetryTimers=new Set,this.wrapSessionGeneration=0,this.formo=e,this.wagmiConfig=t,this.queryClient=r,s.logger.info("WagmiEventHandler: Initializing Wagmi integration");var n,i,a,o,c,u=this.pruneMarkersForLostWallets();!function(e,t){var r;if(v.set(e,(null!==(r=v.get(e))&&void 0!==r?r:0)+1),t){var n=g.get(e);n&&(clearTimeout(n),g.delete(e))}}(this.formo.writeKey,u),this.ownerKey=(n=this.formo.writeKey,i=t,(a=m.get(i))||(a="cfg".concat(b+=1),m.set(i,a)),"".concat(n,":").concat(a)),y.set(this.ownerKey,this),o=this.ownerKey,(c=I.get(o))&&(clearTimeout(c),I.delete(o)),this.setupConnectionListeners(),this.seedFromCurrentState(),this.queryClient?(this.setupMutationTracking(),this.setupQueryTracking()):s.logger.warn("WagmiEventHandler: QueryClient not provided, signature and transaction events will not be tracked")}return e.prototype.pruneMarkersForLostWallets=function(){var e,t=this;try{e=this.getState()}catch(e){return!1}var r="".concat(this.formo.writeKey,":"),n=new Set;e.connections.forEach(function(e){e.accounts.forEach(function(e){return n.add(p(t.formo.writeKey,e))})});var i=!1;return h.forEach(function(e){e.startsWith(r)&&(n.has(e)?i=!0:h.delete(e))}),i},Object.defineProperty(e.prototype,"isEmittingOwner",{get:function(){if(!this.ownerKey)return!0;var e=y.get(this.ownerKey);return e?e===this:(y.set(this.ownerKey,this),!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pendingTransactions",{get:function(){var e,t=null!==(e=this.ownerKey)&&void 0!==e?e:"",r=_.get(t);return r||(r=new Map,_.set(t,r)),r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pendingBatches",{get:function(){var e,t=null!==(e=this.ownerKey)&&void 0!==e?e:"",r=C.get(t);return r||(r=new Map,C.set(t,r)),r},enumerable:!1,configurable:!0}),e.prototype.setupConnectionListeners=function(){var e=this;s.logger.info("WagmiEventHandler: Setting up connection listeners");var t=this.wagmiConfig.subscribe(function(e){return e.status},function(t,r){e.handleStatusChange(t,r)});this.unsubscribers.push(t);var r=this.wagmiConfig.subscribe(function(t){var r;return null!==(r=e.getActiveConnectionChainId(t))&&void 0!==r?r:t.chainId},function(t,r){e.handleChainChange(t,r)});this.unsubscribers.push(r);var n=this.wagmiConfig.subscribe(function(t){var r,n;return"".concat(null!==(r=t.current)&&void 0!==r?r:"","|").concat(null!==(n=e.getConnectedAddress(t))&&void 0!==n?n:"")},function(t,r){var n=t.split("|")[1],i=(null!=r?r:"|").split("|")[1];e.wrapActiveConnectorProvider(e.getState()),e.handleActiveAddressChange(n||void 0,i||void 0)});this.unsubscribers.push(n),s.logger.info("WagmiEventHandler: Connection listeners set up successfully")},e.prototype.seedFromCurrentState=function(){var e,t;try{var r=this.getState();this.kickWalletConnectPeerLookup(r),this.wrapActiveConnectorProvider(r)}catch(e){}try{var i=this.getState();if("connected"!==i.status)return;var a=this.getConnectedAddress(i),o=null!==(e=this.getActiveConnectionChainId(i))&&void 0!==e?e:i.chainId;if(!a||void 0===o)return void s.logger.debug("WagmiEventHandler: Connected at init but address or chainId is missing, nothing to seed",{address:a,chainId:o});if(s.logger.info("WagmiEventHandler: Adopting connection that predates this handler",{address:a,chainId:o}),this.formo.syncWalletState({chainId:o,address:a}),(null===(t=this.formo.currentAddress)||void 0===t?void 0:t.toLowerCase())!==a.toLowerCase())return void s.logger.debug("WagmiEventHandler: Central state declined the connection, not seeding",{address:a,chainId:o});if(this.trackingState.lastAddress=a,this.trackingState.lastChainId=o,this.trackingState.lastStatus=i.status,this.trackingState.lastConnectionId=i.current,!this.formo.isAutocaptureEnabled("connect")||!this.isEmittingOwner)return void s.logger.debug("WagmiEventHandler: Connect autocapture disabled, adopted without emitting",{address:a,chainId:o});if(!this.formo.willTrackEvent(o))return void s.logger.debug("WagmiEventHandler: Connect would not be tracked, adopted without emitting",{address:a,chainId:o});var c=p(this.formo.writeKey,a),u=i.current?i.connections.get(i.current):void 0;if("none"!==k(c,u))return void s.logger.debug("WagmiEventHandler: Wallet already adopted this page load, not re-emitting connect",{address:a});O(c,u);var l=this.getConnectorName(i);Promise.resolve(this.formo.connect({chainId:o,address:a},n({},l&&{providerName:l}))).catch(function(e){P(c,u),s.logger.error("WagmiEventHandler: Error emitting seeded connect event:",e)})}catch(e){s.logger.error("WagmiEventHandler: Error seeding from current state:",e)}},e.prototype.restoreCentralStateFromTracking=function(){var e,t=this.trackingState,r=t.lastAddress,n=t.lastChainId;r&&void 0!==n&&((null===(e=this.formo.currentAddress)||void 0===e?void 0:e.toLowerCase())===r.toLowerCase()&&this.formo.currentChainId===n||(s.logger.info("WagmiEventHandler: Restoring central state a stale disconnect cleared",{address:r,chainId:n}),this.formo.syncWalletState({chainId:n,address:r})))},e.prototype.releaseTrackedWallet=function(){var e=this.trackingState.lastAddress;this.trackingState.lastAddress=void 0,this.trackingState.lastChainId=void 0,this.trackingState.lastConnectionId=void 0,e&&h.delete(p(this.formo.writeKey,e))},e.prototype.retryAdoption=function(){this.disposed||(this.trackingState.lastAddress&&!this.tracksLiveWallet()&&(s.logger.debug("WagmiEventHandler: Tracked wallet is no longer the live one, releasing before retry",{tracked:this.trackingState.lastAddress}),this.releaseTrackedWallet()),this.resyncCentralState(),this.trackingState.lastAddress&&this.isCurrentWalletAnnounced()||this.seedFromCurrentState())},e.prototype.tracksLiveWallet=function(){var e=this.trackingState.lastAddress;if(!e)return!1;try{var t=this.getState();if("connected"!==t.status)return!1;var r=this.getConnectedAddress(t);return!!r&&r.toLowerCase()===e.toLowerCase()}catch(e){return s.logger.error("WagmiEventHandler: Error reading state to compare wallets:",e),!1}},e.prototype.resyncCentralState=function(){var e,t=this.trackingState,r=t.lastAddress,n=t.lastChainId;r&&void 0!==n&&((null===(e=this.formo.currentAddress)||void 0===e?void 0:e.toLowerCase())===r.toLowerCase()&&this.formo.currentChainId===n||(s.logger.info("WagmiEventHandler: Re-syncing central state for a tracked wallet",{address:r,chainId:n}),this.formo.syncWalletState({chainId:n,address:r})))},e.prototype.isCurrentWalletAnnounced=function(){var e,t=this.trackingState.lastAddress;if(!t)return!1;try{var r=this.getState();e=r.current?r.connections.get(r.current):void 0}catch(e){}return"none"!==k(p(this.formo.writeKey,t),e)},e.prototype.handleStatusChange=function(e,t){return i(this,void 0,void 0,function(){var r,i,o,c,u,l,d,f,v,g,y,m,b,A,S;return a(this,function(a){switch(a.label){case 0:if("disconnected"!==e&&"reconnecting"!==e||(this.wrapSessionGeneration+=1,this.fallbackConnector=void 0,this.fallbackProvider=void 0),this.trackingState.isProcessing)return"disconnected"===e&&(this.missedDisconnect=!0),s.logger.debug("WagmiEventHandler: Already processing status change, skipping"),[2];this.trackingState.isProcessing=!0;try{r=this.getState(),this.kickWalletConnectPeerLookup(r),this.wrapActiveConnectorProvider(r)}catch(e){}this.transitionGeneration+=1,a.label=1;case 1:return a.trys.push([1,14,15,16]),i=this.getState(),o=this.getConnectedAddress(i),c=null!==(m=this.getActiveConnectionChainId(i))&&void 0!==m?m:i.chainId,s.logger.info("WagmiEventHandler: Status changed",{status:e,prevStatus:t,address:o,chainId:c}),"disconnected"===e&&this.trackingState.lastAddress?(u=this.trackingState.lastAddress,l=this.trackingState.lastChainId,this.trackingState.lastConnectionId=void 0,this.trackingState.lastAddress=void 0,this.trackingState.lastChainId=void 0,this.pendingChainId=void 0,this.missedDisconnect=!1,h.delete(p(this.formo.writeKey,u)),this.formo.isAutocaptureEnabled("disconnect")&&this.isEmittingOwner?[4,this.formo.disconnect({chainId:l,address:u})]:[3,3]):[3,4];case 2:return a.sent(),[3,4];case 3:this.formo.syncWalletState({chainId:l}),a.label=4;case 4:return"connected"!==e||"connected"===t?[3,13]:o&&void 0!==c?(null===(b=this.trackingState.lastAddress)||void 0===b?void 0:b.toLowerCase())!==o.toLowerCase()?[3,9]:this.trackingState.lastChainId===c?[3,7]:this.pendingChainId!==c?[3,6]:(this.pendingChainId=void 0,s.logger.info("WagmiEventHandler: Re-entry carries a chain the subscription dropped, emitting it",{address:o,from:this.trackingState.lastChainId,to:c}),[4,this.handleChainChange(c,this.trackingState.lastChainId)]):[3,13];case 5:return a.sent(),this.trackingState.lastStatus=e,[2];case 6:return s.logger.info("WagmiEventHandler: Tracked wallet re-entered connected on a different chain",{address:o,from:this.trackingState.lastChainId,to:c}),this.formo.syncWalletState({chainId:c,address:o}),(null===(A=this.formo.currentAddress)||void 0===A?void 0:A.toLowerCase())===o.toLowerCase()?this.trackingState.lastChainId=c:(s.logger.debug("WagmiEventHandler: Central state declined the re-entry chain, dropping the wallet",{address:o,chainId:c}),this.releaseTrackedWallet()),[3,8];case 7:s.logger.debug("WagmiEventHandler: Ignoring re-entry to connected for an already tracked wallet",{address:o,chainId:c}),a.label=8;case 8:return this.trackingState.lastStatus=e,[2];case 9:if(this.formo.syncWalletState({chainId:c,address:o}),(null===(S=this.formo.currentAddress)||void 0===S?void 0:S.toLowerCase())!==o.toLowerCase())return s.logger.debug("WagmiEventHandler: Central state declined the connection, not adopting",{address:o,chainId:c}),this.trackingState.lastStatus=e,[2];if(this.trackingState.lastAddress=o,this.trackingState.lastChainId=c,this.trackingState.lastConnectionId=i.current,!(this.formo.isAutocaptureEnabled("connect")&&this.isEmittingOwner&&this.formo.willTrackEvent(c)))return[3,13];if(d=p(this.formo.writeKey,o),f=i.current?i.connections.get(i.current):void 0,"none"!==k(d,f))return s.logger.debug("WagmiEventHandler: Connect already announced for this wallet, not emitting again",{address:o}),this.trackingState.lastStatus=e,[2];O(d,f),v=this.getConnectorName(i),a.label=10;case 10:return a.trys.push([10,12,,13]),[4,this.formo.connect({chainId:c,address:o},n({},v&&{providerName:v}))];case 11:return a.sent(),[3,13];case 12:throw g=a.sent(),P(d,f),g;case 13:return this.trackingState.lastStatus=e,[3,16];case 14:return y=a.sent(),s.logger.error("WagmiEventHandler: Error handling status change:",y),[3,16];case 15:return this.trackingState.isProcessing=!1,this.reconcileWithLiveState(),[7];case 16:return[2]}})})},e.prototype.reconcileWithLiveState=function(){var e=this;if(!this.disposed&&!this.trackingState.isProcessing&&!this.reconciling){var t;try{t=this.getState()}catch(e){return void s.logger.error("WagmiEventHandler: Error reading state to reconcile:",e)}if("connected"===t.status||"disconnected"===t.status){var r="connected"===t.status?this.getConnectedAddress(t):void 0,n=this.trackingState.lastAddress;if(r||n)if(r&&n){if(r.toLowerCase()===n.toLowerCase()){if(this.missedDisconnect){this.missedDisconnect=!1,s.logger.info("WagmiEventHandler: A disconnect/reconnect cycle completed while the lock was held",{address:r}),this.reconciling=!0;try{this.handleStatusChange("disconnected","connected").then(function(){return e.retryAdoption()})}finally{this.reconciling=!1}return}this.resyncCentralState();var i=this.pendingChainId;return void(void 0!==i&&(this.pendingChainId=void 0,i!==this.trackingState.lastChainId&&(s.logger.info("WagmiEventHandler: Replaying a chain change dropped while reconnecting",{address:r,from:this.trackingState.lastChainId,to:i}),this.handleChainChange(i,this.trackingState.lastChainId))))}s.logger.info("WagmiEventHandler: Wallet changed while the lock was held, re-adopting",{from:n,to:r}),this.reconciling=!0;try{this.releaseTrackedWallet(),this.seedFromCurrentState()}finally{this.reconciling=!1}}else{this.reconciling=!0;try{r?(s.logger.info("WagmiEventHandler: Reconnect landed while the lock was held, adopting it",{address:r}),this.retryAdoption()):(s.logger.info("WagmiEventHandler: Disconnect landed while the lock was held, applying it",{address:n}),this.handleStatusChange("disconnected","connected"))}finally{this.reconciling=!1}}}}},e.prototype.handleActiveAddressChangeEntryKick=function(){try{this.kickWalletConnectPeerLookup(this.getState())}catch(e){}},e.prototype.handleActiveAddressChange=function(e,t){return i(this,void 0,void 0,function(){var r,i,o,c,u,l,d,f,v,g,y,m,b,A,S,w,E,_,C,I,T,x;return a(this,function(a){switch(a.label){case 0:if(this.handleActiveAddressChangeEntryKick(),"connected"!==(r=this.getState()).status)return[2];if(i=this.trackingState.lastConnectionId,o=!!i&&!r.connections.has(i),c=void 0!==this.trackingState.lastConnectionId&&void 0!==r.current&&r.current!==this.trackingState.lastConnectionId,!o&&!c){if(!e||e===t)return[2];if((null===(E=this.trackingState.lastAddress)||void 0===E?void 0:E.toLowerCase())===e.toLowerCase())return[2]}return c&&!o&&e&&(null===(_=this.trackingState.lastAddress)||void 0===_?void 0:_.toLowerCase())===e.toLowerCase()?(u=null!==(C=this.getActiveConnectionChainId(r))&&void 0!==C?C:r.chainId,s.logger.info("WagmiEventHandler: Active connection changed for the same account",{address:e,from:this.trackingState.lastConnectionId,to:r.current}),this.trackingState.lastConnectionId=r.current,void 0===u||u===this.trackingState.lastChainId?[3,2]:[4,this.applyChainForTrackedWallet(e,u)]):[3,3];case 1:a.sent(),a.label=2;case 2:return[2];case 3:return e?(l=++this.transitionGeneration,void 0===(d=null!==(I=this.getActiveConnectionChainId(r))&&void 0!==I?I:r.chainId)?[2]:o?t&&this.isAddressConnected(r,t)?(s.logger.info("WagmiEventHandler: Tracked connector fell away, account still connected elsewhere",{address:t,connection:r.current}),this.trackingState.lastConnectionId=r.current,(null===(T=this.trackingState.lastAddress)||void 0===T?void 0:T.toLowerCase())!==e.toLowerCase()?[3,6]:this.trackingState.lastChainId===d?[3,5]:[4,this.applyChainForTrackedWallet(e,d)]):[3,7]:[3,14]):[2];case 4:a.sent(),a.label=5;case 5:return[2];case 6:return[3,14];case 7:if(!t)return[3,14];if(s.logger.info("WagmiEventHandler: Tracked connector disconnected, wagmi fell back to another connection",{disconnected:t,fallback:e}),f=this.trackingState.lastChainId,this.releaseTrackedWallet(),!this.formo.isAutocaptureEnabled("disconnect")||!this.isEmittingOwner)return[3,12];a.label=8;case 8:return a.trys.push([8,10,,11]),[4,this.formo.disconnect({chainId:f,address:t})];case 9:return a.sent(),[3,11];case 10:return v=a.sent(),s.logger.error("WagmiEventHandler: Error tracking connector fallback disconnect:",v),[3,11];case 11:return[3,13];case 12:this.formo.syncWalletState({chainId:f}),a.label=13;case 13:g=void 0;try{g=this.getState()}catch(e){}if(y=!this.disposed&&"connected"===(null==g?void 0:g.status)&&g.current===r.current,l!==this.transitionGeneration||!y)return s.logger.debug("WagmiEventHandler: A newer transition superseded this one, stopping",{address:e}),this.restoreCentralStateFromTracking(),[2];a.label=14;case 14:if(s.logger.info("WagmiEventHandler: Active account switched",{from:t,to:e,chainId:d}),this.formo.syncWalletState({chainId:d,address:e}),(null===(x=this.formo.currentAddress)||void 0===x?void 0:x.toLowerCase())!==e.toLowerCase())return s.logger.debug("WagmiEventHandler: Central state declined the switched account, not adopting",{address:e,chainId:d}),this.releaseTrackedWallet(),[2];if(this.trackingState.lastAddress=e,this.trackingState.lastChainId=d,this.trackingState.lastConnectionId=r.current,!(this.formo.isAutocaptureEnabled("connect")&&this.isEmittingOwner&&this.formo.willTrackEvent(d)))return[3,18];if(t&&!this.isAddressConnected(r,t)&&h.delete(p(this.formo.writeKey,t)),m=p(this.formo.writeKey,e),b=r.current?r.connections.get(r.current):void 0,A="none"!==k(m,b),O(m,b),A)return s.logger.debug("WagmiEventHandler: Fallback connection was already announced, not re-emitting connect",{address:e}),[2];a.label=15;case 15:return a.trys.push([15,17,,18]),S=this.getConnectorName(r),[4,this.formo.connect({chainId:d,address:e},n({},S&&{providerName:S}))];case 16:return a.sent(),[3,18];case 17:return w=a.sent(),P(m,b),s.logger.error("WagmiEventHandler: Error tracking account switch:",w),[3,18];case 18:return[2]}})})},e.prototype.applyChainForTrackedWallet=function(e,t){return i(this,void 0,void 0,function(){var r,n;return a(this,function(i){switch(i.label){case 0:if(this.formo.syncWalletState({chainId:t,address:e}),(null===(n=this.formo.currentAddress)||void 0===n?void 0:n.toLowerCase())!==e.toLowerCase())return s.logger.debug("WagmiEventHandler: Central state declined the new chain, dropping the wallet",{address:e,chainId:t}),this.releaseTrackedWallet(),[2];if(this.trackingState.lastChainId=t,!this.formo.isAutocaptureEnabled("chain")||!this.isEmittingOwner)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.formo.chain({chainId:t,address:e})];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),s.logger.error("WagmiEventHandler: Error tracking chain change:",r),[3,4];case 4:return[2]}})})},e.prototype.handleChainChange=function(e,t){return i(this,void 0,void 0,function(){var r,n,i,o,c,u,l,d;return a(this,function(a){switch(a.label){case 0:if(void 0!==this.fallbackProvider&&((r=this.getState()).current?null===(u=r.connections.get(r.current))||void 0===u?void 0:u.connector:void 0)===this.fallbackConnector)try{null===(d=(l=this.formo)._rememberWagmiProviderChain)||void 0===d||d.call(l,this.fallbackProvider,e)}catch(e){}return e===t||void 0===e?[2]:"connected"!==(n=this.getState()).status?(this.pendingChainId=e,[2]):(this.pendingChainId=void 0,(i=this.getConnectedAddress(n))?void 0!==this.trackingState.lastConnectionId&&void 0!==n.current&&n.current!==this.trackingState.lastConnectionId?(s.logger.debug("WagmiEventHandler: Chain change belongs to a connection not adopted yet, deferring",{chainId:e,from:this.trackingState.lastConnectionId,to:n.current}),[2]):(o=!!this.trackingState.lastAddress,c=this.isCurrentWalletAnnounced(),o&&c||(this.retryAdoption(),c||!this.isCurrentWalletAnnounced())?(s.logger.info("WagmiEventHandler: Chain changed",{chainId:e,prevChainId:t,address:i}),[4,this.applyChainForTrackedWallet(i,e)]):[2]):(s.logger.warn("WagmiEventHandler: Chain changed but no address found"),[2]));case 1:return a.sent(),[2]}})})},e.prototype.setupMutationTracking=function(){var e=this;if(this.queryClient){s.logger.info("WagmiEventHandler: Setting up mutation tracking");var t=this.queryClient.getMutationCache().subscribe(function(t){e.handleMutationEvent(t)});this.unsubscribers.push(t),s.logger.info("WagmiEventHandler: Mutation tracking set up successfully")}},e.prototype.setupQueryTracking=function(){var e=this;if(this.queryClient){s.logger.info("WagmiEventHandler: Setting up query tracking");var t=this.queryClient.getQueryCache().subscribe(function(t){e.handleQueryEvent(t)});this.unsubscribers.push(t),s.logger.info("WagmiEventHandler: Query tracking set up successfully")}},e.prototype.handleQueryEvent=function(e){if("updated"===e.type&&this.isEmittingOwner){var t=e.query,r=t.queryKey;if(r&&0!==r.length){var n=r[0];if("waitForTransactionReceipt"===n||"callsStatus"===n)if("callsStatus"!==n){var i=t.state,a=i.data,o=null==a?void 0:a.status,c="".concat(t.queryHash,":").concat(i.status,":").concat(o||"");this.processedQueries.has(c)?s.logger.debug("WagmiEventHandler: Skipping duplicate query event",{queryType:n,queryHash:t.queryHash,status:i.status,receiptStatus:o}):(this.processedQueries.add(c),s.logger.debug("WagmiEventHandler: Query event",{queryType:n,queryHash:t.queryHash,status:i.status}),this.handleTransactionReceiptQuery(t),R(this.processedQueries))}else this.handleCallsStatusQuery(t)}}},e.prototype.settleFromCachedCallsStatus=function(e){var t,r,n;try{var i=null===(t=this.queryClient)||void 0===t?void 0:t.getQueryCache(),a=null===(r=null==i?void 0:i.getAll)||void 0===r?void 0:r.call(i);if(!Array.isArray(a))return;for(var o=0,c=a;o<c.length;o++){var u=c[o],l=null==u?void 0:u.queryKey;Array.isArray(l)&&"callsStatus"===l[0]&&(null===(n=l[1])||void 0===n?void 0:n.id)===e&&this.handleCallsStatusQuery(u)}}catch(e){s.logger.debug("WagmiEventHandler: cached callsStatus scan failed",e)}},e.prototype.handleCallsStatusQuery=function(e){var t,r=this;if(this.formo.isAutocaptureEnabled("transaction")){var i=e.queryKey[1],a=null==i?void 0:i.id;if(a){var o=this.pendingBatches.get(a);if(o){var c=e.state;if("success"===c.status&&c.data)try{var l=c.data,d=(0,u.readBatchStatusCode)(l);if(void 0===d||d<200)return;s.logger.debug("WagmiEventHandler: batch settled",{batchId:a,code:d});var h=o.chainIdWasExplicit?o.chainId:null!==(t=(0,u.readBatchChainId)(l))&&void 0!==t?t:o.chainId;o.calls.forEach(function(e,t){var i=(0,u.batchReceiptForCall)(l,t,o.calls.length),s=(0,u.batchCallOutcome)(d,i);void 0!==s&&r.formo.transaction(n(n(n(n({status:s,chainId:h||0,address:o.address},e.data&&{data:e.data}),e.to&&{to:e.to}),e.value&&{value:e.value}),(null==i?void 0:i.transactionHash)?{transactionHash:i.transactionHash}:{}),n({batch_size:o.calls.length,batch_index:t,batch_id:a},o.providerName?{providerName:o.providerName}:{}))}),this.pendingBatches.delete(a)}catch(e){s.logger.error("WagmiEventHandler: callsStatus error:",e)}}else s.logger.debug("WagmiEventHandler: unobserved batch",{batchId:a})}}},e.prototype.handleTransactionReceiptQuery=function(e){var t,r;if(this.formo.isAutocaptureEnabled("transaction")){var i=e.state,a=e.queryKey;if("success"===i.status){var c=a[1],u=null==c?void 0:c.hash,l=null==c?void 0:c.chainId;if(u){var d=u.toLowerCase(),h=this.pendingTransactions.get(d);if(h){var f=h.address,p=h.chainIdWasExplicit?h.chainId:null!==(t=null!=l?l:h.chainId)&&void 0!==t?t:this.trackingState.lastChainId;if(f)try{var v=i.data;if("success"!==(null==v?void 0:v.status)&&"reverted"!==(null==v?void 0:v.status))return void s.logger.debug("WagmiEventHandler: Receipt without explicit success/reverted status; ignoring",{transactionHash:u,status:null==v?void 0:v.status});var g="reverted"===v.status?o.TransactionStatus.REVERTED:o.TransactionStatus.CONFIRMED;s.logger.info("WagmiEventHandler: Tracking transaction confirmation",{status:g,transactionHash:u,address:f,chainId:p,blockNumber:null===(r=null==v?void 0:v.blockNumber)||void 0===r?void 0:r.toString()}),this.formo.transaction(n(n(n(n(n({status:g,chainId:p||0,address:f,transactionHash:u},(null==h?void 0:h.data)&&{data:h.data}),(null==h?void 0:h.to)&&{to:h.to}),(null==h?void 0:h.value)&&{value:h.value}),(null==h?void 0:h.function_name)&&{function_name:h.function_name}),(null==h?void 0:h.function_args)&&{function_args:h.function_args}),n(n({},(null==h?void 0:h.providerName)?{providerName:h.providerName}:this.mutationAttribution()),null==h?void 0:h.safeFunctionArgs)),this.pendingTransactions.delete(d)}catch(e){s.logger.error("WagmiEventHandler: Error handling transaction receipt query:",e)}else s.logger.warn("WagmiEventHandler: Transaction receipt query but no address available")}else s.logger.debug("WagmiEventHandler: Receipt for unobserved tx hash; ignoring",{transactionHash:u})}else s.logger.warn("WagmiEventHandler: Transaction receipt query but no hash found")}}},e.prototype.handleMutationEvent=function(e){if("updated"===e.type&&this.isEmittingOwner){var t=e.mutation,r=t.options.mutationKey;if(r&&0!==r.length){var n=r[0],i=t.state,a="".concat(t.mutationId,":").concat(i.status);this.processedMutations.has(a)?s.logger.debug("WagmiEventHandler: Skipping duplicate mutation event",{mutationType:n,mutationId:t.mutationId,status:i.status}):(this.processedMutations.add(a),s.logger.debug("WagmiEventHandler: Mutation event",{mutationType:n,mutationId:t.mutationId,status:i.status}),"signMessage"!==n&&"signTypedData"!==n||this.handleSignatureMutation(n,t),"sendTransaction"!==n&&"writeContract"!==n||this.handleTransactionMutation(n,t),"sendCalls"===n&&this.handleSendCallsMutation(t),R(this.processedMutations))}}},e.prototype.hasMatchingPendingMutation=function(e,t){var r,n,i,a,o,s;try{var c=null===(r=this.queryClient)||void 0===r?void 0:r.getMutationCache(),u=null===(n=null==c?void 0:c.getAll)||void 0===n?void 0:n.call(c);if(!Array.isArray(u))return!1;var l={personal_sign:["signMessage"],eth_signTypedData_v4:["signTypedData"],eth_sendTransaction:["sendTransaction","writeContract"],wallet_sendCalls:["sendCalls"]}[e];if(!l)return!1;for(var d=0,h=u;d<h.length;d++){var f=h[d];if("pending"===(null===(i=null==f?void 0:f.state)||void 0===i?void 0:i.status)){var p=null===(o=null===(a=null==f?void 0:f.options)||void 0===a?void 0:a.mutationKey)||void 0===o?void 0:o[0];if("string"==typeof p&&l.includes(p)){var v=null===(s=f.state)||void 0===s?void 0:s.variables;if("sendTransaction"===p&&v){var g=Array.isArray(t)?t[0]:void 0,y=v.to;if("string"==typeof(null==g?void 0:g.to)&&"string"==typeof y&&g.to.toLowerCase()!==y.toLowerCase())continue}return!0}}}return!1}catch(e){return!1}},e.prototype.mutationAttribution=function(){try{var e=this.getConnectorName(this.getState());return e?{providerName:e}:void 0}catch(e){return}},e.prototype.handleSignatureMutation=function(e,t){var r,n,i,a;if(this.formo.isAutocaptureEnabled("signature")){var c=t.state,u=c.variables||{},l=null!==(a=null!==(i=null!==(n=T(null===(r=u.domain)||void 0===r?void 0:r.chainId))&&void 0!==n?n:T(u.chainId))&&void 0!==i?i:this.trackingState.lastChainId)&&void 0!==a?a:0,d=x(u.account)||this.trackingState.lastAddress;if(d)try{var h;if("pending"===c.status)h=o.SignatureStatus.REQUESTED;else if("success"===c.status)h=o.SignatureStatus.CONFIRMED;else{if("error"!==c.status)return;h=o.SignatureStatus.REJECTED}var f;f="signMessage"===e?u.message||"":JSON.stringify(u.message||u.types||{}),s.logger.info("WagmiEventHandler: Tracking signature event",{status:h,mutationType:e,address:d,chainId:l}),this.formo.signature({status:h,chainId:l,address:d,message:f},this.mutationAttribution())}catch(e){s.logger.error("WagmiEventHandler: Error handling signature mutation:",e)}else s.logger.warn("WagmiEventHandler: Signature event but no address available")}},e.prototype.handleTransactionMutation=function(e,t){var r,i;if(this.formo.isAutocaptureEnabled("transaction")){var a=t.state,c=a.variables||{},u=T(c.chainId),h=null!=u?u:this.trackingState.lastChainId,f=x(c.account)||c.from||this.trackingState.lastAddress;if(f)try{var p,v=void 0;if("pending"===a.status)p=o.TransactionStatus.STARTED;else if("success"===a.status)p=o.TransactionStatus.BROADCASTED,v=a.data;else{if("error"!==a.status)return;p=o.TransactionStatus.REJECTED}var g=void 0,y=void 0,m=void 0,b=void 0,A=null===(r=c.value)||void 0===r?void 0:r.toString();if("writeContract"===e){var S=c.abi,w=c.functionName,E=c.args,_=c.address,C=c.dataSuffix;if(y=_,m=w,S&&w){b=(0,l.extractFunctionArgs)(S,w,E);var I=(0,l.encodeWriteContractData)(S,w,E);I&&(g=(0,l.concatCalldataWithSuffix)(I,C),s.logger.debug("WagmiEventHandler: Encoded writeContract data",g.substring(0,10)))}}else g=c.data,y=c.to;s.logger.info("WagmiEventHandler: Tracking transaction event",{status:p,mutationType:e,address:f,chainId:h,transactionHash:v,function_name:m});var k=(0,l.buildSafeFunctionArgs)(b,d);if(p===o.TransactionStatus.BROADCASTED&&v){var P=v.toLowerCase(),O=n(n(n(n(n(n(n(n(n({address:f},null!==(i=this.mutationAttribution())&&void 0!==i?i:{}),void 0!==h&&{chainId:h}),{chainIdWasExplicit:void 0!==u}),g&&{data:g}),y&&{to:y}),A&&{value:A}),m&&{function_name:m}),b&&{function_args:b}),k&&{safeFunctionArgs:k});if(this.pendingTransactions.set(P,O),s.logger.debug("WagmiEventHandler: Stored pending transaction for confirmation",{transactionHash:P}),this.pendingTransactions.size>100)for(var R=Array.from(this.pendingTransactions.keys()),L=0;L<50&&L<R.length;L++)this.pendingTransactions.delete(R[L])}this.formo.transaction(n(n(n(n(n(n({status:p,chainId:h||0,address:f},g&&{data:g}),y&&{to:y}),A&&{value:A}),v&&{transactionHash:v}),m&&{function_name:m}),b&&{function_args:b}),n(n({},this.mutationAttribution()),k))}catch(e){s.logger.error("WagmiEventHandler: Error handling transaction mutation:",e)}else s.logger.warn("WagmiEventHandler: Transaction event but no address available")}},e.prototype.handleSendCallsMutation=function(e){var t=this;if(this.formo.isAutocaptureEnabled("transaction")){var r=e.state,i=r.variables||{},a=Array.isArray(i.calls)?i.calls:[];if(0!==a.length){var c=T(i.chainId),l=null!=c?c:this.trackingState.lastChainId,d=x(i.account)||this.trackingState.lastAddress;if(d)try{var h=a.map(function(e){return{to:null==e?void 0:e.to,value:void 0!==(null==e?void 0:e.value)?String(e.value):void 0,data:null==e?void 0:e.data}}),f=this.mutationAttribution(),p=function(e,r){h.forEach(function(i,a){t.formo.transaction(n(n(n({status:e,chainId:l||0,address:d},i.data&&{data:i.data}),i.to&&{to:i.to}),i.value&&{value:i.value}),n(n({batch_size:h.length,batch_index:a},f),r))})};if("pending"===r.status)s.logger.debug("WagmiEventHandler: sendCalls start",{calls:h.length}),p(o.TransactionStatus.STARTED);else if("success"===r.status){var v=(0,u.readBatchId)(r.data);if(s.logger.debug("WagmiEventHandler: sendCalls broadcast",{batchId:v}),p(o.TransactionStatus.BROADCASTED,v?{batch_id:v}:void 0),v){if(this.pendingBatches.set(v,n(n(n({address:d},null!=f?f:{}),void 0!==l&&{chainId:l}),{chainIdWasExplicit:void 0!==c,calls:h})),this.pendingBatches.size>100)for(var g=Array.from(this.pendingBatches.keys()),y=0;y<50&&y<g.length;y++)this.pendingBatches.delete(g[y]);this.settleFromCachedCallsStatus(v)}}else"error"===r.status&&A(r.error)&&(s.logger.debug("WagmiEventHandler: sendCalls rejected"),p(o.TransactionStatus.REJECTED))}catch(e){s.logger.error("WagmiEventHandler: sendCalls error:",e)}else s.logger.warn("WagmiEventHandler: sendCalls without address")}}},e.prototype.getState=function(){return"function"==typeof this.wagmiConfig.getState?this.wagmiConfig.getState():this.wagmiConfig.state?this.wagmiConfig.state:(s.logger.warn("WagmiEventHandler: Unable to get state from config, returning default state"),{status:"disconnected",connections:new Map,current:void 0,chainId:void 0})},e.prototype.getActiveConnectionChainId=function(e){var t;if(e.current)return null===(t=e.connections.get(e.current))||void 0===t?void 0:t.chainId},e.prototype.getConnectedAddress=function(e){if(e.current){var t=e.connections.get(e.current);if(t&&0!==t.accounts.length)return t.accounts[0]}},e.prototype.isAddressConnected=function(e,t){var r=t.toLowerCase(),n=!1;return e.connections.forEach(function(e){!n&&e.accounts.some(function(e){return e.toLowerCase()===r})&&(n=!0)}),n},e.prototype.attributionForConnector=function(e,t){var r=this.nameForConnector(e,t);if(r){var i=e.rdns,a="string"==typeof i&&i.length>0?i:Array.isArray(i)&&1===i.length&&"string"==typeof i[0]&&i[0].length>0?i[0]:void 0;return n({name:r},a&&{rdns:a})}},e.prototype.boundConnectorAttribution=function(e){var t=this;return function(){if(!t.disposed)try{return t.attributionForConnector(e,t.getState())}catch(e){return}}},e.prototype.nameForConnector=function(e,t){var r,n=S.get(e);if(n)return n;(t.current?null===(r=t.connections.get(t.current))||void 0===r?void 0:r.connector:void 0)===e&&this.kickWalletConnectPeerLookup(t);var i=e.name;return"string"==typeof i&&i.length>0?i:void 0},e.prototype.getConnectorName=function(e){if(e.current){var t=e.connections.get(e.current),r=null==t?void 0:t.connector;if(t&&r)return S.get(r)||(this.kickWalletConnectPeerLookup(e),r.name)}},e.prototype.wrapActiveConnectorProvider=function(e,t){var r,n,i,a=this;if(void 0===t&&(t=!1),!0===(null===(n=null===(r=this.formo.options)||void 0===r?void 0:r.wagmi)||void 0===n?void 0:n.eip1193Fallback)&&"connected"===e.status){var o=e.current?e.connections.get(e.current):void 0,s=null==o?void 0:o.connector;if(o&&"function"==typeof(null==s?void 0:s.getProvider)){var c=(null!==(i=this.wrapEpochs.get(s))&&void 0!==i?i:0)+1;this.wrapEpochs.set(s,c);var u=this.wrapSessionGeneration;t||this.wrapRetryCounts.delete(s);var l,d=function(){var e;if(!a.disposed&&a.wrapEpochs.get(s)===c){var t=(null!==(e=a.wrapRetryCounts.get(s))&&void 0!==e?e:0)+1;if(a.wrapRetryCounts.set(s,t),!(t>3)){var r=setTimeout(function(){var e;if(a.wrapRetryTimers.delete(r),!a.disposed){var t=a.getState();void 0!==t.current&&(null===(e=t.connections.get(t.current))||void 0===e?void 0:e.connector)===s&&a.wrapEpochs.get(s)===c&&a.wrapActiveConnectorProvider(t,!0)}},25*t);a.wrapRetryTimers.add(r)}}};try{l=s.getProvider()}catch(e){return void d()}l.then(function(e){var t,r,n,i;if(a.wrapEpochs.get(s)===c){var o=a.getState();if(!a.disposed&&a.wrapSessionGeneration===u&&"connected"===o.status&&void 0!==o.current&&(null===(t=o.connections.get(o.current))||void 0===t?void 0:t.connector)===s){var l=null!==(r=a.getActiveConnectionChainId(o))&&void 0!==r?r:o.chainId;!0===(null===(i=(n=a.formo)._wrapWagmiProvider)||void 0===i?void 0:i.call(n,e,"number"==typeof l?l:void 0,a.boundConnectorAttribution(s)))?(a.wrapRetryCounts.delete(s),a.fallbackConnector=s,a.fallbackProvider=e):d()}}}).catch(function(){d()})}}},e.prototype.kickWalletConnectPeerLookup=function(e){var t,r,n=e.current?e.connections.get(e.current):void 0,i=null==n?void 0:n.connector;if(n&&i&&"string"==typeof i.name&&/walletconnect/i.test(i.name)&&"function"==typeof i.getProvider&&!w.has(n)){w.add(n),E.get(i)!==n&&S.delete(i),E.set(i,n);var a=!1,o=setTimeout(function(){a||E.get(i)!==n||S.delete(i)},3e3);null===(r=(t=o).unref)||void 0===r||r.call(t),i.getProvider().then(function(e){if(a=!0,clearTimeout(o),E.get(i)===n){var t=(0,c.readWalletConnectPeer)(e);(null==t?void 0:t.name)?(S.set(i,t.name),s.logger.debug("WagmiEventHandler: WalletConnect peer resolved",{peer:t.name})):(S.delete(i),w.delete(n))}}).catch(function(){a=!0,clearTimeout(o),E.get(i)===n&&S.delete(i),w.delete(n)})}},e.prototype.cleanup=function(){if(this.wrapRetryTimers.forEach(function(e){return clearTimeout(e)}),this.wrapRetryTimers.clear(),s.logger.debug("WagmiEventHandler: Cleaning up subscriptions"),!this.disposed){this.disposed=!0,this.transitionGeneration+=1,this.ownerKey&&y.get(this.ownerKey)===this&&y.delete(this.ownerKey);var e=function(e){var r,n,i,a=Math.max(0,(null!==(r=v.get(e))&&void 0!==r?r:0)-1);v.set(e,a);var o=0===a;if(a>0||g.has(e))return o;var s=setTimeout(function(){g.delete(e);var t="".concat(e,":");h.forEach(function(e){e.startsWith(t)&&h.delete(e)})},t.MARKER_GRACE_MS);return null===(i=(n=s).unref)||void 0===i||i.call(n),g.set(e,s),o}(this.formo.writeKey);e&&this.ownerKey&&function(e){var r,n;if(!I.has(e)){var i=setTimeout(function(){I.delete(e),_.delete(e),C.delete(e)},t.MARKER_GRACE_MS);null===(n=(r=i).unref)||void 0===n||n.call(r),I.set(e,i)}}(this.ownerKey)}for(var r=0,n=this.unsubscribers;r<n.length;r++){var i=n[r];try{i()}catch(e){s.logger.error("WagmiEventHandler: Error during cleanup:",e)}}this.unsubscribers=[],this.processedMutations.clear(),this.processedQueries.clear(),s.logger.debug("WagmiEventHandler: Cleanup complete")},e}();t.WagmiEventHandler=L},5707(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.WagmiEventHandler=void 0;var n=r(8788);Object.defineProperty(t,"WagmiEventHandler",{enumerable:!0,get:function(){return n.WagmiEventHandler}})},5170(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.flattenObject=a,t.concatCalldataWithSuffix=function(e,t){if(!t||"0x"===t)return e;var r=s();if(null==r?void 0:r.concatHex)return r.concatHex([e,t]);var n=t.replace(/^0x/i,"");return"".concat(e).concat(n)},t.encodeWriteContractData=function(e,t,r){try{var n=s();return n?n.encodeFunctionData({abi:e,functionName:t,args:r||[]}):void i.logger.debug("WagmiEventHandler: viem not available, cannot encode function data")}catch(e){return void i.logger.warn("WagmiEventHandler: Failed to encode function data",e)}},t.extractFunctionArgs=function(e,t,r){if(e&&t&&r&&Array.isArray(r))try{var n=e.find(function(e){return"function"===e.type&&e.name===t});if(!(null==n?void 0:n.inputs)||!Array.isArray(n.inputs))return;var a={};return n.inputs.forEach(function(e,t){if(t<r.length){var n=r[t],i=e.name||"arg".concat(t);a[i]=o(n)}}),a}catch(e){return void i.logger.warn("WagmiEventHandler: Failed to extract function args",e)}},t.buildSafeFunctionArgs=function(e,t){if(e){for(var r={},n=0,o=Object.entries(e);n<o.length;n++){var s=o[n],c=s[0],u=s[1],l=c;if(t.has(c))do{l="arg_".concat(l)}while(l in e);if(r[l]=u,null!==u&&"object"==typeof u&&!Array.isArray(u))for(var d=a(u,l),h=0,f=Object.entries(d);h<f.length;h++){var p=f[h],v=p[0],g=p[1];v in r?i.logger.debug("WagmiEventHandler: Skipping flattened key collision",{flatKey:v,existingValue:r[v]}):r[v]=g}}return r}};var n,i=r(3312);function a(e,t){void 0===t&&(t="");for(var r={},n=0,i=Object.entries(e);n<i.length;n++){var o=i[n],s=o[0],c=o[1],u=t?"".concat(t,"_").concat(s):s;if(null===c||"object"!=typeof c||Array.isArray(c))r[u]=c;else{var l=a(c,u);Object.assign(r,l)}}return r}function o(e){if("bigint"==typeof e)return e.toString();if(Array.isArray(e))return e.map(o);if(null!==e&&"object"==typeof e){for(var t={},r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],a=i[0],s=i[1];t[a]=o(s)}return t}return e}function s(){if(void 0!==n)return n;try{var e=r(Object(function(){var e=new Error("Cannot find module 'viem'");throw e.code="MODULE_NOT_FOUND",e}()));if(null==e?void 0:e.encodeFunctionData)return n={encodeFunctionData:e.encodeFunctionData,concatHex:e.concatHex}}catch(e){}return n=null,null}},2690(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletStateStore=void 0;var i=r(49),a=r(6517),o=r(2257),s=r(3312),c=r(4657),u=r(9308),l=function(){function e(e){this.deps=e,this.state={evm:{},solana:{}},this.observationSeq=0,this.newestObservation={evm:0,solana:0},this.disconnectCount={evm:0,solana:0}}return Object.defineProperty(e.prototype,"activeNamespace",{get:function(){return this._activeNamespace},enumerable:!1,configurable:!0}),e.prototype.namespaceOf=function(e){return(0,u.isSolanaChainId)(e)?"solana":"evm"},Object.defineProperty(e.prototype,"evmAddress",{get:function(){return this.state.evm.address},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"evmChainId",{get:function(){return this.state.evm.chainId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"provider",{get:function(){return this.state.evm.provider},set:function(e){this.displaceProvider(this.state.evm.provider,e),this.state.evm.provider=e},enumerable:!1,configurable:!0}),e.prototype.observe=function(e){var t=++this.observationSeq;return this.newestObservation[e]=t,{id:t,namespace:e}},e.prototype.beginDisconnect=function(e){this.disconnectCount[e]++},e.prototype.disconnectsSoFar=function(e){return this.disconnectCount[e]},e.prototype.snapshot=function(e){return this.newestObservation[e]},e.prototype.isUnchangedSince=function(e,t){return this.newestObservation[e]===t},e.prototype.currentObservation=function(e){return{id:this.newestObservation[e],namespace:e}},e.prototype.isCurrent=function(e){return this.newestObservation[e.namespace]===e.id},e.prototype.set=function(e,t){var r="string"==typeof e?e:this.namespaceOf(e),n=this.state[r];"address"in t&&(n.address=t.address),"chainId"in t?n.chainId=t.chainId:"number"==typeof e&&(n.chainId=e),"evm"===r&&"provider"in t&&(this.displaceProvider(n.provider,t.provider),n.provider=t.provider),this._activeNamespace=r,this.syncDerived()},e.prototype.clear=function(e){"evm"===("string"==typeof e?e:this.namespaceOf(e))?(this.displaceProvider(this.state.evm.provider,void 0),this.state.evm={}):this.state.solana={},this.syncDerived()},e.prototype.reset=function(){var e=this.state.evm.provider;this.state={evm:{provider:e},solana:{}},this._activeNamespace=void 0,this.address=void 0,this.chainId=void 0},e.prototype.clearProvider=function(){this.provider=void 0},e.prototype.setActiveAddress=function(e){this.address=e,this.persist()},e.prototype.setActiveChainId=function(e){this.chainId=e,this.persist()},e.prototype.clearActiveChainId=function(){this.setActiveChainId(void 0)},e.prototype.syncWalletState=function(e){var t=e.chainId,r=e.address;if(this.observe(this.namespaceOf(t)),this.deps.isTrackingSuppressed()){if(!r)return void this.clearForChain(t);if(null==t)return;var n=this.namespaceOf(t),i=this.state[n].address,a=(0,c.validateAddress)(r,t);i&&a&&a!==i&&this.clear(t)}else if(r){if(null!=t){var o=(0,c.validateAddress)(r,t);o?this.set(t,{address:o}):s.logger.warn('syncWalletState: invalid address ("'.concat(r,'") for chain ').concat(t))}}else this.clearForChain(t)},e.prototype.backfill=function(e,t,r){if(r&&void 0!==t&&0!==t){var n=this.deps.providerChainId(r);void 0!==n&&n!==t&&(t=n)}if(!this.deps.isTrackingSuppressed()){var i=this.evmAddress;i?void 0!==t&&(0!==t||!this.evmChainId)&&i.toLowerCase()===e.toLowerCase()&&this.evmChainId!==t&&this.set("evm",{address:i,chainId:t}):this.set("evm",{address:e,chainId:t})}},e.prototype.clearStaleEvmWalletOnSwitchWhileSuppressed=function(e){var t=this.state.evm.address,r=(0,c.validateAndChecksumAddress)(e);t&&r&&r!==t&&this.clear("evm")},e.prototype.persist=function(){try{if(this.deps.isPersistedIdentityPurgeRequired())return void(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY);if(this.address){if(this.deps.isPageExcluded())return;var e=JSON.stringify(n({address:this.address},void 0!==this.chainId&&{chainId:this.chainId})),t=(0,o.getIdentityCookieDomain)(this.deps.crossSubdomainCookies());(0,a.cookie)().set(i.ACTIVE_WALLET_KEY,e,n(n({path:"/",expires:new Date(Date.now()+i.ACTIVE_WALLET_TTL_MS).toUTCString()},(0,o.getIdentityCookieSecurity)()),t?{domain:t}:{}))}else(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY)}catch(e){s.logger.warn("Failed to persist current wallet snapshot",e)}},e.prototype.load=function(){try{if(this.deps.isPersistedIdentityPurgeRequired())return void(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY);if(this.deps.isPageExcluded())return;var e=(0,a.cookie)().get(i.ACTIVE_WALLET_KEY);if(!e)return;var t=JSON.parse(e);if(!(null==t?void 0:t.address))return;var r=t.chainId,n=null==r;if(!(n||"number"==typeof r&&Number.isFinite(r)))return void(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY);var o=n?void 0:r,u=void 0===o?(0,c.validateAndChecksumAddress)(t.address)?"evm":"solana":this.namespaceOf(o),l=(0,c.validateAddress)(t.address,o);if(!l)return void(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY);var d=this.state[u];d.address=l,void 0!==o&&(d.chainId=o),this._activeNamespace=u,this.address=l,this.chainId=o}catch(e){s.logger.warn("Failed to restore persisted wallet snapshot",e),(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY)}},e.prototype.clearForChain=function(e){null!=e?this.clear(e):(this.clear("evm"),this.clear("solana"))},e.prototype.displaceProvider=function(e,t){e&&e!==t&&this.deps.onProviderDisplaced(e)},e.prototype.syncDerived=function(){var e=this._activeNamespace;if(e){var t=this.state[e];if(t.address||t.chainId)return this.address=t.address,this.chainId=t.chainId,void this.persist()}var r="evm"===e?"solana":"evm",n=this.state[r];if(n.address||n.chainId)return this.address=n.address,this.chainId=n.chainId,this._activeNamespace=r,void this.persist();this.address=void 0,this.chainId=void 0,this.persist()},e}();t.WalletStateStore=l},9478(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.requestProviders=t.announceProvider=t.createStore=void 0;var n=r(4887);Object.defineProperty(t,"createStore",{enumerable:!0,get:function(){return n.createStore}});var i=r(8919);Object.defineProperty(t,"announceProvider",{enumerable:!0,get:function(){return i.announceProvider}}),Object.defineProperty(t,"requestProviders",{enumerable:!0,get:function(){return i.requestProviders}})},4887(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.createStore=void 0;const n=r(8919);t.createStore=function(){const e=new Set;let t=[];const r=()=>(0,n.requestProviders)(r=>{t.some(({info:e})=>e.uuid===r.info.uuid)||(t=[...t,r],e.forEach(e=>e(t,{added:[r]})))});let i=r();return{_listeners:()=>e,clear(){e.forEach(e=>e([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),i?.()},findProvider:({rdns:e})=>t.find(t=>t.info.rdns===e),getProviders:()=>t,reset(){this.clear(),i?.(),i=r()},subscribe:(r,{emitImmediately:n}={})=>(e.add(r),n&&r(t,{added:t}),()=>e.delete(r))}}},8919(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.requestProviders=t.announceProvider=void 0,t.announceProvider=function(e){const t=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(e)});window.dispatchEvent(t);const r=()=>window.dispatchEvent(t);return window.addEventListener("eip6963:requestProvider",r),()=>window.removeEventListener("eip6963:requestProvider",r)},t.requestProviders=function(e){if("undefined"==typeof window)return;const t=t=>e(t.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}}},t={},r=function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}(5135);return r.FormoAnalytics})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("FormoAnalytics",[],t):"object"==typeof exports?exports.FormoAnalytics=t():e.FormoAnalytics=t()}(self,()=>(()=>{"use strict";var e={6839(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.notImplemented=t.bitMask=void 0,t.isBytes=i,t.abytes=a,t.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},t.numberToHexUnpadded=o,t.hexToNumber=s,t.bytesToHex=l,t.hexToBytes=h,t.bytesToNumberBE=function(e){return s(l(e))},t.bytesToNumberLE=function(e){return a(e),s(l(Uint8Array.from(e).reverse()))},t.numberToBytesBE=f,t.numberToBytesLE=function(e,t){return f(e,t).reverse()},t.numberToVarBytesBE=function(e){return h(o(e))},t.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=h(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!i(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const a=n.length;if("number"==typeof r&&a!==r)throw new Error(e+" of length "+r+" expected, got "+a);return n},t.concatBytes=p,t.equalBytes=function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r},t.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))},t.inRange=g,t.aInRange=function(e,t,r,n){if(!g(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)},t.bitLen=function(e){let t;for(t=0;e>r;e>>=n,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&n},t.bitSet=function(e,t,i){return e|(i?n:r)<<BigInt(t)},t.createHmacDrbg=function(e,t,r){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 r)throw new Error("hmacFn must be a function");let n=y(e),i=y(e),a=0;const o=()=>{n.fill(1),i.fill(0),a=0},s=(...e)=>r(i,n,...e),c=(e=y(0))=>{i=s(m([0]),e),n=s(),0!==e.length&&(i=s(m([1]),e),n=s())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=s();const t=n.slice();r.push(t),e+=n.length}return p(...r)};return(e,t)=>{let r;for(o(),c(e);!(r=t(u()));)c();return o(),r}},t.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=b[r];if("function"!=typeof i)throw new Error("invalid validator function");const a=e[t];if(!(n&&void 0===a||i(a,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+a)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e},t.memoized=function(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(void 0!==i)return i;const a=e(r,...n);return t.set(r,a),a}};const r=BigInt(0),n=BigInt(1);function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function a(e){if(!i(e))throw new Error("Uint8Array expected")}function o(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function s(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?r:BigInt("0x"+e)}const c="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){if(a(e),c)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=u[e[r]];return t}function d(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function h(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(c)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=d(e.charCodeAt(i)),a=d(e.charCodeAt(i+1));if(void 0===r||void 0===a){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+a}return n}function f(e,t){return h(e.toString(16).padStart(2*t,"0"))}function p(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];a(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const v=e=>"bigint"==typeof e&&r<=e;function g(e,t,r){return v(e)&&v(t)&&v(r)&&t<=e&&e<r}t.bitMask=e=>(n<<BigInt(e))-n;const y=e=>new Uint8Array(e),m=e=>Uint8Array.from(e),b={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||i(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")}},681(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.aoutput=t.anumber=t.aexists=t.abytes=void 0;const n=r(11);t.abytes=n.abytes,t.aexists=n.aexists,t.anumber=n.anumber,t.aoutput=n.aoutput},7734(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.SHA512_IV=t.SHA384_IV=t.SHA224_IV=t.SHA256_IV=t.HashMD=void 0,t.setBigUint64=i,t.Chi=function(e,t,r){return e&t^~e&r},t.Maj=function(e,t,r){return e&t^e&r^t&r};const n=r(11);function i(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),a=BigInt(4294967295),o=Number(r>>i&a),s=Number(r&a),c=n?4:0,u=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+u,s,n)}class a extends n.Hash{constructor(e,t,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=(0,n.createView)(this.buffer)}update(e){(0,n.aexists)(this),e=(0,n.toBytes)(e),(0,n.abytes)(e);const{view:t,buffer:r,blockLen:i}=this,a=e.length;for(let o=0;o<a;){const s=Math.min(i-this.pos,a-o);if(s===i){const t=(0,n.createView)(e);for(;i<=a-o;o+=i)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.aexists)(this),(0,n.aoutput)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:a,isLE:o}=this;let{pos:s}=this;t[s++]=128,(0,n.clean)(this.buffer.subarray(s)),this.padOffset>a-s&&(this.process(r,0),s=0);for(let e=s;e<a;e++)t[e]=0;i(r,a-8,BigInt(8*this.length),o),this.process(r,0);const c=(0,n.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)c.setUint32(4*e,d[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=n,e.pos=o,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}t.HashMD=a,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])},3842(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=b,t.fromBig=i,t.split=a;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function a(e,t=!1){const r=e.length;let n=new Uint32Array(r),a=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:s}=i(e[o],t);[n[o],a[o]]=[r,s]}return[n,a]}const o=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=o;const s=(e,t,r)=>e>>>r;t.shrSH=s;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;const l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;const d=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=d;const h=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=h;const f=(e,t)=>t;t.rotr32H=f;const p=(e,t)=>e;t.rotr32L=p;const v=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=v;const g=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=g;const y=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=y;const m=(e,t,r)=>e<<r-32|t>>>64-r;function b(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.rotlBL=m;const A=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=A;const S=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=S;const w=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=w;const E=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;t.add4H=E;const _=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=_;const C=(e,t,r,n,i,a)=>t+r+n+i+a+(e/2**32|0)|0;t.add5H=C;const I={fromBig:i,split:a,toBig:o,shrSH:s,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:d,rotrBL:h,rotr32H:f,rotr32L:p,rotlSH:v,rotlSL:g,rotlBH:y,rotlBL:m,add:b,add3L:A,add3H:S,add4L:w,add4H:E,add5H:C,add5L:_};t.default=I},9517(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},4072(e,t,r){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 n=r(7734),i=r(3842),a=r(11),o=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]),s=new Uint32Array(64);class c extends n.HashMD{constructor(e=32){super(64,e,8,!1),this.A=0|n.SHA256_IV[0],this.B=0|n.SHA256_IV[1],this.C=0|n.SHA256_IV[2],this.D=0|n.SHA256_IV[3],this.E=0|n.SHA256_IV[4],this.F=0|n.SHA256_IV[5],this.G=0|n.SHA256_IV[6],this.H=0|n.SHA256_IV[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:a,G:o,H:s}=this;return[e,t,r,n,i,a,o,s]}set(e,t,r,n,i,a,o,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|a,this.G=0|o,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)s[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=s[e-15],r=s[e-2],n=(0,a.rotr)(t,7)^(0,a.rotr)(t,18)^t>>>3,i=(0,a.rotr)(r,17)^(0,a.rotr)(r,19)^r>>>10;s[e]=i+s[e-7]+n+s[e-16]|0}let{A:r,B:i,C:c,D:u,E:l,F:d,G:h,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,a.rotr)(l,6)^(0,a.rotr)(l,11)^(0,a.rotr)(l,25))+(0,n.Chi)(l,d,h)+o[e]+s[e]|0,p=((0,a.rotr)(r,2)^(0,a.rotr)(r,13)^(0,a.rotr)(r,22))+(0,n.Maj)(r,i,c)|0;f=h,h=d,d=l,l=u+t|0,u=c,c=i,i=r,r=t+p|0}r=r+this.A|0,i=i+this.B|0,c=c+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,h=h+this.G|0,f=f+this.H|0,this.set(r,i,c,u,l,d,h,f)}roundClean(){(0,a.clean)(s)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,a.clean)(this.buffer)}}t.SHA256=c;class u extends c{constructor(){super(28),this.A=0|n.SHA224_IV[0],this.B=0|n.SHA224_IV[1],this.C=0|n.SHA224_IV[2],this.D=0|n.SHA224_IV[3],this.E=0|n.SHA224_IV[4],this.F=0|n.SHA224_IV[5],this.G=0|n.SHA224_IV[6],this.H=0|n.SHA224_IV[7]}}t.SHA224=u;const l=(()=>i.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))))(),d=(()=>l[0])(),h=(()=>l[1])(),f=new Uint32Array(80),p=new Uint32Array(80);class v extends n.HashMD{constructor(e=64){super(128,e,16,!1),this.Ah=0|n.SHA512_IV[0],this.Al=0|n.SHA512_IV[1],this.Bh=0|n.SHA512_IV[2],this.Bl=0|n.SHA512_IV[3],this.Ch=0|n.SHA512_IV[4],this.Cl=0|n.SHA512_IV[5],this.Dh=0|n.SHA512_IV[6],this.Dl=0|n.SHA512_IV[7],this.Eh=0|n.SHA512_IV[8],this.El=0|n.SHA512_IV[9],this.Fh=0|n.SHA512_IV[10],this.Fl=0|n.SHA512_IV[11],this.Gh=0|n.SHA512_IV[12],this.Gl=0|n.SHA512_IV[13],this.Hh=0|n.SHA512_IV[14],this.Hl=0|n.SHA512_IV[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:h,Gl:f,Hh:p,Hl:v}=this;return[e,t,r,n,i,a,o,s,c,u,l,d,h,f,p,v]}set(e,t,r,n,i,a,o,s,c,u,l,d,h,f,p,v){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|a,this.Dh=0|o,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|v}process(e,t){for(let r=0;r<16;r++,t+=4)f[r]=e.getUint32(t),p[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|f[e-15],r=0|p[e-15],n=i.rotrSH(t,r,1)^i.rotrSH(t,r,8)^i.shrSH(t,r,7),a=i.rotrSL(t,r,1)^i.rotrSL(t,r,8)^i.shrSL(t,r,7),o=0|f[e-2],s=0|p[e-2],c=i.rotrSH(o,s,19)^i.rotrBH(o,s,61)^i.shrSH(o,s,6),u=i.rotrSL(o,s,19)^i.rotrBL(o,s,61)^i.shrSL(o,s,6),l=i.add4L(a,u,p[e-7],p[e-16]),d=i.add4H(l,n,c,f[e-7],f[e-16]);f[e]=0|d,p[e]=0|l}let{Ah:r,Al:n,Bh:a,Bl:o,Ch:s,Cl:c,Dh:u,Dl:l,Eh:v,El:g,Fh:y,Fl:m,Gh:b,Gl:A,Hh:S,Hl:w}=this;for(let e=0;e<80;e++){const t=i.rotrSH(v,g,14)^i.rotrSH(v,g,18)^i.rotrBH(v,g,41),E=i.rotrSL(v,g,14)^i.rotrSL(v,g,18)^i.rotrBL(v,g,41),_=v&y^~v&b,C=g&m^~g&A,I=i.add5L(w,E,C,h[e],p[e]),k=i.add5H(I,S,t,_,d[e],f[e]),P=0|I,O=i.rotrSH(r,n,28)^i.rotrBH(r,n,34)^i.rotrBH(r,n,39),T=i.rotrSL(r,n,28)^i.rotrBL(r,n,34)^i.rotrBL(r,n,39),R=r&a^r&s^a&s,L=n&o^n&c^o&c;S=0|b,w=0|A,b=0|y,A=0|m,y=0|v,m=0|g,({h:v,l:g}=i.add(0|u,0|l,0|k,0|P)),u=0|s,l=0|c,s=0|a,c=0|o,a=0|r,o=0|n;const x=i.add3L(P,T,L);r=i.add3H(x,k,O,R),n=0|x}({h:r,l:n}=i.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:a,l:o}=i.add(0|this.Bh,0|this.Bl,0|a,0|o)),({h:s,l:c}=i.add(0|this.Ch,0|this.Cl,0|s,0|c)),({h:u,l}=i.add(0|this.Dh,0|this.Dl,0|u,0|l)),({h:v,l:g}=i.add(0|this.Eh,0|this.El,0|v,0|g)),({h:y,l:m}=i.add(0|this.Fh,0|this.Fl,0|y,0|m)),({h:b,l:A}=i.add(0|this.Gh,0|this.Gl,0|b,0|A)),({h:S,l:w}=i.add(0|this.Hh,0|this.Hl,0|S,0|w)),this.set(r,n,a,o,s,c,u,l,v,g,y,m,b,A,S,w)}roundClean(){(0,a.clean)(f,p)}destroy(){(0,a.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 g extends v{constructor(){super(48),this.Ah=0|n.SHA384_IV[0],this.Al=0|n.SHA384_IV[1],this.Bh=0|n.SHA384_IV[2],this.Bl=0|n.SHA384_IV[3],this.Ch=0|n.SHA384_IV[4],this.Cl=0|n.SHA384_IV[5],this.Dh=0|n.SHA384_IV[6],this.Dl=0|n.SHA384_IV[7],this.Eh=0|n.SHA384_IV[8],this.El=0|n.SHA384_IV[9],this.Fh=0|n.SHA384_IV[10],this.Fl=0|n.SHA384_IV[11],this.Gh=0|n.SHA384_IV[12],this.Gl=0|n.SHA384_IV[13],this.Hh=0|n.SHA384_IV[14],this.Hl=0|n.SHA384_IV[15]}}t.SHA384=g;const y=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),m=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class b extends v{constructor(){super(28),this.Ah=0|y[0],this.Al=0|y[1],this.Bh=0|y[2],this.Bl=0|y[3],this.Ch=0|y[4],this.Cl=0|y[5],this.Dh=0|y[6],this.Dl=0|y[7],this.Eh=0|y[8],this.El=0|y[9],this.Fh=0|y[10],this.Fl=0|y[11],this.Gh=0|y[12],this.Gl=0|y[13],this.Hh=0|y[14],this.Hl=0|y[15]}}t.SHA512_224=b;class A extends v{constructor(){super(32),this.Ah=0|m[0],this.Al=0|m[1],this.Bh=0|m[2],this.Bl=0|m[3],this.Ch=0|m[4],this.Cl=0|m[5],this.Dh=0|m[6],this.Dl=0|m[7],this.Eh=0|m[8],this.El=0|m[9],this.Fh=0|m[10],this.Fl=0|m[11],this.Gh=0|m[12],this.Gl=0|m[13],this.Hh=0|m[14],this.Hl=0|m[15]}}t.SHA512_256=A,t.sha256=(0,a.createHasher)(()=>new c),t.sha224=(0,a.createHasher)(()=>new u),t.sha512=(0,a.createHasher)(()=>new v),t.sha384=(0,a.createHasher)(()=>new g),t.sha512_256=(0,a.createHasher)(()=>new A),t.sha512_224=(0,a.createHasher)(()=>new b)},5391(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=void 0,t.keccakP=b;const n=r(3842),i=r(11),a=BigInt(0),o=BigInt(1),s=BigInt(2),c=BigInt(7),u=BigInt(256),l=BigInt(113),d=[],h=[],f=[];for(let e=0,t=o,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],d.push(2*(5*n+r)),h.push((e+1)*(e+2)/2%64);let i=a;for(let e=0;e<7;e++)t=(t<<o^(t>>c)*l)%u,t&s&&(i^=o<<(o<<BigInt(e))-o);f.push(i)}const p=(0,n.split)(f,!0),v=p[0],g=p[1],y=(e,t,r)=>r>32?(0,n.rotlBH)(e,t,r):(0,n.rotlSH)(e,t,r),m=(e,t,r)=>r>32?(0,n.rotlBL)(e,t,r):(0,n.rotlSL)(e,t,r);function b(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,a=r[i],o=r[i+1],s=y(a,o,1)^r[n],c=m(a,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=s,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=h[r],a=y(t,i,n),o=m(t,i,n),s=d[r];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=v[n],e[1]^=g[n]}(0,i.clean)(r)}class A extends i.Hash{constructor(e,t,r,n=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=a,(0,i.anumber)(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.swap32IfBE)(this.state32),b(this.state32,this.rounds),(0,i.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(e){(0,i.aexists)(this),e=(0,i.toBytes)(e),(0,i.abytes)(e);const{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){const a=Math.min(t-this.pos,n-i);for(let t=0;t<a;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,i.aexists)(this,!1),(0,i.abytes)(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const a=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,i.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,i.aoutput)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,i.clean)(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:a}=this;return e||(e=new A(t,r,n,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=a,e.destroyed=this.destroyed,e}}t.Keccak=A;const S=(e,t,r)=>(0,i.createHasher)(()=>new A(t,e,r));t.sha3_224=S(6,144,28),t.sha3_256=S(6,136,32),t.sha3_384=S(6,104,48),t.sha3_512=S(6,72,64),t.keccak_224=S(1,144,28),t.keccak_256=S(1,136,32),t.keccak_384=S(1,104,48),t.keccak_512=S(1,72,64);const w=(e,t,r)=>(0,i.createXOFer)((n={})=>new A(t,e,void 0===n.dkLen?r:n.dkLen,!0));t.shake128=w(31,168,16),t.shake256=w(31,136,32)},11(e,t,r){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=i,t.anumber=a,t.abytes=o,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");a(e.outputLen),a(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){o(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},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=s,t.byteSwap32=c,t.bytesToHex=function(e){if(o(e),u)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=l[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(u)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=d(e.charCodeAt(i)),a=d(e.charCodeAt(i+1));if(void 0===r||void 0===a){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+a}return n},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let a=0;a<e;a++){n(a);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=h,t.bytesToUtf8=function(e){return(new TextDecoder).decode(e)},t.toBytes=f,t.kdfInputToBytes=function(e){return"string"==typeof e&&(e=h(e)),o(e),e},t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];o(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},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=p,t.createOptHasher=v,t.createXOFer=g,t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return Uint8Array.from(n.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")};const n=r(9517);function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function a(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function o(e,...t){if(!i(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 s(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]=s(e[t]);return e}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.swap8IfBE=t.isLE?e=>e:e=>s(e),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?e=>e:c;const u=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),l=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function h(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function f(e){return"string"==typeof e&&(e=h(e)),o(e),e}function p(e){const t=t=>e().update(f(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function v(e){const t=(t,r)=>e(r).update(f(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function g(e){const t=(t,r)=>e(r).update(f(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}t.nextTick=async()=>{},t.Hash=class{},t.wrapConstructor=p,t.wrapConstructorWithOpts=v,t.wrapXOFConstructorWithOpts=g},5628(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.keccak512=t.keccak384=t.keccak256=t.keccak224=void 0;const n=r(5391),i=r(7393);t.keccak224=(0,i.wrapHash)(n.keccak_224),t.keccak256=(()=>{const e=(0,i.wrapHash)(n.keccak_256);return e.create=n.keccak_256.create,e})(),t.keccak384=(0,i.wrapHash)(n.keccak_384),t.keccak512=(0,i.wrapHash)(n.keccak_512)},6997(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(4072),i=r(7393);t.sha256=(0,i.wrapHash)(n.sha256)},7393(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.assertBytes=t.assertBool=t.utf8ToBytes=t.toHex=t.createView=t.concatBytes=t.bytesToHex=void 0,t.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},t.hexToBytes=function(e){const t=e.startsWith("0x")?e.substring(2):e;return(0,a.hexToBytes)(t)},t.equalsBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.wrapHash=function(e){return t=>((0,i.abytes)(t),e(t))};const n=r(6839);Object.defineProperty(t,"assertBool",{enumerable:!0,get:function(){return n.abool}});const i=r(681);Object.defineProperty(t,"assertBytes",{enumerable:!0,get:function(){return i.abytes}});const a=r(11);var o=r(11);Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return o.createView}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}})},1757(e,t){var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(e,t,n){var i=null;if(void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:i,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=i,t.jsxs=i},2942(e,t){var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),p=Symbol.iterator,v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,y={};function m(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||v}function b(){}function A(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||v}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=m.prototype;var S=A.prototype=new b;S.constructor=A,g(S,m.prototype),S.isPureReactComponent=!0;var w=Array.isArray;function E(){}var _={H:null,A:null,T:null,S:null},C=Object.prototype.hasOwnProperty;function I(e,t,n){var i=n.ref;return{$$typeof:r,type:e,key:t,ref:void 0!==i?i:null,props:n}}function k(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var P=/\/+/g;function O(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function T(e,t,i,a,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c,u,l=!1;if(null===e)l=!0;else switch(s){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case r:case n:l=!0;break;case h:return T((l=e._init)(e._payload),t,i,a,o)}}if(l)return o=o(e),l=""===a?"."+O(e,0):a,w(o)?(i="",null!=l&&(i=l.replace(P,"$&/")+"/"),T(o,t,i,"",function(e){return e})):null!=o&&(k(o)&&(c=o,u=i+(null==o.key||e&&e.key===o.key?"":(""+o.key).replace(P,"$&/")+"/")+l,o=I(c.type,u,c.props)),t.push(o)),1;l=0;var d,f=""===a?".":a+":";if(w(e))for(var v=0;v<e.length;v++)l+=T(a=e[v],t,i,s=f+O(a,v),o);else if("function"==typeof(v=null===(d=e)||"object"!=typeof d?null:"function"==typeof(d=p&&d[p]||d["@@iterator"])?d:null))for(e=v.call(e),v=0;!(a=e.next()).done;)l+=T(a=a.value,t,i,s=f+O(a,v++),o);else if("object"===s){if("function"==typeof e.then)return T(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(E,E):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,i,a,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function R(e,t,r){if(null==e)return e;var n=[],i=0;return T(e,n,"","",function(e){return t.call(r,e,i++)}),n}function L(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var x="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},D={map:R,forEach:function(e,t,r){R(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return R(e,function(){t++}),t},toArray:function(e){return R(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=f,t.Children=D,t.Component=m,t.Fragment=i,t.Profiler=o,t.PureComponent=A,t.StrictMode=a,t.Suspense=l,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return _.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=g({},e.props),i=e.key;if(null!=t)for(a in void 0!==t.key&&(i=""+t.key),t)!C.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(n[a]=t[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];n.children=o}return I(e.type,i,n)},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:s,_context:e},e},t.createElement=function(e,t,r){var n,i={},a=null;if(null!=t)for(n in void 0!==t.key&&(a=""+t.key),t)C.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(i[n]=t[n]);var o=arguments.length-2;if(1===o)i.children=r;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(n in o=e.defaultProps)void 0===i[n]&&(i[n]=o[n]);return I(e,a,i)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=_.T,r={};_.T=r;try{var n=e(),i=_.S;null!==i&&i(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(E,x)}catch(e){x(e)}finally{null!==t&&null!==r.types&&(t.types=r.types),_.T=t}},t.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},t.use=function(e){return _.H.use(e)},t.useActionState=function(e,t,r){return _.H.useActionState(e,t,r)},t.useCallback=function(e,t){return _.H.useCallback(e,t)},t.useContext=function(e){return _.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return _.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return _.H.useEffect(e,t)},t.useEffectEvent=function(e){return _.H.useEffectEvent(e)},t.useId=function(){return _.H.useId()},t.useImperativeHandle=function(e,t,r){return _.H.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return _.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return _.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return _.H.useMemo(e,t)},t.useOptimistic=function(e,t){return _.H.useOptimistic(e,t)},t.useReducer=function(e,t,r){return _.H.useReducer(e,t,r)},t.useRef=function(e){return _.H.useRef(e)},t.useState=function(e){return _.H.useState(e)},t.useSyncExternalStore=function(e,t,r){return _.H.useSyncExternalStore(e,t,r)},t.useTransition=function(){return _.H.useTransition()},t.version="19.2.6"},489(e,t,r){e.exports=r(2942)},1325(e,t,r){e.exports=r(1757)},8718(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.FormoAnalytics=void 0;var o=r(49),s=r(6517),c=r(2257),u=r(4992),l=r(9293),d=r(4203),h=r(3312),f=r(9582),p=r(5896),v=r(4657),g=r(8834),y=r(2690),m=r(2598),b=r(6653),A=r(5620),S=r(7295),w=r(7392),E=r(5707),_=r(9308),C=r(1951),I=r(6053),k=function(){function e(e,t){void 0===t&&(t={});var r,n,i,a=this;if(this.writeKey=e,this.options=t,this._announcedConnect=new WeakMap,this.isWagmiMode=!1,this.isEvmDisabled=!1,this._currentUrl="",this._pageHooksDisposed=!1,this._pageGeneration=0,this.currentUserId="",this.isCleanedUp=!1,this.config={writeKey:e},this.options=t,this.isWagmiMode=!!t.wagmi,this.isEvmDisabled=!1===t.evm,this.crossSubdomainCookies=null===(r=t.crossSubdomainCookies)||void 0===r||r,t.crossSubdomainCookies=this.crossSubdomainCookies,this.session=new p.FormoAnalyticsSession,this.currentUserId=(0,s.cookie)().get(o.SESSION_USER_ID_KEY)||void 0,this.identify=this.identify.bind(this),this.connect=this.connect.bind(this),this.disconnect=this.disconnect.bind(this),this.chain=this.chain.bind(this),this.signature=this.signature.bind(this),this.transaction=this.transaction.bind(this),this.detect=this.detect.bind(this),this.track=this.track.bind(this),this.registerProvider=this.registerProvider.bind(this),this.page=this.page.bind(this),this.reset=this.reset.bind(this),this.cleanup=this.cleanup.bind(this),this.optOutTracking=this.optOutTracking.bind(this),this.optInTracking=this.optInTracking.bind(this),this.hasOptedOutTracking=this.hasOptedOutTracking.bind(this),this.isAutocaptureEnabled=this.isAutocaptureEnabled.bind(this),this.syncPrivyActiveChain=this.syncPrivyActiveChain.bind(this),this.isTrackingSuppressed=this.isTrackingSuppressed.bind(this),this.getTrackedProvidersCount=this.getTrackedProvidersCount.bind(this),this.getProviderState=this.getProviderState.bind(this),this.syncWalletState=this.syncWalletState.bind(this),h.Logger.init({enabled:(null===(n=t.logger)||void 0===n?void 0:n.enabled)||!1,enabledLevels:(null===(i=t.logger)||void 0===i?void 0:i.levels)||[]}),this.evm=new m.EvmProviderRegistry({activeProvider:function(){return a.wallet.provider},activeChainId:function(){return a.wallet.evmChainId},knownEvmAddress:function(){return a.wallet.evmAddress},onChainObserved:function(e,t){e===a.wallet.provider&&"evm"===a.wallet.activeNamespace&&a.wallet.evmChainId!==t&&a.wallet.set("evm",{chainId:t})}}),this.wallet=new y.WalletStateStore({isPersistedIdentityPurgeRequired:function(){return a.trackingPolicy.isPersistedIdentityPurgeRequired()},isPageExcluded:function(){return a.trackingPolicy.isPageExcluded()},isTrackingSuppressed:function(){return a.trackingPolicy.isTrackingSuppressed()},crossSubdomainCookies:function(){return a.crossSubdomainCookies},providerChainId:function(e){return a.evm.chainIdOf(e)},onProviderDisplaced:function(e){return a.evmEvents.forgetAnnouncedConnect(e)}}),this.evmRequests=new S.EvmRequestTracker(this.wallet,this.evm,{isAutocaptureEnabled:function(e){return a.isAutocaptureEnabled(e)},signature:function(e,t){return a.signature(e,t)},transaction:function(e,t){return a.transaction(e,t)},shouldSkipRequestCapture:function(e,t){var r,n;return null!==(n=null===(r=a.wagmiHandler)||void 0===r?void 0:r.hasMatchingPendingMutation(e,t))&&void 0!==n&&n}}),this.evmEvents=new A.EvmEventTracker(this.wallet,this.evm,{isAutocaptureEnabled:function(e){return a.isAutocaptureEnabled(e)},isTrackingSuppressed:function(){return a.isTrackingSuppressed()},willTrackEvent:function(e){return a.willTrackEvent(e)},retryDetection:function(){return a.retryWalletDetection()},isWagmiMode:function(){return a.isWagmiMode},connect:function(e,t){return a.connect(e,t)},disconnect:function(e){return a.disconnect(e)},chain:function(e,t){return a.chain(e,t)},detect:function(e){return a.detect(e)},registerRequestListeners:function(e){return a.evmRequests.registerRequestListeners(e)}}),this.trackingPolicy=new g.TrackingPolicy({options:function(){return a.options},hasOptedOut:function(){return a.hasOptedOutTracking()},currentChainId:function(){return a.currentChainId}}),this.eventManager=new u.EventManager(new d.EventQueue(this.config.writeKey,{apiHost:t.apiHost||o.EVENTS_API_HOST,flushAt:t.flushAt,retryCount:t.retryCount,maxQueueSize:t.maxQueueSize,flushInterval:t.flushInterval,errorHandler:t.errorHandler,canSend:function(){return!a.hasOptedOutTracking()}}),t,function(){return!a.hasOptedOutTracking()}),this.hasOptedOutTracking()&&h.logger.info("User has previously opted out of tracking"),this.isEvmDisabled)h.logger.info("FormoAnalytics: EVM provider tracking disabled");else if(this.isWagmiMode&&t.wagmi)h.logger.info("FormoAnalytics: Initializing in Wagmi mode"),this.wagmiHandler=new E.WagmiEventHandler(this,t.wagmi.config,t.wagmi.queryClient);else{var c=void 0,l=t.provider;l?c=l:"undefined"!=typeof window&&window.ethereum&&(c=window.ethereum),c&&this.evmEvents.trackEIP1193Provider(c)}!1!==t.solana&&(this.solanaManager=new C.SolanaManager(this,"object"==typeof t.solana?t.solana:void 0)),this._currentUrl=window.location.href,this.wallet.load(),this.trackPageHit(),this.trackPageHits()}return Object.defineProperty(e.prototype,"_provider",{get:function(){return this.wallet.provider},set:function(e){this.wallet.provider=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_evmAddress",{get:function(){return this.wallet.evmAddress},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_evmChainId",{get:function(){return this.wallet.evmChainId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentAddress",{get:function(){return this.wallet.address},set:function(e){this.wallet.setActiveAddress(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentChainId",{get:function(){return this.wallet.chainId},set:function(e){this.wallet.setActiveChainId(e)},enumerable:!1,configurable:!0}),e.init=function(t,r){return i(this,void 0,void 0,function(){var n,i,o;return a(this,function(a){switch(a.label){case 0:return(0,s.initStorageManager)(t),(n=new e(t,r)).isEvmDisabled?(h.logger.info("FormoAnalytics: Skipping provider detection (EVM disabled)"),[3,5]):[3,1];case 1:return a.trys.push([1,4,,5]),[4,n.evmEvents.getProviders()];case 2:return i=a.sent(),[4,n.evmEvents.detectWallets(i)];case 3:return a.sent(),n.isWagmiMode||n.evmEvents.trackProviders(i),[3,5];case 4:return o=a.sent(),h.logger.warn("FormoAnalytics: Provider discovery failed",o),[3,5];case 5:return[2,n]}})})},e.prototype.page=function(e,t,r,n,o){return i(this,void 0,void 0,function(){return a(this,function(i){switch(i.label){case 0:return[4,this.trackPageHit(e,t,r,n,o)];case 1:return i.sent(),[2]}})})},e.prototype.reset=function(){this.currentUserId=void 0,this.wallet.reset(),(0,s.cookie)().remove(o.SESSION_USER_ID_KEY),(0,s.cookie)().remove(p.SESSION_WALLET_DETECTED_KEY),(0,s.cookie)().remove(p.SESSION_WALLET_IDENTIFIED_KEY),(0,s.cookie)().remove(o.ACTIVE_WALLET_KEY)},e.prototype.cleanup=function(){if(this.isCleanedUp=!0,h.logger.debug("FormoAnalytics: Cleaning up resources"),this.eventManager.close(),this.evmRequests.cleanup(),this.evmEvents.cleanup(),this.wagmiHandler&&(this.wagmiHandler.cleanup(),this.wagmiHandler=void 0),this.solanaManager&&(this.solanaManager.cleanup(),this.solanaManager=void 0),!this.isWagmiMode)for(var e=0,t=this.evm.trackedProviders();e<t.length;e++){var r=t[e];this.evmEvents.untrackProvider(r)}this._pageHooksDisposed=!0,"undefined"!=typeof window&&(this._onPopStateListener&&(window.removeEventListener("popstate",this._onPopStateListener),this._onPopStateListener=void 0),this._onLocationChangeListener&&(window.removeEventListener("locationchange",this._onLocationChangeListener),this._onLocationChangeListener=void 0)),h.logger.debug("FormoAnalytics: Cleanup complete")},e.prototype.connect=function(e,t,r,n){return i(this,arguments,void 0,function(e,t,r,n){var i,s=e.chainId,c=e.address;return a(this,function(e){switch(e.label){case 0:return null==s?(h.logger.warn("Connect: Chain ID cannot be null or undefined"),[2]):c?(i=(0,v.validateAddress)(c,s))?this.isTrackingSuppressed()?(h.logger.info("connect() skipped: tracking is suppressed for this visitor or environment"),[2]):(this.wallet.observe(this.wallet.namespaceOf(s)),this.setChainState(s,{address:i}),[4,this.trackEvent(o.EventType.CONNECT,{chainId:s,address:i},t,r,n)]):(h.logger.warn('Connect: Invalid address provided ("'.concat(c,'"). Please provide a valid EVM or Solana address.')),[2]):(h.logger.warn("Connect: Address cannot be empty"),[2]);case 1:return e.sent(),[2]}})})},e.prototype.disconnect=function(e,t,r,s){return i(this,void 0,void 0,function(){var i,c,u,l,d,f,p;return a(this,function(a){switch(a.label){case 0:return i=(null==e?void 0:e.chainId)||this.currentChainId,c=(null==e?void 0:e.address)||this.currentAddress,u=(0,_.isSolanaChainId)(i),l=!u&&this._provider?this.getProviderInfo(this._provider):null,h.logger.info("Disconnect: Emitting disconnect event with:",{chainId:i,address:c,providerName:null==l?void 0:l.name,rdns:null==l?void 0:l.rdns}),d=n(n({},l&&{providerName:l.name,rdns:l.rdns}),t),f=this.wallet.namespaceOf(i),this.wallet.beginDisconnect(f),p=this.wallet.snapshot(f),[4,this.trackEvent(o.EventType.DISCONNECT,n(n({},i&&{chainId:i}),c&&{address:c}),d,r,s)];case 1:return a.sent(),this.wallet.isUnchangedSince(f,p)?(this.clearChainState(i),h.logger.info("Wallet disconnected: Cleared currentAddress, currentChainId, and provider"),[2]):(h.logger.info("Disconnect: A new session claimed this namespace while the event was in flight; leaving its state intact"),[2])}})})},e.prototype.setChainState=function(e,t){this.wallet.set(e,t)},e.prototype.clearChainState=function(e){this.wallet.clear(e)},e.prototype.syncWalletState=function(e){this.wallet.syncWalletState(e),this.retryWalletDetection()},e.prototype.retryWalletDetection=function(){this.isCleanedUp||this.evmEvents.detectWallets(this.evmEvents.detectableProviders())},e.prototype.clearActiveProvider=function(){this.wallet.clearProvider()},e.prototype.backfillActiveWallet=function(e,t,r){this.wallet.backfill(e,t,r)},e.prototype.clearStaleEvmWalletOnSwitchWhileSuppressed=function(e){this.wallet.clearStaleEvmWalletOnSwitchWhileSuppressed(e)},e.prototype.addProviderListener=function(e,t,r){this.evm.addListener(e,t,r)},e.prototype.removeProviderListeners=function(e){this.evm.removeListeners(e)},e.prototype.getProviderInfo=function(e){return this.evm.infoFor(e)},e.prototype.isProviderAlreadyWrapped=function(e,t){return this.evm.isWrapped(e,t)},e.prototype.resolveChainIdForProvider=function(e){return this.evm.resolveChainId(e)},e.prototype.rememberProviderChain=function(e,t){this.evm.rememberChain(e,t)},e.prototype.getAddress=function(e){return i(this,void 0,void 0,function(){return a(this,function(t){return[2,this.evm.addressOf(e)]})})},e.prototype.getAccounts=function(e){return i(this,void 0,void 0,function(){return a(this,function(t){return[2,this.evm.accountsOf(e)]})})},e.prototype.chain=function(e,t,r,n){return i(this,arguments,void 0,function(e,t,r,n){var i=e.chainId,s=e.address;return a(this,function(e){switch(e.label){case 0:return i&&0!==Number(i)?isNaN(Number(i))?(h.logger.warn("FormoAnalytics::chain: chainId must be a valid decimal number"),[2]):s||this.currentAddress?(this.setChainState(i,{}),[4,this.trackEvent(o.EventType.CHAIN,{chainId:i,address:s||this.currentAddress},t,r,n)]):(h.logger.warn("FormoAnalytics::chain: address was empty and no previous address has been recorded"),[2]):(h.logger.warn("FormoAnalytics::chain: chainId cannot be empty or 0"),[2]);case 1:return e.sent(),[2]}})})},e.prototype.signature=function(e,t,r,n){return i(this,arguments,void 0,function(e,t,r,n){var i=e.status,s=e.chainId,c=e.address,u=e.message;return a(this,function(e){switch(e.label){case 0:return[4,this.trackEvent(o.EventType.SIGNATURE,{status:i,chainId:s,address:c,message:u},t,r,n)];case 1:return e.sent(),[2]}})})},e.prototype.transaction=function(e,t,r,s){return i(this,arguments,void 0,function(e,t,r,i){var s=e.status,c=e.chainId,u=e.address,l=e.data,d=e.to,h=e.value,f=e.transactionHash,p=e.function_name,v=e.function_args;return a(this,function(e){switch(e.label){case 0:return[4,this.trackEvent(o.EventType.TRANSACTION,n(n(n({status:s,chainId:c,address:u,data:l,to:d,value:h},f&&{transactionHash:f}),p&&{function_name:p}),v&&{function_args:v}),t,r,i)];case 1:return e.sent(),[2]}})})},e.prototype.identify=function(e,t,r,u){return i(this,void 0,void 0,function(){var i,l,d,f,p,g,y,m,b,A,S,w,E,_,C,k,P,O,T,R,L,x;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,14,,15]),(i=e)&&"string"==typeof i.id&&void 0===i.address?(l=null!=t?t:{},[4,(0,I.identifyPrivyUser)(this,i,{activeAddress:l.activeAddress,properties:l.properties})]):[3,2];case 1:return a.sent(),[2];case 2:if(d=e,f=t,this.isTrackingSuppressed()||this.trackingPolicy.isChainExcluded())return h.logger.info("identify() skipped: tracking is suppressed for this visitor, environment, or chain"),[2];if(d)return[3,12];if(this.isWagmiMode)return h.logger.info("identify() without params is a no-op in Wagmi mode"),[2];h.logger.info("Auto-identifying with providers:",this.evm.all.map(function(e){return e.info.name})),p=0,g=this.evm.all,a.label=3;case 3:if(!(p<g.length))return[3,11];if(y=g[p],!(m=y.provider))return[3,10];a.label=4;case 4:return a.trys.push([4,9,,10]),[4,this.getAddress(m)];case 5:return(b=a.sent())?(A=(0,v.validateAndChecksumAddress)(b),h.logger.info("Auto-identify: Checking deduplication",{validAddress:A,rdns:y.info.rdns,providerName:y.info.name,isAlreadyIdentified:!!A&&this.session.isWalletIdentified(A,y.info.rdns,void 0,f)}),!A||this.session.isWalletIdentified(A,y.info.rdns,void 0,f)?[3,7]:(h.logger.info("Auto-identifying",A,y.info.name,y.info.rdns),[4,this.identify({address:A,providerName:y.info.name,rdns:y.info.rdns},f,r,u)])):[3,8];case 6:return a.sent(),[3,8];case 7:A&&h.logger.info("Auto-identify: Skipping already identified wallet",A,y.info.name,y.info.rdns),a.label=8;case 8:return[3,10];case 9:return S=a.sent(),h.logger.error("Failed to identify provider ".concat(y.info.name,":"),S),[3,10];case 10:return p++,[3,3];case 11:return[2];case 12:return w=d.address,E=d.providerName,_=d.userId,C=d.rdns,k=d.setActive,w?(h.logger.info("Identify",w,_,E,C),(P=(0,v.validateAddress)(w))?(!1!==k&&(this.wallet.setActiveAddress(P),_&&(this.currentUserId=_,O=(0,c.getIdentityCookieDomain)(this.crossSubdomainCookies),(0,s.cookie)().set(o.SESSION_USER_ID_KEY,_,n(n({path:"/"},(0,c.getIdentityCookieSecurity)()),O?{domain:O}:{})))),T=this.session.isWalletIdentified(P,C||"",_,f),h.logger.debug("Identify: Checking deduplication",{validAddress:P,rdns:C,providerName:E,userId:_,isAlreadyIdentified:T}),T?(h.logger.info("Identify: Wallet ".concat(E||"Unknown"," with address ").concat(P," already identified in this session (rdns: ").concat(C||"empty",")")),[2]):(this.session.markWalletIdentified(P,C||"",_,f),[4,this.trackEvent(o.EventType.IDENTIFY,{address:P,providerName:E,userId:_,rdns:C},f,r,u)])):(null===(x=h.logger.warn)||void 0===x||x.call(h.logger,"Invalid address provided to identify:",w),[2])):(null===(L=h.logger.warn)||void 0===L||L.call(h.logger,"identify() called without address - address is required"),[2]);case 13:return a.sent(),[3,15];case 14:return R=a.sent(),h.logger.log("identify error",R),[3,15];case 15:return[2]}})})},e.prototype.syncPrivyActiveChain=function(e,t){if(void 0!==this.currentChainId&&null!==this.currentChainId){var r,n=null==e?void 0:e.toLowerCase();"solana"===n?r=!0:("ethereum"===n||!n&&t&&/^0x[0-9a-f]{40}$/i.test(t))&&(r=!1),void 0!==r&&r!==(0,_.isSolanaChainId)(this.currentChainId)&&this.wallet.setActiveChainId(void 0)}},e.prototype.detect=function(e,t,r,n){return i(this,arguments,void 0,function(e,t,r,n){var i=e.providerName,s=e.rdns;return a(this,function(e){switch(e.label){case 0:return this.shouldTrack()?this.session.isWalletDetected(s)?[2,h.logger.warn("Detect: Wallet ".concat(i," already detected in this session"))]:(this.session.markWalletDetected(s),[4,this.trackEvent(o.EventType.DETECT,{providerName:i,rdns:s},t,r,n)]):(h.logger.info("detect() skipped: tracking is suppressed for this visitor or environment"),[2]);case 1:return e.sent(),[2]}})})},e.prototype.track=function(e,t,r,n){return i(this,void 0,void 0,function(){return a(this,function(i){switch(i.label){case 0:return[4,this.trackEvent(o.EventType.TRACK,{event:e},t,r,n)];case 1:return i.sent(),[2]}})})},e.prototype.willTrackEvent=function(e){return this.shouldTrack(e)},e.prototype.optOutTracking=function(){h.logger.info("Opting out of tracking"),(0,f.setConsentFlag)(this.writeKey,o.CONSENT_OPT_OUT_KEY,"true"),this._pageGeneration++,this.eventManager.clear(),this.evmEvents.markRegisteredAdoptionsPending(),this.reset(),(0,l.clearAnonymousId)(o.LOCAL_ANONYMOUS_ID_KEY),(0,s.session)().remove(o.SESSION_TRAFFIC_SOURCE_KEY),h.logger.info("Successfully opted out of tracking")},e.prototype.optInTracking=function(){var e,t=this;setTimeout(function(){if(!t.isCleanedUp)try{t.evmEvents.retryExternalAdoptions()}catch(e){}},0),h.logger.info("Opting back into tracking"),(0,f.removeConsentFlag)(this.writeKey,o.CONSENT_OPT_OUT_KEY),null===(e=this.wagmiHandler)||void 0===e||e.retryAdoption(),this.retryWalletDetection(),h.logger.info("Successfully opted back into tracking")},e.prototype.hasOptedOutTracking=function(){return"true"===(0,f.getConsentFlag)(this.writeKey,o.CONSENT_OPT_OUT_KEY)},e.prototype.onLocationChange=function(){return i(this,void 0,void 0,function(){var e;return a(this,function(t){return this._currentUrl!==window.location.href&&(this._currentUrl=window.location.href,null===(e=this.wagmiHandler)||void 0===e||e.retryAdoption(),this.trackPageHit()),[2]})})},e.prototype.trackPageHits=function(){var t=this;e.installHistoryHooksOnce(),this._onPopStateListener=function(){return t.onLocationChange()},this._onLocationChangeListener=function(){return t.onLocationChange()},window.addEventListener("popstate",this._onPopStateListener),window.addEventListener("locationchange",this._onLocationChangeListener)},e.installHistoryHooksOnce=function(){if("undefined"!=typeof history&&"undefined"!=typeof window){var e=Symbol.for("formo.historyWrapped");if(!history[e]){history[e]=!0;var t=function(){return window.dispatchEvent(new window.Event("locationchange"))},r=history.pushState;history.pushState=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=r.apply(this,e);return t(),i};var n=history.replaceState;history.replaceState=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=n.apply(this,e);return t(),i}}}},e.prototype.trackPageHit=function(e,t,r,n,s){return i(this,void 0,void 0,function(){var c,u,l=this;return a(this,function(d){if(c=this.shouldTrack(),!this.isCleanedUp&&c)try{this.evmEvents.retryExternalAdoptions(),this.retryWalletDetection()}catch(e){}return c?(u=this._pageGeneration,setTimeout(function(){l._pageHooksDisposed||u!==l._pageGeneration||i(l,void 0,void 0,function(){var i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.trackEvent(o.EventType.PAGE,{category:e,name:t},r,n,s)];case 1:return a.sent(),[3,3];case 2:return i=a.sent(),h.logger.error("Formo: Failed to track page hit",i),[3,3];case 3:return[2]}})})},300),[2]):(h.logger.info("Track page hit: Skipping event due to tracking configuration"),[2])})})},e.prototype.trackEvent=function(e,t,r,o,s){return i(this,void 0,void 0,function(){var i;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),this.shouldTrack(null==t?void 0:t.chainId)?[4,this.eventManager.addEvent(n(n({type:e},t),{properties:r,context:o,callback:s}),this.currentAddress,this.currentUserId)]:(h.logger.info("Skipping ".concat(e," event due to tracking configuration")),[2]);case 1:return a.sent(),[3,3];case 2:return i=a.sent(),h.logger.error("Error tracking event:",i),[3,3];case 3:return[2]}})})},e.prototype.isTrackingSuppressed=function(){return this.trackingPolicy.isTrackingSuppressed()},e.prototype.shouldTrack=function(e){return this.trackingPolicy.shouldTrack({chainId:e})},e.prototype.isAutocaptureEnabled=function(e){return this.trackingPolicy.isAutocaptureEnabled(e)},Object.defineProperty(e.prototype,"providers",{get:function(){return this.evm.all},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"provider",{get:function(){return this._provider},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"solana",{get:function(){return this.solanaManager||(this.solanaManager=new C.SolanaManager(this,void 0,!1)),this.solanaManager},enumerable:!1,configurable:!0}),e.prototype.getCurrentChainId=function(e){return i(this,void 0,void 0,function(){var t,r,n;return a(this,function(i){switch(i.label){case 0:if(!(t=e||this.provider))return h.logger.error("Provider not set for chain ID"),[2,0];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,t.request({method:"eth_chainId"})];case 2:return(r=i.sent())?[2,(0,w.parseChainId)(r)]:(h.logger.info("Chain id not found"),[2,0]);case 3:return n=i.sent(),h.logger.error("eth_chainId threw an error:",n),[2,0];case 4:return[2]}})})},e.prototype._wrapWagmiProvider=function(e,t,r){if(this.isCleanedUp||!(0,b.isValidProvider)(e))return!1;try{return!!this.evmRequests.registerRequestListeners(e)&&(this.evm.rememberAttribution(e,r),void 0!==t&&this.evm.rememberChain(e,t),!0)}catch(e){return h.logger.warn("Failed to wrap wagmi provider for hybrid capture",e),!1}},e.prototype._rememberWagmiProviderChain=function(e,t){if(!this.isCleanedUp)try{this.evm.rememberChain(e,t)}catch(e){}},e.prototype.registerProvider=function(t,r){var n,i,a;if(this.isCleanedUp)return h.logger.warn("registerProvider: instance is cleaned up; refusing"),!1;if(this.isEvmDisabled)return h.logger.warn("registerProvider: EVM tracking is disabled; refusing"),!1;if(this.isWagmiMode)return h.logger.warn("registerProvider: wagmi mode tracks connectors already; registering the provider here would double-report its events. Refusing."),!1;if(!(0,b.isValidProvider)(t))return h.logger.warn("registerProvider: not a valid EIP-1193 provider; refusing"),!1;var o=(0,b.detectInjectedProviderInfo)(t),s=(0,b.readWalletConnectPeer)(t),c=null!==(n=null==r?void 0:r.rdns)&&void 0!==n?n:s&&"io.injected.provider"===o.rdns?"com.walletconnect":o.rdns,u=null!==(i=null==r?void 0:r.name)&&void 0!==i?i:s?"WalletConnect":o.name,l="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"registered-".concat(c.replace(/[^a-zA-Z0-9]/g,"-"),"-").concat(e.registeredProviderSeq+=1);return this.evmEvents.adoptExternalProvider({info:{name:u,rdns:c,uuid:l,icon:null!==(a=null==r?void 0:r.icon)&&void 0!==a?a:o.icon},provider:t})},e.prototype.getTrackedProvidersCount=function(){return this.evm.counts.trackedProviders},e.prototype.getProviderState=function(){return n(n({},this.evm.counts),{activeProvider:!!this._provider})},e.registeredProviderSeq=0,e}();t.FormoAnalytics=k},4245(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFormo=t.FormoAnalyticsProvider=t.computeOptionsKey=t.FormoAnalyticsContext=void 0;var o=r(1325),s=r(489),c=r(8718),u=r(6517),l=r(3312),d={chain:function(){return Promise.resolve()},page:function(){return Promise.resolve()},reset:function(){},cleanup:function(){},registerProvider:function(){return!1},detect:function(){return Promise.resolve()},connect:function(){return Promise.resolve()},disconnect:function(){return Promise.resolve()},signature:function(){return Promise.resolve()},transaction:function(){return Promise.resolve()},identify:function(){return Promise.resolve()},track:function(){return Promise.resolve()},optOutTracking:function(){},optInTracking:function(){},hasOptedOutTracking:function(){return!1}};t.FormoAnalyticsContext=(0,s.createContext)(d);var h=new WeakMap,f=1,p=function(e){if(e){var t=h.get(e);return void 0===t&&(t=f++,h.set(e,t)),t}};t.computeOptionsKey=function(e){var t;if(!e)return"undefined";var r={tracking:e.tracking,autocapture:e.autocapture,crossSubdomainCookies:e.crossSubdomainCookies,apiHost:e.apiHost,flushAt:e.flushAt,flushInterval:e.flushInterval,retryCount:e.retryCount,maxQueueSize:e.maxQueueSize,logger:e.logger,referral:e.referral,evm:e.evm,solana:"object"==typeof e.solana?void 0:e.solana,solanaStoreId:"object"==typeof e.solana?p(e.solana.store):void 0,solanaCluster:"object"==typeof e.solana?e.solana.cluster:void 0,hasProvider:!!e.provider,hasWagmi:!!e.wagmi,wagmiEip1193Fallback:!!(null===(t=e.wagmi)||void 0===t?void 0:t.eip1193Fallback),hasReady:!!e.ready};try{return JSON.stringify(r)}catch(e){return l.logger.warn("Failed to serialize options, using timestamp",e),Date.now().toString()}},t.FormoAnalyticsProvider=function(e){var t=e.writeKey,r=e.disabled,i=void 0!==r&&r,a=e.children;return t?i?(l.logger.warn("FormoAnalytics is disabled"),(0,o.jsx)(o.Fragment,{children:a})):(0,o.jsx)(v,n({},e)):(l.logger.error("FormoAnalyticsProvider: No Write Key provided"),(0,o.jsx)(o.Fragment,{children:a}))};var v=function(e){var r=e.writeKey,n=e.options,h=e.children,f=(0,s.useState)(d),p=f[0],v=f[1],g=(0,s.useRef)(d);(0,u.initStorageManager)(r);var y=(0,s.useMemo)(function(){return(0,t.computeOptionsKey)(n)},[n]);return(0,s.useEffect)(function(){var e=!1;return i(void 0,void 0,void 0,function(){var t,i;return a(this,function(a){switch(a.label){case 0:g.current&&g.current!==d&&(l.logger.log("Cleaning up existing FormoAnalytics SDK instance before re-initialization"),g.current.cleanup(),g.current=d,v(d)),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,c.FormoAnalytics.init(r,n)];case 2:return t=a.sent(),e?(l.logger.log("Component unmounted during initialization, cleaning up SDK"),t.cleanup()):(v(t),g.current=t,l.logger.log("Successfully initialized FormoAnalytics SDK")),[3,4];case 3:return i=a.sent(),e||l.logger.error("Failed to initialize FormoAnalytics SDK",i),[3,4];case 4:return[2]}})}),function(){e=!0,g.current&&g.current!==d&&(l.logger.log("Cleaning up FormoAnalytics SDK instance"),g.current.cleanup(),g.current=d)}},[r,y]),(0,o.jsx)(t.FormoAnalyticsContext.Provider,{value:p,children:h})};t.useFormo=function(){var e=(0,s.useContext)(t.FormoAnalyticsContext);return e||l.logger.warn("useFormo called without a valid context"),e}},6079(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.detectBrowser=function(){var e=this;return a?Promise.resolve(a):i||(i=r(e,void 0,void 0,function(){var e,t;return n(this,function(r){switch(r.label){case 0:return e=function(){try{return void 0!==globalThis.navigator?globalThis.navigator.userAgent:""}catch(e){return""}}(),[4,o().catch(function(){return!1})];case 1:return t=r.sent(),a=t?"brave":function(e){return/Firefox\/\d+/i.test(e)?"firefox":/Edg\/\d+/i.test(e)?"edge":/OPR\/\d+/i.test(e)?"opera":/Safari\/\d+/i.test(e)&&!/Chrome\/\d+/i.test(e)?"safari":/Chrome\/\d+/i.test(e)?"chrome":"unknown"}(e),[2,a]}})}).finally(function(){i=null}))};var i=null,a=null;function o(){return r(this,void 0,void 0,function(){var e,t,r,i;return n(this,function(n){switch(n.label){case 0:if(!(e=void 0!==globalThis.navigator?globalThis.navigator:void 0))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(r=e.brave)||void 0===r?void 0:r.isBrave)?[4,e.brave.isBrave().catch(function(){return!1})]:[3,3];case 2:if(n.sent())return[2,!0];n.label=3;case 3:return[3,5];case 4:return n.sent(),[3,5];case 5:try{if(null==(t=null===(i=e.userAgentData)||void 0===i?void 0:i.brands)?void 0:t.some(function(e){return/Brave/i.test(e.brand)}))return[2,!0]}catch(e){}try{if(/Brave/i.test(e.userAgent))return[2,!0]}catch(e){}return[2,!1]}})})}},9582(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setConsentFlag=function(e,t,r){var n;if("undefined"!=typeof document){var o=a(e,t),s=new Date(Date.now()+31536e6).toUTCString(),c="https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol),u=(0,i.getApexDomain)(),l=u?"; domain=.".concat(u):"";u&&(document.cookie="".concat(o,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;")),document.cookie="".concat(o,"=").concat(encodeURIComponent(r),"; expires=").concat(s,"; path=/").concat(l,"; SameSite=Strict").concat(c?"; Secure":"")}},t.getConsentFlag=function(e,t){if("undefined"==typeof document)return null;for(var r=a(e,t),n=0,i=document.cookie.split(";");n<i.length;n++){var o=i[n].trim(),s=o.indexOf("=");if(-1!==s){var c=o.substring(0,s),u=o.substring(s+1);if(c===r)return decodeURIComponent(u||"")}}return null},t.removeConsentFlag=function(e,t){!function(e){if("undefined"!=typeof document){document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;");var t=(0,i.getApexDomain)();t&&(document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=.").concat(t,";"))}}(a(e,t))};var n=r(625),i=r(9037);function a(e,t){return"formo_".concat((0,n.secureHash)(e),"_").concat(t)}},88(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BLOCKED_ADDRESSES=t.DEAD_ADDRESS=t.ZERO_ADDRESS=t.CONSENT_OPT_OUT_KEY=t.LOCAL_ANONYMOUS_ID_KEY=t.ACTIVE_WALLET_TTL_MS=t.ACTIVE_WALLET_KEY=t.SESSION_USER_ID_KEY=t.SESSION_TRAFFIC_SOURCE_KEY=void 0,t.SESSION_TRAFFIC_SOURCE_KEY="traffic-source",t.SESSION_USER_ID_KEY="user-id",t.ACTIVE_WALLET_KEY="active-wallet",t.ACTIVE_WALLET_TTL_MS=864e5,t.LOCAL_ANONYMOUS_ID_KEY="anonymous-id",t.CONSENT_OPT_OUT_KEY="opt-out-tracking",t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000",t.DEAD_ADDRESS="0x000000000000000000000000000000000000dEaD",t.BLOCKED_ADDRESSES=[t.ZERO_ADDRESS,t.DEAD_ADDRESS]},3787(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.COUNTRY_LIST=t.EVENTS_API_REQUEST_HEADER=t.EVENTS_API_HOST=t.EVENTS_API_ORIGIN=void 0,t.EVENTS_API_ORIGIN="https://events.formo.so",t.EVENTS_API_HOST="".concat(t.EVENTS_API_ORIGIN,"/v0/raw_events"),t.EVENTS_API_REQUEST_HEADER=function(e){return{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}},t.COUNTRY_LIST={"Africa/Abidjan":"CI","Africa/Accra":"GH","Africa/Addis_Ababa":"ET","Africa/Algiers":"DZ","Africa/Asmara":"ER","Africa/Asmera":"ER","Africa/Bamako":"ML","Africa/Bangui":"CF","Africa/Banjul":"GM","Africa/Bissau":"GW","Africa/Blantyre":"MW","Africa/Brazzaville":"CG","Africa/Bujumbura":"BI","Africa/Cairo":"EG","Africa/Casablanca":"MA","Africa/Ceuta":"ES","Africa/Conakry":"GN","Africa/Dakar":"SN","Africa/Dar_es_Salaam":"TZ","Africa/Djibouti":"DJ","Africa/Douala":"CM","Africa/El_Aaiun":"EH","Africa/Freetown":"SL","Africa/Gaborone":"BW","Africa/Harare":"ZW","Africa/Johannesburg":"ZA","Africa/Juba":"SS","Africa/Kampala":"UG","Africa/Khartoum":"SD","Africa/Kigali":"RW","Africa/Kinshasa":"CD","Africa/Lagos":"NG","Africa/Libreville":"GA","Africa/Lome":"TG","Africa/Luanda":"AO","Africa/Lubumbashi":"CD","Africa/Lusaka":"ZM","Africa/Malabo":"GQ","Africa/Maputo":"MZ","Africa/Maseru":"LS","Africa/Mbabane":"SZ","Africa/Mogadishu":"SO","Africa/Monrovia":"LR","Africa/Nairobi":"KE","Africa/Ndjamena":"TD","Africa/Niamey":"NE","Africa/Nouakchott":"MR","Africa/Ouagadougou":"BF","Africa/Porto-Novo":"BJ","Africa/Sao_Tome":"ST","Africa/Timbuktu":"ML","Africa/Tripoli":"LY","Africa/Tunis":"TN","Africa/Windhoek":"NA","America/Adak":"US","America/Anchorage":"US","America/Anguilla":"AI","America/Antigua":"AG","America/Araguaina":"BR","America/Argentina/Buenos_Aires":"AR","America/Argentina/Catamarca":"AR","America/Argentina/ComodRivadavia":"AR","America/Argentina/Cordoba":"AR","America/Argentina/Jujuy":"AR","America/Argentina/La_Rioja":"AR","America/Argentina/Mendoza":"AR","America/Argentina/Rio_Gallegos":"AR","America/Argentina/Salta":"AR","America/Argentina/San_Juan":"AR","America/Argentina/San_Luis":"AR","America/Argentina/Tucuman":"AR","America/Argentina/Ushuaia":"AR","America/Aruba":"AW","America/Asuncion":"PY","America/Atikokan":"CA","America/Atka":"US","America/Bahia":"BR","America/Bahia_Banderas":"MX","America/Barbados":"BB","America/Belem":"BR","America/Belize":"BZ","America/Blanc-Sablon":"CA","America/Boa_Vista":"BR","America/Bogota":"CO","America/Boise":"US","America/Buenos_Aires":"AR","America/Cambridge_Bay":"CA","America/Campo_Grande":"BR","America/Cancun":"MX","America/Caracas":"VE","America/Catamarca":"AR","America/Cayenne":"GF","America/Cayman":"KY","America/Chicago":"US","America/Chihuahua":"MX","America/Ciudad_Juarez":"MX","America/Coral_Harbour":"CA","America/Cordoba":"AR","America/Costa_Rica":"CR","America/Creston":"CA","America/Cuiaba":"BR","America/Curacao":"CW","America/Danmarkshavn":"GL","America/Dawson":"CA","America/Dawson_Creek":"CA","America/Denver":"US","America/Detroit":"US","America/Dominica":"DM","America/Edmonton":"CA","America/Eirunepe":"BR","America/El_Salvador":"SV","America/Ensenada":"MX","America/Fort_Nelson":"CA","America/Fort_Wayne":"US","America/Fortaleza":"BR","America/Glace_Bay":"CA","America/Godthab":"GL","America/Goose_Bay":"CA","America/Grand_Turk":"TC","America/Grenada":"GD","America/Guadeloupe":"GP","America/Guatemala":"GT","America/Guayaquil":"EC","America/Guyana":"GY","America/Halifax":"CA","America/Havana":"CU","America/Hermosillo":"MX","America/Indiana/Indianapoli":"US","America/Indiana/Knox":"US","America/Indiana/Marengo":"US","America/Indiana/Petersburg":"US","America/Indiana/Tell_City":"US","America/Indiana/Vevay":"US","America/Indiana/Vincennes":"US","America/Indiana/Winamac":"US","America/Indianapoli":"US","America/Inuvik":"CA","America/Iqaluit":"CA","America/Jamaica":"JM","America/Jujuy":"AR","America/Juneau":"US","America/Kentucky/Louisville":"US","America/Kentucky/Monticello":"US","America/Knox_IN":"US","America/Kralendijk":"BQ","America/La_Paz":"BO","America/Lima":"PE","America/Los_Angeles":"US","America/Louisville":"US","America/Lower_Princes":"SX","America/Maceio":"BR","America/Managua":"NI","America/Manaus":"BR","America/Marigot":"MF","America/Martinique":"MQ","America/Matamoros":"MX","America/Mazatlan":"MX","America/Mendoza":"AR","America/Menominee":"US","America/Merida":"MX","America/Metlakatla":"US","America/Mexico_City":"MX","America/Miquelon":"PM","America/Moncton":"CA","America/Monterrey":"MX","America/Montevideo":"UY","America/Montreal":"CA","America/Montserrat":"MS","America/Nassau":"BS","America/New_York":"US","America/Nipigon":"CA","America/Nome":"US","America/Noronha":"BR","America/North_Dakota/Beulah":"US","America/North_Dakota/Center":"US","America/North_Dakota/New_Salem":"US","America/Nuuk":"GL","America/Ojinaga":"MX","America/Panama":"PA","America/Pangnirtung":"CA","America/Paramaribo":"SR","America/Phoenix":"US","America/Port-au-Prince":"HT","America/Port_of_Spain":"TT","America/Porto_Acre":"BR","America/Porto_Velho":"BR","America/Puerto_Rico":"PR","America/Punta_Arenas":"CL","America/Rainy_River":"CA","America/Rankin_Inlet":"CA","America/Recife":"BR","America/Regina":"CA","America/Resolute":"CA","America/Rio_Branco":"BR","America/Rosario":"AR","America/Santa_Isabel":"MX","America/Santarem":"BR","America/Santiago":"CL","America/Santo_Domingo":"DO","America/Sao_Paulo":"BR","America/Scoresbysund":"GL","America/Shiprock":"US","America/Sitka":"US","America/St_Barthelemy":"BL","America/St_Johns":"CA","America/St_Kitts":"KN","America/St_Lucia":"LC","America/St_Thomas":"VI","America/St_Vincent":"VC","America/Swift_Current":"CA","America/Tegucigalpa":"HN","America/Thule":"GL","America/Thunder_Bay":"CA","America/Tijuana":"MX","America/Toronto":"CA","America/Tortola":"VG","America/Vancouver":"CA","America/Virgin":"VI","America/Whitehorse":"CA","America/Winnipeg":"CA","America/Yakutat":"US","America/Yellowknife":"CA","Antarctica/Casey":"AQ","Antarctica/Davis":"AQ","Antarctica/DumontDUrville":"AQ","Antarctica/Macquarie":"AU","Antarctica/Mawson":"AQ","Antarctica/McMurdo":"AQ","Antarctica/Palmer":"AQ","Antarctica/Rothera":"AQ","Antarctica/South_Pole":"AQ","Antarctica/Syowa":"AQ","Antarctica/Troll":"AQ","Antarctica/Vostok":"AQ","Arctic/Longyearbyen":"SJ","Asia/Aden":"YE","Asia/Almaty":"KZ","Asia/Amman":"JO","Asia/Anadyr":"RU","Asia/Aqtau":"KZ","Asia/Aqtobe":"KZ","Asia/Ashgabat":"TM","Asia/Ashkhabad":"TM","Asia/Atyrau":"KZ","Asia/Baghdad":"IQ","Asia/Bahrain":"BH","Asia/Baku":"AZ","Asia/Bangkok":"TH","Asia/Barnaul":"RU","Asia/Beirut":"LB","Asia/Bishkek":"KG","Asia/Brunei":"BN","Asia/Calcutta":"IN","Asia/Chita":"RU","Asia/Choibalsan":"MN","Asia/Chongqing":"CN","Asia/Chungking":"CN","Asia/Colombo":"LK","Asia/Dacca":"BD","Asia/Damascus":"SY","Asia/Dhaka":"BD","Asia/Dili":"TL","Asia/Dubai":"AE","Asia/Dushanbe":"TJ","Asia/Famagusta":"CY","Asia/Gaza":"PS","Asia/Harbin":"CN","Asia/Hebron":"PS","Asia/Ho_Chi_Minh":"VN","Asia/Hong_Kong":"HK","Asia/Hovd":"MN","Asia/Irkutsk":"RU","Asia/Istanbul":"TR","Asia/Jakarta":"ID","Asia/Jayapura":"ID","Asia/Jerusalem":"IL","Asia/Kabul":"AF","Asia/Kamchatka":"RU","Asia/Karachi":"PK","Asia/Kashgar":"CN","Asia/Kathmandu":"NP","Asia/Katmandu":"NP","Asia/Khandyga":"RU","Asia/Kolkata":"IN","Asia/Kostanay":"KZ","Asia/Krasnoyarsk":"RU","Asia/Kuala_Lumpur":"MY","Asia/Kuching":"MY","Asia/Kuwait":"KW","Asia/Macao":"MO","Asia/Macau":"MO","Asia/Magadan":"RU","Asia/Makassar":"ID","Asia/Manila":"PH","Asia/Muscat":"OM","Asia/Nicosia":"CY","Asia/Novokuznetsk":"RU","Asia/Novosibirsk":"RU","Asia/Omsk":"RU","Asia/Oral":"KZ","Asia/Phnom_Penh":"KH","Asia/Pontianak":"ID","Asia/Pyongyang":"KP","Asia/Qatar":"QA","Asia/Qostanay":"KZ","Asia/Qyzylorda":"KZ","Asia/Rangoon":"MM","Asia/Riyadh":"SA","Asia/Saigon":"VN","Asia/Sakhalin":"RU","Asia/Samarkand":"UZ","Asia/Seoul":"KR","Asia/Shanghai":"CN","Asia/Singapore":"SG","Asia/Srednekolymsk":"RU","Asia/Taipei":"TW","Asia/Tashkent":"UZ","Asia/Tbilisi":"GE","Asia/Tehran":"IR","Asia/Tel_Aviv":"IL","Asia/Thimbu":"BT","Asia/Thimphu":"BT","Asia/Tokyo":"JP","Asia/Tomsk":"RU","Asia/Ujung_Pandang":"ID","Asia/Ulaanbaatar":"MN","Asia/Ulan_Bator":"MN","Asia/Urumqi":"CN","Asia/Ust-Nera":"RU","Asia/Vientiane":"LA","Asia/Vladivostok":"RU","Asia/Yakutsk":"RU","Asia/Yangon":"MM","Asia/Yekaterinburg":"RU","Asia/Yerevan":"AM","Atlantic/Azores":"PT","Atlantic/Bermuda":"BM","Atlantic/Canary":"ES","Atlantic/Cape_Verde":"CV","Atlantic/Faeroe":"FO","Atlantic/Faroe":"FO","Atlantic/Jan_Mayen":"SJ","Atlantic/Madeira":"PT","Atlantic/Reykjavik":"IS","Atlantic/South_Georgia":"GS","Atlantic/St_Helena":"SH","Atlantic/Stanley":"FK","Australia/ACT":"AU","Australia/Adelaide":"AU","Australia/Brisbane":"AU","Australia/Broken_Hill":"AU","Australia/Canberra":"AU","Australia/Currie":"AU","Australia/Darwin":"AU","Australia/Eucla":"AU","Australia/Hobart":"AU","Australia/LHI":"AU","Australia/Lindeman":"AU","Australia/Lord_Howe":"AU","Australia/Melbourne":"AU","Australia/North":"AU","Australia/NSW":"AU","Australia/Perth":"AU","Australia/Queensland":"AU","Australia/South":"AU","Australia/Sydney":"AU","Australia/Tasmania":"AU","Australia/Victoria":"AU","Australia/West":"AU","Australia/Yancowinna":"AU","Brazil/Acre":"BR","Brazil/DeNoronha":"BR","Brazil/East":"BR","Brazil/West":"BR","Canada/Atlantic":"CA","Canada/Central":"CA","Canada/Eastern":"CA","Canada/Mountain":"CA","Canada/Newfoundland":"CA","Canada/Pacific":"CA","Canada/Saskatchewan":"CA","Canada/Yukon":"CA","Chile/Continental":"CL","Chile/EasterIsland":"CL",Cuba:"CU",Egypt:"EG",Eire:"IE","Europe/Amsterdam":"NL","Europe/Andorra":"AD","Europe/Astrakhan":"RU","Europe/Athens":"GR","Europe/Belfast":"GB","Europe/Belgrade":"RS","Europe/Berlin":"DE","Europe/Bratislava":"SK","Europe/Brussels":"BE","Europe/Bucharest":"RO","Europe/Budapest":"HU","Europe/Busingen":"DE","Europe/Chisinau":"MD","Europe/Copenhagen":"DK","Europe/Dublin":"IE","Europe/Gibraltar":"GI","Europe/Guernsey":"GG","Europe/Helsinki":"FI","Europe/Isle_of_Man":"IM","Europe/Istanbul":"TR","Europe/Jersey":"JE","Europe/Kaliningrad":"RU","Europe/Kiev":"UA","Europe/Kirov":"RU","Europe/Kyiv":"UA","Europe/Lisbon":"PT","Europe/Ljubljana":"SI","Europe/London":"GB","Europe/Luxembourg":"LU","Europe/Madrid":"ES","Europe/Malta":"MT","Europe/Mariehamn":"AX","Europe/Minsk":"BY","Europe/Monaco":"MC","Europe/Moscow":"RU","Europe/Nicosia":"CY","Europe/Oslo":"NO","Europe/Paris":"FR","Europe/Podgorica":"ME","Europe/Prague":"CZ","Europe/Riga":"LV","Europe/Rome":"IT","Europe/Samara":"RU","Europe/San_Marino":"SM","Europe/Sarajevo":"BA","Europe/Saratov":"RU","Europe/Simferopol":"RU","Europe/Skopje":"MK","Europe/Sofia":"BG","Europe/Stockholm":"SE","Europe/Tallinn":"EE","Europe/Tirane":"AL","Europe/Tiraspol":"MD","Europe/Ulyanovsk":"RU","Europe/Uzhgorod":"UA","Europe/Vaduz":"LI","Europe/Vatican":"VA","Europe/Vienna":"AT","Europe/Vilnius":"LT","Europe/Volgograd":"RU","Europe/Warsaw":"PL","Europe/Zagreb":"HR","Europe/Zaporozhye":"UA","Europe/Zurich":"CH",GB:"GB","GB-Eire":"GB",Hongkong:"HK",Iceland:"IS","Indian/Antananarivo":"MG","Indian/Chagos":"IO","Indian/Christmas":"CX","Indian/Cocos":"CC","Indian/Comoro":"KM","Indian/Kerguelen":"TF","Indian/Mahe":"SC","Indian/Maldives":"MV","Indian/Mauritius":"MU","Indian/Mayotte":"YT","Indian/Reunion":"RE",Iran:"IR",Israel:"IL",Jamaica:"JM",Japan:"JP",Kwajalein:"MH",Libya:"LY","Mexico/BajaNorte":"MX","Mexico/BajaSur":"MX","Mexico/General":"MX",Navajo:"US",NZ:"NZ","NZ-CHAT":"NZ","Pacific/Apia":"WS","Pacific/Auckland":"NZ","Pacific/Bougainville":"PG","Pacific/Chatham":"NZ","Pacific/Chuuk":"FM","Pacific/Easter":"CL","Pacific/Efate":"VU","Pacific/Enderbury":"KI","Pacific/Fakaofo":"TK","Pacific/Fiji":"FJ","Pacific/Funafuti":"TV","Pacific/Galapagos":"EC","Pacific/Gambier":"PF","Pacific/Guadalcanal":"SB","Pacific/Guam":"GU","Pacific/Honolulu":"US","Pacific/Johnston":"UM","Pacific/Kanton":"KI","Pacific/Kiritimati":"KI","Pacific/Kosrae":"FM","Pacific/Kwajalein":"MH","Pacific/Majuro":"MH","Pacific/Marquesas":"PF","Pacific/Midway":"UM","Pacific/Nauru":"NR","Pacific/Niue":"NU","Pacific/Norfolk":"NF","Pacific/Noumea":"NC","Pacific/Pago_Pago":"AS","Pacific/Palau":"PW","Pacific/Pitcairn":"PN","Pacific/Pohnpei":"FM","Pacific/Ponape":"FM","Pacific/Port_Moresby":"PG","Pacific/Rarotonga":"CK","Pacific/Saipan":"MP","Pacific/Samoa":"AS","Pacific/Tahiti":"PF","Pacific/Tarawa":"KI","Pacific/Tongatapu":"TO","Pacific/Truk":"FM","Pacific/Wake":"UM","Pacific/Wallis":"WF","Pacific/Yap":"FM",Poland:"PL",Portugal:"PT",PRC:"CN",ROC:"TW",ROK:"KR",Singapore:"SG",Turkey:"TR","US/Alaska":"US","US/Aleutian":"US","US/Arizona":"US","US/Central":"US","US/East-Indiana":"US","US/Eastern":"US","US/Hawaii":"US","US/Indiana-Starke":"US","US/Michigan":"US","US/Mountain":"US","US/Pacific":"US","US/Samoa":"AS","W-SU":"RU"}},1556(e,t){var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.EventChannel=t.EventType=void 0,function(e){e.PAGE="page",e.IDENTIFY="identify",e.DETECT="detect",e.CONNECT="connect",e.DISCONNECT="disconnect",e.CHAIN="chain",e.SIGNATURE="signature",e.TRANSACTION="transaction",e.TRACK="track"}(r||(t.EventType=r={})),function(e){e.WEB="web",e.MOBILE="mobile",e.SERVER="server",e.SOURCE="source"}(n||(t.EventChannel=n={}))},49(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(88),t),i(r(3787),t),i(r(1556),t)},5164(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isSolanaChainId=t.DEFAULT_SOLANA_CHAIN_ID=t.SOLANA_CHAIN_IDS=t.SolanaManager=t.parsePrivyProperties=t.formofy=void 0,i(r(8718),t),i(r(2657),t);var a=r(6271);Object.defineProperty(t,"formofy",{enumerable:!0,get:function(){return a.formofy}});var o=r(4328);Object.defineProperty(t,"parsePrivyProperties",{enumerable:!0,get:function(){return o.parsePrivyProperties}});var s=r(9308);Object.defineProperty(t,"SolanaManager",{enumerable:!0,get:function(){return s.SolanaManager}});var c=r(9308);Object.defineProperty(t,"SOLANA_CHAIN_IDS",{enumerable:!0,get:function(){return c.SOLANA_CHAIN_IDS}}),Object.defineProperty(t,"DEFAULT_SOLANA_CHAIN_ID",{enumerable:!0,get:function(){return c.DEFAULT_SOLANA_CHAIN_ID}}),Object.defineProperty(t,"isSolanaChainId",{enumerable:!0,get:function(){return c.isSolanaChainId}})},4416(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EventFactory=void 0;var c=r(49),u=r(9629),l=r(4657),d=r(8081),h=r(9879),f=r(3312),p=s(r(2817)),v=r(6517),g=r(5479),y=r(9165),m=r(6949),b=r(9293),A=r(6079),S=r(8177),w=/^[A-Z]{2}$/,E=function(){function e(e,t){void 0===t&&(t=function(){return!0});var r,i,a=this;this.canCreate=t,this.generation=0,this.extractUTMParameters=function(e){var t={utm_campaign:"",utm_content:"",utm_medium:"",utm_source:"",utm_term:""};try{new URL(e).searchParams.forEach(function(e,r){r.startsWith("utm_")&&(t[r]=e.trim())})}catch(e){}return t},this.extractClickIdParameters=function(e){for(var t={},r=0,n=y.CLICK_ID_PARAMS;r<n.length;r++){var i=n[r],a=e.searchParams.get(i);t[i]=a?a.trim():""}return t},this.extractReferralParameter=function(e){for(var t,r,n,i=0,o=(null===(t=a.options)||void 0===t?void 0:t.referral)&&null!==(r=a.options.referral.queryParams)&&void 0!==r?r:y.DEFAULT_REFERRAL_PARAMS;i<o.length;i++){var s=o[i],c=null===(n=e.searchParams.get(s))||void 0===n?void 0:n.trim();if(c)return c}if(a.compiledPathPattern){var u=e.pathname.match(a.compiledPathPattern);if(u&&u[1]){var l=u[1].trim();if(l)return l}}return""},this.getExternalReferrer=function(){var e,t=document.referrer;if(!t)return"";try{var r=null===(e=globalThis.location)||void 0===e?void 0:e.hostname;if(r&&new URL(t).hostname===r)return""}catch(e){}return a.redactUrl(t)},this.getTrafficSources=function(e){for(var t=new URL(e),r=(0,m.sanitizeTrafficSources)(n(n(n({},a.extractUTMParameters(e)),a.extractClickIdParameters(t)),{ref:a.extractReferralParameter(t),referrer:a.getExternalReferrer()})),i=(0,m.sanitizeTrafficSources)(a.redactStoredTrafficSources((0,v.session)().get(c.SESSION_TRAFFIC_SOURCE_KEY)||{})),o={},s=0,u=y.CLICK_ID_PARAMS;s<u.length;s++){var l=u[s];o[l]=r[l]||(null==i?void 0:i[l])||""}var d=n({ref:r.ref||(null==i?void 0:i.ref)||"",referrer:(null==i?void 0:i.referrer)||r.referrer||"",utm_campaign:r.utm_campaign||(null==i?void 0:i.utm_campaign)||"",utm_content:r.utm_content||(null==i?void 0:i.utm_content)||"",utm_medium:r.utm_medium||(null==i?void 0:i.utm_medium)||"",utm_source:r.utm_source||(null==i?void 0:i.utm_source)||"",utm_term:r.utm_term||(null==i?void 0:i.utm_term)||""},o),f=Object.keys(d).reduce(function(e,t){var r=d[t];return(0,h.isUndefined)(r)||""===r||(e[t]=r),e},{});return Object.keys(f).length&&(0,v.session)().set(c.SESSION_TRAFFIC_SOURCE_KEY,f),d},this.getPageProperties=function(e){var t=n({},e),r=null;try{r=new URL(globalThis.location.href),a.redactQueryParams(r),a.normalizeUrlPath(r)}catch(e){}(0,h.isUndefined)(t.url)&&(t.url=r?r.href:globalThis.location.href),(0,h.isUndefined)(t.path)&&(t.path=r?r.pathname:globalThis.location.pathname),(0,h.isUndefined)(t.hash)&&(t.hash=globalThis.location.hash),(0,h.isUndefined)(t.query)&&(t.query=r?r.search.slice(1):globalThis.location.search.slice(1));try{r&&r.searchParams.forEach(function(e,r){(0,h.isUndefined)(t[r])&&!y.PAGE_PROPERTIES_EXCLUDED_FIELDS.has(r)&&(t[r]=e)})}catch(e){f.logger.error("Error parsing query parameters for page properties:",e)}return t},this.options=e;var s=null==e?void 0:e.tracking,u="object"==typeof s&&null!==(r=s.excludeQueryParams)&&void 0!==r?r:[];if(this.excludedQueryParams=new Set(o(o([],y.DEFAULT_EXCLUDED_QUERY_PARAMS,!0),u,!0).map(function(e){return e.toLowerCase()})),null===(i=null==e?void 0:e.referral)||void 0===i?void 0:i.pathPattern)try{this.compiledPathPattern=new RegExp(e.referral.pathPattern)}catch(t){f.logger.warn("Invalid referral path pattern: ".concat(e.referral.pathPattern,". Error: ").concat(t))}}return e.prototype.validateEventAddress=function(e,t){return e&&(0,l.validateAddress)(e,t)||null},e.prototype.getTimezone=function(){return(0,u.getTimezone)()},e.prototype.getLocation=function(){try{var e=this.getTimezone();if(!e)return"";var t=c.COUNTRY_LIST[e];return"string"==typeof t&&w.test(t)?t:""}catch(e){return f.logger.error("Error resolving location:",e),""}},e.prototype.getLanguage=function(){try{return(navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language)||"en"}catch(e){return f.logger.error("Error resolving language:",e),"en"}},e.prototype.getLibraryVersion=function(){return g.version},e.prototype.isExcludedQueryParam=function(e){return this.excludedQueryParams.has(e.toLowerCase())},e.prototype.normalizeUrlPath=function(e){"/"!==e.pathname&&(e.pathname=e.pathname.replace(/\/+$/,""))},e.prototype.redactQueryParams=function(e){var t=this,r=new Set;e.searchParams.forEach(function(e,n){t.isExcludedQueryParam(n)&&r.add(n)}),r.forEach(function(t){return e.searchParams.delete(t)})},e.prototype.redactUrl=function(e){if(!e)return e;try{var t=new URL(e);return this.redactQueryParams(t),this.normalizeUrlPath(t),t.href}catch(t){return e}},e.prototype.redactStoredTrafficSources=function(e){for(var t={},r=0,n=Object.keys(e);r<n.length;r++){var i=n[r],a=e[i];"referrer"===i?t[i]=this.redactUrl(a||""):this.isExcludedQueryParam(i)?t[i]="":t[i]=a}return t},e.prototype.getScreen=function(){var e,t;try{return{screen_width:(null===(e=globalThis.screen)||void 0===e?void 0:e.width)||0,screen_height:(null===(t=globalThis.screen)||void 0===t?void 0:t.height)||0,screen_density:globalThis.devicePixelRatio||1,viewport_width:globalThis.innerWidth||0,viewport_height:globalThis.innerHeight||0}}catch(e){return f.logger.error("Error resolving screen properties:",e),{screen_width:0,screen_height:0,screen_density:1,viewport_width:0,viewport_height:0}}},e.prototype.invalidate=function(){this.generation++},e.prototype.generateContext=function(e){return i(this,void 0,void 0,function(){var t,r,i,o,s,c,u;return a(this,function(a){switch(a.label){case 0:return[4,(0,A.detectBrowser)()];case 1:return t=a.sent(),r=this.getLanguage(),i=this.getTimezone(),o=this.getLocation(),s=this.getLibraryVersion(),c=this.redactUrl(globalThis.location.href),u=n(n(n({user_agent:globalThis.navigator.userAgent,locale:r,timezone:i,location:o},this.getTrafficSources(c)),{page_title:document.title,page_url:c,library_name:"Formo Web SDK",library_version:s,browser:t}),this.getScreen()),[2,(0,p.default)(u,e||{})]}})})},e.prototype.getEnrichedEvent=function(e,t){return i(this,void 0,void 0,function(){var r,n,i,o,s,l,h,f;return a(this,function(a){switch(a.label){case 0:return r=this.generation,[4,this.generateContext(t)];case 1:if(n=a.sent(),r!==this.generation||!this.canCreate())throw S.EVENT_CREATION_CANCELLED;return(i={context:n,original_timestamp:(0,d.getCurrentTimeFormatted)(),user_id:e.user_id,type:e.type,channel:y.CHANNEL,version:y.VERSION}).anonymous_id=(0,b.generateAnonymousId)(c.LOCAL_ANONYMOUS_ID_KEY,null===(h=this.options)||void 0===h?void 0:h.crossSubdomainCookies),o=null===(f=e.properties)||void 0===f?void 0:f.chainId,s=this.validateEventAddress(e.address,o),i.address=s,void 0===(l=(0,p.default)(e,i)).event&&(l.event=null),void 0===l.properties&&(l.properties=null),[2,(0,u.toSnakeCase)(l)]}})})},e.prototype.generatePageEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i,s;return a(this,function(a){return(i=n({},null!=r?r:{})).category=e,i.name=t,i=this.getPageProperties(i),s={properties:i,type:"page"},[2,this.getEnrichedEvent(s,o)]})})},e.prototype.generateDetectWalletEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({providerName:e,rdns:t},r),type:"detect"},[2,this.getEnrichedEvent(i,o)]})})},e.prototype.generateIdentifyEvent=function(e,t,r,o,s,c){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n(n(n({},void 0!==e&&{providerName:e}),void 0!==t&&{rdns:t}),s),user_id:o,address:r,type:"identify"},[2,this.getEnrichedEvent(i,c)]})})},e.prototype.generateConnectEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({chainId:e},r),address:t,type:"connect"},[2,this.getEnrichedEvent(i,o)]})})},e.prototype.generateDisconnectEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({chainId:e},r),address:t,type:"disconnect"},[2,this.getEnrichedEvent(i,o)]})})},e.prototype.generateChainChangedEvent=function(e,t,r,o){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({chainId:e},r),address:t,type:"chain"},[2,this.getEnrichedEvent(i,o)]})})},e.prototype.generateSignatureEvent=function(e,t,r,o,s,c){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n({status:e,chainId:t,message:o},s),address:r,type:"signature"},[2,this.getEnrichedEvent(i,c)]})})},e.prototype.generateTransactionEvent=function(e,t,r,o,s,c,u,l,d,h,f){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n(n(n(n(n(n(n({status:e,chainId:t},o&&{data:o}),s&&{to:s}),c&&{value:c}),u&&{transactionHash:u}),l&&{function_name:l}),d&&{function_args:d}),h),address:r,type:"transaction"},[2,this.getEnrichedEvent(i,f)]})})},e.prototype.generateTrackEvent=function(e,t,r){return i(this,void 0,void 0,function(){var i;return a(this,function(a){return i={properties:n(n(n(n({},t),void 0!==(null==t?void 0:t.revenue)&&{revenue:Number(t.revenue),currency:("string"==typeof(null==t?void 0:t.currency)?t.currency:"USD").toLowerCase()}),void 0!==(null==t?void 0:t.points)&&{points:Number(t.points)}),void 0!==(null==t?void 0:t.volume)&&{volume:Number(t.volume)}),event:e,type:"track"},[2,this.getEnrichedEvent(i,r)]})})},e.prototype.create=function(e,t,r){return i(this,void 0,void 0,function(){var n,i,o,s;return a(this,function(a){switch(a.label){case 0:switch(n={},e.type){case"page":return[3,1];case"detect":return[3,3];case"identify":return[3,5];case"chain":return[3,7];case"connect":return[3,9];case"disconnect":return[3,11];case"signature":return[3,13];case"transaction":return[3,15];case"track":return[3,17]}return[3,17];case 1:return[4,this.generatePageEvent(e.category,e.name,e.properties,e.context)];case 2:case 4:case 6:case 8:case 10:case 12:case 14:case 16:case 18:return n=a.sent(),[3,19];case 3:return[4,this.generateDetectWalletEvent(e.providerName,e.rdns,e.properties,e.context)];case 5:return[4,this.generateIdentifyEvent(e.providerName,e.rdns,e.address,e.userId,e.properties,e.context)];case 7:return[4,this.generateChainChangedEvent(e.chainId,e.address,e.properties,e.context)];case 9:return[4,this.generateConnectEvent(e.chainId,e.address,e.properties,e.context)];case 11:return[4,this.generateDisconnectEvent(e.chainId,e.address,e.properties,e.context)];case 13:return[4,this.generateSignatureEvent(e.status,e.chainId,e.address,e.message,e.properties,e.context)];case 15:return[4,this.generateTransactionEvent(e.status,e.chainId,e.address,e.data,e.to,e.value,e.transactionHash,e.function_name,e.function_args,e.properties,e.context)];case 17:return[4,this.generateTrackEvent(e.event,e.properties,e.context)];case 19:return void 0!==n.address&&null!==n.address||"identify"===e.type||(i="chainId"in e?e.chainId:void 0,n.address=this.validateEventAddress(t,i)),n.user_id="identify"===e.type?null!==(s=null!==(o=n.user_id)&&void 0!==o?o:r)&&void 0!==s?s:null:r||null,[2,n]}})})},e}();t.EventFactory=E},1457(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;var o=r(3312),s=r(4416),c=r(8177),u=r(4657),l=function(){function e(e,t,r){void 0===r&&(r=function(){return!0});var n=this;this.canAcceptEvent=r,this.generation=0,this.eventQueue=e,this.eventFactory=new s.EventFactory(t,function(){return n.canAcceptEvent()})}return e.prototype.addEvent=function(e,t,r){return n(this,void 0,void 0,function(){var n,s,l,d,h,f,p=this;return i(this,function(i){switch(i.label){case 0:if(n=e.callback,s=a(e,["callback"]),l=this.generation,!(d=function(){return l===p.generation&&p.canAcceptEvent()})())return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.eventFactory.create(s,t,r)];case 2:return h=i.sent(),[3,4];case 3:if((f=i.sent())===c.EVENT_CREATION_CANCELLED)return[2];throw f;case 4:return d()?h.address&&(0,u.isBlockedAddress)(h.address)?(o.logger.warn("Event blocked: Address ".concat(h.address," is in the blocked list and cannot emit events")),[2]):(this.eventQueue.enqueue(h,function(e,t,r){e?o.logger.error("Error sending events:",e):o.logger.info("Events sent successfully: ".concat(r.length," events")),null==n||n(e,t,r)}),[2]):[2]}})})},e.prototype.clear=function(){this.generation++,this.eventFactory.invalidate(),this.eventQueue.clear()},e.prototype.close=function(){this.generation++,this.eventFactory.invalidate(),this.eventQueue.close()},e}();t.EventManager=l},8177(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EVENT_CREATION_CANCELLED=void 0;var r=Symbol();t.EVENT_CREATION_CANCELLED=r},9165(e,t){var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.PAGE_PROPERTIES_EXCLUDED_FIELDS=t.DEFAULT_REFERRAL_PARAMS=t.DEFAULT_EXCLUDED_QUERY_PARAMS=t.CLICK_ID_PARAMS=t.VERSION=t.CHANNEL=void 0,t.CHANNEL="web",t.VERSION="0";var n=["gclid","gad_source","fbclid","msclkid","twclid","li_fat_id","rdt_cid","ttclid"];t.CLICK_ID_PARAMS=n,t.DEFAULT_EXCLUDED_QUERY_PARAMS=["privy_oauth_code","privy_oauth_state","privy_oauth_provider"];var i=["ref","referral","refcode","af","referrer"];t.DEFAULT_REFERRAL_PARAMS=i;var a=new Set(r(r(r(["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],i,!0),n,!0),["category","name","url","path","hash","query"],!1));t.PAGE_PROPERTIES_EXCLUDED_FIELDS=a},4992(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4416),t),i(r(1457),t),i(r(8962),t)},6949(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeTrafficSources=t.sanitizeUtm=t.sanitizeRef=t.sanitizeClickId=void 0;var i=r(9165),a=/^[A-Za-z0-9._-]{1,255}$/,o=/^[A-Za-z0-9._-]{1,64}$/,s=/[<>"'`\\\u0000-\u001f\u007f-\u009f\u200b-\u200f\u2028-\u202e\u2060\ufeff\ufffd]/,c=/^\s*(javascript|data|vbscript):/i,u=function(e){return a.test(e)?e:""};t.sanitizeClickId=u;var l=function(e){return o.test(e)?e:""};t.sanitizeRef=l;var d=function(e){return e.length<=255&&!s.test(e)&&!c.test(e)?e:""};t.sanitizeUtm=d;var h=new Set(i.CLICK_ID_PARAMS);t.sanitizeTrafficSources=function(e){for(var t=n({},e),r=0,i=Object.keys(t);r<i.length;r++){var a=i[r],o=t[a];"string"==typeof o&&""!==o&&"referrer"!==a&&(h.has(a)?t[a]=u(o):t[a]="ref"===a?l(o):d(o))}return t}},8962(e,t){Object.defineProperty(t,"__esModule",{value:!0})},9293(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.__resetAnonymousIdMemory=t.clearAnonymousId=t.generateAnonymousId=void 0;var i,a=r(9629),o=r(6517),s=r(2257),c=function(e){try{var t=(0,o.local)().get(e);return"string"==typeof t&&t?t:void 0}catch(e){return}};t.generateAnonymousId=function(e,t){var r,u,l=(0,o.cookie)().get(e),d=l&&"string"==typeof l?l:null!==(u=null!==(r=c(e))&&void 0!==r?r:i)&&void 0!==u?u:(0,a.generateNativeUUID)(),h=(0,s.getIdentityCookieDomain)(t);if((0,o.cookie)().set(e,d,n(n({expires:new Date(Date.now()+31536e6).toUTCString(),path:"/"},(0,s.getIdentityCookieSecurity)()),h?{domain:h}:{})),h&&(0,o.cookie)().get(e)!==d&&(0,o.cookie)().set(e,d,n({expires:new Date(Date.now()+31536e6).toUTCString(),path:"/"},(0,s.getIdentityCookieSecurity)())),(0,o.cookie)().get(e)===d){if(i=void 0,(0,o.usesCookieStorage)()&&c(e))try{(0,o.local)().remove(e)}catch(e){}return d}try{(0,o.local)().set(e,d)}catch(e){}return i=d,d},t.clearAnonymousId=function(e){(0,o.cookie)().remove(e);try{(0,o.local)().remove(e)}catch(e){}i=void 0},t.__resetAnonymousIdMemory=function(){i=void 0}},5620(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EvmEventTracker=void 0;var s=r(9478),c=r(3312),u=r(7392),l=r(4657),d=r(6653);function h(e){var t,r=e.accounts;if(Array.isArray(r)&&r.length>0&&r.every(function(e){return"string"==typeof e}))return r;var n=e.session,i=null===(t=null==n?void 0:n.namespaces)||void 0===t?void 0:t.eip155,a=e.chainId,s="number"==typeof a?a:"string"==typeof a?(0,u.parseChainId)(a):void 0,c=s?"eip155:".concat(s,":"):void 0,l=[],d=[];if(Array.isArray(null==i?void 0:i.accounts))for(var h=0,f=i.accounts;h<f.length;h++){var p=f[h];if("string"==typeof p&&p.startsWith("eip155:")){var v=p.split(":")[2];if(v){var g=c&&p.startsWith(c)?l:d;g.includes(v)||g.push(v)}}}return o(o([],l,!0),d.filter(function(e){return!l.includes(e)}),!0)}var f=function(){function e(e,t,r){this.wallet=e,this.registry=t,this.deps=r,this.externallyRegistered=new Set,this.pendingAdoptions=new Set,this.awaitingNewSession=new Set,this.retryInFlight=!1,this.retryRequested=!1,this._announcedConnect=new WeakMap,this.disposed=!1,this.sessionGenerations=new WeakMap}return e.prototype.dropRefusal=function(e){this.latestRefused===e&&(this.latestRefused=void 0)},e.prototype.markRegisteredAdoptionsPending=function(){var e=this;this.externallyRegistered.forEach(function(t){return e.pendingAdoptions.add(t)})},e.prototype.noteRefusalIfSuppressed=function(e){if(this.deps.isTrackingSuppressed()&&this.externallyRegistered.has(e)){this.pendingAdoptions.add(e);var t=!1;try{t=h(e).length>0}catch(e){}t&&(this.latestRefused=e)}},e.prototype.settleAdoption=function(e){this.pendingAdoptions.delete(e),this.awaitingNewSession.delete(e),this.dropRefusal(e)},e.prototype.reopenAdoption=function(e){var t;this.externallyRegistered.has(e)&&(this.pendingAdoptions.add(e),this.awaitingNewSession.add(e),this.sessionGenerations.set(e,(null!==(t=this.sessionGenerations.get(e))&&void 0!==t?t:0)+1),this.dropRefusal(e))},e.prototype.cleanup=function(){var e,t;this.disposed=!0,this.pendingAdoptions.clear(),this.awaitingNewSession.clear(),this.latestRefused=void 0,this.retryRequested=!1;try{null===(e=this.unsubscribeDiscovery)||void 0===e||e.call(this),null===(t=this.discoveryStore)||void 0===t||t.destroy()}catch(e){c.logger.warn("Failed to unsubscribe from provider discovery",e)}this.unsubscribeDiscovery=void 0,this.discoveryStore=void 0},e.prototype.sessionGeneration=function(e){var t;return null!==(t=this.sessionGenerations.get(e))&&void 0!==t?t:0},e.prototype.forgetAnnouncedConnect=function(e){this._announcedConnect.delete(e)},e.prototype.isProviderMismatch=function(e){return null!=this.wallet.provider&&this.wallet.provider!==e},e.prototype.trackEIP1193Provider=function(e){if(c.logger.info("trackEIP1193Provider",e),this.deps.isWagmiMode())c.logger.debug("trackEIP1193Provider: Skipping EIP-1193 provider tracking (Wagmi mode - using connector system instead)");else try{if(!(0,d.isValidProvider)(e))return void c.logger.warn("trackEIP1193Provider: Invalid provider - missing required methods");if(this.registry.isTracked(e))return void c.logger.warn("trackEIP1193Provider: Provider already tracked");if(this.registerAccountsChangedListener(e),this.registerChainChangedListener(e),this.deps.isAutocaptureEnabled("connect")?this.registerConnectListener(e):this.registerConnectChainObserver(e),this.seedProviderChainFromState(e),!this.deps.registerRequestListeners(e))return void c.logger.warn("TrackProvider: Could not wrap provider; leaving it untracked");this.registerDisconnectListener(e),this.registry.markTracked(e)}catch(e){c.logger.error("Error tracking provider:",e)}},e.prototype.trackProviders=function(e){try{for(var t=0,r=e;t<r.length;t++){var n=r[t],i=null==n?void 0:n.provider;i&&!this.registry.isTracked(i)&&this.trackEIP1193Provider(i)}}catch(e){c.logger.error("Failed to track EIP-6963 providers during initialization:",e)}},e.prototype.adoptExternalProvider=function(e){var t=e.provider;if(this.externallyRegistered.add(t),this.registry.add(e),this.trackProviders([e]),!this.registry.isTracked(t))return this.externallyRegistered.delete(t),this.untrackProvider(t),c.logger.warn("adoptExternalProvider: provider could not be tracked"),!1;if(!this.deps.registerRequestListeners(t))return this.externallyRegistered.delete(t),this.untrackProvider(t),c.logger.warn("adoptExternalProvider: request wrapper could not be ensured"),!1;this.detectWallets([n(n({},e),{info:n(n({},e.info),this.registry.infoFor(t))})]),this.pendingAdoptions.add(t);var r=h(t);return r.length>0&&this.onAccountsChanged(t,r),!0},e.prototype.retryExternalAdoptions=function(){var e=this;this.externallyRegistered.forEach(function(t){var r=e.registry.infoFor(t);"com.walletconnect"===r.rdns&&e.detectWallets([{info:{name:r.name,rdns:r.rdns,uuid:"corrected-com-walletconnect",icon:d.DEFAULT_PROVIDER_ICON},provider:t}])}),this.disposed||0===this.pendingAdoptions.size||this.deps.isTrackingSuppressed()||(this.retryInFlight?this.retryRequested=!0:(this.retryInFlight=!0,i(e,void 0,void 0,function(){var e,t,r,n,i,s,c=this;return a(this,function(a){switch(a.label){case 0:a.trys.push([0,,9,10]),a.label=1;case 1:this.retryRequested=!1,e=[this.wallet.provider,this.latestRefused].filter(function(e){return!!e&&c.pendingAdoptions.has(e)}),t=Array.from(new Set(o(o([],e,!0),Array.from(this.pendingAdoptions),!0))),r=0,n=t,a.label=2;case 2:if(!(r<n.length))return[3,7];if(i=n[r],this.disposed||this.deps.isTrackingSuppressed())return[3,7];s=void 0;try{s=h(i)}catch(e){return[3,6]}if(0===s.length||this.awaitingNewSession.has(i))return[3,6];if(void 0!==this.wallet.provider&&this.wallet.provider!==i&&this.latestRefused!==i)return[3,6];a.label=3;case 3:return a.trys.push([3,5,,6]),[4,this.onAccountsChanged(i,s)];case 4:case 5:return a.sent(),[3,6];case 6:return r++,[3,2];case 7:if(this.retryRequested&&!this.disposed&&!this.deps.isTrackingSuppressed())return[3,1];a.label=8;case 8:return[3,10];case 9:return this.retryInFlight=!1,this.retryRequested=!1,[7];case 10:return[2]}})})))},e.prototype.registerAccountsChangedListener=function(e){var t=this;c.logger.info("registerAccountsChangedListener");var r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.onAccountsChanged(e,r[0])};e.on("accountsChanged",r),this.registry.addListener(e,"accountsChanged",r)},e.prototype.onAccountsChanged=function(e,t){return i(this,void 0,void 0,function(){var r,n;return a(this,function(i){switch(i.label){case 0:return this.disposed?[2]:(c.logger.info("onAccountsChanged",t),r=t.length>0||this.wallet.provider===e,n=r?this.wallet.observe("evm"):this.wallet.currentObservation("evm"),[4,this._handleAccountsChanged(e,t,n)]);case 1:return i.sent(),[2]}})})},e.prototype._handleAccountsChanged=function(e,t,r){return i(this,void 0,void 0,function(){var n,i,o,s,u,d,h,f,p,v,g;return a(this,function(a){switch(a.label){case 0:if(0!==t.length)return[3,9];if(this.reopenAdoption(e),this.wallet.provider!==e)return[3,7];if(c.logger.info("OnAccountsChanged: Detecting disconnect, current state:",{evmAddress:this.wallet.evmAddress,evmChainId:this.wallet.evmChainId,providerMatch:this.wallet.provider===e}),this._announcedConnect.delete(e),!this.deps.isAutocaptureEnabled("disconnect"))return[3,5];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})];case 2:return a.sent(),this.disposed?[2]:[3,4];case 3:return n=a.sent(),c.logger.error("Failed to disconnect provider on accountsChanged",n),[3,4];case 4:return[3,6];case 5:c.logger.debug("OnAccountsChanged: Disconnect event skipped (autocapture.disconnect: false)"),this.wallet.beginDisconnect("evm"),this.wallet.clear("evm"),a.label=6;case 6:return[3,8];case 7:c.logger.info("OnAccountsChanged: Ignoring disconnect for non-active provider"),a.label=8;case 8:return[2];case 9:if(!(i=(0,l.validateAndChecksumAddress)(t[0])))return c.logger.warn("onAccountsChanged: Invalid address received",t[0]),[2];if(this.awaitingNewSession.delete(e),this.noteRefusalIfSuppressed(e),o=this.sessionGeneration(e),!this.wallet.provider||this.wallet.provider===e)return[3,26];s=this.wallet.evmAddress,u=(0,l.validateAndChecksumAddress)(i),c.logger.info("OnAccountsChanged: Different provider attempting to connect",{activeProvider:this.registry.infoFor(this.wallet.provider).name,eventProvider:this.registry.infoFor(e).name,currentStoredAddress:s,newProviderAddress:u}),a.label=10;case 10:return a.trys.push([10,22,,26]),[4,this.registry.accountsOf(this.wallet.provider)];case 11:return d=a.sent(),this.disposed?[2]:this.sessionGeneration(e)!==o?(this.dropRefusal(e),[2]):this.wallet.isCurrent(r)?(c.logger.info("OnAccountsChanged: Checking current provider accounts",{activeProvider:this.registry.infoFor(this.wallet.provider).name,accountsLength:d?d.length:0,accounts:d}),d&&d.length>0?u&&s&&u!==s?(c.logger.info("OnAccountsChanged: Different address detected, switching providers despite current provider having accounts",{activeProvider:this.registry.infoFor(this.wallet.provider).name,eventProvider:this.registry.infoFor(e).name,currentAddress:s,newAddress:u,reason:"Address mismatch indicates wallet switch"}),this.deps.isAutocaptureEnabled("disconnect")?[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})]:[3,13]):[3,15]:[3,17]):(this.dropRefusal(e),[2]);case 12:return a.sent(),this.disposed?[2]:[3,14];case 13:c.logger.debug("OnAccountsChanged: Disconnect event skipped during provider switch (autocapture.disconnect: false)"),this.wallet.clear("evm"),a.label=14;case 14:return this.wallet.isCurrent(r)?(this.wallet.clearProvider(),[3,16]):(this.dropRefusal(e),[2]);case 15:return this.deps.isTrackingSuppressed()||this.dropRefusal(e),c.logger.info("OnAccountsChanged: Current provider still has accounts and same address, ignoring new provider",{activeProvider:this.registry.infoFor(this.wallet.provider).name,eventProvider:this.registry.infoFor(e).name,activeProviderAccountsCount:d.length,currentAddress:s,newAddress:u}),[2];case 16:return[3,21];case 17:return c.logger.info("OnAccountsChanged: Current provider has no accounts, switching to new provider",{oldProvider:this.registry.infoFor(this.wallet.provider).name,newProvider:this.registry.infoFor(e).name,reason:"Current provider has no accounts"}),this.deps.isAutocaptureEnabled("disconnect")?[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})]:[3,19];case 18:return a.sent(),this.disposed?[2]:[3,20];case 19:c.logger.debug("OnAccountsChanged: Disconnect event skipped for old provider (autocapture.disconnect: false)"),this.wallet.clear("evm"),a.label=20;case 20:if(!this.wallet.isCurrent(r))return this.dropRefusal(e),[2];a.label=21;case 21:return[3,26];case 22:return h=a.sent(),c.logger.warn("OnAccountsChanged: Could not check current provider accounts, switching to new provider",{error:h instanceof Error?h.message:String(h),errorType:h instanceof Error?h.constructor.name:typeof h,oldProvider:this.wallet.provider?this.registry.infoFor(this.wallet.provider).name:"unknown",newProvider:this.registry.infoFor(e).name,reason:"Could not check current provider accounts"}),this.deps.isAutocaptureEnabled("disconnect")?[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})]:[3,24];case 23:return a.sent(),this.disposed?[2]:[3,25];case 24:c.logger.debug("OnAccountsChanged: Disconnect event skipped for failed provider check (autocapture.disconnect: false)"),this.wallet.clear("evm"),a.label=25;case 25:return this.wallet.isCurrent(r)?[3,26]:(this.dropRefusal(e),[2]);case 26:return this.wallet.provider||(this.wallet.provider=e),this.wallet.provider===e&&i===this.wallet.evmAddress?(this.settleAdoption(e),[2]):(f=this.registry.resolveChainId(e),p=!this.wallet.evmAddress,this.deps.isTrackingSuppressed()?(this.wallet.clearStaleEvmWalletOnSwitchWhileSuppressed(i),this.noteRefusalIfSuppressed(e)):(this.wallet.set("evm",{address:i,chainId:f}),this.settleAdoption(e)),v=this.registry.infoFor(e),g=f||0,this.deps.isAutocaptureEnabled("connect")&&this.shouldReportConnect(e,i)?(c.logger.info("OnAccountsChanged: Detected wallet connection, emitting connect event",{chainId:f,address:i,wasDisconnected:p,providerName:v.name,rdns:v.rdns,hasChainId:!!f}),0===g&&c.logger.info("OnAccountsChanged: Using fallback chainId 0 for connect event"),this.markConnectReported(e,i,g),this.deps.connect({chainId:g,address:i},{providerName:v.name,rdns:v.rdns}).catch(function(e){c.logger.error("Failed to track connect event during account change:",e)})):c.logger.debug("OnAccountsChanged: Connect event skipped (autocapture.connect: false)",{chainId:f,address:i,providerName:v.name}),[2])}})})},e.prototype.registerChainChangedListener=function(e){var t=this;c.logger.info("registerChainChangedListener");var r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.onChainChanged(e,r[0])};e.on("chainChanged",r),this.registry.addListener(e,"chainChanged",r)},e.prototype.onChainChanged=function(e,t){return i(this,void 0,void 0,function(){var r,n;return a(this,function(i){switch(i.label){case 0:if(this.disposed)return[2];if(c.logger.info("onChainChanged",t),r=(0,u.parseChainId)(t),this.registry.rememberChain(e,r),!this.deps.isAutocaptureEnabled("chain")&&e!==this.wallet.provider)return[2];if(this.isProviderMismatch(e)){if("solana"===this.wallet.activeNamespace)return[2];this.handleProviderMismatch(e)}if(!this.wallet.evmAddress)return c.logger.info("OnChainChanged: No current address, user appears disconnected"),[2,Promise.resolve()];this.wallet.provider||(this.wallet.provider=e),this.wallet.set("evm",{chainId:r}),this.deps.retryDetection(),i.label=1;case 1:return i.trys.push([1,5,,6]),this.deps.isAutocaptureEnabled("chain")?[4,this.deps.chain({chainId:r,address:this.wallet.evmAddress})]:[3,3];case 2:return i.sent(),[3,4];case 3:c.logger.debug("OnChainChanged: Chain event skipped (autocapture.chain: false)",{chainId:this.wallet.evmChainId,address:this.wallet.evmAddress}),i.label=4;case 4:return[3,6];case 5:return n=i.sent(),c.logger.error("OnChainChanged: Failed to emit chain event:",n),[3,6];case 6:return[2]}})})},e.prototype.registerConnectChainObserver=function(e){var t=this,r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r[0];t.disposed||"string"==typeof(null==i?void 0:i.chainId)&&(t.registry.rememberChain(e,(0,u.parseChainId)(i.chainId)),t.awaitingNewSession.delete(e),t.noteRefusalIfSuppressed(e))};e.on("connect",r),this.registry.addListener(e,"connect",r)},e.prototype.shouldReportConnect=function(e,t){var r=this._announcedConnect.get(e);return!r||r.address.toLowerCase()!==t.toLowerCase()},e.prototype.markConnectReported=function(e,t,r){this.deps.willTrackEvent(r)&&this._announcedConnect.set(e,{address:t,chainId:r})},e.prototype.registerConnectListener=function(e){var t=this;c.logger.info("registerConnectListener");var r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r[0];t.onConnected(e,i)};e.on("connect",r),this.registry.addListener(e,"connect",r)},e.prototype.registerDisconnectListener=function(e){var t=this;c.logger.info("registerDisconnectListener");var r=function(r){return i(t,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:if(this.disposed)return[2];if(this.reopenAdoption(e),this.wallet.provider!==e)return[2];if(this._announcedConnect.delete(e),c.logger.info("OnDisconnect: Wallet disconnect event received, current state:",{currentAddress:this.wallet.evmAddress,currentChainId:this.wallet.evmChainId}),!this.deps.isAutocaptureEnabled("disconnect"))return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.deps.disconnect({chainId:this.wallet.evmChainId,address:this.wallet.evmAddress})];case 2:return r.sent(),this.disposed?[2]:[3,4];case 3:return t=r.sent(),c.logger.error("Error during disconnect in disconnect listener",t),[3,4];case 4:return[3,6];case 5:c.logger.debug("OnDisconnect: Disconnect event skipped (autocapture.disconnect: false)"),this.wallet.beginDisconnect("evm"),this.wallet.clear("evm"),r.label=6;case 6:return[2]}})})};e.on("disconnect",r),this.registry.addListener(e,"disconnect",r)},e.prototype.onConnected=function(e,t){return i(this,void 0,void 0,function(){var r,n,i,o,s,d,h,f,p,v,g,y;return a(this,function(a){switch(a.label){case 0:if(this.disposed)return[2];c.logger.info("onConnected",t),this.awaitingNewSession.delete(e),this.noteRefusalIfSuppressed(e),r=this.wallet.disconnectsSoFar("evm"),n=this.wallet.currentObservation("evm"),a.label=1;case 1:return a.trys.push([1,3,,4]),(null==t?void 0:t.chainId)&&"string"==typeof t.chainId?(i=(0,u.parseChainId)(t.chainId),this.registry.rememberChain(e,i),o=this.sessionGeneration(e),[4,this.registry.addressOf(e)]):[2];case 2:return s=a.sent(),this.disposed?[2]:this.sessionGeneration(e)!==o?(this.dropRefusal(e),[2]):this.wallet.disconnectsSoFar("evm")!==r?(c.logger.info("onConnected: The wallet disconnected after this observation began; dropping it"),this.dropRefusal(e),[2]):(d=this.wallet.evmAddress,h=!!d&&!!s&&d.toLowerCase()!==s.toLowerCase(),e===this.wallet.provider&&!this.wallet.isCurrent(n)&&h?(c.logger.info("onConnected: A newer signal from this provider has overtaken this connect observation; dropping it"),this.dropRefusal(e),[2]):(i&&s&&(f=!this.wallet.evmAddress,this.noteRefusalIfSuppressed(e),this.wallet.provider||(this.wallet.provider=e),(p=this.wallet.provider===e)&&(this.deps.isTrackingSuppressed()?(this.wallet.clearStaleEvmWalletOnSwitchWhileSuppressed(s),this.noteRefusalIfSuppressed(e)):(this.wallet.set("evm",{chainId:i,address:(0,l.validateAndChecksumAddress)(s)||void 0}),this.settleAdoption(e))),p&&this.wallet.evmAddress&&this.shouldReportConnect(e,s)?(g=this.registry.infoFor(e),v=i||0,this.deps.isAutocaptureEnabled("connect")?(c.logger.info("OnConnected: Detected wallet connection, emitting connect event",{chainId:i,wasDisconnected:f,providerName:g.name,rdns:g.rdns,hasChainId:!!i,isActiveProvider:p}),0===v&&c.logger.info("OnConnected: Using fallback chainId 0 for connect event"),this.markConnectReported(e,s,v),this.deps.connect({chainId:v,address:s},{providerName:g.name,rdns:g.rdns}).catch(function(e){c.logger.error("Failed to track connect event during provider connection:",e)})):c.logger.debug("OnConnected: Connect event skipped (autocapture.connect: false)",{chainId:i,address:s,providerName:g.name})):s&&!p&&(g=this.registry.infoFor(e),c.logger.debug("OnConnected: Skipping connect event for non-active provider",{chainId:i,providerName:g.name,rdns:g.rdns,isActiveProvider:p,activeProviderInfo:this.wallet.provider?this.registry.infoFor(this.wallet.provider):null}))),[3,4]));case 3:return y=a.sent(),c.logger.error("Error handling connect event",y),[3,4];case 4:return[2]}})})},e.prototype.tracksDiscovered=function(){return!this.deps.isWagmiMode()},e.prototype.getProviders=function(){return i(this,void 0,void 0,function(){var e,t,r,n,o,u,l,h,f,p=this;return a(this,function(v){if(e=(0,s.createStore)(),this.discoveryStore=e,t=e.getProviders(),this.unsubscribeDiscovery=e.subscribe(function(e){t=e;for(var r=e.filter(function(e){var t=null==e?void 0:e.provider;return t&&!p.registry.isSeen(t)}),n=0,o=r;n<o.length;n++){var s=o[n];p.registry.add(s)}var u=e.filter(function(e){var t=null==e?void 0:e.provider;return!!t&&!p.registry.isTracked(t)}),l=p.tracksDiscovered()?u:r;p.tracksDiscovered()&&u.length>0&&p.trackProviders(u),l.length>0&&i(p,void 0,void 0,function(){var e;return a(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.detectWallets(l)];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),c.logger.error("Formo: Failed to detect wallets",e),[3,3];case 3:return[2]}})}),p.cleanupUnavailableProviders(e)}),0===t.length){if(r="undefined"!=typeof window?window.ethereum:void 0){if(this.registry.injected&&this.registry.injected.provider===r)return this.tracksDiscovered()&&!this.registry.isTracked(r)&&this.trackEIP1193Provider(r),this.registry.add(this.registry.injected),[2,this.registry.all];this.tracksDiscovered()&&!this.registry.isTracked(r)&&this.trackEIP1193Provider(r),n=(0,d.detectInjectedProviderInfo)(r),o={provider:r,info:n},this.registry.injected=o,this.registry.add(o)}return[2,this.registry.all]}for(u=t.filter(function(e){var t=null==e?void 0:e.provider;return t&&!p.registry.isSeen(t)}),l=0,h=u;l<h.length;l++)f=h[l],this.registry.add(f);return[2,this.registry.all]})})},e.prototype.detectWallets=function(e){return i(this,void 0,void 0,function(){var t,r,n,i;return a(this,function(a){switch(a.label){case 0:a.trys.push([0,5,,6]),t=0,r=e,a.label=1;case 1:return t<r.length?(n=r[t],[4,this.deps.detect({providerName:null==n?void 0:n.info.name,rdns:null==n?void 0:n.info.rdns})]):[3,4];case 2:a.sent(),a.label=3;case 3:return t++,[3,1];case 4:return[3,6];case 5:return i=a.sent(),c.logger.error("Error detect all wallets:",i),[3,6];case 6:return[2]}})})},e.prototype.detectableProviders=function(){var e,t=new Set;null===(e=this.discoveryStore)||void 0===e||e.getProviders().forEach(function(e){return t.add(e.provider)});var r="undefined"!=typeof window?window.ethereum:void 0;return r&&t.add(r),this.externallyRegistered.forEach(function(e){return t.add(e)}),this.registry.all.filter(function(e){return t.has(e.provider)})},e.prototype.seedProviderChainFromState=function(e){var t=e.chainId,r="string"==typeof t?(0,u.parseChainId)(t):"number"==typeof t?t:void 0;this.registry.rememberChain(e,r)},e.prototype.untrackProvider=function(e){this.settleAdoption(e);try{this.registry.removeListeners(e),0===this.registry.attachedEvents(e).length&&this.registry.forgetTracked(e),this.wallet.provider===e&&this.wallet.clearProvider()}catch(e){c.logger.warn("Failed to untrack provider",e)}},e.prototype.cleanupUnavailableProviders=function(e){for(var t=new Set(e.map(function(e){return e.provider})),r=0,n=this.registry.trackedProviders();r<n.length;r++){var i=n[r];this.externallyRegistered.has(i)||t.has(i)||(c.logger.info("Cleaning up unavailable provider: ".concat(i.constructor.name)),this.untrackProvider(i))}},e.prototype.handleProviderMismatch=function(e){this.wallet.provider?this.wallet.set("evm",{address:void 0,chainId:void 0,provider:e}):this.wallet.provider=e},e}();t.EvmEventTracker=f},2598(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EvmProviderRegistry=void 0;var o=r(3312),s=r(4657),c=r(6653),u=r(2657),l=function(){function e(e){this.deps=e,this.details=[],this.tracked=new Set,this.seen=new Set,this.chainIds=new WeakMap,this.chainGenerations=new WeakMap,this.listeners=new Map,this.attributions=new WeakMap}return Object.defineProperty(e.prototype,"all",{get:function(){return this.details},enumerable:!1,configurable:!0}),e.prototype.isTracked=function(e){return this.tracked.has(e)},e.prototype.markTracked=function(e){this.tracked.add(e)},e.prototype.forgetTracked=function(e){this.tracked.delete(e)},e.prototype.trackedProviders=function(){return Array.from(this.tracked)},e.prototype.isSeen=function(e){return this.seen.has(e)},Object.defineProperty(e.prototype,"injected",{get:function(){return this.injectedDetail},set:function(e){this.injectedDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"counts",{get:function(){return{totalProviders:this.details.length,trackedProviders:this.tracked.size,seenProviders:this.seen.size}},enumerable:!1,configurable:!0}),e.prototype.add=function(e){var t=null==e?void 0:e.provider;return!!t&&!this.details.some(function(e){return e.provider===t})&&(this.details=a(a([],this.details,!0),[e],!1),this.seen.add(t),!0)},e.prototype.rememberAttribution=function(e,t){e&&(t?this.attributions.set(e,t):this.attributions.delete(e))},e.prototype.suppliedAttributionFor=function(e){var t=this.attributions.get(e);if(t)try{var r=t();return(null==r?void 0:r.name)?r:void 0}catch(e){return}},e.prototype.infoFor=function(e){var t,r,n=this.details.find(function(t){return t.provider===e}),i=n?void 0:this.suppliedAttributionFor(e),a=n?{name:n.info.name,rdns:n.info.rdns}:(r=(0,c.detectInjectedProviderInfo)(e),i?{name:i.name,rdns:null!==(t=i.rdns)&&void 0!==t?t:r.rdns}:{name:r.name,rdns:r.rdns});if("WalletConnect"===a.name||"Injected Provider"===a.name){var o=(0,c.readWalletConnectPeer)(e);if(null==o?void 0:o.name)return{name:o.name,rdns:"io.injected.provider"===a.rdns?"com.walletconnect":a.rdns}}return a},e.prototype.addListener=function(e,t,r){var n=this.listeners.get(e)||{};n[t]=r,this.listeners.set(e,n)},e.prototype.removeListeners=function(e){var t=this.listeners.get(e);if(t){for(var r={},n=0,i=Object.entries(t);n<i.length;n++){var a=i[n],s=a[0],c=a[1];try{e.removeListener(s,c)}catch(e){o.logger.warn("Failed to remove listener for ".concat(String(s)),e),r[s]=c}}Object.keys(r).length>0?this.listeners.set(e,r):this.listeners.delete(e)}},e.prototype.attachedEvents=function(e){var t;return Object.keys(null!==(t=this.listeners.get(e))&&void 0!==t?t:{})},e.prototype.isWrapped=function(e,t){return!(!t||"function"!=typeof t||!t[u.WRAPPED_REQUEST_SYMBOL]||e[u.WRAPPED_REQUEST_REF_SYMBOL]!==t)},e.prototype.chainIdOf=function(e){return this.chainIds.get(e)},e.prototype.bumpChainGeneration=function(e){var t,r=(null!==(t=this.chainGenerations.get(e))&&void 0!==t?t:0)+1;return this.chainGenerations.set(e,r),r},e.prototype.chainGeneration=function(e){var t;return null!==(t=this.chainGenerations.get(e))&&void 0!==t?t:0},e.prototype.rememberChain=function(e,t){e&&t&&(this.bumpChainGeneration(e),this.chainIds.set(e,t),this.deps.onChainObserved(e,t))},e.prototype.resolveChainId=function(e){if(e){var t=this.chainIds.get(e);if(t)return t;var r=this.deps.activeChainId();return e===this.deps.activeProvider()&&r?r:0}return this.deps.activeChainId()||0},e.prototype.addressOf=function(e){return n(this,void 0,void 0,function(){var t,r,n,a;return i(this,function(i){switch(i.label){case 0:return t=this.deps.activeProvider(),r=e||t,e&&e!==t||!(n=this.deps.knownEvmAddress())?r?[4,this.accountsOf(r)]:(o.logger.info("The provider is not set"),[2,null]):[2,n];case 1:return(a=i.sent())&&a.length>0?[2,(0,s.validateAndChecksumAddress)(a[0])||null]:[2,null]}})})},e.prototype.accountsOf=function(e){return n(this,void 0,void 0,function(){var t,r,n;return i(this,function(i){switch(i.label){case 0:t=e||this.deps.activeProvider(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,null==t?void 0:t.request({method:"eth_accounts"})];case 2:return(r=i.sent())&&0!==r.length?[2,r.map(function(e){return(0,s.validateAndChecksumAddress)(e)}).filter(function(e){return void 0!==e})]:[2,null];case 3:return 4001!==(null==(n=i.sent())?void 0:n.code)&&o.logger.error("EvmProviderRegistry::accountsOf: eth_accounts threw an error",n),[2,null];case 4:return[2]}})})},e}();t.EvmProviderRegistry=l},7295(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EvmRequestTracker=void 0;var c=r(3312),u=r(6653),l=r(7392),d=r(4657),h=r(2657),f=r(8694);function p(e){var t="string"==typeof e&&e.startsWith("0x")?e.slice(2):e;if("string"!=typeof t||0===t.length)return"";for(var r=Math.floor(t.length/2),n=new Uint8Array(r),i=0;i<r;i++){var a=Number.parseInt(t.substring(2*i,2*i+2),16);if(Number.isNaN(a))return(new TextDecoder).decode(n.subarray(0,i));n[i]=a}return(new TextDecoder).decode(n)}var v=new WeakSet,g=function(){function e(t,r,n){this.wallet=t,this.registry=r,this.deps=n,this.polls=new Set,this.disposed=!1,this.wrappedProviders=new Set,this.creationSeq=e.nextCreationSeq++}return e.prototype.cleanup=function(){var e=this;this.disposed=!0,this.polls.forEach(function(e){return clearTimeout(e)}),this.polls.clear(),this.wrappedProviders.forEach(function(t){var r=t[h.WRAPPED_REQUEST_OWNER_SYMBOL];if(Array.isArray(r)){var n=r.indexOf(e);-1!==n&&r.splice(n,1)}}),this.wrappedProviders.clear()},e.prototype.schedulePoll=function(e,t){var r=this;if(!this.disposed){var n=setTimeout(function(){r.polls.delete(n),e()},t);this.polls.add(n)}},e.prototype.insertBySeniority=function(e){var t=this,r=e.indexOf(this);-1!==r&&e.splice(r,1);var n=e.findIndex(function(e){return e.creationSeq>t.creationSeq});-1===n?e.push(this):e.splice(n,0,this)},e.prototype.registerRequestListeners=function(e){var t=this;if(c.logger.info("registerRequestListeners"),!e)return c.logger.error("Provider not found for request (signature, transaction) tracking"),!1;var r=e.request;if(this.registry.isWrapped(e,r)){var n=e[h.WRAPPED_REQUEST_OWNER_SYMBOL];return Array.isArray(n)?(this.insertBySeniority(n),this.wrappedProviders.add(e),c.logger.info("Provider already wrapped; rebinding the wrapper to this instance."),!0):(c.logger.warn("wrapped without owner list; cannot rebind"),!1)}var o=e.request.bind(e);try{var u=e,l=u[h.WRAPPED_REQUEST_OWNER_SYMBOL];n=Array.isArray(l)?l:[],this.insertBySeniority(n),Array.isArray(l)||(u[h.WRAPPED_REQUEST_OWNER_SYMBOL]=n),this.wrappedProviders.add(e)}catch(e){}return this.installWrappedRequest(e,function(r){return i(t,[r],void 0,function(t){var r,n,i=t.method,c=t.params;return a(this,function(t){if(r=e[h.WRAPPED_REQUEST_OWNER_SYMBOL],v.has(e))return[2,o({method:i,params:c})];n=Array.isArray(r)?s([],r,!0).reverse().find(function(e){return!e.disposed}):void 0,v.add(e);try{return[2,(null!=n?n:this).dispatchWrappedRequest({method:i,params:c},e,o)]}finally{v.delete(e)}})})})},e.prototype.installWrappedRequest=function(e,t){t[h.WRAPPED_REQUEST_SYMBOL]=!0;try{return e[h.WRAPPED_REQUEST_REF_SYMBOL]=t,e.request=t,e.request===t||(c.logger.warn("request assignment swallowed; not wrapped"),!1)}catch(e){return c.logger.warn("Failed to wrap provider.request; skipping",e),!1}},e.prototype.dispatchWrappedRequest=function(e,t,r){return i(this,arguments,void 0,function(e,t,r){var o,s,d,f,p,v,g,y,m,b,A,S,w,E,_,C,I=this,k=e.method,P=e.params;return a(this,function(e){switch(e.label){case 0:if("eth_chainId"===k)return o=this.registry.chainGeneration(t),[2,r({method:k,params:P}).then(function(e){return o===I.registry.chainGeneration(t)&&"string"==typeof e&&I.registry.rememberChain(t,(0,l.parseChainId)(e)),e})];if(!Array.isArray(P)||!["eth_signTypedData_v4","personal_sign"].includes(k))return[3,4];if(!this.deps.isAutocaptureEnabled("signature"))return c.logger.debug("Signature event skipped (autocapture.signature: false)",{method:k}),[2,r({method:k,params:P})];if(null===(E=(w=this.deps).shouldSkipRequestCapture)||void 0===E?void 0:E.call(w,k,P))return[2,r({method:k,params:P})];(s=r({method:k,params:P})).catch(function(){}),d=this.registry.resolveChainId(t),f=this.attributionFor(t),i(I,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.deps.signature(n({status:h.SignatureStatus.REQUESTED},this.buildSignatureEventPayload(k,P,void 0,d,t)),f)];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),c.logger.error("Formo: Failed to track signature request",e),[3,3];case 3:return[2]}})}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s];case 2:return(p=e.sent())&&i(I,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.deps.signature(n({status:h.SignatureStatus.CONFIRMED},this.buildSignatureEventPayload(k,P,p,d,t)),f)];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),c.logger.error("Formo: Failed to track signature confirmation",e),[3,3];case 3:return[2]}})}),[2,p];case 3:throw v=e.sent(),S=v,(0,u.isUserRejectionError)(S)&&i(I,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.deps.signature(n({status:h.SignatureStatus.REJECTED},this.buildSignatureEventPayload(k,P,void 0,d,t)),f)];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),c.logger.error("Formo: Failed to track signature rejection",e),[3,3];case 3:return[2]}})}),v;case 4:if("wallet_sendCalls"===k&&Array.isArray(P)&&P[0])return[2,this.trackBatchedCalls(t,r,P)];if(!Array.isArray(P)||"eth_sendTransaction"!==k||!P[0])return[3,8];if(!this.deps.isAutocaptureEnabled("transaction"))return c.logger.debug("Transaction event skipped (autocapture.transaction: false)",{method:k}),[2,r({method:k,params:P})];if(null===(C=(_=this.deps).shouldSkipRequestCapture)||void 0===C?void 0:C.call(_,k,P))return[2,r({method:k,params:P})];(g=r({method:k,params:P})).catch(function(){}),y=this.registry.resolveChainId(t),m=this.attributionFor(t),i(I,void 0,void 0,function(){var e,r;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.buildTransactionEventPayload(P,t,y)];case 1:return e=i.sent(),[4,this.deps.transaction(n({status:h.TransactionStatus.STARTED},e),m)];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),c.logger.error("Formo: Failed to track transaction start",r),[3,4];case 4:return[2]}})}),e.label=5;case 5:return e.trys.push([5,7,,8]),[4,g];case 6:return b=e.sent(),i(I,void 0,void 0,function(){var e,r;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.buildTransactionEventPayload(P,t,y)];case 1:return e=i.sent(),[4,this.deps.transaction(n(n({status:h.TransactionStatus.BROADCASTED},e),{transactionHash:b}),m)];case 2:return i.sent(),this.pollTransactionReceipt(t,b,e,m),[3,4];case 3:return r=i.sent(),c.logger.error("Formo: Failed to track transaction broadcast",r),[3,4];case 4:return[2]}})}),[2,b];case 7:throw A=e.sent(),S=A,(0,u.isUserRejectionError)(S)&&i(I,void 0,void 0,function(){var e,r;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.buildTransactionEventPayload(P,t,y)];case 1:return e=i.sent(),[4,this.deps.transaction(n({status:h.TransactionStatus.REJECTED},e),m)];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),c.logger.error("Formo: Failed to track transaction rejection",r),[3,4];case 4:return[2]}})}),A;case 8:return[2,r({method:k,params:P})]}})})},e.prototype.attributionFor=function(e){var t=this.registry.infoFor(e);return{providerName:t.name,rdns:t.rdns}},e.prototype.buildSignatureEventPayload=function(e,t,r,i,a){var o,s="personal_sign"===e?t[1]:t[0],c=(0,d.validateAndChecksumAddress)(s);if(!c)throw new Error("Invalid address in signature payload: ".concat(s));var u=null!==(o=null!=i?i:this.wallet.evmChainId)&&void 0!==o?o:void 0;return a&&a!==this.wallet.provider&&this.wallet.provider||this.wallet.backfill(c,u,a),n(n({},{chainId:u,address:c}),"personal_sign"===e?{message:p(t[0])}:{message:t[1]})},e.prototype.buildTransactionEventPayload=function(e,t,r){return i(this,void 0,void 0,function(){var n,i,o,s,c,u,l;return a(this,function(a){if(n=e[0],i=n.data,o=n.from,s=n.to,c=n.value,!(u=(0,d.validateAndChecksumAddress)(o)))throw new Error("Invalid address in transaction payload: ".concat(o));return l=null!=r?r:this.registry.resolveChainId(t),t&&t!==this.wallet.provider&&this.wallet.provider||this.wallet.backfill(u,l,t),[2,{chainId:l,data:i,address:u,to:s,value:c}]})})},e.prototype.pollTransactionReceipt=function(e,t,r,o){return i(this,arguments,void 0,function(e,t,r,o,s,u){var l,d,f=this;return void 0===s&&(s=10),void 0===u&&(u=3e3),a(this,function(p){return l=0,e?(d=function(){return i(f,void 0,void 0,function(){var i,f;return a(this,function(a){switch(a.label){case 0:if(this.disposed)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.request({method:"eth_getTransactionReceipt",params:[t]})];case 2:if(i=a.sent()){if("0x1"===i.status||1===i.status)return this.deps.transaction(n(n({status:h.TransactionStatus.CONFIRMED},r),{transactionHash:t}),o).catch(function(e){return c.logger.error("Formo: Failed to track transaction confirmation",e)}),[2];if("0x0"===i.status||0===i.status)return this.deps.transaction(n(n({status:h.TransactionStatus.REVERTED},r),{transactionHash:t}),o).catch(function(e){return c.logger.error("Formo: Failed to track transaction revert",e)}),[2]}return[3,4];case 3:return f=a.sent(),c.logger.error("Error polling transaction receipt",f),[3,4];case 4:return++l<s&&this.schedulePoll(d,u),[2]}})})},d(),[2]):[2]})})},e.prototype.trackBatchedCalls=function(e,t,r){return i(this,void 0,void 0,function(){var i,s,p,v,g,y,m,b,A,S,w,E,_,C,I,k,P,O,T,R,L,x,D,H;return a(this,function(a){switch(a.label){case 0:if(!this.deps.isAutocaptureEnabled("transaction"))return c.logger.debug("Transaction event skipped (autocapture.transaction: false)",{method:"wallet_sendCalls"}),[2,t({method:"wallet_sendCalls",params:r})];if(null===(D=(x=this.deps).shouldSkipRequestCapture)||void 0===D?void 0:D.call(x,"wallet_sendCalls",r))return[2,t({method:"wallet_sendCalls",params:r})];if((i=t({method:"wallet_sendCalls",params:r})).catch(function(){}),s=r[0],p=Array.isArray(null==s?void 0:s.calls)?s.calls:[],v="string"==typeof(null==s?void 0:s.chainId)?(0,l.parseChainId)(s.chainId):void 0,g=v||this.registry.resolveChainId(e),!(y=(0,d.validateAndChecksumAddress)(null!==(H=null==s?void 0:s.from)&&void 0!==H?H:"")))return c.logger.warn("Formo: wallet_sendCalls has no valid `from`; not tracking",{from:null==s?void 0:s.from}),[2,i];if(0===p.length)return c.logger.debug("Formo: wallet_sendCalls carried no calls"),[2,i];for(e&&e!==this.wallet.provider&&this.wallet.provider||this.wallet.backfill(y,g,e),m=this.attributionFor(e),b=p.map(function(e,t){return{chainId:g,address:y,to:null==e?void 0:e.to,value:null==e?void 0:e.value,data:null==e?void 0:e.data,properties:n({batch_size:p.length,batch_index:t},m)}}),A=0,S=b;A<S.length;A++)T=S[A],R=T.properties,L=o(T,["properties"]),this.deps.transaction(n({status:h.TransactionStatus.STARTED},L),R).catch(function(e){return c.logger.error("Formo: Failed to track batch call start",e)});a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i];case 2:for(w=a.sent(),E=(0,f.readBatchId)(w),_=0,C=b;_<C.length;_++)T=C[_],R=T.properties,L=o(T,["properties"]),this.deps.transaction(n({status:h.TransactionStatus.BROADCASTED},L),n(n({},R),E?{batch_id:E}:{})).catch(function(e){return c.logger.error("Formo: Failed to track batch call broadcast",e)});return E&&this.pollBatchStatus(e,E,b),[2,w];case 3:if(I=a.sent(),k=I,(0,u.isUserRejectionError)(k))for(P=0,O=b;P<O.length;P++)T=O[P],R=T.properties,L=o(T,["properties"]),this.deps.transaction(n({status:h.TransactionStatus.REJECTED},L),R).catch(function(e){return c.logger.error("Formo: Failed to track batch call rejection",e)});throw I;case 4:return[2]}})})},e.prototype.pollBatchStatus=function(e,t,r){return i(this,arguments,void 0,function(e,t,r,s,u){var l,d,h=this;return void 0===s&&(s=10),void 0===u&&(u=3e3),a(this,function(p){return e?(l=0,d=function(){return i(h,void 0,void 0,function(){var i,h,p,v=this;return a(this,function(a){switch(a.label){case 0:if(this.disposed)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.request({method:"wallet_getCallsStatus",params:[t]})];case 2:return i=a.sent(),void 0!==(h=(0,f.readBatchStatusCode)(i))&&h>=200?(r.forEach(function(e,a){var s=(0,f.batchReceiptForCall)(i,a,r.length),u=(0,f.batchCallOutcome)(h,s);if(void 0!==u){var l=e.properties,d=o(e,["properties"]);v.deps.transaction(n(n({status:u},d),(null==s?void 0:s.transactionHash)?{transactionHash:s.transactionHash}:{}),n(n({},l),{batch_id:t})).catch(function(e){return c.logger.error("Formo: Failed to track batch call outcome",e)})}}),[2]):[3,4];case 3:return p=a.sent(),c.logger.error("Error polling batch call status",p),[3,4];case 4:return++l<s&&this.schedulePoll(d,u),[2]}})})},d(),[2]):[2]})})},e.nextCreationSeq=0,e}();t.EvmRequestTracker=g},8694(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.readBatchId=function(e){if("string"==typeof e&&e.length>0)return e;if(e&&"object"==typeof e){var t=e.id;if("string"==typeof t&&t.length>0)return t}},t.readBatchStatusCode=i,t.readBatchChainId=function(e){var t=null==e?void 0:e.chainId;if("number"==typeof t&&Number.isFinite(t)&&t>0)return t;if("string"==typeof t){var r=parseInt(t,16);if(Number.isFinite(r)&&r>0)return r}},t.batchCallOutcome=function(e,t){var r=null==t?void 0:t.status;return void 0!==r?"0x0"===r||0===r||"reverted"===r?n.TransactionStatus.REVERTED:n.TransactionStatus.CONFIRMED:e>=600?void 0:e>=500?n.TransactionStatus.REVERTED:e>=400?n.TransactionStatus.REJECTED:n.TransactionStatus.CONFIRMED},t.batchReceiptForCall=function(e,t,r){var n,a=Array.isArray(null==e?void 0:e.receipts)?e.receipts:[],o=null!==(n=i(e))&&void 0!==n?n:0;return!0===(null==e?void 0:e.atomic)||void 0===(null==e?void 0:e.atomic)&&1===a.length&&r>1&&o<600?a[0]:a[t]};var n=r(4164);function i(e){return"number"==typeof(null==e?void 0:e.statusCode)?e.statusCode:"number"==typeof(null==e?void 0:e.status)?e.status:void 0}},7688(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return r(this,void 0,void 0,function(){var r,a,o,s,c,u,l,d,h;return n(this,function(f){switch(f.label){case 0:a=(r=t||{}).retries,o=void 0===a?0:a,s=r.retryDelay,c=r.retryOn,u=i(r,["retries","retryDelay","retryOn"]),l=function(t){var r,i,a,l;return n(this,function(n){switch(n.label){case 0:r=t===o,n.label=1;case 1:return n.trys.push([1,6,,10]),[4,globalThis.fetch(e,u)];case 2:return(i=n.sent()).ok||r?[2,{value:i}]:((a=new Error(i.statusText)).response=i,(null==c?void 0:c(t,a,i))?s?[4,new Promise(function(e){return setTimeout(e,s(t))})]:[3,4]:[3,5]);case 3:n.sent(),n.label=4;case 4:return[2,"continue"];case 5:return[2,{value:i}];case 6:if(l=n.sent(),r)throw l;return(null==c?void 0:c(t,l,null))?s?[4,new Promise(function(e){return setTimeout(e,s(t))})]:[3,8]:[3,9];case 7:n.sent(),n.label=8;case 8:return[2,"continue"];case 9:throw l;case 10:return[2]}})},d=0,f.label=1;case 1:return d<=o?[5,l(d)]:[3,4];case 2:if("object"==typeof(h=f.sent()))return[2,h.value];f.label=3;case 3:return d++,[3,1];case 4:throw new Error("Unexpected: retry loop exited without returning or throwing")}})})}},5135(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});var a=r(6271);i(r(5164),t),i(r(4245),t),"undefined"!=typeof window&&(window.formofy=a.formofy)},6271(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.formofy=function(e,t){e&&"undefined"!=typeof window?n.FormoAnalytics.init(e,t).then(function(e){if(window.formo=e,null==t?void 0:t.ready)try{t.ready(e)}catch(e){console.error("Error in FormoAnalytics ready callback:",e)}}).catch(function(e){return console.error("Error initializing FormoAnalytics:",e)}):console.warn("FormoAnalytics not found")};var n=r(8718)},7378(e,t){var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.Logger=void 0;var n=function(){function e(e,t){void 0===e&&(e=!1),void 0===t&&(t=[]),this.enabled=e,this.enabledLevels=new Set(t)}return e.init=function(t){var r=e.getInstance();void 0!==t.enabled&&r.setEnabled(t.enabled),void 0!==t.enabledLevels&&r.setEnabledLevels(t.enabledLevels)},e.getInstance=function(t){var r,n;return e.instance||(e.instance=new e(null!==(r=null==t?void 0:t.enabled)&&void 0!==r&&r,null!==(n=null==t?void 0:t.enabledLevels)&&void 0!==n?n:[])),e.instance},e.prototype.setEnabled=function(e){this.enabled=e},e.prototype.isLoggingEnabled=function(){return this.enabled},e.prototype.setEnabledLevels=function(e){this.enabledLevels=new Set(e)},e.prototype.getEnabledLevels=function(){return Array.from(this.enabledLevels)},e.prototype.shouldLog=function(e){return!!this.enabled&&this.enabledLevels.has(e)},e.prototype.formatMessage=function(e){var t=(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return"[Formo SDK][".concat(t,"] ").concat(e)},e.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("debug")&&console.debug.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("info")&&console.info.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("warn")&&console.warn.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("error")&&console.error.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.trace=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.shouldLog("trace")&&console.trace.apply(console,r([this.formatMessage(e)],t,!1))},e.prototype.log=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.info.apply(this,r([e],t,!1))},e}();t.Logger=n,t.logger=n.getInstance()},3312(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7378),t),i(r(9954),t)},9954(e,t){Object.defineProperty(t,"__esModule",{value:!0})},4328(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.parsePrivyProperties=void 0;var n=r(6053);Object.defineProperty(t,"parsePrivyProperties",{enumerable:!0,get:function(){return n.parsePrivyProperties}})},6053(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.parsePrivyProperties=f,t.identifyPrivyUser=function(e,t){return i(this,arguments,void 0,function(e,t,r){var i,o,s,u,l,d,p,v,g,y,m,b,A,S,w;return void 0===r&&(r={}),a(this,function(a){switch(a.label){case 0:if(!e||!t)return[2,void 0];if(null===(b=(i=e).isTrackingSuppressed)||void 0===b?void 0:b.call(i))return[2,void 0];if(o=f(t),s=o.properties,0===(u=o.wallets).length)return c.logger.info("identifyPrivyUser: user has no linked wallets; nothing to identify",t.id),[2,void 0];l=n(n({},s),r.properties),d=function(e,t,r){if(t)return e.find(function(e){return h(e.address,t)});if(r){var n=e.find(function(e){return h(e.address,r)});if(n)return n}var i=e.filter(function(e){return!e.isEmbedded});return i.length>0?i[i.length-1]:e[e.length-1]}(u,null!==(A=r.activeAddress)&&void 0!==A?A:i.currentAddress,null===(S=t.wallet)||void 0===S?void 0:S.address),null===(w=i.syncPrivyActiveChain)||void 0===w||w.call(i,null==d?void 0:d.chainType,null==d?void 0:d.address),p=i.identify.bind(e),v=0,g=u,a.label=1;case 1:return v<g.length?(y=g[v],m=n(n({},l),{is_embedded:y.isEmbedded}),y.walletClient&&(m.wallet_client=y.walletClient),y.chainType&&(m.chain_type=y.chainType),[4,p({address:y.address,userId:t.id,setActive:y===d},m)]):[3,4];case 2:a.sent(),a.label=3;case 3:return v++,[3,1];case 4:return[2,d?{address:d.address,chainType:d.chainType}:void 0]}})})};var c=r(3312);function u(e){return("wallet"===e.type||"smart_wallet"===e.type)&&!!e.address}function l(e){if(e instanceof Date){var t=e.getTime();return Number.isNaN(t)?void 0:t}if("number"==typeof e){if(!Number.isFinite(e))return;return e<1e11?1e3*e:e}if("string"==typeof e){var r=Date.parse(e);return Number.isNaN(r)?void 0:r}}var d=/^0x[0-9a-f]{40}$/i;function h(e,t){return d.test(e)&&d.test(t)?e.toLowerCase()===t.toLowerCase():e===t}function f(e){var t,r,n,i,a,c,h,f,p,v,g,y,m,b,A,S,w,E,_=e.linkedAccounts||[],C={privyDid:e.id,privyCreatedAt:l(e.createdAt)};if((null===(t=e.email)||void 0===t?void 0:t.address)&&(C.email=e.email.address),(null===(r=e.phone)||void 0===r?void 0:r.number)&&(C.phone=e.phone.number),(null===(n=e.apple)||void 0===n?void 0:n.email)&&(C.apple=e.apple.email),(null===(i=e.discord)||void 0===i?void 0:i.username)&&(C.discord=e.discord.username),(null===(a=e.farcaster)||void 0===a?void 0:a.username)&&(C.farcaster=e.farcaster.username),(null===(c=e.github)||void 0===c?void 0:c.username)&&(C.github=e.github.username),(null===(h=e.google)||void 0===h?void 0:h.email)&&(C.google=e.google.email),(null===(f=e.instagram)||void 0===f?void 0:f.username)&&(C.instagram=e.instagram.username),(null===(p=e.line)||void 0===p?void 0:p.email)&&(C.line=e.line.email),(null===(v=e.linkedin)||void 0===v?void 0:v.email)&&(C.linkedin=e.linkedin.email),(null===(g=e.spotify)||void 0===g?void 0:g.email)&&(C.spotify=e.spotify.email),(null===(y=e.telegram)||void 0===y?void 0:y.username)&&(C.telegram=e.telegram.username),(null===(m=e.tiktok)||void 0===m?void 0:m.username)&&(C.tiktok=e.tiktok.username),(null===(b=e.twitch)||void 0===b?void 0:b.username)&&(C.twitch=e.twitch.username),(null===(A=e.twitter)||void 0===A?void 0:A.username)&&(C.twitter=e.twitter.username),!C.email){var I=_.find(function(e){return"email"===e.type});(null==I?void 0:I.address)&&(C.email=I.address)}if(!C.phone){var k=_.find(function(e){return"phone"===e.type});(null==k?void 0:k.number)&&(C.phone=k.number)}if(!C.apple){var P=_.find(function(e){return"apple_oauth"===e.type});(null==P?void 0:P.email)&&(C.apple=P.email)}if(!C.discord){var O=_.find(function(e){return"discord_oauth"===e.type});(null==O?void 0:O.username)&&(C.discord=O.username)}if(!C.farcaster){var T=_.find(function(e){return"farcaster"===e.type});(null==T?void 0:T.username)?C.farcaster=T.username:(null==T?void 0:T.displayName)&&(C.farcaster=T.displayName)}if(!C.github){var R=_.find(function(e){return"github_oauth"===e.type});(null==R?void 0:R.username)&&(C.github=R.username)}if(!C.google){var L=_.find(function(e){return"google_oauth"===e.type});(null==L?void 0:L.email)&&(C.google=L.email)}if(!C.instagram){var x=_.find(function(e){return"instagram_oauth"===e.type});(null==x?void 0:x.username)&&(C.instagram=x.username)}if(!C.line){var D=_.find(function(e){return"line_oauth"===e.type});(null==D?void 0:D.email)&&(C.line=D.email)}if(!C.linkedin){var H=_.find(function(e){return"linkedin_oauth"===e.type});(null==H?void 0:H.email)&&(C.linkedin=H.email)}if(!C.spotify){var M=_.find(function(e){return"spotify_oauth"===e.type});(null==M?void 0:M.email)&&(C.spotify=M.email)}if(!C.telegram){var j=_.find(function(e){return"telegram"===e.type});(null==j?void 0:j.username)?C.telegram=j.username:(null==j?void 0:j.telegramUserId)&&(C.telegram=j.telegramUserId)}if(!C.tiktok){var N=_.find(function(e){return"tiktok_oauth"===e.type});(null==N?void 0:N.username)&&(C.tiktok=N.username)}if(!C.twitch){var W=_.find(function(e){return"twitch_oauth"===e.type});(null==W?void 0:W.username)?C.twitch=W.username:(null==W?void 0:W.email)&&(C.twitch=W.email)}if(!C.twitter){var U=_.find(function(e){return"twitter_oauth"===e.type});(null==U?void 0:U.username)&&(C.twitter=U.username)}var F=_.find(function(e){return"custom_auth"===e.type});(null==F?void 0:F.customUserId)&&(C.customUserId=F.customUserId),C.email||(C.google?C.email=C.google:C.apple?C.email=C.apple:C.linkedin&&(C.email=C.linkedin));for(var B=[],K=0,V=_;K<V.length;K++){var G=V[K];if(u(G))B.push({address:G.address,walletClient:null!==(S=G.walletClientType||G.walletClient)&&void 0!==S?S:void 0,chainType:null!==(w=G.chainType)&&void 0!==w?w:void 0,isEmbedded:"privy"===G.walletClientType||"privy"===G.walletClient});else if("cross_app"===G.type)for(var q=0,Y=s(s([],G.embeddedWallets||[],!0),G.smartWallets||[],!0);q<Y.length;q++){var z=Y[q];(null==z?void 0:z.address)&&B.push({address:z.address,walletClient:"cross_app",chainType:null!==(E=z.chainType)&&void 0!==E?E:void 0,isEmbedded:!0,fromCrossApp:!0})}}for(var Q=new Map,J=[],X=0,Z=B;X<Z.length;X++){var $=Z[X],ee=d.test($.address)?$.address.toLowerCase():$.address,te=Q.get(ee);void 0!==te?!$.fromCrossApp&&J[te].fromCrossApp&&(J[te]=$):(Q.set(ee,J.length),J.push($))}var re=J.map(function(e){return e.fromCrossApp,o(e,["fromCrossApp"])});return{properties:C,wallets:re}}},1794(e,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PROVIDER_ICON=void 0,t.detectInjectedProviderInfo=function(e){for(var r="Injected Provider",i="io.injected.provider",a=e,o=0,s=n;o<s.length;o++){var c=s[o];if(a[c.flag]){r=c.name,i=c.rdns;break}}return{name:r,rdns:i,uuid:"injected-".concat(i.replace(/[^a-zA-Z0-9]/g,"-")),icon:t.DEFAULT_PROVIDER_ICON}},t.isUserRejectionError=function(e){for(var t=e,r=0;t&&r<5;r++){var n=t.code;if(4001===n||"number"==typeof n&&n>=5e3&&n<=5005||"UserRejectedRequestError"===t.name)return!0;t=t.cause}return!1},t.readWalletConnectPeer=function(e){var t,n=e.session,i=null===(t=null==n?void 0:n.peer)||void 0===t?void 0:t.metadata;if(i&&"string"==typeof i.name&&0!==i.name.length)return r({name:i.name},"string"==typeof i.url&&i.url.length>0?{url:i.url}:{})},t.isValidProvider=function(e){return!!e&&"function"==typeof e.request&&"function"==typeof e.on&&"function"==typeof e.removeListener},t.DEFAULT_PROVIDER_ICON="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiBmaWxsPSIjRkZGIi8+CjxwYXRoIGQ9Ik0xNiA4TDggMjRoMTZMMTYgOHoiIGZpbGw9IiMzMzMiLz4KPC9zdmc+Cg==";var n=[{flag:"isMetaMask",name:"MetaMask",rdns:"io.metamask"},{flag:"isCoinbaseWallet",name:"Coinbase Wallet",rdns:"com.coinbase.wallet"},{flag:"isWalletConnect",name:"WalletConnect",rdns:"com.walletconnect"},{flag:"isTrust",name:"Trust Wallet",rdns:"com.trustwallet"},{flag:"isBraveWallet",name:"Brave Wallet",rdns:"com.brave.wallet"},{flag:"isPhantom",name:"Phantom",rdns:"app.phantom"}]},6653(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PROVIDER_ICON=t.isUserRejectionError=t.readWalletConnectPeer=t.isValidProvider=t.detectInjectedProviderInfo=void 0;var n=r(1794);Object.defineProperty(t,"detectInjectedProviderInfo",{enumerable:!0,get:function(){return n.detectInjectedProviderInfo}}),Object.defineProperty(t,"isValidProvider",{enumerable:!0,get:function(){return n.isValidProvider}}),Object.defineProperty(t,"readWalletConnectPeer",{enumerable:!0,get:function(){return n.readWalletConnectPeer}}),Object.defineProperty(t,"isUserRejectionError",{enumerable:!0,get:function(){return n.isUserRejectionError}}),Object.defineProperty(t,"DEFAULT_PROVIDER_ICON",{enumerable:!0,get:function(){return n.DEFAULT_PROVIDER_ICON}})},5796(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EventQueue=void 0;var s=r(9879),c=r(9629),u=r(3312),l=r(49),d=o(r(7688)),h=function(){},f=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];try{e.apply(void 0,t)}catch(e){}},p=65536,v=function(){function e(e,t){var r=this;this.queue=[],this.queueByteSize=0,this.payloadHashes=new Set,this.generation=0,this.closed=!1,this.disposePageLeave=null,this.onPageLeave=function(e){var t=!1,r=!1,n=null;function i(){t||(t=!0,e(r),n=setTimeout(function(){n=null,t=!1},0))}var a=function(){r=!1,i()},o=function(){r=!0,i()},s=function(){t=!1},c=function(){r="hidden"!==document.visibilityState,i()},u=function(){r="hidden"!==document.visibilityState,"hidden"===document.visibilityState?i():t=!1},l=globalThis,d=document;return l.addEventListener("beforeunload",a),l.addEventListener("blur",o),l.addEventListener("focus",s),d.addEventListener("pagehide",c),d.addEventListener("visibilitychange",u),function(){n&&(clearTimeout(n),n=null),l.removeEventListener("beforeunload",a),l.removeEventListener("blur",o),l.removeEventListener("focus",s),d.removeEventListener("pagehide",c),d.removeEventListener("visibilitychange",u)}},t=t||{},this.queue=[],this.writeKey=e,this.apiHost=t.apiHost,this.canSend=t.canSend,this.retryCount=(0,c.clampNumber)(t.retryCount||3,5,1),this.flushAt=(0,c.clampNumber)(t.flushAt||20,20,1),this.maxQueueSize=(0,c.clampNumber)(t.maxQueueSize||512e3,512e3,200),this.flushIntervalMs=(0,c.clampNumber)(t.flushInterval||3e4,3e5,1e4),this.flushed=!1,this.errorHandler=t.errorHandler,this.pendingFlush=null,this.timer=null,this.disposePageLeave=this.onPageLeave(function(e){return i(r,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return!1!==e?[3,2]:[4,this.flush(void 0,!0)];case 1:t.sent(),t.label=2;case 2:return[2]}})})})}return e.prototype.generateMessageId=function(e){return i(this,void 0,void 0,function(){var t,r,i;return a(this,function(a){return t=(0,c.toDateHourMinute)(new Date(e.original_timestamp)),r=n(n({},e),{original_timestamp:t}),i=JSON.stringify(r),[2,(0,c.hash)(i)]})})},e.prototype.clear=function(){this.generation++,this.timer&&(clearTimeout(this.timer),this.timer=null),this.queue=[],this.queueByteSize=0,this.payloadHashes.clear(),this.flushed=!1,this.pendingFlush=null},e.prototype.close=function(){this.closed=!0,this.clear(),this.disposePageLeave&&(f(this.disposePageLeave),this.disposePageLeave=null)},Object.defineProperty(e.prototype,"isClosed",{get:function(){return this.closed},enumerable:!1,configurable:!0}),e.prototype.enqueue=function(e,t){return i(this,void 0,void 0,function(){var r,i,o,s,l;return a(this,function(a){switch(a.label){case 0:return t=t||h,r=this.generation,this.closed?[2]:this.canSend&&!this.canSend()?(this.clear(),[2]):[4,this.generateMessageId(e)];case 1:return i=a.sent(),this.closed||r!==this.generation?[2]:this.canSend&&!this.canSend()?(this.clear(),[2]):this.isDuplicate(i)?(u.logger.warn("Event already enqueued, try again after ".concat((0,c.millisecondsToSecond)(this.flushIntervalMs)," seconds.")),[2]):((o={message:n(n({},e),{message_id:i}),callback:t,byteSize:0}).byteSize=JSON.stringify({message:o.message}).length,this.queue.push(o),this.queueByteSize+=o.byteSize,u.logger.log("Event enqueued: ".concat((0,c.getActionDescriptor)(e.type,e.properties))),this.flushed?(s=this.queue.length>=this.flushAt,l=this.queueByteSize>=this.maxQueueSize,s||l?(this.flush(),[2]):(this.flushIntervalMs&&!this.timer&&(this.timer=setTimeout(this.flush.bind(this),this.flushIntervalMs)),[2])):(this.flushed=!0,this.flush(),[2]))}})})},e.prototype.flush=function(e){return i(this,arguments,void 0,function(e,t){var r,i,o,s,c,u,l,d=this;return void 0===t&&(t=!1),a(this,function(a){switch(a.label){case 0:return e=e||h,this.timer&&(clearTimeout(this.timer),this.timer=null),this.canSend&&!this.canSend()?(this.clear(),f(e),[2,Promise.resolve()]):this.queue.length?this.pendingFlush?t?[3,2]:[4,this.pendingFlush]:[3,2]:(f(e),[2,Promise.resolve()]);case 1:a.sent(),a.label=2;case 2:for(r=this.queue.splice(0,t?this.queue.length:this.flushAt),i=0,o=r;i<o.length;i++)s=o[i],this.payloadHashes.delete(s.message.message_id),this.queueByteSize-=s.byteSize;return 0===this.queue.length&&(this.queueByteSize=0),c=(new Date).toISOString(),u=r.map(function(e){return n(n({},e.message),{sent_at:c})}),l=this.splitIntoBatches(r,u),[2,this.pendingFlush=this.sendBatches(l,u).then(function(t){return t?(f(e,t,u),"function"==typeof d.errorHandler&&f(d.errorHandler,t)):f(e,void 0,u),Promise.resolve(u)}).catch(function(t){f(e,t,u),"function"==typeof d.errorHandler&&f(d.errorHandler,t)})]}})})},e.byteLength=function(e){return(new TextEncoder).encode(e).byteLength},e.prototype.splitIntoBatches=function(t,r){var n=JSON.stringify(r);if(e.byteLength(n)<=p)return[{data:r,items:t,keepalive:!0}];for(var i=[],a=[],o=[],s=2,c=0;c<r.length;c++){var u=r[c],l=e.byteLength(JSON.stringify(u)),d=s+(a.length>0?1:0)+l;d>p?(a.length>0&&i.push({data:a,items:o,keepalive:!0}),l+2>p?(i.push({data:[u],items:[t[c]],keepalive:!1}),a=[],o=[],s=2):(a=[u],o=[t[c]],s=2+l)):(a.push(u),o.push(t[c]),s=d)}return a.length>0&&i.push({data:a,items:o,keepalive:!0}),i},e.prototype.sendBatches=function(e,t){return i(this,void 0,void 0,function(){var r,n,i,o,s,c,u,h,p=this;return a(this,function(a){switch(a.label){case 0:n=0,i=e,a.label=1;case 1:if(!(n<i.length))return[3,6];if(o=i[n],this.canSend&&!this.canSend())return[3,6];a.label=2;case 2:return a.trys.push([2,4,,5]),s=JSON.stringify(o.data),[4,(0,d.default)("".concat(this.apiHost),{headers:(0,l.EVENTS_API_REQUEST_HEADER)(this.writeKey),method:"POST",body:s,keepalive:o.keepalive,retries:this.retryCount,retryDelay:function(e){return 1e3*Math.pow(2,e)},retryOn:function(e,t,r){return p.isErrorRetryable(t,r)}})];case 3:if(!(c=a.sent()).ok)throw(u=new Error(c.statusText||"HTTP ".concat(c.status))).response=c,u;return o.items.forEach(function(e){var r=e.message,n=e.callback;return f(n,void 0,r,t)}),[3,5];case 4:return h=a.sent(),r=r||h,o.items.forEach(function(e){var r=e.message,n=e.callback;return f(n,h,r,t)}),[3,5];case 5:return n++,[3,1];case 6:return[2,r]}})})},e.prototype.isErrorRetryable=function(e,t){var r,n;if(e&&(0,s.isNetworkError)(e))return!0;var i=null!==(r=null==t?void 0:t.status)&&void 0!==r?r:null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.status;return!!i&&(i>=500&&i<=599||429===i)},e.prototype.isDuplicate=function(e){return!!this.payloadHashes.has(e)||(this.payloadHashes.add(e),!1)},e}();t.EventQueue=v},4203(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5796),t),i(r(4407),t)},4407(e,t){Object.defineProperty(t,"__esModule",{value:!0})},5896(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.FormoAnalyticsSession=t.SESSION_WALLET_IDENTIFIED_KEY=t.SESSION_WALLET_DETECTED_KEY=void 0;var i=r(6517),a=r(2257),o=r(3312);function s(e,t){if(void 0===t&&(t=new Set),void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e){if(null===e)return"null";if("bigint"==typeof e)return"bigint:".concat(e.toString());if("number"==typeof e)return Number.isFinite(e)?JSON.stringify(e):"null";if("object"!=typeof e)return JSON.stringify(e);if(t.has(e))return'"[circular]"';t.add(e);try{var r=e.toJSON;if("function"==typeof r)return s(r.call(e),t);if(Array.isArray(e))return"[".concat(e.map(function(e){var r;return null!==(r=s(e,t))&&void 0!==r?r:"null"}).join(","),"]");for(var n=e,i=[],a=0,o=Object.keys(n).sort();a<o.length;a++){var c=o[a],u=s(n[c],t);void 0!==u&&i.push("".concat(JSON.stringify(c),":").concat(u))}return"{".concat(i.join(","),"}")}finally{t.delete(e)}}}function c(e){var t;if(e){var r;try{var n=s(e);if(void 0===n||"{}"===n)return;r=n}catch(e){return null===(t=o.logger.warn)||void 0===t||t.call(o.logger,"Session: failed to fingerprint identify properties",e),"nohash"}for(var i=2166136261,a=16777619,c=0;c<r.length;c++){var u=r.charCodeAt(c);i^=u,i=Math.imul(i,16777619),a^=u+c,a=Math.imul(a,2246822507)}return"".concat((i>>>0).toString(36)).concat((a>>>0).toString(36))}}function u(e){return encodeURIComponent(e).length}t.SESSION_WALLET_DETECTED_KEY="wallet-detected",t.SESSION_WALLET_IDENTIFIED_KEY="wallet-identified";var l=function(){function e(){}return e.prototype.generateIdentificationKey=function(e,t,r,n){return this.buildIdentificationKey(e,t,r,n).key},e.prototype.buildIdentificationKey=function(e,t,r,n){var i=c(n),a=[encodeURIComponent(e)];if(r||i){a.push(encodeURIComponent(t||"")),a.push(encodeURIComponent(r||""));var o=a.join(":");return i&&a.push(i),{key:a.join(":"),identityPrefix:o}}return t&&a.push(encodeURIComponent(t)),{key:a.join(":")}},e.prototype.isWalletDetected=function(e){var r;return((null===(r=(0,i.cookie)().get(t.SESSION_WALLET_DETECTED_KEY))||void 0===r?void 0:r.split(","))||[]).includes(e)},e.prototype.markWalletDetected=function(e){var r,o=(null===(r=(0,i.cookie)().get(t.SESSION_WALLET_DETECTED_KEY))||void 0===r?void 0:r.split(","))||[];o.includes(e)||(o.push(e),o.length>20&&o.splice(0,o.length-20),(0,i.cookie)().set(t.SESSION_WALLET_DETECTED_KEY,o.join(","),n({expires:new Date(Date.now()+864e5).toUTCString(),path:"/"},(0,a.getIdentityCookieSecurity)())))},e.prototype.isWalletIdentified=function(e,r,n,a){var s=this.generateIdentificationKey(e,r,n,a),c=(0,i.cookie)().get(t.SESSION_WALLET_IDENTIFIED_KEY),u=((null==c?void 0:c.split(","))||[]).includes(s);return o.logger.debug("Session: Checking wallet identification",{identifiedKey:s,isIdentified:u,hasRdns:!!r}),u},e.prototype.markWalletIdentified=function(e,r,s,c){var l,d=this.buildIdentificationKey(e,r,s,c),h=d.key,f=d.identityPrefix,p=(null===(l=(0,i.cookie)().get(t.SESSION_WALLET_IDENTIFIED_KEY))||void 0===l?void 0:l.split(","))||[];if(p.includes(h))o.logger.info("Session: Wallet already marked as identified",{identifiedKey:h,existingWallets:p,hasRdns:!!r});else{f&&(p=p.filter(function(e){return e!==f&&!e.startsWith("".concat(f,":"))})),p.push(h);for(var v=p.join(",");p.length>1&&u(v)>3584;)p.shift(),v=p.join(",");(0,i.cookie)().set(t.SESSION_WALLET_IDENTIFIED_KEY,v,n({expires:new Date(Date.now()+864e5).toUTCString(),path:"/"},(0,a.getIdentityCookieSecurity)())),o.logger.debug("Session: Marked wallet as identified",{identifiedKey:h,hasRdns:!!r})}},e}();t.FormoAnalyticsSession=l},1951(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaManager=void 0;var n=r(3312),i=r(8898),a=r(3293),o=r(9485),s=function(){function e(e,t,r){void 0===r&&(r=!0);var i=this;this.formo=e,this.enabled=r,this.storeOwnsWalletEvents=!1,r&&((null==t?void 0:t.cluster)&&(this.pendingCluster=t.cluster),this.storeOwnsWalletEvents=!!(null==t?void 0:t.store),this.registry=new a.SolanaWalletStandardRegistry({isAutocaptureEnabled:function(e){return i.formo.isAutocaptureEnabled(e)},willTrackEvent:function(e){return i.formo.willTrackEvent(e)},detect:function(e){return i.formo.detect(e)},connect:function(e,t){return i.formo.connect(e,t)},disconnect:function(e){return i.formo.disconnect(e)},chain:function(e){return i.formo.chain(e)},syncWalletState:function(e){return i.formo.syncWalletState(e)},currentAddress:function(){return i.formo.currentAddress},ownsWalletEvents:function(){return!i.storeOwnsWalletEvents}},{cluster:null==t?void 0:t.cluster}),(null==t?void 0:t.store)&&(n.logger.info("SolanaManager: Initializing store-based Solana tracking"),this.attachStore(t.store,t.cluster)))}return e.prototype.attachStore=function(e,t){var r,a=this;this.storeHandler=new i.SolanaStoreHandler(this.formo,e,{cluster:t,beforeWalletConnect:function(e){var t,r;if(a.formo.syncWalletState({address:e.address,chainId:e.chainId}),a.storeOwnsWalletEvents)return!0;var i=null===(t=a.registry)||void 0===t?void 0:t.takeReportedConnection(e.address,e.rdns);if(a.storeOwnsWalletEvents=!0,!i){var o=null===(r=a.registry)||void 0===r?void 0:r.reportedConnectionRdns(e.address);return o&&n.logger.warn("SolanaManager: Store connector does not match the discovered wallet; the connection is reported twice",{storeRdns:e.rdns,walletRdns:o}),!0}return i.chainId!==e.chainId&&a.formo.isAutocaptureEnabled("chain")&&a.formo.chain(e).catch(function(e){n.logger.error("SolanaManager: Error correcting cluster during store handoff",e)}),!1}});var s=o.SOLANA_CLUSTERS_BY_ID[this.storeHandler.getChainId()];s&&(null===(r=this.registry)||void 0===r||r.setCluster(s))},e.prototype.setStore=function(e,t){var r;this.enabled?(null===(r=this.storeHandler)||void 0===r||r.cleanup(),this.storeHandler=void 0,this.storeOwnsWalletEvents=!1,this.attachStore(e,(null==t?void 0:t.cluster)||this.pendingCluster),this.pendingCluster=void 0):n.logger.warn("SolanaManager: Ignoring setStore. Solana tracking is off for this instance (solana: false, or the SDK was cleaned up)")},e.prototype.setCluster=function(e){var t;this.enabled&&(this.storeHandler?this.storeHandler.setCluster(e):this.pendingCluster=e,null===(t=this.registry)||void 0===t||t.setCluster(e))},Object.defineProperty(e.prototype,"discoveredWallets",{get:function(){var e,t;return null!==(t=null===(e=this.registry)||void 0===e?void 0:e.walletNames)&&void 0!==t?t:[]},enumerable:!1,configurable:!0}),e.prototype.cleanup=function(){var e,t;null===(e=this.storeHandler)||void 0===e||e.cleanup(),this.storeHandler=void 0,this.storeOwnsWalletEvents=!1,null===(t=this.registry)||void 0===t||t.cleanup(),this.registry=void 0},e}();t.SolanaManager=s},8898(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaStoreHandler=void 0;var i=r(4164),a=r(3312),o=r(9485),s=r(3236);function c(e,t,r){if(void 0===t&&(t=1e3),void 0===r&&(r=500),e.size>t)for(var n=Array.from(e),i=0;i<r&&i<n.length;i++)e.delete(n[i])}var u=function(){function e(e,t,r){this.unsubscribers=[],this.lastWalletStatus="disconnected",this.processedTransactions=new Set,this.startedTransactions=new Set,this.transactionSenders=new Map,this.formo=e,this.store=t,this.explicitCluster=!!(null==r?void 0:r.cluster),this.beforeWalletConnect=null==r?void 0:r.beforeWalletConnect,this.cluster=(null==r?void 0:r.cluster)||this.detectClusterFromStore(t)||"mainnet-beta",this.chainId=o.SOLANA_CHAIN_IDS[this.cluster],a.logger.info("SolanaStoreHandler: Initializing framework-kit store integration",{cluster:this.cluster,chainId:this.chainId}),this.setupWalletSubscription(),this.setupTransactionSubscription(),this.setupClusterSubscription(),this.checkInitialWalletState()}return e.prototype.setCluster=function(e){this.explicitCluster=!0;var t=this.cluster;this.cluster=e,this.chainId=o.SOLANA_CHAIN_IDS[e],t!==e&&this.lastAddress&&(this.lastChainId=this.chainId,this.formo.isAutocaptureEnabled("chain")&&this.formo.chain({chainId:this.chainId,address:this.lastAddress}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting chain event",e)}))},e.prototype.getChainId=function(){return this.chainId},e.prototype.resolveCurrentChainId=function(){if(!this.explicitCluster){var e=this.detectClusterFromStore(this.store);e&&(this.cluster=e,this.chainId=o.SOLANA_CHAIN_IDS[e])}return this.chainId},e.prototype.setupWalletSubscription=function(){var e=this,t=this.store.getState().wallet,r=this.store.subscribe(function(r){var n=r.wallet;if(n!==t){var i=t;t=n,e.handleWalletChange(n,i)}});this.unsubscribers.push(r),a.logger.info("SolanaStoreHandler: Wallet subscription set up")},e.prototype.checkInitialWalletState=function(){var e,t,r,n=this.store.getState().wallet;if("connected"===n.status){var i=n.session.account.address;if(i&&!(0,s.isBlockedSolanaAddress)(i)){this.lastWalletStatus="connected",this.lastAddress=i,this.lastChainId=this.chainId,a.logger.info("SolanaStoreHandler: Already connected on initialization",{address:i,chainId:this.chainId});var c=(null===(e=n.session.connector)||void 0===e?void 0:e.name)||n.connectorId,u=(0,o.solanaWalletRdns)(c);(null===(r=null===(t=this.beforeWalletConnect)||void 0===t?void 0:t.call(this,{address:i,chainId:this.chainId,rdns:u}))||void 0===r||r)&&this.formo.isAutocaptureEnabled("connect")&&this.formo.connect({chainId:this.chainId,address:i},{providerName:c,rdns:u}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting initial connect",e)})}}this.lastWalletStatus=n.status},e.prototype.handleWalletChange=function(e,t){if("connected"===t.status&&"connected"!==e.status&&this.handleDisconnect(),"connected"===e.status&&"connected"!==t.status)this.handleConnect(e);else if("connected"===e.status&&"connected"===t.status){var r=e.session.account.address!==t.session.account.address,n=e.connectorId!==t.connectorId;(r||n)&&(this.handleDisconnect(),this.handleConnect(e))}this.lastWalletStatus=e.status},e.prototype.handleConnect=function(e){var t,r,n,i=e.session.account.address;if(i&&!(0,s.isBlockedSolanaAddress)(i)){var c=this.resolveCurrentChainId();this.lastAddress=i,this.lastChainId=c,a.logger.info("SolanaStoreHandler: Wallet connected",{address:i,chainId:c,connector:e.connectorId});var u=(null===(t=e.session.connector)||void 0===t?void 0:t.name)||e.connectorId,l=(0,o.solanaWalletRdns)(u);(null===(n=null===(r=this.beforeWalletConnect)||void 0===r?void 0:r.call(this,{address:i,chainId:c,rdns:l}))||void 0===n||n)&&this.formo.isAutocaptureEnabled("connect")&&this.formo.connect({chainId:c,address:i},{providerName:u,rdns:l}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting connect",e)})}},e.prototype.handleDisconnect=function(){this.lastAddress&&(a.logger.info("SolanaStoreHandler: Wallet disconnected",{address:this.lastAddress,chainId:this.lastChainId}),this.formo.isAutocaptureEnabled("disconnect")&&this.formo.disconnect({chainId:this.lastChainId,address:this.lastAddress}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting disconnect",e)}),this.lastAddress=void 0,this.lastChainId=void 0)},e.prototype.setupClusterSubscription=function(){var e=this,t=this.store.getState().cluster.endpoint,r=this.store.subscribe(function(r){var n=r.cluster.endpoint;n!==t&&(t=n,e.handleClusterChange(n))});this.unsubscribers.push(r),a.logger.info("SolanaStoreHandler: Cluster subscription set up")},e.prototype.handleClusterChange=function(e){if(!this.explicitCluster){var t=this.detectClusterFromEndpoint(e);if(t){var r=this.cluster;t!==r&&(this.cluster=t,this.chainId=o.SOLANA_CHAIN_IDS[t],a.logger.info("SolanaStoreHandler: Cluster changed",{from:r,to:t,chainId:this.chainId}),this.lastAddress&&(this.lastChainId=this.chainId,this.formo.isAutocaptureEnabled("chain")&&this.formo.chain({chainId:this.chainId,address:this.lastAddress}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting chain event",e)})))}}},e.prototype.setupTransactionSubscription=function(){var e=this,t=this.store.getState().transactions,r=this.store.subscribe(function(r){var n=r.transactions;if(n!==t){var i=t;t=n,e.handleTransactionChanges(n,i)}});this.unsubscribers.push(r),a.logger.info("SolanaStoreHandler: Transaction subscription set up")},e.prototype.handleTransactionChanges=function(e,t){for(var r,n=0,i=Object.entries(e);n<i.length;n++){var a=i[n],o=a[0],s=a[1],c=t[o];if(!c||c.status!==s.status){var u=this.lastAddress||(null===(r=this.transactionSenders.get(o))||void 0===r?void 0:r.address);u&&this.handleTransactionStatusChange(o,s,c,u)}}},e.prototype.handleTransactionStatusChange=function(e,t,r,o){var s=this.chainId,u="".concat(e,":").concat(t.status);if(!this.processedTransactions.has(u)&&(this.processedTransactions.add(u),c(this.processedTransactions),this.formo.isAutocaptureEnabled("transaction")))switch(t.status){case"sending":this.startedTransactions.has(e)||(this.startedTransactions.add(e),c(this.startedTransactions),this.transactionSenders.set(e,{address:o,chainId:s}),this.formo.transaction({status:i.TransactionStatus.STARTED,chainId:s,address:o}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting transaction STARTED",e)}));break;case"waiting":if(f=t.signature){this.transactionSenders.has(e)||this.transactionSenders.set(e,{address:o,chainId:s});var l=this.transactionSenders.get(e);this.formo.transaction({status:i.TransactionStatus.BROADCASTED,chainId:l.chainId,address:l.address,transactionHash:f}).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting transaction BROADCASTED",e)})}break;case"confirmed":var d=(null==(l=this.transactionSenders.get(e))?void 0:l.address)||o,h=(null==l?void 0:l.chainId)||s,f=t.signature;a.logger.info("SolanaStoreHandler: Transaction confirmed",{key:e,signature:f}),this.formo.transaction(n({status:i.TransactionStatus.CONFIRMED,chainId:h,address:d},f&&{transactionHash:f})).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting transaction CONFIRMED",e)}),this.transactionSenders.delete(e);break;case"failed":d=(null==(l=this.transactionSenders.get(e))?void 0:l.address)||o,h=(null==l?void 0:l.chainId)||s,f=t.signature;var p=null==r?void 0:r.status,v="waiting"===p?i.TransactionStatus.REVERTED:i.TransactionStatus.REJECTED;a.logger.info("SolanaStoreHandler: Transaction failed",{key:e,signature:f,status:v,prevStatus:p}),this.formo.transaction(n({status:v,chainId:h,address:d},f&&{transactionHash:f})).catch(function(e){a.logger.error("SolanaStoreHandler: Error emitting transaction event",e)}),this.transactionSenders.delete(e)}},e.prototype.detectClusterFromStore=function(e){try{var t=e.getState().cluster.endpoint;return this.detectClusterFromEndpoint(t)}catch(e){return null}},e.prototype.detectClusterFromEndpoint=function(e){if(!e)return null;var t=e.toLowerCase();return t.includes("devnet")?"devnet":t.includes("testnet")?"testnet":t.includes("localhost")||t.includes("127.0.0.1")?"localnet":t.includes("mainnet")?"mainnet-beta":null},e.prototype.cleanup=function(){a.logger.debug("SolanaStoreHandler: Cleaning up");for(var e=0,t=this.unsubscribers;e<t.length;e++){var r=t[e];try{r()}catch(e){a.logger.error("SolanaStoreHandler: Error during cleanup",e)}}this.unsubscribers=[],this.processedTransactions.clear(),this.startedTransactions.clear(),this.transactionSenders.clear(),this.lastAddress=void 0,this.lastChainId=void 0,a.logger.debug("SolanaStoreHandler: Cleanup complete")},e}();t.SolanaStoreHandler=u},3293(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaWalletStandardRegistry=void 0;var n=r(3312),i=r(3236),a=r(9485),o=r(8657),s={"solana:mainnet":"mainnet-beta","solana:devnet":"devnet","solana:testnet":"testnet","solana:localnet":"localnet"};function c(e){return"string"==typeof e&&e.startsWith("solana:")}function u(e){if(e&&"object"==typeof e){var t=e;if("string"==typeof t.name&&t.name&&Array.isArray(t.chains)&&t.chains.some(c)&&t.features&&"object"==typeof t.features&&Array.isArray(t.accounts))return t}}var l=function(){function e(e,t){var r=this;this.deps=e,this.wallets=new Map,this.isCleanedUp=!1,this.cluster=null==t?void 0:t.cluster,this.api=Object.freeze({register:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.register.apply(r,e)}}),this.listen()}return e.prototype.listen=function(){var e=this;if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var t=function(t){var r=t.detail;if("function"==typeof r)try{r(e.api)}catch(e){n.logger.warn("SolanaWalletStandardRegistry: A wallet threw while registering",e)}};try{window.addEventListener(o.WALLET_STANDARD_REGISTER_WALLET_EVENT,t),this.removeWindowListener=function(){return window.removeEventListener(o.WALLET_STANDARD_REGISTER_WALLET_EVENT,t)}}catch(e){n.logger.warn("SolanaWalletStandardRegistry: Could not listen for wallet registrations",e)}if("function"==typeof CustomEvent)try{window.dispatchEvent(new CustomEvent(o.WALLET_STANDARD_APP_READY_EVENT,{detail:this.api}))}catch(e){n.logger.warn("SolanaWalletStandardRegistry: Could not announce app-ready",e)}}},e.prototype.register=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=[];if(this.isCleanedUp)return function(){};for(var i=0,o=t;i<o.length;i++){var s=u(o[i]);if(s&&!this.wallets.has(s)){var c={wallet:s,name:s.name,rdns:(0,a.solanaWalletRdns)(s.name),connectWasReported:!1};this.wallets.set(s,c),n.push(c),this.track(c)}}return function(){for(var t=0,r=n;t<r.length;t++){var i=r[t];e.untrack(i)}}},e.prototype.track=function(e){var t=this;n.logger.info("SolanaWalletStandardRegistry: Discovered wallet",{name:e.name,chains:e.wallet.chains}),this.deps.detect({providerName:e.name,rdns:e.rdns}).catch(function(e){n.logger.error("SolanaWalletStandardRegistry: Error emitting detect",e)});var r=e.wallet.features[o.WALLET_STANDARD_EVENTS_FEATURE];if(r&&"function"==typeof r.on)try{e.unsubscribe=r.on("change",function(r){return t.onChange(e,r)})}catch(t){n.logger.warn("SolanaWalletStandardRegistry: Could not subscribe to ".concat(e.name," events"),t)}else n.logger.info("SolanaWalletStandardRegistry: ".concat(e.name," has no standard:events feature; connections cannot be observed"));this.reconcile(e,e.wallet.accounts)},e.prototype.untrack=function(e){var t;try{null===(t=e.unsubscribe)||void 0===t||t.call(e)}catch(t){n.logger.warn("SolanaWalletStandardRegistry: Could not unsubscribe from ".concat(e.name),t)}e.unsubscribe=void 0,this.wallets.delete(e.wallet)},e.prototype.onChange=function(e,t){if(!this.isCleanedUp){var r=Array.isArray(null==t?void 0:t.accounts)?t.accounts:e.wallet.accounts;this.reconcile(e,Array.isArray(r)?r:[])}},e.prototype.reconcile=function(e,t){var r=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];if(n&&"object"==typeof n){var a=n;if((!Array.isArray(a.chains)||a.chains.some(c))&&(0,i.isSolanaAddress)(a.address)&&!(0,i.isBlockedSolanaAddress)(a.address))return a}}}(t),n=e.connected;if((n||r)&&(!n||!r||n.address!==r.address)){if(!this.deps.ownsWalletEvents())return e.connected=r?{address:r.address,chainId:this.chainIdFor(e)}:void 0,void(e.connectWasReported=!1);n&&this.reportDisconnect(e,n),r&&this.reportConnect(e,r.address)}},e.prototype.reportConnect=function(e,t){var r=this.chainIdFor(e);e.connected={address:t,chainId:r},e.connectWasReported=!1,n.logger.info("SolanaWalletStandardRegistry: Wallet connected",{name:e.name,address:t,chainId:r}),this.deps.isAutocaptureEnabled("connect")&&this.deps.willTrackEvent(r)&&(e.connectWasReported=!0,this.deps.connect({chainId:r,address:t},{providerName:e.name,rdns:e.rdns}).catch(function(e){n.logger.error("SolanaWalletStandardRegistry: Error emitting connect",e)}))},e.prototype.reportDisconnect=function(e,t){e.connected=void 0,e.connectWasReported=!1,n.logger.info("SolanaWalletStandardRegistry: Wallet disconnected",{name:e.name,address:t.address,chainId:t.chainId}),this.deps.isAutocaptureEnabled("disconnect")&&this.deps.disconnect(t).catch(function(e){n.logger.error("SolanaWalletStandardRegistry: Error emitting disconnect",e)})},e.prototype.chainIdFor=function(e){if(this.cluster)return a.SOLANA_CHAIN_IDS[this.cluster];var t=e.wallet.chains;if(t.includes("solana:mainnet"))return a.DEFAULT_SOLANA_CHAIN_ID;for(var r=0,n=t;r<n.length;r++){var i=n[r],o=s[i];if(o)return a.SOLANA_CHAIN_IDS[o]}return a.DEFAULT_SOLANA_CHAIN_ID},e.prototype.setCluster=function(e){var t;if(this.cluster!==e){this.cluster=e;for(var r=a.SOLANA_CHAIN_IDS[e],i=Array.from(this.wallets.values()),o=this.deps.currentAddress(),s=null!==(t=i.find(function(e){return e.connected&&e.connected.address===o}))&&void 0!==t?t:i.find(function(e){return e.connected}),c=0,u=i;c<u.length;c++){var l=u[c],d=l.connected;d&&d.chainId!==r&&(l.connected={address:d.address,chainId:r},this.deps.ownsWalletEvents()&&(l===s&&this.deps.syncWalletState({chainId:r,address:d.address}),this.deps.isAutocaptureEnabled("chain")&&this.deps.chain({chainId:r,address:d.address}).catch(function(e){n.logger.error("SolanaWalletStandardRegistry: Error emitting chain event",e)})))}}},Object.defineProperty(e.prototype,"walletNames",{get:function(){return Array.from(this.wallets.values()).map(function(e){return e.name})},enumerable:!1,configurable:!0}),e.prototype.reportedConnectionRdns=function(e){for(var t,r=0,n=Array.from(this.wallets.values());r<n.length;r++){var i=n[r];if(i.connectWasReported&&(null===(t=i.connected)||void 0===t?void 0:t.address)===e)return i.rdns}},e.prototype.takeReportedConnection=function(e,t){for(var r,n=0,i=Array.from(this.wallets.values());n<i.length;n++){var a=i[n];if(a.connectWasReported&&(null===(r=a.connected)||void 0===r?void 0:r.address)===e&&a.rdns===t)return a.connectWasReported=!1,a.connected}},e.prototype.cleanup=function(){var e;this.isCleanedUp=!0;try{null===(e=this.removeWindowListener)||void 0===e||e.call(this)}catch(e){n.logger.warn("SolanaWalletStandardRegistry: Could not remove window listener",e)}this.removeWindowListener=void 0;for(var t=0,r=Array.from(this.wallets.values());t<r.length;t++){var i=r[t];this.untrack(i)}this.wallets.clear(),n.logger.debug("SolanaWalletStandardRegistry: Cleanup complete")},e}();t.SolanaWalletStandardRegistry=l},3236(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SOLANA_SYSTEM_ADDRESSES=void 0,t.isSolanaAddress=n,t.getValidSolanaAddress=i,t.isSolanaSystemAddress=a,t.isBlockedSolanaAddress=function(e){var t=i(e);return!!t&&!!a(t)},t.publicKeyToAddress=function(e){if(!e)return null;try{var t=e.toBase58();return n(t)?t:null}catch(e){return null}},t.areSolanaAddressesEqual=function(e,t){var r=i(e),n=i(t);return!(!r||!n)&&r===n};var r=new Set("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function n(e){if("string"!=typeof e)return!1;var t=e.trim();return!(t.length<32||t.length>44)&&function(e){for(var t=0;t<e.length;t++)if(!r.has(e[t]))return!1;return!0}(t)}function i(e){if(!e)return null;if("object"==typeof e&&"toBase58"in e)try{var t=e.toBase58();return n(t)?t:null}catch(e){return null}if("string"==typeof e){var r=e.trim();return n(r)?r:null}return null}function a(e){var r=i(e);return!!r&&Object.values(t.SOLANA_SYSTEM_ADDRESSES).includes(r)}t.SOLANA_SYSTEM_ADDRESSES={SYSTEM_PROGRAM:"11111111111111111111111111111111",TOKEN_PROGRAM:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",TOKEN_2022_PROGRAM:"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",ASSOCIATED_TOKEN_PROGRAM:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",RENT_SYSVAR:"SysvarRent111111111111111111111111111111111",CLOCK_SYSVAR:"SysvarC1ock11111111111111111111111111111111"}},9308(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaManager=t.SolanaWalletStandardRegistry=t.SolanaStoreHandler=void 0;var a=r(8898);Object.defineProperty(t,"SolanaStoreHandler",{enumerable:!0,get:function(){return a.SolanaStoreHandler}});var o=r(3293);Object.defineProperty(t,"SolanaWalletStandardRegistry",{enumerable:!0,get:function(){return o.SolanaWalletStandardRegistry}});var s=r(1951);Object.defineProperty(t,"SolanaManager",{enumerable:!0,get:function(){return s.SolanaManager}}),i(r(9485),t),i(r(6720),t),i(r(8657),t),i(r(3236),t)},6720(e,t){Object.defineProperty(t,"__esModule",{value:!0})},9485(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SOLANA_CHAIN_ID=t.SOLANA_CLUSTERS_BY_ID=t.SOLANA_CHAIN_IDS=void 0,t.isSolanaChainId=function(e){return null!=e&&Object.values(t.SOLANA_CHAIN_IDS).includes(e)},t.solanaWalletRdns=function(e){return"sol.wallet.".concat(encodeURIComponent(e.toLowerCase().replace(/\s+/g,"")))},t.SOLANA_CHAIN_IDS={"mainnet-beta":900001,testnet:900002,devnet:900003,localnet:900004},t.SOLANA_CLUSTERS_BY_ID={900001:"mainnet-beta",900002:"testnet",900003:"devnet",900004:"localnet"},t.DEFAULT_SOLANA_CHAIN_ID=t.SOLANA_CHAIN_IDS["mainnet-beta"]},8657(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.WALLET_STANDARD_EVENTS_FEATURE=t.WALLET_STANDARD_REGISTER_WALLET_EVENT=t.WALLET_STANDARD_APP_READY_EVENT=void 0,t.WALLET_STANDARD_APP_READY_EVENT="wallet-standard:app-ready",t.WALLET_STANDARD_REGISTER_WALLET_EVENT="wallet-standard:register-wallet",t.WALLET_STANDARD_EVENTS_FEATURE="standard:events"},2073(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageManager=void 0;var i=r(3312),a=n(r(8410)),o=n(r(7363)),s=n(r(7772)),c=["cookieStorage","localStorage","sessionStorage","memoryStorage"],u=function(){function e(e){this.writeKey=e,this.storages=new Map,this.resolvedTypes=new Map}return e.prototype.getStorage=function(e){if(!this.storages.has(e)){for(var t=this.createStorage(e),r=e;!t.isAvailable();){var n=c.indexOf(r);if(-1===n||n+1>=c.length){t=this.createStorage("memoryStorage");break}var a=r;r=c[n+1],i.logger.warn("Storage ".concat(a," is not available, trying ").concat(r)),t=this.createStorage(r)}this.storages.set(e,t),this.resolvedTypes.set(e,r)}return this.storages.get(e)},e.prototype.getResolvedType=function(e){return this.getStorage(e),this.resolvedTypes.get(e)},e.prototype.createStorage=function(e){switch(e){case"cookieStorage":return new a.default(this.writeKey);case"localStorage":case"sessionStorage":return new s.default(this.writeKey,this.getWebStorage(e));default:return new o.default(this.writeKey)}},e.prototype.getWebStorage=function(e){try{var t="localStorage"===e?localStorage:sessionStorage;return null!=t?t:null}catch(e){return null}},e}();t.StorageManager=u},701(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(9693),i=r(625),a=function(){function e(e){this.writeKey=e}return e.prototype.getKey=function(e){return"".concat(n.KEY_PREFIX,"_").concat((0,i.secureHash)(this.writeKey),"_").concat(e)},e}();t.default=a},8410(e,t,r){var n,i=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 r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},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)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=a(r(701)),s=r(9037),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.isAvailable=function(){return"undefined"!=typeof document&&"string"==typeof document.cookie},t.prototype.set=function(e,t,r){var n=null==r?void 0:r.expires,i=null==r?void 0:r.maxAge,a=(null==r?void 0:r.path)||"/",o=(null==r?void 0:r.domain)||"",c=null==r?void 0:r.sameSite,u=(null==r?void 0:r.secure)||!1,l=encodeURIComponent(this.getKey(e));if(o)document.cookie="".concat(l,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=").concat(a,";");else{var d=(0,s.getApexDomain)();d&&(document.cookie="".concat(l,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=").concat(a,"; domain=.").concat(d))}var h="".concat(l,"=").concat(encodeURIComponent(t));i?h+="; max-age="+i:n&&(h+="; expires="+n),a&&(h+="; path="+a),o&&(h+="; domain="+o),c&&(h+="; samesite="+c),u&&(h+="; secure"),document.cookie=h},t.prototype.get=function(e){var t=document.cookie.match(new RegExp("(?:^|; )".concat(encodeURIComponent(this.getKey(e)),"=([^;]*)")));return t?decodeURIComponent(t[1]):null},t.prototype.remove=function(e){var t=encodeURIComponent(this.getKey(e));document.cookie="".concat(t,"=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT");var r=(0,s.getApexDomain)();r&&(document.cookie="".concat(t,"=; path=/; domain=.").concat(r,"; expires=Thu, 01 Jan 1970 00:00:00 GMT"))},t}(o.default);t.default=c},7363(e,t,r){var n,i=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 r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},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)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.memoryStorage={},t}return i(t,e),t.prototype.isAvailable=function(){return!0},t.prototype.set=function(e,t){this.memoryStorage[this.getKey(e)]=t},t.prototype.get=function(e){return this.memoryStorage[this.getKey(e)]||null},t.prototype.remove=function(e){delete this.memoryStorage[this.getKey(e)]},t}(a(r(701)).default);t.default=o},7772(e,t,r){var n,i=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 r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},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)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(3312),s=r(9693),c=function(e){function t(t,r){var n=e.call(this,t)||this;return n.backend=r,n}return i(t,e),t.prototype.isAvailable=function(){try{var e="__storage_test__";return this.backend.setItem(e,"1"),this.backend.removeItem(e),!0}catch(e){return!1}},t.prototype.set=function(e,t){"boolean"==typeof t&&(t=!0===t?"true":"false"),"object"==typeof t&&(t=s.JSON_PREFIX+JSON.stringify(t)),this.backend.setItem(this.getKey(e),t)},t.prototype.get=function(e){var t=this.backend.getItem(this.getKey(e));if(!t||"string"!=typeof t)return null;if(["null","undefined"].some(function(e){return e==t}))return null;if(t.startsWith(s.JSON_PREFIX))try{return JSON.parse(t.slice(s.JSON_PREFIX.length))}catch(e){return o.logger.error("[FORMO_ERROR] ".concat(this.backend.constructor.name," failed to parse JSON"),e),null}return["true","false"].some(function(e){return e==t})?JSON.parse(t):t},t.prototype.remove=function(e){this.backend.removeItem(this.getKey(e))},t}(a(r(701)).default);t.default=c},9693(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_PREFIX=t.JSON_PREFIX=void 0,t.JSON_PREFIX="__json=",t.KEY_PREFIX="formo"},2257(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getIdentityCookieDomain=function(e){if(void 0===e&&(e=!0),!e)return"";var t=(0,n.getApexDomain)();return t?".".concat(t):""},t.getIdentityCookieSecurity=function(){var e;return{sameSite:"lax",secure:"undefined"!=typeof window&&"https:"===(null===(e=window.location)||void 0===e?void 0:e.protocol)}};var n=r(9037)},6517(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.usesCookieStorage=t.memory=t.session=t.local=t.cookie=void 0,t.initStorageManager=function(e){o||(o=new a.StorageManager(e))};var a=r(2073);i(r(2305),t);var o=null;function s(e){if(!o)throw new Error("StorageManager not initialized. Call initStorageManager(writeKey) first.");return o.getStorage(e)}t.cookie=function(){return s("cookieStorage")},t.local=function(){return s("localStorage")},t.session=function(){return s("sessionStorage")},t.memory=function(){return s("memoryStorage")},t.usesCookieStorage=function(){return!!o&&"cookieStorage"===o.getResolvedType("cookieStorage")}},2305(e,t){Object.defineProperty(t,"__esModule",{value:!0})},8834(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.TrackingPolicy=void 0;var n=r(4586),i=r(9879),a=function(){function e(e){this.deps=e}return e.prototype.trackingOptions=function(){var e=this.deps.options().tracking;return null===e||"object"!=typeof e||Array.isArray(e)?null:e},e.prototype.isTrackingSuppressed=function(){return this.deps.hasOptedOut()||this.isEnvironmentExcluded()},e.prototype.isEnvironmentExcluded=function(){return this.isTimezoneExcluded()||this.isHostExcluded()||this.isPathExcluded()},e.prototype.isHostExcluded=function(){var e=this.trackingOptions();if(!e)return!1;if("undefined"==typeof window)return!1;var t=e.excludeHosts;return(void 0===t?[]:t).includes(window.location.hostname)},e.prototype.isPathExcluded=function(){var e=this.trackingOptions();if(!e)return!1;if("undefined"==typeof window)return!1;var t=e.excludePaths;return(void 0===t?[]:t).includes(window.location.pathname)},e.prototype.isTimezoneExcluded=function(){var e=this.trackingOptions();if(!e)return!1;var t=e.excludeTimezones,r=void 0===t?[]:t;if(0===r.length)return!1;var i=(0,n.getTimezone)();if(!i)return!1;var a=i.toLowerCase();return r.some(function(e){return"string"==typeof e&&e.toLowerCase()===a})},e.prototype.isPageExcluded=function(){return this.isHostExcluded()||this.isPathExcluded()},e.prototype.isPersistedIdentityPurgeRequired=function(){return this.deps.hasOptedOut()||this.isTimezoneExcluded()},e.prototype.isChainExcluded=function(e){var t=this.trackingOptions();if(!t)return!1;var r=t.excludeChains,n=void 0===r?[]:r;return 0!==n.length&&this.isChainRefused(n,e)},e.prototype.isChainRefused=function(e,t){var r,n=null!==(r=null==t?void 0:t.chainId)&&void 0!==r?r:this.deps.currentChainId();return 0===n||void 0!==n&&e.includes(n)},e.prototype.shouldTrack=function(e){if(this.deps.hasOptedOut())return!1;var t=this.deps.options().tracking;if("boolean"==typeof t)return t;var r=this.trackingOptions();if(r){if(this.isEnvironmentExcluded())return!1;var n=r.excludeChains,a=void 0===n?[]:n;return!(a.length>0&&this.isChainRefused(a,e))}return!(0,i.isLocalhost)()},e.prototype.isAutocaptureEnabled=function(e){var t=this.deps.options().autocapture;return void 0===t||("boolean"==typeof t?t:null===t||"object"!=typeof t||!1!==t[e])},e}();t.TrackingPolicy=a},4312(e,t){Object.defineProperty(t,"__esModule",{value:!0})},4164(e,t){var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionStatus=t.SignatureStatus=void 0,function(e){e.REQUESTED="requested",e.REJECTED="rejected",e.CONFIRMED="confirmed"}(r||(t.SignatureStatus=r={})),function(e){e.STARTED="started",e.REJECTED="rejected",e.BROADCASTED="broadcasted",e.CONFIRMED="confirmed",e.REVERTED="reverted"}(n||(t.TransactionStatus=n={}))},2657(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4312),t),i(r(4164),t),i(r(7896),t)},7896(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.WRAPPED_REQUEST_OWNER_SYMBOL=t.WRAPPED_REQUEST_REF_SYMBOL=t.WRAPPED_REQUEST_SYMBOL=void 0,t.WRAPPED_REQUEST_SYMBOL=Symbol("formoWrappedRequest"),t.WRAPPED_REQUEST_REF_SYMBOL=Symbol("formoWrappedRequestRef"),t.WRAPPED_REQUEST_OWNER_SYMBOL=Symbol("formoWrappedRequestOwner")},4657(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.validateAddress=t.validateAndChecksumAddress=t.toChecksumAddress=t.isBlockedAddress=t.getValidAddress=t.isValidAddress=void 0;var n=r(5628),i=r(7393),a=r(9879),o=r(1592),s=r(49),c=r(3236),u=r(9485),l=function(e){return"string"==typeof e&&""!==e.trim()&&(0,a.isAddress)(e.trim())?e.trim():null};t.isValidAddress=function(e){return null!==l(e)},t.getValidAddress=function(e){return l(e)},t.isBlockedAddress=function(e){if(!e||"string"!=typeof e)return!1;var t=e.trim().toLowerCase();return!(!t||!t.startsWith("0x")||42!==t.length)&&s.BLOCKED_ADDRESSES.some(function(e){return e.toLowerCase()===t})},t.toChecksumAddress=function(e){if(!(0,a.isAddress)(e,!1))throw new Error("Invalid address "+e);var t=e.toLowerCase().replace(/^0x/i,""),r=(0,a.uint8ArrayToHexString)((0,n.keccak256)((0,a.ensureIfUint8Array)((0,i.utf8ToBytes)(t))));if((0,o.isNullish)(r)||"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"===r)return"";for(var s="0x",c=r.replace(/^0x/i,""),u=0;u<t.length;u+=1)parseInt(c[u],16)>7?s+=t[u].toUpperCase():s+=t[u];return s},t.validateAndChecksumAddress=function(e){var r=(0,t.getValidAddress)(e);return r?(0,t.toChecksumAddress)(r):void 0},t.validateAddress=function(e,r){var n=Object.values(u.SOLANA_CHAIN_IDS);return null!=r&&n.includes(r)?(0,c.getValidSolanaAddress)(e)||void 0:null!=r?(0,t.validateAndChecksumAddress)(e):(0,t.validateAndChecksumAddress)(e)||(0,c.isSolanaAddress)(e)&&(0,c.getValidSolanaAddress)(e)||void 0}},7916(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getActionDescriptor=void 0,t.getActionDescriptor=function(e,t){var r=e;return(null==t?void 0:t.status)&&(r+=" ".concat(t.status)),"connect"!==e&&"disconnect"!==e||!(null==t?void 0:t.rdns)||(r+=" (".concat(t.rdns,")")),r}},7392(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseChainId=function(e){return"string"!=typeof e?0:e.startsWith("0x")||e.startsWith("0X")?parseInt(e,16):parseInt(e,10)}},1349(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.clampNumber=t.toDateHourMinute=t.millisecondsToSecond=void 0,t.toSnakeCase=function(e,t){void 0===t&&(t=[]);var r=function(e){return Array.isArray(e)?e.map(r):null!==e&&"object"==typeof e?Object.keys(e).reduce(function(n,i){return n[t.includes(i)?i:i.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()]=t.includes(i)?e[i]:r(e[i]),n},{}):e};return r(e)},t.millisecondsToSecond=function(e){return Math.ceil(e/1e3)},t.toDateHourMinute=function(e){return e.getUTCFullYear()+"-"+("0"+(e.getUTCMonth()+1)).slice(-2)+"-"+("0"+e.getUTCDate()).slice(-2)+" "+("0"+e.getUTCHours()).slice(-2)+":"+("0"+e.getUTCMinutes()).slice(-2)},t.clampNumber=function(e,t,r){return Math.min(Math.max(e,r),t)}},9037(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getApexDomain=function(){if("undefined"==typeof window)return null;if(void 0!==r)return r;var e=window.location.hostname;if("localhost"===e||/^\d+\.\d+\.\d+\.\d+$/.test(e))return r=null,null;var t=e.split(".");if(t.length<2)return r=null,null;for(var n=2;n<=t.length;n++){var a=t.slice(-n).join(".");if(i(a))return r=a,a}return r=null,null},t._resetApexDomainCache=function(){r=void 0};var r,n="__formo_domain_probe";function i(e){var t="probe";document.cookie="".concat(n,"=").concat(t,"; domain=.").concat(e,"; path=/; max-age=10");var r=-1!==document.cookie.indexOf("".concat(n,"=").concat(t));return document.cookie="".concat(n,"=; domain=.").concat(e,"; path=/; max-age=0"),r}},6262(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.hash=function(e){return n(this,void 0,void 0,function(){var t,r;return i(this,function(n){return t=(0,o.utf8ToBytes)(e),r=(0,a.sha256)(t),[2,(0,o.bytesToHex)(r)]})})},t.generateNativeUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;var t=Array.from(e).map(function(e){return e.toString(16).padStart(2,"0")}).join("");return"".concat(t.slice(0,8),"-").concat(t.slice(8,12),"-").concat(t.slice(12,16),"-").concat(t.slice(16,20),"-").concat(t.slice(20))}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)})};var a=r(6997),o=r(7393)},625(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.secureHash=function(e){var t=(0,i.utf8ToBytes)(e),r=(0,n.sha256)(t);return(0,i.bytesToHex)(r).slice(0,8)};var n=r(6997),i=r(7393)},9629(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4657),t),i(r(7916),t),i(r(1349),t),i(r(6262),t),i(r(625),t),i(r(4586),t)},2817(e,t){function r(e,t){var r=null!=e?e:{},i=null!=t?t:{},a={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(a[o]=Object.prototype.hasOwnProperty.call(i,o)?n(r[o],i[o]):r[o]);for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(Object.prototype.hasOwnProperty.call(a,o)||(a[o]=i[o]));return a}function n(e,t){return i(e)&&i(t)?r(e,t):t}function i(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.mergeDeepRight=r,t.default=r},8081(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getFormattedTimestamp=t.getCurrentTimeFormatted=void 0;var r=function(e){return e.toISOString()};t.getFormattedTimestamp=r,t.getCurrentTimeFormatted=function(){return r(new Date)}},4586(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getTimezone=void 0;var n=r(3312);t.getTimezone=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){return n.logger.error("Error resolving timezone:",e),""}}},8939(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.checkAddressChecksum=t.isAddress=void 0,t.ensureIfUint8Array=s;var n=r(9874),i=r(5628),a=r(7393),o=r(8090);function s(e){var t;return e instanceof Uint8Array||"Uint8Array"!==(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)?e:Uint8Array.from(e)}t.isAddress=function(e,r){return void 0===r&&(r=!0),!("string"!=typeof e&&!(0,n.isUint8Array)(e))&&(i=(0,n.isUint8Array)(e)?(0,n.uint8ArrayToHexString)(e):"string"!=typeof e||(0,o.isHexStrict)(e)||e.toLowerCase().startsWith("0x")?e:"0x".concat(e),!!/^(0x)?[0-9a-f]{40}$/i.test(i)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(i)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(i))||!r||(0,t.checkAddressChecksum)(i)));var i},t.checkAddressChecksum=function(e){if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;for(var t=e.slice(2),r=(0,a.utf8ToBytes)(t.toLowerCase()),o=(0,n.uint8ArrayToHexString)((0,i.keccak256)(s(r))).slice(2),c=0;c<40;c+=1)if(parseInt(o[c],16)>7&&t[c].toUpperCase()!==t[c]||parseInt(o[c],16)<=7&&t[c].toLowerCase()!==t[c])return!1;return!0}},2886(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isLocalhost=void 0,t.isLocalhost=function(){return/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*:)*?:?0*1$/.test(window.location.hostname)||"file:"===window.location.protocol}},9090(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectToString=t.isPrimitive=t.isError=t.isDate=t.isRegExp=t.isObjectAndNotNull=t.isObject=t.isNumber=t.isBoolean=t.isArray=t.isBigInt=t.isDefinedNotNullAndNotEmptyString=t.isDefinedAndNotNull=t.isDefined=t.isTypeOfError=t.isNullOrUndefined=t.isUndefined=t.isNull=t.isString=t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e&&Boolean(e.constructor&&e.call&&e.apply)},t.isString=function(e){return"string"==typeof e};var r=function(e){return null===e};t.isNull=r;var n=function(e){return void 0===e};t.isUndefined=n;var i=function(e){return r(e)||n(e)};t.isNullOrUndefined=i,t.isBigInt=function(e){return"bigint"==typeof e},t.isDefined=function(e){return!n(e)};var a=function(e){return!i(e)};t.isDefinedAndNotNull=a,t.isDefinedNotNullAndNotEmptyString=function(e){return a(e)&&""!==e},t.isTypeOfError=function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}};var o=function(e){return Array.isArray(e)};t.isArray=o,t.isBoolean=function(e){return"boolean"==typeof e},t.isNumber=function(e){return"number"==typeof e};var s=function(e){return"object"==typeof e};t.isObject=s,t.isObjectAndNotNull=function(e){return!r(e)&&s(e)&&!o(e)},t.isRegExp=function(e){return s(e)&&"[object RegExp]"===c(e)},t.isDate=function(e){return s(e)&&"[object Date]"===c(e)},t.isError=function(e){return s(e)&&("[object Error]"===c(e)||e instanceof Error)},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e};var c=function(e){return Object.prototype.toString.call(e)};t.objectToString=c},9879(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8939),t),i(r(2886),t),i(r(9090),t),i(r(2921),t),i(r(1592),t),i(r(8090),t),i(r(9874),t)},2921(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isNetworkError=function(e){return!(!e||(t=e,a=r.call(t),"[object Error]"!==a&&"[object DOMException]"!==a)||!n.has(e.name)||"string"!=typeof e.message)&&("Load failed"===e.message?void 0===e.stack:i.has(e.message));var t,a};var r=Object.prototype.toString,n=new Set(["TypeError","TimeoutError","NetworkError"]),i=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated","The operation was aborted due to timeout"])},1592(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isNullish=void 0,t.isNullish=function(e){return null==e}},8090(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isHexStrict=void 0,t.isHexStrict=function(e){return"string"==typeof e&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e)}},9874(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=function(e){var t,r;return e instanceof Uint8Array||"Uint8Array"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)||"Buffer"===(null===(r=null==e?void 0:e.constructor)||void 0===r?void 0:r.name)},t.uint8ArrayToHexString=function(e){for(var t="0x",r=0,n=e;r<n.length;r++){var i=n[r].toString(16);t+=1===i.length?"0".concat(i):i}return t}},5479(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="1.40.0"},8788(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.WagmiEventHandler=t.MARKER_GRACE_MS=void 0,t.__resetSeededWallet=function(){y.clear(),I.forEach(function(e){return clearTimeout(e)}),I.clear(),_.clear(),C.clear(),h.clear(),v.clear(),g.forEach(function(e){return clearTimeout(e)}),g.clear()};var o=r(4164),s=r(3312),c=r(6653),u=r(8694),l=r(5170),d=new Set(["status","chainId","address","data","to","value","transactionHash","function_name","function_args","providerName","rdns"]),h=new Set,f=new WeakMap,p=function(e,t){return"".concat(e,":").concat(t.toLowerCase())};t.MARKER_GRACE_MS=3e3;var v=new Map,g=new Map,y=new Map,m=new WeakMap,b=0,A=c.isUserRejectionError,S=new WeakMap,w=new WeakSet,E=new WeakMap,_=new Map,C=new Map,I=new Map;function k(e,t){var r;return t&&(null===(r=f.get(t))||void 0===r?void 0:r.has(e))?"exact":h.has(e)?"recent":"none"}function P(e,t){var r;h.delete(e),t&&(null===(r=f.get(t))||void 0===r||r.delete(e))}function O(e,t){var r;if(t){var n=null!==(r=f.get(t))&&void 0!==r?r:new Set;n.add(e),f.set(t,n)}h.add(e)}function T(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("bigint"==typeof e)return Number(e);if("string"==typeof e&&""!==e.trim()){var t=(e.startsWith("0x"),Number(e));return Number.isFinite(t)?t:void 0}}function R(e){if("string"==typeof e)return e;if(e&&"object"==typeof e){var t=e.address;if("string"==typeof t)return t}}function L(e,t,r){if(void 0===t&&(t=1e3),void 0===r&&(r=500),e.size>t)for(var n=Array.from(e),i=0;i<r&&i<n.length;i++)e.delete(n[i])}var x=function(){function e(e,t,r){this.unsubscribers=[],this.trackingState={isProcessing:!1},this.disposed=!1,this.reconciling=!1,this.transitionGeneration=0,this.missedDisconnect=!1,this.processedMutations=new Set,this.processedQueries=new Set,this.wrapEpochs=new WeakMap,this.wrapRetryCounts=new WeakMap,this.wrapRetryTimers=new Set,this.wrapSessionGeneration=0,this.formo=e,this.wagmiConfig=t,this.queryClient=r,s.logger.info("WagmiEventHandler: Initializing Wagmi integration");var n,i,a,o,c,u=this.pruneMarkersForLostWallets();!function(e,t){var r;if(v.set(e,(null!==(r=v.get(e))&&void 0!==r?r:0)+1),t){var n=g.get(e);n&&(clearTimeout(n),g.delete(e))}}(this.formo.writeKey,u),this.ownerKey=(n=this.formo.writeKey,i=t,(a=m.get(i))||(a="cfg".concat(b+=1),m.set(i,a)),"".concat(n,":").concat(a)),y.set(this.ownerKey,this),o=this.ownerKey,(c=I.get(o))&&(clearTimeout(c),I.delete(o)),this.setupConnectionListeners(),this.seedFromCurrentState(),this.queryClient?(this.setupMutationTracking(),this.setupQueryTracking()):s.logger.warn("WagmiEventHandler: QueryClient not provided, signature and transaction events will not be tracked")}return e.prototype.pruneMarkersForLostWallets=function(){var e,t=this;try{e=this.getState()}catch(e){return!1}var r="".concat(this.formo.writeKey,":"),n=new Set;e.connections.forEach(function(e){e.accounts.forEach(function(e){return n.add(p(t.formo.writeKey,e))})});var i=!1;return h.forEach(function(e){e.startsWith(r)&&(n.has(e)?i=!0:h.delete(e))}),i},Object.defineProperty(e.prototype,"isEmittingOwner",{get:function(){if(!this.ownerKey)return!0;var e=y.get(this.ownerKey);return e?e===this:(y.set(this.ownerKey,this),!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pendingTransactions",{get:function(){var e,t=null!==(e=this.ownerKey)&&void 0!==e?e:"",r=_.get(t);return r||(r=new Map,_.set(t,r)),r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pendingBatches",{get:function(){var e,t=null!==(e=this.ownerKey)&&void 0!==e?e:"",r=C.get(t);return r||(r=new Map,C.set(t,r)),r},enumerable:!1,configurable:!0}),e.prototype.setupConnectionListeners=function(){var e=this;s.logger.info("WagmiEventHandler: Setting up connection listeners");var t=this.wagmiConfig.subscribe(function(e){return e.status},function(t,r){e.handleStatusChange(t,r)});this.unsubscribers.push(t);var r=this.wagmiConfig.subscribe(function(t){var r;return null!==(r=e.getActiveConnectionChainId(t))&&void 0!==r?r:t.chainId},function(t,r){e.handleChainChange(t,r)});this.unsubscribers.push(r);var n=this.wagmiConfig.subscribe(function(t){var r,n;return"".concat(null!==(r=t.current)&&void 0!==r?r:"","|").concat(null!==(n=e.getConnectedAddress(t))&&void 0!==n?n:"")},function(t,r){var n=t.split("|")[1],i=(null!=r?r:"|").split("|")[1];e.wrapActiveConnectorProvider(e.getState()),e.handleActiveAddressChange(n||void 0,i||void 0)});this.unsubscribers.push(n),s.logger.info("WagmiEventHandler: Connection listeners set up successfully")},e.prototype.seedFromCurrentState=function(){var e,t;try{var r=this.getState();this.kickWalletConnectPeerLookup(r),this.wrapActiveConnectorProvider(r)}catch(e){}try{var i=this.getState();if("connected"!==i.status)return;var a=this.getConnectedAddress(i),o=null!==(e=this.getActiveConnectionChainId(i))&&void 0!==e?e:i.chainId;if(!a||void 0===o)return void s.logger.debug("WagmiEventHandler: Connected at init but address or chainId is missing, nothing to seed",{address:a,chainId:o});if(s.logger.info("WagmiEventHandler: Adopting connection that predates this handler",{address:a,chainId:o}),this.formo.syncWalletState({chainId:o,address:a}),(null===(t=this.formo.currentAddress)||void 0===t?void 0:t.toLowerCase())!==a.toLowerCase())return void s.logger.debug("WagmiEventHandler: Central state declined the connection, not seeding",{address:a,chainId:o});if(this.trackingState.lastAddress=a,this.trackingState.lastChainId=o,this.trackingState.lastStatus=i.status,this.trackingState.lastConnectionId=i.current,!this.formo.isAutocaptureEnabled("connect")||!this.isEmittingOwner)return void s.logger.debug("WagmiEventHandler: Connect autocapture disabled, adopted without emitting",{address:a,chainId:o});if(!this.formo.willTrackEvent(o))return void s.logger.debug("WagmiEventHandler: Connect would not be tracked, adopted without emitting",{address:a,chainId:o});var c=p(this.formo.writeKey,a),u=i.current?i.connections.get(i.current):void 0;if("none"!==k(c,u))return void s.logger.debug("WagmiEventHandler: Wallet already adopted this page load, not re-emitting connect",{address:a});O(c,u);var l=this.getConnectorName(i);Promise.resolve(this.formo.connect({chainId:o,address:a},n({},l&&{providerName:l}))).catch(function(e){P(c,u),s.logger.error("WagmiEventHandler: Error emitting seeded connect event:",e)})}catch(e){s.logger.error("WagmiEventHandler: Error seeding from current state:",e)}},e.prototype.restoreCentralStateFromTracking=function(){var e,t=this.trackingState,r=t.lastAddress,n=t.lastChainId;r&&void 0!==n&&((null===(e=this.formo.currentAddress)||void 0===e?void 0:e.toLowerCase())===r.toLowerCase()&&this.formo.currentChainId===n||(s.logger.info("WagmiEventHandler: Restoring central state a stale disconnect cleared",{address:r,chainId:n}),this.formo.syncWalletState({chainId:n,address:r})))},e.prototype.releaseTrackedWallet=function(){var e=this.trackingState.lastAddress;this.trackingState.lastAddress=void 0,this.trackingState.lastChainId=void 0,this.trackingState.lastConnectionId=void 0,e&&h.delete(p(this.formo.writeKey,e))},e.prototype.retryAdoption=function(){this.disposed||(this.trackingState.lastAddress&&!this.tracksLiveWallet()&&(s.logger.debug("WagmiEventHandler: Tracked wallet is no longer the live one, releasing before retry",{tracked:this.trackingState.lastAddress}),this.releaseTrackedWallet()),this.resyncCentralState(),this.trackingState.lastAddress&&this.isCurrentWalletAnnounced()||this.seedFromCurrentState())},e.prototype.tracksLiveWallet=function(){var e=this.trackingState.lastAddress;if(!e)return!1;try{var t=this.getState();if("connected"!==t.status)return!1;var r=this.getConnectedAddress(t);return!!r&&r.toLowerCase()===e.toLowerCase()}catch(e){return s.logger.error("WagmiEventHandler: Error reading state to compare wallets:",e),!1}},e.prototype.resyncCentralState=function(){var e,t=this.trackingState,r=t.lastAddress,n=t.lastChainId;r&&void 0!==n&&((null===(e=this.formo.currentAddress)||void 0===e?void 0:e.toLowerCase())===r.toLowerCase()&&this.formo.currentChainId===n||(s.logger.info("WagmiEventHandler: Re-syncing central state for a tracked wallet",{address:r,chainId:n}),this.formo.syncWalletState({chainId:n,address:r})))},e.prototype.isCurrentWalletAnnounced=function(){var e,t=this.trackingState.lastAddress;if(!t)return!1;try{var r=this.getState();e=r.current?r.connections.get(r.current):void 0}catch(e){}return"none"!==k(p(this.formo.writeKey,t),e)},e.prototype.handleStatusChange=function(e,t){return i(this,void 0,void 0,function(){var r,i,o,c,u,l,d,f,v,g,y,m,b,A,S;return a(this,function(a){switch(a.label){case 0:if("disconnected"!==e&&"reconnecting"!==e||(this.wrapSessionGeneration+=1,this.fallbackConnector=void 0,this.fallbackProvider=void 0),this.trackingState.isProcessing)return"disconnected"===e&&(this.missedDisconnect=!0),s.logger.debug("WagmiEventHandler: Already processing status change, skipping"),[2];this.trackingState.isProcessing=!0;try{r=this.getState(),this.kickWalletConnectPeerLookup(r),this.wrapActiveConnectorProvider(r)}catch(e){}this.transitionGeneration+=1,a.label=1;case 1:return a.trys.push([1,14,15,16]),i=this.getState(),o=this.getConnectedAddress(i),c=null!==(m=this.getActiveConnectionChainId(i))&&void 0!==m?m:i.chainId,s.logger.info("WagmiEventHandler: Status changed",{status:e,prevStatus:t,address:o,chainId:c}),"disconnected"===e&&this.trackingState.lastAddress?(u=this.trackingState.lastAddress,l=this.trackingState.lastChainId,this.trackingState.lastConnectionId=void 0,this.trackingState.lastAddress=void 0,this.trackingState.lastChainId=void 0,this.pendingChainId=void 0,this.missedDisconnect=!1,h.delete(p(this.formo.writeKey,u)),this.formo.isAutocaptureEnabled("disconnect")&&this.isEmittingOwner?[4,this.formo.disconnect({chainId:l,address:u})]:[3,3]):[3,4];case 2:return a.sent(),[3,4];case 3:this.formo.syncWalletState({chainId:l}),a.label=4;case 4:return"connected"!==e||"connected"===t?[3,13]:o&&void 0!==c?(null===(b=this.trackingState.lastAddress)||void 0===b?void 0:b.toLowerCase())!==o.toLowerCase()?[3,9]:this.trackingState.lastChainId===c?[3,7]:this.pendingChainId!==c?[3,6]:(this.pendingChainId=void 0,s.logger.info("WagmiEventHandler: Re-entry carries a chain the subscription dropped, emitting it",{address:o,from:this.trackingState.lastChainId,to:c}),[4,this.handleChainChange(c,this.trackingState.lastChainId)]):[3,13];case 5:return a.sent(),this.trackingState.lastStatus=e,[2];case 6:return s.logger.info("WagmiEventHandler: Tracked wallet re-entered connected on a different chain",{address:o,from:this.trackingState.lastChainId,to:c}),this.formo.syncWalletState({chainId:c,address:o}),(null===(A=this.formo.currentAddress)||void 0===A?void 0:A.toLowerCase())===o.toLowerCase()?this.trackingState.lastChainId=c:(s.logger.debug("WagmiEventHandler: Central state declined the re-entry chain, dropping the wallet",{address:o,chainId:c}),this.releaseTrackedWallet()),[3,8];case 7:s.logger.debug("WagmiEventHandler: Ignoring re-entry to connected for an already tracked wallet",{address:o,chainId:c}),a.label=8;case 8:return this.trackingState.lastStatus=e,[2];case 9:if(this.formo.syncWalletState({chainId:c,address:o}),(null===(S=this.formo.currentAddress)||void 0===S?void 0:S.toLowerCase())!==o.toLowerCase())return s.logger.debug("WagmiEventHandler: Central state declined the connection, not adopting",{address:o,chainId:c}),this.trackingState.lastStatus=e,[2];if(this.trackingState.lastAddress=o,this.trackingState.lastChainId=c,this.trackingState.lastConnectionId=i.current,!(this.formo.isAutocaptureEnabled("connect")&&this.isEmittingOwner&&this.formo.willTrackEvent(c)))return[3,13];if(d=p(this.formo.writeKey,o),f=i.current?i.connections.get(i.current):void 0,"none"!==k(d,f))return s.logger.debug("WagmiEventHandler: Connect already announced for this wallet, not emitting again",{address:o}),this.trackingState.lastStatus=e,[2];O(d,f),v=this.getConnectorName(i),a.label=10;case 10:return a.trys.push([10,12,,13]),[4,this.formo.connect({chainId:c,address:o},n({},v&&{providerName:v}))];case 11:return a.sent(),[3,13];case 12:throw g=a.sent(),P(d,f),g;case 13:return this.trackingState.lastStatus=e,[3,16];case 14:return y=a.sent(),s.logger.error("WagmiEventHandler: Error handling status change:",y),[3,16];case 15:return this.trackingState.isProcessing=!1,this.reconcileWithLiveState(),[7];case 16:return[2]}})})},e.prototype.reconcileWithLiveState=function(){var e=this;if(!this.disposed&&!this.trackingState.isProcessing&&!this.reconciling){var t;try{t=this.getState()}catch(e){return void s.logger.error("WagmiEventHandler: Error reading state to reconcile:",e)}if("connected"===t.status||"disconnected"===t.status){var r="connected"===t.status?this.getConnectedAddress(t):void 0,n=this.trackingState.lastAddress;if(r||n)if(r&&n){if(r.toLowerCase()===n.toLowerCase()){if(this.missedDisconnect){this.missedDisconnect=!1,s.logger.info("WagmiEventHandler: A disconnect/reconnect cycle completed while the lock was held",{address:r}),this.reconciling=!0;try{this.handleStatusChange("disconnected","connected").then(function(){return e.retryAdoption()})}finally{this.reconciling=!1}return}this.resyncCentralState();var i=this.pendingChainId;return void(void 0!==i&&(this.pendingChainId=void 0,i!==this.trackingState.lastChainId&&(s.logger.info("WagmiEventHandler: Replaying a chain change dropped while reconnecting",{address:r,from:this.trackingState.lastChainId,to:i}),this.handleChainChange(i,this.trackingState.lastChainId))))}s.logger.info("WagmiEventHandler: Wallet changed while the lock was held, re-adopting",{from:n,to:r}),this.reconciling=!0;try{this.releaseTrackedWallet(),this.seedFromCurrentState()}finally{this.reconciling=!1}}else{this.reconciling=!0;try{r?(s.logger.info("WagmiEventHandler: Reconnect landed while the lock was held, adopting it",{address:r}),this.retryAdoption()):(s.logger.info("WagmiEventHandler: Disconnect landed while the lock was held, applying it",{address:n}),this.handleStatusChange("disconnected","connected"))}finally{this.reconciling=!1}}}}},e.prototype.handleActiveAddressChangeEntryKick=function(){try{this.kickWalletConnectPeerLookup(this.getState())}catch(e){}},e.prototype.handleActiveAddressChange=function(e,t){return i(this,void 0,void 0,function(){var r,i,o,c,u,l,d,f,v,g,y,m,b,A,S,w,E,_,C,I,T,R;return a(this,function(a){switch(a.label){case 0:if(this.handleActiveAddressChangeEntryKick(),"connected"!==(r=this.getState()).status)return[2];if(i=this.trackingState.lastConnectionId,o=!!i&&!r.connections.has(i),c=void 0!==this.trackingState.lastConnectionId&&void 0!==r.current&&r.current!==this.trackingState.lastConnectionId,!o&&!c){if(!e||e===t)return[2];if((null===(E=this.trackingState.lastAddress)||void 0===E?void 0:E.toLowerCase())===e.toLowerCase())return[2]}return c&&!o&&e&&(null===(_=this.trackingState.lastAddress)||void 0===_?void 0:_.toLowerCase())===e.toLowerCase()?(u=null!==(C=this.getActiveConnectionChainId(r))&&void 0!==C?C:r.chainId,s.logger.info("WagmiEventHandler: Active connection changed for the same account",{address:e,from:this.trackingState.lastConnectionId,to:r.current}),this.trackingState.lastConnectionId=r.current,void 0===u||u===this.trackingState.lastChainId?[3,2]:[4,this.applyChainForTrackedWallet(e,u)]):[3,3];case 1:a.sent(),a.label=2;case 2:return[2];case 3:return e?(l=++this.transitionGeneration,void 0===(d=null!==(I=this.getActiveConnectionChainId(r))&&void 0!==I?I:r.chainId)?[2]:o?t&&this.isAddressConnected(r,t)?(s.logger.info("WagmiEventHandler: Tracked connector fell away, account still connected elsewhere",{address:t,connection:r.current}),this.trackingState.lastConnectionId=r.current,(null===(T=this.trackingState.lastAddress)||void 0===T?void 0:T.toLowerCase())!==e.toLowerCase()?[3,6]:this.trackingState.lastChainId===d?[3,5]:[4,this.applyChainForTrackedWallet(e,d)]):[3,7]:[3,14]):[2];case 4:a.sent(),a.label=5;case 5:return[2];case 6:return[3,14];case 7:if(!t)return[3,14];if(s.logger.info("WagmiEventHandler: Tracked connector disconnected, wagmi fell back to another connection",{disconnected:t,fallback:e}),f=this.trackingState.lastChainId,this.releaseTrackedWallet(),!this.formo.isAutocaptureEnabled("disconnect")||!this.isEmittingOwner)return[3,12];a.label=8;case 8:return a.trys.push([8,10,,11]),[4,this.formo.disconnect({chainId:f,address:t})];case 9:return a.sent(),[3,11];case 10:return v=a.sent(),s.logger.error("WagmiEventHandler: Error tracking connector fallback disconnect:",v),[3,11];case 11:return[3,13];case 12:this.formo.syncWalletState({chainId:f}),a.label=13;case 13:g=void 0;try{g=this.getState()}catch(e){}if(y=!this.disposed&&"connected"===(null==g?void 0:g.status)&&g.current===r.current,l!==this.transitionGeneration||!y)return s.logger.debug("WagmiEventHandler: A newer transition superseded this one, stopping",{address:e}),this.restoreCentralStateFromTracking(),[2];a.label=14;case 14:if(s.logger.info("WagmiEventHandler: Active account switched",{from:t,to:e,chainId:d}),this.formo.syncWalletState({chainId:d,address:e}),(null===(R=this.formo.currentAddress)||void 0===R?void 0:R.toLowerCase())!==e.toLowerCase())return s.logger.debug("WagmiEventHandler: Central state declined the switched account, not adopting",{address:e,chainId:d}),this.releaseTrackedWallet(),[2];if(this.trackingState.lastAddress=e,this.trackingState.lastChainId=d,this.trackingState.lastConnectionId=r.current,!(this.formo.isAutocaptureEnabled("connect")&&this.isEmittingOwner&&this.formo.willTrackEvent(d)))return[3,18];if(t&&!this.isAddressConnected(r,t)&&h.delete(p(this.formo.writeKey,t)),m=p(this.formo.writeKey,e),b=r.current?r.connections.get(r.current):void 0,A="none"!==k(m,b),O(m,b),A)return s.logger.debug("WagmiEventHandler: Fallback connection was already announced, not re-emitting connect",{address:e}),[2];a.label=15;case 15:return a.trys.push([15,17,,18]),S=this.getConnectorName(r),[4,this.formo.connect({chainId:d,address:e},n({},S&&{providerName:S}))];case 16:return a.sent(),[3,18];case 17:return w=a.sent(),P(m,b),s.logger.error("WagmiEventHandler: Error tracking account switch:",w),[3,18];case 18:return[2]}})})},e.prototype.applyChainForTrackedWallet=function(e,t){return i(this,void 0,void 0,function(){var r,n;return a(this,function(i){switch(i.label){case 0:if(this.formo.syncWalletState({chainId:t,address:e}),(null===(n=this.formo.currentAddress)||void 0===n?void 0:n.toLowerCase())!==e.toLowerCase())return s.logger.debug("WagmiEventHandler: Central state declined the new chain, dropping the wallet",{address:e,chainId:t}),this.releaseTrackedWallet(),[2];if(this.trackingState.lastChainId=t,!this.formo.isAutocaptureEnabled("chain")||!this.isEmittingOwner)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.formo.chain({chainId:t,address:e})];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),s.logger.error("WagmiEventHandler: Error tracking chain change:",r),[3,4];case 4:return[2]}})})},e.prototype.handleChainChange=function(e,t){return i(this,void 0,void 0,function(){var r,n,i,o,c,u,l,d;return a(this,function(a){switch(a.label){case 0:if(void 0!==this.fallbackProvider&&((r=this.getState()).current?null===(u=r.connections.get(r.current))||void 0===u?void 0:u.connector:void 0)===this.fallbackConnector)try{null===(d=(l=this.formo)._rememberWagmiProviderChain)||void 0===d||d.call(l,this.fallbackProvider,e)}catch(e){}return e===t||void 0===e?[2]:"connected"!==(n=this.getState()).status?(this.pendingChainId=e,[2]):(this.pendingChainId=void 0,(i=this.getConnectedAddress(n))?void 0!==this.trackingState.lastConnectionId&&void 0!==n.current&&n.current!==this.trackingState.lastConnectionId?(s.logger.debug("WagmiEventHandler: Chain change belongs to a connection not adopted yet, deferring",{chainId:e,from:this.trackingState.lastConnectionId,to:n.current}),[2]):(o=!!this.trackingState.lastAddress,c=this.isCurrentWalletAnnounced(),o&&c||(this.retryAdoption(),c||!this.isCurrentWalletAnnounced())?(s.logger.info("WagmiEventHandler: Chain changed",{chainId:e,prevChainId:t,address:i}),[4,this.applyChainForTrackedWallet(i,e)]):[2]):(s.logger.warn("WagmiEventHandler: Chain changed but no address found"),[2]));case 1:return a.sent(),[2]}})})},e.prototype.setupMutationTracking=function(){var e=this;if(this.queryClient){s.logger.info("WagmiEventHandler: Setting up mutation tracking");var t=this.queryClient.getMutationCache().subscribe(function(t){e.handleMutationEvent(t)});this.unsubscribers.push(t),s.logger.info("WagmiEventHandler: Mutation tracking set up successfully")}},e.prototype.setupQueryTracking=function(){var e=this;if(this.queryClient){s.logger.info("WagmiEventHandler: Setting up query tracking");var t=this.queryClient.getQueryCache().subscribe(function(t){e.handleQueryEvent(t)});this.unsubscribers.push(t),s.logger.info("WagmiEventHandler: Query tracking set up successfully")}},e.prototype.handleQueryEvent=function(e){if("updated"===e.type&&this.isEmittingOwner){var t=e.query,r=t.queryKey;if(r&&0!==r.length){var n=r[0];if("waitForTransactionReceipt"===n||"callsStatus"===n)if("callsStatus"!==n){var i=t.state,a=i.data,o=null==a?void 0:a.status,c="".concat(t.queryHash,":").concat(i.status,":").concat(o||"");this.processedQueries.has(c)?s.logger.debug("WagmiEventHandler: Skipping duplicate query event",{queryType:n,queryHash:t.queryHash,status:i.status,receiptStatus:o}):(this.processedQueries.add(c),s.logger.debug("WagmiEventHandler: Query event",{queryType:n,queryHash:t.queryHash,status:i.status}),this.handleTransactionReceiptQuery(t),L(this.processedQueries))}else this.handleCallsStatusQuery(t)}}},e.prototype.settleFromCachedCallsStatus=function(e){var t,r,n;try{var i=null===(t=this.queryClient)||void 0===t?void 0:t.getQueryCache(),a=null===(r=null==i?void 0:i.getAll)||void 0===r?void 0:r.call(i);if(!Array.isArray(a))return;for(var o=0,c=a;o<c.length;o++){var u=c[o],l=null==u?void 0:u.queryKey;Array.isArray(l)&&"callsStatus"===l[0]&&(null===(n=l[1])||void 0===n?void 0:n.id)===e&&this.handleCallsStatusQuery(u)}}catch(e){s.logger.debug("WagmiEventHandler: cached callsStatus scan failed",e)}},e.prototype.handleCallsStatusQuery=function(e){var t,r=this;if(this.formo.isAutocaptureEnabled("transaction")){var i=e.queryKey[1],a=null==i?void 0:i.id;if(a){var o=this.pendingBatches.get(a);if(o){var c=e.state;if("success"===c.status&&c.data)try{var l=c.data,d=(0,u.readBatchStatusCode)(l);if(void 0===d||d<200)return;s.logger.debug("WagmiEventHandler: batch settled",{batchId:a,code:d});var h=o.chainIdWasExplicit?o.chainId:null!==(t=(0,u.readBatchChainId)(l))&&void 0!==t?t:o.chainId;o.calls.forEach(function(e,t){var i=(0,u.batchReceiptForCall)(l,t,o.calls.length),s=(0,u.batchCallOutcome)(d,i);void 0!==s&&r.formo.transaction(n(n(n(n({status:s,chainId:h||0,address:o.address},e.data&&{data:e.data}),e.to&&{to:e.to}),e.value&&{value:e.value}),(null==i?void 0:i.transactionHash)?{transactionHash:i.transactionHash}:{}),n({batch_size:o.calls.length,batch_index:t,batch_id:a},o.providerName?{providerName:o.providerName}:{}))}),this.pendingBatches.delete(a)}catch(e){s.logger.error("WagmiEventHandler: callsStatus error:",e)}}else s.logger.debug("WagmiEventHandler: unobserved batch",{batchId:a})}}},e.prototype.handleTransactionReceiptQuery=function(e){var t,r;if(this.formo.isAutocaptureEnabled("transaction")){var i=e.state,a=e.queryKey;if("success"===i.status){var c=a[1],u=null==c?void 0:c.hash,l=null==c?void 0:c.chainId;if(u){var d=u.toLowerCase(),h=this.pendingTransactions.get(d);if(h){var f=h.address,p=h.chainIdWasExplicit?h.chainId:null!==(t=null!=l?l:h.chainId)&&void 0!==t?t:this.trackingState.lastChainId;if(f)try{var v=i.data;if("success"!==(null==v?void 0:v.status)&&"reverted"!==(null==v?void 0:v.status))return void s.logger.debug("WagmiEventHandler: Receipt without explicit success/reverted status; ignoring",{transactionHash:u,status:null==v?void 0:v.status});var g="reverted"===v.status?o.TransactionStatus.REVERTED:o.TransactionStatus.CONFIRMED;s.logger.info("WagmiEventHandler: Tracking transaction confirmation",{status:g,transactionHash:u,address:f,chainId:p,blockNumber:null===(r=null==v?void 0:v.blockNumber)||void 0===r?void 0:r.toString()}),this.formo.transaction(n(n(n(n(n({status:g,chainId:p||0,address:f,transactionHash:u},(null==h?void 0:h.data)&&{data:h.data}),(null==h?void 0:h.to)&&{to:h.to}),(null==h?void 0:h.value)&&{value:h.value}),(null==h?void 0:h.function_name)&&{function_name:h.function_name}),(null==h?void 0:h.function_args)&&{function_args:h.function_args}),n(n({},(null==h?void 0:h.providerName)?{providerName:h.providerName}:this.mutationAttribution()),null==h?void 0:h.safeFunctionArgs)),this.pendingTransactions.delete(d)}catch(e){s.logger.error("WagmiEventHandler: Error handling transaction receipt query:",e)}else s.logger.warn("WagmiEventHandler: Transaction receipt query but no address available")}else s.logger.debug("WagmiEventHandler: Receipt for unobserved tx hash; ignoring",{transactionHash:u})}else s.logger.warn("WagmiEventHandler: Transaction receipt query but no hash found")}}},e.prototype.handleMutationEvent=function(e){if("updated"===e.type&&this.isEmittingOwner){var t=e.mutation,r=t.options.mutationKey;if(r&&0!==r.length){var n=r[0],i=t.state,a="".concat(t.mutationId,":").concat(i.status);this.processedMutations.has(a)?s.logger.debug("WagmiEventHandler: Skipping duplicate mutation event",{mutationType:n,mutationId:t.mutationId,status:i.status}):(this.processedMutations.add(a),s.logger.debug("WagmiEventHandler: Mutation event",{mutationType:n,mutationId:t.mutationId,status:i.status}),"signMessage"!==n&&"signTypedData"!==n||this.handleSignatureMutation(n,t),"sendTransaction"!==n&&"writeContract"!==n||this.handleTransactionMutation(n,t),"sendCalls"===n&&this.handleSendCallsMutation(t),L(this.processedMutations))}}},e.prototype.hasMatchingPendingMutation=function(e,t){var r,n,i,a,o,s;try{var c=null===(r=this.queryClient)||void 0===r?void 0:r.getMutationCache(),u=null===(n=null==c?void 0:c.getAll)||void 0===n?void 0:n.call(c);if(!Array.isArray(u))return!1;var l={personal_sign:["signMessage"],eth_signTypedData_v4:["signTypedData"],eth_sendTransaction:["sendTransaction","writeContract"],wallet_sendCalls:["sendCalls"]}[e];if(!l)return!1;for(var d=0,h=u;d<h.length;d++){var f=h[d];if("pending"===(null===(i=null==f?void 0:f.state)||void 0===i?void 0:i.status)){var p=null===(o=null===(a=null==f?void 0:f.options)||void 0===a?void 0:a.mutationKey)||void 0===o?void 0:o[0];if("string"==typeof p&&l.includes(p)){var v=null===(s=f.state)||void 0===s?void 0:s.variables;if("sendTransaction"===p&&v){var g=Array.isArray(t)?t[0]:void 0,y=v.to;if("string"==typeof(null==g?void 0:g.to)&&"string"==typeof y&&g.to.toLowerCase()!==y.toLowerCase())continue}return!0}}}return!1}catch(e){return!1}},e.prototype.mutationAttribution=function(){try{var e=this.getConnectorName(this.getState());return e?{providerName:e}:void 0}catch(e){return}},e.prototype.handleSignatureMutation=function(e,t){var r,n,i,a;if(this.formo.isAutocaptureEnabled("signature")){var c=t.state,u=c.variables||{},l=null!==(a=null!==(i=null!==(n=T(null===(r=u.domain)||void 0===r?void 0:r.chainId))&&void 0!==n?n:T(u.chainId))&&void 0!==i?i:this.trackingState.lastChainId)&&void 0!==a?a:0,d=R(u.account)||this.trackingState.lastAddress;if(d)try{var h;if("pending"===c.status)h=o.SignatureStatus.REQUESTED;else if("success"===c.status)h=o.SignatureStatus.CONFIRMED;else{if("error"!==c.status)return;h=o.SignatureStatus.REJECTED}var f;f="signMessage"===e?u.message||"":JSON.stringify(u.message||u.types||{}),s.logger.info("WagmiEventHandler: Tracking signature event",{status:h,mutationType:e,address:d,chainId:l}),this.formo.signature({status:h,chainId:l,address:d,message:f},this.mutationAttribution())}catch(e){s.logger.error("WagmiEventHandler: Error handling signature mutation:",e)}else s.logger.warn("WagmiEventHandler: Signature event but no address available")}},e.prototype.handleTransactionMutation=function(e,t){var r,i;if(this.formo.isAutocaptureEnabled("transaction")){var a=t.state,c=a.variables||{},u=T(c.chainId),h=null!=u?u:this.trackingState.lastChainId,f=R(c.account)||c.from||this.trackingState.lastAddress;if(f)try{var p,v=void 0;if("pending"===a.status)p=o.TransactionStatus.STARTED;else if("success"===a.status)p=o.TransactionStatus.BROADCASTED,v=a.data;else{if("error"!==a.status)return;p=o.TransactionStatus.REJECTED}var g=void 0,y=void 0,m=void 0,b=void 0,A=null===(r=c.value)||void 0===r?void 0:r.toString();if("writeContract"===e){var S=c.abi,w=c.functionName,E=c.args,_=c.address,C=c.dataSuffix;if(y=_,m=w,S&&w){b=(0,l.extractFunctionArgs)(S,w,E);var I=(0,l.encodeWriteContractData)(S,w,E);I&&(g=(0,l.concatCalldataWithSuffix)(I,C),s.logger.debug("WagmiEventHandler: Encoded writeContract data",g.substring(0,10)))}}else g=c.data,y=c.to;s.logger.info("WagmiEventHandler: Tracking transaction event",{status:p,mutationType:e,address:f,chainId:h,transactionHash:v,function_name:m});var k=(0,l.buildSafeFunctionArgs)(b,d);if(p===o.TransactionStatus.BROADCASTED&&v){var P=v.toLowerCase(),O=n(n(n(n(n(n(n(n(n({address:f},null!==(i=this.mutationAttribution())&&void 0!==i?i:{}),void 0!==h&&{chainId:h}),{chainIdWasExplicit:void 0!==u}),g&&{data:g}),y&&{to:y}),A&&{value:A}),m&&{function_name:m}),b&&{function_args:b}),k&&{safeFunctionArgs:k});if(this.pendingTransactions.set(P,O),s.logger.debug("WagmiEventHandler: Stored pending transaction for confirmation",{transactionHash:P}),this.pendingTransactions.size>100)for(var L=Array.from(this.pendingTransactions.keys()),x=0;x<50&&x<L.length;x++)this.pendingTransactions.delete(L[x])}this.formo.transaction(n(n(n(n(n(n({status:p,chainId:h||0,address:f},g&&{data:g}),y&&{to:y}),A&&{value:A}),v&&{transactionHash:v}),m&&{function_name:m}),b&&{function_args:b}),n(n({},this.mutationAttribution()),k))}catch(e){s.logger.error("WagmiEventHandler: Error handling transaction mutation:",e)}else s.logger.warn("WagmiEventHandler: Transaction event but no address available")}},e.prototype.handleSendCallsMutation=function(e){var t=this;if(this.formo.isAutocaptureEnabled("transaction")){var r=e.state,i=r.variables||{},a=Array.isArray(i.calls)?i.calls:[];if(0!==a.length){var c=T(i.chainId),l=null!=c?c:this.trackingState.lastChainId,d=R(i.account)||this.trackingState.lastAddress;if(d)try{var h=a.map(function(e){return{to:null==e?void 0:e.to,value:void 0!==(null==e?void 0:e.value)?String(e.value):void 0,data:null==e?void 0:e.data}}),f=this.mutationAttribution(),p=function(e,r){h.forEach(function(i,a){t.formo.transaction(n(n(n({status:e,chainId:l||0,address:d},i.data&&{data:i.data}),i.to&&{to:i.to}),i.value&&{value:i.value}),n(n({batch_size:h.length,batch_index:a},f),r))})};if("pending"===r.status)s.logger.debug("WagmiEventHandler: sendCalls start",{calls:h.length}),p(o.TransactionStatus.STARTED);else if("success"===r.status){var v=(0,u.readBatchId)(r.data);if(s.logger.debug("WagmiEventHandler: sendCalls broadcast",{batchId:v}),p(o.TransactionStatus.BROADCASTED,v?{batch_id:v}:void 0),v){if(this.pendingBatches.set(v,n(n(n({address:d},null!=f?f:{}),void 0!==l&&{chainId:l}),{chainIdWasExplicit:void 0!==c,calls:h})),this.pendingBatches.size>100)for(var g=Array.from(this.pendingBatches.keys()),y=0;y<50&&y<g.length;y++)this.pendingBatches.delete(g[y]);this.settleFromCachedCallsStatus(v)}}else"error"===r.status&&A(r.error)&&(s.logger.debug("WagmiEventHandler: sendCalls rejected"),p(o.TransactionStatus.REJECTED))}catch(e){s.logger.error("WagmiEventHandler: sendCalls error:",e)}else s.logger.warn("WagmiEventHandler: sendCalls without address")}}},e.prototype.getState=function(){return"function"==typeof this.wagmiConfig.getState?this.wagmiConfig.getState():this.wagmiConfig.state?this.wagmiConfig.state:(s.logger.warn("WagmiEventHandler: Unable to get state from config, returning default state"),{status:"disconnected",connections:new Map,current:void 0,chainId:void 0})},e.prototype.getActiveConnectionChainId=function(e){var t;if(e.current)return null===(t=e.connections.get(e.current))||void 0===t?void 0:t.chainId},e.prototype.getConnectedAddress=function(e){if(e.current){var t=e.connections.get(e.current);if(t&&0!==t.accounts.length)return t.accounts[0]}},e.prototype.isAddressConnected=function(e,t){var r=t.toLowerCase(),n=!1;return e.connections.forEach(function(e){!n&&e.accounts.some(function(e){return e.toLowerCase()===r})&&(n=!0)}),n},e.prototype.attributionForConnector=function(e,t){var r=this.nameForConnector(e,t);if(r){var i=e.rdns,a="string"==typeof i&&i.length>0?i:Array.isArray(i)&&1===i.length&&"string"==typeof i[0]&&i[0].length>0?i[0]:void 0;return n({name:r},a&&{rdns:a})}},e.prototype.boundConnectorAttribution=function(e){var t=this;return function(){if(!t.disposed)try{return t.attributionForConnector(e,t.getState())}catch(e){return}}},e.prototype.nameForConnector=function(e,t){var r,n=S.get(e);if(n)return n;(t.current?null===(r=t.connections.get(t.current))||void 0===r?void 0:r.connector:void 0)===e&&this.kickWalletConnectPeerLookup(t);var i=e.name;return"string"==typeof i&&i.length>0?i:void 0},e.prototype.getConnectorName=function(e){if(e.current){var t=e.connections.get(e.current),r=null==t?void 0:t.connector;if(t&&r)return S.get(r)||(this.kickWalletConnectPeerLookup(e),r.name)}},e.prototype.wrapActiveConnectorProvider=function(e,t){var r,n,i,a=this;if(void 0===t&&(t=!1),!0===(null===(n=null===(r=this.formo.options)||void 0===r?void 0:r.wagmi)||void 0===n?void 0:n.eip1193Fallback)&&"connected"===e.status){var o=e.current?e.connections.get(e.current):void 0,s=null==o?void 0:o.connector;if(o&&"function"==typeof(null==s?void 0:s.getProvider)){var c=(null!==(i=this.wrapEpochs.get(s))&&void 0!==i?i:0)+1;this.wrapEpochs.set(s,c);var u=this.wrapSessionGeneration;t||this.wrapRetryCounts.delete(s);var l,d=function(){var e;if(!a.disposed&&a.wrapEpochs.get(s)===c){var t=(null!==(e=a.wrapRetryCounts.get(s))&&void 0!==e?e:0)+1;if(a.wrapRetryCounts.set(s,t),!(t>3)){var r=setTimeout(function(){var e;if(a.wrapRetryTimers.delete(r),!a.disposed){var t=a.getState();void 0!==t.current&&(null===(e=t.connections.get(t.current))||void 0===e?void 0:e.connector)===s&&a.wrapEpochs.get(s)===c&&a.wrapActiveConnectorProvider(t,!0)}},25*t);a.wrapRetryTimers.add(r)}}};try{l=s.getProvider()}catch(e){return void d()}l.then(function(e){var t,r,n,i;if(a.wrapEpochs.get(s)===c){var o=a.getState();if(!a.disposed&&a.wrapSessionGeneration===u&&"connected"===o.status&&void 0!==o.current&&(null===(t=o.connections.get(o.current))||void 0===t?void 0:t.connector)===s){var l=null!==(r=a.getActiveConnectionChainId(o))&&void 0!==r?r:o.chainId;!0===(null===(i=(n=a.formo)._wrapWagmiProvider)||void 0===i?void 0:i.call(n,e,"number"==typeof l?l:void 0,a.boundConnectorAttribution(s)))?(a.wrapRetryCounts.delete(s),a.fallbackConnector=s,a.fallbackProvider=e):d()}}}).catch(function(){d()})}}},e.prototype.kickWalletConnectPeerLookup=function(e){var t,r,n=e.current?e.connections.get(e.current):void 0,i=null==n?void 0:n.connector;if(n&&i&&"string"==typeof i.name&&/walletconnect/i.test(i.name)&&"function"==typeof i.getProvider&&!w.has(n)){w.add(n),E.get(i)!==n&&S.delete(i),E.set(i,n);var a=!1,o=setTimeout(function(){a||E.get(i)!==n||S.delete(i)},3e3);null===(r=(t=o).unref)||void 0===r||r.call(t),i.getProvider().then(function(e){if(a=!0,clearTimeout(o),E.get(i)===n){var t=(0,c.readWalletConnectPeer)(e);(null==t?void 0:t.name)?(S.set(i,t.name),s.logger.debug("WagmiEventHandler: WalletConnect peer resolved",{peer:t.name})):(S.delete(i),w.delete(n))}}).catch(function(){a=!0,clearTimeout(o),E.get(i)===n&&S.delete(i),w.delete(n)})}},e.prototype.cleanup=function(){if(this.wrapRetryTimers.forEach(function(e){return clearTimeout(e)}),this.wrapRetryTimers.clear(),s.logger.debug("WagmiEventHandler: Cleaning up subscriptions"),!this.disposed){this.disposed=!0,this.transitionGeneration+=1,this.ownerKey&&y.get(this.ownerKey)===this&&y.delete(this.ownerKey);var e=function(e){var r,n,i,a=Math.max(0,(null!==(r=v.get(e))&&void 0!==r?r:0)-1);v.set(e,a);var o=0===a;if(a>0||g.has(e))return o;var s=setTimeout(function(){g.delete(e);var t="".concat(e,":");h.forEach(function(e){e.startsWith(t)&&h.delete(e)})},t.MARKER_GRACE_MS);return null===(i=(n=s).unref)||void 0===i||i.call(n),g.set(e,s),o}(this.formo.writeKey);e&&this.ownerKey&&function(e){var r,n;if(!I.has(e)){var i=setTimeout(function(){I.delete(e),_.delete(e),C.delete(e)},t.MARKER_GRACE_MS);null===(n=(r=i).unref)||void 0===n||n.call(r),I.set(e,i)}}(this.ownerKey)}for(var r=0,n=this.unsubscribers;r<n.length;r++){var i=n[r];try{i()}catch(e){s.logger.error("WagmiEventHandler: Error during cleanup:",e)}}this.unsubscribers=[],this.processedMutations.clear(),this.processedQueries.clear(),s.logger.debug("WagmiEventHandler: Cleanup complete")},e}();t.WagmiEventHandler=x},5707(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.WagmiEventHandler=void 0;var n=r(8788);Object.defineProperty(t,"WagmiEventHandler",{enumerable:!0,get:function(){return n.WagmiEventHandler}})},5170(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.flattenObject=a,t.concatCalldataWithSuffix=function(e,t){if(!t||"0x"===t)return e;var r=s();if(null==r?void 0:r.concatHex)return r.concatHex([e,t]);var n=t.replace(/^0x/i,"");return"".concat(e).concat(n)},t.encodeWriteContractData=function(e,t,r){try{var n=s();return n?n.encodeFunctionData({abi:e,functionName:t,args:r||[]}):void i.logger.debug("WagmiEventHandler: viem not available, cannot encode function data")}catch(e){return void i.logger.warn("WagmiEventHandler: Failed to encode function data",e)}},t.extractFunctionArgs=function(e,t,r){if(e&&t&&r&&Array.isArray(r))try{var n=e.find(function(e){return"function"===e.type&&e.name===t});if(!(null==n?void 0:n.inputs)||!Array.isArray(n.inputs))return;var a={};return n.inputs.forEach(function(e,t){if(t<r.length){var n=r[t],i=e.name||"arg".concat(t);a[i]=o(n)}}),a}catch(e){return void i.logger.warn("WagmiEventHandler: Failed to extract function args",e)}},t.buildSafeFunctionArgs=function(e,t){if(e){for(var r={},n=0,o=Object.entries(e);n<o.length;n++){var s=o[n],c=s[0],u=s[1],l=c;if(t.has(c))do{l="arg_".concat(l)}while(l in e);if(r[l]=u,null!==u&&"object"==typeof u&&!Array.isArray(u))for(var d=a(u,l),h=0,f=Object.entries(d);h<f.length;h++){var p=f[h],v=p[0],g=p[1];v in r?i.logger.debug("WagmiEventHandler: Skipping flattened key collision",{flatKey:v,existingValue:r[v]}):r[v]=g}}return r}};var n,i=r(3312);function a(e,t){void 0===t&&(t="");for(var r={},n=0,i=Object.entries(e);n<i.length;n++){var o=i[n],s=o[0],c=o[1],u=t?"".concat(t,"_").concat(s):s;if(null===c||"object"!=typeof c||Array.isArray(c))r[u]=c;else{var l=a(c,u);Object.assign(r,l)}}return r}function o(e){if("bigint"==typeof e)return e.toString();if(Array.isArray(e))return e.map(o);if(null!==e&&"object"==typeof e){for(var t={},r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],a=i[0],s=i[1];t[a]=o(s)}return t}return e}function s(){if(void 0!==n)return n;try{var e=r(Object(function(){var e=new Error("Cannot find module 'viem'");throw e.code="MODULE_NOT_FOUND",e}()));if(null==e?void 0:e.encodeFunctionData)return n={encodeFunctionData:e.encodeFunctionData,concatHex:e.concatHex}}catch(e){}return n=null,null}},2690(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletStateStore=void 0;var i=r(49),a=r(6517),o=r(2257),s=r(3312),c=r(4657),u=r(9308),l=function(){function e(e){this.deps=e,this.state={evm:{},solana:{}},this.observationSeq=0,this.newestObservation={evm:0,solana:0},this.disconnectCount={evm:0,solana:0}}return Object.defineProperty(e.prototype,"activeNamespace",{get:function(){return this._activeNamespace},enumerable:!1,configurable:!0}),e.prototype.namespaceOf=function(e){return(0,u.isSolanaChainId)(e)?"solana":"evm"},Object.defineProperty(e.prototype,"evmAddress",{get:function(){return this.state.evm.address},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"evmChainId",{get:function(){return this.state.evm.chainId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"provider",{get:function(){return this.state.evm.provider},set:function(e){this.displaceProvider(this.state.evm.provider,e),this.state.evm.provider=e},enumerable:!1,configurable:!0}),e.prototype.observe=function(e){var t=++this.observationSeq;return this.newestObservation[e]=t,{id:t,namespace:e}},e.prototype.beginDisconnect=function(e){this.disconnectCount[e]++},e.prototype.disconnectsSoFar=function(e){return this.disconnectCount[e]},e.prototype.snapshot=function(e){return this.newestObservation[e]},e.prototype.isUnchangedSince=function(e,t){return this.newestObservation[e]===t},e.prototype.currentObservation=function(e){return{id:this.newestObservation[e],namespace:e}},e.prototype.isCurrent=function(e){return this.newestObservation[e.namespace]===e.id},e.prototype.set=function(e,t){var r="string"==typeof e?e:this.namespaceOf(e),n=this.state[r];"address"in t&&(n.address=t.address),"chainId"in t?n.chainId=t.chainId:"number"==typeof e&&(n.chainId=e),"evm"===r&&"provider"in t&&(this.displaceProvider(n.provider,t.provider),n.provider=t.provider),this._activeNamespace=r,this.syncDerived()},e.prototype.clear=function(e){"evm"===("string"==typeof e?e:this.namespaceOf(e))?(this.displaceProvider(this.state.evm.provider,void 0),this.state.evm={}):this.state.solana={},this.syncDerived()},e.prototype.reset=function(){var e=this.state.evm.provider;this.state={evm:{provider:e},solana:{}},this._activeNamespace=void 0,this.address=void 0,this.chainId=void 0},e.prototype.clearProvider=function(){this.provider=void 0},e.prototype.setActiveAddress=function(e){this.address=e,this.persist()},e.prototype.setActiveChainId=function(e){this.chainId=e,this.persist()},e.prototype.clearActiveChainId=function(){this.setActiveChainId(void 0)},e.prototype.syncWalletState=function(e){var t=e.chainId,r=e.address;if(this.observe(this.namespaceOf(t)),this.deps.isTrackingSuppressed()){if(!r)return void this.clearForChain(t);if(null==t)return;var n=this.namespaceOf(t),i=this.state[n].address,a=(0,c.validateAddress)(r,t);i&&a&&a!==i&&this.clear(t)}else if(r){if(null!=t){var o=(0,c.validateAddress)(r,t);o?this.set(t,{address:o}):s.logger.warn('syncWalletState: invalid address ("'.concat(r,'") for chain ').concat(t))}}else this.clearForChain(t)},e.prototype.backfill=function(e,t,r){if(r&&void 0!==t&&0!==t){var n=this.deps.providerChainId(r);void 0!==n&&n!==t&&(t=n)}if(!this.deps.isTrackingSuppressed()){var i=this.evmAddress;i?void 0!==t&&(0!==t||!this.evmChainId)&&i.toLowerCase()===e.toLowerCase()&&this.evmChainId!==t&&this.set("evm",{address:i,chainId:t}):this.set("evm",{address:e,chainId:t})}},e.prototype.clearStaleEvmWalletOnSwitchWhileSuppressed=function(e){var t=this.state.evm.address,r=(0,c.validateAndChecksumAddress)(e);t&&r&&r!==t&&this.clear("evm")},e.prototype.persist=function(){try{if(this.deps.isPersistedIdentityPurgeRequired())return void(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY);if(this.address){if(this.deps.isPageExcluded())return;var e=JSON.stringify(n({address:this.address},void 0!==this.chainId&&{chainId:this.chainId})),t=(0,o.getIdentityCookieDomain)(this.deps.crossSubdomainCookies());(0,a.cookie)().set(i.ACTIVE_WALLET_KEY,e,n(n({path:"/",expires:new Date(Date.now()+i.ACTIVE_WALLET_TTL_MS).toUTCString()},(0,o.getIdentityCookieSecurity)()),t?{domain:t}:{}))}else(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY)}catch(e){s.logger.warn("Failed to persist current wallet snapshot",e)}},e.prototype.load=function(){try{if(this.deps.isPersistedIdentityPurgeRequired())return void(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY);if(this.deps.isPageExcluded())return;var e=(0,a.cookie)().get(i.ACTIVE_WALLET_KEY);if(!e)return;var t=JSON.parse(e);if(!(null==t?void 0:t.address))return;var r=t.chainId,n=null==r;if(!(n||"number"==typeof r&&Number.isFinite(r)))return void(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY);var o=n?void 0:r,u=void 0===o?(0,c.validateAndChecksumAddress)(t.address)?"evm":"solana":this.namespaceOf(o),l=(0,c.validateAddress)(t.address,o);if(!l)return void(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY);var d=this.state[u];d.address=l,void 0!==o&&(d.chainId=o),this._activeNamespace=u,this.address=l,this.chainId=o}catch(e){s.logger.warn("Failed to restore persisted wallet snapshot",e),(0,a.cookie)().remove(i.ACTIVE_WALLET_KEY)}},e.prototype.clearForChain=function(e){null!=e?this.clear(e):(this.clear("evm"),this.clear("solana"))},e.prototype.displaceProvider=function(e,t){e&&e!==t&&this.deps.onProviderDisplaced(e)},e.prototype.syncDerived=function(){var e=this._activeNamespace;if(e){var t=this.state[e];if(t.address||t.chainId)return this.address=t.address,this.chainId=t.chainId,void this.persist()}var r="evm"===e?"solana":"evm",n=this.state[r];if(n.address||n.chainId)return this.address=n.address,this.chainId=n.chainId,this._activeNamespace=r,void this.persist();this.address=void 0,this.chainId=void 0,this.persist()},e}();t.WalletStateStore=l},9478(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.requestProviders=t.announceProvider=t.createStore=void 0;var n=r(4887);Object.defineProperty(t,"createStore",{enumerable:!0,get:function(){return n.createStore}});var i=r(8919);Object.defineProperty(t,"announceProvider",{enumerable:!0,get:function(){return i.announceProvider}}),Object.defineProperty(t,"requestProviders",{enumerable:!0,get:function(){return i.requestProviders}})},4887(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.createStore=void 0;const n=r(8919);t.createStore=function(){const e=new Set;let t=[];const r=()=>(0,n.requestProviders)(r=>{t.some(({info:e})=>e.uuid===r.info.uuid)||(t=[...t,r],e.forEach(e=>e(t,{added:[r]})))});let i=r();return{_listeners:()=>e,clear(){e.forEach(e=>e([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),i?.()},findProvider:({rdns:e})=>t.find(t=>t.info.rdns===e),getProviders:()=>t,reset(){this.clear(),i?.(),i=r()},subscribe:(r,{emitImmediately:n}={})=>(e.add(r),n&&r(t,{added:t}),()=>e.delete(r))}}},8919(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.requestProviders=t.announceProvider=void 0,t.announceProvider=function(e){const t=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(e)});window.dispatchEvent(t);const r=()=>window.dispatchEvent(t);return window.addEventListener("eip6963:requestProvider",r),()=>window.removeEventListener("eip6963:requestProvider",r)},t.requestProviders=function(e){if("undefined"==typeof window)return;const t=t=>e(t.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}}},t={},r=function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}(5135);return r.FormoAnalytics})());
3
3
  //# sourceMappingURL=index.umd.min.js.map