UNPKG

@web3auth/modal

Version:

Multi chain wallet aggregator for web3Auth

2 lines 3.46 MB
/*! For license information please see modal.umd.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Modal=t():e.Modal=t()}(self,()=>(()=>{var e,t,n={14:(e,t,n)=>{"use strict";n.d(t,{WH:()=>i,zb:()=>a,zl:()=>r});const r={GET_ACCOUNTS:"getAccounts",SOLANA_REQUEST_ACCOUNTS:"solana_requestAccounts",SEND_TRANSACTION:"solana_sendTransaction",SIGN_TRANSACTION:"solana_signTransaction",SIGN_ALL_TRANSACTIONS:"solana_signAllTransactions",SIGN_MESSAGE:"solana_signMessage",SOLANA_PRIVATE_KEY:"solana_privateKey",PRIVATE_KEY:"private_key",SOLANA_PUBLIC_KEY:"solana_publicKey",PUBLIC_KEY:"public_key"},i={SOLANA_MAINNET:"0x65",SOLANA_TESTNET:"0x66",SOLANA_DEVNET:"0x67"},a={GET_ACCOUNTS:"eth_accounts",ETH_TRANSACTION:"eth_sendTransaction",ETH_ESTIMATE_AA_TRANSACTION_GAS:"eth_estimateAATransactionGas",ETH_REQUEST_ACCOUNTS:"eth_requestAccounts",ETH_SEND_RAW_TRANSACTION:"eth_sendRawTransaction",ETH_SIGN:"eth_sign",ETH_SIGN_TYPED_DATA_V4:"eth_signTypedData_v4",PERSONAL_SIGN:"personal_sign",ETH_GET_TRANSACTION_COUNT:"eth_getTransactionCount",ETH_GET_TRANSACTION_BY_HASH:"eth_getTransactionByHash",ETH_GET_TRANSACTION_RECEIPT:"eth_getTransactionReceipt",WATCH_ASSET:"wallet_watchAsset",ETH_GET_BLOCK_BY_HASH:"eth_getBlockByHash",ETH_GET_CODE:"eth_getCode",ETH_GET_GAS_PRICE:"eth_gasPrice",ETH_PRIVATE_KEY:"eth_privateKey",PRIVATE_KEY:"private_key",ETH_PUBLIC_KEY:"eth_publicKey",PUBLIC_KEY:"public_key",SWITCH_CHAIN:"wallet_switchEthereumChain",ADD_CHAIN:"wallet_addEthereumChain"}},528:(e,t,n)=>{"use strict";var r,i=n(9629),a=n(29838),s=n(29110),o=n(61155),c=n(94943),l=n(5731),d=n(3468),u=n(32140),f=n(58479),p=n(18449),h=n(88129),b=n(22387),y=n(85865),m=n(1319),g=n(36882),w=Function,v=function(e){try{return w('"use strict"; return ('+e+").constructor;")()}catch(e){}},E=n(69336),x=n(64940),S=function(){throw new d},T=E?function(){try{return S}catch(e){try{return E(arguments,"callee").get}catch(e){return S}}}():S,_=n(53558)(),A=n(46369),k=n(17345),C=n(57859),I=n(6095),P=n(64531),O={},M="undefined"!=typeof Uint8Array&&A?A(Uint8Array):r,N={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":_&&A?A([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":O,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_&&A?A(A([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&_&&A?A((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":o,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&_&&A?A((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_&&A?A(""[Symbol.iterator]()):r,"%Symbol%":_?Symbol:r,"%SyntaxError%":l,"%ThrowTypeError%":T,"%TypedArray%":M,"%TypeError%":d,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":I,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":k,"%Math.abs%":f,"%Math.floor%":p,"%Math.max%":h,"%Math.min%":b,"%Math.pow%":y,"%Math.round%":m,"%Math.sign%":g,"%Reflect.getPrototypeOf%":C};if(A)try{null.error}catch(e){var R=A(A(e));N["%Error.prototype%"]=R}var L=function e(t){var n;if("%AsyncFunction%"===t)n=v("async function () {}");else if("%GeneratorFunction%"===t)n=v("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=v("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&A&&(n=A(i.prototype))}return N[t]=n,n},D={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},B=n(79138),j=n(78554),U=B.call(P,Array.prototype.concat),F=B.call(I,Array.prototype.splice),z=B.call(P,String.prototype.replace),$=B.call(P,String.prototype.slice),H=B.call(P,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,W=function(e,t){var n,r=e;if(j(D,r)&&(r="%"+(n=D[r])[0]+"%"),j(N,r)){var i=N[r];if(i===O&&(i=L(r)),void 0===i&&!t)throw new d("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new d("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new d('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=$(e,0,1),n=$(e,-1);if("%"===t&&"%"!==n)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var r=[];return z(e,q,function(e,t,n,i){r[r.length]=n?z(i,K,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",i=W("%"+r+"%",t),a=i.name,s=i.value,o=!1,c=i.alias;c&&(r=c[0],F(n,U([0,1],c)));for(var u=1,f=!0;u<n.length;u+=1){var p=n[u],h=$(p,0,1),b=$(p,-1);if(('"'===h||"'"===h||"`"===h||'"'===b||"'"===b||"`"===b)&&h!==b)throw new l("property names with quotes must have matching quotes");if("constructor"!==p&&f||(o=!0),j(N,a="%"+(r+="."+p)+"%"))s=N[a];else if(null!=s){if(!(p in s)){if(!t)throw new d("base intrinsic for "+e+" exists, but the property is not available.");return}if(E&&u+1>=n.length){var y=E(s,p);s=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:s[p]}else f=j(s,p),s=s[p];f&&!o&&(N[a]=s)}}return s}},600:(e,t,n)=>{"use strict";var r=n(70461).rotr32;function i(e,t,n){return e&t^~e&n}function a(e,t,n){return e&t^e&n^t&n}function s(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?i(t,n,r):1===e||3===e?s(t,n,r):2===e?a(t,n,r):void 0},t.ch32=i,t.maj32=a,t.p32=s,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},730:(e,t,n)=>{"use strict";n.d(t,{J9:()=>a,Mc:()=>i,fD:()=>r});const r={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},i={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},a={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}},1048:(e,t,n)=>{"use strict";const r=n(7991),i=n(39318),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|b(e,t);let r=o(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const i=function(e){if(c.isBuffer(e)){const t=0|h(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?o(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return d(e),o(e<0?0:0|h(e))}function f(e){const t=e.length<0?0:0|h(e.length),n=o(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function p(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,c.prototype),r}function h(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function b(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(i)return r?-1:W(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,r,i){let a,s=1,o=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,o/=2,c/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let r=-1;for(a=n;a<o;a++)if(l(e,a)===l(t,-1===r?0:a-r)){if(-1===r&&(r=a),a-r+1===c)return r*s}else-1!==r&&(a-=a-r),r=-1}else for(n+c>o&&(n=o-c),a=n;a>=0;a--){let n=!0;for(let r=0;r<c;r++)if(l(e,a+r)!==l(t,r)){n=!1;break}if(n)return a}return-1}function v(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const a=t.length;let s;for(r>a/2&&(r=a/2),s=0;s<r;++s){const r=parseInt(t.substr(2*s,2),16);if(J(r))return s;e[n+s]=r}return s}function E(e,t,n,r){return G(W(t,e.length-n),e,n,r)}function x(e,t,n,r){return G(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return G(V(t),e,n,r)}function T(e,t,n,r){return G(function(e,t){let n,r,i;const a=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function _(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let a=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=n){let n,r,o,c;switch(s){case 1:t<128&&(a=t);break;case 2:n=e[i+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],o=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&o)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&o,c>65535&&c<1114112&&(a=c))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=k));return n}(r)}t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,n){return function(e,t,n){return d(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},c.allocUnsafe=function(e){return u(e)},c.allocUnsafeSlow=function(e){return u(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=c.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(Y(t,Uint8Array))i+t.length>r.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},c.byteLength=b,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const o=Math.min(a,s),l=this.slice(r,i),d=e.slice(t,n);for(let e=0;e<o;++e)if(l[e]!==d[e]){a=l[e],s=d[e];break}return a<s?-1:s<a?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return E(this,e,t,n);case"ascii":case"latin1":case"binary":return x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function C(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function I(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function P(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=Z[e[r]];return i}function O(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function M(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function R(e,t,n,r,i){$(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function L(e,t,n,r,i){$(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function D(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,r,a){return t=+t,n>>>=0,a||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,a){return t=+t,n>>>=0,a||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Q(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),c.prototype.readBigUInt64BE=Q(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Q(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=Q(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Q(function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Q(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Q(function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Q(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},c.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const a=c.isBuffer(e)?e:c.from(e,r),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};const U={};function F(e,t,n){U[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function z(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function $(e,t,n,r,i,a){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=a>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(a+1)}${r}`:`>= -(2${r} ** ${8*(a+1)-1}${r}) and < 2 ** ${8*(a+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||q(t,e.length-(n+1))}(r,i,a)}function H(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,n){if(Math.floor(e)!==e)throw H(e,n),new U.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),F("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=z(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);const K=/[^+/0-9A-Za-z-_]/g;function W(e,t){let n;t=t||1/0;const r=e.length;let i=null;const a=[];for(let s=0;s<r;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Q(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},1113:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(30666);function i(e){const{authorization:t,factory:n,factoryData:i}=e;if("0x7702"===n||"0x7702000000000000000000000000000000000000"===n){if(!t)return"0x7702000000000000000000000000000000000000";const e=t.address;return(0,r.xW)([e,i??"0x"])}return n?(0,r.xW)([n,i??"0x"]):"0x"}},1319:e=>{"use strict";e.exports=Math.round},1740:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},2317:(e,t,n)=>{"use strict";n.d(t,{Rm:()=>s,_i:()=>a,fc:()=>o,mg:()=>c});var r=n(97702);const i=n.n(r)();function a(e){return i.decode(e)}function s(e){return i.encode(JSON.stringify(e))}const o=e=>{const t=window.document.createElement("template"),n=e.trim();return t.innerHTML=n,t.content.firstChild};function c(e){try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}},2439:(e,t,n)=>{"use strict";n.d(t,{F_:()=>g,Yc:()=>S,_S:()=>v,qb:()=>w,w:()=>x});var r=n(13360),i=n(1048).Buffer;const a=new r.ec("secp256k1"),s=globalThis.crypto||globalThis.msCrypto||{},o=s.subtle||s.webkitSubtle,c=i.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),l=i.alloc(32,0);function d(e,t){if(!e)throw new Error(t||"Assertion failed")}function u(e){return t=e,!(!i.isBuffer(t)||32!==t.length)&&e.compare(l)>0&&e.compare(c)<0;var t}function f(e){if(void 0===s.getRandomValues)return i.from(s.randomBytes(e));const t=new Uint8Array(e);return s.getRandomValues(t),i.from(t)}async function p(e){if(!s.createHash){const t=await o.digest("SHA-512",e);return new Uint8Array(t)}const t=s.createHash("sha512").update(e).digest();return new Uint8Array(t)}function h(e){return async function(t,n,r){if(o&&o[e]&&o.importKey){const a={name:"AES-CBC"},s=await o.importKey("raw",n,a,!1,[e]),c={name:"AES-CBC",iv:t},l=await o[e](c,s,r);return i.from(new Uint8Array(l))}if("encrypt"===e&&s.createCipheriv){const e=s.createCipheriv("aes-256-cbc",n,t),a=e.update(r),o=e.final();return i.concat([a,o])}if("decrypt"===e&&s.createDecipheriv){const e=s.createDecipheriv("aes-256-cbc",n,t),a=e.update(r),o=e.final();return i.concat([a,o])}throw new Error(`Unsupported operation: ${e}`)}}const b=h("encrypt"),y=h("decrypt");async function m(e,t){if(!s.createHmac){const n={name:"HMAC",hash:{name:"SHA-256"}},r=await o.importKey("raw",new Uint8Array(e),n,!1,["sign","verify"]),a=await o.sign("HMAC",r,t);return i.from(new Uint8Array(a))}const n=s.createHmac("sha256",i.from(e));return n.update(t),n.digest()}const g=function(){let e=f(32);for(;!u(e);)e=f(32);return e},w=function(e){return d(32===e.length,"Bad private key"),d(u(e),"Bad private key"),i.from(a.keyFromPrivate(e).getPublic("array"))},v=async function(e,t){return d(32===e.length,"Bad private key"),d(u(e),"Bad private key"),d(t.length>0,"Message should not be empty"),d(t.length<=32,"Message is too long"),i.from(a.sign(t,e,{canonical:!0}).toDER())},E=async function(e,t,n){d(i.isBuffer(e),"Bad private key"),d(i.isBuffer(t),"Bad public key"),d(32===e.length,"Bad private key"),d(u(e),"Bad private key"),d(65===t.length||33===t.length,"Bad public key"),65===t.length&&d(4===t[0],"Bad public key"),33===t.length&&d(2===t[0]||3===t[0],"Bad public key");const r=a.keyFromPrivate(e),s=a.keyFromPublic(t),o=r.derive(s.getPublic());return n?i.from(o.toString(16,64),"hex"):i.from(o.toArray())},x=async function(e,t,n){let r=(n=n||{}).ephemPrivateKey||f(32);for(;!u(r);)r=n.ephemPrivateKey||f(32);const a=w(r),s=await E(r,e,n.padding),o=await p(s),c=n.iv||f(16),l=o.slice(0,32),d=o.slice(32),h=await b(c,i.from(l),t),y=i.concat([c,a,h]);return{iv:c,ephemPublicKey:a,ciphertext:h,mac:await m(i.from(d),y)}},S=async function(e,t,n){const r=await E(e,t.ephemPublicKey,n),a=await p(r),s=a.slice(0,32),o=a.slice(32),c=i.concat([t.iv,t.ephemPublicKey,t.ciphertext]),l=await async function(e,t,n){return function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n}(await m(e,t),n)}(i.from(o),c,t.mac);if(!l&&!n)return S(e,t,!0);if(!l&&!0===n)throw new Error("bad MAC after trying padded");const d=await y(t.iv,i.from(s),t.ciphertext);return i.from(new Uint8Array(d))}},2483:(e,t,n)=>{"use strict";n.d(t,{Dv:()=>T,FO:()=>b,If:()=>E,Ji:()=>u,Rv:()=>c,WL:()=>h,Yo:()=>g,ej:()=>f,fC:()=>_,iB:()=>l,kz:()=>s,l9:()=>m,pc:()=>a,sP:()=>S,v7:()=>A,v8:()=>v});var r=n(66919);const i=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function a(e){return i.test(e)}function s(e){return(0,r.Yv)(i,e)}const o=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function c(e){return o.test(e)}function l(e){return(0,r.Yv)(o,e)}const d=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function u(e){return d.test(e)}function f(e){return(0,r.Yv)(d,e)}const p=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function h(e){return p.test(e)}function b(e){return(0,r.Yv)(p,e)}const y=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function m(e){return y.test(e)}function g(e){return(0,r.Yv)(y,e)}const w=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function v(e){return w.test(e)}function E(e){return(0,r.Yv)(w,e)}const x=/^receive\(\) external payable$/;function S(e){return x.test(e)}const T=new Set(["memory","indexed","storage","calldata"]),_=new Set(["indexed"]),A=new Set(["calldata","memory","storage"])},2522:(e,t,n)=>{"use strict";function r(){return(null===n.g||void 0===n.g?void 0:n.g.crypto)||(null===n.g||void 0===n.g?void 0:n.g.msCrypto)||{}}function i(){const e=r();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=r,t.getSubtleCrypto=i,t.isBrowserCryptoAvailable=function(){return!!r()&&!!i()}},2634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0,t.IWatch=class{}},3468:e=>{"use strict";e.exports=TypeError},3856:(e,t,n)=>{"use strict";n.d(t,{af:()=>o,yv:()=>s});var r=n(2439),i=n(15307),a=n(1048).Buffer;async function s(e,t){const n=JSON.stringify(t),i=a.from(n,"utf-8"),s=(o=await(0,r.w)((0,r.qb)(a.from(e,"hex")),i),{iv:a.from(o.iv).toString("hex"),ephemPublicKey:a.from(o.ephemPublicKey).toString("hex"),ciphertext:a.from(o.ciphertext).toString("hex"),mac:a.from(o.mac).toString("hex")});var o;return JSON.stringify(s)}async function o(e,t){const n=(c=JSON.parse(t),{iv:a.from(c.iv,"hex"),ephemPublicKey:a.from(c.ephemPublicKey,"hex"),ciphertext:a.from(c.ciphertext,"hex"),mac:a.from(c.mac,"hex")}),s=i.ec.keyFromPrivate(e),o=(await(0,r.Yc)(a.from(s.getPrivate().toString("hex",64),"hex"),n)).toString("utf-8");var c;return JSON.parse(o)}},3861:(e,t,n)=>{"use strict";n.d(t,{Bd:()=>y,EW:()=>S,Eo:()=>T,He:()=>m,Jy:()=>h,XL:()=>E,at:()=>w,ce:()=>u,dr:()=>v,is:()=>x,ks:()=>p,lX:()=>l,tP:()=>g,x8:()=>f,xG:()=>d,zr:()=>b});var r=n(95446),i=n(33890),a=n(65204),s=n(23553),o=n(26358),c=n(12361);const l=e=>("string"==typeof e||"number"==typeof e)&&/^(-)?0x[0-9a-f]*$/i.test(e),d=(e=c.Lr.SAPPHIRE_MAINNET)=>i.Q2[e],u=async({clientId:e,web3AuthNetwork:t,aaProvider:n,authBuildEnv:r})=>{const i=new URL(`${d(t)}/api/v2/configuration`);return i.searchParams.append("project_id",e),i.searchParams.append("network",t),r&&i.searchParams.append("build_env",r),n&&i.searchParams.append("aa_provider",n),await(0,a.Jt)(i.href)},f=async e=>await(0,a.Jt)(e||"https://assets.web3auth.io/v1/wallet-registry.json"),p=e=>{let t=e.toLowerCase();return t=t.split("|")[0],t=t.replace(/-/g," "),t=t.replace(/\s+/g," "),t=t.replace(/wallet$/i,"").trim(),t=t.replace(/\s/g,"-"),t},h=e=>{var t,n;return{chainNamespace:r.l.EIP155,chainId:`0x${e.id.toString(16)}`,rpcTarget:e.rpcUrls.default.http[0],displayName:e.name,blockExplorerUrl:(null===(t=e.blockExplorers)||void 0===t?void 0:t.default.url)||"",ticker:e.nativeCurrency.symbol,tickerName:e.nativeCurrency.name,logo:"",decimals:e.nativeCurrency.decimals,isTestnet:e.testnet,wsTarget:null===(n=e.rpcUrls.default.webSocket)||void 0===n?void 0:n[0]}};function b(e,t,n){return t?t.aborted?Promise.reject(new DOMException("Aborted","AbortError")):new Promise((r,i)=>{const a=()=>{null==n||n(),i(new DOMException("Aborted","AbortError"))};return t.addEventListener("abort",a),Promise.resolve().then(()=>e()).then(r,i).finally(()=>{t.removeEventListener("abort",a)})}):e()}const y=()=>"undefined"!=typeof window&&"undefined"!=typeof document,m=h,g=e=>{var t,n;return{whitelabel_app_name:null==e?void 0:e.appName,whitelabel_app_url:null==e?void 0:e.appUrl,whitelabel_logo_light_enabled:Boolean(null==e?void 0:e.logoLight),whitelabel_logo_dark_enabled:Boolean(null==e?void 0:e.logoDark),whitelabel_default_language:null==e?void 0:e.defaultLanguage,whitelabel_theme_mode:null==e?void 0:e.mode,whitelabel_use_logo_loader:null==e?void 0:e.useLogoLoader,whitelabel_theme_primary:null==e||null===(t=e.theme)||void 0===t?void 0:t.primary,whitelabel_theme_on_primary:null==e||null===(n=e.theme)||void 0===n?void 0:n.onPrimary,whitelabel_tnc_link_enabled:Boolean(null==e?void 0:e.tncLink),whitelabel_privacy_policy_enabled:Boolean(null==e?void 0:e.privacyPolicy)}},w=e=>{var t,n,i,a,s;const o=Array.from(new Set(null==e||null===(t=e.chains)||void 0===t?void 0:t.map(e=>{var t;return S(null===(t=e.bundlerConfig)||void 0===t?void 0:t.url)}).filter(Boolean))),c=Array.from(new Set(null==e||null===(n=e.chains)||void 0===n?void 0:n.map(e=>{var t;return S(null===(t=e.paymasterConfig)||void 0===t?void 0:t.url)}).filter(Boolean)));return{aa_smart_account_type:null==e?void 0:e.smartAccountType,aa_chain_ids:null==e||null===(i=e.chains)||void 0===i?void 0:i.map(e=>T({chainId:e.chainId,chainNamespace:r.l.EIP155})),aa_bundler_urls:o,aa_paymaster_urls:c,aa_paymaster_enabled:c.length>0,aa_paymaster_context_enabled:null==e||null===(a=e.chains)||void 0===a?void 0:a.some(e=>{var t;return null===(t=e.bundlerConfig)||void 0===t?void 0:t.paymasterContext}),aa_erc20_paymaster_enabled:null==e||null===(s=e.chains)||void 0===s?void 0:s.some(e=>{var t;return null===(t=e.bundlerConfig)||void 0===t||null===(t=t.paymasterContext)||void 0===t?void 0:t.token})}},v=e=>{var t,n,r,i,a,s,o,c,l,d,u;return{ws_confirmation_strategy:null==e?void 0:e.confirmationStrategy,ws_enable_key_export:null==e?void 0:e.enableKeyExport,ws_show_widget_button:null==e||null===(t=e.whiteLabel)||void 0===t?void 0:t.showWidgetButton,ws_button_position:null==e||null===(n=e.whiteLabel)||void 0===n?void 0:n.buttonPosition,ws_hide_nft_display:null==e||null===(r=e.whiteLabel)||void 0===r?void 0:r.hideNftDisplay,ws_hide_token_display:null==e||null===(i=e.whiteLabel)||void 0===i?void 0:i.hideTokenDisplay,ws_hide_transfers:null==e||null===(a=e.whiteLabel)||void 0===a?void 0:a.hideTransfers,ws_hide_topup:null==e||null===(s=e.whiteLabel)||void 0===s?void 0:s.hideTopup,ws_hide_receive:null==e||null===(o=e.whiteLabel)||void 0===o?void 0:o.hideReceive,ws_hide_swap:null==e||null===(c=e.whiteLabel)||void 0===c?void 0:c.hideSwap,ws_hide_show_all_tokens:null==e||null===(l=e.whiteLabel)||void 0===l?void 0:l.hideShowAllTokens,ws_hide_wallet_connect:null==e||null===(d=e.whiteLabel)||void 0===d?void 0:d.hideWalletConnect,ws_default_portfolio:null==e||null===(u=e.whiteLabel)||void 0===u?void 0:u.defaultPortfolio}},E="10.2.0",x=e=>{try{const t=e instanceof o.uF?e.code:null==e?void 0:e.code;return{error_message:e instanceof Error?e.message:(null==e?void 0:e.message)||(null==e?void 0:e.toString()),error_code:t}}catch{return{error_message:"Unknown error",error_code:void 0}}},S=e=>{try{return new URL(e).hostname}catch{return""}},T=e=>e.chainNamespace===r.l.EIP155?`${e.chainNamespace}:${parseInt(e.chainId,16)}`:e.chainNamespace===r.l.SOLANA?`${e.chainNamespace}:${s.Ah[e.chainId]}`:`${e.chainNamespace}:${e.chainId}`},4919:(e,t,n)=>{"use strict";n.d(t,{C6:()=>i,Cl:()=>a,Tt:()=>s,YH:()=>c,fX:()=>l,sH:()=>o});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function o(e,t,n,r){return new(n||(n=Promise))(function(i,a){function s(e){try{c(r.next(e))}cat