magic-sdk 13.4.1 → 14.0.0-b537cbc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/magic.js CHANGED
@@ -1,6 +1,577 @@
1
- "use strict";var Magic=(()=>{var Un=Object.create;var Ce=Object.defineProperty;var Bn=Object.getOwnPropertyDescriptor;var Fn=Object.getOwnPropertyNames,Xt=Object.getOwnPropertySymbols,Gn=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable;var qt=(e,t,n)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jt=(e,t)=>{for(var n in t||(t={}))zt.call(t,n)&&qt(e,n,t[n]);if(Xt)for(var n of Xt(t))jn.call(t,n)&&qt(e,n,t[n]);return e};var xe=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Qt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zt=(e,t)=>{for(var n in t)Ce(e,n,{get:t[n],enumerable:!0})},er=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Fn(t))!zt.call(e,s)&&s!==n&&Ce(e,s,{get:()=>t[s],enumerable:!(o=Bn(t,s))||o.enumerable});return e};var tr=(e,t,n)=>(n=e!=null?Un(Gn(e)):{},er(t||!e||!e.__esModule?Ce(n,"default",{value:e,enumerable:!0}):n,e)),kn=e=>er(Ce({},"__esModule",{value:!0}),e);var we=(e,t,n)=>new Promise((o,s)=>{var c=m=>{try{p(n.next(m))}catch(v){s(v)}},g=m=>{try{p(n.throw(m))}catch(v){s(v)}},p=m=>m.done?o(m.value):Promise.resolve(m.value).then(c,g);p((n=n.apply(e,t)).next())});var Fr=Qt((Br,Nt)=>{(function(e){if(typeof Br=="object"&&typeof Nt<"u")Nt.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return function o(s,c,g){function p(y,N){if(!c[y]){if(!s[y]){var I=typeof xe=="function"&&xe;if(!N&&I)return I(y,!0);if(m)return m(y,!0);var T=new Error("Cannot find module '"+y+"'");throw T.code="MODULE_NOT_FOUND",T}var P=c[y]={exports:{}};s[y][0].call(P.exports,function(B){var L=s[y][1][B];return p(L||B)},P,P.exports,o,s,c,g)}return c[y].exports}for(var m=typeof xe=="function"&&xe,v=0;v<g.length;v++)p(g[v]);return p}({1:[function(o,s,c){(function(g){"use strict";var p=g.MutationObserver||g.WebKitMutationObserver,m;if(p){var v=0,y=new p(B),N=g.document.createTextNode("");y.observe(N,{characterData:!0}),m=function(){N.data=v=++v%2}}else if(!g.setImmediate&&typeof g.MessageChannel<"u"){var I=new g.MessageChannel;I.port1.onmessage=B,m=function(){I.port2.postMessage(0)}}else"document"in g&&"onreadystatechange"in g.document.createElement("script")?m=function(){var G=g.document.createElement("script");G.onreadystatechange=function(){B(),G.onreadystatechange=null,G.parentNode.removeChild(G),G=null},g.document.documentElement.appendChild(G)}:m=function(){setTimeout(B,0)};var T,P=[];function B(){T=!0;for(var G,J,D=P.length;D;){for(J=P,P=[],G=-1;++G<D;)J[G]();D=P.length}T=!1}s.exports=L;function L(G){P.push(G)===1&&!T&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(o,s,c){"use strict";var g=o(1);function p(){}var m={},v=["REJECTED"],y=["FULFILLED"],N=["PENDING"];s.exports=I;function I(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=N,this.queue=[],this.outcome=void 0,S!==p&&L(this,S)}I.prototype.catch=function(S){return this.then(null,S)},I.prototype.then=function(S,j){if(typeof S!="function"&&this.state===y||typeof j!="function"&&this.state===v)return this;var x=new this.constructor(p);if(this.state!==N){var Y=this.state===y?S:j;P(x,Y,this.outcome)}else this.queue.push(new T(x,S,j));return x};function T(S,j,x){this.promise=S,typeof j=="function"&&(this.onFulfilled=j,this.callFulfilled=this.otherCallFulfilled),typeof x=="function"&&(this.onRejected=x,this.callRejected=this.otherCallRejected)}T.prototype.callFulfilled=function(S){m.resolve(this.promise,S)},T.prototype.otherCallFulfilled=function(S){P(this.promise,this.onFulfilled,S)},T.prototype.callRejected=function(S){m.reject(this.promise,S)},T.prototype.otherCallRejected=function(S){P(this.promise,this.onRejected,S)};function P(S,j,x){g(function(){var Y;try{Y=j(x)}catch(Q){return m.reject(S,Q)}Y===S?m.reject(S,new TypeError("Cannot resolve promise with itself")):m.resolve(S,Y)})}m.resolve=function(S,j){var x=G(B,j);if(x.status==="error")return m.reject(S,x.value);var Y=x.value;if(Y)L(S,Y);else{S.state=y,S.outcome=j;for(var Q=-1,ie=S.queue.length;++Q<ie;)S.queue[Q].callFulfilled(j)}return S},m.reject=function(S,j){S.state=v,S.outcome=j;for(var x=-1,Y=S.queue.length;++x<Y;)S.queue[x].callRejected(j);return S};function B(S){var j=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof j=="function")return function(){j.apply(S,arguments)}}function L(S,j){var x=!1;function Y(se){x||(x=!0,m.reject(S,se))}function Q(se){x||(x=!0,m.resolve(S,se))}function ie(){j(Q,Y)}var ae=G(ie);ae.status==="error"&&Y(ae.value)}function G(S,j){var x={};try{x.value=S(j),x.status="success"}catch(Y){x.status="error",x.value=Y}return x}I.resolve=J;function J(S){return S instanceof this?S:m.resolve(new this(p),S)}I.reject=D;function D(S){var j=new this(p);return m.reject(j,S)}I.all=pe;function pe(S){var j=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=S.length,Y=!1;if(!x)return this.resolve([]);for(var Q=new Array(x),ie=0,ae=-1,se=new this(p);++ae<x;)ce(S[ae],ae);return se;function ce(ye,d){j.resolve(ye).then(_,function(A){Y||(Y=!0,m.reject(se,A))});function _(A){Q[d]=A,++ie===x&&!Y&&(Y=!0,m.resolve(se,Q))}}}I.race=ne;function ne(S){var j=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=S.length,Y=!1;if(!x)return this.resolve([]);for(var Q=-1,ie=new this(p);++Q<x;)ae(S[Q]);return ie;function ae(se){j.resolve(se).then(function(ce){Y||(Y=!0,m.resolve(ie,ce))},function(ce){Y||(Y=!0,m.reject(ie,ce))})}}},{1:1}],3:[function(o,s,c){(function(g){"use strict";typeof g.Promise!="function"&&(g.Promise=o(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(o,s,c){"use strict";var g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function p(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var v=m();function y(){try{if(!v||!v.open)return!1;var r=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),a=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!r||a)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function N(r,a){r=r||[],a=a||{};try{return new Blob(r,a)}catch(u){if(u.name!=="TypeError")throw u;for(var i=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,l=new i,f=0;f<r.length;f+=1)l.append(r[f]);return l.getBlob(a.type)}}typeof Promise>"u"&&o(3);var I=Promise;function T(r,a){a&&r.then(function(i){a(null,i)},function(i){a(i)})}function P(r,a,i){typeof a=="function"&&r.then(a),typeof i=="function"&&r.catch(i)}function B(r){return typeof r!="string"&&(console.warn(r+" used as a key, but it is not a string."),r=String(r)),r}function L(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var G="local-forage-detect-blob-support",J=void 0,D={},pe=Object.prototype.toString,ne="readonly",S="readwrite";function j(r){for(var a=r.length,i=new ArrayBuffer(a),l=new Uint8Array(i),f=0;f<a;f++)l[f]=r.charCodeAt(f);return i}function x(r){return new I(function(a){var i=r.transaction(G,S),l=N([""]);i.objectStore(G).put(l,"key"),i.onabort=function(f){f.preventDefault(),f.stopPropagation(),a(!1)},i.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),u=navigator.userAgent.match(/Edge\//);a(u||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function Y(r){return typeof J=="boolean"?I.resolve(J):x(r).then(function(a){return J=a,J})}function Q(r){var a=D[r.name],i={};i.promise=new I(function(l,f){i.resolve=l,i.reject=f}),a.deferredOperations.push(i),a.dbReady?a.dbReady=a.dbReady.then(function(){return i.promise}):a.dbReady=i.promise}function ie(r){var a=D[r.name],i=a.deferredOperations.pop();if(i)return i.resolve(),i.promise}function ae(r,a){var i=D[r.name],l=i.deferredOperations.pop();if(l)return l.reject(a),l.promise}function se(r,a){return new I(function(i,l){if(D[r.name]=D[r.name]||Z(),r.db)if(a)Q(r),r.db.close();else return i(r.db);var f=[r.name];a&&f.push(r.version);var u=v.open.apply(v,f);a&&(u.onupgradeneeded=function(h){var E=u.result;try{E.createObjectStore(r.storeName),h.oldVersion<=1&&E.createObjectStore(G)}catch(b){if(b.name==="ConstraintError")console.warn('The database "'+r.name+'" has been upgraded from version '+h.oldVersion+" to version "+h.newVersion+', but the storage "'+r.storeName+'" already exists.');else throw b}}),u.onerror=function(h){h.preventDefault(),l(u.error)},u.onsuccess=function(){var h=u.result;h.onversionchange=function(E){E.target.close()},i(h),ie(r)}})}function ce(r){return se(r,!1)}function ye(r){return se(r,!0)}function d(r,a){if(!r.db)return!0;var i=!r.db.objectStoreNames.contains(r.storeName),l=r.version<r.db.version,f=r.version>r.db.version;if(l&&(r.version!==a&&console.warn('The database "'+r.name+`" can't be downgraded from version `+r.db.version+" to version "+r.version+"."),r.version=r.db.version),f||i){if(i){var u=r.db.version+1;u>r.version&&(r.version=u)}return!0}return!1}function _(r){return new I(function(a,i){var l=new FileReader;l.onerror=i,l.onloadend=function(f){var u=btoa(f.target.result||"");a({__local_forage_encoded_blob:!0,data:u,type:r.type})},l.readAsBinaryString(r)})}function A(r){var a=j(atob(r.data));return N([a],{type:r.type})}function M(r){return r&&r.__local_forage_encoded_blob}function $(r){var a=this,i=a._initReady().then(function(){var l=D[a._dbInfo.name];if(l&&l.dbReady)return l.dbReady});return P(i,r,r),i}function C(r){Q(r);for(var a=D[r.name],i=a.forages,l=0;l<i.length;l++){var f=i[l];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return r.db=null,ce(r).then(function(u){return r.db=u,d(r)?ye(r):u}).then(function(u){r.db=a.db=u;for(var h=0;h<i.length;h++)i[h]._dbInfo.db=u}).catch(function(u){throw ae(r,u),u})}function k(r,a,i,l){l===void 0&&(l=1);try{var f=r.db.transaction(r.storeName,a);i(null,f)}catch(u){if(l>0&&(!r.db||u.name==="InvalidStateError"||u.name==="NotFoundError"))return I.resolve().then(function(){if(!r.db||u.name==="NotFoundError"&&!r.db.objectStoreNames.contains(r.storeName)&&r.version<=r.db.version)return r.db&&(r.version=r.db.version+1),ye(r)}).then(function(){return C(r).then(function(){k(r,a,i,l-1)})}).catch(i);i(u)}}function Z(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function be(r){var a=this,i={db:null};if(r)for(var l in r)i[l]=r[l];var f=D[i.name];f||(f=Z(),D[i.name]=f),f.forages.push(a),a._initReady||(a._initReady=a.ready,a.ready=$);var u=[];function h(){return I.resolve()}for(var E=0;E<f.forages.length;E++){var b=f.forages[E];b!==a&&u.push(b._initReady().catch(h))}var R=f.forages.slice(0);return I.all(u).then(function(){return i.db=f.db,ce(i)}).then(function(w){return i.db=w,d(i,a._defaultConfig.version)?ye(i):w}).then(function(w){i.db=f.db=w,a._dbInfo=i;for(var O=0;O<R.length;O++){var F=R[O];F!==a&&(F._dbInfo.db=i.db,F._dbInfo.version=i.version)}})}function Ee(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){k(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),R=b.get(r);R.onsuccess=function(){var w=R.result;w===void 0&&(w=null),M(w)&&(w=A(w)),f(w)},R.onerror=function(){u(R.error)}}catch(w){u(w)}})}).catch(u)});return T(l,a),l}function $e(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){k(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),R=b.openCursor(),w=1;R.onsuccess=function(){var O=R.result;if(O){var F=O.value;M(F)&&(F=A(F));var W=r(F,O.key,w++);W!==void 0?f(W):O.continue()}else f()},R.onerror=function(){u(R.error)}}catch(O){u(O)}})}).catch(u)});return T(l,a),l}function kr(r,a,i){var l=this;r=B(r);var f=new I(function(u,h){var E;l.ready().then(function(){return E=l._dbInfo,pe.call(a)==="[object Blob]"?Y(E.db).then(function(b){return b?a:_(a)}):a}).then(function(b){k(l._dbInfo,S,function(R,w){if(R)return h(R);try{var O=w.objectStore(l._dbInfo.storeName);b===null&&(b=void 0);var F=O.put(b,r);w.oncomplete=function(){b===void 0&&(b=null),u(b)},w.onabort=w.onerror=function(){var W=F.error?F.error:F.transaction.error;h(W)}}catch(W){h(W)}})}).catch(h)});return T(f,i),f}function Wr(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){k(i._dbInfo,S,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),R=b.delete(r);E.oncomplete=function(){f()},E.onerror=function(){u(R.error)},E.onabort=function(){var w=R.error?R.error:R.transaction.error;u(w)}}catch(w){u(w)}})}).catch(u)});return T(l,a),l}function Yr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){k(a._dbInfo,S,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.clear();h.oncomplete=function(){l()},h.onabort=h.onerror=function(){var R=b.error?b.error:b.transaction.error;f(R)}}catch(R){f(R)}})}).catch(f)});return T(i,r),i}function Hr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){k(a._dbInfo,ne,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.count();b.onsuccess=function(){l(b.result)},b.onerror=function(){f(b.error)}}catch(R){f(R)}})}).catch(f)});return T(i,r),i}function Kr(r,a){var i=this,l=new I(function(f,u){if(r<0){f(null);return}i.ready().then(function(){k(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),R=!1,w=b.openKeyCursor();w.onsuccess=function(){var O=w.result;if(!O){f(null);return}r===0||R?f(O.key):(R=!0,O.advance(r))},w.onerror=function(){u(w.error)}}catch(O){u(O)}})}).catch(u)});return T(l,a),l}function Vr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){k(a._dbInfo,ne,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.openKeyCursor(),R=[];b.onsuccess=function(){var w=b.result;if(!w){l(R);return}R.push(w.key),w.continue()},b.onerror=function(){f(b.error)}}catch(w){f(w)}})}).catch(f)});return T(i,r),i}function Xr(r,a){a=L.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var l=this,f;if(!r.name)f=I.reject("Invalid arguments");else{var u=r.name===i.name&&l._dbInfo.db,h=u?I.resolve(l._dbInfo.db):ce(r).then(function(E){var b=D[r.name],R=b.forages;b.db=E;for(var w=0;w<R.length;w++)R[w]._dbInfo.db=E;return E});r.storeName?f=h.then(function(E){if(!!E.objectStoreNames.contains(r.storeName)){var b=E.version+1;Q(r);var R=D[r.name],w=R.forages;E.close();for(var O=0;O<w.length;O++){var F=w[O];F._dbInfo.db=null,F._dbInfo.version=b}var W=new I(function(H,q){var X=v.open(r.name,b);X.onerror=function(ue){var De=X.result;De.close(),q(ue)},X.onupgradeneeded=function(){var ue=X.result;ue.deleteObjectStore(r.storeName)},X.onsuccess=function(){var ue=X.result;ue.close(),H(ue)}});return W.then(function(H){R.db=H;for(var q=0;q<w.length;q++){var X=w[q];X._dbInfo.db=H,ie(X._dbInfo)}}).catch(function(H){throw(ae(r,H)||I.resolve()).catch(function(){}),H})}}):f=h.then(function(E){Q(r);var b=D[r.name],R=b.forages;E.close();for(var w=0;w<R.length;w++){var O=R[w];O._dbInfo.db=null}var F=new I(function(W,H){var q=v.deleteDatabase(r.name);q.onerror=function(){var X=q.result;X&&X.close(),H(q.error)},q.onblocked=function(){console.warn('dropInstance blocked for database "'+r.name+'" until all open connections are closed')},q.onsuccess=function(){var X=q.result;X&&X.close(),W(X)}});return F.then(function(W){b.db=W;for(var H=0;H<R.length;H++){var q=R[H];ie(q._dbInfo)}}).catch(function(W){throw(ae(r,W)||I.resolve()).catch(function(){}),W})})}return T(f,a),f}var qr={_driver:"asyncStorage",_initStorage:be,_support:y(),iterate:$e,getItem:Ee,setItem:kr,removeItem:Wr,clear:Yr,length:Hr,key:Kr,keys:Vr,dropInstance:Xr};function zr(){return typeof openDatabase=="function"}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jr="~~local_forage_type~",Ot=/^~~local_forage_type~([^~]+)~/,He="__lfsc__:",ut=He.length,ct="arbf",lt="blob",Lt="si08",Mt="ui08",$t="uic8",Pt="si16",Dt="si32",Ct="ur16",xt="ui32",Ut="fl32",Bt="fl64",Ft=ut+ct.length,Gt=Object.prototype.toString;function jt(r){var a=r.length*.75,i=r.length,l,f=0,u,h,E,b;r[r.length-1]==="="&&(a--,r[r.length-2]==="="&&a--);var R=new ArrayBuffer(a),w=new Uint8Array(R);for(l=0;l<i;l+=4)u=me.indexOf(r[l]),h=me.indexOf(r[l+1]),E=me.indexOf(r[l+2]),b=me.indexOf(r[l+3]),w[f++]=u<<2|h>>4,w[f++]=(h&15)<<4|E>>2,w[f++]=(E&3)<<6|b&63;return R}function ft(r){var a=new Uint8Array(r),i="",l;for(l=0;l<a.length;l+=3)i+=me[a[l]>>2],i+=me[(a[l]&3)<<4|a[l+1]>>4],i+=me[(a[l+1]&15)<<2|a[l+2]>>6],i+=me[a[l+2]&63];return a.length%3===2?i=i.substring(0,i.length-1)+"=":a.length%3===1&&(i=i.substring(0,i.length-2)+"=="),i}function Qr(r,a){var i="";if(r&&(i=Gt.call(r)),r&&(i==="[object ArrayBuffer]"||r.buffer&&Gt.call(r.buffer)==="[object ArrayBuffer]")){var l,f=He;r instanceof ArrayBuffer?(l=r,f+=ct):(l=r.buffer,i==="[object Int8Array]"?f+=Lt:i==="[object Uint8Array]"?f+=Mt:i==="[object Uint8ClampedArray]"?f+=$t:i==="[object Int16Array]"?f+=Pt:i==="[object Uint16Array]"?f+=Ct:i==="[object Int32Array]"?f+=Dt:i==="[object Uint32Array]"?f+=xt:i==="[object Float32Array]"?f+=Ut:i==="[object Float64Array]"?f+=Bt:a(new Error("Failed to get type for BinaryArray"))),a(f+ft(l))}else if(i==="[object Blob]"){var u=new FileReader;u.onload=function(){var h=Jr+r.type+"~"+ft(this.result);a(He+lt+h)},u.readAsArrayBuffer(r)}else try{a(JSON.stringify(r))}catch(h){console.error("Couldn't convert value into a JSON string: ",r),a(null,h)}}function Zr(r){if(r.substring(0,ut)!==He)return JSON.parse(r);var a=r.substring(Ft),i=r.substring(ut,Ft),l;if(i===lt&&Ot.test(a)){var f=a.match(Ot);l=f[1],a=a.substring(f[0].length)}var u=jt(a);switch(i){case ct:return u;case lt:return N([u],{type:l});case Lt:return new Int8Array(u);case Mt:return new Uint8Array(u);case $t:return new Uint8ClampedArray(u);case Pt:return new Int16Array(u);case Ct:return new Uint16Array(u);case Dt:return new Int32Array(u);case xt:return new Uint32Array(u);case Ut:return new Float32Array(u);case Bt:return new Float64Array(u);default:throw new Error("Unkown type: "+i)}}var dt={serialize:Qr,deserialize:Zr,stringToBuffer:jt,bufferToString:ft};function kt(r,a,i,l){r.executeSql("CREATE TABLE IF NOT EXISTS "+a.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,l)}function en(r){var a=this,i={db:null};if(r)for(var l in r)i[l]=typeof r[l]!="string"?r[l].toString():r[l];var f=new I(function(u,h){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(E){return h(E)}i.db.transaction(function(E){kt(E,i,function(){a._dbInfo=i,u()},function(b,R){h(R)})},h)});return i.serializer=dt,f}function ve(r,a,i,l,f,u){r.executeSql(i,l,f,function(h,E){E.code===E.SYNTAX_ERR?h.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[a.storeName],function(b,R){R.rows.length?u(b,E):kt(b,a,function(){b.executeSql(i,l,f,u)},u)},u):u(h,E)},u)}function tn(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT * FROM "+h.storeName+" WHERE key = ? LIMIT 1",[r],function(b,R){var w=R.rows.length?R.rows.item(0).value:null;w&&(w=h.serializer.deserialize(w)),f(w)},function(b,R){u(R)})})}).catch(u)});return T(l,a),l}function rn(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT * FROM "+h.storeName,[],function(b,R){for(var w=R.rows,O=w.length,F=0;F<O;F++){var W=w.item(F),H=W.value;if(H&&(H=h.serializer.deserialize(H)),H=r(H,W.key,F+1),H!==void 0){f(H);return}}f()},function(b,R){u(R)})})}).catch(u)});return T(l,a),l}function Wt(r,a,i,l){var f=this;r=B(r);var u=new I(function(h,E){f.ready().then(function(){a===void 0&&(a=null);var b=a,R=f._dbInfo;R.serializer.serialize(a,function(w,O){O?E(O):R.db.transaction(function(F){ve(F,R,"INSERT OR REPLACE INTO "+R.storeName+" (key, value) VALUES (?, ?)",[r,w],function(){h(b)},function(W,H){E(H)})},function(F){if(F.code===F.QUOTA_ERR){if(l>0){h(Wt.apply(f,[r,b,i,l-1]));return}E(F)}})})}).catch(E)});return T(u,i),u}function nn(r,a,i){return Wt.apply(this,[r,a,i,1])}function on(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"DELETE FROM "+h.storeName+" WHERE key = ?",[r],function(){f()},function(b,R){u(R)})})}).catch(u)});return T(l,a),l}function an(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"DELETE FROM "+u.storeName,[],function(){l()},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function sn(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"SELECT COUNT(key) as c FROM "+u.storeName,[],function(E,b){var R=b.rows.item(0).c;l(R)},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function un(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT key FROM "+h.storeName+" WHERE id = ? LIMIT 1",[r+1],function(b,R){var w=R.rows.length?R.rows.item(0).key:null;f(w)},function(b,R){u(R)})})}).catch(u)});return T(l,a),l}function cn(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"SELECT key FROM "+u.storeName,[],function(E,b){for(var R=[],w=0;w<b.rows.length;w++)R.push(b.rows.item(w).key);l(R)},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function ln(r){return new I(function(a,i){r.transaction(function(l){l.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,u){for(var h=[],E=0;E<u.rows.length;E++)h.push(u.rows.item(E).name);a({db:r,storeNames:h})},function(f,u){i(u)})},function(l){i(l)})})}function fn(r,a){a=L.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var l=this,f;return r.name?f=new I(function(u){var h;r.name===i.name?h=l._dbInfo.db:h=openDatabase(r.name,"","",0),r.storeName?u({db:h,storeNames:[r.storeName]}):u(ln(h))}).then(function(u){return new I(function(h,E){u.db.transaction(function(b){function R(W){return new I(function(H,q){b.executeSql("DROP TABLE IF EXISTS "+W,[],function(){H()},function(X,ue){q(ue)})})}for(var w=[],O=0,F=u.storeNames.length;O<F;O++)w.push(R(u.storeNames[O]));I.all(w).then(function(){h()}).catch(function(W){E(W)})},function(b){E(b)})})}):f=I.reject("Invalid arguments"),T(f,a),f}var dn={_driver:"webSQLStorage",_initStorage:en,_support:zr(),iterate:rn,getItem:tn,setItem:nn,removeItem:on,clear:an,length:sn,key:un,keys:cn,dropInstance:fn};function hn(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Yt(r,a){var i=r.name+"/";return r.storeName!==a.storeName&&(i+=r.storeName+"/"),i}function pn(){var r="_localforage_support_test";try{return localStorage.setItem(r,!0),localStorage.removeItem(r),!1}catch{return!0}}function mn(){return!pn()||localStorage.length>0}function vn(r){var a=this,i={};if(r)for(var l in r)i[l]=r[l];return i.keyPrefix=Yt(r,a._defaultConfig),mn()?(a._dbInfo=i,i.serializer=dt,I.resolve()):I.reject()}function gn(r){var a=this,i=a.ready().then(function(){for(var l=a._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var u=localStorage.key(f);u.indexOf(l)===0&&localStorage.removeItem(u)}});return T(i,r),i}function yn(r,a){var i=this;r=B(r);var l=i.ready().then(function(){var f=i._dbInfo,u=localStorage.getItem(f.keyPrefix+r);return u&&(u=f.serializer.deserialize(u)),u});return T(l,a),l}function En(r,a){var i=this,l=i.ready().then(function(){for(var f=i._dbInfo,u=f.keyPrefix,h=u.length,E=localStorage.length,b=1,R=0;R<E;R++){var w=localStorage.key(R);if(w.indexOf(u)===0){var O=localStorage.getItem(w);if(O&&(O=f.serializer.deserialize(O)),O=r(O,w.substring(h),b++),O!==void 0)return O}}});return T(l,a),l}function _n(r,a){var i=this,l=i.ready().then(function(){var f=i._dbInfo,u;try{u=localStorage.key(r)}catch{u=null}return u&&(u=u.substring(f.keyPrefix.length)),u});return T(l,a),l}function In(r){var a=this,i=a.ready().then(function(){for(var l=a._dbInfo,f=localStorage.length,u=[],h=0;h<f;h++){var E=localStorage.key(h);E.indexOf(l.keyPrefix)===0&&u.push(E.substring(l.keyPrefix.length))}return u});return T(i,r),i}function bn(r){var a=this,i=a.keys().then(function(l){return l.length});return T(i,r),i}function Rn(r,a){var i=this;r=B(r);var l=i.ready().then(function(){var f=i._dbInfo;localStorage.removeItem(f.keyPrefix+r)});return T(l,a),l}function wn(r,a,i){var l=this;r=B(r);var f=l.ready().then(function(){a===void 0&&(a=null);var u=a;return new I(function(h,E){var b=l._dbInfo;b.serializer.serialize(a,function(R,w){if(w)E(w);else try{localStorage.setItem(b.keyPrefix+r,R),h(u)}catch(O){(O.name==="QuotaExceededError"||O.name==="NS_ERROR_DOM_QUOTA_REACHED")&&E(O),E(O)}})})});return T(f,i),f}function An(r,a){if(a=L.apply(this,arguments),r=typeof r!="function"&&r||{},!r.name){var i=this.config();r.name=r.name||i.name,r.storeName=r.storeName||i.storeName}var l=this,f;return r.name?f=new I(function(u){r.storeName?u(Yt(r,l._defaultConfig)):u(r.name+"/")}).then(function(u){for(var h=localStorage.length-1;h>=0;h--){var E=localStorage.key(h);E.indexOf(u)===0&&localStorage.removeItem(E)}}):f=I.reject("Invalid arguments"),T(f,a),f}var Sn={_driver:"localStorageWrapper",_initStorage:vn,_support:hn(),iterate:En,getItem:yn,setItem:wn,removeItem:Rn,clear:gn,length:bn,key:_n,keys:In,dropInstance:An},Nn=function(a,i){return a===i||typeof a=="number"&&typeof i=="number"&&isNaN(a)&&isNaN(i)},Tn=function(a,i){for(var l=a.length,f=0;f<l;){if(Nn(a[f],i))return!0;f++}return!1},Ht=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"},Pe={},Kt={},Re={INDEXEDDB:qr,WEBSQL:dn,LOCALSTORAGE:Sn},On=[Re.INDEXEDDB._driver,Re.WEBSQL._driver,Re.LOCALSTORAGE._driver],Ke=["dropInstance"],ht=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ke),Ln={description:"",driver:On.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Mn(r,a){r[a]=function(){var i=arguments;return r.ready().then(function(){return r[a].apply(r,i)})}}function pt(){for(var r=1;r<arguments.length;r++){var a=arguments[r];if(a)for(var i in a)a.hasOwnProperty(i)&&(Ht(a[i])?arguments[0][i]=a[i].slice():arguments[0][i]=a[i])}return arguments[0]}var $n=function(){function r(a){p(this,r);for(var i in Re)if(Re.hasOwnProperty(i)){var l=Re[i],f=l._driver;this[i]=f,Pe[f]||this.defineDriver(l)}this._defaultConfig=pt({},Ln),this._config=pt({},this._defaultConfig,a),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return r.prototype.config=function(i){if((typeof i>"u"?"undefined":g(i))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var l in i){if(l==="storeName"&&(i[l]=i[l].replace(/\W/g,"_")),l==="version"&&typeof i[l]!="number")return new Error("Database version must be a number.");this._config[l]=i[l]}return"driver"in i&&i.driver?this.setDriver(this._config.driver):!0}else return typeof i=="string"?this._config[i]:this._config},r.prototype.defineDriver=function(i,l,f){var u=new I(function(h,E){try{var b=i._driver,R=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!i._driver){E(R);return}for(var w=ht.concat("_initStorage"),O=0,F=w.length;O<F;O++){var W=w[O],H=!Tn(Ke,W);if((H||i[W])&&typeof i[W]!="function"){E(R);return}}var q=function(){for(var De=function(Cn){return function(){var xn=new Error("Method "+Cn+" is not implemented by the current driver"),Vt=I.reject(xn);return T(Vt,arguments[arguments.length-1]),Vt}},mt=0,Dn=Ke.length;mt<Dn;mt++){var vt=Ke[mt];i[vt]||(i[vt]=De(vt))}};q();var X=function(De){Pe[b]&&console.info("Redefining LocalForage driver: "+b),Pe[b]=i,Kt[b]=De,h()};"_support"in i?i._support&&typeof i._support=="function"?i._support().then(X,E):X(!!i._support):X(!0)}catch(ue){E(ue)}});return P(u,l,f),u},r.prototype.driver=function(){return this._driver||null},r.prototype.getDriver=function(i,l,f){var u=Pe[i]?I.resolve(Pe[i]):I.reject(new Error("Driver not found."));return P(u,l,f),u},r.prototype.getSerializer=function(i){var l=I.resolve(dt);return P(l,i),l},r.prototype.ready=function(i){var l=this,f=l._driverSet.then(function(){return l._ready===null&&(l._ready=l._initDriver()),l._ready});return P(f,i,i),f},r.prototype.setDriver=function(i,l,f){var u=this;Ht(i)||(i=[i]);var h=this._getSupportedDrivers(i);function E(){u._config.driver=u.driver()}function b(O){return u._extend(O),E(),u._ready=u._initStorage(u._config),u._ready}function R(O){return function(){var F=0;function W(){for(;F<O.length;){var H=O[F];return F++,u._dbInfo=null,u._ready=null,u.getDriver(H).then(b).catch(W)}E();var q=new Error("No available storage method found.");return u._driverSet=I.reject(q),u._driverSet}return W()}}var w=this._driverSet!==null?this._driverSet.catch(function(){return I.resolve()}):I.resolve();return this._driverSet=w.then(function(){var O=h[0];return u._dbInfo=null,u._ready=null,u.getDriver(O).then(function(F){u._driver=F._driver,E(),u._wrapLibraryMethodsWithReady(),u._initDriver=R(h)})}).catch(function(){E();var O=new Error("No available storage method found.");return u._driverSet=I.reject(O),u._driverSet}),P(this._driverSet,l,f),this._driverSet},r.prototype.supports=function(i){return!!Kt[i]},r.prototype._extend=function(i){pt(this,i)},r.prototype._getSupportedDrivers=function(i){for(var l=[],f=0,u=i.length;f<u;f++){var h=i[f];this.supports(h)&&l.push(h)}return l},r.prototype._wrapLibraryMethodsWithReady=function(){for(var i=0,l=ht.length;i<l;i++)Mn(this,ht[i])},r.prototype.createInstance=function(i){return new r(i)},r}(),Pn=new $n;s.exports=Pn},{3:3}]},{},[4])(4)})});var jr=Qt((ot,Gr)=>{(function(e,t){typeof ot=="object"&&typeof Gr<"u"?t(ot):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],t):t(e.LocalforageDriverMemory={})})(typeof self<"u"?self:ot,function(e){"use strict";var t="localforage-driver-memory";function n(d){var _=typeof Symbol=="function"&&d[Symbol.iterator],A=0;return _?_.call(d):{next:function(){return d&&A>=d.length&&(d=void 0),{value:d&&d[A++],done:!d}}}}function o(d,_){d=d||[],_=_||{};try{return new Blob(d,_)}catch(C){if(C.name!=="TypeError")throw C;for(var A=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,M=new A,$=0;$<d.length;$+=1)M.append(d[$]);return M.getBlob(_.type)}}var s=/^~~local_forage_type~([^~]+)~/,c=9,g=c+4,p=Object.prototype.toString;function m(d){var _=d.length*.75,A=d.length;d[d.length-1]==="="&&(_--,d[d.length-2]==="="&&_--);for(var M=new ArrayBuffer(_),$=new Uint8Array(M),C=0,k=0;C<A;C+=4){var Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C]),be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C+1]),Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C+2]),$e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C+3]);$[k++]=Z<<2|be>>4,$[k++]=(be&15)<<4|Ee>>2,$[k++]=(Ee&3)<<6|$e&63}return M}function v(d){for(var _=new Uint8Array(d),A="",M=0;M<_.length;M+=3)A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[M]>>2],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[M]&3)<<4|_[M+1]>>4],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[M+1]&15)<<2|_[M+2]>>6],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[M+2]&63];return _.length%3===2?A=A.substring(0,A.length-1)+"=":_.length%3===1&&(A=A.substring(0,A.length-2)+"=="),A}function y(d,_){var A="";if(d&&(A=p.call(d)),d&&(A==="[object ArrayBuffer]"||d.buffer&&p.call(d.buffer)==="[object ArrayBuffer]")){var M=void 0,$="__lfsc__:";d instanceof ArrayBuffer?(M=d,$+="arbf"):(M=d.buffer,A==="[object Int8Array]"?$+="si08":A==="[object Uint8Array]"?$+="ui08":A==="[object Uint8ClampedArray]"?$+="uic8":A==="[object Int16Array]"?$+="si16":A==="[object Uint16Array]"?$+="ur16":A==="[object Int32Array]"?$+="si32":A==="[object Uint32Array]"?$+="ui32":A==="[object Float32Array]"?$+="fl32":A==="[object Float64Array]"?$+="fl64":_(new Error("Failed to get type for BinaryArray"))),_($+v(M))}else if(A==="[object Blob]"){var C=new FileReader;C.onload=function(){var k="~~local_forage_type~"+d.type+"~"+v(this.result);_("__lfsc__:blob"+k)},C.readAsArrayBuffer(d)}else try{_(JSON.stringify(d))}catch(k){console.error("Couldn't convert value into a JSON string: ",d),_(null,k)}}function N(d){if(d.substring(0,c)!=="__lfsc__:")return JSON.parse(d);var _=d.substring(g),A=d.substring(c,g),M;if(A==="blob"&&s.test(_)){var $=_.match(s);M=$[1],_=_.substring($[0].length)}var C=m(_);switch(A){case"arbf":return C;case"blob":return o([C],{type:M});case"si08":return new Int8Array(C);case"ui08":return new Uint8Array(C);case"uic8":return new Uint8ClampedArray(C);case"si16":return new Int16Array(C);case"ur16":return new Uint16Array(C);case"si32":return new Int32Array(C);case"ui32":return new Uint32Array(C);case"fl32":return new Float32Array(C);case"fl64":return new Float64Array(C);default:throw new Error("Unkown type: "+A)}}function I(d){var _,A;if(d===null||typeof d!="object"||"isActiveClone"in d)return d;var M=d instanceof Date?new Date(d):d.constructor();try{for(var $=n(Object.keys(d)),C=$.next();!C.done;C=$.next()){var k=C.value;Object.prototype.hasOwnProperty.call(d,k)&&(d.isActiveClone=null,M[k]=I(d[k]),delete d.isActiveClone)}}catch(Z){_={error:Z}}finally{try{C&&!C.done&&(A=$.return)&&A.call($)}finally{if(_)throw _.error}}return M}function T(d,_){return(d.name||_.name)+"/"+(d.storeName||_.storeName)+"/"}function P(d,_){_&&d.then(function(A){_(null,A)},function(A){_(A)})}function B(){for(var d=[],_=0;_<arguments.length;_++)d[_]=arguments[_];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function L(d,_){var A=this;if(_=B.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var M=this.config();d.name=d.name||M.name,d.storeName=d.storeName||M.storeName}var $;return d.name?$=new Promise(function(C){d.storeName?C(T(d,A._defaultConfig)):C(d.name+"/")}):$=Promise.reject("Invalid arguments"),{promise:$,callback:_}}function G(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}var J={bufferToString:v,deserialize:N,serialize:y,stringToBuffer:m},D={},pe=function(){function d(_){this.kp=_,this.data={}}return d.resolve=function(_){return D[_]||(D[_]=new d(_)),D[_]},d.prototype.clear=function(){this.data={}},d.prototype.drop=function(){this.clear(),delete D[this.kp]},d.prototype.get=function(_){return this.data[_]},d.prototype.key=function(_){return this.keys()[_]},d.prototype.keys=function(){return Object.keys(this.data)},d.prototype.rm=function(_){delete this.data[_]},d.prototype.set=function(_,A){this.data[_]=A},d}();function ne(d){var _=d?I(d):{},A=T(_,this._defaultConfig),M=pe.resolve(A);return this._dbInfo=_,this._dbInfo.serializer=J,this._dbInfo.keyPrefix=A,this._dbInfo.mStore=M,Promise.resolve()}function S(d){var _=this,A=this.ready().then(function(){_._dbInfo.mStore.clear()});return P(A,d),A}function j(d,_){var A=L.apply(this,arguments),M=A.promise,$=A.callback,C=M.then(function(k){pe.resolve(k).drop()});return P(C,$),M}function x(d,_){var A=this;d=G(d);var M=this.ready().then(function(){var $=A._dbInfo.mStore.get(d);return $==null?null:A._dbInfo.serializer.deserialize($)});return P(M,_),M}function Y(d,_){var A=this,M=this.ready().then(function(){for(var $=A._dbInfo.mStore,C=$.keys(),k=0;k<C.length;k++){var Z=$.get(C[k]);if(Z&&(Z=A._dbInfo.serializer.deserialize(Z)),Z=d(Z,C[k],k+1),Z!==void 0)return Z}});return P(M,_),M}function Q(d,_){var A=this,M=this.ready().then(function(){var $;try{$=A._dbInfo.mStore.key(d),$===void 0&&($=null)}catch{$=null}return $});return P(M,_),M}function ie(d){var _=this,A=this.ready().then(function(){return _._dbInfo.mStore.keys()});return P(A,d),A}function ae(d){var _=this.keys().then(function(A){return A.length});return P(_,d),_}function se(d,_){var A=this;d=G(d);var M=this.ready().then(function(){A._dbInfo.mStore.rm(d)});return P(M,_),M}function ce(d,_,A){var M=this;d=G(d);var $=this.ready().then(function(){_===void 0&&(_=null);var C=_;return new Promise(function(k,Z){M._dbInfo.serializer.serialize(_,function(be,Ee){if(Ee)Z(Ee);else try{M._dbInfo.mStore.set(d,be),k(C)}catch($e){Z($e)}})})});return P($,A),$}var ye=!0;e._support=ye,e._driver=t,e._initStorage=ne,e.clear=S,e.dropInstance=j,e.getItem=x,e.iterate=Y,e.key=Q,e.keys=ie,e.length=ae,e.removeItem=se,e.setItem=ce,Object.defineProperty(e,"__esModule",{value:!0})})});var Fo={};Zt(Fo,{default:()=>Bo});var le=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(le||{}),Ae=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(Ae||{}),Se=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(Se||{}),U=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e))(U||{}),fe=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e))(fe||{}),_e=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(_e||{}),rr=(e=>(e.Harmony="HARMONY",e))(rr||{});var Wn=Object.create,nt=Object.defineProperty,Yn=Object.defineProperties,Hn=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertyNames,nr=Object.getOwnPropertySymbols,Xn=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable,ir=(e,t,n)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yr=(e,t)=>{for(var n in t||(t={}))gr.call(t,n)&&ir(e,n,t[n]);if(nr)for(var n of nr(t))qn.call(t,n)&&ir(e,n,t[n]);return e},zn=(e,t)=>Yn(e,Kn(t)),Jn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qn=(e,t)=>{for(var n in t)nt(e,n,{get:t[n],enumerable:!0})},Zn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Vn(t))!gr.call(e,s)&&s!==n&&nt(e,s,{get:()=>t[s],enumerable:!(o=Hn(t,s))||o.enumerable});return e},ei=(e,t,n)=>(n=e!=null?Wn(Xn(e)):{},Zn(t||!e||!e.__esModule?nt(n,"default",{value:e,enumerable:!0}):n,e)),de=(e,t,n)=>new Promise((o,s)=>{var c=m=>{try{p(n.next(m))}catch(v){s(v)}},g=m=>{try{p(n.throw(m))}catch(v){s(v)}},p=m=>m.done?o(m.value):Promise.resolve(m.value).then(c,g);p((n=n.apply(e,t)).next())}),ti=Jn((e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty,o="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(o=!1));function c(v,y,N){this.fn=v,this.context=y,this.once=N||!1}function g(v,y,N,I,T){if(typeof N!="function")throw new TypeError("The listener must be a function");var P=new c(N,I||v,T),B=o?o+y:y;return v._events[B]?v._events[B].fn?v._events[B]=[v._events[B],P]:v._events[B].push(P):(v._events[B]=P,v._eventsCount++),v}function p(v,y){--v._eventsCount===0?v._events=new s:delete v._events[y]}function m(){this._events=new s,this._eventsCount=0}m.prototype.eventNames=function(){var v=[],y,N;if(this._eventsCount===0)return v;for(N in y=this._events)n.call(y,N)&&v.push(o?N.slice(1):N);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(y)):v},m.prototype.listeners=function(v){var y=o?o+v:v,N=this._events[y];if(!N)return[];if(N.fn)return[N.fn];for(var I=0,T=N.length,P=new Array(T);I<T;I++)P[I]=N[I].fn;return P},m.prototype.listenerCount=function(v){var y=o?o+v:v,N=this._events[y];return N?N.fn?1:N.length:0},m.prototype.emit=function(v,y,N,I,T,P){var B=o?o+v:v;if(!this._events[B])return!1;var L=this._events[B],G=arguments.length,J,D;if(L.fn){switch(L.once&&this.removeListener(v,L.fn,void 0,!0),G){case 1:return L.fn.call(L.context),!0;case 2:return L.fn.call(L.context,y),!0;case 3:return L.fn.call(L.context,y,N),!0;case 4:return L.fn.call(L.context,y,N,I),!0;case 5:return L.fn.call(L.context,y,N,I,T),!0;case 6:return L.fn.call(L.context,y,N,I,T,P),!0}for(D=1,J=new Array(G-1);D<G;D++)J[D-1]=arguments[D];L.fn.apply(L.context,J)}else{var pe=L.length,ne;for(D=0;D<pe;D++)switch(L[D].once&&this.removeListener(v,L[D].fn,void 0,!0),G){case 1:L[D].fn.call(L[D].context);break;case 2:L[D].fn.call(L[D].context,y);break;case 3:L[D].fn.call(L[D].context,y,N);break;case 4:L[D].fn.call(L[D].context,y,N,I);break;default:if(!J)for(ne=1,J=new Array(G-1);ne<G;ne++)J[ne-1]=arguments[ne];L[D].fn.apply(L[D].context,J)}}return!0},m.prototype.on=function(v,y,N){return g(this,v,y,N,!1)},m.prototype.once=function(v,y,N){return g(this,v,y,N,!0)},m.prototype.removeListener=function(v,y,N,I){var T=o?o+v:v;if(!this._events[T])return this;if(!y)return p(this,T),this;var P=this._events[T];if(P.fn)P.fn===y&&(!I||P.once)&&(!N||P.context===N)&&p(this,T);else{for(var B=0,L=[],G=P.length;B<G;B++)(P[B].fn!==y||I&&!P[B].once||N&&P[B].context!==N)&&L.push(P[B]);L.length?this._events[T]=L.length===1?L[0]:L:p(this,T)}return this},m.prototype.removeAllListeners=function(v){var y;return v?(y=o?o+v:v,this._events[y]&&p(this,y)):(this._events=new s,this._eventsCount=0),this},m.prototype.off=m.prototype.removeListener,m.prototype.addListener=m.prototype.on,m.prefixed=o,m.EventEmitter=m,typeof t<"u"&&(t.exports=m)});function ri(e){let t={exports:{}};return e(t,t.exports),t.exports}var ni=Number.MAX_SAFE_INTEGER||9007199254740991,_t={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:ni,MAX_SAFE_COMPONENT_LENGTH:16},ii=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},K=ii,We=ri(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n}=_t,o=(t=e.exports={}).re=[],s=t.src=[],c=t.t={},g=0,p=(m,v,y)=>{let N=g++;K(N,v),c[m]=N,s[N]=v,o[N]=new RegExp(v,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","[0-9]+"),p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),p("MAINVERSION",`(${s[c.NUMERICIDENTIFIER]})\\.(${s[c.NUMERICIDENTIFIER]})\\.(${s[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${s[c.NUMERICIDENTIFIERLOOSE]})\\.(${s[c.NUMERICIDENTIFIERLOOSE]})\\.(${s[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${s[c.NUMERICIDENTIFIER]}|${s[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${s[c.NUMERICIDENTIFIERLOOSE]}|${s[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${s[c.PRERELEASEIDENTIFIER]}(?:\\.${s[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${s[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER","[0-9A-Za-z-]+"),p("BUILD",`(?:\\+(${s[c.BUILDIDENTIFIER]}(?:\\.${s[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${s[c.MAINVERSION]}${s[c.PRERELEASE]}?${s[c.BUILD]}?`),p("FULL",`^${s[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${s[c.MAINVERSIONLOOSE]}${s[c.PRERELEASELOOSE]}?${s[c.BUILD]}?`),p("LOOSE",`^${s[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${s[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${s[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${s[c.XRANGEIDENTIFIER]})(?:\\.(${s[c.XRANGEIDENTIFIER]})(?:\\.(${s[c.XRANGEIDENTIFIER]})(?:${s[c.PRERELEASE]})?${s[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${s[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[c.XRANGEIDENTIFIERLOOSE]})(?:${s[c.PRERELEASELOOSE]})?${s[c.BUILD]}?)?)?`),p("XRANGE",`^${s[c.GTLT]}\\s*${s[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${s[c.GTLT]}\\s*${s[c.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",s[c.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${s[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${s[c.LONETILDE]}${s[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${s[c.LONETILDE]}${s[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${s[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${s[c.LONECARET]}${s[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${s[c.LONECARET]}${s[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${s[c.GTLT]}\\s*(${s[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${s[c.GTLT]}\\s*(${s[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${s[c.GTLT]}\\s*(${s[c.LOOSEPLAIN]}|${s[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${s[c.XRANGEPLAIN]})\\s+-\\s+(${s[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${s[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0.0.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),or=/^[0-9]+$/,Er=(e,t)=>{let n=or.test(e),o=or.test(t);return n&&o&&(e=+e,t=+t),e===t?0:n&&!o?-1:o&&!n?1:e<t?-1:1},oi=(e,t)=>Er(t,e),ai={compareIdentifiers:Er,rcompareIdentifiers:oi},{MAX_LENGTH:ar,MAX_SAFE_INTEGER:Ve}=_t,{re:sr,t:ur}=We,{compareIdentifiers:Ue}=ai,ee=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>ar)throw new TypeError(`version is longer than ${ar} characters`);K("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?sr[ur.LOOSE]:sr[ur.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ve||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ve||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ve||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<Ve)return s}return o}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(K("SemVer.compare",this.version,this.options,e),!(e instanceof ee)){if(typeof e=="string"&&e===this.version)return 0;e=new ee(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ee||(e=new ee(e,this.options)),Ue(this.major,e.major)||Ue(this.minor,e.minor)||Ue(this.patch,e.patch)}comparePre(e){if(e instanceof ee||(e=new ee(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],o=e.prerelease[t];if(K("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return Ue(n,o)}while(++t)}compareBuild(e){e instanceof ee||(e=new ee(e,this.options));let t=0;do{let n=this.build[t],o=e.build[t];if(K("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return Ue(n,o)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},si=(e,t,n)=>new ee(e,n).compare(new ee(t,n)),Le=si,ui=(e,t,n)=>Le(e,t,n)===0,ci=ui,li=(e,t,n)=>Le(e,t,n)!==0,fi=li,di=(e,t,n)=>Le(e,t,n)>0,hi=di,pi=(e,t,n)=>Le(e,t,n)>=0,mi=pi,vi=(e,t,n)=>Le(e,t,n)<0,gi=vi,yi=(e,t,n)=>Le(e,t,n)<=0,Ei=yi,_i=(e,t,n,o)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return ci(e,n,o);case"!=":return fi(e,n,o);case">":return hi(e,n,o);case">=":return mi(e,n,o);case"<":return gi(e,n,o);case"<=":return Ei(e,n,o);default:throw new TypeError(`Invalid operator: ${t}`)}},gt=_i,Be=Symbol("SemVer ANY"),Ge=class{static get ANY(){return Be}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Ge){if(e.loose===!!t.loose)return e;e=e.value}K("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Be?this.value="":this.value=this.operator+this.semver.version,K("comp",this)}parse(e){let t=this.options.loose?cr[lr.COMPARATORLOOSE]:cr[lr.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new ee(n[2],this.options.loose):this.semver=Be}toString(){return this.value}test(e){if(K("Comparator.test",e,this.options.loose),this.semver===Be||e===Be)return!0;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}return gt(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ge))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new Te(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new Te(this.value,t).test(e.semver);let n=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),o=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),s=this.semver.version===e.semver.version,c=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),g=gt(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),p=gt(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||o||s&&c||g||p}},{re:cr,t:lr}=We,Te=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Te)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Te(e.raw,t);if(e instanceof Ge)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?re[te.HYPHENRANGELOOSE]:re[te.HYPHENRANGE];e=e.replace(n,Pi(this.options.includePrerelease)),K("hyphen replace",e),e=e.replace(re[te.COMPARATORTRIM],Ii),K("comparator trim",e,re[te.COMPARATORTRIM]),e=(e=(e=e.replace(re[te.TILDETRIM],bi)).replace(re[te.CARETTRIM],Ri)).split(/\s+/).join(" ");let o=t?re[te.COMPARATORLOOSE]:re[te.COMPARATOR];return e.split(" ").map(s=>wi(s,this.options)).join(" ").split(/\s+/).map(s=>$i(s,this.options)).filter(this.options.loose?s=>!!s.match(o):()=>!0).map(s=>new Ge(s,this.options))}intersects(e,t){if(!(e instanceof Te))throw new TypeError("a Range is required");return this.set.some(n=>fr(n,t)&&e.set.some(o=>fr(o,t)&&n.every(s=>o.every(c=>s.intersects(c,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Di(this.set[t],e,this.options))return!0;return!1}},{re,t:te,comparatorTrimReplace:Ii,tildeTrimReplace:bi,caretTrimReplace:Ri}=We,fr=(e,t)=>{let n=!0,o=e.slice(),s=o.pop();for(;n&&o.length;)n=o.every(c=>s.intersects(c,t)),s=o.pop();return n},wi=(e,t)=>(K("comp",e,t),e=Ni(e,t),K("caret",e),e=Ai(e,t),K("tildes",e),e=Oi(e,t),K("xrange",e),e=Mi(e,t),K("stars",e),e),oe=e=>!e||e.toLowerCase()==="x"||e==="*",Ai=(e,t)=>e.trim().split(/\s+/).map(n=>Si(n,t)).join(" "),Si=(e,t)=>{let n=t.loose?re[te.TILDELOOSE]:re[te.TILDE];return e.replace(n,(o,s,c,g,p)=>{let m;return K("tilde",e,o,s,c,g,p),oe(s)?m="":oe(c)?m=`>=${s}.0.0 <${+s+1}.0.0-0`:oe(g)?m=`>=${s}.${c}.0 <${s}.${+c+1}.0-0`:p?(K("replaceTilde pr",p),m=`>=${s}.${c}.${g}-${p} <${s}.${+c+1}.0-0`):m=`>=${s}.${c}.${g} <${s}.${+c+1}.0-0`,K("tilde return",m),m})},Ni=(e,t)=>e.trim().split(/\s+/).map(n=>Ti(n,t)).join(" "),Ti=(e,t)=>{K("caret",e,t);let n=t.loose?re[te.CARETLOOSE]:re[te.CARET],o=t.includePrerelease?"-0":"";return e.replace(n,(s,c,g,p,m)=>{let v;return K("caret",e,s,c,g,p,m),oe(c)?v="":oe(g)?v=`>=${c}.0.0${o} <${+c+1}.0.0-0`:oe(p)?v=c==="0"?`>=${c}.${g}.0${o} <${c}.${+g+1}.0-0`:`>=${c}.${g}.0${o} <${+c+1}.0.0-0`:m?(K("replaceCaret pr",m),v=c==="0"?g==="0"?`>=${c}.${g}.${p}-${m} <${c}.${g}.${+p+1}-0`:`>=${c}.${g}.${p}-${m} <${c}.${+g+1}.0-0`:`>=${c}.${g}.${p}-${m} <${+c+1}.0.0-0`):(K("no pr"),v=c==="0"?g==="0"?`>=${c}.${g}.${p}${o} <${c}.${g}.${+p+1}-0`:`>=${c}.${g}.${p}${o} <${c}.${+g+1}.0-0`:`>=${c}.${g}.${p} <${+c+1}.0.0-0`),K("caret return",v),v})},Oi=(e,t)=>(K("replaceXRanges",e,t),e.split(/\s+/).map(n=>Li(n,t)).join(" ")),Li=(e,t)=>{e=e.trim();let n=t.loose?re[te.XRANGELOOSE]:re[te.XRANGE];return e.replace(n,(o,s,c,g,p,m)=>{K("xRange",e,o,s,c,g,p,m);let v=oe(c),y=v||oe(g),N=y||oe(p),I=N;return s==="="&&I&&(s=""),m=t.includePrerelease?"-0":"",v?o=s===">"||s==="<"?"<0.0.0-0":"*":s&&I?(y&&(g=0),p=0,s===">"?(s=">=",y?(c=+c+1,g=0,p=0):(g=+g+1,p=0)):s==="<="&&(s="<",y?c=+c+1:g=+g+1),s==="<"&&(m="-0"),o=`${s+c}.${g}.${p}${m}`):y?o=`>=${c}.0.0${m} <${+c+1}.0.0-0`:N&&(o=`>=${c}.${g}.0${m} <${c}.${+g+1}.0-0`),K("xRange return",o),o})},Mi=(e,t)=>(K("replaceStars",e,t),e.trim().replace(re[te.STAR],"")),$i=(e,t)=>(K("replaceGTE0",e,t),e.trim().replace(re[t.includePrerelease?te.GTE0PRE:te.GTE0],"")),Pi=e=>(t,n,o,s,c,g,p,m,v,y,N,I,T)=>`${n=oe(o)?"":oe(s)?`>=${o}.0.0${e?"-0":""}`:oe(c)?`>=${o}.${s}.0${e?"-0":""}`:g?`>=${n}`:`>=${n}${e?"-0":""}`} ${m=oe(v)?"":oe(y)?`<${+v+1}.0.0-0`:oe(N)?`<${v}.${+y+1}.0-0`:I?`<=${v}.${y}.${N}-${I}`:e?`<${v}.${y}.${+N+1}-0`:`<=${m}`}`.trim(),Di=(e,t,n)=>{for(let o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let o=0;o<e.length;o++)if(K(e[o].semver),e[o].semver!==Ge.ANY&&e[o].semver.prerelease.length>0){let s=e[o].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0},Ci=(e,t,n)=>{try{t=new Te(t,n)}catch(o){return!1}return t.test(e)},{MAX_LENGTH:xi}=_t,{re:dr,t:hr}=We,Ui=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee)return e;if(typeof e!="string"||e.length>xi||!(t.loose?dr[hr.LOOSE]:dr[hr.FULL]).test(e))return null;try{return new ee(e,t)}catch(n){return null}},Bi=Ui,{re:Xe,t:qe}=We,Fi=(e,t)=>{if(e instanceof ee)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let n=null;if((t=t||{}).rtl){let o;for(;(o=Xe[qe.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&o.index+o[0].length===n.index+n[0].length||(n=o),Xe[qe.COERCERTL].lastIndex=o.index+o[1].length+o[2].length;Xe[qe.COERCERTL].lastIndex=-1}else n=e.match(Xe[qe.COERCE]);return n===null?null:Bi(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function Gi(e){return String.fromCharCode(parseInt(e.slice(1),16))}function ji(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function ki(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,Gi))}function Wi(e){return decodeURIComponent(Array.from(atob(e),ji).join(""))}function _r(e){return ki(JSON.stringify(e))}function Yi(e){return JSON.parse(Wi(e))}function Fe(e){return typeof e=="undefined"}function Hi(e){return e===null}function Ir(e){return Hi(e)||Fe(e)}function Ki(e){return Ir(e)?!1:!Fe(e.jsonrpc)&&!Fe(e.id)&&(!Fe(e.result)||!Fe(e.error))}function Vi(e){return Ir(e)?!1:typeof e=="number"&&Object.values(Se).includes(e)}function yt(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var z={};function br(e,t){return Object.assign(z,t),e}var Xi={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},he=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,he.prototype)}},Oe=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=Vi(t)?t:Se.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,Object.setPrototypeOf(this,Oe.prototype)}},Ye=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},it=class extends Error{constructor(e,t,n,o){super(`Magic Extension Error (${e.name}): [${t}] ${n}`),this.code=t,this.rawMessage=n,this.data=o,this.__proto__=Error,Object.setPrototypeOf(this,it.prototype)}},Ze=class{constructor(e,t,n){this.code=t,this.rawMessage=n,this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`}log(){console.warn(this.message)}};function qi(){return new he(le.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Rr(){return new he(le.ModalNotReady,"Modal is not ready.")}function zi(){return new he(le.MalformedResponse,"Response from the Magic iframe is malformed.")}function Ji(e){return new he(le.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Qi(e){let t=`Some extensions are incompatible with \`${z.sdkName}@${z.version}\`:`;return e.filter(n=>typeof n.compat!="undefined"&&n.compat!==null).forEach(n=>{let o=n.compat[z.sdkName];typeof o=="string"?t+=`
2
- - Extension \`${n.name}\` supports version(s) \`${o}\``:o||(t+=`
3
- - Extension \`${n.name}\` does not support ${z.platform} environments.`)}),new he(le.IncompatibleExtensions,t)}function Zi(e){let t=n=>{let o=n+1,s=o%10,c=o%100;return s===1&&c!==11?`${o}st`:s===2&&c!==12?`${o}nd`:s===3&&c!==13?`${o}rd`:`${o}th`};return new he(le.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
1
+ "use strict";var Magic=(()=>{var TK=Object.create;var pl=Object.defineProperty;var kK=Object.getOwnPropertyDescriptor;var PK=Object.getOwnPropertyNames,kS=Object.getOwnPropertySymbols,NK=Object.getPrototypeOf,NS=Object.prototype.hasOwnProperty,qK=Object.prototype.propertyIsEnumerable;var PS=(e,t,r)=>t in e?pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qS=(e,t)=>{for(var r in t||(t={}))NS.call(t,r)&&PS(e,r,t[r]);if(kS)for(var r of kS(t))qK.call(t,r)&&PS(e,r,t[r]);return e};var vl=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var yt=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mr=(e,t)=>{for(var r in t)pl(e,r,{get:t[r],enumerable:!0})},rp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of PK(t))!NS.call(e,i)&&i!==r&&pl(e,i,{get:()=>t[i],enumerable:!(n=kK(t,i))||n.enumerable});return e},rr=(e,t,r)=>(rp(e,t,"default"),r&&rp(r,t,"default")),Hr=(e,t,r)=>(r=e!=null?TK(NK(e)):{},rp(t||!e||!e.__esModule?pl(r,"default",{value:e,enumerable:!0}):r,e)),Pt=e=>rp(pl({},"__esModule",{value:!0}),e);var zu=(e,t,r)=>new Promise((n,i)=>{var o=v=>{try{c(r.next(v))}catch(y){i(y)}},a=v=>{try{c(r.throw(v))}catch(y){i(y)}},c=v=>v.done?n(v.value):Promise.resolve(v.value).then(o,a);c((r=r.apply(e,t)).next())});var BS=E(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.getLocalStorage=ar.getLocalStorageOrThrow=ar.getCrypto=ar.getCryptoOrThrow=ar.getLocation=ar.getLocationOrThrow=ar.getNavigator=ar.getNavigatorOrThrow=ar.getDocument=ar.getDocumentOrThrow=ar.getFromWindowOrThrow=ar.getFromWindow=void 0;function ca(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}ar.getFromWindow=ca;function Ku(e){let t=ca(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}ar.getFromWindowOrThrow=Ku;function LK(){return Ku("document")}ar.getDocumentOrThrow=LK;function BK(){return ca("document")}ar.getDocument=BK;function DK(){return Ku("navigator")}ar.getNavigatorOrThrow=DK;function jK(){return ca("navigator")}ar.getNavigator=jK;function FK(){return Ku("location")}ar.getLocationOrThrow=FK;function UK(){return ca("location")}ar.getLocation=UK;function HK(){return Ku("crypto")}ar.getCryptoOrThrow=HK;function WK(){return ca("crypto")}ar.getCrypto=WK;function zK(){return Ku("localStorage")}ar.getLocalStorageOrThrow=zK;function VK(){return ca("localStorage")}ar.getLocalStorage=VK});var jS=E(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.getWindowMetadata=void 0;var DS=BS();function $K(){let e,t;try{e=DS.getDocumentOrThrow(),t=DS.getLocationOrThrow()}catch{return null}function r(){let M=e.getElementsByTagName("link"),S=[];for(let R=0;R<M.length;R++){let C=M[R],B=C.getAttribute("rel");if(B&&B.toLowerCase().indexOf("icon")>-1){let N=C.getAttribute("href");if(N)if(N.toLowerCase().indexOf("https:")===-1&&N.toLowerCase().indexOf("http:")===-1&&N.indexOf("//")!==0){let q=t.protocol+"//"+t.host;if(N.indexOf("/")===0)q+=N;else{let H=t.pathname.split("/");H.pop(),q+=H.join("/")+"/"+N}S.push(q)}else if(N.indexOf("//")===0){let q=t.protocol+N;S.push(q)}else S.push(N)}}return S}function n(...M){let S=e.getElementsByTagName("meta");for(let R=0;R<S.length;R++){let C=S[R],B=["itemprop","property","name"].map(N=>C.getAttribute(N)).filter(N=>N?M.includes(N):!1);if(B.length&&B){let N=C.getAttribute("content");if(N)return N}}return""}function i(){let M=n("name","og:site_name","og:title","twitter:title");return M||(M=e.title),M}function o(){return n("description","og:description","twitter:description","keywords")}let a=i(),c=o(),v=t.origin,y=r();return{description:c,url:v,icons:y,name:a}}np.getWindowMetadata=$K});var FS=E(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.getLocalStorage=ur.getLocalStorageOrThrow=ur.getCrypto=ur.getCryptoOrThrow=ur.getLocation=ur.getLocationOrThrow=ur.getNavigator=ur.getNavigatorOrThrow=ur.getDocument=ur.getDocumentOrThrow=ur.getFromWindowOrThrow=ur.getFromWindow=void 0;function la(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}ur.getFromWindow=la;function Gu(e){let t=la(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}ur.getFromWindowOrThrow=Gu;function KK(){return Gu("document")}ur.getDocumentOrThrow=KK;function GK(){return la("document")}ur.getDocument=GK;function ZK(){return Gu("navigator")}ur.getNavigatorOrThrow=ZK;function YK(){return la("navigator")}ur.getNavigator=YK;function JK(){return Gu("location")}ur.getLocationOrThrow=JK;function QK(){return la("location")}ur.getLocation=QK;function XK(){return Gu("crypto")}ur.getCryptoOrThrow=XK;function eG(){return la("crypto")}ur.getCrypto=eG;function tG(){return Gu("localStorage")}ur.getLocalStorageOrThrow=tG;function rG(){return la("localStorage")}ur.getLocalStorage=rG});function zS(e){return e?WS(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new uG:typeof navigator<"u"?WS(navigator.userAgent):pG()}function hG(e){return e!==""&&lG.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1)}function WS(e){var t=hG(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new aG;var i=n[1]&&n[1].split(/[._]/).slice(0,3);i?i.length<US&&(i=nG(i,vG(US-i.length))):i=[];var o=i.join("."),a=dG(e),c=cG.exec(e);return c&&c[1]?new sG(r,o,a,c[1]):new iG(r,o,a)}function dG(e){for(var t=0,r=HS.length;t<r;t++){var n=HS[t],i=n[0],o=n[1],a=o.exec(e);if(a)return i}return null}function pG(){var e=typeof process<"u"&&process.version;return e?new oG(process.version.slice(1)):null}function vG(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var nG,iG,oG,sG,aG,uG,fG,cG,US,lG,HS,VS=yt(()=>{nG=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],a=0,c=o.length;a<c;a++,i++)n[i]=o[a];return n},iG=function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e}(),oG=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),sG=function(){function e(t,r,n,i){this.name=t,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return e}(),aG=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),uG=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),fG=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,cG=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,US=3,lG=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",fG]],HS=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});function ml(e){return zS(e)}function ip(){let e=ml();return e&&e.os?e.os:void 0}function KS(){let e=ip();return e?e.toLowerCase().includes("android"):!1}function GS(){let e=ip();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function sy(){return ip()?KS()||GS():!1}function ZS(){let e=ml();return e&&e.name?e.name.toLowerCase()==="node":!1}function ay(){return!ZS()&&!!YS()}function op(){return $S.getWindowMetadata()}var $S,mr,uy,mG,gG,bG,yG,YS,_G,fy,wG,xG,MG,gl,cy=yt(()=>{$S=Hr(jS()),mr=Hr(FS());VS();uy=mr.getFromWindow,mG=mr.getFromWindowOrThrow,gG=mr.getDocumentOrThrow,bG=mr.getDocument,yG=mr.getNavigatorOrThrow,YS=mr.getNavigator,_G=mr.getLocationOrThrow,fy=mr.getLocation,wG=mr.getCryptoOrThrow,xG=mr.getCrypto,MG=mr.getLocalStorageOrThrow,gl=mr.getLocalStorage});function JS(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function QS(e){return typeof e=="string"?e:JSON.stringify(e)}var XS=yt(()=>{});var ly,hy,dy=yt(()=>{XS();ly=JS,hy=QS});function bl(e,t){let r=hy(t),n=gl();n&&n.setItem(e,r)}function yl(e){let t=null,r=null,n=gl();return n&&(r=n.getItem(e)),t=r&&ly(r),t}function _l(e){let t=gl();t&&t.removeItem(e)}var py=yt(()=>{dy();cy()});function EG(e,t){let r=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${r}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function AG(e){let t=e.href.split("?")[0];bl(wl,Object.assign(Object.assign({},e),{href:t}))}function eE(e,t){return e.filter(r=>r.name.toLowerCase().includes(t.toLowerCase()))[0]}function OG(e,t){let r=e;return t&&(r=t.map(n=>eE(e,n)).filter(Boolean)),r}var wl,tE=yt(()=>{py();wl="WALLETCONNECT_DEEPLINK_CHOICE"});function RG(){return rE+"/api/v2/wallets"}function IG(){return rE+"/api/v2/dapps"}function nE(e,t="mobile"){var r;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(r=e.image_url.sm)!==null&&r!==void 0?r:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}function CG(e,t="mobile"){return Object.values(e).filter(r=>!!r[t].universal||!!r[t].native).map(r=>nE(r,t))}var rE,iE=yt(()=>{rE="https://registry.walletconnect.com"});var oE={};Mr(oE,{detectEnv:()=>ml,detectOS:()=>ip,formatIOSMobile:()=>EG,formatMobileRegistry:()=>CG,formatMobileRegistryEntry:()=>nE,getClientMeta:()=>op,getCrypto:()=>xG,getCryptoOrThrow:()=>wG,getDappRegistryUrl:()=>IG,getDocument:()=>bG,getDocumentOrThrow:()=>gG,getFromWindow:()=>uy,getFromWindowOrThrow:()=>mG,getLocal:()=>yl,getLocalStorage:()=>gl,getLocalStorageOrThrow:()=>MG,getLocation:()=>fy,getLocationOrThrow:()=>_G,getMobileLinkRegistry:()=>OG,getMobileRegistryEntry:()=>eE,getNavigator:()=>YS,getNavigatorOrThrow:()=>yG,getWalletRegistryUrl:()=>RG,isAndroid:()=>KS,isBrowser:()=>ay,isIOS:()=>GS,isMobile:()=>sy,isNode:()=>ZS,mobileLinkChoiceKey:()=>wl,removeLocal:()=>_l,safeJsonParse:()=>ly,safeJsonStringify:()=>hy,saveMobileLinkInfo:()=>AG,setLocal:()=>bl});var vy=yt(()=>{cy();dy();py();tE();iE()});var AE={};Mr(AE,{Buffer:()=>_e,INSPECT_MAX_BYTES:()=>pE,SlowBuffer:()=>UG,isBuffer:()=>Qi,kMaxLength:()=>LG});function lE(){gy=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)Yi[t]=e[t],ui[e.charCodeAt(t)]=t;ui["-".charCodeAt(0)]=62,ui["_".charCodeAt(0)]=63}function kG(e){gy||lE();var t,r,n,i,o,a,c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[c-2]==="="?2:e[c-1]==="="?1:0,a=new TG(c*3/4-o),n=o>0?c-4:c;var v=0;for(t=0,r=0;t<n;t+=4,r+=3)i=ui[e.charCodeAt(t)]<<18|ui[e.charCodeAt(t+1)]<<12|ui[e.charCodeAt(t+2)]<<6|ui[e.charCodeAt(t+3)],a[v++]=i>>16&255,a[v++]=i>>8&255,a[v++]=i&255;return o===2?(i=ui[e.charCodeAt(t)]<<2|ui[e.charCodeAt(t+1)]>>4,a[v++]=i&255):o===1&&(i=ui[e.charCodeAt(t)]<<10|ui[e.charCodeAt(t+1)]<<4|ui[e.charCodeAt(t+2)]>>2,a[v++]=i>>8&255,a[v++]=i&255),a}function PG(e){return Yi[e>>18&63]+Yi[e>>12&63]+Yi[e>>6&63]+Yi[e&63]}function NG(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(PG(n));return i.join("")}function uE(e){gy||lE();for(var t,r=e.length,n=r%3,i="",o=[],a=16383,c=0,v=r-n;c<v;c+=a)o.push(NG(e,c,c+a>v?v:c+a));return n===1?(t=e[r-1],i+=Yi[t>>2],i+=Yi[t<<4&63],i+="=="):n===2&&(t=(e[r-2]<<8)+e[r-1],i+=Yi[t>>10],i+=Yi[t>>4&63],i+=Yi[t<<2&63],i+="="),o.push(i),o.join("")}function up(e,t,r,n,i){var o,a,c=i*8-n-1,v=(1<<c)-1,y=v>>1,w=-7,M=r?i-1:0,S=r?-1:1,R=e[t+M];for(M+=S,o=R&(1<<-w)-1,R>>=-w,w+=c;w>0;o=o*256+e[t+M],M+=S,w-=8);for(a=o&(1<<-w)-1,o>>=-w,w+=n;w>0;a=a*256+e[t+M],M+=S,w-=8);if(o===0)o=1-y;else{if(o===v)return a?NaN:(R?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-y}return(R?-1:1)*a*Math.pow(2,o-n)}function hE(e,t,r,n,i,o){var a,c,v,y=o*8-i-1,w=(1<<y)-1,M=w>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=n?0:o-1,C=n?1:-1,B=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=w):(a=Math.floor(Math.log(t)/Math.LN2),t*(v=Math.pow(2,-a))<1&&(a--,v*=2),a+M>=1?t+=S/v:t+=S*Math.pow(2,1-M),t*v>=2&&(a++,v/=2),a+M>=w?(c=0,a=w):a+M>=1?(c=(t*v-1)*Math.pow(2,i),a=a+M):(c=t*Math.pow(2,M-1)*Math.pow(2,i),a=0));i>=8;e[r+R]=c&255,R+=C,c/=256,i-=8);for(a=a<<i|c,y+=i;y>0;e[r+R]=a&255,R+=C,a/=256,y-=8);e[r+R-C]|=B*128}function sp(){return _e.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function No(e,t){if(sp()<t)throw new RangeError("Invalid typed array length");return _e.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=_e.prototype):(e===null&&(e=new _e(t)),e.length=t),e}function _e(e,t,r){if(!_e.TYPED_ARRAY_SUPPORT&&!(this instanceof _e))return new _e(e,t,r);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return by(this,e)}return vE(this,e,t,r)}function vE(e,t,r,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?jG(e,t,r,n):typeof t=="string"?DG(e,t,r):FG(e,t)}function mE(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function BG(e,t,r,n){return mE(t),t<=0?No(e,t):r!==void 0?typeof n=="string"?No(e,t).fill(r,n):No(e,t).fill(r):No(e,t)}function by(e,t){if(mE(t),e=No(e,t<0?0:yy(t)|0),!_e.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function DG(e,t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!_e.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=gE(t,r)|0;e=No(e,n);var i=e.write(t,r);return i!==n&&(e=e.slice(0,i)),e}function my(e,t){var r=t.length<0?0:yy(t.length)|0;e=No(e,r);for(var n=0;n<r;n+=1)e[n]=t[n]&255;return e}function jG(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,r):t=new Uint8Array(t,r,n),_e.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=_e.prototype):e=my(e,t),e}function FG(e,t){if(Ji(t)){var r=yy(t.length)|0;return e=No(e,r),e.length===0||t.copy(e,0,0,r),e}if(t){if(typeof ArrayBuffer<"u"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||sZ(t.length)?No(e,0):my(e,t);if(t.type==="Buffer"&&dE(t.data))return my(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function yy(e){if(e>=sp())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+sp().toString(16)+" bytes");return e|0}function UG(e){return+e!=e&&(e=0),_e.alloc(+e)}function Ji(e){return!!(e!=null&&e._isBuffer)}function gE(e,t){if(Ji(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var r=e.length;if(r===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ap(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return SE(e).length;default:if(n)return ap(e).length;t=(""+t).toLowerCase(),n=!0}}function HG(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return QG(this,t,r);case"utf8":case"utf-8":return _E(this,t,r);case"ascii":return YG(this,t,r);case"latin1":case"binary":return JG(this,t,r);case"base64":return GG(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return XG(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function ha(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bE(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=_e.from(t,n)),Ji(t))return t.length===0?-1:fE(e,t,r,n,i);if(typeof t=="number")return t=t&255,_e.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):fE(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function fE(e,t,r,n,i){var o=1,a=e.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,r/=2}function v(R,C){return o===1?R[C]:R.readUInt16BE(C*o)}var y;if(i){var w=-1;for(y=r;y<a;y++)if(v(e,y)===v(t,w===-1?0:y-w)){if(w===-1&&(w=y),y-w+1===c)return w*o}else w!==-1&&(y-=y-w),w=-1}else for(r+c>a&&(r=a-c),y=r;y>=0;y--){for(var M=!0,S=0;S<c;S++)if(v(e,y+S)!==v(t,S)){M=!1;break}if(M)return y}return-1}function WG(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(t.substr(a*2,2),16);if(isNaN(c))return a;e[r+a]=c}return a}function zG(e,t,r,n){return lp(ap(t,e.length-r),e,r,n)}function yE(e,t,r,n){return lp(iZ(t),e,r,n)}function VG(e,t,r,n){return yE(e,t,r,n)}function $G(e,t,r,n){return lp(SE(t),e,r,n)}function KG(e,t,r,n){return lp(oZ(t,e.length-r),e,r,n)}function GG(e,t,r){return t===0&&r===e.length?uE(e):uE(e.slice(t,r))}function _E(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var v,y,w,M;switch(c){case 1:o<128&&(a=o);break;case 2:v=e[i+1],(v&192)===128&&(M=(o&31)<<6|v&63,M>127&&(a=M));break;case 3:v=e[i+1],y=e[i+2],(v&192)===128&&(y&192)===128&&(M=(o&15)<<12|(v&63)<<6|y&63,M>2047&&(M<55296||M>57343)&&(a=M));break;case 4:v=e[i+1],y=e[i+2],w=e[i+3],(v&192)===128&&(y&192)===128&&(w&192)===128&&(M=(o&15)<<18|(v&63)<<12|(y&63)<<6|w&63,M>65535&&M<1114112&&(a=M))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return ZG(n)}function ZG(e){var t=e.length;if(t<=cE)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=cE));return r}function YG(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function JG(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function QG(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=nZ(e[o]);return i}function XG(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function Wr(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function Fn(e,t,r,n,i,o){if(!Ji(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function fp(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function cp(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>(n?i:3-i)*8&255}function wE(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function xE(e,t,r,n,i){return i||wE(e,t,r,4),hE(e,t,r,n,23,4),r+4}function ME(e,t,r,n,i){return i||wE(e,t,r,8),hE(e,t,r,n,52,8),r+8}function tZ(e){if(e=rZ(e).replace(eZ,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function rZ(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function nZ(e){return e<16?"0"+e.toString(16):e.toString(16)}function ap(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function iZ(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function oZ(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function SE(e){return kG(tZ(e))}function lp(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function sZ(e){return e!==e}function Qi(e){return e!=null&&(!!e._isBuffer||EE(e)||aZ(e))}function EE(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function aZ(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&EE(e.slice(0,0))}var Yi,ui,TG,gy,qG,dE,pE,LG,cE,eZ,da=yt(()=>{Yi=[],ui=[],TG=typeof Uint8Array<"u"?Uint8Array:Array,gy=!1;qG={}.toString,dE=Array.isArray||function(e){return qG.call(e)=="[object Array]"};pE=50;_e.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;LG=sp();_e.poolSize=8192;_e._augment=function(e){return e.__proto__=_e.prototype,e};_e.from=function(e,t,r){return vE(null,e,t,r)};_e.TYPED_ARRAY_SUPPORT&&(_e.prototype.__proto__=Uint8Array.prototype,_e.__proto__=Uint8Array);_e.alloc=function(e,t,r){return BG(null,e,t,r)};_e.allocUnsafe=function(e){return by(null,e)};_e.allocUnsafeSlow=function(e){return by(null,e)};_e.isBuffer=Qi;_e.compare=function(t,r){if(!Ji(t)||!Ji(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(t[o]!==r[o]){n=t[o],i=r[o];break}return n<i?-1:i<n?1:0};_e.isEncoding=function(t){switch(String(t).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}};_e.concat=function(t,r){if(!dE(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return _e.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=_e.allocUnsafe(r),o=0;for(n=0;n<t.length;++n){var a=t[n];if(!Ji(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};_e.byteLength=gE;_e.prototype._isBuffer=!0;_e.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)ha(this,r,r+1);return this};_e.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)ha(this,r,r+3),ha(this,r+1,r+2);return this};_e.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)ha(this,r,r+7),ha(this,r+1,r+6),ha(this,r+2,r+5),ha(this,r+3,r+4);return this};_e.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?_E(this,0,t):HG.apply(this,arguments)};_e.prototype.equals=function(t){if(!Ji(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:_e.compare(this,t)===0};_e.prototype.inspect=function(){var t="",r=pE;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"};_e.prototype.compare=function(t,r,n,i,o){if(!Ji(t))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var a=o-i,c=n-r,v=Math.min(a,c),y=this.slice(i,o),w=t.slice(r,n),M=0;M<v;++M)if(y[M]!==w[M]){a=y[M],c=w[M];break}return a<c?-1:c<a?1:0};_e.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};_e.prototype.indexOf=function(t,r,n){return bE(this,t,r,n,!0)};_e.prototype.lastIndexOf=function(t,r,n){return bE(this,t,r,n,!1)};_e.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return WG(this,t,r,n);case"utf8":case"utf-8":return zG(this,t,r,n);case"ascii":return yE(this,t,r,n);case"latin1":case"binary":return VG(this,t,r,n);case"base64":return $G(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return KG(this,t,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};_e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};cE=4096;_e.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i;if(_e.TYPED_ARRAY_SUPPORT)i=this.subarray(t,r),i.__proto__=_e.prototype;else{var o=r-t;i=new _e(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i};_e.prototype.readUIntLE=function(t,r,n){t=t|0,r=r|0,n||Wr(t,r,this.length);for(var i=this[t],o=1,a=0;++a<r&&(o*=256);)i+=this[t+a]*o;return i};_e.prototype.readUIntBE=function(t,r,n){t=t|0,r=r|0,n||Wr(t,r,this.length);for(var i=this[t+--r],o=1;r>0&&(o*=256);)i+=this[t+--r]*o;return i};_e.prototype.readUInt8=function(t,r){return r||Wr(t,1,this.length),this[t]};_e.prototype.readUInt16LE=function(t,r){return r||Wr(t,2,this.length),this[t]|this[t+1]<<8};_e.prototype.readUInt16BE=function(t,r){return r||Wr(t,2,this.length),this[t]<<8|this[t+1]};_e.prototype.readUInt32LE=function(t,r){return r||Wr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};_e.prototype.readUInt32BE=function(t,r){return r||Wr(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};_e.prototype.readIntLE=function(t,r,n){t=t|0,r=r|0,n||Wr(t,r,this.length);for(var i=this[t],o=1,a=0;++a<r&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};_e.prototype.readIntBE=function(t,r,n){t=t|0,r=r|0,n||Wr(t,r,this.length);for(var i=r,o=1,a=this[t+--i];i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};_e.prototype.readInt8=function(t,r){return r||Wr(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};_e.prototype.readInt16LE=function(t,r){r||Wr(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};_e.prototype.readInt16BE=function(t,r){r||Wr(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};_e.prototype.readInt32LE=function(t,r){return r||Wr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};_e.prototype.readInt32BE=function(t,r){return r||Wr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};_e.prototype.readFloatLE=function(t,r){return r||Wr(t,4,this.length),up(this,t,!0,23,4)};_e.prototype.readFloatBE=function(t,r){return r||Wr(t,4,this.length),up(this,t,!1,23,4)};_e.prototype.readDoubleLE=function(t,r){return r||Wr(t,8,this.length),up(this,t,!0,52,8)};_e.prototype.readDoubleBE=function(t,r){return r||Wr(t,8,this.length),up(this,t,!1,52,8)};_e.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;Fn(this,t,r,n,o,0)}var a=1,c=0;for(this[r]=t&255;++c<n&&(a*=256);)this[r+c]=t/a&255;return r+n};_e.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;Fn(this,t,r,n,o,0)}var a=n-1,c=1;for(this[r+a]=t&255;--a>=0&&(c*=256);)this[r+a]=t/c&255;return r+n};_e.prototype.writeUInt8=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,1,255,0),_e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=t&255,r+1};_e.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,2,65535,0),_e.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):fp(this,t,r,!0),r+2};_e.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,2,65535,0),_e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):fp(this,t,r,!1),r+2};_e.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,4,4294967295,0),_e.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255):cp(this,t,r,!0),r+4};_e.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,4,4294967295,0),_e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):cp(this,t,r,!1),r+4};_e.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r|0,!i){var o=Math.pow(2,8*n-1);Fn(this,t,r,n,o-1,-o)}var a=0,c=1,v=0;for(this[r]=t&255;++a<n&&(c*=256);)t<0&&v===0&&this[r+a-1]!==0&&(v=1),this[r+a]=(t/c>>0)-v&255;return r+n};_e.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r|0,!i){var o=Math.pow(2,8*n-1);Fn(this,t,r,n,o-1,-o)}var a=n-1,c=1,v=0;for(this[r+a]=t&255;--a>=0&&(c*=256);)t<0&&v===0&&this[r+a+1]!==0&&(v=1),this[r+a]=(t/c>>0)-v&255;return r+n};_e.prototype.writeInt8=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,1,127,-128),_e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=t&255,r+1};_e.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,2,32767,-32768),_e.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):fp(this,t,r,!0),r+2};_e.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,2,32767,-32768),_e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):fp(this,t,r,!1),r+2};_e.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,4,2147483647,-2147483648),_e.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):cp(this,t,r,!0),r+4};_e.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),_e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):cp(this,t,r,!1),r+4};_e.prototype.writeFloatLE=function(t,r,n){return xE(this,t,r,!0,n)};_e.prototype.writeFloatBE=function(t,r,n){return xE(this,t,r,!1,n)};_e.prototype.writeDoubleLE=function(t,r,n){return ME(this,t,r,!0,n)};_e.prototype.writeDoubleBE=function(t,r,n){return ME(this,t,r,!1,n)};_e.prototype.copy=function(t,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var o=i-n,a;if(this===t&&n<r&&r<i)for(a=o-1;a>=0;--a)t[a+r]=this[a+n];else if(o<1e3||!_e.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+r]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r);return o};_e.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!_e.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{var c=Ji(t)?t:ap(new _e(t,i).toString()),v=c.length;for(a=0;a<n-r;++a)this[a+r]=c[a%v]}return this};eZ=/[^+\/0-9A-Za-z-_]/g});var fi=E((iRe,hp)=>{var pa=(da(),Pt(AE));if(pa&&pa.default){hp.exports=pa.default;for(let e in pa)hp.exports[e]=pa[e]}else pa&&(hp.exports=pa)});var RE=E((OE,_y)=>{(function(e,t){"use strict";function r(T,m){if(!T)throw new Error(m||"Assertion failed")}function n(T,m){T.super_=m;var s=function(){};s.prototype=m.prototype,T.prototype=new s,T.prototype.constructor=T}function i(T,m,s){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((m==="le"||m==="be")&&(s=m,m=10),this._init(T||0,m||10,s||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{o=fi().Buffer}catch{}i.isBN=function(m){return m instanceof i?!0:m!==null&&typeof m=="object"&&m.constructor.wordSize===i.wordSize&&Array.isArray(m.words)},i.max=function(m,s){return m.cmp(s)>0?m:s},i.min=function(m,s){return m.cmp(s)<0?m:s},i.prototype._init=function(m,s,l){if(typeof m=="number")return this._initNumber(m,s,l);if(typeof m=="object")return this._initArray(m,s,l);s==="hex"&&(s=16),r(s===(s|0)&&s>=2&&s<=36),m=m.toString().replace(/\s+/g,"");var d=0;m[0]==="-"&&d++,s===16?this._parseHex(m,d):this._parseBase(m,s,d),m[0]==="-"&&(this.negative=1),this.strip(),l==="le"&&this._initArray(this.toArray(),s,l)},i.prototype._initNumber=function(m,s,l){m<0&&(this.negative=1,m=-m),m<67108864?(this.words=[m&67108863],this.length=1):m<4503599627370496?(this.words=[m&67108863,m/67108864&67108863],this.length=2):(r(m<9007199254740992),this.words=[m&67108863,m/67108864&67108863,1],this.length=3),l==="le"&&this._initArray(this.toArray(),s,l)},i.prototype._initArray=function(m,s,l){if(r(typeof m.length=="number"),m.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(m.length/3),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var f,p,g=0;if(l==="be")for(d=m.length-1,f=0;d>=0;d-=3)p=m[d]|m[d-1]<<8|m[d-2]<<16,this.words[f]|=p<<g&67108863,this.words[f+1]=p>>>26-g&67108863,g+=24,g>=26&&(g-=26,f++);else if(l==="le")for(d=0,f=0;d<m.length;d+=3)p=m[d]|m[d+1]<<8|m[d+2]<<16,this.words[f]|=p<<g&67108863,this.words[f+1]=p>>>26-g&67108863,g+=24,g>=26&&(g-=26,f++);return this.strip()};function a(T,m,s){for(var l=0,d=Math.min(T.length,s),f=m;f<d;f++){var p=T.charCodeAt(f)-48;l<<=4,p>=49&&p<=54?l|=p-49+10:p>=17&&p<=22?l|=p-17+10:l|=p&15}return l}i.prototype._parseHex=function(m,s){this.length=Math.ceil((m.length-s)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d,f,p=0;for(l=m.length-6,d=0;l>=s;l-=6)f=a(m,l,l+6),this.words[d]|=f<<p&67108863,this.words[d+1]|=f>>>26-p&4194303,p+=24,p>=26&&(p-=26,d++);l+6!==s&&(f=a(m,s,l+6),this.words[d]|=f<<p&67108863,this.words[d+1]|=f>>>26-p&4194303),this.strip()};function c(T,m,s,l){for(var d=0,f=Math.min(T.length,s),p=m;p<f;p++){var g=T.charCodeAt(p)-48;d*=l,g>=49?d+=g-49+10:g>=17?d+=g-17+10:d+=g}return d}i.prototype._parseBase=function(m,s,l){this.words=[0],this.length=1;for(var d=0,f=1;f<=67108863;f*=s)d++;d--,f=f/s|0;for(var p=m.length-l,g=p%d,b=Math.min(p,p-g)+l,h=0,u=l;u<b;u+=d)h=c(m,u,u+d,s),this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(g!==0){var _=1;for(h=c(m,u,m.length,s),u=0;u<g;u++)_*=s;this.imuln(_),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},i.prototype.copy=function(m){m.words=new Array(this.length);for(var s=0;s<this.length;s++)m.words[s]=this.words[s];m.length=this.length,m.negative=this.negative,m.red=this.red},i.prototype.clone=function(){var m=new i(null);return this.copy(m),m},i.prototype._expand=function(m){for(;this.length<m;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var v=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],w=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(m,s){m=m||10,s=s|0||1;var l;if(m===16||m==="hex"){l="";for(var d=0,f=0,p=0;p<this.length;p++){var g=this.words[p],b=((g<<d|f)&16777215).toString(16);f=g>>>24-d&16777215,f!==0||p!==this.length-1?l=v[6-b.length]+b+l:l=b+l,d+=2,d>=26&&(d-=26,p--)}for(f!==0&&(l=f.toString(16)+l);l.length%s!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}if(m===(m|0)&&m>=2&&m<=36){var h=y[m],u=w[m];l="";var _=this.clone();for(_.negative=0;!_.isZero();){var A=_.modn(u).toString(m);_=_.idivn(u),_.isZero()?l=A+l:l=v[h-A.length]+A+l}for(this.isZero()&&(l="0"+l);l.length%s!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var m=this.words[0];return this.length===2?m+=this.words[1]*67108864:this.length===3&&this.words[2]===1?m+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(m,s){return r(typeof o<"u"),this.toArrayLike(o,m,s)},i.prototype.toArray=function(m,s){return this.toArrayLike(Array,m,s)},i.prototype.toArrayLike=function(m,s,l){var d=this.byteLength(),f=l||Math.max(1,d);r(d<=f,"byte array longer than desired length"),r(f>0,"Requested array length <= 0"),this.strip();var p=s==="le",g=new m(f),b,h,u=this.clone();if(p){for(h=0;!u.isZero();h++)b=u.andln(255),u.iushrn(8),g[h]=b;for(;h<f;h++)g[h]=0}else{for(h=0;h<f-d;h++)g[h]=0;for(h=0;!u.isZero();h++)b=u.andln(255),u.iushrn(8),g[f-h-1]=b}return g},Math.clz32?i.prototype._countBits=function(m){return 32-Math.clz32(m)}:i.prototype._countBits=function(m){var s=m,l=0;return s>=4096&&(l+=13,s>>>=13),s>=64&&(l+=7,s>>>=7),s>=8&&(l+=4,s>>>=4),s>=2&&(l+=2,s>>>=2),l+s},i.prototype._zeroBits=function(m){if(m===0)return 26;var s=m,l=0;return(s&8191)===0&&(l+=13,s>>>=13),(s&127)===0&&(l+=7,s>>>=7),(s&15)===0&&(l+=4,s>>>=4),(s&3)===0&&(l+=2,s>>>=2),(s&1)===0&&l++,l},i.prototype.bitLength=function(){var m=this.words[this.length-1],s=this._countBits(m);return(this.length-1)*26+s};function M(T){for(var m=new Array(T.bitLength()),s=0;s<m.length;s++){var l=s/26|0,d=s%26;m[s]=(T.words[l]&1<<d)>>>d}return m}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,s=0;s<this.length;s++){var l=this._zeroBits(this.words[s]);if(m+=l,l!==26)break}return m},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(m){return this.negative!==0?this.abs().inotn(m).iaddn(1):this.clone()},i.prototype.fromTwos=function(m){return this.testn(m-1)?this.notn(m).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(m){for(;this.length<m.length;)this.words[this.length++]=0;for(var s=0;s<m.length;s++)this.words[s]=this.words[s]|m.words[s];return this.strip()},i.prototype.ior=function(m){return r((this.negative|m.negative)===0),this.iuor(m)},i.prototype.or=function(m){return this.length>m.length?this.clone().ior(m):m.clone().ior(this)},i.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},i.prototype.iuand=function(m){var s;this.length>m.length?s=m:s=this;for(var l=0;l<s.length;l++)this.words[l]=this.words[l]&m.words[l];return this.length=s.length,this.strip()},i.prototype.iand=function(m){return r((this.negative|m.negative)===0),this.iuand(m)},i.prototype.and=function(m){return this.length>m.length?this.clone().iand(m):m.clone().iand(this)},i.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},i.prototype.iuxor=function(m){var s,l;this.length>m.length?(s=this,l=m):(s=m,l=this);for(var d=0;d<l.length;d++)this.words[d]=s.words[d]^l.words[d];if(this!==s)for(;d<s.length;d++)this.words[d]=s.words[d];return this.length=s.length,this.strip()},i.prototype.ixor=function(m){return r((this.negative|m.negative)===0),this.iuxor(m)},i.prototype.xor=function(m){return this.length>m.length?this.clone().ixor(m):m.clone().ixor(this)},i.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},i.prototype.inotn=function(m){r(typeof m=="number"&&m>=0);var s=Math.ceil(m/26)|0,l=m%26;this._expand(s),l>0&&s--;for(var d=0;d<s;d++)this.words[d]=~this.words[d]&67108863;return l>0&&(this.words[d]=~this.words[d]&67108863>>26-l),this.strip()},i.prototype.notn=function(m){return this.clone().inotn(m)},i.prototype.setn=function(m,s){r(typeof m=="number"&&m>=0);var l=m/26|0,d=m%26;return this._expand(l+1),s?this.words[l]=this.words[l]|1<<d:this.words[l]=this.words[l]&~(1<<d),this.strip()},i.prototype.iadd=function(m){var s;if(this.negative!==0&&m.negative===0)return this.negative=0,s=this.isub(m),this.negative^=1,this._normSign();if(this.negative===0&&m.negative!==0)return m.negative=0,s=this.isub(m),m.negative=1,s._normSign();var l,d;this.length>m.length?(l=this,d=m):(l=m,d=this);for(var f=0,p=0;p<d.length;p++)s=(l.words[p]|0)+(d.words[p]|0)+f,this.words[p]=s&67108863,f=s>>>26;for(;f!==0&&p<l.length;p++)s=(l.words[p]|0)+f,this.words[p]=s&67108863,f=s>>>26;if(this.length=l.length,f!==0)this.words[this.length]=f,this.length++;else if(l!==this)for(;p<l.length;p++)this.words[p]=l.words[p];return this},i.prototype.add=function(m){var s;return m.negative!==0&&this.negative===0?(m.negative=0,s=this.sub(m),m.negative^=1,s):m.negative===0&&this.negative!==0?(this.negative=0,s=m.sub(this),this.negative=1,s):this.length>m.length?this.clone().iadd(m):m.clone().iadd(this)},i.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var s=this.iadd(m);return m.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var l=this.cmp(m);if(l===0)return this.negative=0,this.length=1,this.words[0]=0,this;var d,f;l>0?(d=this,f=m):(d=m,f=this);for(var p=0,g=0;g<f.length;g++)s=(d.words[g]|0)-(f.words[g]|0)+p,p=s>>26,this.words[g]=s&67108863;for(;p!==0&&g<d.length;g++)s=(d.words[g]|0)+p,p=s>>26,this.words[g]=s&67108863;if(p===0&&g<d.length&&d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this.length=Math.max(this.length,g),d!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(m){return this.clone().isub(m)};function S(T,m,s){s.negative=m.negative^T.negative;var l=T.length+m.length|0;s.length=l,l=l-1|0;var d=T.words[0]|0,f=m.words[0]|0,p=d*f,g=p&67108863,b=p/67108864|0;s.words[0]=g;for(var h=1;h<l;h++){for(var u=b>>>26,_=b&67108863,A=Math.min(h,m.length-1),x=Math.max(0,h-T.length+1);x<=A;x++){var I=h-x|0;d=T.words[I]|0,f=m.words[x]|0,p=d*f+_,u+=p/67108864|0,_=p&67108863}s.words[h]=_|0,b=u|0}return b!==0?s.words[h]=b|0:s.length--,s.strip()}var R=function(m,s,l){var d=m.words,f=s.words,p=l.words,g=0,b,h,u,_=d[0]|0,A=_&8191,x=_>>>13,I=d[1]|0,j=I&8191,O=I>>>13,L=d[2]|0,W=L&8191,F=L>>>13,G=d[3]|0,De=G&8191,Y=G>>>13,Q=d[4]|0,Ve=Q&8191,J=Q>>>13,be=d[5]|0,Ke=be&8191,ye=be>>>13,Re=d[6]|0,et=Re&8191,oe=Re>>>13,xe=d[7]|0,it=xe&8191,ce=xe>>>13,Ie=d[8]|0,ft=Ie&8191,le=Ie>>>13,Ce=d[9]|0,ot=Ce&8191,se=Ce>>>13,Me=f[0]|0,st=Me&8191,ae=Me>>>13,Se=f[1]|0,at=Se&8191,re=Se>>>13,Te=f[2]|0,ct=Te&8191,ne=Te>>>13,Ee=f[3]|0,lt=Ee&8191,te=Ee>>>13,ke=f[4]|0,ht=ke&8191,ue=ke>>>13,Pe=f[5]|0,dt=Pe&8191,he=Pe>>>13,Ne=f[6]|0,pt=Ne&8191,de=Ne>>>13,qe=f[7]|0,vt=qe&8191,pe=qe>>>13,Le=f[8]|0,ut=Le&8191,ve=Le>>>13,Be=f[9]|0,mt=Be&8191,me=Be>>>13;l.negative=m.negative^s.negative,l.length=19,b=Math.imul(A,st),h=Math.imul(A,ae),h=h+Math.imul(x,st)|0,u=Math.imul(x,ae);var Ae=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,b=Math.imul(j,st),h=Math.imul(j,ae),h=h+Math.imul(O,st)|0,u=Math.imul(O,ae),b=b+Math.imul(A,at)|0,h=h+Math.imul(A,re)|0,h=h+Math.imul(x,at)|0,u=u+Math.imul(x,re)|0;var $t=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+($t>>>26)|0,$t&=67108863,b=Math.imul(W,st),h=Math.imul(W,ae),h=h+Math.imul(F,st)|0,u=Math.imul(F,ae),b=b+Math.imul(j,at)|0,h=h+Math.imul(j,re)|0,h=h+Math.imul(O,at)|0,u=u+Math.imul(O,re)|0,b=b+Math.imul(A,ct)|0,h=h+Math.imul(A,ne)|0,h=h+Math.imul(x,ct)|0,u=u+Math.imul(x,ne)|0;var Je=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Je>>>26)|0,Je&=67108863,b=Math.imul(De,st),h=Math.imul(De,ae),h=h+Math.imul(Y,st)|0,u=Math.imul(Y,ae),b=b+Math.imul(W,at)|0,h=h+Math.imul(W,re)|0,h=h+Math.imul(F,at)|0,u=u+Math.imul(F,re)|0,b=b+Math.imul(j,ct)|0,h=h+Math.imul(j,ne)|0,h=h+Math.imul(O,ct)|0,u=u+Math.imul(O,ne)|0,b=b+Math.imul(A,lt)|0,h=h+Math.imul(A,te)|0,h=h+Math.imul(x,lt)|0,u=u+Math.imul(x,te)|0;var Qe=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,b=Math.imul(Ve,st),h=Math.imul(Ve,ae),h=h+Math.imul(J,st)|0,u=Math.imul(J,ae),b=b+Math.imul(De,at)|0,h=h+Math.imul(De,re)|0,h=h+Math.imul(Y,at)|0,u=u+Math.imul(Y,re)|0,b=b+Math.imul(W,ct)|0,h=h+Math.imul(W,ne)|0,h=h+Math.imul(F,ct)|0,u=u+Math.imul(F,ne)|0,b=b+Math.imul(j,lt)|0,h=h+Math.imul(j,te)|0,h=h+Math.imul(O,lt)|0,u=u+Math.imul(O,te)|0,b=b+Math.imul(A,ht)|0,h=h+Math.imul(A,ue)|0,h=h+Math.imul(x,ht)|0,u=u+Math.imul(x,ue)|0;var Lt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,b=Math.imul(Ke,st),h=Math.imul(Ke,ae),h=h+Math.imul(ye,st)|0,u=Math.imul(ye,ae),b=b+Math.imul(Ve,at)|0,h=h+Math.imul(Ve,re)|0,h=h+Math.imul(J,at)|0,u=u+Math.imul(J,re)|0,b=b+Math.imul(De,ct)|0,h=h+Math.imul(De,ne)|0,h=h+Math.imul(Y,ct)|0,u=u+Math.imul(Y,ne)|0,b=b+Math.imul(W,lt)|0,h=h+Math.imul(W,te)|0,h=h+Math.imul(F,lt)|0,u=u+Math.imul(F,te)|0,b=b+Math.imul(j,ht)|0,h=h+Math.imul(j,ue)|0,h=h+Math.imul(O,ht)|0,u=u+Math.imul(O,ue)|0,b=b+Math.imul(A,dt)|0,h=h+Math.imul(A,he)|0,h=h+Math.imul(x,dt)|0,u=u+Math.imul(x,he)|0;var Bt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,b=Math.imul(et,st),h=Math.imul(et,ae),h=h+Math.imul(oe,st)|0,u=Math.imul(oe,ae),b=b+Math.imul(Ke,at)|0,h=h+Math.imul(Ke,re)|0,h=h+Math.imul(ye,at)|0,u=u+Math.imul(ye,re)|0,b=b+Math.imul(Ve,ct)|0,h=h+Math.imul(Ve,ne)|0,h=h+Math.imul(J,ct)|0,u=u+Math.imul(J,ne)|0,b=b+Math.imul(De,lt)|0,h=h+Math.imul(De,te)|0,h=h+Math.imul(Y,lt)|0,u=u+Math.imul(Y,te)|0,b=b+Math.imul(W,ht)|0,h=h+Math.imul(W,ue)|0,h=h+Math.imul(F,ht)|0,u=u+Math.imul(F,ue)|0,b=b+Math.imul(j,dt)|0,h=h+Math.imul(j,he)|0,h=h+Math.imul(O,dt)|0,u=u+Math.imul(O,he)|0,b=b+Math.imul(A,pt)|0,h=h+Math.imul(A,de)|0,h=h+Math.imul(x,pt)|0,u=u+Math.imul(x,de)|0;var Dt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,b=Math.imul(it,st),h=Math.imul(it,ae),h=h+Math.imul(ce,st)|0,u=Math.imul(ce,ae),b=b+Math.imul(et,at)|0,h=h+Math.imul(et,re)|0,h=h+Math.imul(oe,at)|0,u=u+Math.imul(oe,re)|0,b=b+Math.imul(Ke,ct)|0,h=h+Math.imul(Ke,ne)|0,h=h+Math.imul(ye,ct)|0,u=u+Math.imul(ye,ne)|0,b=b+Math.imul(Ve,lt)|0,h=h+Math.imul(Ve,te)|0,h=h+Math.imul(J,lt)|0,u=u+Math.imul(J,te)|0,b=b+Math.imul(De,ht)|0,h=h+Math.imul(De,ue)|0,h=h+Math.imul(Y,ht)|0,u=u+Math.imul(Y,ue)|0,b=b+Math.imul(W,dt)|0,h=h+Math.imul(W,he)|0,h=h+Math.imul(F,dt)|0,u=u+Math.imul(F,he)|0,b=b+Math.imul(j,pt)|0,h=h+Math.imul(j,de)|0,h=h+Math.imul(O,pt)|0,u=u+Math.imul(O,de)|0,b=b+Math.imul(A,vt)|0,h=h+Math.imul(A,pe)|0,h=h+Math.imul(x,vt)|0,u=u+Math.imul(x,pe)|0;var jt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(jt>>>26)|0,jt&=67108863,b=Math.imul(ft,st),h=Math.imul(ft,ae),h=h+Math.imul(le,st)|0,u=Math.imul(le,ae),b=b+Math.imul(it,at)|0,h=h+Math.imul(it,re)|0,h=h+Math.imul(ce,at)|0,u=u+Math.imul(ce,re)|0,b=b+Math.imul(et,ct)|0,h=h+Math.imul(et,ne)|0,h=h+Math.imul(oe,ct)|0,u=u+Math.imul(oe,ne)|0,b=b+Math.imul(Ke,lt)|0,h=h+Math.imul(Ke,te)|0,h=h+Math.imul(ye,lt)|0,u=u+Math.imul(ye,te)|0,b=b+Math.imul(Ve,ht)|0,h=h+Math.imul(Ve,ue)|0,h=h+Math.imul(J,ht)|0,u=u+Math.imul(J,ue)|0,b=b+Math.imul(De,dt)|0,h=h+Math.imul(De,he)|0,h=h+Math.imul(Y,dt)|0,u=u+Math.imul(Y,he)|0,b=b+Math.imul(W,pt)|0,h=h+Math.imul(W,de)|0,h=h+Math.imul(F,pt)|0,u=u+Math.imul(F,de)|0,b=b+Math.imul(j,vt)|0,h=h+Math.imul(j,pe)|0,h=h+Math.imul(O,vt)|0,u=u+Math.imul(O,pe)|0,b=b+Math.imul(A,ut)|0,h=h+Math.imul(A,ve)|0,h=h+Math.imul(x,ut)|0,u=u+Math.imul(x,ve)|0;var Ft=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,b=Math.imul(ot,st),h=Math.imul(ot,ae),h=h+Math.imul(se,st)|0,u=Math.imul(se,ae),b=b+Math.imul(ft,at)|0,h=h+Math.imul(ft,re)|0,h=h+Math.imul(le,at)|0,u=u+Math.imul(le,re)|0,b=b+Math.imul(it,ct)|0,h=h+Math.imul(it,ne)|0,h=h+Math.imul(ce,ct)|0,u=u+Math.imul(ce,ne)|0,b=b+Math.imul(et,lt)|0,h=h+Math.imul(et,te)|0,h=h+Math.imul(oe,lt)|0,u=u+Math.imul(oe,te)|0,b=b+Math.imul(Ke,ht)|0,h=h+Math.imul(Ke,ue)|0,h=h+Math.imul(ye,ht)|0,u=u+Math.imul(ye,ue)|0,b=b+Math.imul(Ve,dt)|0,h=h+Math.imul(Ve,he)|0,h=h+Math.imul(J,dt)|0,u=u+Math.imul(J,he)|0,b=b+Math.imul(De,pt)|0,h=h+Math.imul(De,de)|0,h=h+Math.imul(Y,pt)|0,u=u+Math.imul(Y,de)|0,b=b+Math.imul(W,vt)|0,h=h+Math.imul(W,pe)|0,h=h+Math.imul(F,vt)|0,u=u+Math.imul(F,pe)|0,b=b+Math.imul(j,ut)|0,h=h+Math.imul(j,ve)|0,h=h+Math.imul(O,ut)|0,u=u+Math.imul(O,ve)|0,b=b+Math.imul(A,mt)|0,h=h+Math.imul(A,me)|0,h=h+Math.imul(x,mt)|0,u=u+Math.imul(x,me)|0;var lr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(lr>>>26)|0,lr&=67108863,b=Math.imul(ot,at),h=Math.imul(ot,re),h=h+Math.imul(se,at)|0,u=Math.imul(se,re),b=b+Math.imul(ft,ct)|0,h=h+Math.imul(ft,ne)|0,h=h+Math.imul(le,ct)|0,u=u+Math.imul(le,ne)|0,b=b+Math.imul(it,lt)|0,h=h+Math.imul(it,te)|0,h=h+Math.imul(ce,lt)|0,u=u+Math.imul(ce,te)|0,b=b+Math.imul(et,ht)|0,h=h+Math.imul(et,ue)|0,h=h+Math.imul(oe,ht)|0,u=u+Math.imul(oe,ue)|0,b=b+Math.imul(Ke,dt)|0,h=h+Math.imul(Ke,he)|0,h=h+Math.imul(ye,dt)|0,u=u+Math.imul(ye,he)|0,b=b+Math.imul(Ve,pt)|0,h=h+Math.imul(Ve,de)|0,h=h+Math.imul(J,pt)|0,u=u+Math.imul(J,de)|0,b=b+Math.imul(De,vt)|0,h=h+Math.imul(De,pe)|0,h=h+Math.imul(Y,vt)|0,u=u+Math.imul(Y,pe)|0,b=b+Math.imul(W,ut)|0,h=h+Math.imul(W,ve)|0,h=h+Math.imul(F,ut)|0,u=u+Math.imul(F,ve)|0,b=b+Math.imul(j,mt)|0,h=h+Math.imul(j,me)|0,h=h+Math.imul(O,mt)|0,u=u+Math.imul(O,me)|0;var hr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(hr>>>26)|0,hr&=67108863,b=Math.imul(ot,ct),h=Math.imul(ot,ne),h=h+Math.imul(se,ct)|0,u=Math.imul(se,ne),b=b+Math.imul(ft,lt)|0,h=h+Math.imul(ft,te)|0,h=h+Math.imul(le,lt)|0,u=u+Math.imul(le,te)|0,b=b+Math.imul(it,ht)|0,h=h+Math.imul(it,ue)|0,h=h+Math.imul(ce,ht)|0,u=u+Math.imul(ce,ue)|0,b=b+Math.imul(et,dt)|0,h=h+Math.imul(et,he)|0,h=h+Math.imul(oe,dt)|0,u=u+Math.imul(oe,he)|0,b=b+Math.imul(Ke,pt)|0,h=h+Math.imul(Ke,de)|0,h=h+Math.imul(ye,pt)|0,u=u+Math.imul(ye,de)|0,b=b+Math.imul(Ve,vt)|0,h=h+Math.imul(Ve,pe)|0,h=h+Math.imul(J,vt)|0,u=u+Math.imul(J,pe)|0,b=b+Math.imul(De,ut)|0,h=h+Math.imul(De,ve)|0,h=h+Math.imul(Y,ut)|0,u=u+Math.imul(Y,ve)|0,b=b+Math.imul(W,mt)|0,h=h+Math.imul(W,me)|0,h=h+Math.imul(F,mt)|0,u=u+Math.imul(F,me)|0;var or=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(or>>>26)|0,or&=67108863,b=Math.imul(ot,lt),h=Math.imul(ot,te),h=h+Math.imul(se,lt)|0,u=Math.imul(se,te),b=b+Math.imul(ft,ht)|0,h=h+Math.imul(ft,ue)|0,h=h+Math.imul(le,ht)|0,u=u+Math.imul(le,ue)|0,b=b+Math.imul(it,dt)|0,h=h+Math.imul(it,he)|0,h=h+Math.imul(ce,dt)|0,u=u+Math.imul(ce,he)|0,b=b+Math.imul(et,pt)|0,h=h+Math.imul(et,de)|0,h=h+Math.imul(oe,pt)|0,u=u+Math.imul(oe,de)|0,b=b+Math.imul(Ke,vt)|0,h=h+Math.imul(Ke,pe)|0,h=h+Math.imul(ye,vt)|0,u=u+Math.imul(ye,pe)|0,b=b+Math.imul(Ve,ut)|0,h=h+Math.imul(Ve,ve)|0,h=h+Math.imul(J,ut)|0,u=u+Math.imul(J,ve)|0,b=b+Math.imul(De,mt)|0,h=h+Math.imul(De,me)|0,h=h+Math.imul(Y,mt)|0,u=u+Math.imul(Y,me)|0;var Kt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,b=Math.imul(ot,ht),h=Math.imul(ot,ue),h=h+Math.imul(se,ht)|0,u=Math.imul(se,ue),b=b+Math.imul(ft,dt)|0,h=h+Math.imul(ft,he)|0,h=h+Math.imul(le,dt)|0,u=u+Math.imul(le,he)|0,b=b+Math.imul(it,pt)|0,h=h+Math.imul(it,de)|0,h=h+Math.imul(ce,pt)|0,u=u+Math.imul(ce,de)|0,b=b+Math.imul(et,vt)|0,h=h+Math.imul(et,pe)|0,h=h+Math.imul(oe,vt)|0,u=u+Math.imul(oe,pe)|0,b=b+Math.imul(Ke,ut)|0,h=h+Math.imul(Ke,ve)|0,h=h+Math.imul(ye,ut)|0,u=u+Math.imul(ye,ve)|0,b=b+Math.imul(Ve,mt)|0,h=h+Math.imul(Ve,me)|0,h=h+Math.imul(J,mt)|0,u=u+Math.imul(J,me)|0;var sr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(sr>>>26)|0,sr&=67108863,b=Math.imul(ot,dt),h=Math.imul(ot,he),h=h+Math.imul(se,dt)|0,u=Math.imul(se,he),b=b+Math.imul(ft,pt)|0,h=h+Math.imul(ft,de)|0,h=h+Math.imul(le,pt)|0,u=u+Math.imul(le,de)|0,b=b+Math.imul(it,vt)|0,h=h+Math.imul(it,pe)|0,h=h+Math.imul(ce,vt)|0,u=u+Math.imul(ce,pe)|0,b=b+Math.imul(et,ut)|0,h=h+Math.imul(et,ve)|0,h=h+Math.imul(oe,ut)|0,u=u+Math.imul(oe,ve)|0,b=b+Math.imul(Ke,mt)|0,h=h+Math.imul(Ke,me)|0,h=h+Math.imul(ye,mt)|0,u=u+Math.imul(ye,me)|0;var Ut=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,b=Math.imul(ot,pt),h=Math.imul(ot,de),h=h+Math.imul(se,pt)|0,u=Math.imul(se,de),b=b+Math.imul(ft,vt)|0,h=h+Math.imul(ft,pe)|0,h=h+Math.imul(le,vt)|0,u=u+Math.imul(le,pe)|0,b=b+Math.imul(it,ut)|0,h=h+Math.imul(it,ve)|0,h=h+Math.imul(ce,ut)|0,u=u+Math.imul(ce,ve)|0,b=b+Math.imul(et,mt)|0,h=h+Math.imul(et,me)|0,h=h+Math.imul(oe,mt)|0,u=u+Math.imul(oe,me)|0;var dr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(dr>>>26)|0,dr&=67108863,b=Math.imul(ot,vt),h=Math.imul(ot,pe),h=h+Math.imul(se,vt)|0,u=Math.imul(se,pe),b=b+Math.imul(ft,ut)|0,h=h+Math.imul(ft,ve)|0,h=h+Math.imul(le,ut)|0,u=u+Math.imul(le,ve)|0,b=b+Math.imul(it,mt)|0,h=h+Math.imul(it,me)|0,h=h+Math.imul(ce,mt)|0,u=u+Math.imul(ce,me)|0;var Jt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,b=Math.imul(ot,ut),h=Math.imul(ot,ve),h=h+Math.imul(se,ut)|0,u=Math.imul(se,ve),b=b+Math.imul(ft,mt)|0,h=h+Math.imul(ft,me)|0,h=h+Math.imul(le,mt)|0,u=u+Math.imul(le,me)|0;var tr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(tr>>>26)|0,tr&=67108863,b=Math.imul(ot,mt),h=Math.imul(ot,me),h=h+Math.imul(se,mt)|0,u=Math.imul(se,me);var Rr=(g+b|0)+((h&8191)<<13)|0;return g=(u+(h>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,p[0]=Ae,p[1]=$t,p[2]=Je,p[3]=Qe,p[4]=Lt,p[5]=Bt,p[6]=Dt,p[7]=jt,p[8]=Ft,p[9]=lr,p[10]=hr,p[11]=or,p[12]=Kt,p[13]=sr,p[14]=Ut,p[15]=dr,p[16]=Jt,p[17]=tr,p[18]=Rr,g!==0&&(p[19]=g,l.length++),l};Math.imul||(R=S);function C(T,m,s){s.negative=m.negative^T.negative,s.length=T.length+m.length;for(var l=0,d=0,f=0;f<s.length-1;f++){var p=d;d=0;for(var g=l&67108863,b=Math.min(f,m.length-1),h=Math.max(0,f-T.length+1);h<=b;h++){var u=f-h,_=T.words[u]|0,A=m.words[h]|0,x=_*A,I=x&67108863;p=p+(x/67108864|0)|0,I=I+g|0,g=I&67108863,p=p+(I>>>26)|0,d+=p>>>26,p&=67108863}s.words[f]=g,l=p,p=d}return l!==0?s.words[f]=l:s.length--,s.strip()}function B(T,m,s){var l=new N;return l.mulp(T,m,s)}i.prototype.mulTo=function(m,s){var l,d=this.length+m.length;return this.length===10&&m.length===10?l=R(this,m,s):d<63?l=S(this,m,s):d<1024?l=C(this,m,s):l=B(this,m,s),l};function N(T,m){this.x=T,this.y=m}N.prototype.makeRBT=function(m){for(var s=new Array(m),l=i.prototype._countBits(m)-1,d=0;d<m;d++)s[d]=this.revBin(d,l,m);return s},N.prototype.revBin=function(m,s,l){if(m===0||m===l-1)return m;for(var d=0,f=0;f<s;f++)d|=(m&1)<<s-f-1,m>>=1;return d},N.prototype.permute=function(m,s,l,d,f,p){for(var g=0;g<p;g++)d[g]=s[m[g]],f[g]=l[m[g]]},N.prototype.transform=function(m,s,l,d,f,p){this.permute(p,m,s,l,d,f);for(var g=1;g<f;g<<=1)for(var b=g<<1,h=Math.cos(2*Math.PI/b),u=Math.sin(2*Math.PI/b),_=0;_<f;_+=b)for(var A=h,x=u,I=0;I<g;I++){var j=l[_+I],O=d[_+I],L=l[_+I+g],W=d[_+I+g],F=A*L-x*W;W=A*W+x*L,L=F,l[_+I]=j+L,d[_+I]=O+W,l[_+I+g]=j-L,d[_+I+g]=O-W,I!==b&&(F=h*A-u*x,x=h*x+u*A,A=F)}},N.prototype.guessLen13b=function(m,s){var l=Math.max(s,m)|1,d=l&1,f=0;for(l=l/2|0;l;l=l>>>1)f++;return 1<<f+1+d},N.prototype.conjugate=function(m,s,l){if(!(l<=1))for(var d=0;d<l/2;d++){var f=m[d];m[d]=m[l-d-1],m[l-d-1]=f,f=s[d],s[d]=-s[l-d-1],s[l-d-1]=-f}},N.prototype.normalize13b=function(m,s){for(var l=0,d=0;d<s/2;d++){var f=Math.round(m[2*d+1]/s)*8192+Math.round(m[2*d]/s)+l;m[d]=f&67108863,f<67108864?l=0:l=f/67108864|0}return m},N.prototype.convert13b=function(m,s,l,d){for(var f=0,p=0;p<s;p++)f=f+(m[p]|0),l[2*p]=f&8191,f=f>>>13,l[2*p+1]=f&8191,f=f>>>13;for(p=2*s;p<d;++p)l[p]=0;r(f===0),r((f&-8192)===0)},N.prototype.stub=function(m){for(var s=new Array(m),l=0;l<m;l++)s[l]=0;return s},N.prototype.mulp=function(m,s,l){var d=2*this.guessLen13b(m.length,s.length),f=this.makeRBT(d),p=this.stub(d),g=new Array(d),b=new Array(d),h=new Array(d),u=new Array(d),_=new Array(d),A=new Array(d),x=l.words;x.length=d,this.convert13b(m.words,m.length,g,d),this.convert13b(s.words,s.length,u,d),this.transform(g,p,b,h,d,f),this.transform(u,p,_,A,d,f);for(var I=0;I<d;I++){var j=b[I]*_[I]-h[I]*A[I];h[I]=b[I]*A[I]+h[I]*_[I],b[I]=j}return this.conjugate(b,h,d),this.transform(b,h,x,p,d,f),this.conjugate(x,p,d),this.normalize13b(x,d),l.negative=m.negative^s.negative,l.length=m.length+s.length,l.strip()},i.prototype.mul=function(m){var s=new i(null);return s.words=new Array(this.length+m.length),this.mulTo(m,s)},i.prototype.mulf=function(m){var s=new i(null);return s.words=new Array(this.length+m.length),B(this,m,s)},i.prototype.imul=function(m){return this.clone().mulTo(m,this)},i.prototype.imuln=function(m){r(typeof m=="number"),r(m<67108864);for(var s=0,l=0;l<this.length;l++){var d=(this.words[l]|0)*m,f=(d&67108863)+(s&67108863);s>>=26,s+=d/67108864|0,s+=f>>>26,this.words[l]=f&67108863}return s!==0&&(this.words[l]=s,this.length++),this},i.prototype.muln=function(m){return this.clone().imuln(m)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(m){var s=M(m);if(s.length===0)return new i(1);for(var l=this,d=0;d<s.length&&s[d]===0;d++,l=l.sqr());if(++d<s.length)for(var f=l.sqr();d<s.length;d++,f=f.sqr())s[d]!==0&&(l=l.mul(f));return l},i.prototype.iushln=function(m){r(typeof m=="number"&&m>=0);var s=m%26,l=(m-s)/26,d=67108863>>>26-s<<26-s,f;if(s!==0){var p=0;for(f=0;f<this.length;f++){var g=this.words[f]&d,b=(this.words[f]|0)-g<<s;this.words[f]=b|p,p=g>>>26-s}p&&(this.words[f]=p,this.length++)}if(l!==0){for(f=this.length-1;f>=0;f--)this.words[f+l]=this.words[f];for(f=0;f<l;f++)this.words[f]=0;this.length+=l}return this.strip()},i.prototype.ishln=function(m){return r(this.negative===0),this.iushln(m)},i.prototype.iushrn=function(m,s,l){r(typeof m=="number"&&m>=0);var d;s?d=(s-s%26)/26:d=0;var f=m%26,p=Math.min((m-f)/26,this.length),g=67108863^67108863>>>f<<f,b=l;if(d-=p,d=Math.max(0,d),b){for(var h=0;h<p;h++)b.words[h]=this.words[h];b.length=p}if(p!==0)if(this.length>p)for(this.length-=p,h=0;h<this.length;h++)this.words[h]=this.words[h+p];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(u!==0||h>=d);h--){var _=this.words[h]|0;this.words[h]=u<<26-f|_>>>f,u=_&g}return b&&u!==0&&(b.words[b.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(m,s,l){return r(this.negative===0),this.iushrn(m,s,l)},i.prototype.shln=function(m){return this.clone().ishln(m)},i.prototype.ushln=function(m){return this.clone().iushln(m)},i.prototype.shrn=function(m){return this.clone().ishrn(m)},i.prototype.ushrn=function(m){return this.clone().iushrn(m)},i.prototype.testn=function(m){r(typeof m=="number"&&m>=0);var s=m%26,l=(m-s)/26,d=1<<s;if(this.length<=l)return!1;var f=this.words[l];return!!(f&d)},i.prototype.imaskn=function(m){r(typeof m=="number"&&m>=0);var s=m%26,l=(m-s)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=l)return this;if(s!==0&&l++,this.length=Math.min(l,this.length),s!==0){var d=67108863^67108863>>>s<<s;this.words[this.length-1]&=d}return this.strip()},i.prototype.maskn=function(m){return this.clone().imaskn(m)},i.prototype.iaddn=function(m){return r(typeof m=="number"),r(m<67108864),m<0?this.isubn(-m):this.negative!==0?this.length===1&&(this.words[0]|0)<m?(this.words[0]=m-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(m),this.negative=1,this):this._iaddn(m)},i.prototype._iaddn=function(m){this.words[0]+=m;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},i.prototype.isubn=function(m){if(r(typeof m=="number"),r(m<67108864),m<0)return this.iaddn(-m);if(this.negative!==0)return this.negative=0,this.iaddn(m),this.negative=1,this;if(this.words[0]-=m,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this.strip()},i.prototype.addn=function(m){return this.clone().iaddn(m)},i.prototype.subn=function(m){return this.clone().isubn(m)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(m,s,l){var d=m.length+l,f;this._expand(d);var p,g=0;for(f=0;f<m.length;f++){p=(this.words[f+l]|0)+g;var b=(m.words[f]|0)*s;p-=b&67108863,g=(p>>26)-(b/67108864|0),this.words[f+l]=p&67108863}for(;f<this.length-l;f++)p=(this.words[f+l]|0)+g,g=p>>26,this.words[f+l]=p&67108863;if(g===0)return this.strip();for(r(g===-1),g=0,f=0;f<this.length;f++)p=-(this.words[f]|0)+g,g=p>>26,this.words[f]=p&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(m,s){var l=this.length-m.length,d=this.clone(),f=m,p=f.words[f.length-1]|0,g=this._countBits(p);l=26-g,l!==0&&(f=f.ushln(l),d.iushln(l),p=f.words[f.length-1]|0);var b=d.length-f.length,h;if(s!=="mod"){h=new i(null),h.length=b+1,h.words=new Array(h.length);for(var u=0;u<h.length;u++)h.words[u]=0}var _=d.clone()._ishlnsubmul(f,1,b);_.negative===0&&(d=_,h&&(h.words[b]=1));for(var A=b-1;A>=0;A--){var x=(d.words[f.length+A]|0)*67108864+(d.words[f.length+A-1]|0);for(x=Math.min(x/p|0,67108863),d._ishlnsubmul(f,x,A);d.negative!==0;)x--,d.negative=0,d._ishlnsubmul(f,1,A),d.isZero()||(d.negative^=1);h&&(h.words[A]=x)}return h&&h.strip(),d.strip(),s!=="div"&&l!==0&&d.iushrn(l),{div:h||null,mod:d}},i.prototype.divmod=function(m,s,l){if(r(!m.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var d,f,p;return this.negative!==0&&m.negative===0?(p=this.neg().divmod(m,s),s!=="mod"&&(d=p.div.neg()),s!=="div"&&(f=p.mod.neg(),l&&f.negative!==0&&f.iadd(m)),{div:d,mod:f}):this.negative===0&&m.negative!==0?(p=this.divmod(m.neg(),s),s!=="mod"&&(d=p.div.neg()),{div:d,mod:p.mod}):(this.negative&m.negative)!==0?(p=this.neg().divmod(m.neg(),s),s!=="div"&&(f=p.mod.neg(),l&&f.negative!==0&&f.isub(m)),{div:p.div,mod:f}):m.length>this.length||this.cmp(m)<0?{div:new i(0),mod:this}:m.length===1?s==="div"?{div:this.divn(m.words[0]),mod:null}:s==="mod"?{div:null,mod:new i(this.modn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new i(this.modn(m.words[0]))}:this._wordDiv(m,s)},i.prototype.div=function(m){return this.divmod(m,"div",!1).div},i.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},i.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},i.prototype.divRound=function(m){var s=this.divmod(m);if(s.mod.isZero())return s.div;var l=s.div.negative!==0?s.mod.isub(m):s.mod,d=m.ushrn(1),f=m.andln(1),p=l.cmp(d);return p<0||f===1&&p===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},i.prototype.modn=function(m){r(m<=67108863);for(var s=(1<<26)%m,l=0,d=this.length-1;d>=0;d--)l=(s*l+(this.words[d]|0))%m;return l},i.prototype.idivn=function(m){r(m<=67108863);for(var s=0,l=this.length-1;l>=0;l--){var d=(this.words[l]|0)+s*67108864;this.words[l]=d/m|0,s=d%m}return this.strip()},i.prototype.divn=function(m){return this.clone().idivn(m)},i.prototype.egcd=function(m){r(m.negative===0),r(!m.isZero());var s=this,l=m.clone();s.negative!==0?s=s.umod(m):s=s.clone();for(var d=new i(1),f=new i(0),p=new i(0),g=new i(1),b=0;s.isEven()&&l.isEven();)s.iushrn(1),l.iushrn(1),++b;for(var h=l.clone(),u=s.clone();!s.isZero();){for(var _=0,A=1;(s.words[0]&A)===0&&_<26;++_,A<<=1);if(_>0)for(s.iushrn(_);_-- >0;)(d.isOdd()||f.isOdd())&&(d.iadd(h),f.isub(u)),d.iushrn(1),f.iushrn(1);for(var x=0,I=1;(l.words[0]&I)===0&&x<26;++x,I<<=1);if(x>0)for(l.iushrn(x);x-- >0;)(p.isOdd()||g.isOdd())&&(p.iadd(h),g.isub(u)),p.iushrn(1),g.iushrn(1);s.cmp(l)>=0?(s.isub(l),d.isub(p),f.isub(g)):(l.isub(s),p.isub(d),g.isub(f))}return{a:p,b:g,gcd:l.iushln(b)}},i.prototype._invmp=function(m){r(m.negative===0),r(!m.isZero());var s=this,l=m.clone();s.negative!==0?s=s.umod(m):s=s.clone();for(var d=new i(1),f=new i(0),p=l.clone();s.cmpn(1)>0&&l.cmpn(1)>0;){for(var g=0,b=1;(s.words[0]&b)===0&&g<26;++g,b<<=1);if(g>0)for(s.iushrn(g);g-- >0;)d.isOdd()&&d.iadd(p),d.iushrn(1);for(var h=0,u=1;(l.words[0]&u)===0&&h<26;++h,u<<=1);if(h>0)for(l.iushrn(h);h-- >0;)f.isOdd()&&f.iadd(p),f.iushrn(1);s.cmp(l)>=0?(s.isub(l),d.isub(f)):(l.isub(s),f.isub(d))}var _;return s.cmpn(1)===0?_=d:_=f,_.cmpn(0)<0&&_.iadd(m),_},i.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var s=this.clone(),l=m.clone();s.negative=0,l.negative=0;for(var d=0;s.isEven()&&l.isEven();d++)s.iushrn(1),l.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;l.isEven();)l.iushrn(1);var f=s.cmp(l);if(f<0){var p=s;s=l,l=p}else if(f===0||l.cmpn(1)===0)break;s.isub(l)}while(!0);return l.iushln(d)},i.prototype.invm=function(m){return this.egcd(m).a.umod(m)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(m){return this.words[0]&m},i.prototype.bincn=function(m){r(typeof m=="number");var s=m%26,l=(m-s)/26,d=1<<s;if(this.length<=l)return this._expand(l+1),this.words[l]|=d,this;for(var f=d,p=l;f!==0&&p<this.length;p++){var g=this.words[p]|0;g+=f,f=g>>>26,g&=67108863,this.words[p]=g}return f!==0&&(this.words[p]=f,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(m){var s=m<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this.strip();var l;if(this.length>1)l=1;else{s&&(m=-m),r(m<=67108863,"Number is too big");var d=this.words[0]|0;l=d===m?0:d<m?-1:1}return this.negative!==0?-l|0:l},i.prototype.cmp=function(m){if(this.negative!==0&&m.negative===0)return-1;if(this.negative===0&&m.negative!==0)return 1;var s=this.ucmp(m);return this.negative!==0?-s|0:s},i.prototype.ucmp=function(m){if(this.length>m.length)return 1;if(this.length<m.length)return-1;for(var s=0,l=this.length-1;l>=0;l--){var d=this.words[l]|0,f=m.words[l]|0;if(d!==f){d<f?s=-1:d>f&&(s=1);break}}return s},i.prototype.gtn=function(m){return this.cmpn(m)===1},i.prototype.gt=function(m){return this.cmp(m)===1},i.prototype.gten=function(m){return this.cmpn(m)>=0},i.prototype.gte=function(m){return this.cmp(m)>=0},i.prototype.ltn=function(m){return this.cmpn(m)===-1},i.prototype.lt=function(m){return this.cmp(m)===-1},i.prototype.lten=function(m){return this.cmpn(m)<=0},i.prototype.lte=function(m){return this.cmp(m)<=0},i.prototype.eqn=function(m){return this.cmpn(m)===0},i.prototype.eq=function(m){return this.cmp(m)===0},i.red=function(m){return new X(m)},i.prototype.toRed=function(m){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(m){return this.red=m,this},i.prototype.forceRed=function(m){return r(!this.red,"Already a number in reduction context"),this._forceRed(m)},i.prototype.redAdd=function(m){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},i.prototype.redIAdd=function(m){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},i.prototype.redSub=function(m){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},i.prototype.redISub=function(m){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},i.prototype.redShl=function(m){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},i.prototype.redMul=function(m){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},i.prototype.redIMul=function(m){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(m){return r(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var q={k256:null,p224:null,p192:null,p25519:null};function H(T,m){this.name=T,this.p=new i(m,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var m=new i(null);return m.words=new Array(Math.ceil(this.n/13)),m},H.prototype.ireduce=function(m){var s=m,l;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),l=s.bitLength();while(l>this.n);var d=l<this.n?-1:s.ucmp(this.p);return d===0?(s.words[0]=0,s.length=1):d>0?s.isub(this.p):s.strip(),s},H.prototype.split=function(m,s){m.iushrn(this.n,0,s)},H.prototype.imulK=function(m){return m.imul(this.k)};function D(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(D,H),D.prototype.split=function(m,s){for(var l=4194303,d=Math.min(m.length,9),f=0;f<d;f++)s.words[f]=m.words[f];if(s.length=d,m.length<=9){m.words[0]=0,m.length=1;return}var p=m.words[9];for(s.words[s.length++]=p&l,f=10;f<m.length;f++){var g=m.words[f]|0;m.words[f-10]=(g&l)<<4|p>>>22,p=g}p>>>=22,m.words[f-10]=p,p===0&&m.length>10?m.length-=10:m.length-=9},D.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var s=0,l=0;l<m.length;l++){var d=m.words[l]|0;s+=d*977,m.words[l]=s&67108863,s=d*64+(s/67108864|0)}return m.words[m.length-1]===0&&(m.length--,m.words[m.length-1]===0&&m.length--),m};function ee(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ee,H);function ge(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(ge,H);function K(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(K,H),K.prototype.imulK=function(m){for(var s=0,l=0;l<m.length;l++){var d=(m.words[l]|0)*19+s,f=d&67108863;d>>>=26,m.words[l]=f,s=d}return s!==0&&(m.words[m.length++]=s),m},i._prime=function(m){if(q[m])return q[m];var s;if(m==="k256")s=new D;else if(m==="p224")s=new ee;else if(m==="p192")s=new ge;else if(m==="p25519")s=new K;else throw new Error("Unknown prime "+m);return q[m]=s,s};function X(T){if(typeof T=="string"){var m=i._prime(T);this.m=m.p,this.prime=m}else r(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}X.prototype._verify1=function(m){r(m.negative===0,"red works only with positives"),r(m.red,"red works only with red numbers")},X.prototype._verify2=function(m,s){r((m.negative|s.negative)===0,"red works only with positives"),r(m.red&&m.red===s.red,"red works only with red numbers")},X.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):m.umod(this.m)._forceRed(this)},X.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},X.prototype.add=function(m,s){this._verify2(m,s);var l=m.add(s);return l.cmp(this.m)>=0&&l.isub(this.m),l._forceRed(this)},X.prototype.iadd=function(m,s){this._verify2(m,s);var l=m.iadd(s);return l.cmp(this.m)>=0&&l.isub(this.m),l},X.prototype.sub=function(m,s){this._verify2(m,s);var l=m.sub(s);return l.cmpn(0)<0&&l.iadd(this.m),l._forceRed(this)},X.prototype.isub=function(m,s){this._verify2(m,s);var l=m.isub(s);return l.cmpn(0)<0&&l.iadd(this.m),l},X.prototype.shl=function(m,s){return this._verify1(m),this.imod(m.ushln(s))},X.prototype.imul=function(m,s){return this._verify2(m,s),this.imod(m.imul(s))},X.prototype.mul=function(m,s){return this._verify2(m,s),this.imod(m.mul(s))},X.prototype.isqr=function(m){return this.imul(m,m.clone())},X.prototype.sqr=function(m){return this.mul(m,m)},X.prototype.sqrt=function(m){if(m.isZero())return m.clone();var s=this.m.andln(3);if(r(s%2===1),s===3){var l=this.m.add(new i(1)).iushrn(2);return this.pow(m,l)}for(var d=this.m.subn(1),f=0;!d.isZero()&&d.andln(1)===0;)f++,d.iushrn(1);r(!d.isZero());var p=new i(1).toRed(this),g=p.redNeg(),b=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new i(2*h*h).toRed(this);this.pow(h,b).cmp(g)!==0;)h.redIAdd(g);for(var u=this.pow(h,d),_=this.pow(m,d.addn(1).iushrn(1)),A=this.pow(m,d),x=f;A.cmp(p)!==0;){for(var I=A,j=0;I.cmp(p)!==0;j++)I=I.redSqr();r(j<x);var O=this.pow(u,new i(1).iushln(x-j-1));_=_.redMul(O),u=O.redSqr(),A=A.redMul(u),x=j}return _},X.prototype.invm=function(m){var s=m._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},X.prototype.pow=function(m,s){if(s.isZero())return new i(1).toRed(this);if(s.cmpn(1)===0)return m.clone();var l=4,d=new Array(1<<l);d[0]=new i(1).toRed(this),d[1]=m;for(var f=2;f<d.length;f++)d[f]=this.mul(d[f-1],m);var p=d[0],g=0,b=0,h=s.bitLength()%26;for(h===0&&(h=26),f=s.length-1;f>=0;f--){for(var u=s.words[f],_=h-1;_>=0;_--){var A=u>>_&1;if(p!==d[0]&&(p=this.sqr(p)),A===0&&g===0){b=0;continue}g<<=1,g|=A,b++,!(b!==l&&(f!==0||_!==0))&&(p=this.mul(p,d[g]),b=0,g=0)}h=26}return p},X.prototype.convertTo=function(m){var s=m.umod(this.m);return s===m?s.clone():s},X.prototype.convertFrom=function(m){var s=m.clone();return s.red=null,s},i.mont=function(m){return new V(m)};function V(T){X.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(V,X),V.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},V.prototype.convertFrom=function(m){var s=this.imod(m.mul(this.rinv));return s.red=null,s},V.prototype.imul=function(m,s){if(m.isZero()||s.isZero())return m.words[0]=0,m.length=1,m;var l=m.imul(s),d=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=l.isub(d).iushrn(this.shift),p=f;return f.cmp(this.m)>=0?p=f.isub(this.m):f.cmpn(0)<0&&(p=f.iadd(this.m)),p._forceRed(this)},V.prototype.mul=function(m,s){if(m.isZero()||s.isZero())return new i(0)._forceRed(this);var l=m.mul(s),d=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=l.isub(d).iushrn(this.shift),p=f;return f.cmp(this.m)>=0?p=f.isub(this.m):f.cmpn(0)<0&&(p=f.iadd(this.m)),p._forceRed(this)},V.prototype.invm=function(m){var s=this.imod(m._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(typeof _y>"u"||_y,OE)});var xy=E((oRe,TE)=>{TE.exports=wy;wy.strict=IE;wy.loose=CE;var uZ=Object.prototype.toString,fZ={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function wy(e){return IE(e)||CE(e)}function IE(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function CE(e){return fZ[uZ.call(e)]}});var PE=E((sRe,kE)=>{var cZ=xy().strict;kE.exports=function(t){if(cZ(t)){var r=Buffer.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(r=r.slice(t.byteOffset,t.byteOffset+t.byteLength)),r}else return Buffer.from(t)}});var GE=E((pRe,yp)=>{(function(){"use strict";var e="input is invalid type",t="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=globalThis:i&&(n=self);var a=!n.JS_SHA3_NO_COMMON_JS&&typeof yp=="object"&&yp.exports,c=typeof define=="function"&&define.amd,v=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",y="0123456789abcdef".split(""),w=[31,7936,2031616,520093696],M=[4,1024,262144,67108864],S=[1,256,65536,16777216],R=[6,1536,393216,100663296],C=[0,8,16,24],B=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],N=[224,256,384,512],q=[128,256],H=["hex","buffer","arrayBuffer","array","digest"],D={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(O){return Object.prototype.toString.call(O)==="[object Array]"}),v&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(O){return typeof O=="object"&&O.buffer&&O.buffer.constructor===ArrayBuffer});for(var ee=function(O,L,W){return function(F){return new x(O,L,O).update(F)[W]()}},ge=function(O,L,W){return function(F,G){return new x(O,L,G).update(F)[W]()}},K=function(O,L,W){return function(F,G,De,Y){return f["cshake"+O].update(F,G,De,Y)[W]()}},X=function(O,L,W){return function(F,G,De,Y){return f["kmac"+O].update(F,G,De,Y)[W]()}},V=function(O,L,W,F){for(var G=0;G<H.length;++G){var De=H[G];O[De]=L(W,F,De)}return O},T=function(O,L){var W=ee(O,L,"hex");return W.create=function(){return new x(O,L,O)},W.update=function(F){return W.create().update(F)},V(W,ee,O,L)},m=function(O,L){var W=ge(O,L,"hex");return W.create=function(F){return new x(O,L,F)},W.update=function(F,G){return W.create(G).update(F)},V(W,ge,O,L)},s=function(O,L){var W=D[O],F=K(O,L,"hex");return F.create=function(G,De,Y){return!De&&!Y?f["shake"+O].create(G):new x(O,L,G).bytepad([De,Y],W)},F.update=function(G,De,Y,Q){return F.create(De,Y,Q).update(G)},V(F,K,O,L)},l=function(O,L){var W=D[O],F=X(O,L,"hex");return F.create=function(G,De,Y){return new I(O,L,De).bytepad(["KMAC",Y],W).bytepad([G],W)},F.update=function(G,De,Y,Q){return F.create(G,Y,Q).update(De)},V(F,X,O,L)},d=[{name:"keccak",padding:S,bits:N,createMethod:T},{name:"sha3",padding:R,bits:N,createMethod:T},{name:"shake",padding:w,bits:q,createMethod:m},{name:"cshake",padding:M,bits:q,createMethod:s},{name:"kmac",padding:M,bits:q,createMethod:l}],f={},p=[],g=0;g<d.length;++g)for(var b=d[g],h=b.bits,u=0;u<h.length;++u){var _=b.name+"_"+h[u];if(p.push(_),f[_]=b.createMethod(h[u],b.padding),b.name!=="sha3"){var A=b.name+h[u];p.push(A),f[A]=f[_]}}function x(O,L,W){this.blocks=[],this.s=[],this.padding=L,this.outputBits=W,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(O<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=W>>5,this.extraBytes=(W&31)>>3;for(var F=0;F<50;++F)this.s[F]=0}x.prototype.update=function(O){if(this.finalized)throw new Error(t);var L,W=typeof O;if(W!=="string"){if(W==="object"){if(O===null)throw new Error(e);if(v&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!v||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);L=!0}for(var F=this.blocks,G=this.byteCount,De=O.length,Y=this.blockCount,Q=0,Ve=this.s,J,be;Q<De;){if(this.reset)for(this.reset=!1,F[0]=this.block,J=1;J<Y+1;++J)F[J]=0;if(L)for(J=this.start;Q<De&&J<G;++Q)F[J>>2]|=O[Q]<<C[J++&3];else for(J=this.start;Q<De&&J<G;++Q)be=O.charCodeAt(Q),be<128?F[J>>2]|=be<<C[J++&3]:be<2048?(F[J>>2]|=(192|be>>6)<<C[J++&3],F[J>>2]|=(128|be&63)<<C[J++&3]):be<55296||be>=57344?(F[J>>2]|=(224|be>>12)<<C[J++&3],F[J>>2]|=(128|be>>6&63)<<C[J++&3],F[J>>2]|=(128|be&63)<<C[J++&3]):(be=65536+((be&1023)<<10|O.charCodeAt(++Q)&1023),F[J>>2]|=(240|be>>18)<<C[J++&3],F[J>>2]|=(128|be>>12&63)<<C[J++&3],F[J>>2]|=(128|be>>6&63)<<C[J++&3],F[J>>2]|=(128|be&63)<<C[J++&3]);if(this.lastByteIndex=J,J>=G){for(this.start=J-G,this.block=F[Y],J=0;J<Y;++J)Ve[J]^=F[J];j(Ve),this.reset=!0}else this.start=J}return this},x.prototype.encode=function(O,L){var W=O&255,F=1,G=[W];for(O=O>>8,W=O&255;W>0;)G.unshift(W),O=O>>8,W=O&255,++F;return L?G.push(F):G.unshift(F),this.update(G),G.length},x.prototype.encodeString=function(O){var L,W=typeof O;if(W!=="string"){if(W==="object"){if(O===null)throw new Error(e);if(v&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!v||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);L=!0}var F=0,G=O.length;if(L)F=G;else for(var De=0;De<O.length;++De){var Y=O.charCodeAt(De);Y<128?F+=1:Y<2048?F+=2:Y<55296||Y>=57344?F+=3:(Y=65536+((Y&1023)<<10|O.charCodeAt(++De)&1023),F+=4)}return F+=this.encode(F*8),this.update(O),F},x.prototype.bytepad=function(O,L){for(var W=this.encode(L),F=0;F<O.length;++F)W+=this.encodeString(O[F]);var G=L-W%L,De=[];return De.length=G,this.update(De),this},x.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var O=this.blocks,L=this.lastByteIndex,W=this.blockCount,F=this.s;if(O[L>>2]|=this.padding[L&3],this.lastByteIndex===this.byteCount)for(O[0]=O[W],L=1;L<W+1;++L)O[L]=0;for(O[W-1]|=2147483648,L=0;L<W;++L)F[L]^=O[L];j(F)}},x.prototype.toString=x.prototype.hex=function(){this.finalize();for(var O=this.blockCount,L=this.s,W=this.outputBlocks,F=this.extraBytes,G=0,De=0,Y="",Q;De<W;){for(G=0;G<O&&De<W;++G,++De)Q=L[G],Y+=y[Q>>4&15]+y[Q&15]+y[Q>>12&15]+y[Q>>8&15]+y[Q>>20&15]+y[Q>>16&15]+y[Q>>28&15]+y[Q>>24&15];De%O===0&&(j(L),G=0)}return F&&(Q=L[G],Y+=y[Q>>4&15]+y[Q&15],F>1&&(Y+=y[Q>>12&15]+y[Q>>8&15]),F>2&&(Y+=y[Q>>20&15]+y[Q>>16&15])),Y},x.prototype.arrayBuffer=function(){this.finalize();var O=this.blockCount,L=this.s,W=this.outputBlocks,F=this.extraBytes,G=0,De=0,Y=this.outputBits>>3,Q;F?Q=new ArrayBuffer(W+1<<2):Q=new ArrayBuffer(Y);for(var Ve=new Uint32Array(Q);De<W;){for(G=0;G<O&&De<W;++G,++De)Ve[De]=L[G];De%O===0&&j(L)}return F&&(Ve[G]=L[G],Q=Q.slice(0,Y)),Q},x.prototype.buffer=x.prototype.arrayBuffer,x.prototype.digest=x.prototype.array=function(){this.finalize();for(var O=this.blockCount,L=this.s,W=this.outputBlocks,F=this.extraBytes,G=0,De=0,Y=[],Q,Ve;De<W;){for(G=0;G<O&&De<W;++G,++De)Q=De<<2,Ve=L[G],Y[Q]=Ve&255,Y[Q+1]=Ve>>8&255,Y[Q+2]=Ve>>16&255,Y[Q+3]=Ve>>24&255;De%O===0&&j(L)}return F&&(Q=De<<2,Ve=L[G],Y[Q]=Ve&255,F>1&&(Y[Q+1]=Ve>>8&255),F>2&&(Y[Q+2]=Ve>>16&255)),Y};function I(O,L,W){x.call(this,O,L,W)}I.prototype=new x,I.prototype.finalize=function(){return this.encode(this.outputBits,!0),x.prototype.finalize.call(this)};var j=function(O){var L,W,F,G,De,Y,Q,Ve,J,be,Ke,ye,Re,et,oe,xe,it,ce,Ie,ft,le,Ce,ot,se,Me,st,ae,Se,at,re,Te,ct,ne,Ee,lt,te,ke,ht,ue,Pe,dt,he,Ne,pt,de,qe,vt,pe,Le,ut,ve,Be,mt,me,Ae,$t,Je,Qe,Lt,Bt,Dt,jt,Ft;for(F=0;F<48;F+=2)G=O[0]^O[10]^O[20]^O[30]^O[40],De=O[1]^O[11]^O[21]^O[31]^O[41],Y=O[2]^O[12]^O[22]^O[32]^O[42],Q=O[3]^O[13]^O[23]^O[33]^O[43],Ve=O[4]^O[14]^O[24]^O[34]^O[44],J=O[5]^O[15]^O[25]^O[35]^O[45],be=O[6]^O[16]^O[26]^O[36]^O[46],Ke=O[7]^O[17]^O[27]^O[37]^O[47],ye=O[8]^O[18]^O[28]^O[38]^O[48],Re=O[9]^O[19]^O[29]^O[39]^O[49],L=ye^(Y<<1|Q>>>31),W=Re^(Q<<1|Y>>>31),O[0]^=L,O[1]^=W,O[10]^=L,O[11]^=W,O[20]^=L,O[21]^=W,O[30]^=L,O[31]^=W,O[40]^=L,O[41]^=W,L=G^(Ve<<1|J>>>31),W=De^(J<<1|Ve>>>31),O[2]^=L,O[3]^=W,O[12]^=L,O[13]^=W,O[22]^=L,O[23]^=W,O[32]^=L,O[33]^=W,O[42]^=L,O[43]^=W,L=Y^(be<<1|Ke>>>31),W=Q^(Ke<<1|be>>>31),O[4]^=L,O[5]^=W,O[14]^=L,O[15]^=W,O[24]^=L,O[25]^=W,O[34]^=L,O[35]^=W,O[44]^=L,O[45]^=W,L=Ve^(ye<<1|Re>>>31),W=J^(Re<<1|ye>>>31),O[6]^=L,O[7]^=W,O[16]^=L,O[17]^=W,O[26]^=L,O[27]^=W,O[36]^=L,O[37]^=W,O[46]^=L,O[47]^=W,L=be^(G<<1|De>>>31),W=Ke^(De<<1|G>>>31),O[8]^=L,O[9]^=W,O[18]^=L,O[19]^=W,O[28]^=L,O[29]^=W,O[38]^=L,O[39]^=W,O[48]^=L,O[49]^=W,et=O[0],oe=O[1],qe=O[11]<<4|O[10]>>>28,vt=O[10]<<4|O[11]>>>28,Se=O[20]<<3|O[21]>>>29,at=O[21]<<3|O[20]>>>29,Bt=O[31]<<9|O[30]>>>23,Dt=O[30]<<9|O[31]>>>23,he=O[40]<<18|O[41]>>>14,Ne=O[41]<<18|O[40]>>>14,Ee=O[2]<<1|O[3]>>>31,lt=O[3]<<1|O[2]>>>31,xe=O[13]<<12|O[12]>>>20,it=O[12]<<12|O[13]>>>20,pe=O[22]<<10|O[23]>>>22,Le=O[23]<<10|O[22]>>>22,re=O[33]<<13|O[32]>>>19,Te=O[32]<<13|O[33]>>>19,jt=O[42]<<2|O[43]>>>30,Ft=O[43]<<2|O[42]>>>30,me=O[5]<<30|O[4]>>>2,Ae=O[4]<<30|O[5]>>>2,te=O[14]<<6|O[15]>>>26,ke=O[15]<<6|O[14]>>>26,ce=O[25]<<11|O[24]>>>21,Ie=O[24]<<11|O[25]>>>21,ut=O[34]<<15|O[35]>>>17,ve=O[35]<<15|O[34]>>>17,ct=O[45]<<29|O[44]>>>3,ne=O[44]<<29|O[45]>>>3,se=O[6]<<28|O[7]>>>4,Me=O[7]<<28|O[6]>>>4,$t=O[17]<<23|O[16]>>>9,Je=O[16]<<23|O[17]>>>9,ht=O[26]<<25|O[27]>>>7,ue=O[27]<<25|O[26]>>>7,ft=O[36]<<21|O[37]>>>11,le=O[37]<<21|O[36]>>>11,Be=O[47]<<24|O[46]>>>8,mt=O[46]<<24|O[47]>>>8,pt=O[8]<<27|O[9]>>>5,de=O[9]<<27|O[8]>>>5,st=O[18]<<20|O[19]>>>12,ae=O[19]<<20|O[18]>>>12,Qe=O[29]<<7|O[28]>>>25,Lt=O[28]<<7|O[29]>>>25,Pe=O[38]<<8|O[39]>>>24,dt=O[39]<<8|O[38]>>>24,Ce=O[48]<<14|O[49]>>>18,ot=O[49]<<14|O[48]>>>18,O[0]=et^~xe&ce,O[1]=oe^~it&Ie,O[10]=se^~st&Se,O[11]=Me^~ae&at,O[20]=Ee^~te&ht,O[21]=lt^~ke&ue,O[30]=pt^~qe&pe,O[31]=de^~vt&Le,O[40]=me^~$t&Qe,O[41]=Ae^~Je&Lt,O[2]=xe^~ce&ft,O[3]=it^~Ie&le,O[12]=st^~Se&re,O[13]=ae^~at&Te,O[22]=te^~ht&Pe,O[23]=ke^~ue&dt,O[32]=qe^~pe&ut,O[33]=vt^~Le&ve,O[42]=$t^~Qe&Bt,O[43]=Je^~Lt&Dt,O[4]=ce^~ft&Ce,O[5]=Ie^~le&ot,O[14]=Se^~re&ct,O[15]=at^~Te&ne,O[24]=ht^~Pe&he,O[25]=ue^~dt&Ne,O[34]=pe^~ut&Be,O[35]=Le^~ve&mt,O[44]=Qe^~Bt&jt,O[45]=Lt^~Dt&Ft,O[6]=ft^~Ce&et,O[7]=le^~ot&oe,O[16]=re^~ct&se,O[17]=Te^~ne&Me,O[26]=Pe^~he&Ee,O[27]=dt^~Ne&lt,O[36]=ut^~Be&pt,O[37]=ve^~mt&de,O[46]=Bt^~jt&me,O[47]=Dt^~Ft&Ae,O[8]=Ce^~et&xe,O[9]=ot^~oe&it,O[18]=ct^~se&st,O[19]=ne^~Me&ae,O[28]=he^~Ee&te,O[29]=Ne^~lt&ke,O[38]=Be^~pt&qe,O[39]=mt^~de&vt,O[48]=jt^~me&$t,O[49]=Ft^~Ae&Je,O[0]^=B[F],O[1]^=B[F+1]};if(a)yp.exports=f;else{for(g=0;g<p.length;++g)n[p[g]]=f[p[g]];c&&define(function(){return f})}})()});var _8=E((bRe,Ap)=>{var e8,t8,r8,n8,i8,o8,s8,a8,u8,Ep,Ry,f8,c8,Ju,l8,h8,d8,p8,v8,m8,g8,b8,y8;(function(e){var t=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Ap=="object"&&typeof Ap.exports=="object"?e(r(t,r(Ap.exports))):e(r(t));function r(n,i){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,a){return n[o]=i?i(o,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])};e8=function(r,n){t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},t8=Object.assign||function(r){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},r8=function(r,n){var i={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(r);a<o.length;a++)n.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(r,o[a])&&(i[o[a]]=r[o[a]]);return i},n8=function(r,n,i,o){var a=arguments.length,c=a<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,i):o,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,i,o);else for(var y=r.length-1;y>=0;y--)(v=r[y])&&(c=(a<3?v(c):a>3?v(n,i,c):v(n,i))||c);return a>3&&c&&Object.defineProperty(n,i,c),c},i8=function(r,n){return function(i,o){n(i,o,r)}},o8=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},s8=function(r,n,i,o){function a(c){return c instanceof i?c:new i(function(v){v(c)})}return new(i||(i=Promise))(function(c,v){function y(S){try{M(o.next(S))}catch(R){v(R)}}function w(S){try{M(o.throw(S))}catch(R){v(R)}}function M(S){S.done?c(S.value):a(S.value).then(y,w)}M((o=o.apply(r,n||[])).next())})},a8=function(r,n){var i={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,a,c,v;return v={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function y(M){return function(S){return w([M,S])}}function w(M){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(c=M[0]&2?a.return:M[0]?a.throw||((c=a.return)&&c.call(a),0):a.next)&&!(c=c.call(a,M[1])).done)return c;switch(a=0,c&&(M=[M[0]&2,c.value]),M[0]){case 0:case 1:c=M;break;case 4:return i.label++,{value:M[1],done:!1};case 5:i.label++,a=M[1],M=[0];continue;case 7:M=i.ops.pop(),i.trys.pop();continue;default:if(c=i.trys,!(c=c.length>0&&c[c.length-1])&&(M[0]===6||M[0]===2)){i=0;continue}if(M[0]===3&&(!c||M[1]>c[0]&&M[1]<c[3])){i.label=M[1];break}if(M[0]===6&&i.label<c[1]){i.label=c[1],c=M;break}if(c&&i.label<c[2]){i.label=c[2],i.ops.push(M);break}c[2]&&i.ops.pop(),i.trys.pop();continue}M=n.call(r,i)}catch(S){M=[6,S],a=0}finally{o=c=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}},y8=function(r,n,i,o){o===void 0&&(o=i),r[o]=n[i]},u8=function(r,n){for(var i in r)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=r[i])},Ep=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],o=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Ry=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var o=i.call(r),a,c=[],v;try{for(;(n===void 0||n-- >0)&&!(a=o.next()).done;)c.push(a.value)}catch(y){v={error:y}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(v)throw v.error}}return c},f8=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Ry(arguments[n]));return r},c8=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var o=Array(r),a=0,n=0;n<i;n++)for(var c=arguments[n],v=0,y=c.length;v<y;v++,a++)o[a]=c[v];return o},Ju=function(r){return this instanceof Ju?(this.v=r,this):new Ju(r)},l8=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(r,n||[]),a,c=[];return a={},v("next"),v("throw"),v("return"),a[Symbol.asyncIterator]=function(){return this},a;function v(C){o[C]&&(a[C]=function(B){return new Promise(function(N,q){c.push([C,B,N,q])>1||y(C,B)})})}function y(C,B){try{w(o[C](B))}catch(N){R(c[0][3],N)}}function w(C){C.value instanceof Ju?Promise.resolve(C.value.v).then(M,S):R(c[0][2],C)}function M(C){y("next",C)}function S(C){y("throw",C)}function R(C,B){C(B),c.shift(),c.length&&y(c[0][0],c[0][1])}},h8=function(r){var n,i;return n={},o("next"),o("throw",function(a){throw a}),o("return"),n[Symbol.iterator]=function(){return this},n;function o(a,c){n[a]=r[a]?function(v){return(i=!i)?{value:Ju(r[a](v)),done:a==="return"}:c?c(v):v}:c}},d8=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof Ep=="function"?Ep(r):r[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(c){i[c]=r[c]&&function(v){return new Promise(function(y,w){v=r[c](v),a(y,w,v.done,v.value)})}}function a(c,v,y,w){Promise.resolve(w).then(function(M){c({value:M,done:y})},v)}},p8=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r},v8=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n.default=r,n},m8=function(r){return r&&r.__esModule?r:{default:r}},g8=function(r,n){if(!n.has(r))throw new TypeError("attempted to get private field on non-instance");return n.get(r)},b8=function(r,n,i){if(!n.has(r))throw new TypeError("attempted to set private field on non-instance");return n.set(r,i),i},e("__extends",e8),e("__assign",t8),e("__rest",r8),e("__decorate",n8),e("__param",i8),e("__metadata",o8),e("__awaiter",s8),e("__generator",a8),e("__exportStar",u8),e("__createBinding",y8),e("__values",Ep),e("__read",Ry),e("__spread",f8),e("__spreadArrays",c8),e("__await",Ju),e("__asyncGenerator",l8),e("__asyncDelegator",h8),e("__asyncValues",d8),e("__makeTemplateObject",p8),e("__importStar",v8),e("__importDefault",m8),e("__classPrivateFieldGet",g8),e("__classPrivateFieldSet",b8)})});var x8=E(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.isBrowserCryptoAvailable=cs.getSubtleCrypto=cs.getBrowerCrypto=void 0;function Iy(){return globalThis?.crypto||globalThis?.msCrypto||{}}cs.getBrowerCrypto=Iy;function w8(){let e=Iy();return e.subtle||e.webkitSubtle}cs.getSubtleCrypto=w8;function yZ(){return!!Iy()&&!!w8()}cs.isBrowserCryptoAvailable=yZ});var E8=E(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.isBrowser=ls.isNode=ls.isReactNative=void 0;function M8(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}ls.isReactNative=M8;function S8(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}ls.isNode=S8;function _Z(){return!M8()&&!S8()}ls.isBrowser=_Z});var Qu=E(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});var A8=_8();A8.__exportStar(x8(),Op);A8.__exportStar(E8(),Op)});var W8=E((uIe,H8)=>{"use strict";H8.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)});var G8=E((fIe,K8)=>{"use strict";var $8="%[a-f0-9]{2}",z8=new RegExp("("+$8+")|([^%]+?)","gi"),V8=new RegExp("("+$8+")+","gi");function qy(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],qy(r),qy(n))}function jZ(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(z8)||[],r=1;r<t.length;r++)e=qy(t,r).join(""),t=e.match(z8)||[];return e}}function FZ(e){for(var t={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=V8.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var n=jZ(r[0]);n!==r[0]&&(t[r[0]]=n)}r=V8.exec(e)}t["%C2"]="\uFFFD";for(var i=Object.keys(t),o=0;o<i.length;o++){var a=i[o];e=e.replace(new RegExp(a,"g"),t[a])}return e}K8.exports=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return FZ(e)}}});var Y8=E((cIe,Z8)=>{"use strict";Z8.exports=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];let r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]}});var i9=E(Lo=>{"use strict";var UZ=W8(),HZ=G8(),Q8=Y8(),WZ=e=>e==null;function zZ(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let i=r.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[Xr(t,e),"[",i,"]"].join("")]:[...r,[Xr(t,e),"[",Xr(i,e),"]=",Xr(n,e)].join("")]};case"bracket":return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[Xr(t,e),"[]"].join("")]:[...r,[Xr(t,e),"[]=",Xr(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>n==null||n.length===0?r:r.length===0?[[Xr(t,e),"=",Xr(n,e)].join("")]:[[r,Xr(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,Xr(t,e)]:[...r,[Xr(t,e),"=",Xr(n,e)].join("")]}}function VZ(e){let t;switch(e.arrayFormat){case"index":return(r,n,i)=>{if(t=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),!t){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][t[1]]=n};case"bracket":return(r,n,i)=>{if(t=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),!t){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[].concat(i[r],n)};case"comma":case"separator":return(r,n,i)=>{let a=typeof n=="string"&&n.split("").indexOf(e.arrayFormatSeparator)>-1?n.split(e.arrayFormatSeparator).map(c=>Al(c,e)):n===null?n:Al(n,e);i[r]=a};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[].concat(i[r],n)}}}function X8(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Xr(e,t){return t.encode?t.strict?UZ(e):encodeURIComponent(e):e}function Al(e,t){return t.decode?HZ(e):e}function e9(e){return Array.isArray(e)?e.sort():typeof e=="object"?e9(Object.keys(e)).sort((t,r)=>Number(t)-Number(r)).map(t=>e[t]):e}function t9(e){let t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function $Z(e){let t="",r=e.indexOf("#");return r!==-1&&(t=e.slice(r)),t}function r9(e){e=t9(e);let t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function J8(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function n9(e,t){t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t),X8(t.arrayFormatSeparator);let r=VZ(t),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(let i of e.split("&")){let[o,a]=Q8(t.decode?i.replace(/\+/g," "):i,"=");a=a===void 0?null:["comma","separator"].includes(t.arrayFormat)?a:Al(a,t),r(Al(o,t),a,n)}for(let i of Object.keys(n)){let o=n[i];if(typeof o=="object"&&o!==null)for(let a of Object.keys(o))o[a]=J8(o[a],t);else n[i]=J8(o,t)}return t.sort===!1?n:(t.sort===!0?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((i,o)=>{let a=n[o];return Boolean(a)&&typeof a=="object"&&!Array.isArray(a)?i[o]=e9(a):i[o]=a,i},Object.create(null))}Lo.extract=r9;Lo.parse=n9;Lo.stringify=(e,t)=>{if(!e)return"";t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t),X8(t.arrayFormatSeparator);let r=a=>t.skipNull&&WZ(e[a])||t.skipEmptyString&&e[a]==="",n=zZ(t),i={};for(let a of Object.keys(e))r(a)||(i[a]=e[a]);let o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(a=>{let c=e[a];return c===void 0?"":c===null?Xr(a,t):Array.isArray(c)?c.reduce(n(a),[]).join("&"):Xr(a,t)+"="+Xr(c,t)}).filter(a=>a.length>0).join("&")};Lo.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[r,n]=Q8(e,"#");return Object.assign({url:r.split("?")[0]||"",query:n9(r9(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:Al(n,t)}:{})};Lo.stringifyUrl=(e,t)=>{t=Object.assign({encode:!0,strict:!0},t);let r=t9(e.url).split("?")[0]||"",n=Lo.extract(e.url),i=Lo.parse(n,{sort:!1}),o=Object.assign(i,e.query),a=Lo.stringify(o,t);a&&(a=`?${a}`);let c=$Z(e.url);return e.fragmentIdentifier&&(c=`#${Xr(e.fragmentIdentifier,t)}`),`${r}${a}${c}`}});var l9=E((AIe,c9)=>{"use strict";c9.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var D9=E((OCe,B9)=>{B9.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Up=E((RCe,j9)=>{var CY={}.toString;j9.exports=Array.isArray||function(e){return CY.call(e)=="[object Array]"}});var ga=E((ICe,f_)=>{"use strict";var TY=Up();function kY(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},e.foo()===42}catch{return!1}}St.TYPED_ARRAY_SUPPORT=kY();var F9=St.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function St(e,t,r){return!St.TYPED_ARRAY_SUPPORT&&!(this instanceof St)?new St(e,t,r):typeof e=="number"?U9(this,e):jY(this,e,t,r)}St.TYPED_ARRAY_SUPPORT&&(St.prototype.__proto__=Uint8Array.prototype,St.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&St[Symbol.species]===St&&Object.defineProperty(St,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function u_(e){if(e>=F9)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+F9.toString(16)+" bytes");return e|0}function PY(e){return e!==e}function rf(e,t){var r;return St.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=St.prototype):(r=e,r===null&&(r=new St(t)),r.length=t),r}function U9(e,t){var r=rf(e,t<0?0:u_(t)|0);if(!St.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)r[n]=0;return r}function NY(e,t){var r=W9(t)|0,n=rf(e,r),i=n.write(t);return i!==r&&(n=n.slice(0,i)),n}function a_(e,t){for(var r=t.length<0?0:u_(t.length)|0,n=rf(e,r),i=0;i<r;i+=1)n[i]=t[i]&255;return n}function qY(e,t,r,n){if(r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");var i;return r===void 0&&n===void 0?i=new Uint8Array(t):n===void 0?i=new Uint8Array(t,r):i=new Uint8Array(t,r,n),St.TYPED_ARRAY_SUPPORT?i.__proto__=St.prototype:i=a_(e,i),i}function LY(e,t){if(St.isBuffer(t)){var r=u_(t.length)|0,n=rf(e,r);return n.length===0||t.copy(n,0,0,r),n}if(t){if(typeof ArrayBuffer<"u"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||PY(t.length)?rf(e,0):a_(e,t);if(t.type==="Buffer"&&Array.isArray(t.data))return a_(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H9(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function W9(e){if(St.isBuffer(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;return t===0?0:H9(e).length}function BY(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function DY(e,t,r,n){return BY(H9(t,e.length-r),e,r,n)}function jY(e,t,r,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?qY(e,t,r,n):typeof t=="string"?NY(e,t,r):LY(e,t)}St.prototype.write=function(t,r,n){r===void 0?(n=this.length,r=0):n===void 0&&typeof r=="string"?(n=this.length,r=0):isFinite(r)&&(r=r|0,isFinite(n)?n=n|0:n=void 0);var i=this.length-r;if((n===void 0||n>i)&&(n=i),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return DY(this,t,r,n)};St.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i;if(St.TYPED_ARRAY_SUPPORT)i=this.subarray(t,r),i.__proto__=St.prototype;else{var o=r-t;i=new St(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i};St.prototype.copy=function(t,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var o=i-n,a;if(this===t&&n<r&&r<i)for(a=o-1;a>=0;--a)t[a+r]=this[a+n];else if(o<1e3||!St.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+r]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r);return o};St.prototype.fill=function(t,r,n){if(typeof t=="string"){if(typeof r=="string"?(r=0,n=this.length):typeof n=="string"&&(n=this.length),t.length===1){var i=t.charCodeAt(0);i<256&&(t=i)}}else typeof t=="number"&&(t=t&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var o;if(typeof t=="number")for(o=r;o<n;++o)this[o]=t;else{var a=St.isBuffer(t)?t:new St(t),c=a.length;for(o=0;o<n-r;++o)this[o+r]=a[o%c]}return this};St.concat=function(t,r){if(!TY(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return rf(null,0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=U9(null,r),o=0;for(n=0;n<t.length;++n){var a=t[n];if(!St.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};St.byteLength=W9;St.prototype._isBuffer=!0;St.isBuffer=function(t){return!!(t!=null&&t._isBuffer)};f_.exports.alloc=function(e){var t=new St(e);return t.fill(0),t};f_.exports.from=function(e){return new St(e)}});var ps=E(ba=>{var c_,FY=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];ba.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};ba.getSymbolTotalCodewords=function(t){return FY[t]};ba.getBCHDigit=function(e){for(var t=0;e!==0;)t++,e>>>=1;return t};ba.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');c_=t};ba.isKanjiModeEnabled=function(){return typeof c_<"u"};ba.toSJIS=function(t){return c_(t)}});var Hp=E(hi=>{hi.L={bit:1};hi.M={bit:0};hi.Q={bit:3};hi.H={bit:2};function UY(e){if(typeof e!="string")throw new Error("Param is not a string");var t=e.toLowerCase();switch(t){case"l":case"low":return hi.L;case"m":case"medium":return hi.M;case"q":case"quartile":return hi.Q;case"h":case"high":return hi.H;default:throw new Error("Unknown EC Level: "+e)}}hi.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};hi.from=function(t,r){if(hi.isValid(t))return t;try{return UY(t)}catch{return r}}});var $9=E((kCe,V9)=>{function z9(){this.buffer=[],this.length=0}z9.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};V9.exports=z9});var Z9=E((PCe,G9)=>{var K9=ga();function Il(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=K9.alloc(e*e),this.reservedBit=K9.alloc(e*e)}Il.prototype.set=function(e,t,r,n){var i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)};Il.prototype.get=function(e,t){return this.data[e*this.size+t]};Il.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};Il.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};G9.exports=Il});var Y9=E(Wp=>{var HY=ps().getSymbolSize;Wp.getRowColCoords=function(t){if(t===1)return[];for(var r=Math.floor(t/7)+2,n=HY(t),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,o=[n-7],a=1;a<r-1;a++)o[a]=o[a-1]-i;return o.push(6),o.reverse()};Wp.getPositions=function(t){for(var r=[],n=Wp.getRowColCoords(t),i=n.length,o=0;o<i;o++)for(var a=0;a<i;a++)o===0&&a===0||o===0&&a===i-1||o===i-1&&a===0||r.push([n[o],n[a]]);return r}});var X9=E(Q9=>{var WY=ps().getSymbolSize,J9=7;Q9.getPositions=function(t){var r=WY(t);return[[0,0],[r-J9,0],[0,r-J9]]}});var e7=E(fr=>{fr.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var ya={N1:3,N2:3,N3:40,N4:10};fr.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};fr.from=function(t){return fr.isValid(t)?parseInt(t,10):void 0};fr.getPenaltyN1=function(t){for(var r=t.size,n=0,i=0,o=0,a=null,c=null,v=0;v<r;v++){i=o=0,a=c=null;for(var y=0;y<r;y++){var w=t.get(v,y);w===a?i++:(i>=5&&(n+=ya.N1+(i-5)),a=w,i=1),w=t.get(y,v),w===c?o++:(o>=5&&(n+=ya.N1+(o-5)),c=w,o=1)}i>=5&&(n+=ya.N1+(i-5)),o>=5&&(n+=ya.N1+(o-5))}return n};fr.getPenaltyN2=function(t){for(var r=t.size,n=0,i=0;i<r-1;i++)for(var o=0;o<r-1;o++){var a=t.get(i,o)+t.get(i,o+1)+t.get(i+1,o)+t.get(i+1,o+1);(a===4||a===0)&&n++}return n*ya.N2};fr.getPenaltyN3=function(t){for(var r=t.size,n=0,i=0,o=0,a=0;a<r;a++){i=o=0;for(var c=0;c<r;c++)i=i<<1&2047|t.get(a,c),c>=10&&(i===1488||i===93)&&n++,o=o<<1&2047|t.get(c,a),c>=10&&(o===1488||o===93)&&n++}return n*ya.N3};fr.getPenaltyN4=function(t){for(var r=0,n=t.data.length,i=0;i<n;i++)r+=t.data[i];var o=Math.abs(Math.ceil(r*100/n/5)-10);return o*ya.N4};function zY(e,t,r){switch(e){case fr.Patterns.PATTERN000:return(t+r)%2===0;case fr.Patterns.PATTERN001:return t%2===0;case fr.Patterns.PATTERN010:return r%3===0;case fr.Patterns.PATTERN011:return(t+r)%3===0;case fr.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case fr.Patterns.PATTERN101:return t*r%2+t*r%3===0;case fr.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case fr.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}fr.applyMask=function(t,r){for(var n=r.size,i=0;i<n;i++)for(var o=0;o<n;o++)r.isReserved(o,i)||r.xor(o,i,zY(t,o,i))};fr.getBestMask=function(t,r){for(var n=Object.keys(fr.Patterns).length,i=0,o=1/0,a=0;a<n;a++){r(a),fr.applyMask(a,t);var c=fr.getPenaltyN1(t)+fr.getPenaltyN2(t)+fr.getPenaltyN3(t)+fr.getPenaltyN4(t);fr.applyMask(a,t),c<o&&(o=c,i=a)}return i}});var h_=E(l_=>{var vs=Hp(),zp=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Vp=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];l_.getBlocksCount=function(t,r){switch(r){case vs.L:return zp[(t-1)*4+0];case vs.M:return zp[(t-1)*4+1];case vs.Q:return zp[(t-1)*4+2];case vs.H:return zp[(t-1)*4+3];default:return}};l_.getTotalCodewordsCount=function(t,r){switch(r){case vs.L:return Vp[(t-1)*4+0];case vs.M:return Vp[(t-1)*4+1];case vs.Q:return Vp[(t-1)*4+2];case vs.H:return Vp[(t-1)*4+3];default:return}}});var r7=E(Kp=>{var t7=ga(),Cl=t7.alloc(512),$p=t7.alloc(256);(function(){for(var t=1,r=0;r<255;r++)Cl[r]=t,$p[t]=r,t<<=1,t&256&&(t^=285);for(r=255;r<512;r++)Cl[r]=Cl[r-255]})();Kp.log=function(t){if(t<1)throw new Error("log("+t+")");return $p[t]};Kp.exp=function(t){return Cl[t]};Kp.mul=function(t,r){return t===0||r===0?0:Cl[$p[t]+$p[r]]}});var n7=E(Tl=>{var d_=ga(),p_=r7();Tl.mul=function(t,r){for(var n=d_.alloc(t.length+r.length-1),i=0;i<t.length;i++)for(var o=0;o<r.length;o++)n[i+o]^=p_.mul(t[i],r[o]);return n};Tl.mod=function(t,r){for(var n=d_.from(t);n.length-r.length>=0;){for(var i=n[0],o=0;o<r.length;o++)n[o]^=p_.mul(r[o],i);for(var a=0;a<n.length&&n[a]===0;)a++;n=n.slice(a)}return n};Tl.generateECPolynomial=function(t){for(var r=d_.from([1]),n=0;n<t;n++)r=Tl.mul(r,[1,p_.exp(n)]);return r}});var a7=E((FCe,s7)=>{var i7=ga(),o7=n7(),VY=fi().Buffer;function v_(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}v_.prototype.initialize=function(t){this.degree=t,this.genPoly=o7.generateECPolynomial(this.degree)};v_.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var r=i7.alloc(this.degree),n=VY.concat([t,r],t.length+this.degree),i=o7.mod(n,this.genPoly),o=this.degree-i.length;if(o>0){var a=i7.alloc(this.degree);return i.copy(a,o),a}return i};s7.exports=v_});var m_=E(u7=>{u7.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var g_=E(Do=>{var f7="[0-9]+",$Y="[A-Z $%*+\\-./:]+",kl="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kl=kl.replace(/u/g,"\\u");var KY="(?:(?![A-Z0-9 $%*+\\-./:]|"+kl+`)(?:.|[\r
2
+ ]))+`;Do.KANJI=new RegExp(kl,"g");Do.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Do.BYTE=new RegExp(KY,"g");Do.NUMERIC=new RegExp(f7,"g");Do.ALPHANUMERIC=new RegExp($Y,"g");var GY=new RegExp("^"+kl+"$"),ZY=new RegExp("^"+f7+"$"),YY=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Do.testKanji=function(t){return GY.test(t)};Do.testNumeric=function(t){return ZY.test(t)};Do.testAlphanumeric=function(t){return YY.test(t)}});var ms=E(Nr=>{var JY=m_(),b_=g_();Nr.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]};Nr.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]};Nr.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]};Nr.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]};Nr.MIXED={bit:-1};Nr.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!JY.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]};Nr.getBestModeForData=function(t){return b_.testNumeric(t)?Nr.NUMERIC:b_.testAlphanumeric(t)?Nr.ALPHANUMERIC:b_.testKanji(t)?Nr.KANJI:Nr.BYTE};Nr.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};Nr.isValid=function(t){return t&&t.bit&&t.ccBits};function QY(e){if(typeof e!="string")throw new Error("Param is not a string");var t=e.toLowerCase();switch(t){case"numeric":return Nr.NUMERIC;case"alphanumeric":return Nr.ALPHANUMERIC;case"kanji":return Nr.KANJI;case"byte":return Nr.BYTE;default:throw new Error("Unknown mode: "+e)}}Nr.from=function(t,r){if(Nr.isValid(t))return t;try{return QY(t)}catch{return r}}});var p7=E(_a=>{var Gp=ps(),XY=h_(),c7=Hp(),gs=ms(),y_=m_(),eJ=Up(),h7=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,l7=Gp.getBCHDigit(h7);function tJ(e,t,r){for(var n=1;n<=40;n++)if(t<=_a.getCapacity(n,r,e))return n}function d7(e,t){return gs.getCharCountIndicator(e,t)+4}function rJ(e,t){var r=0;return e.forEach(function(n){var i=d7(n.mode,t);r+=i+n.getBitsLength()}),r}function nJ(e,t){for(var r=1;r<=40;r++){var n=rJ(e,r);if(n<=_a.getCapacity(r,t,gs.MIXED))return r}}_a.from=function(t,r){return y_.isValid(t)?parseInt(t,10):r};_a.getCapacity=function(t,r,n){if(!y_.isValid(t))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=gs.BYTE);var i=Gp.getSymbolTotalCodewords(t),o=XY.getTotalCodewordsCount(t,r),a=(i-o)*8;if(n===gs.MIXED)return a;var c=a-d7(n,t);switch(n){case gs.NUMERIC:return Math.floor(c/10*3);case gs.ALPHANUMERIC:return Math.floor(c/11*2);case gs.KANJI:return Math.floor(c/13);case gs.BYTE:default:return Math.floor(c/8)}};_a.getBestVersionForData=function(t,r){var n,i=c7.from(r,c7.M);if(eJ(t)){if(t.length>1)return nJ(t,i);if(t.length===0)return 1;n=t[0]}else n=t;return tJ(n.mode,n.getLength(),i)};_a.getEncodedBits=function(t){if(!y_.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var r=t<<12;Gp.getBCHDigit(r)-l7>=0;)r^=h7<<Gp.getBCHDigit(r)-l7;return t<<12|r}});var b7=E(g7=>{var __=ps(),m7=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,iJ=1<<14|1<<12|1<<10|1<<4|1<<1,v7=__.getBCHDigit(m7);g7.getEncodedBits=function(t,r){for(var n=t.bit<<3|r,i=n<<10;__.getBCHDigit(i)-v7>=0;)i^=m7<<__.getBCHDigit(i)-v7;return(n<<10|i)^iJ}});var _7=E(($Ce,y7)=>{var oJ=ms();function nf(e){this.mode=oJ.NUMERIC,this.data=e.toString()}nf.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};nf.prototype.getLength=function(){return this.data.length};nf.prototype.getBitsLength=function(){return nf.getBitsLength(this.data.length)};nf.prototype.write=function(t){var r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),t.put(i,10);var o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),t.put(i,o*3+1))};y7.exports=nf});var x7=E((KCe,w7)=>{var sJ=ms(),w_=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function of(e){this.mode=sJ.ALPHANUMERIC,this.data=e}of.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};of.prototype.getLength=function(){return this.data.length};of.prototype.getBitsLength=function(){return of.getBitsLength(this.data.length)};of.prototype.write=function(t){var r;for(r=0;r+2<=this.data.length;r+=2){var n=w_.indexOf(this.data[r])*45;n+=w_.indexOf(this.data[r+1]),t.put(n,11)}this.data.length%2&&t.put(w_.indexOf(this.data[r]),6)};w7.exports=of});var S7=E((GCe,M7)=>{var aJ=ga(),uJ=ms();function sf(e){this.mode=uJ.BYTE,this.data=aJ.from(e)}sf.getBitsLength=function(t){return t*8};sf.prototype.getLength=function(){return this.data.length};sf.prototype.getBitsLength=function(){return sf.getBitsLength(this.data.length)};sf.prototype.write=function(e){for(var t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)};M7.exports=sf});var A7=E((ZCe,E7)=>{var fJ=ms(),cJ=ps();function af(e){this.mode=fJ.KANJI,this.data=e}af.getBitsLength=function(t){return t*13};af.prototype.getLength=function(){return this.data.length};af.prototype.getBitsLength=function(){return af.getBitsLength(this.data.length)};af.prototype.write=function(e){var t;for(t=0;t<this.data.length;t++){var r=cJ.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
3
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),e.put(r,13)}};E7.exports=af});var O7=E((YCe,x_)=>{"use strict";var Pl={single_source_shortest_paths:function(e,t,r){var n={},i={};i[t]=0;var o=Pl.PriorityQueue.make();o.push(t,0);for(var a,c,v,y,w,M,S,R,C;!o.empty();){a=o.pop(),c=a.value,y=a.cost,w=e[c]||{};for(v in w)w.hasOwnProperty(v)&&(M=w[v],S=y+M,R=i[v],C=typeof i[v]>"u",(C||R>S)&&(i[v]=S,o.push(v,S),n[v]=c))}if(typeof r<"u"&&typeof i[r]>"u"){var B=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(B)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t,i;n;)r.push(n),i=e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var n=Pl.single_source_shortest_paths(e,t,r);return Pl.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t=Pl.PriorityQueue,r={},n;e=e||{};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof x_<"u"&&(x_.exports=Pl)});var q7=E(uf=>{var Wt=ms(),C7=_7(),T7=x7(),k7=S7(),P7=A7(),Nl=g_(),Zp=ps(),lJ=O7();function R7(e){return unescape(encodeURIComponent(e)).length}function ql(e,t,r){for(var n=[],i;(i=e.exec(r))!==null;)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function N7(e){var t=ql(Nl.NUMERIC,Wt.NUMERIC,e),r=ql(Nl.ALPHANUMERIC,Wt.ALPHANUMERIC,e),n,i;Zp.isKanjiModeEnabled()?(n=ql(Nl.BYTE,Wt.BYTE,e),i=ql(Nl.KANJI,Wt.KANJI,e)):(n=ql(Nl.BYTE_KANJI,Wt.BYTE,e),i=[]);var o=t.concat(r,n,i);return o.sort(function(a,c){return a.index-c.index}).map(function(a){return{data:a.data,mode:a.mode,length:a.length}})}function M_(e,t){switch(t){case Wt.NUMERIC:return C7.getBitsLength(e);case Wt.ALPHANUMERIC:return T7.getBitsLength(e);case Wt.KANJI:return P7.getBitsLength(e);case Wt.BYTE:return k7.getBitsLength(e)}}function hJ(e){return e.reduce(function(t,r){var n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===r.mode?(t[t.length-1].data+=r.data,t):(t.push(r),t)},[])}function dJ(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];switch(n.mode){case Wt.NUMERIC:t.push([n,{data:n.data,mode:Wt.ALPHANUMERIC,length:n.length},{data:n.data,mode:Wt.BYTE,length:n.length}]);break;case Wt.ALPHANUMERIC:t.push([n,{data:n.data,mode:Wt.BYTE,length:n.length}]);break;case Wt.KANJI:t.push([n,{data:n.data,mode:Wt.BYTE,length:R7(n.data)}]);break;case Wt.BYTE:t.push([{data:n.data,mode:Wt.BYTE,length:R7(n.data)}])}}return t}function pJ(e,t){for(var r={},n={start:{}},i=["start"],o=0;o<e.length;o++){for(var a=e[o],c=[],v=0;v<a.length;v++){var y=a[v],w=""+o+v;c.push(w),r[w]={node:y,lastCount:0},n[w]={};for(var M=0;M<i.length;M++){var S=i[M];r[S]&&r[S].node.mode===y.mode?(n[S][w]=M_(r[S].lastCount+y.length,y.mode)-M_(r[S].lastCount,y.mode),r[S].lastCount+=y.length):(r[S]&&(r[S].lastCount=y.length),n[S][w]=M_(y.length,y.mode)+4+Wt.getCharCountIndicator(y.mode,t))}}i=c}for(M=0;M<i.length;M++)n[i[M]].end=0;return{map:n,table:r}}function I7(e,t){var r,n=Wt.getBestModeForData(e);if(r=Wt.from(t,n),r!==Wt.BYTE&&r.bit<n.bit)throw new Error('"'+e+'" cannot be encoded with mode '+Wt.toString(r)+`.
4
+ Suggested mode is: `+Wt.toString(n));switch(r===Wt.KANJI&&!Zp.isKanjiModeEnabled()&&(r=Wt.BYTE),r){case Wt.NUMERIC:return new C7(e);case Wt.ALPHANUMERIC:return new T7(e);case Wt.KANJI:return new P7(e);case Wt.BYTE:return new k7(e)}}uf.fromArray=function(t){return t.reduce(function(r,n){return typeof n=="string"?r.push(I7(n,null)):n.data&&r.push(I7(n.data,n.mode)),r},[])};uf.fromString=function(t,r){for(var n=N7(t,Zp.isKanjiModeEnabled()),i=dJ(n),o=pJ(i,r),a=lJ.find_path(o.map,"start","end"),c=[],v=1;v<a.length-1;v++)c.push(o.table[a[v]].node);return uf.fromArray(hJ(c))};uf.rawSplit=function(t){return uf.fromArray(N7(t,Zp.isKanjiModeEnabled()))}});var D7=E(B7=>{var L7=ga(),Jp=ps(),S_=Hp(),vJ=$9(),mJ=Z9(),gJ=Y9(),bJ=X9(),O_=e7(),R_=h_(),yJ=a7(),Yp=p7(),_J=b7(),wJ=ms(),E_=q7(),xJ=Up();function MJ(e,t){for(var r=e.size,n=bJ.getPositions(t),i=0;i<n.length;i++)for(var o=n[i][0],a=n[i][1],c=-1;c<=7;c++)if(!(o+c<=-1||r<=o+c))for(var v=-1;v<=7;v++)a+v<=-1||r<=a+v||(c>=0&&c<=6&&(v===0||v===6)||v>=0&&v<=6&&(c===0||c===6)||c>=2&&c<=4&&v>=2&&v<=4?e.set(o+c,a+v,!0,!0):e.set(o+c,a+v,!1,!0))}function SJ(e){for(var t=e.size,r=8;r<t-8;r++){var n=r%2===0;e.set(r,6,n,!0),e.set(6,r,n,!0)}}function EJ(e,t){for(var r=gJ.getPositions(t),n=0;n<r.length;n++)for(var i=r[n][0],o=r[n][1],a=-2;a<=2;a++)for(var c=-2;c<=2;c++)a===-2||a===2||c===-2||c===2||a===0&&c===0?e.set(i+a,o+c,!0,!0):e.set(i+a,o+c,!1,!0)}function AJ(e,t){for(var r=e.size,n=Yp.getEncodedBits(t),i,o,a,c=0;c<18;c++)i=Math.floor(c/3),o=c%3+r-8-3,a=(n>>c&1)===1,e.set(i,o,a,!0),e.set(o,i,a,!0)}function A_(e,t,r){var n=e.size,i=_J.getEncodedBits(t,r),o,a;for(o=0;o<15;o++)a=(i>>o&1)===1,o<6?e.set(o,8,a,!0):o<8?e.set(o+1,8,a,!0):e.set(n-15+o,8,a,!0),o<8?e.set(8,n-o-1,a,!0):o<9?e.set(8,15-o-1+1,a,!0):e.set(8,15-o-1,a,!0);e.set(n-8,8,1,!0)}function OJ(e,t){for(var r=e.size,n=-1,i=r-1,o=7,a=0,c=r-1;c>0;c-=2)for(c===6&&c--;;){for(var v=0;v<2;v++)if(!e.isReserved(i,c-v)){var y=!1;a<t.length&&(y=(t[a]>>>o&1)===1),e.set(i,c-v,y),o--,o===-1&&(a++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function RJ(e,t,r){var n=new vJ;r.forEach(function(y){n.put(y.mode.bit,4),n.put(y.getLength(),wJ.getCharCountIndicator(y.mode,e)),y.write(n)});var i=Jp.getSymbolTotalCodewords(e),o=R_.getTotalCodewordsCount(e,t),a=(i-o)*8;for(n.getLengthInBits()+4<=a&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);for(var c=(a-n.getLengthInBits())/8,v=0;v<c;v++)n.put(v%2?17:236,8);return IJ(n,e,t)}function IJ(e,t,r){for(var n=Jp.getSymbolTotalCodewords(t),i=R_.getTotalCodewordsCount(t,r),o=n-i,a=R_.getBlocksCount(t,r),c=n%a,v=a-c,y=Math.floor(n/a),w=Math.floor(o/a),M=w+1,S=y-w,R=new yJ(S),C=0,B=new Array(a),N=new Array(a),q=0,H=L7.from(e.buffer),D=0;D<a;D++){var ee=D<v?w:M;B[D]=H.slice(C,C+ee),N[D]=R.encode(B[D]),C+=ee,q=Math.max(q,ee)}var ge=L7.alloc(n),K=0,X,V;for(X=0;X<q;X++)for(V=0;V<a;V++)X<B[V].length&&(ge[K++]=B[V][X]);for(X=0;X<S;X++)for(V=0;V<a;V++)ge[K++]=N[V][X];return ge}function CJ(e,t,r,n){var i;if(xJ(e))i=E_.fromArray(e);else if(typeof e=="string"){var o=t;if(!o){var a=E_.rawSplit(e);o=Yp.getBestVersionForData(a,r)}i=E_.fromString(e,o||40)}else throw new Error("Invalid data");var c=Yp.getBestVersionForData(i,r);if(!c)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=c;else if(t<c)throw new Error(`
5
+ The chosen QR Code version cannot contain this amount of data.
6
+ Minimum version required to store current data is: `+c+`.
7
+ `);var v=RJ(t,r,i),y=Jp.getSymbolSize(t),w=new mJ(y);return MJ(w,t),SJ(w),EJ(w,t),A_(w,r,0),t>=7&&AJ(w,t),OJ(w,v),isNaN(n)&&(n=O_.getBestMask(w,A_.bind(null,w,r))),O_.applyMask(n,w),A_(w,r,n),{modules:w,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}B7.create=function(t,r){if(typeof t>"u"||t==="")throw new Error("No input text");var n=S_.M,i,o;return typeof r<"u"&&(n=S_.from(r.errorCorrectionLevel,S_.M),i=Yp.from(r.version),o=O_.from(r.maskPattern),r.toSJISFunc&&Jp.setToSJISFunction(r.toSJISFunc)),CJ(t,i,n,o)}});var I_=E(wa=>{function j7(e){if(typeof e=="number"&&(e=e.toString()),typeof e!="string")throw new Error("Color should be defined as hex string");var t=e.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(n){return[n,n]}))),t.length===6&&t.push("F","F");var r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+t.slice(0,6).join("")}}wa.getOptions=function(t){t||(t={}),t.color||(t.color={});var r=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:n,scale:n?4:i,margin:r,color:{dark:j7(t.color.dark||"#000000ff"),light:j7(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};wa.getScale=function(t,r){return r.width&&r.width>=t+r.margin*2?r.width/(t+r.margin*2):r.scale};wa.getImageWidth=function(t,r){var n=wa.getScale(t,r);return Math.floor((t+r.margin*2)*n)};wa.qrToImageData=function(t,r,n){for(var i=r.modules.size,o=r.modules.data,a=wa.getScale(i,n),c=Math.floor((i+n.margin*2)*a),v=n.margin*a,y=[n.color.light,n.color.dark],w=0;w<c;w++)for(var M=0;M<c;M++){var S=(w*c+M)*4,R=n.color.light;if(w>=v&&M>=v&&w<c-v&&M<c-v){var C=Math.floor((w-v)/a),B=Math.floor((M-v)/a);R=y[o[C*i+B]?1:0]}t[S++]=R.r,t[S++]=R.g,t[S++]=R.b,t[S]=R.a}}});var F7=E(Qp=>{var C_=I_();function TJ(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}function kJ(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}Qp.render=function(t,r,n){var i=n,o=r;typeof i>"u"&&(!r||!r.getContext)&&(i=r,r=void 0),r||(o=kJ()),i=C_.getOptions(i);var a=C_.getImageWidth(t.modules.size,i),c=o.getContext("2d"),v=c.createImageData(a,a);return C_.qrToImageData(v.data,t,i),TJ(c,o,a),c.putImageData(v,0,0),o};Qp.renderToDataURL=function(t,r,n){var i=n;typeof i>"u"&&(!r||!r.getContext)&&(i=r,r=void 0),i||(i={});var o=Qp.render(t,r,i),a=i.type||"image/png",c=i.rendererOpts||{};return o.toDataURL(a,c.quality)}});var W7=E(H7=>{var PJ=I_();function U7(e,t){var r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function T_(e,t,r){var n=e+t;return typeof r<"u"&&(n+=" "+r),n}function NJ(e,t,r){for(var n="",i=0,o=!1,a=0,c=0;c<e.length;c++){var v=Math.floor(c%t),y=Math.floor(c/t);!v&&!o&&(o=!0),e[c]?(a++,c>0&&v>0&&e[c-1]||(n+=o?T_("M",v+r,.5+y+r):T_("m",i,0),i=0,o=!1),v+1<t&&e[c+1]||(n+=T_("h",a),a=0)):i++}return n}H7.render=function(t,r,n){var i=PJ.getOptions(r),o=t.modules.size,a=t.modules.data,c=o+i.margin*2,v=i.color.light.a?"<path "+U7(i.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",y="<path "+U7(i.color.dark,"stroke")+' d="'+NJ(a,o,i.margin)+'"/>',w='viewBox="0 0 '+c+" "+c+'"',M=i.width?'width="'+i.width+'" height="'+i.width+'" ':"",S='<svg xmlns="http://www.w3.org/2000/svg" '+M+w+' shape-rendering="crispEdges">'+v+y+`</svg>
8
+ `;return typeof n=="function"&&n(null,S),S}});var V7=E(Ll=>{var qJ=D9(),k_=D7(),z7=F7(),LJ=W7();function P_(e,t,r,n,i){var o=[].slice.call(arguments,1),a=o.length,c=typeof o[a-1]=="function";if(!c&&!qJ())throw new Error("Callback required as last argument");if(c){if(a<2)throw new Error("Too few arguments provided");a===2?(i=r,r=t,t=n=void 0):a===3&&(t.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(r=t,t=n=void 0):a===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(y,w){try{var M=k_.create(r,n);y(e(M,t,n))}catch(S){w(S)}})}try{var v=k_.create(r,n);i(null,e(v,t,n))}catch(y){i(y)}}Ll.create=k_.create;Ll.toCanvas=P_.bind(null,z7.render);Ll.toDataURL=P_.bind(null,z7.renderToDataURL);Ll.toString=P_.bind(null,function(e,t,r){return LJ.render(e,r)})});var K7=E((nTe,$7)=>{$7.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(i){e.addRange(i)}),t&&t.focus()}}});var Y7=E((iTe,Z7)=>{"use strict";var BJ=K7(),G7={"text/plain":"Text","text/html":"Url",default:"Text"},DJ="Copy to clipboard: #{key}, Enter";function jJ(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function FJ(e,t){var r,n,i,o,a,c,v=!1;t||(t={}),r=t.debug||!1;try{i=BJ(),o=document.createRange(),a=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(w){if(w.stopPropagation(),t.format)if(w.preventDefault(),typeof w.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var M=G7[t.format]||G7.default;window.clipboardData.setData(M,e)}else w.clipboardData.clearData(),w.clipboardData.setData(t.format,e);t.onCopy&&(w.preventDefault(),t.onCopy(w.clipboardData))}),document.body.appendChild(c),o.selectNodeContents(c),a.addRange(o);var y=document.execCommand("copy");if(!y)throw new Error("copy command was unsuccessful");v=!0}catch(w){r&&console.error("unable to copy using execCommand: ",w),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),v=!0}catch(M){r&&console.error("unable to copy using clipboardData: ",M),r&&console.error("falling back to prompt"),n=jJ("message"in t?t.message:DJ),window.prompt(n,e)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(o):a.removeAllRanges()),c&&document.body.removeChild(c),i()}return v}Z7.exports=FJ});function jo(e,t){for(var r in t)e[r]=t[r];return e}function rA(e){var t=e.parentNode;t&&t.removeChild(e)}function Ti(e,t,r){var n,i=arguments,o={};for(n in t)n!=="key"&&n!=="ref"&&(o[n]=t[n]);if(arguments.length>3)for(r=[r],n=3;n<arguments.length;n++)r.push(i[n]);if(r!=null&&(o.children=r),typeof e=="function"&&e.defaultProps!=null)for(n in e.defaultProps)o[n]===void 0&&(o[n]=e.defaultProps[n]);return ev(e,o,t&&t.key,t&&t.ref,null)}function ev(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i};return i==null&&(o.__v=o),Ge.vnode&&Ge.vnode(o),o}function nv(){return{}}function xa(e){return e.children}function Qn(e,t){this.props=e,this.context=t}function Dl(e,t){if(t==null)return e.__?Dl(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Dl(e):null}function nA(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return nA(e)}}function Xp(e){(!e.__d&&(e.__d=!0)&&Bl.push(e)&&!N_++||J7!==Ge.debounceRendering)&&((J7=Ge.debounceRendering)||eA)(WJ)}function WJ(){for(var e;N_=Bl.length;)e=Bl.sort(function(t,r){return t.__v.__b-r.__v.__b}),Bl=[],e.some(function(t){var r,n,i,o,a,c,v;t.__d&&(c=(a=(r=t).__v).__e,(v=r.__P)&&(n=[],(i=jo({},a)).__v=i,o=L_(v,a,i,r.__n,v.ownerSVGElement!==void 0,null,n,c??Dl(a)),oA(n,a),o!=c&&nA(a)))})}function iA(e,t,r,n,i,o,a,c,v){var y,w,M,S,R,C,B,N=r&&r.__k||rv,q=N.length;if(c==Fo&&(c=o!=null?o[0]:q?Dl(r,0):null),y=0,t.__k=Uo(t.__k,function(H){if(H!=null){if(H.__=t,H.__b=t.__b+1,(M=N[y])===null||M&&H.key==M.key&&H.type===M.type)N[y]=void 0;else for(w=0;w<q;w++){if((M=N[w])&&H.key==M.key&&H.type===M.type){N[w]=void 0;break}M=null}if(S=L_(e,H,M=M||Fo,n,i,o,a,c,v),(w=H.ref)&&M.ref!=w&&(B||(B=[]),M.ref&&B.push(M.ref,null,H),B.push(w,H.__c||S,H)),S!=null){var D;if(C==null&&(C=S),H.__d!==void 0)D=H.__d,H.__d=void 0;else if(o==M||S!=c||S.parentNode==null){e:if(c==null||c.parentNode!==e)e.appendChild(S),D=null;else{for(R=c,w=0;(R=R.nextSibling)&&w<q;w+=2)if(R==S)break e;e.insertBefore(S,c),D=c}t.type=="option"&&(e.value="")}c=D!==void 0?D:S.nextSibling,typeof t.type=="function"&&(t.__d=c)}else c&&M.__e==c&&c.parentNode!=e&&(c=Dl(M))}return y++,H}),t.__e=C,o!=null&&typeof t.type!="function")for(y=o.length;y--;)o[y]!=null&&rA(o[y]);for(y=q;y--;)N[y]!=null&&ff(N[y],N[y]);if(B)for(y=0;y<B.length;y++)sA(B[y],B[++y],B[++y])}function Uo(e,t,r){if(r==null&&(r=[]),e==null||typeof e=="boolean")t&&r.push(t(null));else if(Array.isArray(e))for(var n=0;n<e.length;n++)Uo(e[n],t,r);else r.push(t?t(typeof e=="string"||typeof e=="number"?ev(null,e,null,null,e):e.__e!=null||e.__c!=null?ev(e.type,e.props,e.key,null,e.__v):e):e);return r}function zJ(e,t,r,n,i){var o;for(o in r)o==="children"||o==="key"||o in t||tv(e,o,null,r[o],n);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||r[o]===t[o]||tv(e,o,t[o],r[o],n)}function Q7(e,t,r){t[0]==="-"?e.setProperty(t,r):e[t]=typeof r=="number"&&HJ.test(t)===!1?r+"px":r??""}function tv(e,t,r,n,i){var o,a,c,v,y;if(i?t==="className"&&(t="class"):t==="class"&&(t="className"),t==="style")if(o=e.style,typeof r=="string")o.cssText=r;else{if(typeof n=="string"&&(o.cssText="",n=null),n)for(v in n)r&&v in r||Q7(o,v,"");if(r)for(y in r)n&&r[y]===n[y]||Q7(o,y,r[y])}else t[0]==="o"&&t[1]==="n"?(a=t!==(t=t.replace(/Capture$/,"")),c=t.toLowerCase(),t=(c in e?c:t).slice(2),r?(n||e.addEventListener(t,X7,a),(e.l||(e.l={}))[t]=r):e.removeEventListener(t,X7,a)):t!=="list"&&t!=="tagName"&&t!=="form"&&t!=="type"&&t!=="size"&&!i&&t in e?e[t]=r??"":typeof r!="function"&&t!=="dangerouslySetInnerHTML"&&(t!==(t=t.replace(/^xlink:?/,""))?r==null||r===!1?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):r==null||r===!1&&!/^ar/.test(t)?e.removeAttribute(t):e.setAttribute(t,r))}function X7(e){this.l[e.type](Ge.event?Ge.event(e):e)}function L_(e,t,r,n,i,o,a,c,v){var y,w,M,S,R,C,B,N,q,H,D=t.type;if(t.constructor!==void 0)return null;(y=Ge.__b)&&y(t);try{e:if(typeof D=="function"){if(N=t.props,q=(y=D.contextType)&&n[y.__c],H=y?q?q.props.value:y.__:n,r.__c?B=(w=t.__c=r.__c).__=w.__E:("prototype"in D&&D.prototype.render?t.__c=w=new D(N,H):(t.__c=w=new Qn(N,H),w.constructor=D,w.render=$J),q&&q.sub(w),w.props=N,w.state||(w.state={}),w.context=H,w.__n=n,M=w.__d=!0,w.__h=[]),w.__s==null&&(w.__s=w.state),D.getDerivedStateFromProps!=null&&(w.__s==w.state&&(w.__s=jo({},w.__s)),jo(w.__s,D.getDerivedStateFromProps(N,w.__s))),S=w.props,R=w.state,M)D.getDerivedStateFromProps==null&&w.componentWillMount!=null&&w.componentWillMount(),w.componentDidMount!=null&&w.__h.push(w.componentDidMount);else{if(D.getDerivedStateFromProps==null&&N!==S&&w.componentWillReceiveProps!=null&&w.componentWillReceiveProps(N,H),!w.__e&&w.shouldComponentUpdate!=null&&w.shouldComponentUpdate(N,w.__s,H)===!1||t.__v===r.__v&&!w.__){for(w.props=N,w.state=w.__s,t.__v!==r.__v&&(w.__d=!1),w.__v=t,t.__e=r.__e,t.__k=r.__k,w.__h.length&&a.push(w),y=0;y<t.__k.length;y++)t.__k[y]&&(t.__k[y].__=t);break e}w.componentWillUpdate!=null&&w.componentWillUpdate(N,w.__s,H),w.componentDidUpdate!=null&&w.__h.push(function(){w.componentDidUpdate(S,R,C)})}w.context=H,w.props=N,w.state=w.__s,(y=Ge.__r)&&y(t),w.__d=!1,w.__v=t,w.__P=e,y=w.render(w.props,w.state,w.context),t.__k=y!=null&&y.type==xa&&y.key==null?y.props.children:Array.isArray(y)?y:[y],w.getChildContext!=null&&(n=jo(jo({},n),w.getChildContext())),M||w.getSnapshotBeforeUpdate==null||(C=w.getSnapshotBeforeUpdate(S,R)),iA(e,t,r,n,i,o,a,c,v),w.base=t.__e,w.__h.length&&a.push(w),B&&(w.__E=w.__=null),w.__e=!1}else o==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=VJ(r.__e,t,r,n,i,o,a,v);(y=Ge.diffed)&&y(t)}catch(ee){t.__v=null,Ge.__e(ee,t,r)}return t.__e}function oA(e,t){Ge.__c&&Ge.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(n){n.call(r)})}catch(n){Ge.__e(n,r.__v)}})}function VJ(e,t,r,n,i,o,a,c){var v,y,w,M,S,R=r.props,C=t.props;if(i=t.type==="svg"||i,o!=null){for(v=0;v<o.length;v++)if((y=o[v])!=null&&((t.type===null?y.nodeType===3:y.localName===t.type)||e==y)){e=y,o[v]=null;break}}if(e==null){if(t.type===null)return document.createTextNode(C);e=i?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type,C.is&&{is:C.is}),o=null,c=!1}if(t.type===null)R!==C&&e.data!=C&&(e.data=C);else{if(o!=null&&(o=rv.slice.call(e.childNodes)),w=(R=r.props||Fo).dangerouslySetInnerHTML,M=C.dangerouslySetInnerHTML,!c){if(R===Fo)for(R={},S=0;S<e.attributes.length;S++)R[e.attributes[S].name]=e.attributes[S].value;(M||w)&&(M&&w&&M.__html==w.__html||(e.innerHTML=M&&M.__html||""))}zJ(e,C,R,i,c),M?t.__k=[]:(t.__k=t.props.children,iA(e,t,r,n,t.type!=="foreignObject"&&i,o,a,Fo,c)),c||("value"in C&&(v=C.value)!==void 0&&v!==e.value&&tv(e,"value",v,R.value,!1),"checked"in C&&(v=C.checked)!==void 0&&v!==e.checked&&tv(e,"checked",v,R.checked,!1))}return e}function sA(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){Ge.__e(n,r)}}function ff(e,t,r){var n,i,o;if(Ge.unmount&&Ge.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||sA(n,null,t)),r||typeof e.type=="function"||(r=(i=e.__e)!=null),e.__e=e.__d=void 0,(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(a){Ge.__e(a,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&ff(n[o],t,r);i!=null&&rA(i)}function $J(e,t,r){return this.constructor(e,r)}function cf(e,t,r){var n,i,o;Ge.__&&Ge.__(e,t),i=(n=r===q_)?null:r&&r.__k||t.__k,e=Ti(xa,null,[e]),o=[],L_(t,(n?t:r||t).__k=e,i||Fo,Fo,t.ownerSVGElement!==void 0,r&&!n?[r]:i?null:rv.slice.call(t.childNodes),o,r||Fo,n),oA(o,e)}function B_(e,t){cf(e,t,q_)}function aA(e,t){var r,n;for(n in t=jo(jo({},e.props),t),arguments.length>2&&(t.children=rv.slice.call(arguments,2)),r={},t)n!=="key"&&n!=="ref"&&(r[n]=t[n]);return ev(e.type,r,t.key||e.key,t.ref||e.ref,null)}function iv(e){var t={},r={__c:"__cC"+tA++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,o=this;return this.getChildContext||(i=[],this.getChildContext=function(){return t[r.__c]=o,t},this.shouldComponentUpdate=function(a){o.props.value!==a.value&&i.some(function(c){c.context=a.value,Xp(c)})},this.sub=function(a){i.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),c&&c.call(a)}}),n.children}};return r.Consumer.contextType=r,r.Provider.__=r,r}var Ge,UJ,Bl,N_,eA,J7,q_,tA,Fo,rv,HJ,ov=yt(()=>{Fo={},rv=[],HJ=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;Ge={__e:function(e,t){for(var r,n;t=t.__;)if((r=t.__c)&&!r.__)try{if(r.constructor&&r.constructor.getDerivedStateFromError!=null&&(n=!0,r.setState(r.constructor.getDerivedStateFromError(e))),r.componentDidCatch!=null&&(n=!0,r.componentDidCatch(e)),n)return Xp(r.__E=r)}catch(i){e=i}throw e}},UJ=function(e){return e!=null&&e.constructor===void 0},Qn.prototype.setState=function(e,t){var r;r=this.__s!==this.state?this.__s:this.__s=jo({},this.state),typeof e=="function"&&(e=e(r,this.props)),e&&jo(r,e),e!=null&&this.__v&&(t&&this.__h.push(t),Xp(this))},Qn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Xp(this))},Qn.prototype.render=xa,Bl=[],N_=0,eA=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,q_=Fo,tA=0});function hf(e,t){Ge.__h&&Ge.__h(Un,e,lf||t),lf=0;var r=Un.__H||(Un.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function sv(e){return lf=1,av(dA,e)}function av(e,t,r){var n=hf(Ma++,2);return n.__c||(n.__c=Un,n.__=[r?r(t):dA(void 0,t),function(i){var o=e(n.__[0],i);n.__[0]!==o&&(n.__[0]=o,n.__c.setState({}))}]),n.__}function U_(e,t){var r=hf(Ma++,3);!Ge.__s&&K_(r.__H,t)&&(r.__=e,r.__H=t,Un.__H.__h.push(r))}function uv(e,t){var r=hf(Ma++,4);!Ge.__s&&K_(r.__H,t)&&(r.__=e,r.__H=t,Un.__h.push(r))}function H_(e){return lf=5,jl(function(){return{current:e}},[])}function W_(e,t,r){lf=6,uv(function(){typeof e=="function"?e(t()):e&&(e.current=t())},r==null?r:r.concat(e))}function jl(e,t){var r=hf(Ma++,7);return K_(r.__H,t)?(r.__H=t,r.__h=e,r.__=e()):r.__}function z_(e,t){return lf=8,jl(function(){return e},t)}function V_(e){var t=Un.context[e.__c],r=hf(Ma++,9);return r.__c=e,t?(r.__==null&&(r.__=!0,t.sub(Un)),t.props.value):e.__}function $_(e,t){Ge.useDebugValue&&Ge.useDebugValue(t?t(e):e)}function KJ(e){var t=hf(Ma++,10),r=sv();return t.__=e,Un.componentDidCatch||(Un.componentDidCatch=function(n){t.__&&t.__(n),r[1](n)}),[r[0],function(){r[1](void 0)}]}function GJ(){D_.some(function(e){if(e.__P)try{e.__H.__h.forEach(j_),e.__H.__h.forEach(F_),e.__H.__h=[]}catch(t){return e.__H.__h=[],Ge.__e(t,e.__v),!0}}),D_=[]}function j_(e){e.t&&e.t()}function F_(e){var t=e.__();typeof t=="function"&&(e.t=t)}function K_(e,t){return!e||t.some(function(r,n){return r!==e[n]})}function dA(e,t){return typeof t=="function"?t(e):t}var Ma,Un,uA,lf,D_,fA,cA,lA,hA,G_=yt(()=>{ov();lf=0,D_=[],fA=Ge.__r,cA=Ge.diffed,lA=Ge.__c,hA=Ge.unmount;Ge.__r=function(e){fA&&fA(e),Ma=0,(Un=e.__c).__H&&(Un.__H.__h.forEach(j_),Un.__H.__h.forEach(F_),Un.__H.__h=[])},Ge.diffed=function(e){cA&&cA(e);var t=e.__c;if(t){var r=t.__H;r&&r.__h.length&&(D_.push(t)!==1&&uA===Ge.requestAnimationFrame||((uA=Ge.requestAnimationFrame)||function(n){var i,o=function(){clearTimeout(a),cancelAnimationFrame(i),setTimeout(n)},a=setTimeout(o,100);typeof window<"u"&&(i=requestAnimationFrame(o))})(GJ))}},Ge.__c=function(e,t){t.some(function(r){try{r.__h.forEach(j_),r.__h=r.__h.filter(function(n){return!n.__||F_(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Ge.__e(n,r.__v)}}),lA&&lA(e,t)},Ge.unmount=function(e){hA&&hA(e);var t=e.__c;if(t){var r=t.__H;if(r)try{r.__.forEach(function(n){return n.t&&n.t()})}catch(n){Ge.__e(n,t.__v)}}}});var qA={};Mr(qA,{Children:()=>SA,Component:()=>Qn,Fragment:()=>xa,PureComponent:()=>wA,Suspense:()=>fv,SuspenseList:()=>df,cloneElement:()=>TA,createContext:()=>iv,createElement:()=>Ti,createFactory:()=>CA,createPortal:()=>RA,createRef:()=>nv,default:()=>eQ,findDOMNode:()=>PA,forwardRef:()=>MA,hydrate:()=>QJ,isValidElement:()=>X_,lazy:()=>OA,memo:()=>xA,render:()=>J_,unmountComponentAtNode:()=>kA,unstable_batchedUpdates:()=>NA,useCallback:()=>z_,useContext:()=>V_,useDebugValue:()=>$_,useEffect:()=>U_,useErrorBoundary:()=>KJ,useImperativeHandle:()=>W_,useLayoutEffect:()=>uv,useMemo:()=>jl,useReducer:()=>av,useRef:()=>H_,useState:()=>sv,version:()=>XJ});function Q_(e,t){for(var r in t)e[r]=t[r];return e}function Y_(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function xA(e,t){function r(i){var o=this.props.ref,a=o==i.ref;return!a&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!a:Y_(this.props,i)}function n(i){return this.shouldComponentUpdate=r,Ti(e,Q_({},i))}return n.prototype.isReactComponent=!0,n.displayName="Memo("+(e.displayName||e.name)+")",n.t=!0,n}function MA(e){function t(r){var n=Q_({},r);return delete n.ref,e(n,r.ref)}return t.prototype.isReactComponent=t.t=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}function EA(e){return e&&((e=Q_({},e)).__c=null,e.__k=e.__k&&e.__k.map(EA)),e}function fv(){this.__u=0,this.o=null,this.__b=null}function AA(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function OA(e){var t,r,n;function i(o){if(t||(t=e()).then(function(a){r=a.default||a},function(a){n=a}),n)throw n;if(!r)throw t;return Ti(r,o)}return i.displayName="Lazy",i.t=!0,i}function df(){this.i=null,this.l=null}function JJ(e){var t=this,r=e.container,n=Ti(YJ,{context:t.context},e.vnode);return t.s&&t.s!==r&&(t.v.parentNode&&t.s.removeChild(t.v),ff(t.h),t.p=!1),e.vnode?t.p?(r.__k=t.__k,cf(n,r),t.__k=r.__k):(t.v=document.createTextNode(""),B_("",r),r.appendChild(t.v),t.p=!0,t.s=r,cf(n,r,t.v),t.__k=t.v.__k):t.p&&(t.v.parentNode&&t.s.removeChild(t.v),ff(t.h)),t.h=n,t.componentWillUnmount=function(){t.v.parentNode&&t.s.removeChild(t.v),ff(t.h)},null}function RA(e,t){return Ti(JJ,{vnode:e,container:t})}function J_(e,t,r){if(t.__k==null)for(;t.firstChild;)t.removeChild(t.firstChild);return cf(e,t),typeof r=="function"&&r(),e?e.__c:null}function QJ(e,t,r){return B_(e,t),typeof r=="function"&&r(),e?e.__c:null}function Z_(e,t){e["UNSAFE_"+t]&&!e[t]&&Object.defineProperty(e,t,{configurable:!1,get:function(){return this["UNSAFE_"+t]},set:function(r){this["UNSAFE_"+t]=r}})}function CA(e){return Ti.bind(null,e)}function X_(e){return!!e&&e.$$typeof===IA}function TA(e){return X_(e)?aA.apply(null,arguments):e}function kA(e){return!!e.__k&&(cf(null,e),!0)}function PA(e){return e&&(e.base||e.nodeType===1&&e)||null}var wA,pA,vA,SA,ZJ,mA,YJ,gA,IA,bA,yA,_A,XJ,NA,eQ,LA=yt(()=>{G_();G_();ov();ov();wA=function(e){var t,r;function n(i){var o;return(o=e.call(this,i)||this).isPureReactComponent=!0,o}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.prototype.shouldComponentUpdate=function(i,o){return Y_(this.props,i)||Y_(this.state,o)},n}(Qn);pA=Ge.__b;Ge.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),pA&&pA(e)};vA=function(e,t){return e?Uo(e).reduce(function(r,n,i){return r.concat(t(n,i))},[]):null},SA={map:vA,forEach:vA,count:function(e){return e?Uo(e).length:0},only:function(e){if((e=Uo(e)).length!==1)throw new Error("Children.only() expects only one child.");return e[0]},toArray:Uo},ZJ=Ge.__e;Ge.__e=function(e,t,r){if(e.then){for(var n,i=t;i=i.__;)if((n=i.__c)&&n.__c)return n.__c(e,t.__c)}ZJ(e,t,r)},(fv.prototype=new Qn).__c=function(e,t){var r=this;r.o==null&&(r.o=[]),r.o.push(t);var n=AA(r.__v),i=!1,o=function(){i||(i=!0,n?n(a):a())};t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){o(),t.__c&&t.__c()};var a=function(){var c;if(!--r.__u)for(r.__v.__k[0]=r.state.u,r.setState({u:r.__b=null});c=r.o.pop();)c.forceUpdate()};r.__u++||r.setState({u:r.__b=r.__v.__k[0]}),e.then(o,o)},fv.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=EA(this.__b),this.__b=null),[Ti(Qn,null,t.u?null:e.children),t.u&&e.fallback]};mA=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(df.prototype=new Qn).u=function(e){var t=this,r=AA(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),mA(t,e,n)):i()};r?r(o):o()}},df.prototype.render=function(e){this.i=null,this.l=new Map;var t=Uo(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},df.prototype.componentDidUpdate=df.prototype.componentDidMount=function(){var e=this;e.l.forEach(function(t,r){mA(e,r,t)})};YJ=function(){function e(){}var t=e.prototype;return t.getChildContext=function(){return this.props.context},t.render=function(r){return r.children},e}();gA=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;Qn.prototype.isReactComponent={};IA=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103;bA=Ge.event;Ge.event=function(e){bA&&(e=bA(e)),e.persist=function(){};var t=!1,r=!1,n=e.stopPropagation;e.stopPropagation=function(){n.call(e),t=!0};var i=e.preventDefault;return e.preventDefault=function(){i.call(e),r=!0},e.isPropagationStopped=function(){return t},e.isDefaultPrevented=function(){return r},e.nativeEvent=e};yA={configurable:!0,get:function(){return this.class}},_A=Ge.vnode;Ge.vnode=function(e){e.$$typeof=IA;var t=e.type,r=e.props;if(t){if(r.class!=r.className&&(yA.enumerable="className"in r,r.className!=null&&(r.class=r.className),Object.defineProperty(r,"className",yA)),typeof t!="function"){var n,i,o;for(o in r.defaultValue&&r.value!==void 0&&(r.value||r.value===0||(r.value=r.defaultValue),delete r.defaultValue),Array.isArray(r.value)&&r.multiple&&t==="select"&&(Uo(r.children).forEach(function(a){r.value.indexOf(a.props.value)!=-1&&(a.props.selected=!0)}),delete r.value),r)if(n=gA.test(o))break;if(n)for(o in i=e.props={},r)i[gA.test(o)?o.replace(/[A-Z0-9]/,"-$&").toLowerCase():o]=r[o]}(function(a){var c=e.type,v=e.props;if(v&&typeof c=="string"){var y={};for(var w in v)/^on(Ani|Tra|Tou)/.test(w)&&(v[w.toLowerCase()]=v[w],delete v[w]),y[w.toLowerCase()]=w;if(y.ondoubleclick&&(v.ondblclick=v[y.ondoubleclick],delete v[y.ondoubleclick]),y.onbeforeinput&&(v.onbeforeinput=v[y.onbeforeinput],delete v[y.onbeforeinput]),y.onchange&&(c==="textarea"||c.toLowerCase()==="input"&&!/^fil|che|ra/i.test(v.type))){var M=y.oninput||"oninput";v[M]||(v[M]=v[y.onchange],delete v[y.onchange])}}})(),typeof t=="function"&&!t.m&&t.prototype&&(Z_(t.prototype,"componentWillMount"),Z_(t.prototype,"componentWillReceiveProps"),Z_(t.prototype,"componentWillUpdate"),t.m=!0)}_A&&_A(e)};XJ="16.8.0";NA=function(e,t){return e(t)},eQ={useState:sv,useReducer:av,useEffect:U_,useLayoutEffect:uv,useRef:H_,useImperativeHandle:W_,useMemo:jl,useCallback:z_,useContext:V_,useDebugValue:$_,version:"16.8.0",Children:SA,render:J_,hydrate:J_,unmountComponentAtNode:kA,createPortal:RA,createElement:Ti,createContext:iv,createFactory:CA,cloneElement:TA,createRef:nv,Fragment:xa,isValidElement:X_,findDOMNode:PA,Component:Qn,PureComponent:wA,memo:xA,forwardRef:MA,unstable_batchedUpdates:NA,Suspense:fv,SuspenseList:df,lazy:OA}});var KA=E((pTe,$A)=>{function jA(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var In=(vy(),Pt(oE)),FA=jA(V7()),tQ=jA(Y7()),He=(LA(),Pt(qA));function rQ(e){FA.toString(e,{type:"terminal"}).then(console.log)}var nQ=`:root {
9
+ --animation-duration: 300ms;
10
+ }
11
+
12
+ @keyframes fadeIn {
13
+ from {
14
+ opacity: 0;
15
+ }
16
+ to {
17
+ opacity: 1;
18
+ }
19
+ }
20
+
21
+ @keyframes fadeOut {
22
+ from {
23
+ opacity: 1;
24
+ }
25
+ to {
26
+ opacity: 0;
27
+ }
28
+ }
29
+
30
+ .animated {
31
+ animation-duration: var(--animation-duration);
32
+ animation-fill-mode: both;
33
+ }
34
+
35
+ .fadeIn {
36
+ animation-name: fadeIn;
37
+ }
38
+
39
+ .fadeOut {
40
+ animation-name: fadeOut;
41
+ }
42
+
43
+ #walletconnect-wrapper {
44
+ -webkit-user-select: none;
45
+ align-items: center;
46
+ display: flex;
47
+ height: 100%;
48
+ justify-content: center;
49
+ left: 0;
50
+ pointer-events: none;
51
+ position: fixed;
52
+ top: 0;
53
+ user-select: none;
54
+ width: 100%;
55
+ z-index: 99999999999999;
56
+ }
57
+
58
+ .walletconnect-modal__headerLogo {
59
+ height: 21px;
60
+ }
61
+
62
+ .walletconnect-modal__header p {
63
+ color: #ffffff;
64
+ font-size: 20px;
65
+ font-weight: 600;
66
+ margin: 0;
67
+ align-items: flex-start;
68
+ display: flex;
69
+ flex: 1;
70
+ margin-left: 5px;
71
+ }
72
+
73
+ .walletconnect-modal__close__wrapper {
74
+ position: absolute;
75
+ top: 0px;
76
+ right: 0px;
77
+ z-index: 10000;
78
+ background: white;
79
+ border-radius: 26px;
80
+ padding: 6px;
81
+ box-sizing: border-box;
82
+ width: 26px;
83
+ height: 26px;
84
+ cursor: pointer;
85
+ }
86
+
87
+ .walletconnect-modal__close__icon {
88
+ position: relative;
89
+ top: 7px;
90
+ right: 0;
91
+ display: flex;
92
+ align-items: center;
93
+ justify-content: center;
94
+ transform: rotate(45deg);
95
+ }
96
+
97
+ .walletconnect-modal__close__line1 {
98
+ position: absolute;
99
+ width: 100%;
100
+ border: 1px solid rgb(48, 52, 59);
101
+ }
102
+
103
+ .walletconnect-modal__close__line2 {
104
+ position: absolute;
105
+ width: 100%;
106
+ border: 1px solid rgb(48, 52, 59);
107
+ transform: rotate(90deg);
108
+ }
109
+
110
+ .walletconnect-qrcode__base {
111
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
112
+ background: rgba(37, 41, 46, 0.95);
113
+ height: 100%;
114
+ left: 0;
115
+ pointer-events: auto;
116
+ position: fixed;
117
+ top: 0;
118
+ transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
119
+ width: 100%;
120
+ will-change: opacity;
121
+ padding: 40px;
122
+ box-sizing: border-box;
123
+ }
124
+
125
+ .walletconnect-qrcode__text {
126
+ color: rgba(60, 66, 82, 0.6);
127
+ font-size: 16px;
128
+ font-weight: 600;
129
+ letter-spacing: 0;
130
+ line-height: 1.1875em;
131
+ margin: 10px 0 20px 0;
132
+ text-align: center;
133
+ width: 100%;
134
+ }
135
+
136
+ @media only screen and (max-width: 768px) {
137
+ .walletconnect-qrcode__text {
138
+ font-size: 4vw;
139
+ }
140
+ }
141
+
142
+ @media only screen and (max-width: 320px) {
143
+ .walletconnect-qrcode__text {
144
+ font-size: 14px;
145
+ }
146
+ }
147
+
148
+ .walletconnect-qrcode__image {
149
+ width: calc(100% - 30px);
150
+ box-sizing: border-box;
151
+ cursor: none;
152
+ margin: 0 auto;
153
+ }
154
+
155
+ .walletconnect-qrcode__notification {
156
+ position: absolute;
157
+ bottom: 0;
158
+ left: 0;
159
+ right: 0;
160
+ font-size: 16px;
161
+ padding: 16px 20px;
162
+ border-radius: 16px;
163
+ text-align: center;
164
+ transition: all 0.1s ease-in-out;
165
+ background: white;
166
+ color: black;
167
+ margin-bottom: -60px;
168
+ opacity: 0;
169
+ }
170
+
171
+ .walletconnect-qrcode__notification.notification__show {
172
+ opacity: 1;
173
+ }
174
+
175
+ @media only screen and (max-width: 768px) {
176
+ .walletconnect-modal__header {
177
+ height: 130px;
178
+ }
179
+ .walletconnect-modal__base {
180
+ overflow: auto;
181
+ }
182
+ }
183
+
184
+ @media only screen and (min-device-width: 415px) and (max-width: 768px) {
185
+ #content {
186
+ max-width: 768px;
187
+ box-sizing: border-box;
188
+ }
189
+ }
190
+
191
+ @media only screen and (min-width: 375px) and (max-width: 415px) {
192
+ #content {
193
+ max-width: 414px;
194
+ box-sizing: border-box;
195
+ }
196
+ }
197
+
198
+ @media only screen and (min-width: 320px) and (max-width: 375px) {
199
+ #content {
200
+ max-width: 375px;
201
+ box-sizing: border-box;
202
+ }
203
+ }
204
+
205
+ @media only screen and (max-width: 320px) {
206
+ #content {
207
+ max-width: 320px;
208
+ box-sizing: border-box;
209
+ }
210
+ }
211
+
212
+ .walletconnect-modal__base {
213
+ -webkit-font-smoothing: antialiased;
214
+ background: #ffffff;
215
+ border-radius: 24px;
216
+ box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);
217
+ font-family: ui-rounded, "SF Pro Rounded", "SF Pro Text", medium-content-sans-serif-font,
218
+ -apple-system, BlinkMacSystemFont, ui-sans-serif, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
219
+ "Open Sans", "Helvetica Neue", sans-serif;
220
+ margin-top: 41px;
221
+ padding: 24px 24px 22px;
222
+ pointer-events: auto;
223
+ position: relative;
224
+ text-align: center;
225
+ transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
226
+ will-change: transform;
227
+ overflow: visible;
228
+ transform: translateY(-50%);
229
+ top: 50%;
230
+ max-width: 500px;
231
+ margin: auto;
232
+ }
233
+
234
+ @media only screen and (max-width: 320px) {
235
+ .walletconnect-modal__base {
236
+ padding: 24px 12px;
237
+ }
238
+ }
239
+
240
+ .walletconnect-modal__base .hidden {
241
+ transform: translateY(150%);
242
+ transition: 0.125s cubic-bezier(0.4, 0, 1, 1);
243
+ }
244
+
245
+ .walletconnect-modal__header {
246
+ align-items: center;
247
+ display: flex;
248
+ height: 26px;
249
+ left: 0;
250
+ justify-content: space-between;
251
+ position: absolute;
252
+ top: -42px;
253
+ width: 100%;
254
+ }
255
+
256
+ .walletconnect-modal__base .wc-logo {
257
+ align-items: center;
258
+ display: flex;
259
+ height: 26px;
260
+ margin-top: 15px;
261
+ padding-bottom: 15px;
262
+ pointer-events: auto;
263
+ }
264
+
265
+ .walletconnect-modal__base .wc-logo div {
266
+ background-color: #3399ff;
267
+ height: 21px;
268
+ margin-right: 5px;
269
+ mask-image: url("images/wc-logo.svg") center no-repeat;
270
+ width: 32px;
271
+ }
272
+
273
+ .walletconnect-modal__base .wc-logo p {
274
+ color: #ffffff;
275
+ font-size: 20px;
276
+ font-weight: 600;
277
+ margin: 0;
278
+ }
279
+
280
+ .walletconnect-modal__base h2 {
281
+ color: rgba(60, 66, 82, 0.6);
282
+ font-size: 16px;
283
+ font-weight: 600;
284
+ letter-spacing: 0;
285
+ line-height: 1.1875em;
286
+ margin: 0 0 19px 0;
287
+ text-align: center;
288
+ width: 100%;
289
+ }
290
+
291
+ .walletconnect-modal__base__row {
292
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
293
+ align-items: center;
294
+ border-radius: 20px;
295
+ cursor: pointer;
296
+ display: flex;
297
+ height: 56px;
298
+ justify-content: space-between;
299
+ padding: 0 15px;
300
+ position: relative;
301
+ margin: 0px 0px 8px;
302
+ text-align: left;
303
+ transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
304
+ will-change: transform;
305
+ text-decoration: none;
306
+ }
307
+
308
+ .walletconnect-modal__base__row:hover {
309
+ background: rgba(60, 66, 82, 0.06);
310
+ }
311
+
312
+ .walletconnect-modal__base__row:active {
313
+ background: rgba(60, 66, 82, 0.06);
314
+ transform: scale(0.975);
315
+ transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
316
+ }
317
+
318
+ .walletconnect-modal__base__row__h3 {
319
+ color: #25292e;
320
+ font-size: 20px;
321
+ font-weight: 700;
322
+ margin: 0;
323
+ padding-bottom: 3px;
324
+ }
325
+
326
+ .walletconnect-modal__base__row__right {
327
+ align-items: center;
328
+ display: flex;
329
+ justify-content: center;
330
+ }
331
+
332
+ .walletconnect-modal__base__row__right__app-icon {
333
+ border-radius: 8px;
334
+ height: 34px;
335
+ margin: 0 11px 2px 0;
336
+ width: 34px;
337
+ background-size: 100%;
338
+ box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);
339
+ }
340
+
341
+ .walletconnect-modal__base__row__right__caret {
342
+ height: 18px;
343
+ opacity: 0.3;
344
+ transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
345
+ width: 8px;
346
+ will-change: opacity;
347
+ }
348
+
349
+ .walletconnect-modal__base__row:hover .caret,
350
+ .walletconnect-modal__base__row:active .caret {
351
+ opacity: 0.6;
352
+ }
353
+
354
+ .walletconnect-modal__mobile__toggle {
355
+ width: 80%;
356
+ display: flex;
357
+ margin: 0 auto;
358
+ position: relative;
359
+ overflow: hidden;
360
+ border-radius: 8px;
361
+ margin-bottom: 18px;
362
+ background: #d4d5d9;
363
+ }
364
+
365
+ .walletconnect-modal__single_wallet {
366
+ display: flex;
367
+ justify-content: center;
368
+ margin-top: 7px;
369
+ margin-bottom: 18px;
370
+ }
371
+
372
+ .walletconnect-modal__single_wallet a {
373
+ cursor: pointer;
374
+ color: rgb(64, 153, 255);
375
+ font-size: 21px;
376
+ font-weight: 800;
377
+ text-decoration: none !important;
378
+ margin: 0 auto;
379
+ }
380
+
381
+ .walletconnect-modal__mobile__toggle_selector {
382
+ width: calc(50% - 8px);
383
+ background: white;
384
+ position: absolute;
385
+ border-radius: 5px;
386
+ height: calc(100% - 8px);
387
+ top: 4px;
388
+ transition: all 0.2s ease-in-out;
389
+ transform: translate3d(4px, 0, 0);
390
+ }
391
+
392
+ .walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {
393
+ transform: translate3d(calc(100% + 12px), 0, 0);
394
+ }
395
+
396
+ .walletconnect-modal__mobile__toggle a {
397
+ font-size: 12px;
398
+ width: 50%;
399
+ text-align: center;
400
+ padding: 8px;
401
+ margin: 0;
402
+ font-weight: 600;
403
+ z-index: 1;
404
+ }
405
+
406
+ .walletconnect-modal__footer {
407
+ display: flex;
408
+ justify-content: center;
409
+ margin-top: 20px;
410
+ }
411
+
412
+ @media only screen and (max-width: 768px) {
413
+ .walletconnect-modal__footer {
414
+ margin-top: 5vw;
415
+ }
416
+ }
417
+
418
+ .walletconnect-modal__footer a {
419
+ cursor: pointer;
420
+ color: #898d97;
421
+ font-size: 15px;
422
+ margin: 0 auto;
423
+ }
424
+
425
+ @media only screen and (max-width: 320px) {
426
+ .walletconnect-modal__footer a {
427
+ font-size: 14px;
428
+ }
429
+ }
430
+
431
+ .walletconnect-connect__buttons__wrapper {
432
+ max-height: 44vh;
433
+ }
434
+
435
+ .walletconnect-connect__buttons__wrapper__android {
436
+ margin: 50% 0;
437
+ }
438
+
439
+ .walletconnect-connect__buttons__wrapper__wrap {
440
+ display: grid;
441
+ grid-template-columns: repeat(4, 1fr);
442
+ margin: 10px 0;
443
+ }
444
+
445
+ @media only screen and (min-width: 768px) {
446
+ .walletconnect-connect__buttons__wrapper__wrap {
447
+ margin-top: 40px;
448
+ }
449
+ }
450
+
451
+ .walletconnect-connect__button {
452
+ background-color: rgb(64, 153, 255);
453
+ padding: 12px;
454
+ border-radius: 8px;
455
+ text-decoration: none;
456
+ color: rgb(255, 255, 255);
457
+ font-weight: 500;
458
+ }
459
+
460
+ .walletconnect-connect__button__icon_anchor {
461
+ cursor: pointer;
462
+ display: flex;
463
+ justify-content: flex-start;
464
+ align-items: center;
465
+ margin: 8px;
466
+ width: 42px;
467
+ justify-self: center;
468
+ flex-direction: column;
469
+ text-decoration: none !important;
470
+ }
471
+
472
+ @media only screen and (max-width: 320px) {
473
+ .walletconnect-connect__button__icon_anchor {
474
+ margin: 4px;
475
+ }
476
+ }
477
+
478
+ .walletconnect-connect__button__icon {
479
+ border-radius: 10px;
480
+ height: 42px;
481
+ margin: 0;
482
+ width: 42px;
483
+ background-size: cover !important;
484
+ box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);
485
+ }
486
+
487
+ .walletconnect-connect__button__text {
488
+ color: #424952;
489
+ font-size: 2.7vw;
490
+ text-decoration: none !important;
491
+ padding: 0;
492
+ margin-top: 1.8vw;
493
+ font-weight: 600;
494
+ }
495
+
496
+ @media only screen and (min-width: 768px) {
497
+ .walletconnect-connect__button__text {
498
+ font-size: 16px;
499
+ margin-top: 12px;
500
+ }
501
+ }
502
+
503
+ .walletconnect-search__input {
504
+ border: none;
505
+ background: #d4d5d9;
506
+ border-style: none;
507
+ padding: 8px 16px;
508
+ outline: none;
509
+ font-style: normal;
510
+ font-stretch: normal;
511
+ font-size: 16px;
512
+ font-style: normal;
513
+ font-stretch: normal;
514
+ line-height: normal;
515
+ letter-spacing: normal;
516
+ text-align: left;
517
+ border-radius: 8px;
518
+ width: calc(100% - 16px);
519
+ margin: 0;
520
+ margin-bottom: 8px;
521
+ }
522
+ `,hTe=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator",dTe=typeof Symbol<"u"?Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")):"@@asyncIterator";function iQ(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}var oQ="data:image/svg+xml,%3Csvg height='185' viewBox='0 0 300 185' width='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m61.4385429 36.2562612c48.9112241-47.8881663 128.2119871-47.8881663 177.1232091 0l5.886545 5.7634174c2.445561 2.3944081 2.445561 6.2765112 0 8.6709204l-20.136695 19.715503c-1.222781 1.1972051-3.2053 1.1972051-4.428081 0l-8.100584-7.9311479c-34.121692-33.4079817-89.443886-33.4079817-123.5655788 0l-8.6750562 8.4936051c-1.2227816 1.1972041-3.205301 1.1972041-4.4280806 0l-20.1366949-19.7155031c-2.4455612-2.3944092-2.4455612-6.2765122 0-8.6709204zm218.7677961 40.7737449 17.921697 17.546897c2.445549 2.3943969 2.445563 6.2764769.000031 8.6708899l-80.810171 79.121134c-2.445544 2.394426-6.410582 2.394453-8.85616.000062-.00001-.00001-.000022-.000022-.000032-.000032l-57.354143-56.154572c-.61139-.598602-1.60265-.598602-2.21404 0-.000004.000004-.000007.000008-.000011.000011l-57.3529212 56.154531c-2.4455368 2.394432-6.4105755 2.394472-8.8561612.000087-.0000143-.000014-.0000296-.000028-.0000449-.000044l-80.81241943-79.122185c-2.44556021-2.394408-2.44556021-6.2765115 0-8.6709197l17.92172963-17.5468673c2.4455602-2.3944082 6.4105989-2.3944082 8.8561602 0l57.3549775 56.155357c.6113908.598602 1.602649.598602 2.2140398 0 .0000092-.000009.0000174-.000017.0000265-.000024l57.3521031-56.155333c2.445505-2.3944633 6.410544-2.3945531 8.856161-.0002.000034.0000336.000068.0000673.000101.000101l57.354902 56.155432c.61139.598601 1.60265.598601 2.21404 0l57.353975-56.1543249c2.445561-2.3944092 6.410599-2.3944092 8.85616 0z' fill='%233b99fc'/%3E%3C/svg%3E",sQ="WalletConnect",aQ=300,uQ="rgb(64, 153, 255)",UA="walletconnect-wrapper",BA="walletconnect-style-sheet",HA="walletconnect-qrcode-modal",fQ="walletconnect-qrcode-close",WA="walletconnect-qrcode-text",cQ="walletconnect-connect-button";function lQ(e){return He.createElement("div",{className:"walletconnect-modal__header"},He.createElement("img",{src:oQ,className:"walletconnect-modal__headerLogo"}),He.createElement("p",null,sQ),He.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:e.onClose},He.createElement("div",{id:fQ,className:"walletconnect-modal__close__icon"},He.createElement("div",{className:"walletconnect-modal__close__line1"}),He.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function hQ(e){return He.createElement("a",{className:"walletconnect-connect__button",href:e.href,id:cQ+"-"+e.name,onClick:e.onClick,rel:"noopener noreferrer",style:{backgroundColor:e.color},target:"_blank"},e.name)}var dQ="data:image/svg+xml,%3Csvg fill='none' height='18' viewBox='0 0 8 18' width='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath clip-rule='evenodd' d='m.586301.213898c-.435947.33907-.5144813.967342-.175411 1.403292l4.87831 6.27212c.28087.36111.28087.86677 0 1.22788l-4.878311 6.27211c-.33907.436-.260536 1.0642.175412 1.4033.435949.3391 1.064219.2605 1.403289-.1754l4.87832-6.2721c.84259-1.08336.84259-2.60034 0-3.68367l-4.87832-6.27212c-.33907-.4359474-.96734-.514482-1.403289-.175412z' fill='%233c4252' fill-rule='evenodd'/%3E%3C/svg%3E";function pQ(e){var t=e.color,r=e.href,n=e.name,i=e.logo,o=e.onClick;return He.createElement("a",{className:"walletconnect-modal__base__row",href:r,onClick:o,rel:"noopener noreferrer",target:"_blank"},He.createElement("h3",{className:"walletconnect-modal__base__row__h3"},n),He.createElement("div",{className:"walletconnect-modal__base__row__right"},He.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+i+"') "+t,backgroundSize:"100%"}}),He.createElement("img",{src:dQ,className:"walletconnect-modal__base__row__right__caret"})))}function vQ(e){var t=e.color,r=e.href,n=e.name,i=e.logo,o=e.onClick,a=window.innerWidth<768?(n.length>8?2.5:2.7)+"vw":"inherit";return He.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:r,onClick:o,rel:"noopener noreferrer",target:"_blank"},He.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+i+"') "+t,backgroundSize:"100%"}}),He.createElement("div",{style:{fontSize:a},className:"walletconnect-connect__button__text"},n))}var mQ=5,ew=12;function gQ(e){var t=In.isAndroid(),r=He.useState(""),n=r[0],i=r[1],o=He.useState(""),a=o[0],c=o[1],v=He.useState(1),y=v[0],w=v[1],M=a?e.links.filter(function(ee){return ee.name.toLowerCase().includes(a.toLowerCase())}):e.links,S=e.errorMessage,R=a||M.length>mQ,C=Math.ceil(M.length/ew),B=[(y-1)*ew+1,y*ew],N=M.length?M.filter(function(ee,ge){return ge+1>=B[0]&&ge+1<=B[1]}):[],q=!t&&C>1,H=void 0;function D(ee){i(ee.target.value),clearTimeout(H),ee.target.value?H=setTimeout(function(){c(ee.target.value),w(1)},1e3):(i(""),c(""),w(1))}return He.createElement("div",null,He.createElement("p",{id:WA,className:"walletconnect-qrcode__text"},t?e.text.connect_mobile_wallet:e.text.choose_preferred_wallet),!t&&He.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:n,onChange:D}),He.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(t?"__android":R&&M.length?"__wrap":"")},t?He.createElement(hQ,{name:e.text.connect,color:uQ,href:e.uri,onClick:He.useCallback(function(){In.saveMobileLinkInfo({name:"Unknown",href:e.uri})},[])}):N.length?N.map(function(ee){var ge=ee.color,K=ee.name,X=ee.shortName,V=ee.logo,T=In.formatIOSMobile(e.uri,ee),m=He.useCallback(function(){In.saveMobileLinkInfo({name:K,href:T})},[N]);return R?He.createElement(vQ,{color:ge,href:T,name:X||K,logo:V,onClick:m}):He.createElement(pQ,{color:ge,href:T,name:K,logo:V,onClick:m})}):He.createElement(He.Fragment,null,He.createElement("p",null,S.length?e.errorMessage:!!e.links.length&&!M.length?e.text.no_wallets_found:e.text.loading))),q&&He.createElement("div",{className:"walletconnect-modal__footer"},Array(C).fill(0).map(function(ee,ge){var K=ge+1,X=y===K;return He.createElement("a",{style:{margin:"auto 10px",fontWeight:X?"bold":"normal"},onClick:function(){return w(K)}},K)})))}function bQ(e){var t=!!e.message.trim();return He.createElement("div",{className:"walletconnect-qrcode__notification"+(t?" notification__show":"")},e.message)}var yQ=function(e){try{var t="";return Promise.resolve(FA.toString(e,{margin:0,type:"svg"})).then(function(r){return typeof r=="string"&&(t=r.replace("<svg",'<svg class="walletconnect-qrcode__image"')),t})}catch(r){return Promise.reject(r)}};function _Q(e){var t=He.useState(""),r=t[0],n=t[1],i=He.useState(""),o=i[0],a=i[1];He.useEffect(function(){try{return Promise.resolve(yQ(e.uri)).then(function(v){a(v)})}catch(v){Promise.reject(v)}},[]);var c=function(){var v=tQ(e.uri);v?(n(e.text.copied_to_clipboard),setInterval(function(){return n("")},1200)):(n("Error"),setInterval(function(){return n("")},1200))};return He.createElement("div",null,He.createElement("p",{id:WA,className:"walletconnect-qrcode__text"},e.text.scan_qrcode_with_wallet),He.createElement("div",{dangerouslySetInnerHTML:{__html:o}}),He.createElement("div",{className:"walletconnect-modal__footer"},He.createElement("a",{onClick:c},e.text.copy_to_clipboard)),He.createElement(bQ,{message:r}))}function wQ(e){var t=In.isAndroid(),r=In.isMobile(),n=r?e.qrcodeModalOptions&&e.qrcodeModalOptions.mobileLinks?e.qrcodeModalOptions.mobileLinks:void 0:e.qrcodeModalOptions&&e.qrcodeModalOptions.desktopLinks?e.qrcodeModalOptions.desktopLinks:void 0,i=He.useState(!1),o=i[0],a=i[1],c=He.useState(!1),v=c[0],y=c[1],w=He.useState(!r),M=w[0],S=w[1],R={mobile:r,text:e.text,uri:e.uri,qrcodeModalOptions:e.qrcodeModalOptions},C=He.useState(""),B=C[0],N=C[1],q=He.useState(!1),H=q[0],D=q[1],ee=He.useState([]),ge=ee[0],K=ee[1],X=He.useState(""),V=X[0],T=X[1],m=function(){v||o||n&&!n.length||ge.length>0||He.useEffect(function(){var l=function(){try{if(t)return Promise.resolve();a(!0);var d=iQ(function(){var f=e.qrcodeModalOptions&&e.qrcodeModalOptions.registryUrl?e.qrcodeModalOptions.registryUrl:In.getWalletRegistryUrl();return Promise.resolve(fetch(f)).then(function(p){return Promise.resolve(p.json()).then(function(g){var b=g.listings,h=r?"mobile":"desktop",u=In.getMobileLinkRegistry(In.formatMobileRegistry(b,h),n);a(!1),y(!0),T(u.length?"":e.text.no_supported_wallets),K(u);var _=u.length===1;_&&(N(In.formatIOSMobile(e.uri,u[0])),S(!0)),D(_)})})},function(f){a(!1),y(!0),T(e.text.something_went_wrong),console.error(f)});return Promise.resolve(d&&d.then?d.then(function(){}):void 0)}catch(f){return Promise.reject(f)}};l()})};m();var s=r?M:!M;return He.createElement("div",{id:HA,className:"walletconnect-qrcode__base animated fadeIn"},He.createElement("div",{className:"walletconnect-modal__base"},He.createElement(lQ,{onClose:e.onClose}),H&&M?He.createElement("div",{className:"walletconnect-modal__single_wallet"},He.createElement("a",{onClick:function(){return In.saveMobileLinkInfo({name:ge[0].name,href:B})},href:B,rel:"noopener noreferrer",target:"_blank"},e.text.connect_with+" "+(H?ge[0].name:"")+" \u203A")):t||o||!o&&ge.length?He.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(s?" right__selected":"")},He.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),r?He.createElement(He.Fragment,null,He.createElement("a",{onClick:function(){return S(!1),m()}},e.text.mobile),He.createElement("a",{onClick:function(){return S(!0)}},e.text.qrcode)):He.createElement(He.Fragment,null,He.createElement("a",{onClick:function(){return S(!0)}},e.text.qrcode),He.createElement("a",{onClick:function(){return S(!1),m()}},e.text.desktop))):null,He.createElement("div",null,M||!t&&!o&&!ge.length?He.createElement(_Q,Object.assign({},R)):He.createElement(gQ,Object.assign({},R,{links:ge,errorMessage:V})))))}var xQ={choose_preferred_wallet:"W\xE4hle bevorzugte Wallet",connect_mobile_wallet:"Verbinde mit Mobile Wallet",scan_qrcode_with_wallet:"Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",connect:"Verbinden",qrcode:"QR-Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"In die Zwischenablage kopieren",copied_to_clipboard:"In die Zwischenablage kopiert!",connect_with:"Verbinden mit Hilfe von",loading:"Laden...",something_went_wrong:"Etwas ist schief gelaufen",no_supported_wallets:"Es gibt noch keine unterst\xFCtzten Wallet",no_wallets_found:"keine Wallet gefunden"},MQ={choose_preferred_wallet:"Choose your preferred wallet",connect_mobile_wallet:"Connect to Mobile Wallet",scan_qrcode_with_wallet:"Scan QR code with a WalletConnect-compatible wallet",connect:"Connect",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copy to clipboard",copied_to_clipboard:"Copied to clipboard!",connect_with:"Connect with",loading:"Loading...",something_went_wrong:"Something went wrong",no_supported_wallets:"There are no supported wallets yet",no_wallets_found:"No wallets found"},SQ={choose_preferred_wallet:"Elige tu billetera preferida",connect_mobile_wallet:"Conectar a billetera m\xF3vil",scan_qrcode_with_wallet:"Escanea el c\xF3digo QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"C\xF3digo QR",mobile:"M\xF3vil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo sali\xF3 mal",no_supported_wallets:"Todav\xEDa no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},EQ={choose_preferred_wallet:"Choisissez votre portefeuille pr\xE9f\xE9r\xE9",connect_mobile_wallet:"Se connecter au portefeuille mobile",scan_qrcode_with_wallet:"Scannez le QR code avec un portefeuille compatible WalletConnect",connect:"Se connecter",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copier",copied_to_clipboard:"Copi\xE9!",connect_with:"Connectez-vous \xE0 l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourn\xE9",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouv\xE9"},AQ={choose_preferred_wallet:"\uC6D0\uD558\uB294 \uC9C0\uAC11\uC744 \uC120\uD0DD\uD558\uC138\uC694",connect_mobile_wallet:"\uBAA8\uBC14\uC77C \uC9C0\uAC11\uACFC \uC5F0\uACB0",scan_qrcode_with_wallet:"WalletConnect \uC9C0\uC6D0 \uC9C0\uAC11\uC5D0\uC11C QR\uCF54\uB4DC\uB97C \uC2A4\uCE94\uD558\uC138\uC694",connect:"\uC5F0\uACB0",qrcode:"QR \uCF54\uB4DC",mobile:"\uBAA8\uBC14\uC77C",desktop:"\uB370\uC2A4\uD06C\uD0D1",copy_to_clipboard:"\uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC",copied_to_clipboard:"\uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC\uB418\uC5C8\uC2B5\uB2C8\uB2E4!",connect_with:"\uC640 \uC5F0\uACB0\uD558\uB2E4",loading:"\uB85C\uB4DC \uC911...",something_went_wrong:"\uBB38\uC81C\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.",no_supported_wallets:"\uC544\uC9C1 \uC9C0\uC6D0\uB418\uB294 \uC9C0\uAC11\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",no_wallets_found:"\uC9C0\uAC11\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4"},OQ={choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se \xE0 carteira m\xF3vel",scan_qrcode_with_wallet:"Ler o c\xF3digo QR com uma carteira compat\xEDvel com WalletConnect",connect:"Conectar",qrcode:"C\xF3digo QR",mobile:"M\xF3vel",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Ligar por meio de",loading:"Carregamento...",something_went_wrong:"Algo correu mal",no_supported_wallets:"Ainda n\xE3o h\xE1 carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},RQ={choose_preferred_wallet:"\u9009\u62E9\u4F60\u7684\u94B1\u5305",connect_mobile_wallet:"\u8FDE\u63A5\u81F3\u79FB\u52A8\u7AEF\u94B1\u5305",scan_qrcode_with_wallet:"\u4F7F\u7528\u517C\u5BB9 WalletConnect \u7684\u94B1\u5305\u626B\u63CF\u4E8C\u7EF4\u7801",connect:"\u8FDE\u63A5",qrcode:"\u4E8C\u7EF4\u7801",mobile:"\u79FB\u52A8",desktop:"\u684C\u9762",copy_to_clipboard:"\u590D\u5236\u5230\u526A\u8D34\u677F",copied_to_clipboard:"\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F\uFF01",connect_with:"\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u8FDE\u63A5",loading:"\u6B63\u5728\u52A0\u8F7D...",something_went_wrong:"\u51FA\u4E86\u95EE\u9898",no_supported_wallets:"\u76EE\u524D\u8FD8\u6CA1\u6709\u652F\u6301\u7684\u94B1\u5305",no_wallets_found:"\u6CA1\u6709\u627E\u5230\u94B1\u5305"},IQ={choose_preferred_wallet:"\u06A9\u06CC\u0641 \u067E\u0648\u0644 \u0645\u0648\u0631\u062F \u0646\u0638\u0631 \u062E\u0648\u062F \u0631\u0627 \u0627\u0646\u062A\u062E\u0627\u0628 \u06A9\u0646\u06CC\u062F",connect_mobile_wallet:"\u0628\u0647 \u06A9\u06CC\u0641 \u067E\u0648\u0644 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0648\u0635\u0644 \u0634\u0648\u06CC\u062F",scan_qrcode_with_wallet:"\u06A9\u062F QR \u0631\u0627 \u0628\u0627 \u06CC\u06A9 \u06A9\u06CC\u0641 \u067E\u0648\u0644 \u0633\u0627\u0632\u06AF\u0627\u0631 \u0628\u0627 WalletConnect \u0627\u0633\u06A9\u0646 \u06A9\u0646\u06CC\u062F",connect:"\u0627\u062A\u0635\u0627\u0644",qrcode:"\u06A9\u062F QR",mobile:"\u0633\u06CC\u0627\u0631",desktop:"\u062F\u0633\u06A9\u062A\u0627\u067E",copy_to_clipboard:"\u06A9\u067E\u06CC \u0628\u0647 \u06A9\u0644\u06CC\u067E \u0628\u0648\u0631\u062F",copied_to_clipboard:"\u062F\u0631 \u06A9\u0644\u06CC\u067E \u0628\u0648\u0631\u062F \u06A9\u067E\u06CC \u0634\u062F!",connect_with:"\u0627\u0631\u062A\u0628\u0627\u0637 \u0628\u0627",loading:"...\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",something_went_wrong:"\u0645\u0634\u06A9\u0644\u06CC \u067E\u06CC\u0634 \u0622\u0645\u062F",no_supported_wallets:"\u0647\u0646\u0648\u0632 \u0647\u06CC\u0686 \u06A9\u06CC\u0641 \u067E\u0648\u0644 \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0634\u062F\u0647 \u0627\u06CC \u0648\u062C\u0648\u062F \u0646\u062F\u0627\u0631\u062F",no_wallets_found:"\u0647\u06CC\u0686 \u06A9\u06CC\u0641 \u067E\u0648\u0644\u06CC \u067E\u06CC\u062F\u0627 \u0646\u0634\u062F"},DA={de:xQ,en:MQ,es:SQ,fr:EQ,ko:AQ,pt:OQ,zh:RQ,fa:IQ};function CQ(){var e=In.getDocumentOrThrow(),t=e.getElementById(BA);t&&e.head.removeChild(t);var r=e.createElement("style");r.setAttribute("id",BA),r.innerText=nQ,e.head.appendChild(r)}function TQ(){var e=In.getDocumentOrThrow(),t=e.createElement("div");return t.setAttribute("id",UA),e.body.appendChild(t),t}function zA(){var e=In.getDocumentOrThrow(),t=e.getElementById(HA);t&&(t.className=t.className.replace("fadeIn","fadeOut"),setTimeout(function(){var r=e.getElementById(UA);r&&e.body.removeChild(r)},aQ))}function kQ(e){return function(){zA(),e&&e()}}function PQ(){var e=In.getNavigatorOrThrow().language.split("-")[0]||"en";return DA[e]||DA.en}function NQ(e,t,r){CQ();var n=TQ();He.render(He.createElement(wQ,{text:PQ(),uri:e,onClose:kQ(t),qrcodeModalOptions:r}),n)}function qQ(){zA()}var VA=function(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"};function LQ(e,t,r){console.log(e),VA()?rQ(e):NQ(e,t,r)}function BQ(){VA()||qQ()}var DQ={open:LQ,close:BQ};$A.exports=DQ});var ZA=E((vTe,tw)=>{"use strict";var jQ=Object.prototype.hasOwnProperty,Cn="~";function Fl(){}Object.create&&(Fl.prototype=Object.create(null),new Fl().__proto__||(Cn=!1));function FQ(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function GA(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new FQ(r,n||e,i),a=Cn?Cn+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}function cv(e,t){--e._eventsCount===0?e._events=new Fl:delete e._events[t]}function cn(){this._events=new Fl,this._eventsCount=0}cn.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)jQ.call(r,n)&&t.push(Cn?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};cn.prototype.listeners=function(t){var r=Cn?Cn+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a};cn.prototype.listenerCount=function(t){var r=Cn?Cn+t:t,n=this._events[r];return n?n.fn?1:n.length:0};cn.prototype.emit=function(t,r,n,i,o,a){var c=Cn?Cn+t:t;if(!this._events[c])return!1;var v=this._events[c],y=arguments.length,w,M;if(v.fn){switch(v.once&&this.removeListener(t,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,r),!0;case 3:return v.fn.call(v.context,r,n),!0;case 4:return v.fn.call(v.context,r,n,i),!0;case 5:return v.fn.call(v.context,r,n,i,o),!0;case 6:return v.fn.call(v.context,r,n,i,o,a),!0}for(M=1,w=new Array(y-1);M<y;M++)w[M-1]=arguments[M];v.fn.apply(v.context,w)}else{var S=v.length,R;for(M=0;M<S;M++)switch(v[M].once&&this.removeListener(t,v[M].fn,void 0,!0),y){case 1:v[M].fn.call(v[M].context);break;case 2:v[M].fn.call(v[M].context,r);break;case 3:v[M].fn.call(v[M].context,r,n);break;case 4:v[M].fn.call(v[M].context,r,n,i);break;default:if(!w)for(R=1,w=new Array(y-1);R<y;R++)w[R-1]=arguments[R];v[M].fn.apply(v[M].context,w)}}return!0};cn.prototype.on=function(t,r,n){return GA(this,t,r,n,!1)};cn.prototype.once=function(t,r,n){return GA(this,t,r,n,!0)};cn.prototype.removeListener=function(t,r,n,i){var o=Cn?Cn+t:t;if(!this._events[o])return this;if(!r)return cv(this,o),this;var a=this._events[o];if(a.fn)a.fn===r&&(!i||a.once)&&(!n||a.context===n)&&cv(this,o);else{for(var c=0,v=[],y=a.length;c<y;c++)(a[c].fn!==r||i&&!a[c].once||n&&a[c].context!==n)&&v.push(a[c]);v.length?this._events[o]=v.length===1?v[0]:v:cv(this,o)}return this};cn.prototype.removeAllListeners=function(t){var r;return t?(r=Cn?Cn+t:t,this._events[r]&&cv(this,r)):(this._events=new Fl,this._eventsCount=0),this};cn.prototype.off=cn.prototype.removeListener;cn.prototype.addListener=cn.prototype.on;cn.prefixed=Cn;cn.EventEmitter=cn;typeof tw<"u"&&(tw.exports=cn)});function YA(){if(typeof Ul<"u")return Ul;try{new globalThis.Blob([new ArrayBuffer(1)]),Ul=!0}catch{Ul=!1}return Ul}function rw(e){Sa||(Sa=new globalThis.XMLHttpRequest,Sa.open("GET",globalThis.location.host?"/":"https://example.com"));try{return Sa.responseType=e,Sa.responseType===e}catch{return!1}}function Hl(e){return typeof e=="function"}var lv,Ul,Sa,nw,UQ,JA,QA,XA,hv,eO,iw=yt(()=>{lv=Hl(globalThis.fetch)&&Hl(globalThis.ReadableStream);nw=typeof globalThis.ArrayBuffer<"u",UQ=nw&&Hl(globalThis.ArrayBuffer.prototype.slice),JA=nw&&rw("arraybuffer"),QA=!lv&&UQ&&rw("ms-stream"),XA=!lv&&nw&&rw("moz-chunked-arraybuffer"),hv=Hl(Sa.overrideMimeType),eO=Hl(globalThis.VBArray);Sa=null});function tO(){throw new Error("setTimeout has not been defined")}function rO(){throw new Error("clearTimeout has not been defined")}function nO(e){if(bs===setTimeout)return setTimeout(e,0);if((bs===tO||!bs)&&setTimeout)return bs=setTimeout,setTimeout(e,0);try{return bs(e,0)}catch{try{return bs.call(null,e,0)}catch{return bs.call(this,e,0)}}}function WQ(e){if(ys===clearTimeout)return clearTimeout(e);if((ys===rO||!ys)&&clearTimeout)return ys=clearTimeout,clearTimeout(e);try{return ys(e)}catch{try{return ys.call(null,e)}catch{return ys.call(this,e)}}}function zQ(){!vf||!Ea||(vf=!1,Ea.length?Ho=Ea.concat(Ho):dv=-1,Ho.length&&iO())}function iO(){if(!vf){var e=nO(zQ);vf=!0;for(var t=Ho.length;t;){for(Ea=Ho,Ho=[];++dv<t;)Ea&&Ea[dv].run();dv=-1,t=Ho.length}Ea=null,vf=!1,WQ(e)}}function ln(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Ho.push(new oO(e,t)),Ho.length===1&&!vf&&nO(iO)}function oO(e,t){this.fun=e,this.array=t}function Aa(){}function aX(e){throw new Error("process.binding is not supported")}function uX(){return"/"}function fX(e){throw new Error("process.chdir is not supported")}function cX(){return 0}function hX(e){var t=lX.call(pf)*.001,r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r=r-e[0],n=n-e[1],n<0&&(r--,n+=1e9)),[r,n]}function pX(){var e=new Date,t=e-dX;return t/1e3}var bs,ys,Ho,vf,Ea,dv,VQ,$Q,KQ,GQ,ZQ,YQ,JQ,QQ,XQ,eX,tX,rX,nX,iX,oX,sX,pf,lX,dX,vX,Wl,zl=yt(()=>{bs=tO,ys=rO;typeof globalThis.setTimeout=="function"&&(bs=setTimeout);typeof globalThis.clearTimeout=="function"&&(ys=clearTimeout);Ho=[],vf=!1,dv=-1;oO.prototype.run=function(){this.fun.apply(null,this.array)};VQ="browser",$Q="browser",KQ=!0,GQ={},ZQ=[],YQ="",JQ={},QQ={},XQ={};eX=Aa,tX=Aa,rX=Aa,nX=Aa,iX=Aa,oX=Aa,sX=Aa;pf=globalThis.performance||{},lX=pf.now||pf.mozNow||pf.msNow||pf.oNow||pf.webkitNow||function(){return new Date().getTime()};dX=new Date;vX={nextTick:ln,title:VQ,browser:KQ,env:GQ,argv:ZQ,version:YQ,versions:JQ,on:eX,addListener:tX,once:rX,off:nX,removeListener:iX,removeAllListeners:oX,emit:sX,binding:aX,cwd:uX,chdir:fX,umask:cX,hrtime:hX,platform:$Q,release:QQ,config:XQ,uptime:pX},Wl=vX});var ow,Cr,sO=yt(()=>{typeof Object.create=="function"?ow=function(t,r){t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:ow=function(t,r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t};Cr=ow});var lO={};Mr(lO,{_extend:()=>dw,debuglog:()=>gv,default:()=>EX,deprecate:()=>Vl,format:()=>mv,inherits:()=>Cr,inspect:()=>di,isArray:()=>cw,isBoolean:()=>bv,isBuffer:()=>uO,isDate:()=>Ra,isError:()=>Oa,isFunction:()=>ws,isNull:()=>ro,isNullOrUndefined:()=>yv,isNumber:()=>lw,isObject:()=>no,isPrimitive:()=>$l,isRegExp:()=>_s,isString:()=>Wo,isSymbol:()=>aO,isUndefined:()=>to,log:()=>fO});function mv(e){if(!Wo(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(di(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(e).replace(mX,function(c){if(c==="%%")return"%";if(r>=i)return c;switch(c){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return c}}),a=n[r];r<i;a=n[++r])ro(a)||!no(a)?o+=" "+a:o+=" "+di(a);return o}function Vl(e,t){if(to(globalThis.process))return function(){return Vl(e,t).apply(this,arguments)};if(Wl.noDeprecation===!0)return e;var r=!1;function n(){if(!r){if(Wl.throwDeprecation)throw new Error(t);Wl.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}return n}function gv(e){if(to(sw)&&(sw=Wl.env.NODE_DEBUG||""),e=e.toUpperCase(),!pv[e])if(new RegExp("\\b"+e+"\\b","i").test(sw)){var t=0;pv[e]=function(){var r=mv.apply(null,arguments);console.error("%s %d: %s",e,t,r)}}else pv[e]=function(){};return pv[e]}function di(e,t){var r={seen:[],stylize:bX};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),bv(t)?r.showHidden=t:t&&dw(r,t),to(r.showHidden)&&(r.showHidden=!1),to(r.depth)&&(r.depth=2),to(r.colors)&&(r.colors=!1),to(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=gX),vv(r,e,r.depth)}function gX(e,t){var r=di.styles[t];return r?"\x1B["+di.colors[r][0]+"m"+e+"\x1B["+di.colors[r][1]+"m":e}function bX(e,t){return e}function yX(e){var t={};return e.forEach(function(r,n){t[r]=!0}),t}function vv(e,t,r){if(e.customInspect&&t&&ws(t.inspect)&&t.inspect!==di&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(r,e);return Wo(n)||(n=vv(e,n,r)),n}var i=_X(e,t);if(i)return i;var o=Object.keys(t),a=yX(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Oa(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return aw(t);if(o.length===0){if(ws(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(_s(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ra(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Oa(t))return aw(t)}var v="",y=!1,w=["{","}"];if(cw(t)&&(y=!0,w=["[","]"]),ws(t)){var M=t.name?": "+t.name:"";v=" [Function"+M+"]"}if(_s(t)&&(v=" "+RegExp.prototype.toString.call(t)),Ra(t)&&(v=" "+Date.prototype.toUTCString.call(t)),Oa(t)&&(v=" "+aw(t)),o.length===0&&(!y||t.length==0))return w[0]+v+w[1];if(r<0)return _s(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var S;return y?S=wX(e,t,r,a,o):S=o.map(function(R){return fw(e,t,r,a,R,y)}),e.seen.pop(),xX(S,v,w)}function _X(e,t){if(to(t))return e.stylize("undefined","undefined");if(Wo(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(lw(t))return e.stylize(""+t,"number");if(bv(t))return e.stylize(""+t,"boolean");if(ro(t))return e.stylize("null","null")}function aw(e){return"["+Error.prototype.toString.call(e)+"]"}function wX(e,t,r,n,i){for(var o=[],a=0,c=t.length;a<c;++a)cO(t,String(a))?o.push(fw(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(v){v.match(/^\d+$/)||o.push(fw(e,t,r,n,v,!0))}),o}function fw(e,t,r,n,i,o){var a,c,v;if(v=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},v.get?v.set?c=e.stylize("[Getter/Setter]","special"):c=e.stylize("[Getter]","special"):v.set&&(c=e.stylize("[Setter]","special")),cO(n,i)||(a="["+i+"]"),c||(e.seen.indexOf(v.value)<0?(ro(r)?c=vv(e,v.value,null):c=vv(e,v.value,r-1),c.indexOf(`
523
+ `)>-1&&(o?c=c.split(`
524
+ `).map(function(y){return" "+y}).join(`
525
+ `).substr(2):c=`
526
+ `+c.split(`
527
+ `).map(function(y){return" "+y}).join(`
528
+ `))):c=e.stylize("[Circular]","special")),to(a)){if(o&&i.match(/^\d+$/))return c;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+c}function xX(e,t,r){var n=0,i=e.reduce(function(o,a){return n++,a.indexOf(`
529
+ `)>=0&&n++,o+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(t===""?"":t+`
530
+ `)+" "+e.join(`,
531
+ `)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function cw(e){return Array.isArray(e)}function bv(e){return typeof e=="boolean"}function ro(e){return e===null}function yv(e){return e==null}function lw(e){return typeof e=="number"}function Wo(e){return typeof e=="string"}function aO(e){return typeof e=="symbol"}function to(e){return e===void 0}function _s(e){return no(e)&&hw(e)==="[object RegExp]"}function no(e){return typeof e=="object"&&e!==null}function Ra(e){return no(e)&&hw(e)==="[object Date]"}function Oa(e){return no(e)&&(hw(e)==="[object Error]"||e instanceof Error)}function ws(e){return typeof e=="function"}function $l(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}function uO(e){return Buffer.isBuffer(e)}function hw(e){return Object.prototype.toString.call(e)}function uw(e){return e<10?"0"+e.toString(10):e.toString(10)}function SX(){var e=new Date,t=[uw(e.getHours()),uw(e.getMinutes()),uw(e.getSeconds())].join(":");return[e.getDate(),MX[e.getMonth()],t].join(" ")}function fO(){console.log("%s - %s",SX(),mv.apply(null,arguments))}function dw(e,t){if(!t||!no(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function cO(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var mX,pv,sw,MX,EX,pi=yt(()=>{zl();sO();mX=/%[sdj%]/g;pv={};di.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};di.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};MX=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];EX={inherits:Cr,_extend:dw,log:fO,isBuffer:uO,isPrimitive:$l,isFunction:ws,isError:Oa,isDate:Ra,isObject:no,isRegExp:_s,isUndefined:to,isSymbol:aO,isString:Wo,isNumber:lw,isNullOrUndefined:yv,isNull:ro,isBoolean:bv,isArray:cw,inspect:di,deprecate:Vl,format:mv,debuglog:gv}});var mO={};Mr(mO,{EventEmitter:()=>qt,default:()=>zo});function xs(){}function qt(){qt.init.call(this)}function hO(e){return e._maxListeners===void 0?qt.defaultMaxListeners:e._maxListeners}function AX(e,t,r){if(t)e.call(r);else for(var n=e.length,i=Kl(e,n),o=0;o<n;++o)i[o].call(r)}function OX(e,t,r,n){if(t)e.call(r,n);else for(var i=e.length,o=Kl(e,i),a=0;a<i;++a)o[a].call(r,n)}function RX(e,t,r,n,i){if(t)e.call(r,n,i);else for(var o=e.length,a=Kl(e,o),c=0;c<o;++c)a[c].call(r,n,i)}function IX(e,t,r,n,i,o){if(t)e.call(r,n,i,o);else for(var a=e.length,c=Kl(e,a),v=0;v<a;++v)c[v].call(r,n,i,o)}function CX(e,t,r,n){if(t)e.apply(r,n);else for(var i=e.length,o=Kl(e,i),a=0;a<i;++a)o[a].apply(r,n)}function dO(e,t,r,n){var i,o,a;if(typeof r!="function")throw new TypeError('"listener" argument must be a function');if(o=e._events,o?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]):(o=e._events=new xs,e._eventsCount=0),!a)a=o[t]=r,++e._eventsCount;else if(typeof a=="function"?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),!a.warned&&(i=hO(e),i&&i>0&&a.length>i)){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,TX(c)}return e}function TX(e){typeof console.warn=="function"?console.warn(e):console.log(e)}function pO(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function vO(e){var t=this._events;if(t){var r=t[e];if(typeof r=="function")return 1;if(r)return r.length}return 0}function kX(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}function Kl(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function PX(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}var pw,zo,Gl=yt(()=>{"use strict";xs.prototype=Object.create(null);zo=qt;qt.EventEmitter=qt;qt.usingDomains=!1;qt.prototype.domain=void 0;qt.prototype._events=void 0;qt.prototype._maxListeners=void 0;qt.defaultMaxListeners=10;qt.init=function(){this.domain=null,qt.usingDomains&&pw.active&&!(this instanceof pw.Domain)&&(this.domain=pw.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new xs,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};qt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this};qt.prototype.getMaxListeners=function(){return hO(this)};qt.prototype.emit=function(t){var r,n,i,o,a,c,v,y=!1,w=t==="error";if(c=this._events,c)w=w&&c.error==null;else if(!w)return!1;if(v=this.domain,w){if(r=arguments[1],v)r||(r=new Error('Uncaught, unspecified "error" event')),r.domainEmitter=this,r.domain=v,r.domainThrown=!1,v.emit("error",r);else{if(r instanceof Error)throw r;var M=new Error('Uncaught, unspecified "error" event. ('+r+")");throw M.context=r,M}return!1}if(n=c[t],!n)return!1;var S=typeof n=="function";switch(i=arguments.length,i){case 1:AX(n,S,this);break;case 2:OX(n,S,this,arguments[1]);break;case 3:RX(n,S,this,arguments[1],arguments[2]);break;case 4:IX(n,S,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];CX(n,S,this,o)}return y&&v.exit(),!0};qt.prototype.addListener=function(t,r){return dO(this,t,r,!1)};qt.prototype.on=qt.prototype.addListener;qt.prototype.prependListener=function(t,r){return dO(this,t,r,!0)};qt.prototype.once=function(t,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.on(t,pO(this,t,r)),this};qt.prototype.prependOnceListener=function(t,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(t,pO(this,t,r)),this};qt.prototype.removeListener=function(t,r){var n,i,o,a,c;if(typeof r!="function")throw new TypeError('"listener" argument must be a function');if(i=this._events,!i)return this;if(n=i[t],!n)return this;if(n===r||n.listener&&n.listener===r)--this._eventsCount===0?this._events=new xs:(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(o=-1,a=n.length;a-- >0;)if(n[a]===r||n[a].listener&&n[a].listener===r){c=n[a].listener,o=a;break}if(o<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount===0)return this._events=new xs,this;delete i[t]}else kX(n,o);i.removeListener&&this.emit("removeListener",t,c||r)}return this};qt.prototype.removeAllListeners=function(t){var r,n;if(n=this._events,!n)return this;if(!n.removeListener)return arguments.length===0?(this._events=new xs,this._eventsCount=0):n[t]&&(--this._eventsCount===0?this._events=new xs:delete n[t]),this;if(arguments.length===0){for(var i=Object.keys(n),o=0,a;o<i.length;++o)a=i[o],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=new xs,this._eventsCount=0,this}if(r=n[t],typeof r=="function")this.removeListener(t,r);else if(r)do this.removeListener(t,r[r.length-1]);while(r[0]);return this};qt.prototype.listeners=function(t){var r,n,i=this._events;return i?(r=i[t],r?typeof r=="function"?n=[r.listener||r]:n=PX(r):n=[]):n=[],n};qt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):vO.call(e,t)};qt.prototype.listenerCount=vO;qt.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}});function Ia(){this.head=null,this.tail=null,this.length=0}var gO,bO=yt(()=>{da();gO=Ia;Ia.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length};Ia.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length};Ia.prototype.shift=function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}};Ia.prototype.clear=function(){this.head=this.tail=null,this.length=0};Ia.prototype.join=function(e){if(this.length===0)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r};Ia.prototype.concat=function(e){if(this.length===0)return _e.alloc(0);if(this.length===1)return this.head.data;for(var t=_e.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t}});var yO={};Mr(yO,{StringDecoder:()=>Ca});function qX(e){if(e&&!NX(e))throw new Error("Unknown encoding: "+e)}function Ca(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),qX(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=BX;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=DX;break;default:this.write=LX;return}this.charBuffer=new _e(6),this.charReceived=0,this.charLength=0}function LX(e){return e.toString(this.encoding)}function BX(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function DX(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var NX,vw=yt(()=>{da();NX=_e.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};Ca.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";e=e.slice(r,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319){this.charLength+=this.surrogateSize,t="";continue}if(this.charReceived=this.charLength=0,e.length===0)return t;break}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived),t+=e.toString(this.encoding,0,n);var n=t.length-1,i=t.charCodeAt(n);if(i>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t};Ca.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};Ca.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}});function jX(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function FX(e,t){return e.listeners(t).length}function MO(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof en&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new gO,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Ca(e.encoding),this.encoding=e.encoding)}function Qt(e){if(!(this instanceof Qt))return new Qt(e);this._readableState=new MO(e,this),this.readable=!0,e&&typeof e.read=="function"&&(this._read=e.read),zo.call(this)}function SO(e,t,r,n,i){var o=WX(t,r);if(o)e.emit("error",o);else if(r===null)t.reading=!1,zX(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var c=new Error("stream.unshift() after end event");e.emit("error",c)}else{var v;t.decoder&&!i&&!n&&(r=t.decoder.write(r),v=!t.objectMode&&r.length===0),i||(t.reading=!1),v||(t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&_v(e))),VX(e,t)}else i||(t.reading=!1);return UX(t)}function UX(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}function HX(e){return e>=_O?e=_O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function wO(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=HX(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function WX(e,t){var r=null;return!Buffer.isBuffer(t)&&typeof t!="string"&&t!==null&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function zX(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,_v(e)}}function _v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Zt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?ln(xO,e):xO(e))}function xO(e){Zt("emit readable"),e.emit("readable"),gw(e)}function VX(e,t){t.readingMore||(t.readingMore=!0,ln($X,e,t))}function $X(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Zt("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function KX(e){return function(){var t=e._readableState;Zt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&e.listeners("data").length&&(t.flowing=!0,gw(e))}}function GX(e){Zt("readable nexttick read 0"),e.read(0)}function ZX(e,t){t.resumeScheduled||(t.resumeScheduled=!0,ln(YX,e,t))}function YX(e,t){t.reading||(Zt("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),gw(e),t.flowing&&!t.reading&&e.read(0)}function gw(e){var t=e._readableState;for(Zt("flow",t.flowing);t.flowing&&e.read()!==null;);}function EO(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=JX(e,t.buffer,t.decoder),r}function JX(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=r?QX(e,t):XX(e,t),n}function QX(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),e-=a,e===0){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}function XX(e,t){var r=Buffer.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),e-=a,e===0){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}function mw(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,ln(eee,t,e))}function eee(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function tee(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}function AO(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}var Zt,_O,bw=yt(()=>{"use strict";Gl();pi();bO();vw();Zl();zl();Qt.ReadableState=MO;Zt=gv("stream");Cr(Qt,zo);Qt.prototype.push=function(e,t){var r=this._readableState;return!r.objectMode&&typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Buffer.from(e,t),t="")),SO(this,r,e,t,!1)};Qt.prototype.unshift=function(e){var t=this._readableState;return SO(this,t,e,"",!0)};Qt.prototype.isPaused=function(){return this._readableState.flowing===!1};Qt.prototype.setEncoding=function(e){return this._readableState.decoder=new Ca(e),this._readableState.encoding=e,this};_O=8388608;Qt.prototype.read=function(e){Zt("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Zt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?mw(this):_v(this),null;if(e=wO(e,t),e===0&&t.ended)return t.length===0&&mw(this),null;var n=t.needReadable;Zt("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,Zt("length less than watermark",n)),t.ended||t.reading?(n=!1,Zt("reading or ended",n)):n&&(Zt("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=wO(r,t)));var i;return e>0?i=EO(e,t):i=null,i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&mw(this)),i!==null&&this.emit("data",i),i};Qt.prototype._read=function(e){this.emit("error",new Error("not implemented"))};Qt.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,Zt("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||t.end!==!1,o=i?c:w;n.endEmitted?ln(o):r.once("end",o),e.on("unpipe",a);function a(q){Zt("onunpipe"),q===r&&w()}function c(){Zt("onend"),e.end()}var v=KX(r);e.on("drain",v);var y=!1;function w(){Zt("cleanup"),e.removeListener("close",C),e.removeListener("finish",B),e.removeListener("drain",v),e.removeListener("error",R),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",w),r.removeListener("data",S),y=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&v()}var M=!1;r.on("data",S);function S(q){Zt("ondata"),M=!1;var H=e.write(q);H===!1&&!M&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&AO(n.pipes,e)!==-1)&&!y&&(Zt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,M=!0),r.pause())}function R(q){Zt("onerror",q),N(),e.removeListener("error",R),FX(e,"error")===0&&e.emit("error",q)}jX(e,"error",R);function C(){e.removeListener("finish",B),N()}e.once("close",C);function B(){Zt("onfinish"),e.removeListener("close",C),N()}e.once("finish",B);function N(){Zt("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(Zt("pipe resume"),r.resume()),e};Qt.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var o=AO(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)};Qt.prototype.on=function(e,t){var r=zo.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&_v(this,n):ln(GX,this))}return r};Qt.prototype.addListener=Qt.prototype.on;Qt.prototype.resume=function(){var e=this._readableState;return e.flowing||(Zt("resume"),e.flowing=!0,ZX(this,e)),this};Qt.prototype.pause=function(){return Zt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Zt("pause"),this._readableState.flowing=!1,this.emit("pause")),this};Qt.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;e.on("end",function(){if(Zt("wrapped end"),t.decoder&&!t.ended){var a=t.decoder.end();a&&a.length&&n.push(a)}n.push(null)}),e.on("data",function(a){if(Zt("wrapped data"),t.decoder&&(a=t.decoder.write(a)),!(t.objectMode&&a==null)&&!(!t.objectMode&&(!a||!a.length))){var c=n.push(a);c||(r=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(a){return function(){return e[a].apply(e,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return tee(o,function(a){e.on(a,n.emit.bind(n,a))}),n._read=function(a){Zt("wrapped _read",a),r&&(r=!1,e.resume())},n};Qt._fromList=EO});function ree(){}function nee(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function _w(e,t){Object.defineProperty(this,"buffer",{get:Vl(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof en&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){cee(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new kO(this)}function _r(e){if(!(this instanceof _r)&&!(this instanceof en))return new _r(e);this._writableState=new _w(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev)),qt.call(this)}function iee(e,t){var r=new Error("write after end");e.emit("error",r),ln(t,r)}function oee(e,t,r,n){var i=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):!_e.isBuffer(r)&&typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),ln(n,o),i=!1),i}function see(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=_e.from(t,r)),t}function aee(e,t,r,n,i){r=see(t,r,n),_e.isBuffer(r)&&(n="buffer");var o=t.objectMode?1:r.length;t.length+=o;var a=t.length<t.highWaterMark;if(a||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest=new nee(r,n,i),c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else yw(e,t,!1,o,r,n,i);return a}function yw(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function uee(e,t,r,n,i){--t.pendingcb,r?ln(i,n):i(n),e._writableState.errorEmitted=!0,e.emit("error",n)}function fee(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function cee(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(fee(r),t)uee(e,r,n,t,i);else{var o=CO(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&IO(e,r),n?ln(OO,e,r,o,i):OO(e,r,o,i)}}function OO(e,t,r,n){r||lee(e,t),t.pendingcb--,n(),TO(e,t)}function lee(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function IO(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0;r;)i[a]=r,r=r.next,a+=1;yw(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new kO(t)}else{for(;r;){var c=r.chunk,v=r.encoding,y=r.callback,w=t.objectMode?1:c.length;if(yw(e,t,!1,w,c,v,y),r=r.next,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function CO(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function RO(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function TO(e,t){var r=CO(t);return r&&(t.pendingcb===0?(RO(e,t),t.finished=!0,e.emit("finish")):RO(e,t)),r}function hee(e,t,r){t.ending=!0,TO(e,t),r&&(t.finished?ln(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function kO(e){var t=this;this.next=null,this.entry=null,this.finish=function(r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}var ww=yt(()=>{pi();da();Gl();Zl();zl();_r.WritableState=_w;Cr(_r,qt);_w.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};_r.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};_r.prototype.write=function(e,t,r){var n=this._writableState,i=!1;return typeof t=="function"&&(r=t,t=null),_e.isBuffer(e)?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=ree),n.ended?iee(this,r):oee(this,n,e,r)&&(n.pendingcb++,i=aee(this,n,e,t,r)),i};_r.prototype.cork=function(){var e=this._writableState;e.corked++};_r.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&IO(this,e))};_r.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};_r.prototype._write=function(e,t,r){r(new Error("not implemented"))};_r.prototype._writev=null;_r.prototype.end=function(e,t,r){var n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),!n.ending&&!n.finished&&hee(this,n,r)}});function en(e){if(!(this instanceof en))return new en(e);Qt.call(this,e),_r.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",dee)}function dee(){this.allowHalfOpen||this._writableState.ended||ln(pee,this)}function pee(e){e.end()}var PO,xv,wv,Zl=yt(()=>{pi();zl();bw();ww();Cr(en,Qt);PO=Object.keys(_r.prototype);for(wv=0;wv<PO.length;wv++)xv=PO[wv],en.prototype[xv]||(en.prototype[xv]=_r.prototype[xv])});function vee(e){this.afterTransform=function(t,r){return mee(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function mee(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,r!=null&&e.push(r),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function Xn(e){if(!(this instanceof Xn))return new Xn(e);en.call(this,e),this._transformState=new vee(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.once("prefinish",function(){typeof this._flush=="function"?this._flush(function(r){NO(t,r)}):NO(t)})}function NO(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=e._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}var xw=yt(()=>{Zl();pi();Cr(Xn,en);Xn.prototype.push=function(e,t){return this._transformState.needTransform=!1,en.prototype.push.call(this,e,t)};Xn.prototype._transform=function(e,t,r){throw new Error("Not implemented")};Xn.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Xn.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}});function Ta(e){if(!(this instanceof Ta))return new Ta(e);Xn.call(this,e)}var qO=yt(()=>{xw();pi();Cr(Ta,Xn);Ta.prototype._transform=function(e,t,r){r(null,e)}});var LO={};Mr(LO,{Duplex:()=>en,PassThrough:()=>Ta,Readable:()=>Qt,Stream:()=>ki,Transform:()=>Xn,Writable:()=>_r,default:()=>gee});function ki(){zo.call(this)}var gee,Mv=yt(()=>{Gl();pi();Zl();bw();ww();xw();qO();Cr(ki,zo);ki.Readable=Qt;ki.Writable=_r;ki.Duplex=en;ki.Transform=Xn;ki.PassThrough=Ta;ki.Stream=ki;gee=ki;ki.prototype.pipe=function(e,t){var r=this;function n(w){e.writable&&e.write(w)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",a),r.on("close",c));var o=!1;function a(){o||(o=!0,e.end())}function c(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function v(w){if(y(),zo.listenerCount(this,"error")===0)throw w}r.on("error",v),e.on("error",v);function y(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",v),e.removeListener("error",v),r.removeListener("end",y),r.removeListener("close",y),e.removeListener("close",y)}return r.on("end",y),r.on("close",y),e.on("close",y),e.emit("pipe",r),e}});function Yl(e,t,r){var n=this;Qt.call(n),n._mode=r,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",function(){process.nextTick(function(){n.emit("close")})});var i;if(r==="fetch"){n._fetchResponse=t,n.url=t.url,n.statusCode=t.status,n.statusMessage=t.statusText;for(var o,a,c=t.headers[Symbol.iterator]();o=(a=c.next()).value,!a.done;)n.headers[o[0].toLowerCase()]=o[1],n.rawHeaders.push(o[0],o[1]);var v=t.body.getReader();i=function(){v.read().then(function(S){if(!n._destroyed){if(S.done){n.push(null);return}n.push(new Buffer(S.value)),i()}})},i()}else{n._xhr=e,n._pos=0,n.url=e.responseURL,n.statusCode=e.status,n.statusMessage=e.statusText;var y=e.getAllResponseHeaders().split(/\r?\n/);if(y.forEach(function(S){var R=S.match(/^([^:]+):\s*(.*)/);if(R){var C=R[1].toLowerCase();C==="set-cookie"?(n.headers[C]===void 0&&(n.headers[C]=[]),n.headers[C].push(R[2])):n.headers[C]!==void 0?n.headers[C]+=", "+R[2]:n.headers[C]=R[2],n.rawHeaders.push(R[1],R[2])}}),n._charset="x-user-defined",!hv){var w=n.rawHeaders["mime-type"];if(w){var M=w.match(/;\s*charset=([^;])(;|$)/);M&&(n._charset=M[1].toLowerCase())}n._charset||(n._charset="utf-8")}}}var Ms,BO=yt(()=>{iw();pi();Mv();Ms={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};Cr(Yl,Qt);Yl.prototype._read=function(){};Yl.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==Ms.DONE)break;try{r=new globalThis.VBArray(t.responseBody).toArray()}catch{}if(r!==null){e.push(new Buffer(r));break}case"text":try{r=t.responseText}catch{e._mode="text:vbarray";break}if(r.length>e._pos){var n=r.substr(e._pos);if(e._charset==="x-user-defined"){for(var i=new Buffer(n.length),o=0;o<n.length;o++)i[o]=n.charCodeAt(o)&255;e.push(i)}else e.push(n,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==Ms.DONE||!t.response)break;r=t.response,e.push(new Buffer(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==Ms.LOADING||!r)break;e.push(new Buffer(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==Ms.LOADING)break;var a=new globalThis.MSStreamReader;a.onprogress=function(){a.result.byteLength>e._pos&&(e.push(new Buffer(new Uint8Array(a.result.slice(e._pos)))),e._pos=a.result.byteLength)},a.onload=function(){e.push(null)},a.readAsArrayBuffer(r);break}e._xhr.readyState===Ms.DONE&&e._mode!=="ms-stream"&&e.push(null)}});function DO(e){if(e instanceof Uint8Array){if(e.byteOffset===0&&e.byteLength===e.buffer.byteLength)return e.buffer;if(typeof e.buffer.slice=="function")return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(Qi(e)){for(var t=new Uint8Array(e.length),r=e.length,n=0;n<r;n++)t[n]=e[n];return t.buffer}else throw new Error("Argument must be a Buffer")}var jO=yt(()=>{da()});function bee(e,t){return lv&&t?"fetch":XA?"moz-chunked-arraybuffer":QA?"ms-stream":JA&&e?"arraybuffer":eO&&e?"text:vbarray":"text"}function hn(e){var t=this;_r.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+new Buffer(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(i){t.setHeader(i,e.headers[i])});var r,n=!0;if(e.mode==="disable-fetch")n=!1,r=!0;else if(e.mode==="prefer-streaming")r=!1;else if(e.mode==="allow-wrong-content-type")r=!hv;else if(!e.mode||e.mode==="default"||e.mode==="prefer-fast")r=!0;else throw new Error("Invalid value for opts.mode");t._mode=bee(r,n),t.on("finish",function(){t._onFinish()})}function _ee(e){try{var t=e.status;return t!==null&&t!==0}catch{return!1}}var Sv,yee,Mw=yt(()=>{iw();pi();BO();Mv();jO();Sv=hn;Cr(hn,_r);yee=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];hn.prototype.setHeader=function(e,t){var r=this,n=e.toLowerCase();yee.indexOf(n)===-1&&(r._headers[n]={name:e,value:t})};hn.prototype.getHeader=function(e){var t=this;return t._headers[e.toLowerCase()].value};hn.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]};hn.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,r=e._headers,n;if((t.method==="POST"||t.method==="PUT"||t.method==="PATCH")&&(YA()?n=new globalThis.Blob(e._body.map(function(a){return DO(a)}),{type:(r["content-type"]||{}).value||""}):n=Buffer.concat(e._body).toString()),e._mode==="fetch"){var i=Object.keys(r).map(function(a){return[r[a].name,r[a].value]});globalThis.fetch(e._opts.url,{method:e._opts.method,headers:i,body:n,mode:"cors",credentials:t.withCredentials?"include":"same-origin"}).then(function(a){e._fetchResponse=a,e._connect()},function(a){e.emit("error",a)})}else{var o=e._xhr=new globalThis.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(a){process.nextTick(function(){e.emit("error",a)});return}"responseType"in o&&(o.responseType=e._mode.split(":")[0]),"withCredentials"in o&&(o.withCredentials=!!t.withCredentials),e._mode==="text"&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),Object.keys(r).forEach(function(a){o.setRequestHeader(r[a].name,r[a].value)}),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case Ms.LOADING:case Ms.DONE:e._onXHRProgress();break}},e._mode==="moz-chunked-arraybuffer"&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{o.send(n)}catch(a){process.nextTick(function(){e.emit("error",a)});return}}}};hn.prototype._onXHRProgress=function(){var e=this;!_ee(e._xhr)||e._destroyed||(e._response||e._connect(),e._response._onXHRProgress())};hn.prototype._connect=function(){var e=this;e._destroyed||(e._response=new Yl(e._xhr,e._fetchResponse,e._mode),e.emit("response",e._response))};hn.prototype._write=function(e,t,r){var n=this;n._body.push(e),r()};hn.prototype.abort=hn.prototype.destroy=function(){var e=this;e._destroyed=!0,e._response&&(e._response._destroyed=!0),e._xhr&&e._xhr.abort()};hn.prototype.end=function(e,t,r){var n=this;typeof e=="function"&&(r=e,e=void 0),_r.prototype.end.call(n,e,t,r)};hn.prototype.flushHeaders=function(){};hn.prototype.setTimeout=function(){};hn.prototype.setNoDelay=function(){};hn.prototype.setSocketKeepAlive=function(){}});function FO(e){throw new RangeError(Ree[e])}function Iee(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function Cee(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(Oee,".");var i=e.split("."),o=Iee(i,t).join(".");return n+o}function Tee(e){for(var t=[],r=0,n=e.length,i,o;r<n;)i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n?(o=e.charCodeAt(r++),(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),r--)):t.push(i);return t}function UO(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function kee(e,t,r){var n=0;for(e=r?mf(e/xee):e>>1,e+=mf(e/t);e>Ew*Ow>>1;n+=Jl)e=mf(e/Ew);return mf(n+(Ew+1)*e/(e+wee))}function Pee(e){var t,r,n,i,o,a,c,v,y,w,M,S=[],R,C,B,N;for(e=Tee(e),R=e.length,t=See,r=0,o=Mee,a=0;a<R;++a)M=e[a],M<128&&S.push(Aw(M));for(n=i=S.length,i&&S.push(Eee);n<R;){for(c=Sw,a=0;a<R;++a)M=e[a],M>=t&&M<c&&(c=M);for(C=n+1,c-t>mf((Sw-r)/C)&&FO("overflow"),r+=(c-t)*C,t=c,a=0;a<R;++a)if(M=e[a],M<t&&++r>Sw&&FO("overflow"),M==t){for(v=r,y=Jl;w=y<=o?HO:y>=o+Ow?Ow:y-o,!(v<w);y+=Jl)N=v-w,B=Jl-w,S.push(Aw(UO(w+N%B,0))),v=mf(N/B);S.push(Aw(UO(v,0))),o=kee(r,C,n==i),r=0,++n}++r,++t}return S.join("")}function WO(e){return Cee(e,function(t){return Aee.test(t)?"xn--"+Pee(t):t})}var Sw,Jl,HO,Ow,wee,xee,Mee,See,Eee,Aee,Oee,Ree,Ew,mf,Aw,zO=yt(()=>{Sw=2147483647,Jl=36,HO=1,Ow=26,wee=38,xee=700,Mee=72,See=128,Eee="-",Aee=/[^\x20-\x7E]/,Oee=/[\x2E\u3002\uFF0E\uFF61]/g,Ree={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ew=Jl-HO,mf=Math.floor,Aw=String.fromCharCode});function Nee(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ql(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function KO(e,t,r,n){return t=t||"&",r=r||"=",e===null&&(e=void 0),typeof e=="object"?VO(qee(e),function(i){var o=encodeURIComponent(Ql(i))+r;return $O(e[i])?VO(e[i],function(a){return o+encodeURIComponent(Ql(a))}).join(t):o+encodeURIComponent(Ql(e[i]))}).join(t):n?encodeURIComponent(Ql(n))+r+encodeURIComponent(Ql(e)):""}function VO(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}function Rw(e,t,r,n){t=t||"&",r=r||"=";var i={};if(typeof e!="string"||e.length===0)return i;var o=/\+/g;e=e.split(t);var a=1e3;n&&typeof n.maxKeys=="number"&&(a=n.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var v=0;v<c;++v){var y=e[v].replace(o,"%20"),w=y.indexOf(r),M,S,R,C;w>=0?(M=y.substr(0,w),S=y.substr(w+1)):(M=y,S=""),R=decodeURIComponent(M),C=decodeURIComponent(S),Nee(i,R)?$O(i[R])?i[R].push(C):i[R]=[i[R],C]:i[R]=C}return i}var $O,qee,GO=yt(()=>{$O=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};qee=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}});var nR={};Mr(nR,{Url:()=>Pi,default:()=>Lee,format:()=>XO,parse:()=>Vo,resolve:()=>eR,resolveObject:()=>tR});function Pi(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function Vo(e,t,r){if(e&&no(e)&&e instanceof Pi)return e;var n=new Pi;return n.parse(e,t,r),n}function QO(e,t,r,n){if(!Wo(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=i!==-1&&i<t.indexOf("#")?"?":"#",a=t.split(o),c=/\\/g;a[0]=a[0].replace(c,"/"),t=a.join(o);var v=t;if(v=v.trim(),!n&&t.split("#").length===1){var y=jee.exec(v);if(y)return e.path=v,e.href=v,e.pathname=y[1],y[2]?(e.search=y[2],r?e.query=Rw(e.search.substr(1)):e.query=e.search.substr(1)):r&&(e.search="",e.query={}),e}var w=Bee.exec(v);if(w){w=w[0];var M=w.toLowerCase();e.protocol=M,v=v.substr(w.length)}if(n||w||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var S=v.substr(0,2)==="//";S&&!(w&&Cw[w])&&(v=v.substr(2),e.slashes=!0)}var R,C,B,N;if(!Cw[w]&&(S||w&&!gf[w])){var q=-1;for(R=0;R<YO.length;R++)C=v.indexOf(YO[R]),C!==-1&&(q===-1||C<q)&&(q=C);var H,D;for(q===-1?D=v.lastIndexOf("@"):D=v.lastIndexOf("@",q),D!==-1&&(H=v.slice(0,D),v=v.slice(D+1),e.auth=decodeURIComponent(H)),q=-1,R=0;R<ZO.length;R++)C=v.indexOf(ZO[R]),C!==-1&&(q===-1||C<q)&&(q=C);q===-1&&(q=v.length),e.host=v.slice(0,q),v=v.slice(q),rR(e),e.hostname=e.hostname||"";var ee=e.hostname[0]==="["&&e.hostname[e.hostname.length-1]==="]";if(!ee){var ge=e.hostname.split(/\./);for(R=0,B=ge.length;R<B;R++){var K=ge[R];if(!!K&&!K.match(JO)){for(var X="",V=0,T=K.length;V<T;V++)K.charCodeAt(V)>127?X+="x":X+=K[V];if(!X.match(JO)){var m=ge.slice(0,R),s=ge.slice(R+1),l=K.match(Wee);l&&(m.push(l[1]),s.unshift(l[2])),s.length&&(v="/"+s.join(".")+v),e.hostname=m.join(".");break}}}}e.hostname.length>Hee?e.hostname="":e.hostname=e.hostname.toLowerCase(),ee||(e.hostname=WO(e.hostname)),N=e.port?":"+e.port:"";var d=e.hostname||"";e.host=d+N,e.href+=e.host,ee&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),v[0]!=="/"&&(v="/"+v))}if(!zee[M])for(R=0,B=Iw.length;R<B;R++){var f=Iw[R];if(v.indexOf(f)!==-1){var p=encodeURIComponent(f);p===f&&(p=escape(f)),v=v.split(f).join(p)}}var g=v.indexOf("#");g!==-1&&(e.hash=v.substr(g),v=v.slice(0,g));var b=v.indexOf("?");if(b!==-1?(e.search=v.substr(b),e.query=v.substr(b+1),r&&(e.query=Rw(e.query)),v=v.slice(0,b)):r&&(e.search="",e.query={}),v&&(e.pathname=v),gf[M]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){N=e.pathname||"";var h=e.search||"";e.path=N+h}return e.href=Tw(e),e}function XO(e){return Wo(e)&&(e=QO({},e)),Tw(e)}function Tw(e){var t=e.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var r=e.protocol||"",n=e.pathname||"",i=e.hash||"",o=!1,a="";e.host?o=t+e.host:e.hostname&&(o=t+(e.hostname.indexOf(":")===-1?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&no(e.query)&&Object.keys(e.query).length&&(a=KO(e.query));var c=e.search||a&&"?"+a||"";return r&&r.substr(-1)!==":"&&(r+=":"),e.slashes||(!r||gf[r])&&o!==!1?(o="//"+(o||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):o||(o=""),i&&i.charAt(0)!=="#"&&(i="#"+i),c&&c.charAt(0)!=="?"&&(c="?"+c),n=n.replace(/[?#]/g,function(v){return encodeURIComponent(v)}),c=c.replace("#","%23"),r+o+n+c+i}function eR(e,t){return Vo(e,!1,!0).resolve(t)}function tR(e,t){return e?Vo(e,!1,!0).resolveObject(t):t}function rR(e){var t=e.host,r=Dee.exec(t);r&&(r=r[0],r!==":"&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}var Lee,Bee,Dee,jee,Fee,Uee,Iw,ZO,YO,Hee,JO,Wee,zee,Cw,gf,Ev=yt(()=>{zO();pi();GO();Lee={parse:Vo,resolve:eR,resolveObject:tR,format:XO,Url:Pi};Bee=/^([a-z0-9.+-]+:)/i,Dee=/:[0-9]*$/,jee=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Fee=["<",">",'"',"`"," ","\r",`
532
+ `," "],Uee=["{","}","|","\\","^","`"].concat(Fee),Iw=["'"].concat(Uee),ZO=["%","/","?",";","#"].concat(Iw),YO=["/","?","#"],Hee=255,JO=/^[+a-z0-9A-Z_-]{0,63}$/,Wee=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,zee={javascript:!0,"javascript:":!0},Cw={javascript:!0,"javascript:":!0},gf={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};Pi.prototype.parse=function(e,t,r){return QO(this,e,t,r)};Pi.prototype.format=function(){return Tw(this)};Pi.prototype.resolve=function(e){return this.resolveObject(Vo(e,!1,!0)).format()};Pi.prototype.resolveObject=function(e){if(Wo(e)){var t=new Pi;t.parse(e,!1,!0),e=t}for(var r=new Pi,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];r[o]=this[o]}if(r.hash=e.hash,e.href==="")return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),c=0;c<a.length;c++){var v=a[c];v!=="protocol"&&(r[v]=e[v])}return gf[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}var y;if(e.protocol&&e.protocol!==r.protocol){if(!gf[e.protocol]){for(var w=Object.keys(e),M=0;M<w.length;M++){var S=w[M];r[S]=e[S]}return r.href=r.format(),r}if(r.protocol=e.protocol,!e.host&&!Cw[e.protocol]){for(y=(e.pathname||"").split("/");y.length&&!(e.host=y.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),y[0]!==""&&y.unshift(""),y.length<2&&y.unshift(""),r.pathname=y.join("/")}else r.pathname=e.pathname;if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var R=r.pathname||"",C=r.search||"";r.path=R+C}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var B=r.pathname&&r.pathname.charAt(0)==="/",N=e.host||e.pathname&&e.pathname.charAt(0)==="/",q=N||B||r.host&&e.pathname,H=q,D=r.pathname&&r.pathname.split("/")||[],ee=r.protocol&&!gf[r.protocol];y=e.pathname&&e.pathname.split("/")||[],ee&&(r.hostname="",r.port=null,r.host&&(D[0]===""?D[0]=r.host:D.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(y[0]===""?y[0]=e.host:y.unshift(e.host)),e.host=null),q=q&&(y[0]===""||D[0]===""));var ge;if(N)r.host=e.host||e.host===""?e.host:r.host,r.hostname=e.hostname||e.hostname===""?e.hostname:r.hostname,r.search=e.search,r.query=e.query,D=y;else if(y.length)D||(D=[]),D.pop(),D=D.concat(y),r.search=e.search,r.query=e.query;else if(!yv(e.search))return ee&&(r.hostname=r.host=D.shift(),ge=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1,ge&&(r.auth=ge.shift(),r.host=r.hostname=ge.shift())),r.search=e.search,r.query=e.query,(!ro(r.pathname)||!ro(r.search))&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!D.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var K=D.slice(-1)[0],X=(r.host||e.host||D.length>1)&&(K==="."||K==="..")||K==="",V=0,T=D.length;T>=0;T--)K=D[T],K==="."?D.splice(T,1):K===".."?(D.splice(T,1),V++):V&&(D.splice(T,1),V--);if(!q&&!H)for(;V--;V)D.unshift("..");q&&D[0]!==""&&(!D[0]||D[0].charAt(0)!=="/")&&D.unshift(""),X&&D.join("/").substr(-1)!=="/"&&D.push("");var m=D[0]===""||D[0]&&D[0].charAt(0)==="/";return ee&&(r.hostname=r.host=m?"":D.length?D.shift():"",ge=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1,ge&&(r.auth=ge.shift(),r.host=r.hostname=ge.shift())),q=q||r.host&&D.length,q&&!m&&D.unshift(""),D.length?r.pathname=D.join("/"):(r.pathname=null,r.path=null),(!ro(r.pathname)||!ro(r.search))&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r};Pi.prototype.parseHost=function(){return rR(this)}});var aR={};Mr(aR,{Agent:()=>Pw,METHODS:()=>oR,STATUS_CODES:()=>sR,default:()=>Vee,get:()=>iR,request:()=>kw});function kw(e,t){typeof e=="string"&&(e=Vo(e));var r=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",n=e.protocol||r,i=e.hostname||e.host,o=e.port,a=e.path||"/";i&&i.indexOf(":")!==-1&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(o?":"+o:"")+a,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var c=new Sv(e);return t&&c.on("response",t),c}function iR(e,t){var r=kw(e,t);return r.end(),r}function Pw(){}var oR,sR,Vee,uR=yt(()=>{Mw();Ev();Pw.defaultMaxSockets=4;oR=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],sR={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Vee={request:kw,get:iR,Agent:Pw,METHODS:oR,STATUS_CODES:sR}});var fR=E((bke,Av)=>{var ka=(uR(),Pt(aR));if(ka&&ka.default){Av.exports=ka.default;for(let e in ka)Av.exports[e]=ka[e]}else ka&&(Av.exports=ka)});var dR={};Mr(dR,{Agent:()=>qw,METHODS:()=>lR,STATUS_CODES:()=>hR,default:()=>$ee,get:()=>cR,request:()=>Nw});function Nw(e,t){typeof e=="string"&&(e=Vo(e));var r=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",n=e.protocol||r,i=e.hostname||e.host,o=e.port,a=e.path||"/";i&&i.indexOf(":")!==-1&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(o?":"+o:"")+a,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var c=new Sv(e);return t&&c.on("response",t),c}function cR(e,t){var r=Nw(e,t);return r.end(),r}function qw(){}var lR,hR,$ee,pR=yt(()=>{Mw();Ev();qw.defaultMaxSockets=4;lR=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],hR={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},$ee={request:Nw,get:cR,Agent:qw,METHODS:lR,STATUS_CODES:hR}});var vR=E((wke,Ov)=>{var Pa=(pR(),Pt(dR));if(Pa&&Pa.default){Ov.exports=Pa.default;for(let e in Pa)Ov.exports[e]=Pa[e]}else Pa&&(Ov.exports=Pa)});var IR={};Mr(IR,{EOL:()=>RR,arch:()=>Kee,cpus:()=>xR,default:()=>Zee,endianness:()=>mR,freemem:()=>_R,getNetworkInterfaces:()=>AR,hostname:()=>gR,loadavg:()=>bR,networkInterfaces:()=>ER,platform:()=>Gee,release:()=>SR,tmpDir:()=>Lw,tmpdir:()=>OR,totalmem:()=>wR,type:()=>MR,uptime:()=>yR});function mR(){if(typeof Rv>"u"){var e=new ArrayBuffer(2),t=new Uint8Array(e),r=new Uint16Array(e);if(t[0]=1,t[1]=2,r[0]===258)Rv="BE";else if(r[0]===513)Rv="LE";else throw new Error("unable to figure out endianess")}return Rv}function gR(){return typeof globalThis.location<"u"?globalThis.location.hostname:""}function bR(){return[]}function yR(){return 0}function _R(){return Number.MAX_VALUE}function wR(){return Number.MAX_VALUE}function xR(){return[]}function MR(){return"Browser"}function SR(){return typeof globalThis.navigator<"u"?globalThis.navigator.appVersion:""}function ER(){}function AR(){}function Kee(){return"javascript"}function Gee(){return"browser"}function Lw(){return"/tmp"}var Rv,OR,RR,Zee,CR=yt(()=>{OR=Lw,RR=`
533
+ `,Zee={EOL:RR,tmpdir:OR,tmpDir:Lw,networkInterfaces:ER,getNetworkInterfaces:AR,release:SR,type:MR,cpus:xR,totalmem:wR,freemem:_R,uptime:yR,loadavg:bR,hostname:gR,endianness:mR}});var TR=E((xke,Iv)=>{var Na=(CR(),Pt(IR));if(Na&&Na.default){Iv.exports=Na.default;for(let e in Na)Iv.exports[e]=Na[e]}else Na&&(Iv.exports=Na)});var kR=E((Mke,Cv)=>{var qa=(Ev(),Pt(nR));if(qa&&qa.default){Cv.exports=qa.default;for(let e in qa)Cv.exports[e]=qa[e]}else qa&&(Cv.exports=qa)});var PR=E(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});var Yee=function(){function e(t){this.type=t,this.bubbles=!1,this.cancelable=!1,this.loaded=0,this.lengthComputable=!1,this.total=0}return e}();Bw.ProgressEvent=Yee});var NR=E(Ss=>{"use strict";var Tv=Ss&&Ss.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ss,"__esModule",{value:!0});var Jee=function(e){Tv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);Ss.SecurityError=Jee;var Qee=function(e){Tv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);Ss.InvalidStateError=Qee;var Xee=function(e){Tv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);Ss.NetworkError=Xee;var ete=function(e){Tv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);Ss.SyntaxError=ete});var kv=E(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});var tte=function(){function e(){this.listeners={}}return e.prototype.addEventListener=function(t,r){t=t.toLowerCase(),this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(r.handleEvent||r)},e.prototype.removeEventListener=function(t,r){if(t=t.toLowerCase(),!!this.listeners[t]){var n=this.listeners[t].indexOf(r.handleEvent||r);n<0||this.listeners[t].splice(n,1)}},e.prototype.dispatchEvent=function(t){var r=t.type.toLowerCase();if(t.target=this,this.listeners[r])for(var n=0,i=this.listeners[r];n<i.length;n++){var o=i[n];o.call(this,t)}var a=this["on"+r];return a&&a.call(this,t),!0},e}();Dw.XMLHttpRequestEventTarget=tte});var qR=E(Xl=>{"use strict";var rte=Xl&&Xl.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Xl,"__esModule",{value:!0});var nte=kv(),ite=function(e){rte(t,e);function t(){var r=e.call(this)||this;return r._contentType=null,r._body=null,r._reset(),r}return t.prototype._reset=function(){this._contentType=null,this._body=null},t.prototype._setData=function(r){if(r!=null)if(typeof r=="string")r.length!==0&&(this._contentType="text/plain;charset=UTF-8"),this._body=new Buffer(r,"utf-8");else if(Buffer.isBuffer(r))this._body=r;else if(r instanceof ArrayBuffer){for(var n=new Buffer(r.byteLength),i=new Uint8Array(r),o=0;o<r.byteLength;o++)n[o]=i[o];this._body=n}else if(r.buffer&&r.buffer instanceof ArrayBuffer){for(var n=new Buffer(r.byteLength),a=r.byteOffset,i=new Uint8Array(r.buffer),o=0;o<r.byteLength;o++)n[o]=i[o+a];this._body=n}else throw new Error("Unsupported send() data "+r)},t.prototype._finalizeHeaders=function(r,n){this._contentType&&!n["content-type"]&&(r["Content-Type"]=this._contentType),this._body&&(r["Content-Length"]=this._body.length.toString())},t.prototype._startUpload=function(r){this._body&&r.write(this._body),r.end()},t}(nte.XMLHttpRequestEventTarget);Xl.XMLHttpRequestUpload=ite});var LR=E(Pv=>{(function(){"use strict";function e(i,o,a,c){return this instanceof e?(this.domain=i||void 0,this.path=o||"/",this.secure=!!a,this.script=!!c,this):new e(i,o,a,c)}e.All=Object.freeze(Object.create(null)),Pv.CookieAccessInfo=e;function t(i,o,a){return i instanceof t?i:this instanceof t?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(a||"/"),this.explicit_path=!1,this.domain=o||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,i&&this.parse(i,o,a),this):new t(i,o,a)}Pv.Cookie=t,t.prototype.toString=function(){var o=[this.name+"="+this.value];return this.expiration_date!==1/0&&o.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&o.push("domain="+this.domain),this.path&&o.push("path="+this.path),this.secure&&o.push("secure"),this.noscript&&o.push("httponly"),o.join("; ")},t.prototype.toValueString=function(){return this.name+"="+this.value};var r=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;t.prototype.parse=function(o,a,c){if(this instanceof t){if(o.length>32768){console.warn("Cookie too long for parsing (>32768 characters)");return}var v=o.split(";").filter(function(R){return!!R}),y,w=v[0].match(/([^=]+)=([\s\S]*)/);if(!w){console.warn("Invalid cookie header encountered. Header: '"+o+"'");return}var M=w[1],S=w[2];if(typeof M!="string"||M.length===0||typeof S!="string"){console.warn("Unable to extract values from cookie header. Cookie: '"+o+"'");return}for(this.name=M,this.value=S,y=1;y<v.length;y+=1)switch(w=v[y].match(/([^=]+)(?:=([\s\S]*))?/),M=w[1].trim().toLowerCase(),S=w[2],M){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=S?Number(Date.parse(S)):1/0;break;case"path":this.path=S?S.trim():"",this.explicit_path=!0;break;case"domain":this.domain=S?S.trim():"",this.explicit_domain=!!this.domain;break;case"secure":this.secure=!0;break}return this.explicit_path||(this.path=c||"/"),this.explicit_domain||(this.domain=a),this}return new t().parse(o,a,c)},t.prototype.matches=function(o){return o===e.All?!0:!(this.noscript&&o.script||this.secure&&!o.secure||!this.collidesWith(o))},t.prototype.collidesWith=function(o){if(this.path&&!o.path||this.domain&&!o.domain||this.path&&o.path.indexOf(this.path)!==0||this.explicit_path&&o.path.indexOf(this.path)!==0)return!1;var a=o.domain&&o.domain.replace(/^[\.]/,""),c=this.domain&&this.domain.replace(/^[\.]/,"");if(c===a)return!0;if(c){if(!this.explicit_domain)return!1;var v=a.indexOf(c);return!(v===-1||v!==a.length-c.length)}return!0};function n(){var i,o,a;return this instanceof n?(i=Object.create(null),this.setCookie=function(v,y,w){var M,S;if(v=new t(v,y,w),M=v.expiration_date<=Date.now(),i[v.name]!==void 0){for(o=i[v.name],S=0;S<o.length;S+=1)if(a=o[S],a.collidesWith(v))return M?(o.splice(S,1),o.length===0&&delete i[v.name],!1):(o[S]=v,v);return M?!1:(o.push(v),v)}return M?!1:(i[v.name]=[v],i[v.name])},this.getCookie=function(v,y){var w,M;if(o=i[v],!!o)for(M=0;M<o.length;M+=1){if(w=o[M],w.expiration_date<=Date.now()){o.length===0&&delete i[w.name];continue}if(w.matches(y))return w}},this.getCookies=function(v){var y=[],w,M;for(w in i)M=this.getCookie(w,v),M&&y.push(M);return y.toString=function(){return y.join(":")},y.toValueString=function(){return y.map(function(R){return R.toValueString()}).join("; ")},y},this):new n}Pv.CookieJar=n,n.prototype.setCookies=function(o,a,c){o=Array.isArray(o)?o:o.split(r);var v=[],y,w;for(o=o.map(function(M){return new t(M,a,c)}),y=0;y<o.length;y+=1)w=o[y],this.setCookie(w,a,c)&&v.push(w);return v}})()});var HR=E(La=>{"use strict";var ote=La&&La.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ste=La&&La.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(La,"__esModule",{value:!0});var Fw=fR(),UR=vR(),BR=TR(),jw=kR(),DR=PR(),Nv=NR(),ate=kv(),jR=qR(),FR=LR(),qv=function(e){ote(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.UNSENT=t.UNSENT,n.OPENED=t.OPENED,n.HEADERS_RECEIVED=t.HEADERS_RECEIVED,n.LOADING=t.LOADING,n.DONE=t.DONE,n.onreadystatechange=null,n.readyState=t.UNSENT,n.response=null,n.responseText="",n.responseType="",n.status=0,n.statusText="",n.timeout=0,n.upload=new jR.XMLHttpRequestUpload,n.responseUrl="",n.withCredentials=!1,n._method=null,n._url=null,n._sync=!1,n._headers={},n._loweredHeaders={},n._mimeOverride=null,n._request=null,n._response=null,n._responseParts=null,n._responseHeaders=null,n._aborting=null,n._error=null,n._loadedBytes=0,n._totalBytes=0,n._lengthComputable=!1,n._restrictedMethods={CONNECT:!0,TRACE:!0,TRACK:!0},n._restrictedHeaders={"accept-charset":!0,"accept-encoding":!0,"access-control-request-headers":!0,"access-control-request-method":!0,connection:!0,"content-length":!0,cookie:!0,cookie2:!0,date:!0,dnt:!0,expect:!0,host:!0,"keep-alive":!0,origin:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,via:!0},n._privateHeaders={"set-cookie":!0,"set-cookie2":!0},n._userAgent="Mozilla/5.0 ("+BR.type()+" "+BR.arch()+") node.js/"+process.versions.node+" v8/"+process.versions.v8,n._anonymous=r.anon||!1,n}return t.prototype.open=function(r,n,i,o,a){if(i===void 0&&(i=!0),r=r.toUpperCase(),this._restrictedMethods[r])throw new t.SecurityError("HTTP method "+r+" is not allowed in XHR");var c=this._parseUrl(n,o,a);this.readyState===t.HEADERS_RECEIVED||(this.readyState,t.LOADING),this._method=r,this._url=c,this._sync=!i,this._headers={},this._loweredHeaders={},this._mimeOverride=null,this._setReadyState(t.OPENED),this._request=null,this._response=null,this.status=0,this.statusText="",this._responseParts=[],this._responseHeaders=null,this._loadedBytes=0,this._totalBytes=0,this._lengthComputable=!1},t.prototype.setRequestHeader=function(r,n){if(this.readyState!==t.OPENED)throw new t.InvalidStateError("XHR readyState must be OPENED");var i=r.toLowerCase();if(this._restrictedHeaders[i]||/^sec-/.test(i)||/^proxy-/.test(i)){console.warn('Refused to set unsafe header "'+r+'"');return}n=n.toString(),this._loweredHeaders[i]!=null?(r=this._loweredHeaders[i],this._headers[r]=this._headers[r]+", "+n):(this._loweredHeaders[i]=r,this._headers[r]=n)},t.prototype.send=function(r){if(this.readyState!==t.OPENED)throw new t.InvalidStateError("XHR readyState must be OPENED");if(this._request)throw new t.InvalidStateError("send() already called");switch(this._url.protocol){case"file:":return this._sendFile(r);case"http:":case"https:":return this._sendHttp(r);default:throw new t.NetworkError("Unsupported protocol "+this._url.protocol)}},t.prototype.abort=function(){this._request!=null&&(this._request.abort(),this._setError(),this._dispatchProgress("abort"),this._dispatchProgress("loadend"))},t.prototype.getResponseHeader=function(r){if(this._responseHeaders==null||r==null)return null;var n=r.toLowerCase();return this._responseHeaders.hasOwnProperty(n)?this._responseHeaders[r.toLowerCase()]:null},t.prototype.getAllResponseHeaders=function(){var r=this;return this._responseHeaders==null?"":Object.keys(this._responseHeaders).map(function(n){return n+": "+r._responseHeaders[n]}).join(`\r
534
+ `)},t.prototype.overrideMimeType=function(r){if(this.readyState===t.LOADING||this.readyState===t.DONE)throw new t.InvalidStateError("overrideMimeType() not allowed in LOADING or DONE");this._mimeOverride=r.toLowerCase()},t.prototype.nodejsSet=function(r){if(this.nodejsHttpAgent=r.httpAgent||this.nodejsHttpAgent,this.nodejsHttpsAgent=r.httpsAgent||this.nodejsHttpsAgent,r.hasOwnProperty("baseUrl")){if(r.baseUrl!=null){var n=jw.parse(r.baseUrl,!1,!0);if(!n.protocol)throw new t.SyntaxError("baseUrl must be an absolute URL")}this.nodejsBaseUrl=r.baseUrl}},t.nodejsSet=function(r){t.prototype.nodejsSet(r)},t.prototype._setReadyState=function(r){this.readyState=r,this.dispatchEvent(new DR.ProgressEvent("readystatechange"))},t.prototype._sendFile=function(r){throw new Error("Protocol file: not implemented")},t.prototype._sendHttp=function(r){if(this._sync)throw new Error("Synchronous XHR processing not implemented");r&&(this._method==="GET"||this._method==="HEAD")?(console.warn("Discarding entity body for "+this._method+" requests"),r=null):r=r||"",this.upload._setData(r),this._finalizeHeaders(),this._sendHxxpRequest()},t.prototype._sendHxxpRequest=function(){var r=this;if(this.withCredentials){var n=t.cookieJar.getCookies(FR.CookieAccessInfo(this._url.hostname,this._url.pathname,this._url.protocol==="https:")).toValueString();this._headers.cookie=this._headers.cookie2=n}var i=this._url.protocol==="http:"?[Fw,this.nodejsHttpAgent]:[UR,this.nodejsHttpsAgent],o=i[0],a=i[1],c=o.request.bind(o),v=c({hostname:this._url.hostname,port:+this._url.port,path:this._url.path,auth:this._url.auth,method:this._method,headers:this._headers,agent:a});this._request=v,this.timeout&&v.setTimeout(this.timeout,function(){return r._onHttpTimeout(v)}),v.on("response",function(y){return r._onHttpResponse(v,y)}),v.on("error",function(y){return r._onHttpRequestError(v,y)}),this.upload._startUpload(v),this._request===v&&this._dispatchProgress("loadstart")},t.prototype._finalizeHeaders=function(){this._headers=ste({},this._headers,{Connection:"keep-alive",Host:this._url.host,"User-Agent":this._userAgent},this._anonymous?{Referer:"about:blank"}:{}),this.upload._finalizeHeaders(this._headers,this._loweredHeaders)},t.prototype._onHttpResponse=function(r,n){var i=this;if(this._request===r){if(this.withCredentials&&(n.headers["set-cookie"]||n.headers["set-cookie2"])&&t.cookieJar.setCookies(n.headers["set-cookie"]||n.headers["set-cookie2"]),[301,302,303,307,308].indexOf(n.statusCode)>=0){this._url=this._parseUrl(n.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),this._headers["Content-Type"]!=null&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),this._sendHxxpRequest();return}this._response=n,this._response.on("data",function(a){return i._onHttpResponseData(n,a)}),this._response.on("end",function(){return i._onHttpResponseEnd(n)}),this._response.on("close",function(){return i._onHttpResponseClose(n)}),this.responseUrl=this._url.href.split("#")[0],this.status=n.statusCode,this.statusText=Fw.STATUS_CODES[this.status],this._parseResponseHeaders(n);var o=this._responseHeaders["content-length"]||"";this._totalBytes=+o,this._lengthComputable=!!o,this._setReadyState(t.HEADERS_RECEIVED)}},t.prototype._onHttpResponseData=function(r,n){this._response===r&&(this._responseParts.push(new Buffer(n)),this._loadedBytes+=n.length,this.readyState!==t.LOADING&&this._setReadyState(t.LOADING),this._dispatchProgress("progress"))},t.prototype._onHttpResponseEnd=function(r){this._response===r&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(t.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},t.prototype._onHttpResponseClose=function(r){if(this._response===r){var n=this._request;this._setError(),n.abort(),this._setReadyState(t.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},t.prototype._onHttpTimeout=function(r){this._request===r&&(this._setError(),r.abort(),this._setReadyState(t.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},t.prototype._onHttpRequestError=function(r,n){this._request===r&&(this._setError(),r.abort(),this._setReadyState(t.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},t.prototype._dispatchProgress=function(r){var n=new t.ProgressEvent(r);n.lengthComputable=this._lengthComputable,n.loaded=this._loadedBytes,n.total=this._totalBytes,this.dispatchEvent(n)},t.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},t.prototype._parseUrl=function(r,n,i){var o=this.nodejsBaseUrl==null?r:jw.resolve(this.nodejsBaseUrl,r),a=jw.parse(o,!1,!0);a.hash=null;var c=(a.auth||"").split(":"),v=c[0],y=c[1];return(v||y||n||i)&&(a.auth=(n||v||"")+":"+(i||y||"")),a},t.prototype._parseResponseHeaders=function(r){this._responseHeaders={};for(var n in r.headers){var i=n.toLowerCase();this._privateHeaders[i]||(this._responseHeaders[i]=r.headers[n])}this._mimeOverride!=null&&(this._responseHeaders["content-type"]=this._mimeOverride)},t.prototype._parseResponse=function(){var r=Buffer.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(r.toString("utf-8"))}catch{this.response=null}return;case"buffer":this.responseText=null,this.response=r;return;case"arraybuffer":this.responseText=null;for(var n=new ArrayBuffer(r.length),i=new Uint8Array(n),o=0;o<r.length;o++)i[o]=r[o];this.response=n;return;case"text":default:try{this.responseText=r.toString(this._parseResponseEncoding())}catch{this.responseText=r.toString("binary")}this.response=this.responseText}},t.prototype._parseResponseEncoding=function(){return/;\s*charset=(.*)$/.exec(this._responseHeaders["content-type"]||"")[1]||"utf-8"},t.ProgressEvent=DR.ProgressEvent,t.InvalidStateError=Nv.InvalidStateError,t.NetworkError=Nv.NetworkError,t.SecurityError=Nv.SecurityError,t.SyntaxError=Nv.SyntaxError,t.XMLHttpRequestUpload=jR.XMLHttpRequestUpload,t.UNSENT=0,t.OPENED=1,t.HEADERS_RECEIVED=2,t.LOADING=3,t.DONE=4,t.cookieJar=FR.CookieJar(),t}(ate.XMLHttpRequestEventTarget);La.XMLHttpRequest=qv;qv.prototype.nodejsHttpAgent=Fw.globalAgent;qv.prototype.nodejsHttpsAgent=UR.globalAgent;qv.prototype.nodejsBaseUrl=null});var WR=E(eh=>{"use strict";function ute(e){for(var t in e)eh.hasOwnProperty(t)||(eh[t]=e[t])}Object.defineProperty(eh,"__esModule",{value:!0});ute(HR());var fte=kv();eh.XMLHttpRequestEventTarget=fte.XMLHttpRequestEventTarget});var bf=E((Pke,Lv)=>{var Ba=(Gl(),Pt(mO));if(Ba&&Ba.default){Lv.exports=Ba.default;for(let e in Ba)Lv.exports[e]=Ba[e]}else Ba&&(Lv.exports=Ba)});var $o=E((Nke,Bv)=>{var Da=(pi(),Pt(lO));if(Da&&Da.default){Bv.exports=Da.default;for(let e in Da)Bv.exports[e]=Da[e]}else Da&&(Bv.exports=Da)});var KR=E(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});function lte(e){return function(t){var r=e();return r.update(t),Buffer.from(r.digest())}}Hw.createHashFunction=lte});var Ww=E((Lke,GR)=>{GR.exports=bf().EventEmitter});var QR=E((Bke,JR)=>{"use strict";function ZR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hte(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZR(Object(r),!0).forEach(function(n){dte(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dte(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vte(e,t,r){return t&&YR(e.prototype,t),r&&YR(e,r),e}var mte=fi(),Dv=mte.Buffer,gte=$o(),zw=gte.inspect,bte=zw&&zw.custom||"inspect";function yte(e,t,r){Dv.prototype.copy.call(e,t,r)}JR.exports=function(){function e(){pte(this,e),this.head=null,this.tail=null,this.length=0}return vte(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return Dv.alloc(0);for(var n=Dv.allocUnsafe(r>>>0),i=this.head,o=0;i;)yte(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var a=n.data,c=r>a.length?a.length:r;if(c===a.length?o+=a:o+=a.slice(0,r),r-=c,r===0){c===a.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(c));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=Dv.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var a=i.data,c=r>a.length?a.length:r;if(a.copy(n,n.length-r,0,c),r-=c,r===0){c===a.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(c));break}++o}return this.length-=o,n}},{key:bte,value:function(r,n){return zw(this,hte({},n,{depth:0,customInspect:!1}))}}]),e}()});var $w=E((Dke,eI)=>{"use strict";function _te(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Vw,this,e)):process.nextTick(Vw,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(jv,r):(r._writableState.errorEmitted=!0,process.nextTick(XR,r,o)):process.nextTick(XR,r,o):t?(process.nextTick(jv,r),t(o)):process.nextTick(jv,r)}),this)}function XR(e,t){Vw(e,t),jv(e)}function jv(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function wte(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Vw(e,t){e.emit("error",t)}function xte(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}eI.exports={destroy:_te,undestroy:wte,errorOrDestroy:xte}});var ja=E((jke,nI)=>{"use strict";function Mte(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var rI={};function vi(e,t,r){r||(r=Error);function n(o,a,c){return typeof t=="string"?t:t(o,a,c)}var i=function(o){Mte(a,o);function a(c,v,y){return o.call(this,n(c,v,y))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=e,rI[e]=i}function tI(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Ste(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function Ete(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Ate(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}vi("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);vi("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&Ste(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(Ete(e," argument"))i="The ".concat(e," ").concat(n," ").concat(tI(t,"type"));else{var o=Ate(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(tI(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);vi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");vi("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});vi("ERR_STREAM_PREMATURE_CLOSE","Premature close");vi("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});vi("ERR_MULTIPLE_CALLBACK","Callback called multiple times");vi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");vi("ERR_STREAM_WRITE_AFTER_END","write after end");vi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);vi("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);vi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");nI.exports.codes=rI});var Kw=E((Fke,iI)=>{"use strict";var Ote=ja().codes.ERR_INVALID_OPT_VALUE;function Rte(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Ite(e,t,r,n){var i=Rte(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new Ote(o,i)}return Math.floor(i)}return e.objectMode?16:16*1024}iI.exports={getHighWaterMark:Ite}});var Tr=E((Uke,Gw)=>{typeof Object.create=="function"?Gw.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Gw.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}});var sI=E((Hke,oI)=>{oI.exports=Cte;function Cte(e,t){if(Zw("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Zw("throwDeprecation"))throw new Error(t);Zw("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Zw(e){try{if(!globalThis.localStorage)return!1}catch{return!1}var t=globalThis.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}});var Qw=E((Wke,hI)=>{"use strict";hI.exports=Sr;function uI(e){var t=this;this.next=null,this.entry=null,this.finish=function(){nre(t,e)}}var yf;Sr.WritableState=rh;var Tte={deprecate:sI()},fI=Ww(),Uv=fi().Buffer,kte=globalThis.Uint8Array||function(){};function Pte(e){return Uv.from(e)}function Nte(e){return Uv.isBuffer(e)||e instanceof kte}var Jw=$w(),qte=Kw(),Lte=qte.getHighWaterMark,Es=ja().codes,Bte=Es.ERR_INVALID_ARG_TYPE,Dte=Es.ERR_METHOD_NOT_IMPLEMENTED,jte=Es.ERR_MULTIPLE_CALLBACK,Fte=Es.ERR_STREAM_CANNOT_PIPE,Ute=Es.ERR_STREAM_DESTROYED,Hte=Es.ERR_STREAM_NULL_VALUES,Wte=Es.ERR_STREAM_WRITE_AFTER_END,zte=Es.ERR_UNKNOWN_ENCODING,_f=Jw.errorOrDestroy;Tr()(Sr,fI);function Vte(){}function rh(e,t,r){yf=yf||Fa(),e=e||{},typeof r!="boolean"&&(r=t instanceof yf),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Lte(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){Qte(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new uI(this)}rh.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(rh.prototype,"buffer",{get:Tte.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Fv;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Fv=Function.prototype[Symbol.hasInstance],Object.defineProperty(Sr,Symbol.hasInstance,{value:function(t){return Fv.call(this,t)?!0:this!==Sr?!1:t&&t._writableState instanceof rh}})):Fv=function(t){return t instanceof this};function Sr(e){yf=yf||Fa();var t=this instanceof yf;if(!t&&!Fv.call(Sr,this))return new Sr(e);this._writableState=new rh(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),fI.call(this)}Sr.prototype.pipe=function(){_f(this,new Fte)};function $te(e,t){var r=new Wte;_f(e,r),process.nextTick(t,r)}function Kte(e,t,r,n){var i;return r===null?i=new Hte:typeof r!="string"&&!t.objectMode&&(i=new Bte("chunk",["string","Buffer"],r)),i?(_f(e,i),process.nextTick(n,i),!1):!0}Sr.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=!n.objectMode&&Nte(e);return o&&!Uv.isBuffer(e)&&(e=Pte(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=Vte),n.ending?$te(this,r):(o||Kte(this,n,e,r))&&(n.pendingcb++,i=Zte(this,n,o,e,t,r)),i};Sr.prototype.cork=function(){this._writableState.corked++};Sr.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&cI(this,e))};Sr.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new zte(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(Sr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Gte(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Uv.from(t,r)),t}Object.defineProperty(Sr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Zte(e,t,r,n,i,o){if(!r){var a=Gte(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var c=t.objectMode?1:n.length;t.length+=c;var v=t.length<t.highWaterMark;if(v||(t.needDrain=!0),t.writing||t.corked){var y=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},y?y.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Yw(e,t,!1,c,n,i,o);return v}function Yw(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new Ute("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function Yte(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(th,e,t),e._writableState.errorEmitted=!0,_f(e,n)):(i(n),e._writableState.errorEmitted=!0,_f(e,n),th(e,t))}function Jte(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function Qte(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new jte;if(Jte(r),t)Yte(e,r,n,t,i);else{var o=lI(r)||e.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&cI(e,r),n?process.nextTick(aI,e,r,o,i):aI(e,r,o,i)}}function aI(e,t,r,n){r||Xte(e,t),t.pendingcb--,n(),th(e,t)}function Xte(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function cI(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,Yw(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new uI(t),t.bufferedRequestCount=0}else{for(;r;){var v=r.chunk,y=r.encoding,w=r.callback,M=t.objectMode?1:v.length;if(Yw(e,t,!1,M,v,y,w),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}Sr.prototype._write=function(e,t,r){r(new Dte("_write()"))};Sr.prototype._writev=null;Sr.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||rre(this,n,r),this};Object.defineProperty(Sr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function lI(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function ere(e,t){e._final(function(r){t.pendingcb--,r&&_f(e,r),t.prefinished=!0,e.emit("prefinish"),th(e,t)})}function tre(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(ere,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function th(e,t){var r=lI(t);if(r&&(tre(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function rre(e,t,r){t.ending=!0,th(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function nre(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(Sr.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){!this._writableState||(this._writableState.destroyed=t)}});Sr.prototype.destroy=Jw.destroy;Sr.prototype._undestroy=Jw.undestroy;Sr.prototype._destroy=function(e,t){t(e)}});var Fa=E((zke,pI)=>{"use strict";var ire=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};pI.exports=io;var dI=t2(),e2=Qw();Tr()(io,dI);for(Xw=ire(e2.prototype),Hv=0;Hv<Xw.length;Hv++)Wv=Xw[Hv],io.prototype[Wv]||(io.prototype[Wv]=e2.prototype[Wv]);var Xw,Wv,Hv;function io(e){if(!(this instanceof io))return new io(e);dI.call(this,e),e2.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",ore)))}Object.defineProperty(io.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(io.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(io.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ore(){this._writableState.ended||process.nextTick(sre,this)}function sre(e){e.end()}Object.defineProperty(io.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var Hn=E((r2,mI)=>{var zv=fi(),oo=zv.Buffer;function vI(e,t){for(var r in e)t[r]=e[r]}oo.from&&oo.alloc&&oo.allocUnsafe&&oo.allocUnsafeSlow?mI.exports=zv:(vI(zv,r2),r2.Buffer=Ua);function Ua(e,t,r){return oo(e,t,r)}Ua.prototype=Object.create(oo.prototype);vI(oo,Ua);Ua.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return oo(e,t,r)};Ua.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=oo(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};Ua.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return oo(e)};Ua.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return zv.SlowBuffer(e)}});var o2=E(bI=>{"use strict";var i2=Hn().Buffer,gI=i2.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function are(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function ure(e){var t=are(e);if(typeof t!="string"&&(i2.isEncoding===gI||!gI(e)))throw new Error("Unknown encoding: "+e);return t||e}bI.StringDecoder=nh;function nh(e){this.encoding=ure(e);var t;switch(this.encoding){case"utf16le":this.text=pre,this.end=vre,t=4;break;case"utf8":this.fillLast=lre,t=4;break;case"base64":this.text=mre,this.end=gre,t=3;break;default:this.write=bre,this.end=yre;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=i2.allocUnsafe(t)}nh.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};nh.prototype.end=dre;nh.prototype.text=hre;nh.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function n2(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function fre(e,t,r){var n=t.length-1;if(n<r)return 0;var i=n2(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=n2(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=n2(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function cre(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function lre(e){var t=this.lastTotal-this.lastNeed,r=cre(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function hre(e,t){var r=fre(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function dre(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function pre(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function vre(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function mre(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function gre(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function bre(e){return e.toString(this.encoding)}function yre(e){return e&&e.length?this.write(e):""}});var Vv=E(($ke,wI)=>{"use strict";var yI=ja().codes.ERR_STREAM_PREMATURE_CLOSE;function _re(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function wre(){}function xre(e){return e.setHeader&&typeof e.abort=="function"}function _I(e,t,r){if(typeof t=="function")return _I(e,null,t);t||(t={}),r=_re(r||wre);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,o=function(){e.writable||c()},a=e._writableState&&e._writableState.finished,c=function(){i=!1,a=!0,n||r.call(e)},v=e._readableState&&e._readableState.endEmitted,y=function(){n=!1,v=!0,i||r.call(e)},w=function(C){r.call(e,C)},M=function(){var C;if(n&&!v)return(!e._readableState||!e._readableState.ended)&&(C=new yI),r.call(e,C);if(i&&!a)return(!e._writableState||!e._writableState.ended)&&(C=new yI),r.call(e,C)},S=function(){e.req.on("finish",c)};return xre(e)?(e.on("complete",c),e.on("abort",M),e.req?S():e.on("request",S)):i&&!e._writableState&&(e.on("end",o),e.on("close",o)),e.on("end",y),e.on("finish",c),t.error!==!1&&e.on("error",w),e.on("close",M),function(){e.removeListener("complete",c),e.removeListener("abort",M),e.removeListener("request",S),e.req&&e.req.removeListener("finish",c),e.removeListener("end",o),e.removeListener("close",o),e.removeListener("finish",c),e.removeListener("end",y),e.removeListener("error",w),e.removeListener("close",M)}}wI.exports=_I});var MI=E((Kke,xI)=>{"use strict";var $v;function As(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Mre=Vv(),Os=Symbol("lastResolve"),Ha=Symbol("lastReject"),ih=Symbol("error"),Kv=Symbol("ended"),Wa=Symbol("lastPromise"),s2=Symbol("handlePromise"),za=Symbol("stream");function Rs(e,t){return{value:e,done:t}}function Sre(e){var t=e[Os];if(t!==null){var r=e[za].read();r!==null&&(e[Wa]=null,e[Os]=null,e[Ha]=null,t(Rs(r,!1)))}}function Ere(e){process.nextTick(Sre,e)}function Are(e,t){return function(r,n){e.then(function(){if(t[Kv]){r(Rs(void 0,!0));return}t[s2](r,n)},n)}}var Ore=Object.getPrototypeOf(function(){}),Rre=Object.setPrototypeOf(($v={get stream(){return this[za]},next:function(){var t=this,r=this[ih];if(r!==null)return Promise.reject(r);if(this[Kv])return Promise.resolve(Rs(void 0,!0));if(this[za].destroyed)return new Promise(function(a,c){process.nextTick(function(){t[ih]?c(t[ih]):a(Rs(void 0,!0))})});var n=this[Wa],i;if(n)i=new Promise(Are(n,this));else{var o=this[za].read();if(o!==null)return Promise.resolve(Rs(o,!1));i=new Promise(this[s2])}return this[Wa]=i,i}},As($v,Symbol.asyncIterator,function(){return this}),As($v,"return",function(){var t=this;return new Promise(function(r,n){t[za].destroy(null,function(i){if(i){n(i);return}r(Rs(void 0,!0))})})}),$v),Ore),Ire=function(t){var r,n=Object.create(Rre,(r={},As(r,za,{value:t,writable:!0}),As(r,Os,{value:null,writable:!0}),As(r,Ha,{value:null,writable:!0}),As(r,ih,{value:null,writable:!0}),As(r,Kv,{value:t._readableState.endEmitted,writable:!0}),As(r,s2,{value:function(o,a){var c=n[za].read();c?(n[Wa]=null,n[Os]=null,n[Ha]=null,o(Rs(c,!1))):(n[Os]=o,n[Ha]=a)},writable:!0}),r));return n[Wa]=null,Mre(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Ha];o!==null&&(n[Wa]=null,n[Os]=null,n[Ha]=null,o(i)),n[ih]=i;return}var a=n[Os];a!==null&&(n[Wa]=null,n[Os]=null,n[Ha]=null,a(Rs(void 0,!0))),n[Kv]=!0}),t.on("readable",Ere.bind(null,n)),n};xI.exports=Ire});var EI=E((Gke,SI)=>{SI.exports=function(){throw new Error("Readable.from is not available in the browser")}});var t2=E((Yke,qI)=>{"use strict";qI.exports=Tt;var wf;Tt.ReadableState=II;var Zke=bf().EventEmitter,RI=function(t,r){return t.listeners(r).length},sh=Ww(),Gv=fi().Buffer,Cre=globalThis.Uint8Array||function(){};function Tre(e){return Gv.from(e)}function kre(e){return Gv.isBuffer(e)||e instanceof Cre}var a2=$o(),wt;a2&&a2.debuglog?wt=a2.debuglog("stream"):wt=function(){};var Pre=QR(),p2=$w(),Nre=Kw(),qre=Nre.getHighWaterMark,Zv=ja().codes,Lre=Zv.ERR_INVALID_ARG_TYPE,Bre=Zv.ERR_STREAM_PUSH_AFTER_EOF,Dre=Zv.ERR_METHOD_NOT_IMPLEMENTED,jre=Zv.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,xf,u2,f2;Tr()(Tt,sh);var oh=p2.errorOrDestroy,c2=["error","close","destroy","pause","resume"];function Fre(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function II(e,t,r){wf=wf||Fa(),e=e||{},typeof r!="boolean"&&(r=t instanceof wf),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=qre(this,e,"readableHighWaterMark",r),this.buffer=new Pre,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(xf||(xf=o2().StringDecoder),this.decoder=new xf(e.encoding),this.encoding=e.encoding)}function Tt(e){if(wf=wf||Fa(),!(this instanceof Tt))return new Tt(e);var t=this instanceof wf;this._readableState=new II(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),sh.call(this)}Object.defineProperty(Tt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){!this._readableState||(this._readableState.destroyed=t)}});Tt.prototype.destroy=p2.destroy;Tt.prototype._undestroy=p2.undestroy;Tt.prototype._destroy=function(e,t){t(e)};Tt.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Gv.from(e,t),t=""),n=!0),CI(this,e,t,!1,n)};Tt.prototype.unshift=function(e){return CI(this,e,null,!0,!1)};function CI(e,t,r,n,i){wt("readableAddChunk",t);var o=e._readableState;if(t===null)o.reading=!1,Wre(e,o);else{var a;if(i||(a=Ure(o,t)),a)oh(e,a);else if(o.objectMode||t&&t.length>0)if(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==Gv.prototype&&(t=Tre(t)),n)o.endEmitted?oh(e,new jre):l2(e,o,t,!0);else if(o.ended)oh(e,new Bre);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?l2(e,o,t,!1):d2(e,o)):l2(e,o,t,!1)}else n||(o.reading=!1,d2(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function l2(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Yv(e)),d2(e,t)}function Ure(e,t){var r;return!kre(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Lre("chunk",["string","Buffer","Uint8Array"],t)),r}Tt.prototype.isPaused=function(){return this._readableState.flowing===!1};Tt.prototype.setEncoding=function(e){xf||(xf=o2().StringDecoder);var t=new xf(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var AI=1073741824;function Hre(e){return e>=AI?e=AI:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function OI(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=Hre(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Tt.prototype.read=function(e){wt("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return wt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?h2(this):Yv(this),null;if(e=OI(e,t),e===0&&t.ended)return t.length===0&&h2(this),null;var n=t.needReadable;wt("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,wt("length less than watermark",n)),t.ended||t.reading?(n=!1,wt("reading or ended",n)):n&&(wt("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=OI(r,t)));var i;return e>0?i=PI(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&h2(this)),i!==null&&this.emit("data",i),i};function Wre(e,t){if(wt("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Yv(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,TI(e)))}}function Yv(e){var t=e._readableState;wt("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(wt("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(TI,e))}function TI(e){var t=e._readableState;wt("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,v2(e)}function d2(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(zre,e,t))}function zre(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(wt("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Tt.prototype._read=function(e){oh(this,new Dre("_read()"))};Tt.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,wt("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=i?c:B;n.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(N,q){wt("onunpipe"),N===r&&q&&q.hasUnpiped===!1&&(q.hasUnpiped=!0,w())}function c(){wt("onend"),e.end()}var v=Vre(r);e.on("drain",v);var y=!1;function w(){wt("cleanup"),e.removeListener("close",R),e.removeListener("finish",C),e.removeListener("drain",v),e.removeListener("error",S),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",B),r.removeListener("data",M),y=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&v()}r.on("data",M);function M(N){wt("ondata");var q=e.write(N);wt("dest.write",q),q===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&NI(n.pipes,e)!==-1)&&!y&&(wt("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function S(N){wt("onerror",N),B(),e.removeListener("error",S),RI(e,"error")===0&&oh(e,N)}Fre(e,"error",S);function R(){e.removeListener("finish",C),B()}e.once("close",R);function C(){wt("onfinish"),e.removeListener("close",R),B()}e.once("finish",C);function B(){wt("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(wt("pipe resume"),r.resume()),e};function Vre(e){return function(){var r=e._readableState;wt("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&RI(e,"data")&&(r.flowing=!0,v2(e))}}Tt.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=NI(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Tt.prototype.on=function(e,t){var r=sh.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,wt("on readable",n.length,n.reading),n.length?Yv(this):n.reading||process.nextTick($re,this)),r};Tt.prototype.addListener=Tt.prototype.on;Tt.prototype.removeListener=function(e,t){var r=sh.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(kI,this),r};Tt.prototype.removeAllListeners=function(e){var t=sh.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(kI,this),t};function kI(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function $re(e){wt("readable nexttick read 0"),e.read(0)}Tt.prototype.resume=function(){var e=this._readableState;return e.flowing||(wt("resume"),e.flowing=!e.readableListening,Kre(this,e)),e.paused=!1,this};function Kre(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Gre,e,t))}function Gre(e,t){wt("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),v2(e),t.flowing&&!t.reading&&e.read(0)}Tt.prototype.pause=function(){return wt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(wt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function v2(e){var t=e._readableState;for(wt("flow",t.flowing);t.flowing&&e.read()!==null;);}Tt.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(wt("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(wt("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var c=t.push(a);c||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(c){return function(){return e[c].apply(e,arguments)}}(i));for(var o=0;o<c2.length;o++)e.on(c2[o],this.emit.bind(this,c2[o]));return this._read=function(a){wt("wrapped _read",a),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Tt.prototype[Symbol.asyncIterator]=function(){return u2===void 0&&(u2=MI()),u2(this)});Object.defineProperty(Tt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Tt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Tt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Tt._fromList=PI;Object.defineProperty(Tt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function PI(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function h2(e){var t=e._readableState;wt("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(Zre,t,e))}function Zre(e,t){if(wt("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Tt.from=function(e,t){return f2===void 0&&(f2=EI()),f2(Tt,e,t)});function NI(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var m2=E((Jke,BI)=>{"use strict";BI.exports=Ko;var Jv=ja().codes,Yre=Jv.ERR_METHOD_NOT_IMPLEMENTED,Jre=Jv.ERR_MULTIPLE_CALLBACK,Qre=Jv.ERR_TRANSFORM_ALREADY_TRANSFORMING,Xre=Jv.ERR_TRANSFORM_WITH_LENGTH_0,Qv=Fa();Tr()(Ko,Qv);function ene(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Jre);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ko(e){if(!(this instanceof Ko))return new Ko(e);Qv.call(this,e),this._transformState={afterTransform:ene.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",tne)}function tne(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){LI(e,t,r)}):LI(this,null,null)}Ko.prototype.push=function(e,t){return this._transformState.needTransform=!1,Qv.prototype.push.call(this,e,t)};Ko.prototype._transform=function(e,t,r){r(new Yre("_transform()"))};Ko.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Ko.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Ko.prototype._destroy=function(e,t){Qv.prototype._destroy.call(this,e,function(r){t(r)})};function LI(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Xre;if(e._transformState.transforming)throw new Qre;return e.push(null)}});var FI=E((Qke,jI)=>{"use strict";jI.exports=ah;var DI=m2();Tr()(ah,DI);function ah(e){if(!(this instanceof ah))return new ah(e);DI.call(this,e)}ah.prototype._transform=function(e,t,r){r(null,e)}});var VI=E((Xke,zI)=>{"use strict";var g2;function rne(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var WI=ja().codes,nne=WI.ERR_MISSING_ARGS,ine=WI.ERR_STREAM_DESTROYED;function UI(e){if(e)throw e}function one(e){return e.setHeader&&typeof e.abort=="function"}function sne(e,t,r,n){n=rne(n);var i=!1;e.on("close",function(){i=!0}),g2===void 0&&(g2=Vv()),g2(e,{readable:t,writable:r},function(a){if(a)return n(a);i=!0,n()});var o=!1;return function(a){if(!i&&!o){if(o=!0,one(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(a||new ine("pipe"))}}}function HI(e){e()}function ane(e,t){return e.pipe(t)}function une(e){return!e.length||typeof e[e.length-1]!="function"?UI:e.pop()}function fne(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=une(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new nne("streams");var i,o=t.map(function(a,c){var v=c<t.length-1,y=c>0;return sne(a,v,y,function(w){i||(i=w),w&&o.forEach(HI),!v&&(o.forEach(HI),n(i))})});return t.reduce(ane)}zI.exports=fne});var Xv=E((mi,$I)=>{mi=$I.exports=t2();mi.Stream=mi;mi.Readable=mi;mi.Writable=Qw();mi.Duplex=Fa();mi.Transform=m2();mi.PassThrough=FI();mi.finished=Vv();mi.pipeline=VI()});var ZI=E((ePe,GI)=>{var{Transform:cne}=Xv();GI.exports=e=>class KI extends cne{constructor(r,n,i,o,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=o,this._options=a,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let o=null;try{this.update(r,n)}catch(a){o=a}i(o)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let r=new KI(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}}});var QI=E((tPe,JI)=>{var{Transform:lne}=Xv();JI.exports=e=>class YI extends lne{constructor(r,n,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let o=null;try{this.update(r,n)}catch(a){o=a}i(o)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let r=new YI(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}}});var eC=E((rPe,XI)=>{var hne=ZI(),dne=QI();XI.exports=function(e){let t=hne(e),r=dne(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}}});var nC=E(rC=>{var tC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];rC.p1600=function(e){for(let t=0;t<24;++t){let r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],v=e[6]^e[16]^e[26]^e[36]^e[46],y=e[7]^e[17]^e[27]^e[37]^e[47],w=e[8]^e[18]^e[28]^e[38]^e[48],M=e[9]^e[19]^e[29]^e[39]^e[49],S=w^(i<<1|o>>>31),R=M^(o<<1|i>>>31),C=e[0]^S,B=e[1]^R,N=e[10]^S,q=e[11]^R,H=e[20]^S,D=e[21]^R,ee=e[30]^S,ge=e[31]^R,K=e[40]^S,X=e[41]^R;S=r^(a<<1|c>>>31),R=n^(c<<1|a>>>31);let V=e[2]^S,T=e[3]^R,m=e[12]^S,s=e[13]^R,l=e[22]^S,d=e[23]^R,f=e[32]^S,p=e[33]^R,g=e[42]^S,b=e[43]^R;S=i^(v<<1|y>>>31),R=o^(y<<1|v>>>31);let h=e[4]^S,u=e[5]^R,_=e[14]^S,A=e[15]^R,x=e[24]^S,I=e[25]^R,j=e[34]^S,O=e[35]^R,L=e[44]^S,W=e[45]^R;S=a^(w<<1|M>>>31),R=c^(M<<1|w>>>31);let F=e[6]^S,G=e[7]^R,De=e[16]^S,Y=e[17]^R,Q=e[26]^S,Ve=e[27]^R,J=e[36]^S,be=e[37]^R,Ke=e[46]^S,ye=e[47]^R;S=v^(r<<1|n>>>31),R=y^(n<<1|r>>>31);let Re=e[8]^S,et=e[9]^R,oe=e[18]^S,xe=e[19]^R,it=e[28]^S,ce=e[29]^R,Ie=e[38]^S,ft=e[39]^R,le=e[48]^S,Ce=e[49]^R,ot=C,se=B,Me=q<<4|N>>>28,st=N<<4|q>>>28,ae=H<<3|D>>>29,Se=D<<3|H>>>29,at=ge<<9|ee>>>23,re=ee<<9|ge>>>23,Te=K<<18|X>>>14,ct=X<<18|K>>>14,ne=V<<1|T>>>31,Ee=T<<1|V>>>31,lt=s<<12|m>>>20,te=m<<12|s>>>20,ke=l<<10|d>>>22,ht=d<<10|l>>>22,ue=p<<13|f>>>19,Pe=f<<13|p>>>19,dt=g<<2|b>>>30,he=b<<2|g>>>30,Ne=u<<30|h>>>2,pt=h<<30|u>>>2,de=_<<6|A>>>26,qe=A<<6|_>>>26,vt=I<<11|x>>>21,pe=x<<11|I>>>21,Le=j<<15|O>>>17,ut=O<<15|j>>>17,ve=W<<29|L>>>3,Be=L<<29|W>>>3,mt=F<<28|G>>>4,me=G<<28|F>>>4,Ae=Y<<23|De>>>9,$t=De<<23|Y>>>9,Je=Q<<25|Ve>>>7,Qe=Ve<<25|Q>>>7,Lt=J<<21|be>>>11,Bt=be<<21|J>>>11,Dt=ye<<24|Ke>>>8,jt=Ke<<24|ye>>>8,Ft=Re<<27|et>>>5,lr=et<<27|Re>>>5,hr=oe<<20|xe>>>12,or=xe<<20|oe>>>12,Kt=ce<<7|it>>>25,sr=it<<7|ce>>>25,Ut=Ie<<8|ft>>>24,dr=ft<<8|Ie>>>24,Jt=le<<14|Ce>>>18,tr=Ce<<14|le>>>18;e[0]=ot^~lt&vt,e[1]=se^~te&pe,e[10]=mt^~hr&ae,e[11]=me^~or&Se,e[20]=ne^~de&Je,e[21]=Ee^~qe&Qe,e[30]=Ft^~Me&ke,e[31]=lr^~st&ht,e[40]=Ne^~Ae&Kt,e[41]=pt^~$t&sr,e[2]=lt^~vt&Lt,e[3]=te^~pe&Bt,e[12]=hr^~ae&ue,e[13]=or^~Se&Pe,e[22]=de^~Je&Ut,e[23]=qe^~Qe&dr,e[32]=Me^~ke&Le,e[33]=st^~ht&ut,e[42]=Ae^~Kt&at,e[43]=$t^~sr&re,e[4]=vt^~Lt&Jt,e[5]=pe^~Bt&tr,e[14]=ae^~ue&ve,e[15]=Se^~Pe&Be,e[24]=Je^~Ut&Te,e[25]=Qe^~dr&ct,e[34]=ke^~Le&Dt,e[35]=ht^~ut&jt,e[44]=Kt^~at&dt,e[45]=sr^~re&he,e[6]=Lt^~Jt&ot,e[7]=Bt^~tr&se,e[16]=ue^~ve&mt,e[17]=Pe^~Be&me,e[26]=Ut^~Te&ne,e[27]=dr^~ct&Ee,e[36]=Le^~Dt&Ft,e[37]=ut^~jt&lr,e[46]=at^~dt&Ne,e[47]=re^~he&pt,e[8]=Jt^~ot&lt,e[9]=tr^~se&te,e[18]=ve^~mt&hr,e[19]=Be^~me&or,e[28]=Te^~ne&de,e[29]=ct^~Ee&qe,e[38]=Dt^~Ft&Me,e[39]=jt^~lr&st,e[48]=dt^~Ne&Ae,e[49]=he^~pt&$t,e[0]^=tC[t*2],e[1]^=tC[t*2+1]}}});var oC=E((iPe,iC)=>{var e1=nC();function Mf(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Mf.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Mf.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(e1.p1600(this.state),this.count=0)};Mf.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),(e&128)!==0&&this.count===this.blockSize-1&&e1.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),e1.p1600(this.state),this.count=0,this.squeezing=!0};Mf.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);let t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(e1.p1600(this.state),this.count=0);return t};Mf.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};iC.exports=Mf});var b2=E((oPe,sC)=>{sC.exports=eC()(oC())});var y2=E(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});var t1=KR(),r1=b2();Sf.keccak224=t1.createHashFunction(function(){return r1("keccak224")});Sf.keccak256=t1.createHashFunction(function(){return r1("keccak256")});Sf.keccak384=t1.createHashFunction(function(){return r1("keccak384")});Sf.keccak512=t1.createHashFunction(function(){return r1("keccak512")})});var uC=E((aPe,aC)=>{var Nt={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function gi(e,t){if(!e)throw new Error(t)}function It(e,t,r){if(gi(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),r!==void 0)if(Array.isArray(r)){let n=r.join(", "),i=`Expected ${e} to be an Uint8Array with length [${n}]`;gi(r.includes(t.length),i)}else{let n=`Expected ${e} to be an Uint8Array with length ${r}`;gi(t.length===r,n)}}function Va(e){gi(Ef(e)==="Boolean","Expected compressed to be a Boolean")}function Ni(e=r=>new Uint8Array(r),t){return typeof e=="function"&&(e=e(t)),It("output",e,t),e}function Ef(e){return Object.prototype.toString.call(e).slice(8,-1)}aC.exports=e=>({contextRandomize(t){switch(gi(t===null||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),t!==null&&It("seed",t,32),e.contextRandomize(t)){case 1:throw new Error(Nt.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(t){return It("private key",t,32),e.privateKeyVerify(t)===0},privateKeyNegate(t){switch(It("private key",t,32),e.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(Nt.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(t,r){switch(It("private key",t,32),It("tweak",r,32),e.privateKeyTweakAdd(t,r)){case 0:return t;case 1:throw new Error(Nt.TWEAK_ADD)}},privateKeyTweakMul(t,r){switch(It("private key",t,32),It("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(Nt.TWEAK_MUL)}},publicKeyVerify(t){return It("public key",t,[33,65]),e.publicKeyVerify(t)===0},publicKeyCreate(t,r=!0,n){switch(It("private key",t,32),Va(r),n=Ni(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error(Nt.SECKEY_INVALID);case 2:throw new Error(Nt.PUBKEY_SERIALIZE)}},publicKeyConvert(t,r=!0,n){switch(It("public key",t,[33,65]),Va(r),n=Ni(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.PUBKEY_SERIALIZE)}},publicKeyNegate(t,r=!0,n){switch(It("public key",t,[33,65]),Va(r),n=Ni(n,r?33:65),e.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.IMPOSSIBLE_CASE);case 3:throw new Error(Nt.PUBKEY_SERIALIZE)}},publicKeyCombine(t,r=!0,n){gi(Array.isArray(t),"Expected public keys to be an Array"),gi(t.length>0,"Expected public keys array will have more than zero items");for(let i of t)It("public key",i,[33,65]);switch(Va(r),n=Ni(n,r?33:65),e.publicKeyCombine(n,t)){case 0:return n;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.PUBKEY_COMBINE);case 3:throw new Error(Nt.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(t,r,n=!0,i){switch(It("public key",t,[33,65]),It("tweak",r,32),Va(n),i=Ni(i,n?33:65),e.publicKeyTweakAdd(i,t,r)){case 0:return i;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.TWEAK_ADD)}},publicKeyTweakMul(t,r,n=!0,i){switch(It("public key",t,[33,65]),It("tweak",r,32),Va(n),i=Ni(i,n?33:65),e.publicKeyTweakMul(i,t,r)){case 0:return i;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.TWEAK_MUL)}},signatureNormalize(t){switch(It("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(Nt.SIG_PARSE)}},signatureExport(t,r){It("signature",t,64),r=Ni(r,72);let n={output:r,outputlen:72};switch(e.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(Nt.SIG_PARSE);case 2:throw new Error(Nt.IMPOSSIBLE_CASE)}},signatureImport(t,r){switch(It("signature",t),r=Ni(r,64),e.signatureImport(r,t)){case 0:return r;case 1:throw new Error(Nt.SIG_PARSE);case 2:throw new Error(Nt.IMPOSSIBLE_CASE)}},ecdsaSign(t,r,n={},i){It("message",t,32),It("private key",r,32),gi(Ef(n)==="Object","Expected options to be an Object"),n.data!==void 0&&It("options.data",n.data),n.noncefn!==void 0&&gi(Ef(n.noncefn)==="Function","Expected options.noncefn to be a Function"),i=Ni(i,64);let o={signature:i,recid:null};switch(e.ecdsaSign(o,t,r,n.data,n.noncefn)){case 0:return o;case 1:throw new Error(Nt.SIGN);case 2:throw new Error(Nt.IMPOSSIBLE_CASE)}},ecdsaVerify(t,r,n){switch(It("signature",t,64),It("message",r,32),It("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(Nt.SIG_PARSE);case 2:throw new Error(Nt.PUBKEY_PARSE)}},ecdsaRecover(t,r,n,i=!0,o){switch(It("signature",t,64),gi(Ef(r)==="Number"&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),It("message",n,32),Va(i),o=Ni(o,i?33:65),e.ecdsaRecover(o,t,r,n)){case 0:return o;case 1:throw new Error(Nt.SIG_PARSE);case 2:throw new Error(Nt.RECOVER);case 3:throw new Error(Nt.IMPOSSIBLE_CASE)}},ecdh(t,r,n={},i){switch(It("public key",t,[33,65]),It("private key",r,32),gi(Ef(n)==="Object","Expected options to be an Object"),n.data!==void 0&&It("options.data",n.data),n.hashfn!==void 0?(gi(Ef(n.hashfn)==="Function","Expected options.hashfn to be a Function"),n.xbuf!==void 0&&It("options.xbuf",n.xbuf,32),n.ybuf!==void 0&&It("options.ybuf",n.ybuf,32),It("output",i)):i=Ni(i,32),e.ecdh(i,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.ECDH)}}})});var fC=E((uPe,pne)=>{pne.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var so=E((cC,_2)=>{(function(e,t){"use strict";function r(m,s){if(!m)throw new Error(s||"Assertion failed")}function n(m,s){m.super_=s;var l=function(){};l.prototype=s.prototype,m.prototype=new l,m.prototype.constructor=m}function i(m,s,l){if(i.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(m||0,s||10,l||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=fi().Buffer}catch{}i.isBN=function(s){return s instanceof i?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===i.wordSize&&Array.isArray(s.words)},i.max=function(s,l){return s.cmp(l)>0?s:l},i.min=function(s,l){return s.cmp(l)<0?s:l},i.prototype._init=function(s,l,d){if(typeof s=="number")return this._initNumber(s,l,d);if(typeof s=="object")return this._initArray(s,l,d);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f<s.length&&(l===16?this._parseHex(s,f,d):(this._parseBase(s,l,f),d==="le"&&this._initArray(this.toArray(),l,d)))},i.prototype._initNumber=function(s,l,d){s<0&&(this.negative=1,s=-s),s<67108864?(this.words=[s&67108863],this.length=1):s<4503599627370496?(this.words=[s&67108863,s/67108864&67108863],this.length=2):(r(s<9007199254740992),this.words=[s&67108863,s/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),l,d)},i.prototype._initArray=function(s,l,d){if(r(typeof s.length=="number"),s.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(s.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p,g,b=0;if(d==="be")for(f=s.length-1,p=0;f>=0;f-=3)g=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);else if(d==="le")for(f=0,p=0;f<s.length;f+=3)g=s[f]|s[f+1]<<8|s[f+2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);return this.strip()};function a(m,s){var l=m.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function c(m,s,l){var d=a(m,l);return l-1>=s&&(d|=a(m,l-1)<<4),d}i.prototype._parseHex=function(s,l,d){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p=0,g=0,b;if(d==="be")for(f=s.length-1;f>=l;f-=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8;else{var h=s.length-l;for(f=h%2===0?l+1:l;f<s.length;f+=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8}this.strip()};function v(m,s,l,d){for(var f=0,p=Math.min(m.length,l),g=s;g<p;g++){var b=m.charCodeAt(g)-48;f*=d,b>=49?f+=b-49+10:b>=17?f+=b-17+10:f+=b}return f}i.prototype._parseBase=function(s,l,d){this.words=[0],this.length=1;for(var f=0,p=1;p<=67108863;p*=l)f++;f--,p=p/l|0;for(var g=s.length-d,b=g%f,h=Math.min(g,g-b)+d,u=0,_=d;_<h;_+=f)u=v(s,_,_+f,l),this.imuln(p),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(b!==0){var A=1;for(u=v(s,_,s.length,l),_=0;_<b;_++)A*=l;this.imuln(A),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(s){s.words=new Array(this.length);for(var l=0;l<this.length;l++)s.words[l]=this.words[l];s.length=this.length,s.negative=this.negative,s.red=this.red},i.prototype.clone=function(){var s=new i(null);return this.copy(s),s},i.prototype._expand=function(s){for(;this.length<s;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,l){s=s||10,l=l|0||1;var d;if(s===16||s==="hex"){d="";for(var f=0,p=0,g=0;g<this.length;g++){var b=this.words[g],h=((b<<f|p)&16777215).toString(16);p=b>>>24-f&16777215,p!==0||g!==this.length-1?d=y[6-h.length]+h+d:d=h+d,f+=2,f>=26&&(f-=26,g--)}for(p!==0&&(d=p.toString(16)+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(s===(s|0)&&s>=2&&s<=36){var u=w[s],_=M[s];d="";var A=this.clone();for(A.negative=0;!A.isZero();){var x=A.modn(_).toString(s);A=A.idivn(_),A.isZero()?d=x+d:d=y[u-x.length]+x+d}for(this.isZero()&&(d="0"+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},i.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},i.prototype.toArrayLike=function(s,l,d){var f=this.byteLength(),p=d||Math.max(1,f);r(f<=p,"byte array longer than desired length"),r(p>0,"Requested array length <= 0"),this.strip();var g=l==="le",b=new s(p),h,u,_=this.clone();if(g){for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[u]=h;for(;u<p;u++)b[u]=0}else{for(u=0;u<p-f;u++)b[u]=0;for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[p-u-1]=h}return b},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var l=s,d=0;return l>=4096&&(d+=13,l>>>=13),l>=64&&(d+=7,l>>>=7),l>=8&&(d+=4,l>>>=4),l>=2&&(d+=2,l>>>=2),d+l},i.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,d=0;return(l&8191)===0&&(d+=13,l>>>=13),(l&127)===0&&(d+=7,l>>>=7),(l&15)===0&&(d+=4,l>>>=4),(l&3)===0&&(d+=2,l>>>=2),(l&1)===0&&d++,d},i.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function S(m){for(var s=new Array(m.bitLength()),l=0;l<s.length;l++){var d=l/26|0,f=l%26;s[l]=(m.words[d]&1<<f)>>>f}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;l<this.length;l++){var d=this._zeroBits(this.words[l]);if(s+=d,d!==26)break}return s},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(s){return this.negative!==0?this.abs().inotn(s).iaddn(1):this.clone()},i.prototype.fromTwos=function(s){return this.testn(s-1)?this.notn(s).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(s){for(;this.length<s.length;)this.words[this.length++]=0;for(var l=0;l<s.length;l++)this.words[l]=this.words[l]|s.words[l];return this.strip()},i.prototype.ior=function(s){return r((this.negative|s.negative)===0),this.iuor(s)},i.prototype.or=function(s){return this.length>s.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]&s.words[d];return this.length=l.length,this.strip()},i.prototype.iand=function(s){return r((this.negative|s.negative)===0),this.iuand(s)},i.prototype.and=function(s){return this.length>s.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var l,d;this.length>s.length?(l=this,d=s):(l=s,d=this);for(var f=0;f<d.length;f++)this.words[f]=l.words[f]^d.words[f];if(this!==l)for(;f<l.length;f++)this.words[f]=l.words[f];return this.length=l.length,this.strip()},i.prototype.ixor=function(s){return r((this.negative|s.negative)===0),this.iuxor(s)},i.prototype.xor=function(s){return this.length>s.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,d=s%26;this._expand(l),d>0&&l--;for(var f=0;f<l;f++)this.words[f]=~this.words[f]&67108863;return d>0&&(this.words[f]=~this.words[f]&67108863>>26-d),this.strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var d=s/26|0,f=s%26;return this._expand(d+1),l?this.words[d]=this.words[d]|1<<f:this.words[d]=this.words[d]&~(1<<f),this.strip()},i.prototype.iadd=function(s){var l;if(this.negative!==0&&s.negative===0)return this.negative=0,l=this.isub(s),this.negative^=1,this._normSign();if(this.negative===0&&s.negative!==0)return s.negative=0,l=this.isub(s),s.negative=1,l._normSign();var d,f;this.length>s.length?(d=this,f=s):(d=s,f=this);for(var p=0,g=0;g<f.length;g++)l=(d.words[g]|0)+(f.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;for(;p!==0&&g<d.length;g++)l=(d.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;if(this.length=d.length,p!==0)this.words[this.length]=p,this.length++;else if(d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this},i.prototype.add=function(s){var l;return s.negative!==0&&this.negative===0?(s.negative=0,l=this.sub(s),s.negative^=1,l):s.negative===0&&this.negative!==0?(this.negative=0,l=s.sub(this),this.negative=1,l):this.length>s.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var d=this.cmp(s);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,p;d>0?(f=this,p=s):(f=s,p=this);for(var g=0,b=0;b<p.length;b++)l=(f.words[b]|0)-(p.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;for(;g!==0&&b<f.length;b++)l=(f.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;if(g===0&&b<f.length&&f!==this)for(;b<f.length;b++)this.words[b]=f.words[b];return this.length=Math.max(this.length,b),f!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(s){return this.clone().isub(s)};function R(m,s,l){l.negative=s.negative^m.negative;var d=m.length+s.length|0;l.length=d,d=d-1|0;var f=m.words[0]|0,p=s.words[0]|0,g=f*p,b=g&67108863,h=g/67108864|0;l.words[0]=b;for(var u=1;u<d;u++){for(var _=h>>>26,A=h&67108863,x=Math.min(u,s.length-1),I=Math.max(0,u-m.length+1);I<=x;I++){var j=u-I|0;f=m.words[j]|0,p=s.words[I]|0,g=f*p+A,_+=g/67108864|0,A=g&67108863}l.words[u]=A|0,h=_|0}return h!==0?l.words[u]=h|0:l.length--,l.strip()}var C=function(s,l,d){var f=s.words,p=l.words,g=d.words,b=0,h,u,_,A=f[0]|0,x=A&8191,I=A>>>13,j=f[1]|0,O=j&8191,L=j>>>13,W=f[2]|0,F=W&8191,G=W>>>13,De=f[3]|0,Y=De&8191,Q=De>>>13,Ve=f[4]|0,J=Ve&8191,be=Ve>>>13,Ke=f[5]|0,ye=Ke&8191,Re=Ke>>>13,et=f[6]|0,oe=et&8191,xe=et>>>13,it=f[7]|0,ce=it&8191,Ie=it>>>13,ft=f[8]|0,le=ft&8191,Ce=ft>>>13,ot=f[9]|0,se=ot&8191,Me=ot>>>13,st=p[0]|0,ae=st&8191,Se=st>>>13,at=p[1]|0,re=at&8191,Te=at>>>13,ct=p[2]|0,ne=ct&8191,Ee=ct>>>13,lt=p[3]|0,te=lt&8191,ke=lt>>>13,ht=p[4]|0,ue=ht&8191,Pe=ht>>>13,dt=p[5]|0,he=dt&8191,Ne=dt>>>13,pt=p[6]|0,de=pt&8191,qe=pt>>>13,vt=p[7]|0,pe=vt&8191,Le=vt>>>13,ut=p[8]|0,ve=ut&8191,Be=ut>>>13,mt=p[9]|0,me=mt&8191,Ae=mt>>>13;d.negative=s.negative^l.negative,d.length=19,h=Math.imul(x,ae),u=Math.imul(x,Se),u=u+Math.imul(I,ae)|0,_=Math.imul(I,Se);var $t=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+($t>>>26)|0,$t&=67108863,h=Math.imul(O,ae),u=Math.imul(O,Se),u=u+Math.imul(L,ae)|0,_=Math.imul(L,Se),h=h+Math.imul(x,re)|0,u=u+Math.imul(x,Te)|0,u=u+Math.imul(I,re)|0,_=_+Math.imul(I,Te)|0;var Je=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Je>>>26)|0,Je&=67108863,h=Math.imul(F,ae),u=Math.imul(F,Se),u=u+Math.imul(G,ae)|0,_=Math.imul(G,Se),h=h+Math.imul(O,re)|0,u=u+Math.imul(O,Te)|0,u=u+Math.imul(L,re)|0,_=_+Math.imul(L,Te)|0,h=h+Math.imul(x,ne)|0,u=u+Math.imul(x,Ee)|0,u=u+Math.imul(I,ne)|0,_=_+Math.imul(I,Ee)|0;var Qe=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,h=Math.imul(Y,ae),u=Math.imul(Y,Se),u=u+Math.imul(Q,ae)|0,_=Math.imul(Q,Se),h=h+Math.imul(F,re)|0,u=u+Math.imul(F,Te)|0,u=u+Math.imul(G,re)|0,_=_+Math.imul(G,Te)|0,h=h+Math.imul(O,ne)|0,u=u+Math.imul(O,Ee)|0,u=u+Math.imul(L,ne)|0,_=_+Math.imul(L,Ee)|0,h=h+Math.imul(x,te)|0,u=u+Math.imul(x,ke)|0,u=u+Math.imul(I,te)|0,_=_+Math.imul(I,ke)|0;var Lt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(J,ae),u=Math.imul(J,Se),u=u+Math.imul(be,ae)|0,_=Math.imul(be,Se),h=h+Math.imul(Y,re)|0,u=u+Math.imul(Y,Te)|0,u=u+Math.imul(Q,re)|0,_=_+Math.imul(Q,Te)|0,h=h+Math.imul(F,ne)|0,u=u+Math.imul(F,Ee)|0,u=u+Math.imul(G,ne)|0,_=_+Math.imul(G,Ee)|0,h=h+Math.imul(O,te)|0,u=u+Math.imul(O,ke)|0,u=u+Math.imul(L,te)|0,_=_+Math.imul(L,ke)|0,h=h+Math.imul(x,ue)|0,u=u+Math.imul(x,Pe)|0,u=u+Math.imul(I,ue)|0,_=_+Math.imul(I,Pe)|0;var Bt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(ye,ae),u=Math.imul(ye,Se),u=u+Math.imul(Re,ae)|0,_=Math.imul(Re,Se),h=h+Math.imul(J,re)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(be,re)|0,_=_+Math.imul(be,Te)|0,h=h+Math.imul(Y,ne)|0,u=u+Math.imul(Y,Ee)|0,u=u+Math.imul(Q,ne)|0,_=_+Math.imul(Q,Ee)|0,h=h+Math.imul(F,te)|0,u=u+Math.imul(F,ke)|0,u=u+Math.imul(G,te)|0,_=_+Math.imul(G,ke)|0,h=h+Math.imul(O,ue)|0,u=u+Math.imul(O,Pe)|0,u=u+Math.imul(L,ue)|0,_=_+Math.imul(L,Pe)|0,h=h+Math.imul(x,he)|0,u=u+Math.imul(x,Ne)|0,u=u+Math.imul(I,he)|0,_=_+Math.imul(I,Ne)|0;var Dt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,h=Math.imul(oe,ae),u=Math.imul(oe,Se),u=u+Math.imul(xe,ae)|0,_=Math.imul(xe,Se),h=h+Math.imul(ye,re)|0,u=u+Math.imul(ye,Te)|0,u=u+Math.imul(Re,re)|0,_=_+Math.imul(Re,Te)|0,h=h+Math.imul(J,ne)|0,u=u+Math.imul(J,Ee)|0,u=u+Math.imul(be,ne)|0,_=_+Math.imul(be,Ee)|0,h=h+Math.imul(Y,te)|0,u=u+Math.imul(Y,ke)|0,u=u+Math.imul(Q,te)|0,_=_+Math.imul(Q,ke)|0,h=h+Math.imul(F,ue)|0,u=u+Math.imul(F,Pe)|0,u=u+Math.imul(G,ue)|0,_=_+Math.imul(G,Pe)|0,h=h+Math.imul(O,he)|0,u=u+Math.imul(O,Ne)|0,u=u+Math.imul(L,he)|0,_=_+Math.imul(L,Ne)|0,h=h+Math.imul(x,de)|0,u=u+Math.imul(x,qe)|0,u=u+Math.imul(I,de)|0,_=_+Math.imul(I,qe)|0;var jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(jt>>>26)|0,jt&=67108863,h=Math.imul(ce,ae),u=Math.imul(ce,Se),u=u+Math.imul(Ie,ae)|0,_=Math.imul(Ie,Se),h=h+Math.imul(oe,re)|0,u=u+Math.imul(oe,Te)|0,u=u+Math.imul(xe,re)|0,_=_+Math.imul(xe,Te)|0,h=h+Math.imul(ye,ne)|0,u=u+Math.imul(ye,Ee)|0,u=u+Math.imul(Re,ne)|0,_=_+Math.imul(Re,Ee)|0,h=h+Math.imul(J,te)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(be,te)|0,_=_+Math.imul(be,ke)|0,h=h+Math.imul(Y,ue)|0,u=u+Math.imul(Y,Pe)|0,u=u+Math.imul(Q,ue)|0,_=_+Math.imul(Q,Pe)|0,h=h+Math.imul(F,he)|0,u=u+Math.imul(F,Ne)|0,u=u+Math.imul(G,he)|0,_=_+Math.imul(G,Ne)|0,h=h+Math.imul(O,de)|0,u=u+Math.imul(O,qe)|0,u=u+Math.imul(L,de)|0,_=_+Math.imul(L,qe)|0,h=h+Math.imul(x,pe)|0,u=u+Math.imul(x,Le)|0,u=u+Math.imul(I,pe)|0,_=_+Math.imul(I,Le)|0;var Ft=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,h=Math.imul(le,ae),u=Math.imul(le,Se),u=u+Math.imul(Ce,ae)|0,_=Math.imul(Ce,Se),h=h+Math.imul(ce,re)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(Ie,re)|0,_=_+Math.imul(Ie,Te)|0,h=h+Math.imul(oe,ne)|0,u=u+Math.imul(oe,Ee)|0,u=u+Math.imul(xe,ne)|0,_=_+Math.imul(xe,Ee)|0,h=h+Math.imul(ye,te)|0,u=u+Math.imul(ye,ke)|0,u=u+Math.imul(Re,te)|0,_=_+Math.imul(Re,ke)|0,h=h+Math.imul(J,ue)|0,u=u+Math.imul(J,Pe)|0,u=u+Math.imul(be,ue)|0,_=_+Math.imul(be,Pe)|0,h=h+Math.imul(Y,he)|0,u=u+Math.imul(Y,Ne)|0,u=u+Math.imul(Q,he)|0,_=_+Math.imul(Q,Ne)|0,h=h+Math.imul(F,de)|0,u=u+Math.imul(F,qe)|0,u=u+Math.imul(G,de)|0,_=_+Math.imul(G,qe)|0,h=h+Math.imul(O,pe)|0,u=u+Math.imul(O,Le)|0,u=u+Math.imul(L,pe)|0,_=_+Math.imul(L,Le)|0,h=h+Math.imul(x,ve)|0,u=u+Math.imul(x,Be)|0,u=u+Math.imul(I,ve)|0,_=_+Math.imul(I,Be)|0;var lr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,h=Math.imul(se,ae),u=Math.imul(se,Se),u=u+Math.imul(Me,ae)|0,_=Math.imul(Me,Se),h=h+Math.imul(le,re)|0,u=u+Math.imul(le,Te)|0,u=u+Math.imul(Ce,re)|0,_=_+Math.imul(Ce,Te)|0,h=h+Math.imul(ce,ne)|0,u=u+Math.imul(ce,Ee)|0,u=u+Math.imul(Ie,ne)|0,_=_+Math.imul(Ie,Ee)|0,h=h+Math.imul(oe,te)|0,u=u+Math.imul(oe,ke)|0,u=u+Math.imul(xe,te)|0,_=_+Math.imul(xe,ke)|0,h=h+Math.imul(ye,ue)|0,u=u+Math.imul(ye,Pe)|0,u=u+Math.imul(Re,ue)|0,_=_+Math.imul(Re,Pe)|0,h=h+Math.imul(J,he)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(be,he)|0,_=_+Math.imul(be,Ne)|0,h=h+Math.imul(Y,de)|0,u=u+Math.imul(Y,qe)|0,u=u+Math.imul(Q,de)|0,_=_+Math.imul(Q,qe)|0,h=h+Math.imul(F,pe)|0,u=u+Math.imul(F,Le)|0,u=u+Math.imul(G,pe)|0,_=_+Math.imul(G,Le)|0,h=h+Math.imul(O,ve)|0,u=u+Math.imul(O,Be)|0,u=u+Math.imul(L,ve)|0,_=_+Math.imul(L,Be)|0,h=h+Math.imul(x,me)|0,u=u+Math.imul(x,Ae)|0,u=u+Math.imul(I,me)|0,_=_+Math.imul(I,Ae)|0;var hr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,h=Math.imul(se,re),u=Math.imul(se,Te),u=u+Math.imul(Me,re)|0,_=Math.imul(Me,Te),h=h+Math.imul(le,ne)|0,u=u+Math.imul(le,Ee)|0,u=u+Math.imul(Ce,ne)|0,_=_+Math.imul(Ce,Ee)|0,h=h+Math.imul(ce,te)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(Ie,te)|0,_=_+Math.imul(Ie,ke)|0,h=h+Math.imul(oe,ue)|0,u=u+Math.imul(oe,Pe)|0,u=u+Math.imul(xe,ue)|0,_=_+Math.imul(xe,Pe)|0,h=h+Math.imul(ye,he)|0,u=u+Math.imul(ye,Ne)|0,u=u+Math.imul(Re,he)|0,_=_+Math.imul(Re,Ne)|0,h=h+Math.imul(J,de)|0,u=u+Math.imul(J,qe)|0,u=u+Math.imul(be,de)|0,_=_+Math.imul(be,qe)|0,h=h+Math.imul(Y,pe)|0,u=u+Math.imul(Y,Le)|0,u=u+Math.imul(Q,pe)|0,_=_+Math.imul(Q,Le)|0,h=h+Math.imul(F,ve)|0,u=u+Math.imul(F,Be)|0,u=u+Math.imul(G,ve)|0,_=_+Math.imul(G,Be)|0,h=h+Math.imul(O,me)|0,u=u+Math.imul(O,Ae)|0,u=u+Math.imul(L,me)|0,_=_+Math.imul(L,Ae)|0;var or=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(or>>>26)|0,or&=67108863,h=Math.imul(se,ne),u=Math.imul(se,Ee),u=u+Math.imul(Me,ne)|0,_=Math.imul(Me,Ee),h=h+Math.imul(le,te)|0,u=u+Math.imul(le,ke)|0,u=u+Math.imul(Ce,te)|0,_=_+Math.imul(Ce,ke)|0,h=h+Math.imul(ce,ue)|0,u=u+Math.imul(ce,Pe)|0,u=u+Math.imul(Ie,ue)|0,_=_+Math.imul(Ie,Pe)|0,h=h+Math.imul(oe,he)|0,u=u+Math.imul(oe,Ne)|0,u=u+Math.imul(xe,he)|0,_=_+Math.imul(xe,Ne)|0,h=h+Math.imul(ye,de)|0,u=u+Math.imul(ye,qe)|0,u=u+Math.imul(Re,de)|0,_=_+Math.imul(Re,qe)|0,h=h+Math.imul(J,pe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(be,pe)|0,_=_+Math.imul(be,Le)|0,h=h+Math.imul(Y,ve)|0,u=u+Math.imul(Y,Be)|0,u=u+Math.imul(Q,ve)|0,_=_+Math.imul(Q,Be)|0,h=h+Math.imul(F,me)|0,u=u+Math.imul(F,Ae)|0,u=u+Math.imul(G,me)|0,_=_+Math.imul(G,Ae)|0;var Kt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,h=Math.imul(se,te),u=Math.imul(se,ke),u=u+Math.imul(Me,te)|0,_=Math.imul(Me,ke),h=h+Math.imul(le,ue)|0,u=u+Math.imul(le,Pe)|0,u=u+Math.imul(Ce,ue)|0,_=_+Math.imul(Ce,Pe)|0,h=h+Math.imul(ce,he)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(Ie,he)|0,_=_+Math.imul(Ie,Ne)|0,h=h+Math.imul(oe,de)|0,u=u+Math.imul(oe,qe)|0,u=u+Math.imul(xe,de)|0,_=_+Math.imul(xe,qe)|0,h=h+Math.imul(ye,pe)|0,u=u+Math.imul(ye,Le)|0,u=u+Math.imul(Re,pe)|0,_=_+Math.imul(Re,Le)|0,h=h+Math.imul(J,ve)|0,u=u+Math.imul(J,Be)|0,u=u+Math.imul(be,ve)|0,_=_+Math.imul(be,Be)|0,h=h+Math.imul(Y,me)|0,u=u+Math.imul(Y,Ae)|0,u=u+Math.imul(Q,me)|0,_=_+Math.imul(Q,Ae)|0;var sr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,h=Math.imul(se,ue),u=Math.imul(se,Pe),u=u+Math.imul(Me,ue)|0,_=Math.imul(Me,Pe),h=h+Math.imul(le,he)|0,u=u+Math.imul(le,Ne)|0,u=u+Math.imul(Ce,he)|0,_=_+Math.imul(Ce,Ne)|0,h=h+Math.imul(ce,de)|0,u=u+Math.imul(ce,qe)|0,u=u+Math.imul(Ie,de)|0,_=_+Math.imul(Ie,qe)|0,h=h+Math.imul(oe,pe)|0,u=u+Math.imul(oe,Le)|0,u=u+Math.imul(xe,pe)|0,_=_+Math.imul(xe,Le)|0,h=h+Math.imul(ye,ve)|0,u=u+Math.imul(ye,Be)|0,u=u+Math.imul(Re,ve)|0,_=_+Math.imul(Re,Be)|0,h=h+Math.imul(J,me)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(be,me)|0,_=_+Math.imul(be,Ae)|0;var Ut=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,h=Math.imul(se,he),u=Math.imul(se,Ne),u=u+Math.imul(Me,he)|0,_=Math.imul(Me,Ne),h=h+Math.imul(le,de)|0,u=u+Math.imul(le,qe)|0,u=u+Math.imul(Ce,de)|0,_=_+Math.imul(Ce,qe)|0,h=h+Math.imul(ce,pe)|0,u=u+Math.imul(ce,Le)|0,u=u+Math.imul(Ie,pe)|0,_=_+Math.imul(Ie,Le)|0,h=h+Math.imul(oe,ve)|0,u=u+Math.imul(oe,Be)|0,u=u+Math.imul(xe,ve)|0,_=_+Math.imul(xe,Be)|0,h=h+Math.imul(ye,me)|0,u=u+Math.imul(ye,Ae)|0,u=u+Math.imul(Re,me)|0,_=_+Math.imul(Re,Ae)|0;var dr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,h=Math.imul(se,de),u=Math.imul(se,qe),u=u+Math.imul(Me,de)|0,_=Math.imul(Me,qe),h=h+Math.imul(le,pe)|0,u=u+Math.imul(le,Le)|0,u=u+Math.imul(Ce,pe)|0,_=_+Math.imul(Ce,Le)|0,h=h+Math.imul(ce,ve)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(Ie,ve)|0,_=_+Math.imul(Ie,Be)|0,h=h+Math.imul(oe,me)|0,u=u+Math.imul(oe,Ae)|0,u=u+Math.imul(xe,me)|0,_=_+Math.imul(xe,Ae)|0;var Jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,h=Math.imul(se,pe),u=Math.imul(se,Le),u=u+Math.imul(Me,pe)|0,_=Math.imul(Me,Le),h=h+Math.imul(le,ve)|0,u=u+Math.imul(le,Be)|0,u=u+Math.imul(Ce,ve)|0,_=_+Math.imul(Ce,Be)|0,h=h+Math.imul(ce,me)|0,u=u+Math.imul(ce,Ae)|0,u=u+Math.imul(Ie,me)|0,_=_+Math.imul(Ie,Ae)|0;var tr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,h=Math.imul(se,ve),u=Math.imul(se,Be),u=u+Math.imul(Me,ve)|0,_=Math.imul(Me,Be),h=h+Math.imul(le,me)|0,u=u+Math.imul(le,Ae)|0,u=u+Math.imul(Ce,me)|0,_=_+Math.imul(Ce,Ae)|0;var Rr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,h=Math.imul(se,me),u=Math.imul(se,Ae),u=u+Math.imul(Me,me)|0,_=Math.imul(Me,Ae);var Qr=(b+h|0)+((u&8191)<<13)|0;return b=(_+(u>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,g[0]=$t,g[1]=Je,g[2]=Qe,g[3]=Lt,g[4]=Bt,g[5]=Dt,g[6]=jt,g[7]=Ft,g[8]=lr,g[9]=hr,g[10]=or,g[11]=Kt,g[12]=sr,g[13]=Ut,g[14]=dr,g[15]=Jt,g[16]=tr,g[17]=Rr,g[18]=Qr,b!==0&&(g[19]=b,d.length++),d};Math.imul||(C=R);function B(m,s,l){l.negative=s.negative^m.negative,l.length=m.length+s.length;for(var d=0,f=0,p=0;p<l.length-1;p++){var g=f;f=0;for(var b=d&67108863,h=Math.min(p,s.length-1),u=Math.max(0,p-m.length+1);u<=h;u++){var _=p-u,A=m.words[_]|0,x=s.words[u]|0,I=A*x,j=I&67108863;g=g+(I/67108864|0)|0,j=j+b|0,b=j&67108863,g=g+(j>>>26)|0,f+=g>>>26,g&=67108863}l.words[p]=b,d=g,g=f}return d!==0?l.words[p]=d:l.length--,l.strip()}function N(m,s,l){var d=new q;return d.mulp(m,s,l)}i.prototype.mulTo=function(s,l){var d,f=this.length+s.length;return this.length===10&&s.length===10?d=C(this,s,l):f<63?d=R(this,s,l):f<1024?d=B(this,s,l):d=N(this,s,l),d};function q(m,s){this.x=m,this.y=s}q.prototype.makeRBT=function(s){for(var l=new Array(s),d=i.prototype._countBits(s)-1,f=0;f<s;f++)l[f]=this.revBin(f,d,s);return l},q.prototype.revBin=function(s,l,d){if(s===0||s===d-1)return s;for(var f=0,p=0;p<l;p++)f|=(s&1)<<l-p-1,s>>=1;return f},q.prototype.permute=function(s,l,d,f,p,g){for(var b=0;b<g;b++)f[b]=l[s[b]],p[b]=d[s[b]]},q.prototype.transform=function(s,l,d,f,p,g){this.permute(g,s,l,d,f,p);for(var b=1;b<p;b<<=1)for(var h=b<<1,u=Math.cos(2*Math.PI/h),_=Math.sin(2*Math.PI/h),A=0;A<p;A+=h)for(var x=u,I=_,j=0;j<b;j++){var O=d[A+j],L=f[A+j],W=d[A+j+b],F=f[A+j+b],G=x*W-I*F;F=x*F+I*W,W=G,d[A+j]=O+W,f[A+j]=L+F,d[A+j+b]=O-W,f[A+j+b]=L-F,j!==h&&(G=u*x-_*I,I=u*I+_*x,x=G)}},q.prototype.guessLen13b=function(s,l){var d=Math.max(l,s)|1,f=d&1,p=0;for(d=d/2|0;d;d=d>>>1)p++;return 1<<p+1+f},q.prototype.conjugate=function(s,l,d){if(!(d<=1))for(var f=0;f<d/2;f++){var p=s[f];s[f]=s[d-f-1],s[d-f-1]=p,p=l[f],l[f]=-l[d-f-1],l[d-f-1]=-p}},q.prototype.normalize13b=function(s,l){for(var d=0,f=0;f<l/2;f++){var p=Math.round(s[2*f+1]/l)*8192+Math.round(s[2*f]/l)+d;s[f]=p&67108863,p<67108864?d=0:d=p/67108864|0}return s},q.prototype.convert13b=function(s,l,d,f){for(var p=0,g=0;g<l;g++)p=p+(s[g]|0),d[2*g]=p&8191,p=p>>>13,d[2*g+1]=p&8191,p=p>>>13;for(g=2*l;g<f;++g)d[g]=0;r(p===0),r((p&-8192)===0)},q.prototype.stub=function(s){for(var l=new Array(s),d=0;d<s;d++)l[d]=0;return l},q.prototype.mulp=function(s,l,d){var f=2*this.guessLen13b(s.length,l.length),p=this.makeRBT(f),g=this.stub(f),b=new Array(f),h=new Array(f),u=new Array(f),_=new Array(f),A=new Array(f),x=new Array(f),I=d.words;I.length=f,this.convert13b(s.words,s.length,b,f),this.convert13b(l.words,l.length,_,f),this.transform(b,g,h,u,f,p),this.transform(_,g,A,x,f,p);for(var j=0;j<f;j++){var O=h[j]*A[j]-u[j]*x[j];u[j]=h[j]*x[j]+u[j]*A[j],h[j]=O}return this.conjugate(h,u,f),this.transform(h,u,I,g,f,p),this.conjugate(I,g,f),this.normalize13b(I,f),d.negative=s.negative^l.negative,d.length=s.length+l.length,d.strip()},i.prototype.mul=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),this.mulTo(s,l)},i.prototype.mulf=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),N(this,s,l)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){r(typeof s=="number"),r(s<67108864);for(var l=0,d=0;d<this.length;d++){var f=(this.words[d]|0)*s,p=(f&67108863)+(l&67108863);l>>=26,l+=f/67108864|0,l+=p>>>26,this.words[d]=p&67108863}return l!==0&&(this.words[d]=l,this.length++),this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var l=S(s);if(l.length===0)return new i(1);for(var d=this,f=0;f<l.length&&l[f]===0;f++,d=d.sqr());if(++f<l.length)for(var p=d.sqr();f<l.length;f++,p=p.sqr())l[f]!==0&&(d=d.mul(p));return d},i.prototype.iushln=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=67108863>>>26-l<<26-l,p;if(l!==0){var g=0;for(p=0;p<this.length;p++){var b=this.words[p]&f,h=(this.words[p]|0)-b<<l;this.words[p]=h|g,g=b>>>26-l}g&&(this.words[p]=g,this.length++)}if(d!==0){for(p=this.length-1;p>=0;p--)this.words[p+d]=this.words[p];for(p=0;p<d;p++)this.words[p]=0;this.length+=d}return this.strip()},i.prototype.ishln=function(s){return r(this.negative===0),this.iushln(s)},i.prototype.iushrn=function(s,l,d){r(typeof s=="number"&&s>=0);var f;l?f=(l-l%26)/26:f=0;var p=s%26,g=Math.min((s-p)/26,this.length),b=67108863^67108863>>>p<<p,h=d;if(f-=g,f=Math.max(0,f),h){for(var u=0;u<g;u++)h.words[u]=this.words[u];h.length=g}if(g!==0)if(this.length>g)for(this.length-=g,u=0;u<this.length;u++)this.words[u]=this.words[u+g];else this.words[0]=0,this.length=1;var _=0;for(u=this.length-1;u>=0&&(_!==0||u>=f);u--){var A=this.words[u]|0;this.words[u]=_<<26-p|A>>>p,_=A&b}return h&&_!==0&&(h.words[h.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(s,l,d){return r(this.negative===0),this.iushrn(s,l,d)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return!1;var p=this.words[d];return!!(p&f)},i.prototype.imaskn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(l!==0&&d++,this.length=Math.min(d,this.length),l!==0){var f=67108863^67108863>>>l<<l;this.words[this.length-1]&=f}return this.strip()},i.prototype.maskn=function(s){return this.clone().imaskn(s)},i.prototype.iaddn=function(s){return r(typeof s=="number"),r(s<67108864),s<0?this.isubn(-s):this.negative!==0?this.length===1&&(this.words[0]|0)<s?(this.words[0]=s-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(s),this.negative=1,this):this._iaddn(s)},i.prototype._iaddn=function(s){this.words[0]+=s;for(var l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},i.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+1]-=1;return this.strip()},i.prototype.addn=function(s){return this.clone().iaddn(s)},i.prototype.subn=function(s){return this.clone().isubn(s)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(s,l,d){var f=s.length+d,p;this._expand(f);var g,b=0;for(p=0;p<s.length;p++){g=(this.words[p+d]|0)+b;var h=(s.words[p]|0)*l;g-=h&67108863,b=(g>>26)-(h/67108864|0),this.words[p+d]=g&67108863}for(;p<this.length-d;p++)g=(this.words[p+d]|0)+b,b=g>>26,this.words[p+d]=g&67108863;if(b===0)return this.strip();for(r(b===-1),b=0,p=0;p<this.length;p++)g=-(this.words[p]|0)+b,b=g>>26,this.words[p]=g&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(s,l){var d=this.length-s.length,f=this.clone(),p=s,g=p.words[p.length-1]|0,b=this._countBits(g);d=26-b,d!==0&&(p=p.ushln(d),f.iushln(d),g=p.words[p.length-1]|0);var h=f.length-p.length,u;if(l!=="mod"){u=new i(null),u.length=h+1,u.words=new Array(u.length);for(var _=0;_<u.length;_++)u.words[_]=0}var A=f.clone()._ishlnsubmul(p,1,h);A.negative===0&&(f=A,u&&(u.words[h]=1));for(var x=h-1;x>=0;x--){var I=(f.words[p.length+x]|0)*67108864+(f.words[p.length+x-1]|0);for(I=Math.min(I/g|0,67108863),f._ishlnsubmul(p,I,x);f.negative!==0;)I--,f.negative=0,f._ishlnsubmul(p,1,x),f.isZero()||(f.negative^=1);u&&(u.words[x]=I)}return u&&u.strip(),f.strip(),l!=="div"&&d!==0&&f.iushrn(d),{div:u||null,mod:f}},i.prototype.divmod=function(s,l,d){if(r(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var f,p,g;return this.negative!==0&&s.negative===0?(g=this.neg().divmod(s,l),l!=="mod"&&(f=g.div.neg()),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.iadd(s)),{div:f,mod:p}):this.negative===0&&s.negative!==0?(g=this.divmod(s.neg(),l),l!=="mod"&&(f=g.div.neg()),{div:f,mod:g.mod}):(this.negative&s.negative)!==0?(g=this.neg().divmod(s.neg(),l),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.isub(s)),{div:g.div,mod:p}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new i(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modn(s.words[0]))}:this._wordDiv(s,l)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var d=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),p=s.andln(1),g=d.cmp(f);return g<0||p===1&&g===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,d=0,f=this.length-1;f>=0;f--)d=(l*d+(this.words[f]|0))%s;return d},i.prototype.idivn=function(s){r(s<=67108863);for(var l=0,d=this.length-1;d>=0;d--){var f=(this.words[d]|0)+l*67108864;this.words[d]=f/s|0,l=f%s}return this.strip()},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=new i(0),b=new i(1),h=0;l.isEven()&&d.isEven();)l.iushrn(1),d.iushrn(1),++h;for(var u=d.clone(),_=l.clone();!l.isZero();){for(var A=0,x=1;(l.words[0]&x)===0&&A<26;++A,x<<=1);if(A>0)for(l.iushrn(A);A-- >0;)(f.isOdd()||p.isOdd())&&(f.iadd(u),p.isub(_)),f.iushrn(1),p.iushrn(1);for(var I=0,j=1;(d.words[0]&j)===0&&I<26;++I,j<<=1);if(I>0)for(d.iushrn(I);I-- >0;)(g.isOdd()||b.isOdd())&&(g.iadd(u),b.isub(_)),g.iushrn(1),b.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(g),p.isub(b)):(d.isub(l),g.isub(f),b.isub(p))}return{a:g,b,gcd:d.iushln(h)}},i.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=d.clone();l.cmpn(1)>0&&d.cmpn(1)>0;){for(var b=0,h=1;(l.words[0]&h)===0&&b<26;++b,h<<=1);if(b>0)for(l.iushrn(b);b-- >0;)f.isOdd()&&f.iadd(g),f.iushrn(1);for(var u=0,_=1;(d.words[0]&_)===0&&u<26;++u,_<<=1);if(u>0)for(d.iushrn(u);u-- >0;)p.isOdd()&&p.iadd(g),p.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(p)):(d.isub(l),p.isub(f))}var A;return l.cmpn(1)===0?A=f:A=p,A.cmpn(0)<0&&A.iadd(s),A},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),d=s.clone();l.negative=0,d.negative=0;for(var f=0;l.isEven()&&d.isEven();f++)l.iushrn(1),d.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;d.isEven();)d.iushrn(1);var p=l.cmp(d);if(p<0){var g=l;l=d,d=g}else if(p===0||d.cmpn(1)===0)break;l.isub(d)}while(!0);return d.iushln(f)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return this._expand(d+1),this.words[d]|=f,this;for(var p=f,g=d;p!==0&&g<this.length;g++){var b=this.words[g]|0;b+=p,p=b>>>26,b&=67108863,this.words[g]=b}return p!==0&&(this.words[g]=p,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var d;if(this.length>1)d=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;d=f===s?0:f<s?-1:1}return this.negative!==0?-d|0:d},i.prototype.cmp=function(s){if(this.negative!==0&&s.negative===0)return-1;if(this.negative===0&&s.negative!==0)return 1;var l=this.ucmp(s);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(s){if(this.length>s.length)return 1;if(this.length<s.length)return-1;for(var l=0,d=this.length-1;d>=0;d--){var f=this.words[d]|0,p=s.words[d]|0;if(f!==p){f<p?l=-1:f>p&&(l=1);break}}return l},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new V(s)},i.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var H={k256:null,p224:null,p192:null,p25519:null};function D(m,s){this.name=m,this.p=new i(s,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},D.prototype.ireduce=function(s){var l=s,d;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),d=l.bitLength();while(d>this.n);var f=d<this.n?-1:l.ucmp(this.p);return f===0?(l.words[0]=0,l.length=1):f>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},D.prototype.split=function(s,l){s.iushrn(this.n,0,l)},D.prototype.imulK=function(s){return s.imul(this.k)};function ee(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(ee,D),ee.prototype.split=function(s,l){for(var d=4194303,f=Math.min(s.length,9),p=0;p<f;p++)l.words[p]=s.words[p];if(l.length=f,s.length<=9){s.words[0]=0,s.length=1;return}var g=s.words[9];for(l.words[l.length++]=g&d,p=10;p<s.length;p++){var b=s.words[p]|0;s.words[p-10]=(b&d)<<4|g>>>22,g=b}g>>>=22,s.words[p-10]=g,g===0&&s.length>10?s.length-=10:s.length-=9},ee.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,d=0;d<s.length;d++){var f=s.words[d]|0;l+=f*977,s.words[d]=l&67108863,l=f*64+(l/67108864|0)}return s.words[s.length-1]===0&&(s.length--,s.words[s.length-1]===0&&s.length--),s};function ge(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ge,D);function K(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(K,D);function X(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(X,D),X.prototype.imulK=function(s){for(var l=0,d=0;d<s.length;d++){var f=(s.words[d]|0)*19+l,p=f&67108863;f>>>=26,s.words[d]=p,l=f}return l!==0&&(s.words[s.length++]=l),s},i._prime=function(s){if(H[s])return H[s];var l;if(s==="k256")l=new ee;else if(s==="p224")l=new ge;else if(s==="p192")l=new K;else if(s==="p25519")l=new X;else throw new Error("Unknown prime "+s);return H[s]=l,l};function V(m){if(typeof m=="string"){var s=i._prime(m);this.m=s.p,this.prime=s}else r(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}V.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},V.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},V.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},V.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},V.prototype.add=function(s,l){this._verify2(s,l);var d=s.add(l);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},V.prototype.iadd=function(s,l){this._verify2(s,l);var d=s.iadd(l);return d.cmp(this.m)>=0&&d.isub(this.m),d},V.prototype.sub=function(s,l){this._verify2(s,l);var d=s.sub(l);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},V.prototype.isub=function(s,l){this._verify2(s,l);var d=s.isub(l);return d.cmpn(0)<0&&d.iadd(this.m),d},V.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},V.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},V.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},V.prototype.isqr=function(s){return this.imul(s,s.clone())},V.prototype.sqr=function(s){return this.mul(s,s)},V.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var d=this.m.add(new i(1)).iushrn(2);return this.pow(s,d)}for(var f=this.m.subn(1),p=0;!f.isZero()&&f.andln(1)===0;)p++,f.iushrn(1);r(!f.isZero());var g=new i(1).toRed(this),b=g.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);this.pow(u,h).cmp(b)!==0;)u.redIAdd(b);for(var _=this.pow(u,f),A=this.pow(s,f.addn(1).iushrn(1)),x=this.pow(s,f),I=p;x.cmp(g)!==0;){for(var j=x,O=0;j.cmp(g)!==0;O++)j=j.redSqr();r(O<I);var L=this.pow(_,new i(1).iushln(I-O-1));A=A.redMul(L),_=L.redSqr(),x=x.redMul(_),I=O}return A},V.prototype.invm=function(s){var l=s._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},V.prototype.pow=function(s,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return s.clone();var d=4,f=new Array(1<<d);f[0]=new i(1).toRed(this),f[1]=s;for(var p=2;p<f.length;p++)f[p]=this.mul(f[p-1],s);var g=f[0],b=0,h=0,u=l.bitLength()%26;for(u===0&&(u=26),p=l.length-1;p>=0;p--){for(var _=l.words[p],A=u-1;A>=0;A--){var x=_>>A&1;if(g!==f[0]&&(g=this.sqr(g)),x===0&&b===0){h=0;continue}b<<=1,b|=x,h++,!(h!==d&&(p!==0||A!==0))&&(g=this.mul(g,f[b]),h=0,b=0)}u=26}return g},V.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},V.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},i.mont=function(s){return new T(s)};function T(m){V.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(T,V),T.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},T.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},T.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var d=s.imul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},T.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new i(0)._forceRed(this);var d=s.mul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},T.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof _2>"u"||_2,cC)});var Is=E((fPe,hC)=>{hC.exports=lC;function lC(e,t){if(!e)throw new Error(t||"Assertion failed")}lC.equal=function(t,r,n){if(t!=r)throw new Error(n||"Assertion failed: "+t+" != "+r)}});var w2=E(vC=>{"use strict";var n1=vC;function vne(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e!="string"){for(var n=0;n<e.length;n++)r[n]=e[n]|0;return r}if(t==="hex"){e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e);for(var n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=i&255;o?r.push(o,a):r.push(a)}return r}n1.toArray=vne;function dC(e){return e.length===1?"0"+e:e}n1.zero2=dC;function pC(e){for(var t="",r=0;r<e.length;r++)t+=dC(e[r].toString(16));return t}n1.toHex=pC;n1.encode=function(t,r){return r==="hex"?pC(t):t}});var ei=E(mC=>{"use strict";var qi=mC,mne=so(),gne=Is(),i1=w2();qi.assert=gne;qi.toArray=i1.toArray;qi.zero2=i1.zero2;qi.toHex=i1.toHex;qi.encode=i1.encode;function bne(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var c,v=o.andln(i-1);o.isOdd()?(v>(i>>1)-1?c=(i>>1)-v:c=v,o.isubn(c)):c=0,n[a]=c,o.iushrn(1)}return n}qi.getNAF=bne;function yne(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0,o;e.cmpn(-n)>0||t.cmpn(-i)>0;){var a=e.andln(3)+n&3,c=t.andln(3)+i&3;a===3&&(a=-1),c===3&&(c=-1);var v;(a&1)===0?v=0:(o=e.andln(7)+n&7,(o===3||o===5)&&c===2?v=-a:v=a),r[0].push(v);var y;(c&1)===0?y=0:(o=t.andln(7)+i&7,(o===3||o===5)&&a===2?y=-c:y=c),r[1].push(y),2*n===v+1&&(n=1-n),2*i===y+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}qi.getJSF=yne;function _ne(e,t,r){var n="_"+t;e.prototype[t]=function(){return this[n]!==void 0?this[n]:this[n]=r.call(this)}}qi.cachedProperty=_ne;function wne(e){return typeof e=="string"?qi.toArray(e,"hex"):e}qi.parseBytes=wne;function xne(e){return new mne(e,"hex","le")}qi.intFromLE=xne});var gC={};Mr(gC,{default:()=>Mne});var Mne,bC=yt(()=>{Mne={}});var yC=E((hPe,o1)=>{var $a=(bC(),Pt(gC));if($a&&$a.default){o1.exports=$a.default;for(let e in $a)o1.exports[e]=$a[e]}else $a&&(o1.exports=$a)});var E2=E((dPe,S2)=>{var x2;S2.exports=function(t){return x2||(x2=new Cs(null)),x2.generate(t)};function Cs(e){this.rand=e}S2.exports.Rand=Cs;Cs.prototype.generate=function(t){return this._rand(t)};Cs.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var r=new Uint8Array(t),n=0;n<r.length;n++)r[n]=this.rand.getByte();return r};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Cs.prototype._rand=function(t){var r=new Uint8Array(t);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Cs.prototype._rand=function(t){var r=new Uint8Array(t);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(Cs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(M2=yC(),typeof M2.randomBytes!="function")throw new Error("Not supported");Cs.prototype._rand=function(t){return M2.randomBytes(t)}}catch{}var M2});var fh=E((pPe,_C)=>{"use strict";var Ka=so(),uh=ei(),s1=uh.getNAF,Sne=uh.getJSF,a1=uh.assert;function Ts(e,t){this.type=e,this.p=new Ka(t.p,16),this.red=t.prime?Ka.red(t.prime):Ka.mont(this.p),this.zero=new Ka(0).toRed(this.red),this.one=new Ka(1).toRed(this.red),this.two=new Ka(2).toRed(this.red),this.n=t.n&&new Ka(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}_C.exports=Ts;Ts.prototype.point=function(){throw new Error("Not implemented")};Ts.prototype.validate=function(){throw new Error("Not implemented")};Ts.prototype._fixedNafMul=function(t,r){a1(t.precomputed);var n=t._getDoubles(),i=s1(r,1,this._bitLength),o=(1<<n.step+1)-(n.step%2===0?2:1);o/=3;var a=[],c,v;for(c=0;c<i.length;c+=n.step){v=0;for(var y=c+n.step-1;y>=c;y--)v=(v<<1)+i[y];a.push(v)}for(var w=this.jpoint(null,null,null),M=this.jpoint(null,null,null),S=o;S>0;S--){for(c=0;c<a.length;c++)v=a[c],v===S?M=M.mixedAdd(n.points[c]):v===-S&&(M=M.mixedAdd(n.points[c].neg()));w=w.add(M)}return w.toP()};Ts.prototype._wnafMul=function(t,r){var n=4,i=t._getNAFPoints(n);n=i.wnd;for(var o=i.points,a=s1(r,n,this._bitLength),c=this.jpoint(null,null,null),v=a.length-1;v>=0;v--){for(var y=0;v>=0&&a[v]===0;v--)y++;if(v>=0&&y++,c=c.dblp(y),v<0)break;var w=a[v];a1(w!==0),t.type==="affine"?w>0?c=c.mixedAdd(o[w-1>>1]):c=c.mixedAdd(o[-w-1>>1].neg()):w>0?c=c.add(o[w-1>>1]):c=c.add(o[-w-1>>1].neg())}return t.type==="affine"?c.toP():c};Ts.prototype._wnafMulAdd=function(t,r,n,i,o){var a=this._wnafT1,c=this._wnafT2,v=this._wnafT3,y=0,w,M,S;for(w=0;w<i;w++){S=r[w];var R=S._getNAFPoints(t);a[w]=R.wnd,c[w]=R.points}for(w=i-1;w>=1;w-=2){var C=w-1,B=w;if(a[C]!==1||a[B]!==1){v[C]=s1(n[C],a[C],this._bitLength),v[B]=s1(n[B],a[B],this._bitLength),y=Math.max(v[C].length,y),y=Math.max(v[B].length,y);continue}var N=[r[C],null,null,r[B]];r[C].y.cmp(r[B].y)===0?(N[1]=r[C].add(r[B]),N[2]=r[C].toJ().mixedAdd(r[B].neg())):r[C].y.cmp(r[B].y.redNeg())===0?(N[1]=r[C].toJ().mixedAdd(r[B]),N[2]=r[C].add(r[B].neg())):(N[1]=r[C].toJ().mixedAdd(r[B]),N[2]=r[C].toJ().mixedAdd(r[B].neg()));var q=[-3,-1,-5,-7,0,7,5,1,3],H=Sne(n[C],n[B]);for(y=Math.max(H[0].length,y),v[C]=new Array(y),v[B]=new Array(y),M=0;M<y;M++){var D=H[0][M]|0,ee=H[1][M]|0;v[C][M]=q[(D+1)*3+(ee+1)],v[B][M]=0,c[C]=N}}var ge=this.jpoint(null,null,null),K=this._wnafT4;for(w=y;w>=0;w--){for(var X=0;w>=0;){var V=!0;for(M=0;M<i;M++)K[M]=v[M][w]|0,K[M]!==0&&(V=!1);if(!V)break;X++,w--}if(w>=0&&X++,ge=ge.dblp(X),w<0)break;for(M=0;M<i;M++){var T=K[M];T!==0&&(T>0?S=c[M][T-1>>1]:T<0&&(S=c[M][-T-1>>1].neg()),S.type==="affine"?ge=ge.mixedAdd(S):ge=ge.add(S))}}for(w=0;w<i;w++)c[w]=null;return o?ge:ge.toP()};function bi(e,t){this.curve=e,this.type=t,this.precomputed=null}Ts.BasePoint=bi;bi.prototype.eq=function(){throw new Error("Not implemented")};bi.prototype.validate=function(){return this.curve.validate(this)};Ts.prototype.decodePoint=function(t,r){t=uh.toArray(t,r);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?a1(t[t.length-1]%2===0):t[0]===7&&a1(t[t.length-1]%2===1);var i=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return i}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")};bi.prototype.encodeCompressed=function(t){return this.encode(t,!0)};bi.prototype._encode=function(t){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};bi.prototype.encode=function(t,r){return uh.encode(this._encode(r),t)};bi.prototype.precompute=function(t){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,t),r.beta=this._getBeta(),this.precomputed=r,this};bi.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((t.bitLength()+1)/r.step):!1};bi.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,o=0;o<r;o+=t){for(var a=0;a<t;a++)i=i.dbl();n.push(i)}return{step:t,points:n}};bi.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<t)-1,i=n===1?null:this.dbl(),o=1;o<n;o++)r[o]=r[o-1].add(i);return{wnd:t,points:r}};bi.prototype._getBeta=function(){return null};bi.prototype.dblp=function(t){for(var r=this,n=0;n<t;n++)r=r.dbl();return r}});var xC=E((vPe,wC)=>{"use strict";var Ene=ei(),Er=so(),A2=Tr(),Af=fh(),Ane=Ene.assert;function yi(e){Af.call(this,"short",e),this.a=new Er(e.a,16).toRed(this.red),this.b=new Er(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}A2(yi,Af);wC.exports=yi;yi.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(t.beta)r=new Er(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(t.lambda)n=new Er(t.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(r))===0?n=o[0]:(n=o[1],Ane(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var a;return t.basis?a=t.basis.map(function(c){return{a:new Er(c.a,16),b:new Er(c.b,16)}}):a=this._getEndoBasis(n),{beta:r,lambda:n,basis:a}}};yi.prototype._getEndoRoots=function(t){var r=t===this.p?this.red:Er.mont(t),n=new Er(2).toRed(r).redInvm(),i=n.redNeg(),o=new Er(3).toRed(r).redNeg().redSqrt().redMul(n),a=i.redAdd(o).fromRed(),c=i.redSub(o).fromRed();return[a,c]};yi.prototype._getEndoBasis=function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,i=this.n.clone(),o=new Er(1),a=new Er(0),c=new Er(0),v=new Er(1),y,w,M,S,R,C,B,N=0,q,H;n.cmpn(0)!==0;){var D=i.div(n);q=i.sub(D.mul(n)),H=c.sub(D.mul(o));var ee=v.sub(D.mul(a));if(!M&&q.cmp(r)<0)y=B.neg(),w=o,M=q.neg(),S=H;else if(M&&++N===2)break;B=q,i=n,n=q,c=o,o=H,v=a,a=ee}R=q.neg(),C=H;var ge=M.sqr().add(S.sqr()),K=R.sqr().add(C.sqr());return K.cmp(ge)>=0&&(R=y,C=w),M.negative&&(M=M.neg(),S=S.neg()),R.negative&&(R=R.neg(),C=C.neg()),[{a:M,b:S},{a:R,b:C}]};yi.prototype._endoSplit=function(t){var r=this.endo.basis,n=r[0],i=r[1],o=i.b.mul(t).divRound(this.n),a=n.b.neg().mul(t).divRound(this.n),c=o.mul(n.a),v=a.mul(i.a),y=o.mul(n.b),w=a.mul(i.b),M=t.sub(c).sub(v),S=y.add(w).neg();return{k1:M,k2:S}};yi.prototype.pointFromX=function(t,r){t=new Er(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(t,i)};yi.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,n=t.y,i=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(o).cmpn(0)===0};yi.prototype._endoWnafMulAdd=function(t,r,n){for(var i=this._endoWnafT1,o=this._endoWnafT2,a=0;a<t.length;a++){var c=this._endoSplit(r[a]),v=t[a],y=v._getBeta();c.k1.negative&&(c.k1.ineg(),v=v.neg(!0)),c.k2.negative&&(c.k2.ineg(),y=y.neg(!0)),i[a*2]=v,i[a*2+1]=y,o[a*2]=c.k1,o[a*2+1]=c.k2}for(var w=this._wnafMulAdd(1,i,o,a*2,n),M=0;M<a*2;M++)i[M]=null,o[M]=null;return w};function zr(e,t,r,n){Af.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Er(t,16),this.y=new Er(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}A2(zr,Af.BasePoint);yi.prototype.point=function(t,r,n){return new zr(this,t,r,n)};yi.prototype.pointFromJSON=function(t,r){return zr.fromJSON(this,t,r)};zr.prototype._getBeta=function(){if(!!this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,i=function(o){return n.point(o.x.redMul(n.endo.beta),o.y)};t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return r}};zr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};zr.fromJSON=function(t,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=t.point(r[0],r[1],n);if(!r[2])return i;function o(c){return t.point(c[0],c[1],n)}var a=r[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(o))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(o))}},i};zr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};zr.prototype.isInfinity=function(){return this.inf};zr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(t.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};zr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=t.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),a=o.redSqr().redISub(this.x.redAdd(this.x)),c=o.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,c)};zr.prototype.getX=function(){return this.x.fromRed()};zr.prototype.getY=function(){return this.y.fromRed()};zr.prototype.mul=function(t){return t=new Er(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};zr.prototype.mulAdd=function(t,r,n){var i=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o):this.curve._wnafMulAdd(1,i,o,2)};zr.prototype.jmulAdd=function(t,r,n){var i=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o,!0):this.curve._wnafMulAdd(1,i,o,2,!0)};zr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};zr.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,i=function(o){return o.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};zr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function tn(e,t,r,n){Af.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Er(0)):(this.x=new Er(t,16),this.y=new Er(r,16),this.z=new Er(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}A2(tn,Af.BasePoint);yi.prototype.jpoint=function(t,r,n){return new tn(this,t,r,n)};tn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(t);return this.curve.point(n,i)};tn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};tn.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),o=t.x.redMul(n),a=this.y.redMul(r.redMul(t.z)),c=t.y.redMul(n.redMul(this.z)),v=i.redSub(o),y=a.redSub(c);if(v.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=v.redSqr(),M=w.redMul(v),S=i.redMul(w),R=y.redSqr().redIAdd(M).redISub(S).redISub(S),C=y.redMul(S.redISub(R)).redISub(a.redMul(M)),B=this.z.redMul(t.z).redMul(v);return this.curve.jpoint(R,C,B)};tn.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=t.x.redMul(r),o=this.y,a=t.y.redMul(r).redMul(this.z),c=n.redSub(i),v=o.redSub(a);if(c.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=c.redSqr(),w=y.redMul(c),M=n.redMul(y),S=v.redSqr().redIAdd(w).redISub(M).redISub(M),R=v.redMul(M.redISub(S)).redISub(o.redMul(w)),C=this.z.redMul(c);return this.curve.jpoint(S,R,C)};tn.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<t;r++)n=n.dbl();return n}var i=this.curve.a,o=this.curve.tinv,a=this.x,c=this.y,v=this.z,y=v.redSqr().redSqr(),w=c.redAdd(c);for(r=0;r<t;r++){var M=a.redSqr(),S=w.redSqr(),R=S.redSqr(),C=M.redAdd(M).redIAdd(M).redIAdd(i.redMul(y)),B=a.redMul(S),N=C.redSqr().redISub(B.redAdd(B)),q=B.redISub(N),H=C.redMul(q);H=H.redIAdd(H).redISub(R);var D=w.redMul(v);r+1<t&&(y=y.redMul(R)),a=N,v=D,w=H}return this.curve.jpoint(a,w.redMul(o),v)};tn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};tn.prototype._zeroDbl=function(){var t,r,n;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),a=o.redSqr(),c=this.x.redAdd(o).redSqr().redISub(i).redISub(a);c=c.redIAdd(c);var v=i.redAdd(i).redIAdd(i),y=v.redSqr().redISub(c).redISub(c),w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),t=y,r=v.redMul(c.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),S=this.y.redSqr(),R=S.redSqr(),C=this.x.redAdd(S).redSqr().redISub(M).redISub(R);C=C.redIAdd(C);var B=M.redAdd(M).redIAdd(M),N=B.redSqr(),q=R.redIAdd(R);q=q.redIAdd(q),q=q.redIAdd(q),t=N.redISub(C).redISub(C),r=B.redMul(C.redISub(t)).redISub(q),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,r,n)};tn.prototype._threeDbl=function(){var t,r,n;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),a=o.redSqr(),c=this.x.redAdd(o).redSqr().redISub(i).redISub(a);c=c.redIAdd(c);var v=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),y=v.redSqr().redISub(c).redISub(c);t=y;var w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),r=v.redMul(c.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),S=this.y.redSqr(),R=this.x.redMul(S),C=this.x.redSub(M).redMul(this.x.redAdd(M));C=C.redAdd(C).redIAdd(C);var B=R.redIAdd(R);B=B.redIAdd(B);var N=B.redAdd(B);t=C.redSqr().redISub(N),n=this.y.redAdd(this.z).redSqr().redISub(S).redISub(M);var q=S.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),r=C.redMul(B.redISub(t)).redISub(q)}return this.curve.jpoint(t,r,n)};tn.prototype._dbl=function(){var t=this.curve.a,r=this.x,n=this.y,i=this.z,o=i.redSqr().redSqr(),a=r.redSqr(),c=n.redSqr(),v=a.redAdd(a).redIAdd(a).redIAdd(t.redMul(o)),y=r.redAdd(r);y=y.redIAdd(y);var w=y.redMul(c),M=v.redSqr().redISub(w.redAdd(w)),S=w.redISub(M),R=c.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var C=v.redMul(S).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(M,C,B)};tn.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),o=t.redAdd(t).redIAdd(t),a=o.redSqr(),c=this.x.redAdd(r).redSqr().redISub(t).redISub(i);c=c.redIAdd(c),c=c.redAdd(c).redIAdd(c),c=c.redISub(a);var v=c.redSqr(),y=i.redIAdd(i);y=y.redIAdd(y),y=y.redIAdd(y),y=y.redIAdd(y);var w=o.redIAdd(c).redSqr().redISub(a).redISub(v).redISub(y),M=r.redMul(w);M=M.redIAdd(M),M=M.redIAdd(M);var S=this.x.redMul(v).redISub(M);S=S.redIAdd(S),S=S.redIAdd(S);var R=this.y.redMul(w.redMul(y.redISub(w)).redISub(c.redMul(v)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var C=this.z.redAdd(c).redSqr().redISub(n).redISub(v);return this.curve.jpoint(S,R,C)};tn.prototype.mul=function(t,r){return t=new Er(t,r),this.curve._wnafMul(this,t)};tn.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var r=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),o=n.redMul(t.z);return this.y.redMul(o).redISub(t.y.redMul(i)).cmpn(0)===0};tn.prototype.eqXToP=function(t){var r=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=t.clone(),o=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(o),this.x.cmp(n)===0)return!0}};tn.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};tn.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var EC=E((mPe,SC)=>{"use strict";var Of=so(),MC=Tr(),u1=fh(),One=ei();function Rf(e){u1.call(this,"mont",e),this.a=new Of(e.a,16).toRed(this.red),this.b=new Of(e.b,16).toRed(this.red),this.i4=new Of(4).toRed(this.red).redInvm(),this.two=new Of(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}MC(Rf,u1);SC.exports=Rf;Rf.prototype.validate=function(t){var r=t.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),o=i.redSqrt();return o.redSqr().cmp(i)===0};function Vr(e,t,r){u1.BasePoint.call(this,e,"projective"),t===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Of(t,16),this.z=new Of(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}MC(Vr,u1.BasePoint);Rf.prototype.decodePoint=function(t,r){return this.point(One.toArray(t,r),1)};Rf.prototype.point=function(t,r){return new Vr(this,t,r)};Rf.prototype.pointFromJSON=function(t){return Vr.fromJSON(this,t)};Vr.prototype.precompute=function(){};Vr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Vr.fromJSON=function(t,r){return new Vr(t,r[0],r[1]||t.one)};Vr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Vr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Vr.prototype.dbl=function(){var t=this.x.redAdd(this.z),r=t.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),o=r.redSub(i),a=r.redMul(i),c=o.redMul(i.redAdd(this.curve.a24.redMul(o)));return this.curve.point(a,c)};Vr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Vr.prototype.diffAdd=function(t,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),o=t.x.redAdd(t.z),a=t.x.redSub(t.z),c=a.redMul(n),v=o.redMul(i),y=r.z.redMul(c.redAdd(v).redSqr()),w=r.x.redMul(c.redISub(v).redSqr());return this.curve.point(y,w)};Vr.prototype.mul=function(t){for(var r=t.clone(),n=this,i=this.curve.point(null,null),o=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var c=a.length-1;c>=0;c--)a[c]===0?(n=n.diffAdd(i,o),i=i.dbl()):(i=n.diffAdd(i,o),n=n.dbl());return i};Vr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Vr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Vr.prototype.eq=function(t){return this.getX().cmp(t.getX())===0};Vr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Vr.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var RC=E((gPe,OC)=>{"use strict";var Rne=ei(),Go=so(),AC=Tr(),f1=fh(),Ine=Rne.assert;function ao(e){this.twisted=(e.a|0)!==1,this.mOneA=this.twisted&&(e.a|0)===-1,this.extended=this.mOneA,f1.call(this,"edwards",e),this.a=new Go(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Go(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Go(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Ine(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(e.c|0)===1}AC(ao,f1);OC.exports=ao;ao.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)};ao.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)};ao.prototype.jpoint=function(t,r,n,i){return this.point(t,r,n,i)};ao.prototype.pointFromX=function(t,r){t=new Go(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr(),i=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(o.redInvm()),c=a.redSqrt();if(c.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var v=c.fromRed().isOdd();return(r&&!v||!r&&v)&&(c=c.redNeg()),this.point(t,c)};ao.prototype.pointFromY=function(t,r){t=new Go(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr(),i=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(o.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var c=a.redSqrt();if(c.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return c.fromRed().isOdd()!==r&&(c=c.redNeg()),this.point(c,t)};ao.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),n=t.y.redSqr(),i=r.redMul(this.a).redAdd(n),o=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(o)===0};function cr(e,t,r,n,i){f1.BasePoint.call(this,e,"projective"),t===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Go(t,16),this.y=new Go(r,16),this.z=n?new Go(n,16):this.curve.one,this.t=i&&new Go(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}AC(cr,f1.BasePoint);ao.prototype.pointFromJSON=function(t){return cr.fromJSON(this,t)};ao.prototype.point=function(t,r,n,i){return new cr(this,t,r,n,i)};cr.fromJSON=function(t,r){return new cr(t,r[0],r[1],r[2])};cr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};cr.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};cr.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(t),o=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),a=i.redAdd(r),c=a.redSub(n),v=i.redSub(r),y=o.redMul(c),w=a.redMul(v),M=o.redMul(v),S=c.redMul(a);return this.curve.point(y,w,S,M)};cr.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,o,a,c,v,y;if(this.curve.twisted){c=this.curve._mulA(r);var w=c.redAdd(n);this.zOne?(i=t.redSub(r).redSub(n).redMul(w.redSub(this.curve.two)),o=w.redMul(c.redSub(n)),a=w.redSqr().redSub(w).redSub(w)):(v=this.z.redSqr(),y=w.redSub(v).redISub(v),i=t.redSub(r).redISub(n).redMul(y),o=w.redMul(c.redSub(n)),a=w.redMul(y))}else c=r.redAdd(n),v=this.curve._mulC(this.z).redSqr(),y=c.redSub(v).redSub(v),i=this.curve._mulC(t.redISub(c)).redMul(y),o=this.curve._mulC(c).redMul(r.redISub(n)),a=c.redMul(y);return this.curve.point(i,o,a)};cr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};cr.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),n=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),o=this.z.redMul(t.z.redAdd(t.z)),a=n.redSub(r),c=o.redSub(i),v=o.redAdd(i),y=n.redAdd(r),w=a.redMul(c),M=v.redMul(y),S=a.redMul(y),R=c.redMul(v);return this.curve.point(w,M,R,S)};cr.prototype._projAdd=function(t){var r=this.z.redMul(t.z),n=r.redSqr(),i=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(i).redMul(o),c=n.redSub(a),v=n.redAdd(a),y=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(o),w=r.redMul(c).redMul(y),M,S;return this.curve.twisted?(M=r.redMul(v).redMul(o.redSub(this.curve._mulA(i))),S=c.redMul(v)):(M=r.redMul(v).redMul(o.redSub(i)),S=this.curve._mulC(c).redMul(v)),this.curve.point(w,M,S)};cr.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)};cr.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)};cr.prototype.mulAdd=function(t,r,n){return this.curve._wnafMulAdd(1,[this,r],[t,n],2,!1)};cr.prototype.jmulAdd=function(t,r,n){return this.curve._wnafMulAdd(1,[this,r],[t,n],2,!0)};cr.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this};cr.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};cr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};cr.prototype.getY=function(){return this.normalize(),this.y.fromRed()};cr.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0};cr.prototype.eqXToP=function(t){var r=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=t.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};cr.prototype.toP=cr.prototype.normalize;cr.prototype.mixedAdd=cr.prototype.add});var O2=E(IC=>{"use strict";var c1=IC;c1.base=fh();c1.short=xC();c1.mont=EC();c1.edwards=RC()});var Li=E(nr=>{"use strict";var Cne=Is(),Tne=Tr();nr.inherits=Tne;function kne(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function Pne(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):kne(e,i)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++i)&1023),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128)}else for(i=0;i<e.length;i++)r[i]=e[i]|0;return r}nr.toArray=Pne;function Nne(e){for(var t="",r=0;r<e.length;r++)t+=TC(e[r].toString(16));return t}nr.toHex=Nne;function CC(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}nr.htonl=CC;function qne(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];t==="little"&&(i=CC(i)),r+=kC(i.toString(16))}return r}nr.toHex32=qne;function TC(e){return e.length===1?"0"+e:e}nr.zero2=TC;function kC(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}nr.zero8=kC;function Lne(e,t,r,n){var i=r-t;Cne(i%4===0);for(var o=new Array(i/4),a=0,c=t;a<o.length;a++,c+=4){var v;n==="big"?v=e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:v=e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],o[a]=v>>>0}return o}nr.join32=Lne;function Bne(e,t){for(var r=new Array(e.length*4),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];t==="big"?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=o&255):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=o&255)}return r}nr.split32=Bne;function Dne(e,t){return e>>>t|e<<32-t}nr.rotr32=Dne;function jne(e,t){return e<<t|e>>>32-t}nr.rotl32=jne;function Fne(e,t){return e+t>>>0}nr.sum32=Fne;function Une(e,t,r){return e+t+r>>>0}nr.sum32_3=Une;function Hne(e,t,r,n){return e+t+r+n>>>0}nr.sum32_4=Hne;function Wne(e,t,r,n,i){return e+t+r+n+i>>>0}nr.sum32_5=Wne;function zne(e,t,r,n){var i=e[t],o=e[t+1],a=n+o>>>0,c=(a<n?1:0)+r+i;e[t]=c>>>0,e[t+1]=a}nr.sum64=zne;function Vne(e,t,r,n){var i=t+n>>>0,o=(i<t?1:0)+e+r;return o>>>0}nr.sum64_hi=Vne;function $ne(e,t,r,n){var i=t+n;return i>>>0}nr.sum64_lo=$ne;function Kne(e,t,r,n,i,o,a,c){var v=0,y=t;y=y+n>>>0,v+=y<t?1:0,y=y+o>>>0,v+=y<o?1:0,y=y+c>>>0,v+=y<c?1:0;var w=e+r+i+a+v;return w>>>0}nr.sum64_4_hi=Kne;function Gne(e,t,r,n,i,o,a,c){var v=t+n+o+c;return v>>>0}nr.sum64_4_lo=Gne;function Zne(e,t,r,n,i,o,a,c,v,y){var w=0,M=t;M=M+n>>>0,w+=M<t?1:0,M=M+o>>>0,w+=M<o?1:0,M=M+c>>>0,w+=M<c?1:0,M=M+y>>>0,w+=M<y?1:0;var S=e+r+i+a+v+w;return S>>>0}nr.sum64_5_hi=Zne;function Yne(e,t,r,n,i,o,a,c,v,y){var w=t+n+o+c+y;return w>>>0}nr.sum64_5_lo=Yne;function Jne(e,t,r){var n=t<<32-r|e>>>r;return n>>>0}nr.rotr64_hi=Jne;function Qne(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}nr.rotr64_lo=Qne;function Xne(e,t,r){return e>>>r}nr.shr64_hi=Xne;function eie(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}nr.shr64_lo=eie});var If=E(NC=>{"use strict";var PC=Li(),tie=Is();function l1(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}NC.BlockHash=l1;l1.prototype.update=function(t,r){if(t=PC.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var n=t.length%this._delta8;this.pending=t.slice(t.length-n,t.length),this.pending.length===0&&(this.pending=null),t=PC.join32(t,0,t.length-n,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this};l1.prototype.digest=function(t){return this.update(this._pad()),tie(this.pending===null),this._digest(t)};l1.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,n=r-(t+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var o=1;o<n;o++)i[o]=0;if(t<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)i[o++]=0;i[o++]=0,i[o++]=0,i[o++]=0,i[o++]=0,i[o++]=t>>>24&255,i[o++]=t>>>16&255,i[o++]=t>>>8&255,i[o++]=t&255}else for(i[o++]=t&255,i[o++]=t>>>8&255,i[o++]=t>>>16&255,i[o++]=t>>>24&255,i[o++]=0,i[o++]=0,i[o++]=0,i[o++]=0,a=8;a<this.padLength;a++)i[o++]=0;return i}});var R2=E(Zo=>{"use strict";var rie=Li(),uo=rie.rotr32;function nie(e,t,r,n){if(e===0)return qC(t,r,n);if(e===1||e===3)return BC(t,r,n);if(e===2)return LC(t,r,n)}Zo.ft_1=nie;function qC(e,t,r){return e&t^~e&r}Zo.ch32=qC;function LC(e,t,r){return e&t^e&r^t&r}Zo.maj32=LC;function BC(e,t,r){return e^t^r}Zo.p32=BC;function iie(e){return uo(e,2)^uo(e,13)^uo(e,22)}Zo.s0_256=iie;function oie(e){return uo(e,6)^uo(e,11)^uo(e,25)}Zo.s1_256=oie;function sie(e){return uo(e,7)^uo(e,18)^e>>>3}Zo.g0_256=sie;function aie(e){return uo(e,17)^uo(e,19)^e>>>10}Zo.g1_256=aie});var FC=E((xPe,jC)=>{"use strict";var Cf=Li(),uie=If(),fie=R2(),I2=Cf.rotl32,ch=Cf.sum32,cie=Cf.sum32_5,lie=fie.ft_1,DC=uie.BlockHash,hie=[1518500249,1859775393,2400959708,3395469782];function fo(){if(!(this instanceof fo))return new fo;DC.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Cf.inherits(fo,DC);jC.exports=fo;fo.blockSize=512;fo.outSize=160;fo.hmacStrength=80;fo.padLength=64;fo.prototype._update=function(t,r){for(var n=this.W,i=0;i<16;i++)n[i]=t[r+i];for(;i<n.length;i++)n[i]=I2(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var o=this.h[0],a=this.h[1],c=this.h[2],v=this.h[3],y=this.h[4];for(i=0;i<n.length;i++){var w=~~(i/20),M=cie(I2(o,5),lie(w,a,c,v),y,n[i],hie[w]);y=v,v=c,c=I2(a,30),a=o,o=M}this.h[0]=ch(this.h[0],o),this.h[1]=ch(this.h[1],a),this.h[2]=ch(this.h[2],c),this.h[3]=ch(this.h[3],v),this.h[4]=ch(this.h[4],y)};fo.prototype._digest=function(t){return t==="hex"?Cf.toHex32(this.h,"big"):Cf.split32(this.h,"big")}});var C2=E((MPe,HC)=>{"use strict";var Tf=Li(),die=If(),kf=R2(),pie=Is(),Bi=Tf.sum32,vie=Tf.sum32_4,mie=Tf.sum32_5,gie=kf.ch32,bie=kf.maj32,yie=kf.s0_256,_ie=kf.s1_256,wie=kf.g0_256,xie=kf.g1_256,UC=die.BlockHash,Mie=[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];function co(){if(!(this instanceof co))return new co;UC.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Mie,this.W=new Array(64)}Tf.inherits(co,UC);HC.exports=co;co.blockSize=512;co.outSize=256;co.hmacStrength=192;co.padLength=64;co.prototype._update=function(t,r){for(var n=this.W,i=0;i<16;i++)n[i]=t[r+i];for(;i<n.length;i++)n[i]=vie(xie(n[i-2]),n[i-7],wie(n[i-15]),n[i-16]);var o=this.h[0],a=this.h[1],c=this.h[2],v=this.h[3],y=this.h[4],w=this.h[5],M=this.h[6],S=this.h[7];for(pie(this.k.length===n.length),i=0;i<n.length;i++){var R=mie(S,_ie(y),gie(y,w,M),this.k[i],n[i]),C=Bi(yie(o),bie(o,a,c));S=M,M=w,w=y,y=Bi(v,R),v=c,c=a,a=o,o=Bi(R,C)}this.h[0]=Bi(this.h[0],o),this.h[1]=Bi(this.h[1],a),this.h[2]=Bi(this.h[2],c),this.h[3]=Bi(this.h[3],v),this.h[4]=Bi(this.h[4],y),this.h[5]=Bi(this.h[5],w),this.h[6]=Bi(this.h[6],M),this.h[7]=Bi(this.h[7],S)};co.prototype._digest=function(t){return t==="hex"?Tf.toHex32(this.h,"big"):Tf.split32(this.h,"big")}});var VC=E((SPe,zC)=>{"use strict";var T2=Li(),WC=C2();function Yo(){if(!(this instanceof Yo))return new Yo;WC.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}T2.inherits(Yo,WC);zC.exports=Yo;Yo.blockSize=512;Yo.outSize=224;Yo.hmacStrength=192;Yo.padLength=64;Yo.prototype._digest=function(t){return t==="hex"?T2.toHex32(this.h.slice(0,7),"big"):T2.split32(this.h.slice(0,7),"big")}});var N2=E((EPe,ZC)=>{"use strict";var Wn=Li(),Sie=If(),Eie=Is(),lo=Wn.rotr64_hi,ho=Wn.rotr64_lo,$C=Wn.shr64_hi,KC=Wn.shr64_lo,ks=Wn.sum64,k2=Wn.sum64_hi,P2=Wn.sum64_lo,Aie=Wn.sum64_4_hi,Oie=Wn.sum64_4_lo,Rie=Wn.sum64_5_hi,Iie=Wn.sum64_5_lo,GC=Sie.BlockHash,Cie=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Di(){if(!(this instanceof Di))return new Di;GC.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Cie,this.W=new Array(160)}Wn.inherits(Di,GC);ZC.exports=Di;Di.blockSize=1024;Di.outSize=512;Di.hmacStrength=192;Di.padLength=128;Di.prototype._prepareBlock=function(t,r){for(var n=this.W,i=0;i<32;i++)n[i]=t[r+i];for(;i<n.length;i+=2){var o=Uie(n[i-4],n[i-3]),a=Hie(n[i-4],n[i-3]),c=n[i-14],v=n[i-13],y=jie(n[i-30],n[i-29]),w=Fie(n[i-30],n[i-29]),M=n[i-32],S=n[i-31];n[i]=Aie(o,a,c,v,y,w,M,S),n[i+1]=Oie(o,a,c,v,y,w,M,S)}};Di.prototype._update=function(t,r){this._prepareBlock(t,r);var n=this.W,i=this.h[0],o=this.h[1],a=this.h[2],c=this.h[3],v=this.h[4],y=this.h[5],w=this.h[6],M=this.h[7],S=this.h[8],R=this.h[9],C=this.h[10],B=this.h[11],N=this.h[12],q=this.h[13],H=this.h[14],D=this.h[15];Eie(this.k.length===n.length);for(var ee=0;ee<n.length;ee+=2){var ge=H,K=D,X=Bie(S,R),V=Die(S,R),T=Tie(S,R,C,B,N,q),m=kie(S,R,C,B,N,q),s=this.k[ee],l=this.k[ee+1],d=n[ee],f=n[ee+1],p=Rie(ge,K,X,V,T,m,s,l,d,f),g=Iie(ge,K,X,V,T,m,s,l,d,f);ge=qie(i,o),K=Lie(i,o),X=Pie(i,o,a,c,v,y),V=Nie(i,o,a,c,v,y);var b=k2(ge,K,X,V),h=P2(ge,K,X,V);H=N,D=q,N=C,q=B,C=S,B=R,S=k2(w,M,p,g),R=P2(M,M,p,g),w=v,M=y,v=a,y=c,a=i,c=o,i=k2(p,g,b,h),o=P2(p,g,b,h)}ks(this.h,0,i,o),ks(this.h,2,a,c),ks(this.h,4,v,y),ks(this.h,6,w,M),ks(this.h,8,S,R),ks(this.h,10,C,B),ks(this.h,12,N,q),ks(this.h,14,H,D)};Di.prototype._digest=function(t){return t==="hex"?Wn.toHex32(this.h,"big"):Wn.split32(this.h,"big")};function Tie(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function kie(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function Pie(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function Nie(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function qie(e,t){var r=lo(e,t,28),n=lo(t,e,2),i=lo(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function Lie(e,t){var r=ho(e,t,28),n=ho(t,e,2),i=ho(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function Bie(e,t){var r=lo(e,t,14),n=lo(e,t,18),i=lo(t,e,9),o=r^n^i;return o<0&&(o+=4294967296),o}function Die(e,t){var r=ho(e,t,14),n=ho(e,t,18),i=ho(t,e,9),o=r^n^i;return o<0&&(o+=4294967296),o}function jie(e,t){var r=lo(e,t,1),n=lo(e,t,8),i=$C(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function Fie(e,t){var r=ho(e,t,1),n=ho(e,t,8),i=KC(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function Uie(e,t){var r=lo(e,t,19),n=lo(t,e,29),i=$C(e,t,6),o=r^n^i;return o<0&&(o+=4294967296),o}function Hie(e,t){var r=ho(e,t,19),n=ho(t,e,29),i=KC(e,t,6),o=r^n^i;return o<0&&(o+=4294967296),o}});var QC=E((APe,JC)=>{"use strict";var q2=Li(),YC=N2();function Jo(){if(!(this instanceof Jo))return new Jo;YC.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}q2.inherits(Jo,YC);JC.exports=Jo;Jo.blockSize=1024;Jo.outSize=384;Jo.hmacStrength=192;Jo.padLength=128;Jo.prototype._digest=function(t){return t==="hex"?q2.toHex32(this.h.slice(0,12),"big"):q2.split32(this.h.slice(0,12),"big")}});var XC=E(Pf=>{"use strict";Pf.sha1=FC();Pf.sha224=VC();Pf.sha256=C2();Pf.sha384=QC();Pf.sha512=N2()});var oT=E(iT=>{"use strict";var Ga=Li(),Wie=If(),h1=Ga.rotl32,eT=Ga.sum32,lh=Ga.sum32_3,tT=Ga.sum32_4,nT=Wie.BlockHash;function po(){if(!(this instanceof po))return new po;nT.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Ga.inherits(po,nT);iT.ripemd160=po;po.blockSize=512;po.outSize=160;po.hmacStrength=192;po.padLength=64;po.prototype._update=function(t,r){for(var n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],v=n,y=i,w=o,M=a,S=c,R=0;R<80;R++){var C=eT(h1(tT(n,rT(R,i,o,a),t[$ie[R]+r],zie(R)),Gie[R]),c);n=c,c=a,a=h1(o,10),o=i,i=C,C=eT(h1(tT(v,rT(79-R,y,w,M),t[Kie[R]+r],Vie(R)),Zie[R]),S),v=S,S=M,M=h1(w,10),w=y,y=C}C=lh(this.h[1],o,M),this.h[1]=lh(this.h[2],a,S),this.h[2]=lh(this.h[3],c,v),this.h[3]=lh(this.h[4],n,y),this.h[4]=lh(this.h[0],i,w),this.h[0]=C};po.prototype._digest=function(t){return t==="hex"?Ga.toHex32(this.h,"little"):Ga.split32(this.h,"little")};function rT(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function zie(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Vie(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var $ie=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Kie=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Gie=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Zie=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var aT=E((IPe,sT)=>{"use strict";var Yie=Li(),Jie=Is();function Nf(e,t,r){if(!(this instanceof Nf))return new Nf(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(Yie.toArray(t,r))}sT.exports=Nf;Nf.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),Jie(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=new this.Hash().update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=new this.Hash().update(t)};Nf.prototype.update=function(t,r){return this.inner.update(t,r),this};Nf.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}});var d1=E(uT=>{var rn=uT;rn.utils=Li();rn.common=If();rn.sha=XC();rn.ripemd=oT();rn.hmac=aT();rn.sha1=rn.sha.sha1;rn.sha256=rn.sha.sha256;rn.sha224=rn.sha.sha224;rn.sha384=rn.sha.sha384;rn.sha512=rn.sha.sha512;rn.ripemd160=rn.ripemd.ripemd160});var cT=E((TPe,fT)=>{fT.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var p1=E(dT=>{"use strict";var B2=dT,Ps=d1(),L2=O2(),Qie=ei(),lT=Qie.assert;function hT(e){e.type==="short"?this.curve=new L2.short(e):e.type==="edwards"?this.curve=new L2.edwards(e):this.curve=new L2.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,lT(this.g.validate(),"Invalid curve"),lT(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}B2.PresetCurve=hT;function Ns(e,t){Object.defineProperty(B2,e,{configurable:!0,enumerable:!0,get:function(){var r=new hT(t);return Object.defineProperty(B2,e,{configurable:!0,enumerable:!0,value:r}),r}})}Ns("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Ps.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Ns("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Ps.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Ns("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Ps.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Ns("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Ps.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});Ns("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Ps.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});Ns("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ps.sha256,gRed:!1,g:["9"]});Ns("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ps.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var D2;try{D2=cT()}catch{D2=void 0}Ns("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Ps.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",D2]})});var mT=E((PPe,vT)=>{"use strict";var Xie=d1(),Za=w2(),pT=Is();function qs(e){if(!(this instanceof qs))return new qs(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Za.toArray(e.entropy,e.entropyEnc||"hex"),r=Za.toArray(e.nonce,e.nonceEnc||"hex"),n=Za.toArray(e.pers,e.persEnc||"hex");pT(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}vT.exports=qs;qs.prototype._init=function(t,r,n){var i=t.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};qs.prototype._hmac=function(){return new Xie.hmac(this.hash,this.K)};qs.prototype._update=function(t){var r=this._hmac().update(this.V).update([0]);t&&(r=r.update(t)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};qs.prototype.reseed=function(t,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),t=Za.toArray(t,r),n=Za.toArray(n,i),pT(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1};qs.prototype.generate=function(t,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Za.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,t);return this._update(n),this._reseed++,Za.encode(a,r)}});var bT=E((NPe,gT)=>{"use strict";var eoe=so(),toe=ei(),j2=toe.assert;function dn(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}gT.exports=dn;dn.fromPublic=function(t,r,n){return r instanceof dn?r:new dn(t,{pub:r,pubEnc:n})};dn.fromPrivate=function(t,r,n){return r instanceof dn?r:new dn(t,{priv:r,privEnc:n})};dn.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};dn.prototype.getPublic=function(t,r){return typeof t=="string"&&(r=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,t):this.pub};dn.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};dn.prototype._importPrivate=function(t,r){this.priv=new eoe(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)};dn.prototype._importPublic=function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?j2(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&j2(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,r)};dn.prototype.derive=function(t){return t.validate()||j2(t.validate(),"public point not validated"),t.mul(this.priv).getX()};dn.prototype.sign=function(t,r,n){return this.ec.sign(t,this,r,n)};dn.prototype.verify=function(t,r){return this.ec.verify(t,r,this)};dn.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var wT=E((qPe,_T)=>{"use strict";var v1=so(),H2=ei(),roe=H2.assert;function m1(e,t){if(e instanceof m1)return e;this._importDER(e,t)||(roe(e.r&&e.s,"Signature without r or s"),this.r=new v1(e.r,16),this.s=new v1(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}_T.exports=m1;function noe(){this.place=0}function F2(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return i<=127?!1:(t.place=a,i)}function yT(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t<r;)t++;return t===0?e:e.slice(t)}m1.prototype._importDER=function(t,r){t=H2.toArray(t,r);var n=new noe;if(t[n.place++]!==48)return!1;var i=F2(t,n);if(i===!1||i+n.place!==t.length||t[n.place++]!==2)return!1;var o=F2(t,n);if(o===!1)return!1;var a=t.slice(n.place,o+n.place);if(n.place+=o,t[n.place++]!==2)return!1;var c=F2(t,n);if(c===!1||t.length!==c+n.place)return!1;var v=t.slice(n.place,c+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(v[0]===0)if(v[1]&128)v=v.slice(1);else return!1;return this.r=new v1(a),this.s=new v1(v),this.recoveryParam=null,!0};function U2(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}m1.prototype.toDER=function(t){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=yT(r),n=yT(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];U2(i,r.length),i=i.concat(r),i.push(2),U2(i,n.length);var o=i.concat(n),a=[48];return U2(a,o.length),a=a.concat(o),H2.encode(a,t)}});var ET=E((LPe,ST)=>{"use strict";var Ya=so(),xT=mT(),ioe=ei(),W2=p1(),ooe=E2(),MT=ioe.assert,z2=bT(),g1=wT();function _i(e){if(!(this instanceof _i))return new _i(e);typeof e=="string"&&(MT(Object.prototype.hasOwnProperty.call(W2,e),"Unknown curve "+e),e=W2[e]),e instanceof W2.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}ST.exports=_i;_i.prototype.keyPair=function(t){return new z2(this,t)};_i.prototype.keyFromPrivate=function(t,r){return z2.fromPrivate(this,t,r)};_i.prototype.keyFromPublic=function(t,r){return z2.fromPublic(this,t,r)};_i.prototype.genKeyPair=function(t){t||(t={});for(var r=new xT({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||ooe(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Ya(2));;){var o=new Ya(r.generate(n));if(!(o.cmp(i)>0))return o.iaddn(1),this.keyFromPrivate(o)}};_i.prototype._truncateToN=function(t,r){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t};_i.prototype.sign=function(t,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),t=this._truncateToN(new Ya(t,16));for(var o=this.n.byteLength(),a=r.getPrivate().toArray("be",o),c=t.toArray("be",o),v=new xT({hash:this.hash,entropy:a,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),y=this.n.sub(new Ya(1)),w=0;;w++){var M=i.k?i.k(w):new Ya(v.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(y)>=0)){var S=this.g.mul(M);if(!S.isInfinity()){var R=S.getX(),C=R.umod(this.n);if(C.cmpn(0)!==0){var B=M.invm(this.n).mul(C.mul(r.getPrivate()).iadd(t));if(B=B.umod(this.n),B.cmpn(0)!==0){var N=(S.getY().isOdd()?1:0)|(R.cmp(C)!==0?2:0);return i.canonical&&B.cmp(this.nh)>0&&(B=this.n.sub(B),N^=1),new g1({r:C,s:B,recoveryParam:N})}}}}}};_i.prototype.verify=function(t,r,n,i){t=this._truncateToN(new Ya(t,16)),n=this.keyFromPublic(n,i),r=new g1(r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),v=c.mul(t).umod(this.n),y=c.mul(o).umod(this.n),w;return this.curve._maxwellTrick?(w=this.g.jmulAdd(v,n.getPublic(),y),w.isInfinity()?!1:w.eqXToP(o)):(w=this.g.mulAdd(v,n.getPublic(),y),w.isInfinity()?!1:w.getX().umod(this.n).cmp(o)===0)};_i.prototype.recoverPubKey=function(e,t,r,n){MT((3&r)===r,"The recovery param is more than two bits"),t=new g1(t,n);var i=this.n,o=new Ya(e),a=t.r,c=t.s,v=r&1,y=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&y)throw new Error("Unable to find sencond key candinate");y?a=this.curve.pointFromX(a.add(this.curve.n),v):a=this.curve.pointFromX(a,v);var w=t.r.invm(i),M=i.sub(o).mul(w).umod(i),S=c.mul(w).umod(i);return this.g.mulAdd(M,a,S)};_i.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new g1(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}});var IT=E((BPe,RT)=>{"use strict";var hh=ei(),OT=hh.assert,AT=hh.parseBytes,qf=hh.cachedProperty;function $r(e,t){this.eddsa=e,this._secret=AT(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=AT(t.pub)}$r.fromPublic=function(t,r){return r instanceof $r?r:new $r(t,{pub:r})};$r.fromSecret=function(t,r){return r instanceof $r?r:new $r(t,{secret:r})};$r.prototype.secret=function(){return this._secret};qf($r,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});qf($r,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});qf($r,"privBytes",function(){var t=this.eddsa,r=this.hash(),n=t.encodingLength-1,i=r.slice(0,t.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});qf($r,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});qf($r,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});qf($r,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});$r.prototype.sign=function(t){return OT(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)};$r.prototype.verify=function(t,r){return this.eddsa.verify(t,r,this)};$r.prototype.getSecret=function(t){return OT(this._secret,"KeyPair is public only"),hh.encode(this.secret(),t)};$r.prototype.getPublic=function(t){return hh.encode(this.pubBytes(),t)};RT.exports=$r});var TT=E((DPe,CT)=>{"use strict";var soe=so(),b1=ei(),aoe=b1.assert,y1=b1.cachedProperty,uoe=b1.parseBytes;function Ja(e,t){this.eddsa=e,typeof t!="object"&&(t=uoe(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),aoe(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof soe&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}y1(Ja,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});y1(Ja,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});y1(Ja,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});y1(Ja,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Ja.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Ja.prototype.toHex=function(){return b1.encode(this.toBytes(),"hex").toUpperCase()};CT.exports=Ja});var LT=E((jPe,qT)=>{"use strict";var foe=d1(),coe=p1(),Lf=ei(),loe=Lf.assert,PT=Lf.parseBytes,NT=IT(),kT=TT();function zn(e){if(loe(e==="ed25519","only tested with ed25519 so far"),!(this instanceof zn))return new zn(e);e=coe[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=foe.sha512}qT.exports=zn;zn.prototype.sign=function(t,r){t=PT(t);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),t),o=this.g.mul(i),a=this.encodePoint(o),c=this.hashInt(a,n.pubBytes(),t).mul(n.priv()),v=i.add(c).umod(this.curve.n);return this.makeSignature({R:o,S:v,Rencoded:a})};zn.prototype.verify=function(t,r,n){t=PT(t),r=this.makeSignature(r);var i=this.keyFromPublic(n),o=this.hashInt(r.Rencoded(),i.pubBytes(),t),a=this.g.mul(r.S()),c=r.R().add(i.pub().mul(o));return c.eq(a)};zn.prototype.hashInt=function(){for(var t=this.hash(),r=0;r<arguments.length;r++)t.update(arguments[r]);return Lf.intFromLE(t.digest()).umod(this.curve.n)};zn.prototype.keyFromPublic=function(t){return NT.fromPublic(this,t)};zn.prototype.keyFromSecret=function(t){return NT.fromSecret(this,t)};zn.prototype.makeSignature=function(t){return t instanceof kT?t:new kT(this,t)};zn.prototype.encodePoint=function(t){var r=t.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=t.getX().isOdd()?128:0,r};zn.prototype.decodePoint=function(t){t=Lf.parseBytes(t);var r=t.length-1,n=t.slice(0,r).concat(t[r]&-129),i=(t[r]&128)!==0,o=Lf.intFromLE(n);return this.curve.pointFromY(o,i)};zn.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)};zn.prototype.decodeInt=function(t){return Lf.intFromLE(t)};zn.prototype.isPoint=function(t){return t instanceof this.pointClass}});var _1=E(BT=>{"use strict";var Qa=BT;Qa.version=fC().version;Qa.utils=ei();Qa.rand=E2();Qa.curve=O2();Qa.curves=p1();Qa.ec=ET();Qa.eddsa=LT()});var jT=E((UPe,DT)=>{var hoe=_1().ec,vo=new hoe("secp256k1"),Ot=vo.curve,ir=Ot.n.constructor;function doe(e,t){let r=new ir(t);if(r.cmp(Ot.p)>=0)return null;r=r.toRed(Ot.red);let n=r.redSqr().redIMul(r).redIAdd(Ot.b).redSqrt();return e===3!==n.isOdd()&&(n=n.redNeg()),vo.keyPair({pub:{x:r,y:n}})}function poe(e,t,r){let n=new ir(t),i=new ir(r);if(n.cmp(Ot.p)>=0||i.cmp(Ot.p)>=0||(n=n.toRed(Ot.red),i=i.toRed(Ot.red),(e===6||e===7)&&i.isOdd()!==(e===7)))return null;let o=n.redSqr().redIMul(n);return i.redSqr().redISub(o.redIAdd(Ot.b)).isZero()?vo.keyPair({pub:{x:n,y:i}}):null}function Ls(e){let t=e[0];switch(t){case 2:case 3:return e.length!==33?null:doe(t,e.subarray(1,33));case 4:case 6:case 7:return e.length!==65?null:poe(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function Xa(e,t){let r=t.encode(null,e.length===33);for(let n=0;n<e.length;++n)e[n]=r[n]}DT.exports={contextRandomize(){return 0},privateKeyVerify(e){let t=new ir(e);return t.cmp(Ot.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){let t=new ir(e),r=Ot.n.sub(t).umod(Ot.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){let r=new ir(t);if(r.cmp(Ot.n)>=0||(r.iadd(new ir(e)),r.cmp(Ot.n)>=0&&r.isub(Ot.n),r.isZero()))return 1;let n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul(e,t){let r=new ir(t);if(r.cmp(Ot.n)>=0||r.isZero())return 1;r.imul(new ir(e)),r.cmp(Ot.n)>=0&&(r=r.umod(Ot.n));let n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify(e){return Ls(e)===null?1:0},publicKeyCreate(e,t){let r=new ir(t);if(r.cmp(Ot.n)>=0||r.isZero())return 1;let n=vo.keyFromPrivate(t).getPublic();return Xa(e,n),0},publicKeyConvert(e,t){let r=Ls(t);if(r===null)return 1;let n=r.getPublic();return Xa(e,n),0},publicKeyNegate(e,t){let r=Ls(t);if(r===null)return 1;let n=r.getPublic();return n.y=n.y.redNeg(),Xa(e,n),0},publicKeyCombine(e,t){let r=new Array(t.length);for(let i=0;i<t.length;++i)if(r[i]=Ls(t[i]),r[i]===null)return 1;let n=r[0].getPublic();for(let i=1;i<r.length;++i)n=n.add(r[i].pub);return n.isInfinity()?2:(Xa(e,n),0)},publicKeyTweakAdd(e,t,r){let n=Ls(t);if(n===null)return 1;if(r=new ir(r),r.cmp(Ot.n)>=0)return 2;let i=n.getPublic().add(Ot.g.mul(r));return i.isInfinity()?2:(Xa(e,i),0)},publicKeyTweakMul(e,t,r){let n=Ls(t);if(n===null)return 1;if(r=new ir(r),r.cmp(Ot.n)>=0||r.isZero())return 2;let i=n.getPublic().mul(r);return Xa(e,i),0},signatureNormalize(e){let t=new ir(e.subarray(0,32)),r=new ir(e.subarray(32,64));return t.cmp(Ot.n)>=0||r.cmp(Ot.n)>=0?1:(r.cmp(vo.nh)===1&&e.set(Ot.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){let r=t.subarray(0,32),n=t.subarray(32,64);if(new ir(r).cmp(Ot.n)>=0||new ir(n).cmp(Ot.n)>=0)return 1;let{output:i}=e,o=i.subarray(4,4+33);o[0]=0,o.set(r,1);let a=33,c=0;for(;a>1&&o[c]===0&&!(o[c+1]&128);--a,++c);if(o=o.subarray(c),o[0]&128||a>1&&o[0]===0&&!(o[1]&128))return 1;let v=i.subarray(6+33,6+33+33);v[0]=0,v.set(n,1);let y=33,w=0;for(;y>1&&v[w]===0&&!(v[w+1]&128);--y,++w);return v=v.subarray(w),v[0]&128||y>1&&v[0]===0&&!(v[1]&128)?1:(e.outputlen=6+a+y,i[0]=48,i[1]=e.outputlen-2,i[2]=2,i[3]=o.length,i.set(o,4),i[4+a]=2,i[5+a]=v.length,i.set(v,6+a),0)},signatureImport(e,t){if(t.length<8||t.length>72||t[0]!==48||t[1]!==t.length-2||t[2]!==2)return 1;let r=t[3];if(r===0||5+r>=t.length||t[4+r]!==2)return 1;let n=t[5+r];if(n===0||6+r+n!==t.length||t[4]&128||r>1&&t[4]===0&&!(t[5]&128)||t[r+6]&128||n>1&&t[r+6]===0&&!(t[r+7]&128))return 1;let i=t.subarray(4,4+r);if(i.length===33&&i[0]===0&&(i=i.subarray(1)),i.length>32)return 1;let o=t.subarray(6+r);if(o.length===33&&o[0]===0&&(o=o.slice(1)),o.length>32)throw new Error("S length is too long");let a=new ir(i);a.cmp(Ot.n)>=0&&(a=new ir(0));let c=new ir(t.subarray(6+r));return c.cmp(Ot.n)>=0&&(c=new ir(0)),e.set(a.toArrayLike(Uint8Array,"be",32),0),e.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,n,i){if(i){let c=i;i=v=>{let y=c(t,r,null,n,v);if(!(y instanceof Uint8Array&&y.length===32))throw new Error("This is the way");return new ir(y)}}let o=new ir(r);if(o.cmp(Ot.n)>=0||o.isZero())return 1;let a;try{a=vo.sign(t,r,{canonical:!0,k:i,pers:n})}catch{return 1}return e.signature.set(a.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(a.s.toArrayLike(Uint8Array,"be",32),32),e.recid=a.recoveryParam,0},ecdsaVerify(e,t,r){let n={r:e.subarray(0,32),s:e.subarray(32,64)},i=new ir(n.r),o=new ir(n.s);if(i.cmp(Ot.n)>=0||o.cmp(Ot.n)>=0)return 1;if(o.cmp(vo.nh)===1||i.isZero()||o.isZero())return 3;let a=Ls(r);if(a===null)return 2;let c=a.getPublic();return vo.verify(t,n,c)?0:3},ecdsaRecover(e,t,r,n){let i={r:t.slice(0,32),s:t.slice(32,64)},o=new ir(i.r),a=new ir(i.s);if(o.cmp(Ot.n)>=0||a.cmp(Ot.n)>=0)return 1;if(o.isZero()||a.isZero())return 2;let c;try{c=vo.recoverPubKey(n,i,r)}catch{return 2}return Xa(e,c),0},ecdh(e,t,r,n,i,o,a){let c=Ls(t);if(c===null)return 1;let v=new ir(r);if(v.cmp(Ot.n)>=0||v.isZero())return 2;let y=c.getPublic().mul(v);if(i===void 0){let w=y.encode(null,!0),M=vo.hash().update(w).digest();for(let S=0;S<32;++S)e[S]=M[S]}else{o||(o=new Uint8Array(32));let w=y.getX().toArray("be",32);for(let C=0;C<32;++C)o[C]=w[C];a||(a=new Uint8Array(32));let M=y.getY().toArray("be",32);for(let C=0;C<32;++C)a[C]=M[C];let S=i(o,a,n);if(!(S instanceof Uint8Array&&S.length===e.length))return 2;e.set(S)}return 0}}});var V2=E((HPe,FT)=>{FT.exports=uC()(jT())});var UT=E((WPe,K2)=>{"use strict";var $2=65536,voe=4294967295;function moe(){throw new Error(`Secure random number generation is not supported by this browser.
535
+ Use Chrome, Firefox or Internet Explorer 11`)}var goe=Hn().Buffer,w1=globalThis.crypto||globalThis.msCrypto;w1&&w1.getRandomValues?K2.exports=boe:K2.exports=moe;function boe(e,t){if(e>voe)throw new RangeError("requested too many random bytes");var r=goe.allocUnsafe(e);if(e>0)if(e>$2)for(var n=0;n<e;n+=$2)w1.getRandomValues(r.slice(n,n+$2));else w1.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}});var WT=E(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0});var HT=UT();function yoe(e){return new Promise(function(t,r){HT(e,function(n,i){if(n){r(n);return}t(i)})})}x1.getRandomBytes=yoe;function _oe(e){return HT(e)}x1.getRandomBytesSync=_oe});var G2=E(mo=>{"use strict";var woe=mo&&mo.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function c(w){try{y(n.next(w))}catch(M){a(M)}}function v(w){try{y(n.throw(w))}catch(M){a(M)}}function y(w){w.done?o(w.value):i(w.value).then(c,v)}y((n=n.apply(e,t||[])).next())})},xoe=mo&&mo.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(y){return function(w){return v([y,w])}}function v(y){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=y[0]&2?i.return:y[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,y[1])).done)return o;switch(i=0,o&&(y=[y[0]&2,o.value]),y[0]){case 0:case 1:o=y;break;case 4:return r.label++,{value:y[1],done:!1};case 5:r.label++,i=y[1],y=[0];continue;case 7:y=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(y[0]===6||y[0]===2)){r=0;continue}if(y[0]===3&&(!o||y[1]>o[0]&&y[1]<o[3])){r.label=y[1];break}if(y[0]===6&&r.label<o[1]){r.label=o[1],o=y;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(y);break}o[2]&&r.ops.pop(),r.trys.pop();continue}y=t.call(e,r)}catch(w){y=[6,w],i=0}finally{n=o=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}};function Moe(e){for(var t in e)mo.hasOwnProperty(t)||(mo[t]=e[t])}Object.defineProperty(mo,"__esModule",{value:!0});var zT=V2(),VT=WT(),$T=32;function Soe(){return woe(this,void 0,void 0,function(){var e;return xoe(this,function(t){switch(t.label){case 0:return[4,VT.getRandomBytes($T)];case 1:return e=t.sent(),zT.privateKeyVerify(e)?[2,e]:[3,0];case 2:return[2]}})})}mo.createPrivateKey=Soe;function Eoe(){for(;;){var e=VT.getRandomBytesSync($T);if(zT.privateKeyVerify(e))return e}}mo.createPrivateKeySync=Eoe;Moe(V2())});var Y2=E((KT,Z2)=>{(function(e,t){"use strict";function r(m,s){if(!m)throw new Error(s||"Assertion failed")}function n(m,s){m.super_=s;var l=function(){};l.prototype=s.prototype,m.prototype=new l,m.prototype.constructor=m}function i(m,s,l){if(i.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(m||0,s||10,l||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=fi().Buffer}catch{}i.isBN=function(s){return s instanceof i?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===i.wordSize&&Array.isArray(s.words)},i.max=function(s,l){return s.cmp(l)>0?s:l},i.min=function(s,l){return s.cmp(l)<0?s:l},i.prototype._init=function(s,l,d){if(typeof s=="number")return this._initNumber(s,l,d);if(typeof s=="object")return this._initArray(s,l,d);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f<s.length&&(l===16?this._parseHex(s,f,d):(this._parseBase(s,l,f),d==="le"&&this._initArray(this.toArray(),l,d)))},i.prototype._initNumber=function(s,l,d){s<0&&(this.negative=1,s=-s),s<67108864?(this.words=[s&67108863],this.length=1):s<4503599627370496?(this.words=[s&67108863,s/67108864&67108863],this.length=2):(r(s<9007199254740992),this.words=[s&67108863,s/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),l,d)},i.prototype._initArray=function(s,l,d){if(r(typeof s.length=="number"),s.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(s.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p,g,b=0;if(d==="be")for(f=s.length-1,p=0;f>=0;f-=3)g=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);else if(d==="le")for(f=0,p=0;f<s.length;f+=3)g=s[f]|s[f+1]<<8|s[f+2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);return this.strip()};function a(m,s){var l=m.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function c(m,s,l){var d=a(m,l);return l-1>=s&&(d|=a(m,l-1)<<4),d}i.prototype._parseHex=function(s,l,d){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p=0,g=0,b;if(d==="be")for(f=s.length-1;f>=l;f-=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8;else{var h=s.length-l;for(f=h%2===0?l+1:l;f<s.length;f+=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8}this.strip()};function v(m,s,l,d){for(var f=0,p=Math.min(m.length,l),g=s;g<p;g++){var b=m.charCodeAt(g)-48;f*=d,b>=49?f+=b-49+10:b>=17?f+=b-17+10:f+=b}return f}i.prototype._parseBase=function(s,l,d){this.words=[0],this.length=1;for(var f=0,p=1;p<=67108863;p*=l)f++;f--,p=p/l|0;for(var g=s.length-d,b=g%f,h=Math.min(g,g-b)+d,u=0,_=d;_<h;_+=f)u=v(s,_,_+f,l),this.imuln(p),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(b!==0){var A=1;for(u=v(s,_,s.length,l),_=0;_<b;_++)A*=l;this.imuln(A),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(s){s.words=new Array(this.length);for(var l=0;l<this.length;l++)s.words[l]=this.words[l];s.length=this.length,s.negative=this.negative,s.red=this.red},i.prototype.clone=function(){var s=new i(null);return this.copy(s),s},i.prototype._expand=function(s){for(;this.length<s;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,l){s=s||10,l=l|0||1;var d;if(s===16||s==="hex"){d="";for(var f=0,p=0,g=0;g<this.length;g++){var b=this.words[g],h=((b<<f|p)&16777215).toString(16);p=b>>>24-f&16777215,p!==0||g!==this.length-1?d=y[6-h.length]+h+d:d=h+d,f+=2,f>=26&&(f-=26,g--)}for(p!==0&&(d=p.toString(16)+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(s===(s|0)&&s>=2&&s<=36){var u=w[s],_=M[s];d="";var A=this.clone();for(A.negative=0;!A.isZero();){var x=A.modn(_).toString(s);A=A.idivn(_),A.isZero()?d=x+d:d=y[u-x.length]+x+d}for(this.isZero()&&(d="0"+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},i.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},i.prototype.toArrayLike=function(s,l,d){var f=this.byteLength(),p=d||Math.max(1,f);r(f<=p,"byte array longer than desired length"),r(p>0,"Requested array length <= 0"),this.strip();var g=l==="le",b=new s(p),h,u,_=this.clone();if(g){for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[u]=h;for(;u<p;u++)b[u]=0}else{for(u=0;u<p-f;u++)b[u]=0;for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[p-u-1]=h}return b},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var l=s,d=0;return l>=4096&&(d+=13,l>>>=13),l>=64&&(d+=7,l>>>=7),l>=8&&(d+=4,l>>>=4),l>=2&&(d+=2,l>>>=2),d+l},i.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,d=0;return(l&8191)===0&&(d+=13,l>>>=13),(l&127)===0&&(d+=7,l>>>=7),(l&15)===0&&(d+=4,l>>>=4),(l&3)===0&&(d+=2,l>>>=2),(l&1)===0&&d++,d},i.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function S(m){for(var s=new Array(m.bitLength()),l=0;l<s.length;l++){var d=l/26|0,f=l%26;s[l]=(m.words[d]&1<<f)>>>f}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;l<this.length;l++){var d=this._zeroBits(this.words[l]);if(s+=d,d!==26)break}return s},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(s){return this.negative!==0?this.abs().inotn(s).iaddn(1):this.clone()},i.prototype.fromTwos=function(s){return this.testn(s-1)?this.notn(s).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(s){for(;this.length<s.length;)this.words[this.length++]=0;for(var l=0;l<s.length;l++)this.words[l]=this.words[l]|s.words[l];return this.strip()},i.prototype.ior=function(s){return r((this.negative|s.negative)===0),this.iuor(s)},i.prototype.or=function(s){return this.length>s.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]&s.words[d];return this.length=l.length,this.strip()},i.prototype.iand=function(s){return r((this.negative|s.negative)===0),this.iuand(s)},i.prototype.and=function(s){return this.length>s.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var l,d;this.length>s.length?(l=this,d=s):(l=s,d=this);for(var f=0;f<d.length;f++)this.words[f]=l.words[f]^d.words[f];if(this!==l)for(;f<l.length;f++)this.words[f]=l.words[f];return this.length=l.length,this.strip()},i.prototype.ixor=function(s){return r((this.negative|s.negative)===0),this.iuxor(s)},i.prototype.xor=function(s){return this.length>s.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,d=s%26;this._expand(l),d>0&&l--;for(var f=0;f<l;f++)this.words[f]=~this.words[f]&67108863;return d>0&&(this.words[f]=~this.words[f]&67108863>>26-d),this.strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var d=s/26|0,f=s%26;return this._expand(d+1),l?this.words[d]=this.words[d]|1<<f:this.words[d]=this.words[d]&~(1<<f),this.strip()},i.prototype.iadd=function(s){var l;if(this.negative!==0&&s.negative===0)return this.negative=0,l=this.isub(s),this.negative^=1,this._normSign();if(this.negative===0&&s.negative!==0)return s.negative=0,l=this.isub(s),s.negative=1,l._normSign();var d,f;this.length>s.length?(d=this,f=s):(d=s,f=this);for(var p=0,g=0;g<f.length;g++)l=(d.words[g]|0)+(f.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;for(;p!==0&&g<d.length;g++)l=(d.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;if(this.length=d.length,p!==0)this.words[this.length]=p,this.length++;else if(d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this},i.prototype.add=function(s){var l;return s.negative!==0&&this.negative===0?(s.negative=0,l=this.sub(s),s.negative^=1,l):s.negative===0&&this.negative!==0?(this.negative=0,l=s.sub(this),this.negative=1,l):this.length>s.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var d=this.cmp(s);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,p;d>0?(f=this,p=s):(f=s,p=this);for(var g=0,b=0;b<p.length;b++)l=(f.words[b]|0)-(p.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;for(;g!==0&&b<f.length;b++)l=(f.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;if(g===0&&b<f.length&&f!==this)for(;b<f.length;b++)this.words[b]=f.words[b];return this.length=Math.max(this.length,b),f!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(s){return this.clone().isub(s)};function R(m,s,l){l.negative=s.negative^m.negative;var d=m.length+s.length|0;l.length=d,d=d-1|0;var f=m.words[0]|0,p=s.words[0]|0,g=f*p,b=g&67108863,h=g/67108864|0;l.words[0]=b;for(var u=1;u<d;u++){for(var _=h>>>26,A=h&67108863,x=Math.min(u,s.length-1),I=Math.max(0,u-m.length+1);I<=x;I++){var j=u-I|0;f=m.words[j]|0,p=s.words[I]|0,g=f*p+A,_+=g/67108864|0,A=g&67108863}l.words[u]=A|0,h=_|0}return h!==0?l.words[u]=h|0:l.length--,l.strip()}var C=function(s,l,d){var f=s.words,p=l.words,g=d.words,b=0,h,u,_,A=f[0]|0,x=A&8191,I=A>>>13,j=f[1]|0,O=j&8191,L=j>>>13,W=f[2]|0,F=W&8191,G=W>>>13,De=f[3]|0,Y=De&8191,Q=De>>>13,Ve=f[4]|0,J=Ve&8191,be=Ve>>>13,Ke=f[5]|0,ye=Ke&8191,Re=Ke>>>13,et=f[6]|0,oe=et&8191,xe=et>>>13,it=f[7]|0,ce=it&8191,Ie=it>>>13,ft=f[8]|0,le=ft&8191,Ce=ft>>>13,ot=f[9]|0,se=ot&8191,Me=ot>>>13,st=p[0]|0,ae=st&8191,Se=st>>>13,at=p[1]|0,re=at&8191,Te=at>>>13,ct=p[2]|0,ne=ct&8191,Ee=ct>>>13,lt=p[3]|0,te=lt&8191,ke=lt>>>13,ht=p[4]|0,ue=ht&8191,Pe=ht>>>13,dt=p[5]|0,he=dt&8191,Ne=dt>>>13,pt=p[6]|0,de=pt&8191,qe=pt>>>13,vt=p[7]|0,pe=vt&8191,Le=vt>>>13,ut=p[8]|0,ve=ut&8191,Be=ut>>>13,mt=p[9]|0,me=mt&8191,Ae=mt>>>13;d.negative=s.negative^l.negative,d.length=19,h=Math.imul(x,ae),u=Math.imul(x,Se),u=u+Math.imul(I,ae)|0,_=Math.imul(I,Se);var $t=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+($t>>>26)|0,$t&=67108863,h=Math.imul(O,ae),u=Math.imul(O,Se),u=u+Math.imul(L,ae)|0,_=Math.imul(L,Se),h=h+Math.imul(x,re)|0,u=u+Math.imul(x,Te)|0,u=u+Math.imul(I,re)|0,_=_+Math.imul(I,Te)|0;var Je=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Je>>>26)|0,Je&=67108863,h=Math.imul(F,ae),u=Math.imul(F,Se),u=u+Math.imul(G,ae)|0,_=Math.imul(G,Se),h=h+Math.imul(O,re)|0,u=u+Math.imul(O,Te)|0,u=u+Math.imul(L,re)|0,_=_+Math.imul(L,Te)|0,h=h+Math.imul(x,ne)|0,u=u+Math.imul(x,Ee)|0,u=u+Math.imul(I,ne)|0,_=_+Math.imul(I,Ee)|0;var Qe=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,h=Math.imul(Y,ae),u=Math.imul(Y,Se),u=u+Math.imul(Q,ae)|0,_=Math.imul(Q,Se),h=h+Math.imul(F,re)|0,u=u+Math.imul(F,Te)|0,u=u+Math.imul(G,re)|0,_=_+Math.imul(G,Te)|0,h=h+Math.imul(O,ne)|0,u=u+Math.imul(O,Ee)|0,u=u+Math.imul(L,ne)|0,_=_+Math.imul(L,Ee)|0,h=h+Math.imul(x,te)|0,u=u+Math.imul(x,ke)|0,u=u+Math.imul(I,te)|0,_=_+Math.imul(I,ke)|0;var Lt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(J,ae),u=Math.imul(J,Se),u=u+Math.imul(be,ae)|0,_=Math.imul(be,Se),h=h+Math.imul(Y,re)|0,u=u+Math.imul(Y,Te)|0,u=u+Math.imul(Q,re)|0,_=_+Math.imul(Q,Te)|0,h=h+Math.imul(F,ne)|0,u=u+Math.imul(F,Ee)|0,u=u+Math.imul(G,ne)|0,_=_+Math.imul(G,Ee)|0,h=h+Math.imul(O,te)|0,u=u+Math.imul(O,ke)|0,u=u+Math.imul(L,te)|0,_=_+Math.imul(L,ke)|0,h=h+Math.imul(x,ue)|0,u=u+Math.imul(x,Pe)|0,u=u+Math.imul(I,ue)|0,_=_+Math.imul(I,Pe)|0;var Bt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(ye,ae),u=Math.imul(ye,Se),u=u+Math.imul(Re,ae)|0,_=Math.imul(Re,Se),h=h+Math.imul(J,re)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(be,re)|0,_=_+Math.imul(be,Te)|0,h=h+Math.imul(Y,ne)|0,u=u+Math.imul(Y,Ee)|0,u=u+Math.imul(Q,ne)|0,_=_+Math.imul(Q,Ee)|0,h=h+Math.imul(F,te)|0,u=u+Math.imul(F,ke)|0,u=u+Math.imul(G,te)|0,_=_+Math.imul(G,ke)|0,h=h+Math.imul(O,ue)|0,u=u+Math.imul(O,Pe)|0,u=u+Math.imul(L,ue)|0,_=_+Math.imul(L,Pe)|0,h=h+Math.imul(x,he)|0,u=u+Math.imul(x,Ne)|0,u=u+Math.imul(I,he)|0,_=_+Math.imul(I,Ne)|0;var Dt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,h=Math.imul(oe,ae),u=Math.imul(oe,Se),u=u+Math.imul(xe,ae)|0,_=Math.imul(xe,Se),h=h+Math.imul(ye,re)|0,u=u+Math.imul(ye,Te)|0,u=u+Math.imul(Re,re)|0,_=_+Math.imul(Re,Te)|0,h=h+Math.imul(J,ne)|0,u=u+Math.imul(J,Ee)|0,u=u+Math.imul(be,ne)|0,_=_+Math.imul(be,Ee)|0,h=h+Math.imul(Y,te)|0,u=u+Math.imul(Y,ke)|0,u=u+Math.imul(Q,te)|0,_=_+Math.imul(Q,ke)|0,h=h+Math.imul(F,ue)|0,u=u+Math.imul(F,Pe)|0,u=u+Math.imul(G,ue)|0,_=_+Math.imul(G,Pe)|0,h=h+Math.imul(O,he)|0,u=u+Math.imul(O,Ne)|0,u=u+Math.imul(L,he)|0,_=_+Math.imul(L,Ne)|0,h=h+Math.imul(x,de)|0,u=u+Math.imul(x,qe)|0,u=u+Math.imul(I,de)|0,_=_+Math.imul(I,qe)|0;var jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(jt>>>26)|0,jt&=67108863,h=Math.imul(ce,ae),u=Math.imul(ce,Se),u=u+Math.imul(Ie,ae)|0,_=Math.imul(Ie,Se),h=h+Math.imul(oe,re)|0,u=u+Math.imul(oe,Te)|0,u=u+Math.imul(xe,re)|0,_=_+Math.imul(xe,Te)|0,h=h+Math.imul(ye,ne)|0,u=u+Math.imul(ye,Ee)|0,u=u+Math.imul(Re,ne)|0,_=_+Math.imul(Re,Ee)|0,h=h+Math.imul(J,te)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(be,te)|0,_=_+Math.imul(be,ke)|0,h=h+Math.imul(Y,ue)|0,u=u+Math.imul(Y,Pe)|0,u=u+Math.imul(Q,ue)|0,_=_+Math.imul(Q,Pe)|0,h=h+Math.imul(F,he)|0,u=u+Math.imul(F,Ne)|0,u=u+Math.imul(G,he)|0,_=_+Math.imul(G,Ne)|0,h=h+Math.imul(O,de)|0,u=u+Math.imul(O,qe)|0,u=u+Math.imul(L,de)|0,_=_+Math.imul(L,qe)|0,h=h+Math.imul(x,pe)|0,u=u+Math.imul(x,Le)|0,u=u+Math.imul(I,pe)|0,_=_+Math.imul(I,Le)|0;var Ft=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,h=Math.imul(le,ae),u=Math.imul(le,Se),u=u+Math.imul(Ce,ae)|0,_=Math.imul(Ce,Se),h=h+Math.imul(ce,re)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(Ie,re)|0,_=_+Math.imul(Ie,Te)|0,h=h+Math.imul(oe,ne)|0,u=u+Math.imul(oe,Ee)|0,u=u+Math.imul(xe,ne)|0,_=_+Math.imul(xe,Ee)|0,h=h+Math.imul(ye,te)|0,u=u+Math.imul(ye,ke)|0,u=u+Math.imul(Re,te)|0,_=_+Math.imul(Re,ke)|0,h=h+Math.imul(J,ue)|0,u=u+Math.imul(J,Pe)|0,u=u+Math.imul(be,ue)|0,_=_+Math.imul(be,Pe)|0,h=h+Math.imul(Y,he)|0,u=u+Math.imul(Y,Ne)|0,u=u+Math.imul(Q,he)|0,_=_+Math.imul(Q,Ne)|0,h=h+Math.imul(F,de)|0,u=u+Math.imul(F,qe)|0,u=u+Math.imul(G,de)|0,_=_+Math.imul(G,qe)|0,h=h+Math.imul(O,pe)|0,u=u+Math.imul(O,Le)|0,u=u+Math.imul(L,pe)|0,_=_+Math.imul(L,Le)|0,h=h+Math.imul(x,ve)|0,u=u+Math.imul(x,Be)|0,u=u+Math.imul(I,ve)|0,_=_+Math.imul(I,Be)|0;var lr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,h=Math.imul(se,ae),u=Math.imul(se,Se),u=u+Math.imul(Me,ae)|0,_=Math.imul(Me,Se),h=h+Math.imul(le,re)|0,u=u+Math.imul(le,Te)|0,u=u+Math.imul(Ce,re)|0,_=_+Math.imul(Ce,Te)|0,h=h+Math.imul(ce,ne)|0,u=u+Math.imul(ce,Ee)|0,u=u+Math.imul(Ie,ne)|0,_=_+Math.imul(Ie,Ee)|0,h=h+Math.imul(oe,te)|0,u=u+Math.imul(oe,ke)|0,u=u+Math.imul(xe,te)|0,_=_+Math.imul(xe,ke)|0,h=h+Math.imul(ye,ue)|0,u=u+Math.imul(ye,Pe)|0,u=u+Math.imul(Re,ue)|0,_=_+Math.imul(Re,Pe)|0,h=h+Math.imul(J,he)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(be,he)|0,_=_+Math.imul(be,Ne)|0,h=h+Math.imul(Y,de)|0,u=u+Math.imul(Y,qe)|0,u=u+Math.imul(Q,de)|0,_=_+Math.imul(Q,qe)|0,h=h+Math.imul(F,pe)|0,u=u+Math.imul(F,Le)|0,u=u+Math.imul(G,pe)|0,_=_+Math.imul(G,Le)|0,h=h+Math.imul(O,ve)|0,u=u+Math.imul(O,Be)|0,u=u+Math.imul(L,ve)|0,_=_+Math.imul(L,Be)|0,h=h+Math.imul(x,me)|0,u=u+Math.imul(x,Ae)|0,u=u+Math.imul(I,me)|0,_=_+Math.imul(I,Ae)|0;var hr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,h=Math.imul(se,re),u=Math.imul(se,Te),u=u+Math.imul(Me,re)|0,_=Math.imul(Me,Te),h=h+Math.imul(le,ne)|0,u=u+Math.imul(le,Ee)|0,u=u+Math.imul(Ce,ne)|0,_=_+Math.imul(Ce,Ee)|0,h=h+Math.imul(ce,te)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(Ie,te)|0,_=_+Math.imul(Ie,ke)|0,h=h+Math.imul(oe,ue)|0,u=u+Math.imul(oe,Pe)|0,u=u+Math.imul(xe,ue)|0,_=_+Math.imul(xe,Pe)|0,h=h+Math.imul(ye,he)|0,u=u+Math.imul(ye,Ne)|0,u=u+Math.imul(Re,he)|0,_=_+Math.imul(Re,Ne)|0,h=h+Math.imul(J,de)|0,u=u+Math.imul(J,qe)|0,u=u+Math.imul(be,de)|0,_=_+Math.imul(be,qe)|0,h=h+Math.imul(Y,pe)|0,u=u+Math.imul(Y,Le)|0,u=u+Math.imul(Q,pe)|0,_=_+Math.imul(Q,Le)|0,h=h+Math.imul(F,ve)|0,u=u+Math.imul(F,Be)|0,u=u+Math.imul(G,ve)|0,_=_+Math.imul(G,Be)|0,h=h+Math.imul(O,me)|0,u=u+Math.imul(O,Ae)|0,u=u+Math.imul(L,me)|0,_=_+Math.imul(L,Ae)|0;var or=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(or>>>26)|0,or&=67108863,h=Math.imul(se,ne),u=Math.imul(se,Ee),u=u+Math.imul(Me,ne)|0,_=Math.imul(Me,Ee),h=h+Math.imul(le,te)|0,u=u+Math.imul(le,ke)|0,u=u+Math.imul(Ce,te)|0,_=_+Math.imul(Ce,ke)|0,h=h+Math.imul(ce,ue)|0,u=u+Math.imul(ce,Pe)|0,u=u+Math.imul(Ie,ue)|0,_=_+Math.imul(Ie,Pe)|0,h=h+Math.imul(oe,he)|0,u=u+Math.imul(oe,Ne)|0,u=u+Math.imul(xe,he)|0,_=_+Math.imul(xe,Ne)|0,h=h+Math.imul(ye,de)|0,u=u+Math.imul(ye,qe)|0,u=u+Math.imul(Re,de)|0,_=_+Math.imul(Re,qe)|0,h=h+Math.imul(J,pe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(be,pe)|0,_=_+Math.imul(be,Le)|0,h=h+Math.imul(Y,ve)|0,u=u+Math.imul(Y,Be)|0,u=u+Math.imul(Q,ve)|0,_=_+Math.imul(Q,Be)|0,h=h+Math.imul(F,me)|0,u=u+Math.imul(F,Ae)|0,u=u+Math.imul(G,me)|0,_=_+Math.imul(G,Ae)|0;var Kt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,h=Math.imul(se,te),u=Math.imul(se,ke),u=u+Math.imul(Me,te)|0,_=Math.imul(Me,ke),h=h+Math.imul(le,ue)|0,u=u+Math.imul(le,Pe)|0,u=u+Math.imul(Ce,ue)|0,_=_+Math.imul(Ce,Pe)|0,h=h+Math.imul(ce,he)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(Ie,he)|0,_=_+Math.imul(Ie,Ne)|0,h=h+Math.imul(oe,de)|0,u=u+Math.imul(oe,qe)|0,u=u+Math.imul(xe,de)|0,_=_+Math.imul(xe,qe)|0,h=h+Math.imul(ye,pe)|0,u=u+Math.imul(ye,Le)|0,u=u+Math.imul(Re,pe)|0,_=_+Math.imul(Re,Le)|0,h=h+Math.imul(J,ve)|0,u=u+Math.imul(J,Be)|0,u=u+Math.imul(be,ve)|0,_=_+Math.imul(be,Be)|0,h=h+Math.imul(Y,me)|0,u=u+Math.imul(Y,Ae)|0,u=u+Math.imul(Q,me)|0,_=_+Math.imul(Q,Ae)|0;var sr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,h=Math.imul(se,ue),u=Math.imul(se,Pe),u=u+Math.imul(Me,ue)|0,_=Math.imul(Me,Pe),h=h+Math.imul(le,he)|0,u=u+Math.imul(le,Ne)|0,u=u+Math.imul(Ce,he)|0,_=_+Math.imul(Ce,Ne)|0,h=h+Math.imul(ce,de)|0,u=u+Math.imul(ce,qe)|0,u=u+Math.imul(Ie,de)|0,_=_+Math.imul(Ie,qe)|0,h=h+Math.imul(oe,pe)|0,u=u+Math.imul(oe,Le)|0,u=u+Math.imul(xe,pe)|0,_=_+Math.imul(xe,Le)|0,h=h+Math.imul(ye,ve)|0,u=u+Math.imul(ye,Be)|0,u=u+Math.imul(Re,ve)|0,_=_+Math.imul(Re,Be)|0,h=h+Math.imul(J,me)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(be,me)|0,_=_+Math.imul(be,Ae)|0;var Ut=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,h=Math.imul(se,he),u=Math.imul(se,Ne),u=u+Math.imul(Me,he)|0,_=Math.imul(Me,Ne),h=h+Math.imul(le,de)|0,u=u+Math.imul(le,qe)|0,u=u+Math.imul(Ce,de)|0,_=_+Math.imul(Ce,qe)|0,h=h+Math.imul(ce,pe)|0,u=u+Math.imul(ce,Le)|0,u=u+Math.imul(Ie,pe)|0,_=_+Math.imul(Ie,Le)|0,h=h+Math.imul(oe,ve)|0,u=u+Math.imul(oe,Be)|0,u=u+Math.imul(xe,ve)|0,_=_+Math.imul(xe,Be)|0,h=h+Math.imul(ye,me)|0,u=u+Math.imul(ye,Ae)|0,u=u+Math.imul(Re,me)|0,_=_+Math.imul(Re,Ae)|0;var dr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,h=Math.imul(se,de),u=Math.imul(se,qe),u=u+Math.imul(Me,de)|0,_=Math.imul(Me,qe),h=h+Math.imul(le,pe)|0,u=u+Math.imul(le,Le)|0,u=u+Math.imul(Ce,pe)|0,_=_+Math.imul(Ce,Le)|0,h=h+Math.imul(ce,ve)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(Ie,ve)|0,_=_+Math.imul(Ie,Be)|0,h=h+Math.imul(oe,me)|0,u=u+Math.imul(oe,Ae)|0,u=u+Math.imul(xe,me)|0,_=_+Math.imul(xe,Ae)|0;var Jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,h=Math.imul(se,pe),u=Math.imul(se,Le),u=u+Math.imul(Me,pe)|0,_=Math.imul(Me,Le),h=h+Math.imul(le,ve)|0,u=u+Math.imul(le,Be)|0,u=u+Math.imul(Ce,ve)|0,_=_+Math.imul(Ce,Be)|0,h=h+Math.imul(ce,me)|0,u=u+Math.imul(ce,Ae)|0,u=u+Math.imul(Ie,me)|0,_=_+Math.imul(Ie,Ae)|0;var tr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,h=Math.imul(se,ve),u=Math.imul(se,Be),u=u+Math.imul(Me,ve)|0,_=Math.imul(Me,Be),h=h+Math.imul(le,me)|0,u=u+Math.imul(le,Ae)|0,u=u+Math.imul(Ce,me)|0,_=_+Math.imul(Ce,Ae)|0;var Rr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,h=Math.imul(se,me),u=Math.imul(se,Ae),u=u+Math.imul(Me,me)|0,_=Math.imul(Me,Ae);var Qr=(b+h|0)+((u&8191)<<13)|0;return b=(_+(u>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,g[0]=$t,g[1]=Je,g[2]=Qe,g[3]=Lt,g[4]=Bt,g[5]=Dt,g[6]=jt,g[7]=Ft,g[8]=lr,g[9]=hr,g[10]=or,g[11]=Kt,g[12]=sr,g[13]=Ut,g[14]=dr,g[15]=Jt,g[16]=tr,g[17]=Rr,g[18]=Qr,b!==0&&(g[19]=b,d.length++),d};Math.imul||(C=R);function B(m,s,l){l.negative=s.negative^m.negative,l.length=m.length+s.length;for(var d=0,f=0,p=0;p<l.length-1;p++){var g=f;f=0;for(var b=d&67108863,h=Math.min(p,s.length-1),u=Math.max(0,p-m.length+1);u<=h;u++){var _=p-u,A=m.words[_]|0,x=s.words[u]|0,I=A*x,j=I&67108863;g=g+(I/67108864|0)|0,j=j+b|0,b=j&67108863,g=g+(j>>>26)|0,f+=g>>>26,g&=67108863}l.words[p]=b,d=g,g=f}return d!==0?l.words[p]=d:l.length--,l.strip()}function N(m,s,l){var d=new q;return d.mulp(m,s,l)}i.prototype.mulTo=function(s,l){var d,f=this.length+s.length;return this.length===10&&s.length===10?d=C(this,s,l):f<63?d=R(this,s,l):f<1024?d=B(this,s,l):d=N(this,s,l),d};function q(m,s){this.x=m,this.y=s}q.prototype.makeRBT=function(s){for(var l=new Array(s),d=i.prototype._countBits(s)-1,f=0;f<s;f++)l[f]=this.revBin(f,d,s);return l},q.prototype.revBin=function(s,l,d){if(s===0||s===d-1)return s;for(var f=0,p=0;p<l;p++)f|=(s&1)<<l-p-1,s>>=1;return f},q.prototype.permute=function(s,l,d,f,p,g){for(var b=0;b<g;b++)f[b]=l[s[b]],p[b]=d[s[b]]},q.prototype.transform=function(s,l,d,f,p,g){this.permute(g,s,l,d,f,p);for(var b=1;b<p;b<<=1)for(var h=b<<1,u=Math.cos(2*Math.PI/h),_=Math.sin(2*Math.PI/h),A=0;A<p;A+=h)for(var x=u,I=_,j=0;j<b;j++){var O=d[A+j],L=f[A+j],W=d[A+j+b],F=f[A+j+b],G=x*W-I*F;F=x*F+I*W,W=G,d[A+j]=O+W,f[A+j]=L+F,d[A+j+b]=O-W,f[A+j+b]=L-F,j!==h&&(G=u*x-_*I,I=u*I+_*x,x=G)}},q.prototype.guessLen13b=function(s,l){var d=Math.max(l,s)|1,f=d&1,p=0;for(d=d/2|0;d;d=d>>>1)p++;return 1<<p+1+f},q.prototype.conjugate=function(s,l,d){if(!(d<=1))for(var f=0;f<d/2;f++){var p=s[f];s[f]=s[d-f-1],s[d-f-1]=p,p=l[f],l[f]=-l[d-f-1],l[d-f-1]=-p}},q.prototype.normalize13b=function(s,l){for(var d=0,f=0;f<l/2;f++){var p=Math.round(s[2*f+1]/l)*8192+Math.round(s[2*f]/l)+d;s[f]=p&67108863,p<67108864?d=0:d=p/67108864|0}return s},q.prototype.convert13b=function(s,l,d,f){for(var p=0,g=0;g<l;g++)p=p+(s[g]|0),d[2*g]=p&8191,p=p>>>13,d[2*g+1]=p&8191,p=p>>>13;for(g=2*l;g<f;++g)d[g]=0;r(p===0),r((p&-8192)===0)},q.prototype.stub=function(s){for(var l=new Array(s),d=0;d<s;d++)l[d]=0;return l},q.prototype.mulp=function(s,l,d){var f=2*this.guessLen13b(s.length,l.length),p=this.makeRBT(f),g=this.stub(f),b=new Array(f),h=new Array(f),u=new Array(f),_=new Array(f),A=new Array(f),x=new Array(f),I=d.words;I.length=f,this.convert13b(s.words,s.length,b,f),this.convert13b(l.words,l.length,_,f),this.transform(b,g,h,u,f,p),this.transform(_,g,A,x,f,p);for(var j=0;j<f;j++){var O=h[j]*A[j]-u[j]*x[j];u[j]=h[j]*x[j]+u[j]*A[j],h[j]=O}return this.conjugate(h,u,f),this.transform(h,u,I,g,f,p),this.conjugate(I,g,f),this.normalize13b(I,f),d.negative=s.negative^l.negative,d.length=s.length+l.length,d.strip()},i.prototype.mul=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),this.mulTo(s,l)},i.prototype.mulf=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),N(this,s,l)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){r(typeof s=="number"),r(s<67108864);for(var l=0,d=0;d<this.length;d++){var f=(this.words[d]|0)*s,p=(f&67108863)+(l&67108863);l>>=26,l+=f/67108864|0,l+=p>>>26,this.words[d]=p&67108863}return l!==0&&(this.words[d]=l,this.length++),this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var l=S(s);if(l.length===0)return new i(1);for(var d=this,f=0;f<l.length&&l[f]===0;f++,d=d.sqr());if(++f<l.length)for(var p=d.sqr();f<l.length;f++,p=p.sqr())l[f]!==0&&(d=d.mul(p));return d},i.prototype.iushln=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=67108863>>>26-l<<26-l,p;if(l!==0){var g=0;for(p=0;p<this.length;p++){var b=this.words[p]&f,h=(this.words[p]|0)-b<<l;this.words[p]=h|g,g=b>>>26-l}g&&(this.words[p]=g,this.length++)}if(d!==0){for(p=this.length-1;p>=0;p--)this.words[p+d]=this.words[p];for(p=0;p<d;p++)this.words[p]=0;this.length+=d}return this.strip()},i.prototype.ishln=function(s){return r(this.negative===0),this.iushln(s)},i.prototype.iushrn=function(s,l,d){r(typeof s=="number"&&s>=0);var f;l?f=(l-l%26)/26:f=0;var p=s%26,g=Math.min((s-p)/26,this.length),b=67108863^67108863>>>p<<p,h=d;if(f-=g,f=Math.max(0,f),h){for(var u=0;u<g;u++)h.words[u]=this.words[u];h.length=g}if(g!==0)if(this.length>g)for(this.length-=g,u=0;u<this.length;u++)this.words[u]=this.words[u+g];else this.words[0]=0,this.length=1;var _=0;for(u=this.length-1;u>=0&&(_!==0||u>=f);u--){var A=this.words[u]|0;this.words[u]=_<<26-p|A>>>p,_=A&b}return h&&_!==0&&(h.words[h.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(s,l,d){return r(this.negative===0),this.iushrn(s,l,d)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return!1;var p=this.words[d];return!!(p&f)},i.prototype.imaskn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(l!==0&&d++,this.length=Math.min(d,this.length),l!==0){var f=67108863^67108863>>>l<<l;this.words[this.length-1]&=f}return this.strip()},i.prototype.maskn=function(s){return this.clone().imaskn(s)},i.prototype.iaddn=function(s){return r(typeof s=="number"),r(s<67108864),s<0?this.isubn(-s):this.negative!==0?this.length===1&&(this.words[0]|0)<s?(this.words[0]=s-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(s),this.negative=1,this):this._iaddn(s)},i.prototype._iaddn=function(s){this.words[0]+=s;for(var l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},i.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+1]-=1;return this.strip()},i.prototype.addn=function(s){return this.clone().iaddn(s)},i.prototype.subn=function(s){return this.clone().isubn(s)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(s,l,d){var f=s.length+d,p;this._expand(f);var g,b=0;for(p=0;p<s.length;p++){g=(this.words[p+d]|0)+b;var h=(s.words[p]|0)*l;g-=h&67108863,b=(g>>26)-(h/67108864|0),this.words[p+d]=g&67108863}for(;p<this.length-d;p++)g=(this.words[p+d]|0)+b,b=g>>26,this.words[p+d]=g&67108863;if(b===0)return this.strip();for(r(b===-1),b=0,p=0;p<this.length;p++)g=-(this.words[p]|0)+b,b=g>>26,this.words[p]=g&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(s,l){var d=this.length-s.length,f=this.clone(),p=s,g=p.words[p.length-1]|0,b=this._countBits(g);d=26-b,d!==0&&(p=p.ushln(d),f.iushln(d),g=p.words[p.length-1]|0);var h=f.length-p.length,u;if(l!=="mod"){u=new i(null),u.length=h+1,u.words=new Array(u.length);for(var _=0;_<u.length;_++)u.words[_]=0}var A=f.clone()._ishlnsubmul(p,1,h);A.negative===0&&(f=A,u&&(u.words[h]=1));for(var x=h-1;x>=0;x--){var I=(f.words[p.length+x]|0)*67108864+(f.words[p.length+x-1]|0);for(I=Math.min(I/g|0,67108863),f._ishlnsubmul(p,I,x);f.negative!==0;)I--,f.negative=0,f._ishlnsubmul(p,1,x),f.isZero()||(f.negative^=1);u&&(u.words[x]=I)}return u&&u.strip(),f.strip(),l!=="div"&&d!==0&&f.iushrn(d),{div:u||null,mod:f}},i.prototype.divmod=function(s,l,d){if(r(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var f,p,g;return this.negative!==0&&s.negative===0?(g=this.neg().divmod(s,l),l!=="mod"&&(f=g.div.neg()),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.iadd(s)),{div:f,mod:p}):this.negative===0&&s.negative!==0?(g=this.divmod(s.neg(),l),l!=="mod"&&(f=g.div.neg()),{div:f,mod:g.mod}):(this.negative&s.negative)!==0?(g=this.neg().divmod(s.neg(),l),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.isub(s)),{div:g.div,mod:p}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new i(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modn(s.words[0]))}:this._wordDiv(s,l)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var d=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),p=s.andln(1),g=d.cmp(f);return g<0||p===1&&g===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,d=0,f=this.length-1;f>=0;f--)d=(l*d+(this.words[f]|0))%s;return d},i.prototype.idivn=function(s){r(s<=67108863);for(var l=0,d=this.length-1;d>=0;d--){var f=(this.words[d]|0)+l*67108864;this.words[d]=f/s|0,l=f%s}return this.strip()},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=new i(0),b=new i(1),h=0;l.isEven()&&d.isEven();)l.iushrn(1),d.iushrn(1),++h;for(var u=d.clone(),_=l.clone();!l.isZero();){for(var A=0,x=1;(l.words[0]&x)===0&&A<26;++A,x<<=1);if(A>0)for(l.iushrn(A);A-- >0;)(f.isOdd()||p.isOdd())&&(f.iadd(u),p.isub(_)),f.iushrn(1),p.iushrn(1);for(var I=0,j=1;(d.words[0]&j)===0&&I<26;++I,j<<=1);if(I>0)for(d.iushrn(I);I-- >0;)(g.isOdd()||b.isOdd())&&(g.iadd(u),b.isub(_)),g.iushrn(1),b.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(g),p.isub(b)):(d.isub(l),g.isub(f),b.isub(p))}return{a:g,b,gcd:d.iushln(h)}},i.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=d.clone();l.cmpn(1)>0&&d.cmpn(1)>0;){for(var b=0,h=1;(l.words[0]&h)===0&&b<26;++b,h<<=1);if(b>0)for(l.iushrn(b);b-- >0;)f.isOdd()&&f.iadd(g),f.iushrn(1);for(var u=0,_=1;(d.words[0]&_)===0&&u<26;++u,_<<=1);if(u>0)for(d.iushrn(u);u-- >0;)p.isOdd()&&p.iadd(g),p.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(p)):(d.isub(l),p.isub(f))}var A;return l.cmpn(1)===0?A=f:A=p,A.cmpn(0)<0&&A.iadd(s),A},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),d=s.clone();l.negative=0,d.negative=0;for(var f=0;l.isEven()&&d.isEven();f++)l.iushrn(1),d.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;d.isEven();)d.iushrn(1);var p=l.cmp(d);if(p<0){var g=l;l=d,d=g}else if(p===0||d.cmpn(1)===0)break;l.isub(d)}while(!0);return d.iushln(f)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return this._expand(d+1),this.words[d]|=f,this;for(var p=f,g=d;p!==0&&g<this.length;g++){var b=this.words[g]|0;b+=p,p=b>>>26,b&=67108863,this.words[g]=b}return p!==0&&(this.words[g]=p,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var d;if(this.length>1)d=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;d=f===s?0:f<s?-1:1}return this.negative!==0?-d|0:d},i.prototype.cmp=function(s){if(this.negative!==0&&s.negative===0)return-1;if(this.negative===0&&s.negative!==0)return 1;var l=this.ucmp(s);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(s){if(this.length>s.length)return 1;if(this.length<s.length)return-1;for(var l=0,d=this.length-1;d>=0;d--){var f=this.words[d]|0,p=s.words[d]|0;if(f!==p){f<p?l=-1:f>p&&(l=1);break}}return l},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new V(s)},i.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var H={k256:null,p224:null,p192:null,p25519:null};function D(m,s){this.name=m,this.p=new i(s,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},D.prototype.ireduce=function(s){var l=s,d;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),d=l.bitLength();while(d>this.n);var f=d<this.n?-1:l.ucmp(this.p);return f===0?(l.words[0]=0,l.length=1):f>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},D.prototype.split=function(s,l){s.iushrn(this.n,0,l)},D.prototype.imulK=function(s){return s.imul(this.k)};function ee(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(ee,D),ee.prototype.split=function(s,l){for(var d=4194303,f=Math.min(s.length,9),p=0;p<f;p++)l.words[p]=s.words[p];if(l.length=f,s.length<=9){s.words[0]=0,s.length=1;return}var g=s.words[9];for(l.words[l.length++]=g&d,p=10;p<s.length;p++){var b=s.words[p]|0;s.words[p-10]=(b&d)<<4|g>>>22,g=b}g>>>=22,s.words[p-10]=g,g===0&&s.length>10?s.length-=10:s.length-=9},ee.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,d=0;d<s.length;d++){var f=s.words[d]|0;l+=f*977,s.words[d]=l&67108863,l=f*64+(l/67108864|0)}return s.words[s.length-1]===0&&(s.length--,s.words[s.length-1]===0&&s.length--),s};function ge(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ge,D);function K(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(K,D);function X(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(X,D),X.prototype.imulK=function(s){for(var l=0,d=0;d<s.length;d++){var f=(s.words[d]|0)*19+l,p=f&67108863;f>>>=26,s.words[d]=p,l=f}return l!==0&&(s.words[s.length++]=l),s},i._prime=function(s){if(H[s])return H[s];var l;if(s==="k256")l=new ee;else if(s==="p224")l=new ge;else if(s==="p192")l=new K;else if(s==="p25519")l=new X;else throw new Error("Unknown prime "+s);return H[s]=l,l};function V(m){if(typeof m=="string"){var s=i._prime(m);this.m=s.p,this.prime=s}else r(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}V.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},V.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},V.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},V.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},V.prototype.add=function(s,l){this._verify2(s,l);var d=s.add(l);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},V.prototype.iadd=function(s,l){this._verify2(s,l);var d=s.iadd(l);return d.cmp(this.m)>=0&&d.isub(this.m),d},V.prototype.sub=function(s,l){this._verify2(s,l);var d=s.sub(l);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},V.prototype.isub=function(s,l){this._verify2(s,l);var d=s.isub(l);return d.cmpn(0)<0&&d.iadd(this.m),d},V.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},V.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},V.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},V.prototype.isqr=function(s){return this.imul(s,s.clone())},V.prototype.sqr=function(s){return this.mul(s,s)},V.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var d=this.m.add(new i(1)).iushrn(2);return this.pow(s,d)}for(var f=this.m.subn(1),p=0;!f.isZero()&&f.andln(1)===0;)p++,f.iushrn(1);r(!f.isZero());var g=new i(1).toRed(this),b=g.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);this.pow(u,h).cmp(b)!==0;)u.redIAdd(b);for(var _=this.pow(u,f),A=this.pow(s,f.addn(1).iushrn(1)),x=this.pow(s,f),I=p;x.cmp(g)!==0;){for(var j=x,O=0;j.cmp(g)!==0;O++)j=j.redSqr();r(O<I);var L=this.pow(_,new i(1).iushln(I-O-1));A=A.redMul(L),_=L.redSqr(),x=x.redMul(_),I=O}return A},V.prototype.invm=function(s){var l=s._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},V.prototype.pow=function(s,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return s.clone();var d=4,f=new Array(1<<d);f[0]=new i(1).toRed(this),f[1]=s;for(var p=2;p<f.length;p++)f[p]=this.mul(f[p-1],s);var g=f[0],b=0,h=0,u=l.bitLength()%26;for(u===0&&(u=26),p=l.length-1;p>=0;p--){for(var _=l.words[p],A=u-1;A>=0;A--){var x=_>>A&1;if(g!==f[0]&&(g=this.sqr(g)),x===0&&b===0){h=0;continue}b<<=1,b|=x,h++,!(h!==d&&(p!==0||A!==0))&&(g=this.mul(g,f[b]),h=0,b=0)}u=26}return g},V.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},V.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},i.mont=function(s){return new T(s)};function T(m){V.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(T,V),T.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},T.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},T.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var d=s.imul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},T.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new i(0)._forceRed(this);var d=s.mul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},T.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof Z2>"u"||Z2,KT)});var ZT=E(dh=>{"use strict";var eu=Y2(),Aoe=_1().ec,J2=new Aoe("secp256k1"),Bf=J2.curve;dh.privateKeyExport=function(e,t){var r=new eu(e);if(r.ucmp(Bf.n)>=0)throw new Error("couldn't export to DER format");var n=J2.g.mul(r);return GT(n.getX(),n.getY(),t)};dh.privateKeyModInverse=function(e){var t=new eu(e);if(t.ucmp(Bf.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(Bf.n).toArrayLike(Buffer,"be",32)};dh.signatureImport=function(e){var t=new eu(e.r);t.ucmp(Bf.n)>=0&&(t=new eu(0));var r=new eu(e.s);return r.ucmp(Bf.n)>=0&&(r=new eu(0)),Buffer.concat([t.toArrayLike(Buffer,"be",32),r.toArrayLike(Buffer,"be",32)])};dh.ecdhUnsafe=function(e,t,r){var n=J2.keyFromPublic(e),i=new eu(t);if(i.ucmp(Bf.n)>=0||i.isZero())throw new Error("scalar was invalid (zero or overflow)");var o=n.pub.mul(i);return GT(o.getX(),o.getY(),r)};var GT=function(t,r,n){var i=void 0;return n?(i=Buffer.alloc(33),i[0]=r.isOdd()?3:2,t.toArrayLike(Buffer,"be",32).copy(i,1)):(i=Buffer.alloc(65),i[0]=4,t.toArrayLike(Buffer,"be",32).copy(i,1),r.toArrayLike(Buffer,"be",32).copy(i,33)),i}});var YT=E(M1=>{"use strict";var Ooe=Buffer.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Roe=Buffer.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);M1.privateKeyExport=function(e,t,r){var n=Buffer.from(r?Ooe:Roe);return e.copy(n,r?8:9),t.copy(n,r?181:214),n};M1.privateKeyImport=function(e){var t=e.length,r=0;if(t<r+1||e[r]!==48||(r+=1,t<r+1||!(e[r]&128)))return null;var n=e[r]&127;if(r+=1,n<1||n>2||t<r+n)return null;var i=e[r+n-1]|(n>1?e[r+n-2]<<8:0);return r+=n,t<r+i||t<r+3||e[r]!==2||e[r+1]!==1||e[r+2]!==1||(r+=3,t<r+2||e[r]!==4||e[r+1]>32||t<r+2+e[r+1])?null:e.slice(r+2,r+2+e[r+1])};M1.signatureImportLax=function(e){var t=Buffer.alloc(32,0),r=Buffer.alloc(32,0),n=e.length,i=0;if(e[i++]!==48)return null;var o=e[i++];if(o&128&&(i+=o-128,i>n)||e[i++]!==2)return null;var a=e[i++];if(a&128){if(o=a-128,i+o>n)return null;for(;o>0&&e[i]===0;i+=1,o-=1);for(a=0;o>0;i+=1,o-=1)a=(a<<8)+e[i]}if(a>n-i)return null;var c=i;if(i+=a,e[i++]!==2)return null;var v=e[i++];if(v&128){if(o=v-128,i+o>n)return null;for(;o>0&&e[i]===0;i+=1,o-=1);for(v=0;o>0;i+=1,o-=1)v=(v<<8)+e[i]}if(v>n-i)return null;var y=i;for(i+=v;a>0&&e[c]===0;a-=1,c+=1);if(a>32)return null;var w=e.slice(c,c+a);for(w.copy(t,32-w.length);v>0&&e[y]===0;v-=1,y+=1);if(v>32)return null;var M=e.slice(y,y+v);return M.copy(r,32-M.length),{r:t,s:r}}});var XT=E((GPe,QT)=>{"use strict";var nn=G2(),S1=ZT(),Q2=YT(),JT=function(t){return t.length!==32?!1:nn.privateKeyVerify(Uint8Array.from(t))},Ioe=function(t,r){if(t.length!==32)throw new RangeError("private key length is invalid");var n=S1.privateKeyExport(t,r);return Q2.privateKeyExport(t,n,r)},Coe=function(t){if(t=Q2.privateKeyImport(t),t!==null&&t.length===32&&JT(t))return t;throw new Error("couldn't import from DER format")},Toe=function(t){return Buffer.from(nn.privateKeyNegate(Uint8Array.from(t)))},koe=function(t){if(t.length!==32)throw new Error("private key length is invalid");return Buffer.from(S1.privateKeyModInverse(Uint8Array.from(t)))},Poe=function(t,r){return Buffer.from(nn.privateKeyTweakAdd(Uint8Array.from(t),r))},Noe=function(t,r){return Buffer.from(nn.privateKeyTweakMul(Uint8Array.from(t),Uint8Array.from(r)))},qoe=function(t,r){return Buffer.from(nn.publicKeyCreate(Uint8Array.from(t),r))},Loe=function(t,r){return Buffer.from(nn.publicKeyConvert(Uint8Array.from(t),r))},Boe=function(t){return t.length!==33&&t.length!==65?!1:nn.publicKeyVerify(Uint8Array.from(t))},Doe=function(t,r,n){return Buffer.from(nn.publicKeyTweakAdd(Uint8Array.from(t),Uint8Array.from(r),n))},joe=function(t,r,n){return Buffer.from(nn.publicKeyTweakMul(Uint8Array.from(t),Uint8Array.from(r),n))},Foe=function(t,r){var n=[];return t.forEach(function(i){n.push(Uint8Array.from(i))}),Buffer.from(nn.publicKeyCombine(n,r))},Uoe=function(t){return Buffer.from(nn.signatureNormalize(Uint8Array.from(t)))},Hoe=function(t){return Buffer.from(nn.signatureExport(Uint8Array.from(t)))},Woe=function(t){return Buffer.from(nn.signatureImport(Uint8Array.from(t)))},zoe=function(t){if(t.length===0)throw new RangeError("signature length is invalid");var r=Q2.signatureImportLax(t);if(r===null)throw new Error("couldn't parse DER signature");return S1.signatureImport(r)},Voe=function(t,r,n){if(n===null)throw new TypeError("options should be an Object");var i=void 0;if(n){if(i={},n.data===null)throw new TypeError("options.data should be a Buffer");if(n.data){if(n.data.length!==32)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(n.data)}if(n.noncefn===null)throw new TypeError("options.noncefn should be a Function");n.noncefn&&(i.noncefn=function(a,c,v,y,w){var M=v!=null?Buffer.from(v):null,S=y!=null?Buffer.from(y):null,R=Buffer.from("");return n.noncefn&&(R=n.noncefn(Buffer.from(a),Buffer.from(c),M,S,w)),Uint8Array.from(R)})}var o=nn.ecdsaSign(Uint8Array.from(t),Uint8Array.from(r),i);return{signature:Buffer.from(o.signature),recovery:o.recid}},$oe=function(t,r,n){return nn.ecdsaVerify(Uint8Array.from(r),Uint8Array.from(t),n)},Koe=function(t,r,n,i){return Buffer.from(nn.ecdsaRecover(Uint8Array.from(r),n,Uint8Array.from(t),i))},Goe=function(t,r){return Buffer.from(nn.ecdh(Uint8Array.from(t),Uint8Array.from(r),{}))},Zoe=function(t,r,n){if(t.length!==33&&t.length!==65)throw new RangeError("public key length is invalid");if(r.length!==32)throw new RangeError("private key length is invalid");return Buffer.from(S1.ecdhUnsafe(Uint8Array.from(t),Uint8Array.from(r),n))};QT.exports={privateKeyVerify:JT,privateKeyExport:Ioe,privateKeyImport:Coe,privateKeyNegate:Toe,privateKeyModInverse:koe,privateKeyTweakAdd:Poe,privateKeyTweakMul:Noe,publicKeyCreate:qoe,publicKeyConvert:Loe,publicKeyVerify:Boe,publicKeyTweakAdd:Doe,publicKeyTweakMul:joe,publicKeyCombine:Foe,signatureNormalize:Uoe,signatureExport:Hoe,signatureImport:Woe,signatureImportLax:zoe,sign:Voe,verify:$oe,recover:Koe,ecdh:Goe,ecdhUnsafe:Zoe}});var vk={};Mr(vk,{AssertionError:()=>E1,assert:()=>A1,deepEqual:()=>rx,deepStrictEqual:()=>nx,default:()=>Joe,doesNotThrow:()=>dk,equal:()=>ex,fail:()=>Tn,ifError:()=>pk,notDeepEqual:()=>ix,notDeepStrictEqual:()=>ox,notEqual:()=>tx,notStrictEqual:()=>ax,ok:()=>A1,strictEqual:()=>sx,throws:()=>hk});function ek(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function fk(){return typeof X2<"u"?X2:X2=function(){return function(){}.name==="foo"}()}function nk(e){return Object.prototype.toString.call(e)}function ik(e){return Qi(e)||typeof globalThis.ArrayBuffer!="function"?!1:typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e?!!(e instanceof DataView||e.buffer&&e.buffer instanceof ArrayBuffer):!1}function kn(e,t){e||Tn(e,!0,t,"==",A1)}function ck(e){if(!!ws(e)){if(fk())return e.name;var t=e.toString(),r=t.match(Qoe);return r&&r[1]}}function E1(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=Xoe(this),this.generatedMessage=!0);var t=e.stackStartFunction||Tn;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=ck(t),o=n.indexOf(`
536
+ `+i);if(o>=0){var a=n.indexOf(`
537
+ `,o+1);n=n.substring(a+1)}this.stack=n}}}function ok(e,t){return typeof e=="string"?e.length<t?e:e.slice(0,t):e}function sk(e){if(fk()||!ws(e))return di(e);var t=ck(e),r=t?": "+t:"";return"[Function"+r+"]"}function Xoe(e){return ok(sk(e.actual),128)+" "+e.operator+" "+ok(sk(e.expected),128)}function Tn(e,t,r,n,i){throw new E1({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function A1(e,t){e||Tn(e,!0,t,"==",A1)}function ex(e,t,r){e!=t&&Tn(e,t,r,"==",ex)}function tx(e,t,r){e==t&&Tn(e,t,r,"!=",tx)}function rx(e,t,r){Df(e,t,!1)||Tn(e,t,r,"deepEqual",rx)}function nx(e,t,r){Df(e,t,!0)||Tn(e,t,r,"deepStrictEqual",nx)}function Df(e,t,r,n){if(e===t)return!0;if(Qi(e)&&Qi(t))return ek(e,t)===0;if(Ra(e)&&Ra(t))return e.getTime()===t.getTime();if(_s(e)&&_s(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if((e===null||typeof e!="object")&&(t===null||typeof t!="object"))return r?e===t:e==t;if(ik(e)&&ik(t)&&nk(e)===nk(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return ek(new Uint8Array(e.buffer),new Uint8Array(t.buffer))===0;if(Qi(e)!==Qi(t))return!1;n=n||{actual:[],expected:[]};var i=n.actual.indexOf(e);return i!==-1&&i===n.expected.indexOf(t)?!0:(n.actual.push(e),n.expected.push(t),ese(e,t,r,n))}function ak(e){return Object.prototype.toString.call(e)=="[object Arguments]"}function ese(e,t,r,n){if(e==null||t===null||t===void 0)return!1;if($l(e)||$l(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=ak(e),o=ak(t);if(i&&!o||!i&&o)return!1;if(i)return e=rk.call(e),t=rk.call(t),Df(e,t,r);var a=tk(e),c=tk(t),v,y;if(a.length!==c.length)return!1;for(a.sort(),c.sort(),y=a.length-1;y>=0;y--)if(a[y]!==c[y])return!1;for(y=a.length-1;y>=0;y--)if(v=a[y],!Df(e[v],t[v],r,n))return!1;return!0}function ix(e,t,r){Df(e,t,!1)&&Tn(e,t,r,"notDeepEqual",ix)}function ox(e,t,r){Df(e,t,!0)&&Tn(e,t,r,"notDeepStrictEqual",ox)}function sx(e,t,r){e!==t&&Tn(e,t,r,"===",sx)}function ax(e,t,r){e===t&&Tn(e,t,r,"!==",ax)}function uk(e,t){if(!e||!t)return!1;if(Object.prototype.toString.call(t)=="[object RegExp]")return t.test(e);try{if(e instanceof t)return!0}catch{}return Error.isPrototypeOf(t)?!1:t.call({},e)===!0}function tse(e){var t;try{e()}catch(r){t=r}return t}function lk(e,t,r,n){var i;if(typeof t!="function")throw new TypeError('"block" argument must be a function');typeof r=="string"&&(n=r,r=null),i=tse(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&Tn(i,r,"Missing expected exception"+n);var o=typeof n=="string",a=!e&&Oa(i),c=!e&&i&&!r;if((a&&o&&uk(i,r)||c)&&Tn(i,r,"Got unwanted exception"+n),e&&i&&r&&!uk(i,r)||!e&&i)throw i}function hk(e,t,r){lk(!0,e,t,r)}function dk(e,t,r){lk(!1,e,t,r)}function pk(e){if(e)throw e}var Yoe,tk,rk,X2,Joe,Qoe,mk=yt(()=>{da();pi();Yoe=Object.prototype.hasOwnProperty,tk=Object.keys||function(e){var t=[];for(var r in e)Yoe.call(e,r)&&t.push(r);return t},rk=Array.prototype.slice;Joe=kn,Qoe=/\s*function\s+([^\(\s]*)\s*/;kn.AssertionError=E1;Cr(E1,Error);kn.fail=Tn;kn.ok=A1;kn.equal=ex;kn.notEqual=tx;kn.deepEqual=rx;kn.deepStrictEqual=nx;kn.notDeepEqual=ix;kn.notDeepStrictEqual=ox;kn.strictEqual=sx;kn.notStrictEqual=ax;kn.throws=hk;kn.doesNotThrow=dk;kn.ifError=pk});var R1=E((JPe,O1)=>{var tu=(mk(),Pt(vk));if(tu&&tu.default){O1.exports=tu.default;for(let e in tu)O1.exports[e]=tu[e]}else tu&&(O1.exports=tu)});var jf=E((gk,ux)=>{(function(e,t){"use strict";function r(d,f){if(!d)throw new Error(f||"Assertion failed")}function n(d,f){d.super_=f;var p=function(){};p.prototype=f.prototype,d.prototype=new p,d.prototype.constructor=d}function i(d,f,p){if(i.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((f==="le"||f==="be")&&(p=f,f=10),this._init(d||0,f||10,p||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=fi().Buffer}catch{}i.isBN=function(f){return f instanceof i?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===i.wordSize&&Array.isArray(f.words)},i.max=function(f,p){return f.cmp(p)>0?f:p},i.min=function(f,p){return f.cmp(p)<0?f:p},i.prototype._init=function(f,p,g){if(typeof f=="number")return this._initNumber(f,p,g);if(typeof f=="object")return this._initArray(f,p,g);p==="hex"&&(p=16),r(p===(p|0)&&p>=2&&p<=36),f=f.toString().replace(/\s+/g,"");var b=0;f[0]==="-"&&(b++,this.negative=1),b<f.length&&(p===16?this._parseHex(f,b,g):(this._parseBase(f,p,b),g==="le"&&this._initArray(this.toArray(),p,g)))},i.prototype._initNumber=function(f,p,g){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),g==="le"&&this._initArray(this.toArray(),p,g)},i.prototype._initArray=function(f,p,g){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var b=0;b<this.length;b++)this.words[b]=0;var h,u,_=0;if(g==="be")for(b=f.length-1,h=0;b>=0;b-=3)u=f[b]|f[b-1]<<8|f[b-2]<<16,this.words[h]|=u<<_&67108863,this.words[h+1]=u>>>26-_&67108863,_+=24,_>=26&&(_-=26,h++);else if(g==="le")for(b=0,h=0;b<f.length;b+=3)u=f[b]|f[b+1]<<8|f[b+2]<<16,this.words[h]|=u<<_&67108863,this.words[h+1]=u>>>26-_&67108863,_+=24,_>=26&&(_-=26,h++);return this._strip()};function a(d,f){var p=d.charCodeAt(f);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;r(!1,"Invalid character in "+d)}function c(d,f,p){var g=a(d,p);return p-1>=f&&(g|=a(d,p-1)<<4),g}i.prototype._parseHex=function(f,p,g){this.length=Math.ceil((f.length-p)/6),this.words=new Array(this.length);for(var b=0;b<this.length;b++)this.words[b]=0;var h=0,u=0,_;if(g==="be")for(b=f.length-1;b>=p;b-=2)_=c(f,p,b)<<h,this.words[u]|=_&67108863,h>=18?(h-=18,u+=1,this.words[u]|=_>>>26):h+=8;else{var A=f.length-p;for(b=A%2===0?p+1:p;b<f.length;b+=2)_=c(f,p,b)<<h,this.words[u]|=_&67108863,h>=18?(h-=18,u+=1,this.words[u]|=_>>>26):h+=8}this._strip()};function v(d,f,p,g){for(var b=0,h=0,u=Math.min(d.length,p),_=f;_<u;_++){var A=d.charCodeAt(_)-48;b*=g,A>=49?h=A-49+10:A>=17?h=A-17+10:h=A,r(A>=0&&h<g,"Invalid character"),b+=h}return b}i.prototype._parseBase=function(f,p,g){this.words=[0],this.length=1;for(var b=0,h=1;h<=67108863;h*=p)b++;b--,h=h/p|0;for(var u=f.length-g,_=u%b,A=Math.min(u,u-_)+g,x=0,I=g;I<A;I+=b)x=v(f,I,I+b,p),this.imuln(h),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x);if(_!==0){var j=1;for(x=v(f,I,f.length,p),I=0;I<_;I++)j*=p;this.imuln(j),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x)}this._strip()},i.prototype.copy=function(f){f.words=new Array(this.length);for(var p=0;p<this.length;p++)f.words[p]=this.words[p];f.length=this.length,f.negative=this.negative,f.red=this.red};function y(d,f){d.words=f.words,d.length=f.length,d.negative=f.negative,d.red=f.red}if(i.prototype._move=function(f){y(f,this)},i.prototype.clone=function(){var f=new i(null);return this.copy(f),f},i.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=w}catch{i.prototype.inspect=w}else i.prototype.inspect=w;function w(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],R=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(f,p){f=f||10,p=p|0||1;var g;if(f===16||f==="hex"){g="";for(var b=0,h=0,u=0;u<this.length;u++){var _=this.words[u],A=((_<<b|h)&16777215).toString(16);h=_>>>24-b&16777215,b+=2,b>=26&&(b-=26,u--),h!==0||u!==this.length-1?g=M[6-A.length]+A+g:g=A+g}for(h!==0&&(g=h.toString(16)+g);g.length%p!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(f===(f|0)&&f>=2&&f<=36){var x=S[f],I=R[f];g="";var j=this.clone();for(j.negative=0;!j.isZero();){var O=j.modrn(I).toString(f);j=j.idivn(I),j.isZero()?g=O+g:g=M[x-O.length]+O+g}for(this.isZero()&&(g="0"+g);g.length%p!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(f,p){return this.toArrayLike(o,f,p)}),i.prototype.toArray=function(f,p){return this.toArrayLike(Array,f,p)};var C=function(f,p){return f.allocUnsafe?f.allocUnsafe(p):new f(p)};i.prototype.toArrayLike=function(f,p,g){this._strip();var b=this.byteLength(),h=g||Math.max(1,b);r(b<=h,"byte array longer than desired length"),r(h>0,"Requested array length <= 0");var u=C(f,h),_=p==="le"?"LE":"BE";return this["_toArrayLike"+_](u,b),u},i.prototype._toArrayLikeLE=function(f,p){for(var g=0,b=0,h=0,u=0;h<this.length;h++){var _=this.words[h]<<u|b;f[g++]=_&255,g<f.length&&(f[g++]=_>>8&255),g<f.length&&(f[g++]=_>>16&255),u===6?(g<f.length&&(f[g++]=_>>24&255),b=0,u=0):(b=_>>>24,u+=2)}if(g<f.length)for(f[g++]=b;g<f.length;)f[g++]=0},i.prototype._toArrayLikeBE=function(f,p){for(var g=f.length-1,b=0,h=0,u=0;h<this.length;h++){var _=this.words[h]<<u|b;f[g--]=_&255,g>=0&&(f[g--]=_>>8&255),g>=0&&(f[g--]=_>>16&255),u===6?(g>=0&&(f[g--]=_>>24&255),b=0,u=0):(b=_>>>24,u+=2)}if(g>=0)for(f[g--]=b;g>=0;)f[g--]=0},Math.clz32?i.prototype._countBits=function(f){return 32-Math.clz32(f)}:i.prototype._countBits=function(f){var p=f,g=0;return p>=4096&&(g+=13,p>>>=13),p>=64&&(g+=7,p>>>=7),p>=8&&(g+=4,p>>>=4),p>=2&&(g+=2,p>>>=2),g+p},i.prototype._zeroBits=function(f){if(f===0)return 26;var p=f,g=0;return(p&8191)===0&&(g+=13,p>>>=13),(p&127)===0&&(g+=7,p>>>=7),(p&15)===0&&(g+=4,p>>>=4),(p&3)===0&&(g+=2,p>>>=2),(p&1)===0&&g++,g},i.prototype.bitLength=function(){var f=this.words[this.length-1],p=this._countBits(f);return(this.length-1)*26+p};function B(d){for(var f=new Array(d.bitLength()),p=0;p<f.length;p++){var g=p/26|0,b=p%26;f[p]=d.words[g]>>>b&1}return f}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,p=0;p<this.length;p++){var g=this._zeroBits(this.words[p]);if(f+=g,g!==26)break}return f},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},i.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var p=0;p<f.length;p++)this.words[p]=this.words[p]|f.words[p];return this._strip()},i.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},i.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},i.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},i.prototype.iuand=function(f){var p;this.length>f.length?p=f:p=this;for(var g=0;g<p.length;g++)this.words[g]=this.words[g]&f.words[g];return this.length=p.length,this._strip()},i.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},i.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},i.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},i.prototype.iuxor=function(f){var p,g;this.length>f.length?(p=this,g=f):(p=f,g=this);for(var b=0;b<g.length;b++)this.words[b]=p.words[b]^g.words[b];if(this!==p)for(;b<p.length;b++)this.words[b]=p.words[b];return this.length=p.length,this._strip()},i.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},i.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},i.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},i.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var p=Math.ceil(f/26)|0,g=f%26;this._expand(p),g>0&&p--;for(var b=0;b<p;b++)this.words[b]=~this.words[b]&67108863;return g>0&&(this.words[b]=~this.words[b]&67108863>>26-g),this._strip()},i.prototype.notn=function(f){return this.clone().inotn(f)},i.prototype.setn=function(f,p){r(typeof f=="number"&&f>=0);var g=f/26|0,b=f%26;return this._expand(g+1),p?this.words[g]=this.words[g]|1<<b:this.words[g]=this.words[g]&~(1<<b),this._strip()},i.prototype.iadd=function(f){var p;if(this.negative!==0&&f.negative===0)return this.negative=0,p=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,p=this.isub(f),f.negative=1,p._normSign();var g,b;this.length>f.length?(g=this,b=f):(g=f,b=this);for(var h=0,u=0;u<b.length;u++)p=(g.words[u]|0)+(b.words[u]|0)+h,this.words[u]=p&67108863,h=p>>>26;for(;h!==0&&u<g.length;u++)p=(g.words[u]|0)+h,this.words[u]=p&67108863,h=p>>>26;if(this.length=g.length,h!==0)this.words[this.length]=h,this.length++;else if(g!==this)for(;u<g.length;u++)this.words[u]=g.words[u];return this},i.prototype.add=function(f){var p;return f.negative!==0&&this.negative===0?(f.negative=0,p=this.sub(f),f.negative^=1,p):f.negative===0&&this.negative!==0?(this.negative=0,p=f.sub(this),this.negative=1,p):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},i.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var p=this.iadd(f);return f.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var g=this.cmp(f);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var b,h;g>0?(b=this,h=f):(b=f,h=this);for(var u=0,_=0;_<h.length;_++)p=(b.words[_]|0)-(h.words[_]|0)+u,u=p>>26,this.words[_]=p&67108863;for(;u!==0&&_<b.length;_++)p=(b.words[_]|0)+u,u=p>>26,this.words[_]=p&67108863;if(u===0&&_<b.length&&b!==this)for(;_<b.length;_++)this.words[_]=b.words[_];return this.length=Math.max(this.length,_),b!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(f){return this.clone().isub(f)};function N(d,f,p){p.negative=f.negative^d.negative;var g=d.length+f.length|0;p.length=g,g=g-1|0;var b=d.words[0]|0,h=f.words[0]|0,u=b*h,_=u&67108863,A=u/67108864|0;p.words[0]=_;for(var x=1;x<g;x++){for(var I=A>>>26,j=A&67108863,O=Math.min(x,f.length-1),L=Math.max(0,x-d.length+1);L<=O;L++){var W=x-L|0;b=d.words[W]|0,h=f.words[L]|0,u=b*h+j,I+=u/67108864|0,j=u&67108863}p.words[x]=j|0,A=I|0}return A!==0?p.words[x]=A|0:p.length--,p._strip()}var q=function(f,p,g){var b=f.words,h=p.words,u=g.words,_=0,A,x,I,j=b[0]|0,O=j&8191,L=j>>>13,W=b[1]|0,F=W&8191,G=W>>>13,De=b[2]|0,Y=De&8191,Q=De>>>13,Ve=b[3]|0,J=Ve&8191,be=Ve>>>13,Ke=b[4]|0,ye=Ke&8191,Re=Ke>>>13,et=b[5]|0,oe=et&8191,xe=et>>>13,it=b[6]|0,ce=it&8191,Ie=it>>>13,ft=b[7]|0,le=ft&8191,Ce=ft>>>13,ot=b[8]|0,se=ot&8191,Me=ot>>>13,st=b[9]|0,ae=st&8191,Se=st>>>13,at=h[0]|0,re=at&8191,Te=at>>>13,ct=h[1]|0,ne=ct&8191,Ee=ct>>>13,lt=h[2]|0,te=lt&8191,ke=lt>>>13,ht=h[3]|0,ue=ht&8191,Pe=ht>>>13,dt=h[4]|0,he=dt&8191,Ne=dt>>>13,pt=h[5]|0,de=pt&8191,qe=pt>>>13,vt=h[6]|0,pe=vt&8191,Le=vt>>>13,ut=h[7]|0,ve=ut&8191,Be=ut>>>13,mt=h[8]|0,me=mt&8191,Ae=mt>>>13,$t=h[9]|0,Je=$t&8191,Qe=$t>>>13;g.negative=f.negative^p.negative,g.length=19,A=Math.imul(O,re),x=Math.imul(O,Te),x=x+Math.imul(L,re)|0,I=Math.imul(L,Te);var Lt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,A=Math.imul(F,re),x=Math.imul(F,Te),x=x+Math.imul(G,re)|0,I=Math.imul(G,Te),A=A+Math.imul(O,ne)|0,x=x+Math.imul(O,Ee)|0,x=x+Math.imul(L,ne)|0,I=I+Math.imul(L,Ee)|0;var Bt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,A=Math.imul(Y,re),x=Math.imul(Y,Te),x=x+Math.imul(Q,re)|0,I=Math.imul(Q,Te),A=A+Math.imul(F,ne)|0,x=x+Math.imul(F,Ee)|0,x=x+Math.imul(G,ne)|0,I=I+Math.imul(G,Ee)|0,A=A+Math.imul(O,te)|0,x=x+Math.imul(O,ke)|0,x=x+Math.imul(L,te)|0,I=I+Math.imul(L,ke)|0;var Dt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,A=Math.imul(J,re),x=Math.imul(J,Te),x=x+Math.imul(be,re)|0,I=Math.imul(be,Te),A=A+Math.imul(Y,ne)|0,x=x+Math.imul(Y,Ee)|0,x=x+Math.imul(Q,ne)|0,I=I+Math.imul(Q,Ee)|0,A=A+Math.imul(F,te)|0,x=x+Math.imul(F,ke)|0,x=x+Math.imul(G,te)|0,I=I+Math.imul(G,ke)|0,A=A+Math.imul(O,ue)|0,x=x+Math.imul(O,Pe)|0,x=x+Math.imul(L,ue)|0,I=I+Math.imul(L,Pe)|0;var jt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(jt>>>26)|0,jt&=67108863,A=Math.imul(ye,re),x=Math.imul(ye,Te),x=x+Math.imul(Re,re)|0,I=Math.imul(Re,Te),A=A+Math.imul(J,ne)|0,x=x+Math.imul(J,Ee)|0,x=x+Math.imul(be,ne)|0,I=I+Math.imul(be,Ee)|0,A=A+Math.imul(Y,te)|0,x=x+Math.imul(Y,ke)|0,x=x+Math.imul(Q,te)|0,I=I+Math.imul(Q,ke)|0,A=A+Math.imul(F,ue)|0,x=x+Math.imul(F,Pe)|0,x=x+Math.imul(G,ue)|0,I=I+Math.imul(G,Pe)|0,A=A+Math.imul(O,he)|0,x=x+Math.imul(O,Ne)|0,x=x+Math.imul(L,he)|0,I=I+Math.imul(L,Ne)|0;var Ft=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,A=Math.imul(oe,re),x=Math.imul(oe,Te),x=x+Math.imul(xe,re)|0,I=Math.imul(xe,Te),A=A+Math.imul(ye,ne)|0,x=x+Math.imul(ye,Ee)|0,x=x+Math.imul(Re,ne)|0,I=I+Math.imul(Re,Ee)|0,A=A+Math.imul(J,te)|0,x=x+Math.imul(J,ke)|0,x=x+Math.imul(be,te)|0,I=I+Math.imul(be,ke)|0,A=A+Math.imul(Y,ue)|0,x=x+Math.imul(Y,Pe)|0,x=x+Math.imul(Q,ue)|0,I=I+Math.imul(Q,Pe)|0,A=A+Math.imul(F,he)|0,x=x+Math.imul(F,Ne)|0,x=x+Math.imul(G,he)|0,I=I+Math.imul(G,Ne)|0,A=A+Math.imul(O,de)|0,x=x+Math.imul(O,qe)|0,x=x+Math.imul(L,de)|0,I=I+Math.imul(L,qe)|0;var lr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(lr>>>26)|0,lr&=67108863,A=Math.imul(ce,re),x=Math.imul(ce,Te),x=x+Math.imul(Ie,re)|0,I=Math.imul(Ie,Te),A=A+Math.imul(oe,ne)|0,x=x+Math.imul(oe,Ee)|0,x=x+Math.imul(xe,ne)|0,I=I+Math.imul(xe,Ee)|0,A=A+Math.imul(ye,te)|0,x=x+Math.imul(ye,ke)|0,x=x+Math.imul(Re,te)|0,I=I+Math.imul(Re,ke)|0,A=A+Math.imul(J,ue)|0,x=x+Math.imul(J,Pe)|0,x=x+Math.imul(be,ue)|0,I=I+Math.imul(be,Pe)|0,A=A+Math.imul(Y,he)|0,x=x+Math.imul(Y,Ne)|0,x=x+Math.imul(Q,he)|0,I=I+Math.imul(Q,Ne)|0,A=A+Math.imul(F,de)|0,x=x+Math.imul(F,qe)|0,x=x+Math.imul(G,de)|0,I=I+Math.imul(G,qe)|0,A=A+Math.imul(O,pe)|0,x=x+Math.imul(O,Le)|0,x=x+Math.imul(L,pe)|0,I=I+Math.imul(L,Le)|0;var hr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(hr>>>26)|0,hr&=67108863,A=Math.imul(le,re),x=Math.imul(le,Te),x=x+Math.imul(Ce,re)|0,I=Math.imul(Ce,Te),A=A+Math.imul(ce,ne)|0,x=x+Math.imul(ce,Ee)|0,x=x+Math.imul(Ie,ne)|0,I=I+Math.imul(Ie,Ee)|0,A=A+Math.imul(oe,te)|0,x=x+Math.imul(oe,ke)|0,x=x+Math.imul(xe,te)|0,I=I+Math.imul(xe,ke)|0,A=A+Math.imul(ye,ue)|0,x=x+Math.imul(ye,Pe)|0,x=x+Math.imul(Re,ue)|0,I=I+Math.imul(Re,Pe)|0,A=A+Math.imul(J,he)|0,x=x+Math.imul(J,Ne)|0,x=x+Math.imul(be,he)|0,I=I+Math.imul(be,Ne)|0,A=A+Math.imul(Y,de)|0,x=x+Math.imul(Y,qe)|0,x=x+Math.imul(Q,de)|0,I=I+Math.imul(Q,qe)|0,A=A+Math.imul(F,pe)|0,x=x+Math.imul(F,Le)|0,x=x+Math.imul(G,pe)|0,I=I+Math.imul(G,Le)|0,A=A+Math.imul(O,ve)|0,x=x+Math.imul(O,Be)|0,x=x+Math.imul(L,ve)|0,I=I+Math.imul(L,Be)|0;var or=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(or>>>26)|0,or&=67108863,A=Math.imul(se,re),x=Math.imul(se,Te),x=x+Math.imul(Me,re)|0,I=Math.imul(Me,Te),A=A+Math.imul(le,ne)|0,x=x+Math.imul(le,Ee)|0,x=x+Math.imul(Ce,ne)|0,I=I+Math.imul(Ce,Ee)|0,A=A+Math.imul(ce,te)|0,x=x+Math.imul(ce,ke)|0,x=x+Math.imul(Ie,te)|0,I=I+Math.imul(Ie,ke)|0,A=A+Math.imul(oe,ue)|0,x=x+Math.imul(oe,Pe)|0,x=x+Math.imul(xe,ue)|0,I=I+Math.imul(xe,Pe)|0,A=A+Math.imul(ye,he)|0,x=x+Math.imul(ye,Ne)|0,x=x+Math.imul(Re,he)|0,I=I+Math.imul(Re,Ne)|0,A=A+Math.imul(J,de)|0,x=x+Math.imul(J,qe)|0,x=x+Math.imul(be,de)|0,I=I+Math.imul(be,qe)|0,A=A+Math.imul(Y,pe)|0,x=x+Math.imul(Y,Le)|0,x=x+Math.imul(Q,pe)|0,I=I+Math.imul(Q,Le)|0,A=A+Math.imul(F,ve)|0,x=x+Math.imul(F,Be)|0,x=x+Math.imul(G,ve)|0,I=I+Math.imul(G,Be)|0,A=A+Math.imul(O,me)|0,x=x+Math.imul(O,Ae)|0,x=x+Math.imul(L,me)|0,I=I+Math.imul(L,Ae)|0;var Kt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,A=Math.imul(ae,re),x=Math.imul(ae,Te),x=x+Math.imul(Se,re)|0,I=Math.imul(Se,Te),A=A+Math.imul(se,ne)|0,x=x+Math.imul(se,Ee)|0,x=x+Math.imul(Me,ne)|0,I=I+Math.imul(Me,Ee)|0,A=A+Math.imul(le,te)|0,x=x+Math.imul(le,ke)|0,x=x+Math.imul(Ce,te)|0,I=I+Math.imul(Ce,ke)|0,A=A+Math.imul(ce,ue)|0,x=x+Math.imul(ce,Pe)|0,x=x+Math.imul(Ie,ue)|0,I=I+Math.imul(Ie,Pe)|0,A=A+Math.imul(oe,he)|0,x=x+Math.imul(oe,Ne)|0,x=x+Math.imul(xe,he)|0,I=I+Math.imul(xe,Ne)|0,A=A+Math.imul(ye,de)|0,x=x+Math.imul(ye,qe)|0,x=x+Math.imul(Re,de)|0,I=I+Math.imul(Re,qe)|0,A=A+Math.imul(J,pe)|0,x=x+Math.imul(J,Le)|0,x=x+Math.imul(be,pe)|0,I=I+Math.imul(be,Le)|0,A=A+Math.imul(Y,ve)|0,x=x+Math.imul(Y,Be)|0,x=x+Math.imul(Q,ve)|0,I=I+Math.imul(Q,Be)|0,A=A+Math.imul(F,me)|0,x=x+Math.imul(F,Ae)|0,x=x+Math.imul(G,me)|0,I=I+Math.imul(G,Ae)|0,A=A+Math.imul(O,Je)|0,x=x+Math.imul(O,Qe)|0,x=x+Math.imul(L,Je)|0,I=I+Math.imul(L,Qe)|0;var sr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(sr>>>26)|0,sr&=67108863,A=Math.imul(ae,ne),x=Math.imul(ae,Ee),x=x+Math.imul(Se,ne)|0,I=Math.imul(Se,Ee),A=A+Math.imul(se,te)|0,x=x+Math.imul(se,ke)|0,x=x+Math.imul(Me,te)|0,I=I+Math.imul(Me,ke)|0,A=A+Math.imul(le,ue)|0,x=x+Math.imul(le,Pe)|0,x=x+Math.imul(Ce,ue)|0,I=I+Math.imul(Ce,Pe)|0,A=A+Math.imul(ce,he)|0,x=x+Math.imul(ce,Ne)|0,x=x+Math.imul(Ie,he)|0,I=I+Math.imul(Ie,Ne)|0,A=A+Math.imul(oe,de)|0,x=x+Math.imul(oe,qe)|0,x=x+Math.imul(xe,de)|0,I=I+Math.imul(xe,qe)|0,A=A+Math.imul(ye,pe)|0,x=x+Math.imul(ye,Le)|0,x=x+Math.imul(Re,pe)|0,I=I+Math.imul(Re,Le)|0,A=A+Math.imul(J,ve)|0,x=x+Math.imul(J,Be)|0,x=x+Math.imul(be,ve)|0,I=I+Math.imul(be,Be)|0,A=A+Math.imul(Y,me)|0,x=x+Math.imul(Y,Ae)|0,x=x+Math.imul(Q,me)|0,I=I+Math.imul(Q,Ae)|0,A=A+Math.imul(F,Je)|0,x=x+Math.imul(F,Qe)|0,x=x+Math.imul(G,Je)|0,I=I+Math.imul(G,Qe)|0;var Ut=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,A=Math.imul(ae,te),x=Math.imul(ae,ke),x=x+Math.imul(Se,te)|0,I=Math.imul(Se,ke),A=A+Math.imul(se,ue)|0,x=x+Math.imul(se,Pe)|0,x=x+Math.imul(Me,ue)|0,I=I+Math.imul(Me,Pe)|0,A=A+Math.imul(le,he)|0,x=x+Math.imul(le,Ne)|0,x=x+Math.imul(Ce,he)|0,I=I+Math.imul(Ce,Ne)|0,A=A+Math.imul(ce,de)|0,x=x+Math.imul(ce,qe)|0,x=x+Math.imul(Ie,de)|0,I=I+Math.imul(Ie,qe)|0,A=A+Math.imul(oe,pe)|0,x=x+Math.imul(oe,Le)|0,x=x+Math.imul(xe,pe)|0,I=I+Math.imul(xe,Le)|0,A=A+Math.imul(ye,ve)|0,x=x+Math.imul(ye,Be)|0,x=x+Math.imul(Re,ve)|0,I=I+Math.imul(Re,Be)|0,A=A+Math.imul(J,me)|0,x=x+Math.imul(J,Ae)|0,x=x+Math.imul(be,me)|0,I=I+Math.imul(be,Ae)|0,A=A+Math.imul(Y,Je)|0,x=x+Math.imul(Y,Qe)|0,x=x+Math.imul(Q,Je)|0,I=I+Math.imul(Q,Qe)|0;var dr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(dr>>>26)|0,dr&=67108863,A=Math.imul(ae,ue),x=Math.imul(ae,Pe),x=x+Math.imul(Se,ue)|0,I=Math.imul(Se,Pe),A=A+Math.imul(se,he)|0,x=x+Math.imul(se,Ne)|0,x=x+Math.imul(Me,he)|0,I=I+Math.imul(Me,Ne)|0,A=A+Math.imul(le,de)|0,x=x+Math.imul(le,qe)|0,x=x+Math.imul(Ce,de)|0,I=I+Math.imul(Ce,qe)|0,A=A+Math.imul(ce,pe)|0,x=x+Math.imul(ce,Le)|0,x=x+Math.imul(Ie,pe)|0,I=I+Math.imul(Ie,Le)|0,A=A+Math.imul(oe,ve)|0,x=x+Math.imul(oe,Be)|0,x=x+Math.imul(xe,ve)|0,I=I+Math.imul(xe,Be)|0,A=A+Math.imul(ye,me)|0,x=x+Math.imul(ye,Ae)|0,x=x+Math.imul(Re,me)|0,I=I+Math.imul(Re,Ae)|0,A=A+Math.imul(J,Je)|0,x=x+Math.imul(J,Qe)|0,x=x+Math.imul(be,Je)|0,I=I+Math.imul(be,Qe)|0;var Jt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,A=Math.imul(ae,he),x=Math.imul(ae,Ne),x=x+Math.imul(Se,he)|0,I=Math.imul(Se,Ne),A=A+Math.imul(se,de)|0,x=x+Math.imul(se,qe)|0,x=x+Math.imul(Me,de)|0,I=I+Math.imul(Me,qe)|0,A=A+Math.imul(le,pe)|0,x=x+Math.imul(le,Le)|0,x=x+Math.imul(Ce,pe)|0,I=I+Math.imul(Ce,Le)|0,A=A+Math.imul(ce,ve)|0,x=x+Math.imul(ce,Be)|0,x=x+Math.imul(Ie,ve)|0,I=I+Math.imul(Ie,Be)|0,A=A+Math.imul(oe,me)|0,x=x+Math.imul(oe,Ae)|0,x=x+Math.imul(xe,me)|0,I=I+Math.imul(xe,Ae)|0,A=A+Math.imul(ye,Je)|0,x=x+Math.imul(ye,Qe)|0,x=x+Math.imul(Re,Je)|0,I=I+Math.imul(Re,Qe)|0;var tr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(tr>>>26)|0,tr&=67108863,A=Math.imul(ae,de),x=Math.imul(ae,qe),x=x+Math.imul(Se,de)|0,I=Math.imul(Se,qe),A=A+Math.imul(se,pe)|0,x=x+Math.imul(se,Le)|0,x=x+Math.imul(Me,pe)|0,I=I+Math.imul(Me,Le)|0,A=A+Math.imul(le,ve)|0,x=x+Math.imul(le,Be)|0,x=x+Math.imul(Ce,ve)|0,I=I+Math.imul(Ce,Be)|0,A=A+Math.imul(ce,me)|0,x=x+Math.imul(ce,Ae)|0,x=x+Math.imul(Ie,me)|0,I=I+Math.imul(Ie,Ae)|0,A=A+Math.imul(oe,Je)|0,x=x+Math.imul(oe,Qe)|0,x=x+Math.imul(xe,Je)|0,I=I+Math.imul(xe,Qe)|0;var Rr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,A=Math.imul(ae,pe),x=Math.imul(ae,Le),x=x+Math.imul(Se,pe)|0,I=Math.imul(Se,Le),A=A+Math.imul(se,ve)|0,x=x+Math.imul(se,Be)|0,x=x+Math.imul(Me,ve)|0,I=I+Math.imul(Me,Be)|0,A=A+Math.imul(le,me)|0,x=x+Math.imul(le,Ae)|0,x=x+Math.imul(Ce,me)|0,I=I+Math.imul(Ce,Ae)|0,A=A+Math.imul(ce,Je)|0,x=x+Math.imul(ce,Qe)|0,x=x+Math.imul(Ie,Je)|0,I=I+Math.imul(Ie,Qe)|0;var Qr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,A=Math.imul(ae,ve),x=Math.imul(ae,Be),x=x+Math.imul(Se,ve)|0,I=Math.imul(Se,Be),A=A+Math.imul(se,me)|0,x=x+Math.imul(se,Ae)|0,x=x+Math.imul(Me,me)|0,I=I+Math.imul(Me,Ae)|0,A=A+Math.imul(le,Je)|0,x=x+Math.imul(le,Qe)|0,x=x+Math.imul(Ce,Je)|0,I=I+Math.imul(Ce,Qe)|0;var ua=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(ua>>>26)|0,ua&=67108863,A=Math.imul(ae,me),x=Math.imul(ae,Ae),x=x+Math.imul(Se,me)|0,I=Math.imul(Se,Ae),A=A+Math.imul(se,Je)|0,x=x+Math.imul(se,Qe)|0,x=x+Math.imul(Me,Je)|0,I=I+Math.imul(Me,Qe)|0;var ll=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(ll>>>26)|0,ll&=67108863,A=Math.imul(ae,Je),x=Math.imul(ae,Qe),x=x+Math.imul(Se,Je)|0,I=Math.imul(Se,Qe);var hl=(_+A|0)+((x&8191)<<13)|0;return _=(I+(x>>>13)|0)+(hl>>>26)|0,hl&=67108863,u[0]=Lt,u[1]=Bt,u[2]=Dt,u[3]=jt,u[4]=Ft,u[5]=lr,u[6]=hr,u[7]=or,u[8]=Kt,u[9]=sr,u[10]=Ut,u[11]=dr,u[12]=Jt,u[13]=tr,u[14]=Rr,u[15]=Qr,u[16]=ua,u[17]=ll,u[18]=hl,_!==0&&(u[19]=_,g.length++),g};Math.imul||(q=N);function H(d,f,p){p.negative=f.negative^d.negative,p.length=d.length+f.length;for(var g=0,b=0,h=0;h<p.length-1;h++){var u=b;b=0;for(var _=g&67108863,A=Math.min(h,f.length-1),x=Math.max(0,h-d.length+1);x<=A;x++){var I=h-x,j=d.words[I]|0,O=f.words[x]|0,L=j*O,W=L&67108863;u=u+(L/67108864|0)|0,W=W+_|0,_=W&67108863,u=u+(W>>>26)|0,b+=u>>>26,u&=67108863}p.words[h]=_,g=u,u=b}return g!==0?p.words[h]=g:p.length--,p._strip()}function D(d,f,p){return H(d,f,p)}i.prototype.mulTo=function(f,p){var g,b=this.length+f.length;return this.length===10&&f.length===10?g=q(this,f,p):b<63?g=N(this,f,p):b<1024?g=H(this,f,p):g=D(this,f,p),g};function ee(d,f){this.x=d,this.y=f}ee.prototype.makeRBT=function(f){for(var p=new Array(f),g=i.prototype._countBits(f)-1,b=0;b<f;b++)p[b]=this.revBin(b,g,f);return p},ee.prototype.revBin=function(f,p,g){if(f===0||f===g-1)return f;for(var b=0,h=0;h<p;h++)b|=(f&1)<<p-h-1,f>>=1;return b},ee.prototype.permute=function(f,p,g,b,h,u){for(var _=0;_<u;_++)b[_]=p[f[_]],h[_]=g[f[_]]},ee.prototype.transform=function(f,p,g,b,h,u){this.permute(u,f,p,g,b,h);for(var _=1;_<h;_<<=1)for(var A=_<<1,x=Math.cos(2*Math.PI/A),I=Math.sin(2*Math.PI/A),j=0;j<h;j+=A)for(var O=x,L=I,W=0;W<_;W++){var F=g[j+W],G=b[j+W],De=g[j+W+_],Y=b[j+W+_],Q=O*De-L*Y;Y=O*Y+L*De,De=Q,g[j+W]=F+De,b[j+W]=G+Y,g[j+W+_]=F-De,b[j+W+_]=G-Y,W!==A&&(Q=x*O-I*L,L=x*L+I*O,O=Q)}},ee.prototype.guessLen13b=function(f,p){var g=Math.max(p,f)|1,b=g&1,h=0;for(g=g/2|0;g;g=g>>>1)h++;return 1<<h+1+b},ee.prototype.conjugate=function(f,p,g){if(!(g<=1))for(var b=0;b<g/2;b++){var h=f[b];f[b]=f[g-b-1],f[g-b-1]=h,h=p[b],p[b]=-p[g-b-1],p[g-b-1]=-h}},ee.prototype.normalize13b=function(f,p){for(var g=0,b=0;b<p/2;b++){var h=Math.round(f[2*b+1]/p)*8192+Math.round(f[2*b]/p)+g;f[b]=h&67108863,h<67108864?g=0:g=h/67108864|0}return f},ee.prototype.convert13b=function(f,p,g,b){for(var h=0,u=0;u<p;u++)h=h+(f[u]|0),g[2*u]=h&8191,h=h>>>13,g[2*u+1]=h&8191,h=h>>>13;for(u=2*p;u<b;++u)g[u]=0;r(h===0),r((h&-8192)===0)},ee.prototype.stub=function(f){for(var p=new Array(f),g=0;g<f;g++)p[g]=0;return p},ee.prototype.mulp=function(f,p,g){var b=2*this.guessLen13b(f.length,p.length),h=this.makeRBT(b),u=this.stub(b),_=new Array(b),A=new Array(b),x=new Array(b),I=new Array(b),j=new Array(b),O=new Array(b),L=g.words;L.length=b,this.convert13b(f.words,f.length,_,b),this.convert13b(p.words,p.length,I,b),this.transform(_,u,A,x,b,h),this.transform(I,u,j,O,b,h);for(var W=0;W<b;W++){var F=A[W]*j[W]-x[W]*O[W];x[W]=A[W]*O[W]+x[W]*j[W],A[W]=F}return this.conjugate(A,x,b),this.transform(A,x,L,u,b,h),this.conjugate(L,u,b),this.normalize13b(L,b),g.negative=f.negative^p.negative,g.length=f.length+p.length,g._strip()},i.prototype.mul=function(f){var p=new i(null);return p.words=new Array(this.length+f.length),this.mulTo(f,p)},i.prototype.mulf=function(f){var p=new i(null);return p.words=new Array(this.length+f.length),D(this,f,p)},i.prototype.imul=function(f){return this.clone().mulTo(f,this)},i.prototype.imuln=function(f){var p=f<0;p&&(f=-f),r(typeof f=="number"),r(f<67108864);for(var g=0,b=0;b<this.length;b++){var h=(this.words[b]|0)*f,u=(h&67108863)+(g&67108863);g>>=26,g+=h/67108864|0,g+=u>>>26,this.words[b]=u&67108863}return g!==0&&(this.words[b]=g,this.length++),p?this.ineg():this},i.prototype.muln=function(f){return this.clone().imuln(f)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(f){var p=B(f);if(p.length===0)return new i(1);for(var g=this,b=0;b<p.length&&p[b]===0;b++,g=g.sqr());if(++b<p.length)for(var h=g.sqr();b<p.length;b++,h=h.sqr())p[b]!==0&&(g=g.mul(h));return g},i.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var p=f%26,g=(f-p)/26,b=67108863>>>26-p<<26-p,h;if(p!==0){var u=0;for(h=0;h<this.length;h++){var _=this.words[h]&b,A=(this.words[h]|0)-_<<p;this.words[h]=A|u,u=_>>>26-p}u&&(this.words[h]=u,this.length++)}if(g!==0){for(h=this.length-1;h>=0;h--)this.words[h+g]=this.words[h];for(h=0;h<g;h++)this.words[h]=0;this.length+=g}return this._strip()},i.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},i.prototype.iushrn=function(f,p,g){r(typeof f=="number"&&f>=0);var b;p?b=(p-p%26)/26:b=0;var h=f%26,u=Math.min((f-h)/26,this.length),_=67108863^67108863>>>h<<h,A=g;if(b-=u,b=Math.max(0,b),A){for(var x=0;x<u;x++)A.words[x]=this.words[x];A.length=u}if(u!==0)if(this.length>u)for(this.length-=u,x=0;x<this.length;x++)this.words[x]=this.words[x+u];else this.words[0]=0,this.length=1;var I=0;for(x=this.length-1;x>=0&&(I!==0||x>=b);x--){var j=this.words[x]|0;this.words[x]=I<<26-h|j>>>h,I=j&_}return A&&I!==0&&(A.words[A.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(f,p,g){return r(this.negative===0),this.iushrn(f,p,g)},i.prototype.shln=function(f){return this.clone().ishln(f)},i.prototype.ushln=function(f){return this.clone().iushln(f)},i.prototype.shrn=function(f){return this.clone().ishrn(f)},i.prototype.ushrn=function(f){return this.clone().iushrn(f)},i.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var p=f%26,g=(f-p)/26,b=1<<p;if(this.length<=g)return!1;var h=this.words[g];return!!(h&b)},i.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var p=f%26,g=(f-p)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(p!==0&&g++,this.length=Math.min(g,this.length),p!==0){var b=67108863^67108863>>>p<<p;this.words[this.length-1]&=b}return this._strip()},i.prototype.maskn=function(f){return this.clone().imaskn(f)},i.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},i.prototype._iaddn=function(f){this.words[0]+=f;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},i.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this._strip()},i.prototype.addn=function(f){return this.clone().iaddn(f)},i.prototype.subn=function(f){return this.clone().isubn(f)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(f,p,g){var b=f.length+g,h;this._expand(b);var u,_=0;for(h=0;h<f.length;h++){u=(this.words[h+g]|0)+_;var A=(f.words[h]|0)*p;u-=A&67108863,_=(u>>26)-(A/67108864|0),this.words[h+g]=u&67108863}for(;h<this.length-g;h++)u=(this.words[h+g]|0)+_,_=u>>26,this.words[h+g]=u&67108863;if(_===0)return this._strip();for(r(_===-1),_=0,h=0;h<this.length;h++)u=-(this.words[h]|0)+_,_=u>>26,this.words[h]=u&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(f,p){var g=this.length-f.length,b=this.clone(),h=f,u=h.words[h.length-1]|0,_=this._countBits(u);g=26-_,g!==0&&(h=h.ushln(g),b.iushln(g),u=h.words[h.length-1]|0);var A=b.length-h.length,x;if(p!=="mod"){x=new i(null),x.length=A+1,x.words=new Array(x.length);for(var I=0;I<x.length;I++)x.words[I]=0}var j=b.clone()._ishlnsubmul(h,1,A);j.negative===0&&(b=j,x&&(x.words[A]=1));for(var O=A-1;O>=0;O--){var L=(b.words[h.length+O]|0)*67108864+(b.words[h.length+O-1]|0);for(L=Math.min(L/u|0,67108863),b._ishlnsubmul(h,L,O);b.negative!==0;)L--,b.negative=0,b._ishlnsubmul(h,1,O),b.isZero()||(b.negative^=1);x&&(x.words[O]=L)}return x&&x._strip(),b._strip(),p!=="div"&&g!==0&&b.iushrn(g),{div:x||null,mod:b}},i.prototype.divmod=function(f,p,g){if(r(!f.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var b,h,u;return this.negative!==0&&f.negative===0?(u=this.neg().divmod(f,p),p!=="mod"&&(b=u.div.neg()),p!=="div"&&(h=u.mod.neg(),g&&h.negative!==0&&h.iadd(f)),{div:b,mod:h}):this.negative===0&&f.negative!==0?(u=this.divmod(f.neg(),p),p!=="mod"&&(b=u.div.neg()),{div:b,mod:u.mod}):(this.negative&f.negative)!==0?(u=this.neg().divmod(f.neg(),p),p!=="div"&&(h=u.mod.neg(),g&&h.negative!==0&&h.isub(f)),{div:u.div,mod:h}):f.length>this.length||this.cmp(f)<0?{div:new i(0),mod:this}:f.length===1?p==="div"?{div:this.divn(f.words[0]),mod:null}:p==="mod"?{div:null,mod:new i(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new i(this.modrn(f.words[0]))}:this._wordDiv(f,p)},i.prototype.div=function(f){return this.divmod(f,"div",!1).div},i.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},i.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},i.prototype.divRound=function(f){var p=this.divmod(f);if(p.mod.isZero())return p.div;var g=p.div.negative!==0?p.mod.isub(f):p.mod,b=f.ushrn(1),h=f.andln(1),u=g.cmp(b);return u<0||h===1&&u===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},i.prototype.modrn=function(f){var p=f<0;p&&(f=-f),r(f<=67108863);for(var g=(1<<26)%f,b=0,h=this.length-1;h>=0;h--)b=(g*b+(this.words[h]|0))%f;return p?-b:b},i.prototype.modn=function(f){return this.modrn(f)},i.prototype.idivn=function(f){var p=f<0;p&&(f=-f),r(f<=67108863);for(var g=0,b=this.length-1;b>=0;b--){var h=(this.words[b]|0)+g*67108864;this.words[b]=h/f|0,g=h%f}return this._strip(),p?this.ineg():this},i.prototype.divn=function(f){return this.clone().idivn(f)},i.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var p=this,g=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var b=new i(1),h=new i(0),u=new i(0),_=new i(1),A=0;p.isEven()&&g.isEven();)p.iushrn(1),g.iushrn(1),++A;for(var x=g.clone(),I=p.clone();!p.isZero();){for(var j=0,O=1;(p.words[0]&O)===0&&j<26;++j,O<<=1);if(j>0)for(p.iushrn(j);j-- >0;)(b.isOdd()||h.isOdd())&&(b.iadd(x),h.isub(I)),b.iushrn(1),h.iushrn(1);for(var L=0,W=1;(g.words[0]&W)===0&&L<26;++L,W<<=1);if(L>0)for(g.iushrn(L);L-- >0;)(u.isOdd()||_.isOdd())&&(u.iadd(x),_.isub(I)),u.iushrn(1),_.iushrn(1);p.cmp(g)>=0?(p.isub(g),b.isub(u),h.isub(_)):(g.isub(p),u.isub(b),_.isub(h))}return{a:u,b:_,gcd:g.iushln(A)}},i.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var p=this,g=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var b=new i(1),h=new i(0),u=g.clone();p.cmpn(1)>0&&g.cmpn(1)>0;){for(var _=0,A=1;(p.words[0]&A)===0&&_<26;++_,A<<=1);if(_>0)for(p.iushrn(_);_-- >0;)b.isOdd()&&b.iadd(u),b.iushrn(1);for(var x=0,I=1;(g.words[0]&I)===0&&x<26;++x,I<<=1);if(x>0)for(g.iushrn(x);x-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);p.cmp(g)>=0?(p.isub(g),b.isub(h)):(g.isub(p),h.isub(b))}var j;return p.cmpn(1)===0?j=b:j=h,j.cmpn(0)<0&&j.iadd(f),j},i.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var p=this.clone(),g=f.clone();p.negative=0,g.negative=0;for(var b=0;p.isEven()&&g.isEven();b++)p.iushrn(1),g.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;g.isEven();)g.iushrn(1);var h=p.cmp(g);if(h<0){var u=p;p=g,g=u}else if(h===0||g.cmpn(1)===0)break;p.isub(g)}while(!0);return g.iushln(b)},i.prototype.invm=function(f){return this.egcd(f).a.umod(f)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(f){return this.words[0]&f},i.prototype.bincn=function(f){r(typeof f=="number");var p=f%26,g=(f-p)/26,b=1<<p;if(this.length<=g)return this._expand(g+1),this.words[g]|=b,this;for(var h=b,u=g;h!==0&&u<this.length;u++){var _=this.words[u]|0;_+=h,h=_>>>26,_&=67108863,this.words[u]=_}return h!==0&&(this.words[u]=h,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(f){var p=f<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var g;if(this.length>1)g=1;else{p&&(f=-f),r(f<=67108863,"Number is too big");var b=this.words[0]|0;g=b===f?0:b<f?-1:1}return this.negative!==0?-g|0:g},i.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var p=this.ucmp(f);return this.negative!==0?-p|0:p},i.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var p=0,g=this.length-1;g>=0;g--){var b=this.words[g]|0,h=f.words[g]|0;if(b!==h){b<h?p=-1:b>h&&(p=1);break}}return p},i.prototype.gtn=function(f){return this.cmpn(f)===1},i.prototype.gt=function(f){return this.cmp(f)===1},i.prototype.gten=function(f){return this.cmpn(f)>=0},i.prototype.gte=function(f){return this.cmp(f)>=0},i.prototype.ltn=function(f){return this.cmpn(f)===-1},i.prototype.lt=function(f){return this.cmp(f)===-1},i.prototype.lten=function(f){return this.cmpn(f)<=0},i.prototype.lte=function(f){return this.cmp(f)<=0},i.prototype.eqn=function(f){return this.cmpn(f)===0},i.prototype.eq=function(f){return this.cmp(f)===0},i.red=function(f){return new s(f)},i.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(f){return this.red=f,this},i.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},i.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},i.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},i.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},i.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},i.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},i.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},i.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var ge={k256:null,p224:null,p192:null,p25519:null};function K(d,f){this.name=d,this.p=new i(f,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}K.prototype._tmp=function(){var f=new i(null);return f.words=new Array(Math.ceil(this.n/13)),f},K.prototype.ireduce=function(f){var p=f,g;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),g=p.bitLength();while(g>this.n);var b=g<this.n?-1:p.ucmp(this.p);return b===0?(p.words[0]=0,p.length=1):b>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},K.prototype.split=function(f,p){f.iushrn(this.n,0,p)},K.prototype.imulK=function(f){return f.imul(this.k)};function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(X,K),X.prototype.split=function(f,p){for(var g=4194303,b=Math.min(f.length,9),h=0;h<b;h++)p.words[h]=f.words[h];if(p.length=b,f.length<=9){f.words[0]=0,f.length=1;return}var u=f.words[9];for(p.words[p.length++]=u&g,h=10;h<f.length;h++){var _=f.words[h]|0;f.words[h-10]=(_&g)<<4|u>>>22,u=_}u>>>=22,f.words[h-10]=u,u===0&&f.length>10?f.length-=10:f.length-=9},X.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var p=0,g=0;g<f.length;g++){var b=f.words[g]|0;p+=b*977,f.words[g]=p&67108863,p=b*64+(p/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function V(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(V,K);function T(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(T,K);function m(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(m,K),m.prototype.imulK=function(f){for(var p=0,g=0;g<f.length;g++){var b=(f.words[g]|0)*19+p,h=b&67108863;b>>>=26,f.words[g]=h,p=b}return p!==0&&(f.words[f.length++]=p),f},i._prime=function(f){if(ge[f])return ge[f];var p;if(f==="k256")p=new X;else if(f==="p224")p=new V;else if(f==="p192")p=new T;else if(f==="p25519")p=new m;else throw new Error("Unknown prime "+f);return ge[f]=p,p};function s(d){if(typeof d=="string"){var f=i._prime(d);this.m=f.p,this.prime=f}else r(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}s.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},s.prototype._verify2=function(f,p){r((f.negative|p.negative)===0,"red works only with positives"),r(f.red&&f.red===p.red,"red works only with red numbers")},s.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(y(f,f.umod(this.m)._forceRed(this)),f)},s.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},s.prototype.add=function(f,p){this._verify2(f,p);var g=f.add(p);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},s.prototype.iadd=function(f,p){this._verify2(f,p);var g=f.iadd(p);return g.cmp(this.m)>=0&&g.isub(this.m),g},s.prototype.sub=function(f,p){this._verify2(f,p);var g=f.sub(p);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},s.prototype.isub=function(f,p){this._verify2(f,p);var g=f.isub(p);return g.cmpn(0)<0&&g.iadd(this.m),g},s.prototype.shl=function(f,p){return this._verify1(f),this.imod(f.ushln(p))},s.prototype.imul=function(f,p){return this._verify2(f,p),this.imod(f.imul(p))},s.prototype.mul=function(f,p){return this._verify2(f,p),this.imod(f.mul(p))},s.prototype.isqr=function(f){return this.imul(f,f.clone())},s.prototype.sqr=function(f){return this.mul(f,f)},s.prototype.sqrt=function(f){if(f.isZero())return f.clone();var p=this.m.andln(3);if(r(p%2===1),p===3){var g=this.m.add(new i(1)).iushrn(2);return this.pow(f,g)}for(var b=this.m.subn(1),h=0;!b.isZero()&&b.andln(1)===0;)h++,b.iushrn(1);r(!b.isZero());var u=new i(1).toRed(this),_=u.redNeg(),A=this.m.subn(1).iushrn(1),x=this.m.bitLength();for(x=new i(2*x*x).toRed(this);this.pow(x,A).cmp(_)!==0;)x.redIAdd(_);for(var I=this.pow(x,b),j=this.pow(f,b.addn(1).iushrn(1)),O=this.pow(f,b),L=h;O.cmp(u)!==0;){for(var W=O,F=0;W.cmp(u)!==0;F++)W=W.redSqr();r(F<L);var G=this.pow(I,new i(1).iushln(L-F-1));j=j.redMul(G),I=G.redSqr(),O=O.redMul(I),L=F}return j},s.prototype.invm=function(f){var p=f._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},s.prototype.pow=function(f,p){if(p.isZero())return new i(1).toRed(this);if(p.cmpn(1)===0)return f.clone();var g=4,b=new Array(1<<g);b[0]=new i(1).toRed(this),b[1]=f;for(var h=2;h<b.length;h++)b[h]=this.mul(b[h-1],f);var u=b[0],_=0,A=0,x=p.bitLength()%26;for(x===0&&(x=26),h=p.length-1;h>=0;h--){for(var I=p.words[h],j=x-1;j>=0;j--){var O=I>>j&1;if(u!==b[0]&&(u=this.sqr(u)),O===0&&_===0){A=0;continue}_<<=1,_|=O,A++,!(A!==g&&(h!==0||j!==0))&&(u=this.mul(u,b[_]),A=0,_=0)}x=26}return u},s.prototype.convertTo=function(f){var p=f.umod(this.m);return p===f?p.clone():p},s.prototype.convertFrom=function(f){var p=f.clone();return p.red=null,p},i.mont=function(f){return new l(f)};function l(d){s.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(l,s),l.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},l.prototype.convertFrom=function(f){var p=this.imod(f.mul(this.rinv));return p.red=null,p},l.prototype.imul=function(f,p){if(f.isZero()||p.isZero())return f.words[0]=0,f.length=1,f;var g=f.imul(p),b=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=g.isub(b).iushrn(this.shift),u=h;return h.cmp(this.m)>=0?u=h.isub(this.m):h.cmpn(0)<0&&(u=h.iadd(this.m)),u._forceRed(this)},l.prototype.mul=function(f,p){if(f.isZero()||p.isZero())return new i(0)._forceRed(this);var g=f.mul(p),b=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=g.isub(b).iushrn(this.shift),u=h;return h.cmp(this.m)>=0?u=h.isub(this.m):h.cmpn(0)<0&&(u=h.iadd(this.m)),u._forceRed(this)},l.prototype.invm=function(f){var p=this.imod(f._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(typeof ux>"u"||ux,gk)});var ph=E(go=>{"use strict";var rse=go&&go.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(go,"__esModule",{value:!0});go.getLength=go.decode=go.encode=void 0;var nse=rse(jf());function yk(e){if(Array.isArray(e)){for(var t=[],r=0;r<e.length;r++)t.push(yk(e[r]));var n=Buffer.concat(t);return Buffer.concat([bk(n.length,192),n])}else{var i=hx(e);return i.length===1&&i[0]<128?i:Buffer.concat([bk(i.length,128),i])}}go.encode=yk;function fx(e,t){if(e[0]==="0"&&e[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function bk(e,t){if(e<56)return Buffer.from([e+t]);var r=lx(e),n=r.length/2,i=lx(t+55+n);return Buffer.from(i+r,"hex")}function ise(e,t){if(t===void 0&&(t=!1),!e||e.length===0)return Buffer.from([]);var r=hx(e),n=cx(r);if(t)return n;if(n.remainder.length!==0)throw new Error("invalid remainder");return n.data}go.decode=ise;function ose(e){if(!e||e.length===0)return Buffer.from([]);var t=hx(e),r=t[0];if(r<=127)return t.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;var n=r-246,i=fx(t.slice(1,n).toString("hex"),16);return n+i}go.getLength=ose;function cx(e){var t,r,n,i,o,a=[],c=e[0];if(c<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(c<=183){if(t=c-127,c===128?n=Buffer.from([]):n=e.slice(1,t),t===2&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:e.slice(t)}}else if(c<=191){if(r=c-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=fx(e.slice(1,r).toString("hex"),16),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(n=e.slice(r,t+r),n.length<t)throw new Error("invalid RLP: not enough bytes for string");return{data:n,remainder:e.slice(t+r)}}else if(c<=247){for(t=c-191,i=e.slice(1,t);i.length;)o=cx(i),a.push(o.data),i=o.remainder;return{data:a,remainder:e.slice(t)}}else{r=c-246,t=fx(e.slice(1,r).toString("hex"),16);var v=r+t;if(v>e.length)throw new Error("invalid rlp: total length is larger than the data");if(i=e.slice(r,v),i.length===0)throw new Error("invalid rlp, List has a invalid length");for(;i.length;)o=cx(i),a.push(o.data),i=o.remainder;return{data:a,remainder:e.slice(v)}}}function _k(e){return e.slice(0,2)==="0x"}function sse(e){return typeof e!="string"?e:_k(e)?e.slice(2):e}function lx(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function ase(e){return e.length%2?"0"+e:e}function use(e){var t=lx(e);return Buffer.from(t,"hex")}function hx(e){if(!Buffer.isBuffer(e)){if(typeof e=="string")return _k(e)?Buffer.from(ase(sse(e)),"hex"):Buffer.from(e);if(typeof e=="number"||typeof e=="bigint")return e?use(e):Buffer.from([]);if(e==null)return Buffer.from([]);if(e instanceof Uint8Array)return Buffer.from(e);if(nse.default.isBN(e))return Buffer.from(e.toArray());throw new Error("invalid type")}return e}});var dx=E((XPe,xk)=>{"use strict";var I1=Hn().Buffer,wk=Xv().Transform,fse=Tr();function cse(e,t){if(!I1.isBuffer(e)&&typeof e!="string")throw new TypeError(t+" must be a string or a buffer")}function Bs(e){wk.call(this),this._block=I1.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}fse(Bs,wk);Bs.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(i){n=i}r(n)};Bs.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};Bs.prototype.update=function(e,t){if(cse(e,"Data"),this._finalized)throw new Error("Digest already called");I1.isBuffer(e)||(e=I1.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var o=0,a=e.length*8;a>0;++o)this._length[o]+=a,a=this._length[o]/4294967296|0,a>0&&(this._length[o]-=4294967296*a);return this};Bs.prototype._update=function(){throw new Error("_update is not implemented")};Bs.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};Bs.prototype._digest=function(){throw new Error("_digest is not implemented")};xk.exports=Bs});var Ek=E((eNe,Sk)=>{"use strict";var lse=Tr(),Mk=dx(),hse=Hn().Buffer,dse=new Array(16);function C1(){Mk.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}lse(C1,Mk);C1.prototype._update=function(){for(var e=dse,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a,n=this._b,i=this._c,o=this._d;r=pn(r,n,i,o,e[0],3614090360,7),o=pn(o,r,n,i,e[1],3905402710,12),i=pn(i,o,r,n,e[2],606105819,17),n=pn(n,i,o,r,e[3],3250441966,22),r=pn(r,n,i,o,e[4],4118548399,7),o=pn(o,r,n,i,e[5],1200080426,12),i=pn(i,o,r,n,e[6],2821735955,17),n=pn(n,i,o,r,e[7],4249261313,22),r=pn(r,n,i,o,e[8],1770035416,7),o=pn(o,r,n,i,e[9],2336552879,12),i=pn(i,o,r,n,e[10],4294925233,17),n=pn(n,i,o,r,e[11],2304563134,22),r=pn(r,n,i,o,e[12],1804603682,7),o=pn(o,r,n,i,e[13],4254626195,12),i=pn(i,o,r,n,e[14],2792965006,17),n=pn(n,i,o,r,e[15],1236535329,22),r=vn(r,n,i,o,e[1],4129170786,5),o=vn(o,r,n,i,e[6],3225465664,9),i=vn(i,o,r,n,e[11],643717713,14),n=vn(n,i,o,r,e[0],3921069994,20),r=vn(r,n,i,o,e[5],3593408605,5),o=vn(o,r,n,i,e[10],38016083,9),i=vn(i,o,r,n,e[15],3634488961,14),n=vn(n,i,o,r,e[4],3889429448,20),r=vn(r,n,i,o,e[9],568446438,5),o=vn(o,r,n,i,e[14],3275163606,9),i=vn(i,o,r,n,e[3],4107603335,14),n=vn(n,i,o,r,e[8],1163531501,20),r=vn(r,n,i,o,e[13],2850285829,5),o=vn(o,r,n,i,e[2],4243563512,9),i=vn(i,o,r,n,e[7],1735328473,14),n=vn(n,i,o,r,e[12],2368359562,20),r=mn(r,n,i,o,e[5],4294588738,4),o=mn(o,r,n,i,e[8],2272392833,11),i=mn(i,o,r,n,e[11],1839030562,16),n=mn(n,i,o,r,e[14],4259657740,23),r=mn(r,n,i,o,e[1],2763975236,4),o=mn(o,r,n,i,e[4],1272893353,11),i=mn(i,o,r,n,e[7],4139469664,16),n=mn(n,i,o,r,e[10],3200236656,23),r=mn(r,n,i,o,e[13],681279174,4),o=mn(o,r,n,i,e[0],3936430074,11),i=mn(i,o,r,n,e[3],3572445317,16),n=mn(n,i,o,r,e[6],76029189,23),r=mn(r,n,i,o,e[9],3654602809,4),o=mn(o,r,n,i,e[12],3873151461,11),i=mn(i,o,r,n,e[15],530742520,16),n=mn(n,i,o,r,e[2],3299628645,23),r=gn(r,n,i,o,e[0],4096336452,6),o=gn(o,r,n,i,e[7],1126891415,10),i=gn(i,o,r,n,e[14],2878612391,15),n=gn(n,i,o,r,e[5],4237533241,21),r=gn(r,n,i,o,e[12],1700485571,6),o=gn(o,r,n,i,e[3],2399980690,10),i=gn(i,o,r,n,e[10],4293915773,15),n=gn(n,i,o,r,e[1],2240044497,21),r=gn(r,n,i,o,e[8],1873313359,6),o=gn(o,r,n,i,e[15],4264355552,10),i=gn(i,o,r,n,e[6],2734768916,15),n=gn(n,i,o,r,e[13],1309151649,21),r=gn(r,n,i,o,e[4],4149444226,6),o=gn(o,r,n,i,e[11],3174756917,10),i=gn(i,o,r,n,e[2],718787259,15),n=gn(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0};C1.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=hse.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function T1(e,t){return e<<t|e>>>32-t}function pn(e,t,r,n,i,o,a){return T1(e+(t&r|~t&n)+i+o|0,a)+t|0}function vn(e,t,r,n,i,o,a){return T1(e+(t&n|r&~n)+i+o|0,a)+t|0}function mn(e,t,r,n,i,o,a){return T1(e+(t^r^n)+i+o|0,a)+t|0}function gn(e,t,r,n,i,o,a){return T1(e+(r^(t|~n))+i+o|0,a)+t|0}Sk.exports=C1});var Pk=E((tNe,kk)=>{"use strict";var px=fi().Buffer,pse=Tr(),Tk=dx(),vse=new Array(16),vh=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],mh=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],gh=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],bh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],yh=[0,1518500249,1859775393,2400959708,2840853838],_h=[1352829926,1548603684,1836072691,2053994217,0];function k1(){Tk.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}pse(k1,Tk);k1.prototype._update=function(){for(var e=vse,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,c=this._a|0,v=this._b|0,y=this._c|0,w=this._d|0,M=this._e|0,S=0;S<80;S+=1){var R,C;S<16?(R=Ak(r,n,i,o,a,e[vh[S]],yh[0],gh[S]),C=Ck(c,v,y,w,M,e[mh[S]],_h[0],bh[S])):S<32?(R=Ok(r,n,i,o,a,e[vh[S]],yh[1],gh[S]),C=Ik(c,v,y,w,M,e[mh[S]],_h[1],bh[S])):S<48?(R=Rk(r,n,i,o,a,e[vh[S]],yh[2],gh[S]),C=Rk(c,v,y,w,M,e[mh[S]],_h[2],bh[S])):S<64?(R=Ik(r,n,i,o,a,e[vh[S]],yh[3],gh[S]),C=Ok(c,v,y,w,M,e[mh[S]],_h[3],bh[S])):(R=Ck(r,n,i,o,a,e[vh[S]],yh[4],gh[S]),C=Ak(c,v,y,w,M,e[mh[S]],_h[4],bh[S])),r=a,a=o,o=ru(i,10),i=n,n=R,c=M,M=w,w=ru(y,10),y=v,v=C}var B=this._b+i+w|0;this._b=this._c+o+M|0,this._c=this._d+a+c|0,this._d=this._e+r+v|0,this._e=this._a+n+y|0,this._a=B};k1.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=px.alloc?px.alloc(20):new px(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};function ru(e,t){return e<<t|e>>>32-t}function Ak(e,t,r,n,i,o,a,c){return ru(e+(t^r^n)+o+a|0,c)+i|0}function Ok(e,t,r,n,i,o,a,c){return ru(e+(t&r|~t&n)+o+a|0,c)+i|0}function Rk(e,t,r,n,i,o,a,c){return ru(e+((t|~r)^n)+o+a|0,c)+i|0}function Ik(e,t,r,n,i,o,a,c){return ru(e+(t&n|r&~n)+o+a|0,c)+i|0}function Ck(e,t,r,n,i,o,a,c){return ru(e+(t^(r|~n))+o+a|0,c)+i|0}kk.exports=k1});var nu=E((rNe,qk)=>{var Nk=Hn().Buffer;function P1(e,t){this._block=Nk.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}P1.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Nk.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,a=0;a<i;){for(var c=o%n,v=Math.min(i-a,n-c),y=0;y<v;y++)r[c+y]=e[a+y];o+=v,a+=v,o%n===0&&this._update(r)}return this._len+=i,this};P1.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o};P1.prototype._update=function(){throw new Error("_update must be implemented by subclass")};qk.exports=P1});var Dk=E((nNe,Bk)=>{var mse=Tr(),Lk=nu(),gse=Hn().Buffer,bse=[1518500249,1859775393,-1894007588,-899497514],yse=new Array(80);function wh(){this.init(),this._w=yse,Lk.call(this,64,56)}mse(wh,Lk);wh.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function _se(e){return e<<5|e>>>27}function wse(e){return e<<30|e>>>2}function xse(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}wh.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var v=0;v<80;++v){var y=~~(v/20),w=_se(r)+xse(y,n,i,o)+a+t[v]+bse[y]|0;a=o,o=i,i=wse(n),n=r,r=w}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};wh.prototype._hash=function(){var e=gse.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};Bk.exports=wh});var Uk=E((iNe,Fk)=>{var Mse=Tr(),jk=nu(),Sse=Hn().Buffer,Ese=[1518500249,1859775393,-1894007588,-899497514],Ase=new Array(80);function xh(){this.init(),this._w=Ase,jk.call(this,64,56)}Mse(xh,jk);xh.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Ose(e){return e<<1|e>>>31}function Rse(e){return e<<5|e>>>27}function Ise(e){return e<<30|e>>>2}function Cse(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}xh.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=Ose(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var v=0;v<80;++v){var y=~~(v/20),w=Rse(r)+Cse(y,n,i,o)+a+t[v]+Ese[y]|0;a=o,o=i,i=Ise(n),n=r,r=w}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};xh.prototype._hash=function(){var e=Sse.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};Fk.exports=xh});var vx=E((oNe,Wk)=>{var Tse=Tr(),Hk=nu(),kse=Hn().Buffer,Pse=[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],Nse=new Array(64);function Mh(){this.init(),this._w=Nse,Hk.call(this,64,56)}Tse(Mh,Hk);Mh.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function qse(e,t,r){return r^e&(t^r)}function Lse(e,t,r){return e&t|r&(e|t)}function Bse(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Dse(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function jse(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Fse(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Mh.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,c=this._f|0,v=this._g|0,y=this._h|0,w=0;w<16;++w)t[w]=e.readInt32BE(w*4);for(;w<64;++w)t[w]=Fse(t[w-2])+t[w-7]+jse(t[w-15])+t[w-16]|0;for(var M=0;M<64;++M){var S=y+Dse(a)+qse(a,c,v)+Pse[M]+t[M]|0,R=Bse(r)+Lse(r,n,i)|0;y=v,v=c,c=a,a=o+S|0,o=i,i=n,n=r,r=S+R|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=c+this._f|0,this._g=v+this._g|0,this._h=y+this._h|0};Mh.prototype._hash=function(){var e=kse.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};Wk.exports=Mh});var Vk=E((sNe,zk)=>{var Use=Tr(),Hse=vx(),Wse=nu(),zse=Hn().Buffer,Vse=new Array(64);function N1(){this.init(),this._w=Vse,Wse.call(this,64,56)}Use(N1,Hse);N1.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};N1.prototype._hash=function(){var e=zse.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};zk.exports=N1});var mx=E((aNe,Qk)=>{var $se=Tr(),Jk=nu(),Kse=Hn().Buffer,$k=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Gse=new Array(160);function Sh(){this.init(),this._w=Gse,Jk.call(this,128,112)}$se(Sh,Jk);Sh.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Kk(e,t,r){return r^e&(t^r)}function Gk(e,t,r){return e&t|r&(e|t)}function Zk(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Yk(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Zse(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Yse(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Jse(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Qse(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Kr(e,t){return e>>>0<t>>>0?1:0}Sh.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,o=this._dh|0,a=this._eh|0,c=this._fh|0,v=this._gh|0,y=this._hh|0,w=this._al|0,M=this._bl|0,S=this._cl|0,R=this._dl|0,C=this._el|0,B=this._fl|0,N=this._gl|0,q=this._hl|0,H=0;H<32;H+=2)t[H]=e.readInt32BE(H*4),t[H+1]=e.readInt32BE(H*4+4);for(;H<160;H+=2){var D=t[H-30],ee=t[H-15*2+1],ge=Zse(D,ee),K=Yse(ee,D);D=t[H-2*2],ee=t[H-2*2+1];var X=Jse(D,ee),V=Qse(ee,D),T=t[H-7*2],m=t[H-7*2+1],s=t[H-16*2],l=t[H-16*2+1],d=K+m|0,f=ge+T+Kr(d,K)|0;d=d+V|0,f=f+X+Kr(d,V)|0,d=d+l|0,f=f+s+Kr(d,l)|0,t[H]=f,t[H+1]=d}for(var p=0;p<160;p+=2){f=t[p],d=t[p+1];var g=Gk(r,n,i),b=Gk(w,M,S),h=Zk(r,w),u=Zk(w,r),_=Yk(a,C),A=Yk(C,a),x=$k[p],I=$k[p+1],j=Kk(a,c,v),O=Kk(C,B,N),L=q+A|0,W=y+_+Kr(L,q)|0;L=L+O|0,W=W+j+Kr(L,O)|0,L=L+I|0,W=W+x+Kr(L,I)|0,L=L+d|0,W=W+f+Kr(L,d)|0;var F=u+b|0,G=h+g+Kr(F,u)|0;y=v,q=N,v=c,N=B,c=a,B=C,C=R+L|0,a=o+W+Kr(C,R)|0,o=i,R=S,i=n,S=M,n=r,M=w,w=L+F|0,r=W+G+Kr(w,L)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+S|0,this._dl=this._dl+R|0,this._el=this._el+C|0,this._fl=this._fl+B|0,this._gl=this._gl+N|0,this._hl=this._hl+q|0,this._ah=this._ah+r+Kr(this._al,w)|0,this._bh=this._bh+n+Kr(this._bl,M)|0,this._ch=this._ch+i+Kr(this._cl,S)|0,this._dh=this._dh+o+Kr(this._dl,R)|0,this._eh=this._eh+a+Kr(this._el,C)|0,this._fh=this._fh+c+Kr(this._fl,B)|0,this._gh=this._gh+v+Kr(this._gl,N)|0,this._hh=this._hh+y+Kr(this._hl,q)|0};Sh.prototype._hash=function(){var e=Kse.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};Qk.exports=Sh});var eP=E((uNe,Xk)=>{var Xse=Tr(),eae=mx(),tae=nu(),rae=Hn().Buffer,nae=new Array(160);function q1(){this.init(),this._w=nae,tae.call(this,128,112)}Xse(q1,eae);q1.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};q1.prototype._hash=function(){var e=rae.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};Xk.exports=q1});var gx=E((Qo,tP)=>{var Qo=tP.exports=function(t){t=t.toLowerCase();var r=Qo[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};Qo.sha=Dk();Qo.sha1=Uk();Qo.sha224=Vk();Qo.sha256=vx();Qo.sha384=eP();Qo.sha512=mx()});var rP=E((fNe,L1)=>{var iu=(Mv(),Pt(LO));if(iu&&iu.default){L1.exports=iu.default;for(let e in iu)L1.exports[e]=iu[e]}else iu&&(L1.exports=iu)});var nP=E((cNe,B1)=>{var ou=(vw(),Pt(yO));if(ou&&ou.default){B1.exports=ou.default;for(let e in ou)B1.exports[e]=ou[e]}else ou&&(B1.exports=ou)});var aP=E((lNe,sP)=>{var iP=Hn().Buffer,oP=rP().Transform,iae=nP().StringDecoder,oae=Tr();function ji(e){oP.call(this),this.hashMode=typeof e=="string",this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}oae(ji,oP);ji.prototype.update=function(e,t,r){typeof e=="string"&&(e=iP.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)};ji.prototype.setAutoPadding=function(){};ji.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};ji.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};ji.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};ji.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(i){n=i}finally{r(n)}};ji.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};ji.prototype._finalOrDigest=function(e){var t=this.__final()||iP.alloc(0);return e&&(t=this._toString(t,e,!0)),t};ji.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new iae(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};sP.exports=ji});var bx=E((hNe,fP)=>{"use strict";var sae=Tr(),aae=Ek(),uae=Pk(),fae=gx(),uP=aP();function D1(e){uP.call(this,"digest"),this._hash=e}sae(D1,uP);D1.prototype._update=function(e){this._hash.update(e)};D1.prototype._final=function(){return this._hash.digest()};fP.exports=function(t){return t=t.toLowerCase(),t==="md5"?new aae:t==="rmd160"||t==="ripemd160"?new uae:new D1(fae(t))}});var yx=E((dNe,cP)=>{cP.exports=function(t){if(typeof t!="string")throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return t.slice(0,2)==="0x"}});var hP=E((pNe,lP)=>{var cae=yx();lP.exports=function(t){return typeof t!="string"?t:cae(t)?t.slice(2):t}});var su=E((vNe,vP)=>{"use strict";var lae=yx(),dP=hP();function j1(e){var t=e;if(typeof t!="string")throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function pP(e){var t=e.toString(16);return"0x"+t}function hae(e){var t=pP(e);return new Buffer(j1(t.slice(2)),"hex")}function dae(e){if(typeof e!="string")throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return Buffer.byteLength(e,"utf8")}function pae(e,t,r){if(Array.isArray(e)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(Array.isArray(t)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)&&"some"||"every"](function(n){return e.indexOf(n)>=0})}function vae(e){var t=new Buffer(j1(dP(e).replace(/^0+|0+$/g,"")),"hex");return t.toString("utf8")}function mae(e){var t="",r=0,n=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<n;r+=2){var i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t}function gae(e){var t=new Buffer(e,"utf8");return"0x"+j1(t.toString("hex")).replace(/^0+|0+$/g,"")}function bae(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r),i=n.toString(16);t+=i.length<2?"0"+i:i}return"0x"+t}function yae(e,t,r){if(!Array.isArray(e))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof e+"'");if(typeof t!="string")throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof t+"'.");for(var n=[],i=0;i<e.length;i++){var o=e[i][t];if(r&&!o)o="";else if(typeof o!="string")throw new Error("invalid abi");n.push(o)}return n}function _ae(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}vP.exports={arrayContainsArray:pae,intToBuffer:hae,getBinarySize:dae,isHexPrefixed:lae,stripHexPrefix:dP,padToEven:j1,intToHex:pP,fromAscii:bae,fromUtf8:gae,toAscii:mae,toUtf8:vae,getKeys:yae,isHexString:_ae}});var Ff=E(ie=>{"use strict";var wae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U1=y2(),xae=U1.keccak224,Mae=U1.keccak384,Sae=U1.keccak256,Eae=U1.keccak512,bo=XT(),_x=R1(),F1=ph(),wi=Y2(),mP=bx(),Ar=Hn().Buffer;Object.assign(ie,su());ie.MAX_INTEGER=new wi("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16);ie.TWO_POW256=new wi("10000000000000000000000000000000000000000000000000000000000000000",16);ie.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";ie.SHA3_NULL_S=ie.KECCAK256_NULL_S;ie.KECCAK256_NULL=Ar.from(ie.KECCAK256_NULL_S,"hex");ie.SHA3_NULL=ie.KECCAK256_NULL;ie.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347";ie.SHA3_RLP_ARRAY_S=ie.KECCAK256_RLP_ARRAY_S;ie.KECCAK256_RLP_ARRAY=Ar.from(ie.KECCAK256_RLP_ARRAY_S,"hex");ie.SHA3_RLP_ARRAY=ie.KECCAK256_RLP_ARRAY;ie.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421";ie.SHA3_RLP_S=ie.KECCAK256_RLP_S;ie.KECCAK256_RLP=Ar.from(ie.KECCAK256_RLP_S,"hex");ie.SHA3_RLP=ie.KECCAK256_RLP;ie.BN=wi;ie.rlp=F1;ie.secp256k1=bo;ie.zeros=function(e){return Ar.allocUnsafe(e).fill(0)};ie.zeroAddress=function(){var e=20,t=ie.zeros(e);return ie.bufferToHex(t)};ie.setLengthLeft=ie.setLength=function(e,t,r){var n=ie.zeros(t);return e=ie.toBuffer(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)};ie.setLengthRight=function(e,t){return ie.setLength(e,t,!0)};ie.unpad=ie.stripZeros=function(e){e=ie.stripHexPrefix(e);for(var t=e[0];e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e};ie.toBuffer=function(e){if(!Ar.isBuffer(e))if(Array.isArray(e))e=Ar.from(e);else if(typeof e=="string")ie.isHexString(e)?e=Ar.from(ie.padToEven(ie.stripHexPrefix(e)),"hex"):e=Ar.from(e);else if(typeof e=="number")e=ie.intToBuffer(e);else if(e==null)e=Ar.allocUnsafe(0);else if(wi.isBN(e))e=e.toArrayLike(Ar);else if(e.toArray)e=Ar.from(e.toArray());else throw new Error("invalid type");return e};ie.bufferToInt=function(e){return new wi(ie.toBuffer(e)).toNumber()};ie.bufferToHex=function(e){return e=ie.toBuffer(e),"0x"+e.toString("hex")};ie.fromSigned=function(e){return new wi(e).fromTwos(256)};ie.toUnsigned=function(e){return Ar.from(e.toTwos(256).toArray())};ie.keccak=function(e,t){switch(e=ie.toBuffer(e),t||(t=256),t){case 224:return xae(e);case 256:return Sae(e);case 384:return Mae(e);case 512:return Eae(e);default:throw new Error("Invald algorithm: keccak"+t)}};ie.keccak256=function(e){return ie.keccak(e)};ie.sha3=ie.keccak;ie.sha256=function(e){return e=ie.toBuffer(e),mP("sha256").update(e).digest()};ie.ripemd160=function(e,t){e=ie.toBuffer(e);var r=mP("rmd160").update(e).digest();return t===!0?ie.setLength(r,32):r};ie.rlphash=function(e){return ie.keccak(F1.encode(e))};ie.isValidPrivate=function(e){return bo.privateKeyVerify(e)};ie.isValidPublic=function(e,t){return e.length===64?bo.publicKeyVerify(Ar.concat([Ar.from([4]),e])):t?bo.publicKeyVerify(e):!1};ie.pubToAddress=ie.publicToAddress=function(e,t){return e=ie.toBuffer(e),t&&e.length!==64&&(e=bo.publicKeyConvert(e,!1).slice(1)),_x(e.length===64),ie.keccak(e).slice(-20)};var Aae=ie.privateToPublic=function(e){return e=ie.toBuffer(e),bo.publicKeyCreate(e,!1).slice(1)};ie.importPublic=function(e){return e=ie.toBuffer(e),e.length!==64&&(e=bo.publicKeyConvert(e,!1).slice(1)),e};ie.ecsign=function(e,t){var r=bo.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n};ie.hashPersonalMessage=function(e){var t=ie.toBuffer(`Ethereum Signed Message:
538
+ `+e.length.toString());return ie.keccak(Ar.concat([t,e]))};ie.ecrecover=function(e,t,r,n){var i=Ar.concat([ie.setLength(r,32),ie.setLength(n,32)],64),o=t-27;if(o!==0&&o!==1)throw new Error("Invalid signature v value");var a=bo.recover(e,i,o);return bo.publicKeyConvert(a,!1).slice(1)};ie.toRpcSig=function(e,t,r){if(e!==27&&e!==28)throw new Error("Invalid recovery id");return ie.bufferToHex(Ar.concat([ie.setLengthLeft(t,32),ie.setLengthLeft(r,32),ie.toBuffer(e-27)]))};ie.fromRpcSig=function(e){if(e=ie.toBuffer(e),e.length!==65)throw new Error("Invalid signature length");var t=e[64];return t<27&&(t+=27),{v:t,r:e.slice(0,32),s:e.slice(32,64)}};ie.privateToAddress=function(e){return ie.publicToAddress(Aae(e))};ie.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)};ie.isZeroAddress=function(e){var t=ie.zeroAddress();return t===ie.addHexPrefix(e)};ie.toChecksumAddress=function(e){e=ie.stripHexPrefix(e).toLowerCase();for(var t=ie.keccak(e).toString("hex"),r="0x",n=0;n<e.length;n++)parseInt(t[n],16)>=8?r+=e[n].toUpperCase():r+=e[n];return r};ie.isValidChecksumAddress=function(e){return ie.isValidAddress(e)&&ie.toChecksumAddress(e)===e};ie.generateAddress=function(e,t){return e=ie.toBuffer(e),t=new wi(t),t.isZero()?t=null:t=Ar.from(t.toArray()),ie.rlphash([e,t]).slice(-20)};ie.isPrecompiled=function(e){var t=ie.unpad(e);return t.length===1&&t[0]>=1&&t[0]<=8};ie.addHexPrefix=function(e){return typeof e!="string"||ie.isHexPrefixed(e)?e:"0x"+e};ie.isValidSignature=function(e,t,r,n){var i=new wi("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),o=new wi("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return!(t.length!==32||r.length!==32||e!==27&&e!==28||(t=new wi(t),r=new wi(r),t.isZero()||t.gt(o)||r.isZero()||r.gt(o))||n===!1&&new wi(r).cmp(i)===1)};ie.baToJSON=function(e){if(Ar.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var t=[],r=0;r<e.length;r++)t.push(ie.baToJSON(e[r]));return t}};ie.defineProperties=function(e,t,r){if(e.raw=[],e._fields=[],e.toJSON=function(i){if(i){var o={};return e._fields.forEach(function(a){o[a]="0x"+e[a].toString("hex")}),o}return ie.baToJSON(this.raw)},e.serialize=function(){return F1.encode(e.raw)},t.forEach(function(i,o){e._fields.push(i.name);function a(){return e.raw[o]}function c(v){v=ie.toBuffer(v),v.toString("hex")==="00"&&!i.allowZero&&(v=Ar.allocUnsafe(0)),i.allowLess&&i.length?(v=ie.stripZeros(v),_x(i.length>=v.length,"The field "+i.name+" must not have more "+i.length+" bytes")):!(i.allowZero&&v.length===0)&&i.length&&_x(i.length===v.length,"The field "+i.name+" must have byte length of "+i.length),e.raw[o]=v}Object.defineProperty(e,i.name,{enumerable:!0,configurable:!0,get:a,set:c}),i.default&&(e[i.name]=i.default),i.alias&&Object.defineProperty(e,i.alias,{enumerable:!1,configurable:!0,set:c,get:a})}),r)if(typeof r=="string"&&(r=Ar.from(ie.stripHexPrefix(r),"hex")),Ar.isBuffer(r)&&(r=F1.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach(function(i,o){e[e._fields[o]]=ie.toBuffer(i)})}else if((typeof r>"u"?"undefined":wae(r))==="object"){var n=Object.keys(r);t.forEach(function(i){n.indexOf(i.name)!==-1&&(e[i.name]=r[i.name]),n.indexOf(i.alias)!==-1&&(e[i.alias]=r[i.alias])})}else throw new Error("invalid data")}});var wx=E((gNe,bP)=>{"use strict";var gP=(e,t)=>function(){let r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,o)=>{t.errorFirst?n.push(function(a,c){if(t.multiArgs){let v=new Array(arguments.length-1);for(let y=1;y<arguments.length;y++)v[y-1]=arguments[y];a?(v.unshift(a),o(v)):i(v)}else a?o(a):i(c)}):n.push(function(a){if(t.multiArgs){let c=new Array(arguments.length-1);for(let v=0;v<arguments.length;v++)c[v]=arguments[v];i(c)}else i(a)}),e.apply(this,n)})};bP.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=i=>{let o=a=>typeof a=="string"?i===a:a.test(i);return t.include?t.include.some(o):!t.exclude.some(o)},n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):gP(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(let i in e){let o=e[i];n[i]=typeof o=="function"&&r(i)?gP(o,t):o}return n}});var H1=E((bNe,yP)=>{yP.exports=Rae;var Oae=Object.prototype.hasOwnProperty;function Rae(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)Oae.call(r,n)&&(e[n]=r[n])}return e}});var wP=E((yNe,_P)=>{_P.exports=Iae;function Iae(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}});var xx=E((_Ne,xP)=>{var Cae=H1(),Tae=wP()();xP.exports=tt;function tt(e){let t=this;t.currentProvider=e}tt.prototype.getBalance=Eh(2,"eth_getBalance");tt.prototype.getCode=Eh(2,"eth_getCode");tt.prototype.getTransactionCount=Eh(2,"eth_getTransactionCount");tt.prototype.getStorageAt=Eh(3,"eth_getStorageAt");tt.prototype.call=Eh(2,"eth_call");tt.prototype.protocolVersion=xt("eth_protocolVersion");tt.prototype.syncing=xt("eth_syncing");tt.prototype.coinbase=xt("eth_coinbase");tt.prototype.mining=xt("eth_mining");tt.prototype.hashrate=xt("eth_hashrate");tt.prototype.gasPrice=xt("eth_gasPrice");tt.prototype.accounts=xt("eth_accounts");tt.prototype.blockNumber=xt("eth_blockNumber");tt.prototype.getBlockTransactionCountByHash=xt("eth_getBlockTransactionCountByHash");tt.prototype.getBlockTransactionCountByNumber=xt("eth_getBlockTransactionCountByNumber");tt.prototype.getUncleCountByBlockHash=xt("eth_getUncleCountByBlockHash");tt.prototype.getUncleCountByBlockNumber=xt("eth_getUncleCountByBlockNumber");tt.prototype.sign=xt("eth_sign");tt.prototype.sendTransaction=xt("eth_sendTransaction");tt.prototype.sendRawTransaction=xt("eth_sendRawTransaction");tt.prototype.estimateGas=xt("eth_estimateGas");tt.prototype.getBlockByHash=xt("eth_getBlockByHash");tt.prototype.getBlockByNumber=xt("eth_getBlockByNumber");tt.prototype.getTransactionByHash=xt("eth_getTransactionByHash");tt.prototype.getTransactionByBlockHashAndIndex=xt("eth_getTransactionByBlockHashAndIndex");tt.prototype.getTransactionByBlockNumberAndIndex=xt("eth_getTransactionByBlockNumberAndIndex");tt.prototype.getTransactionReceipt=xt("eth_getTransactionReceipt");tt.prototype.getUncleByBlockHashAndIndex=xt("eth_getUncleByBlockHashAndIndex");tt.prototype.getUncleByBlockNumberAndIndex=xt("eth_getUncleByBlockNumberAndIndex");tt.prototype.getCompilers=xt("eth_getCompilers");tt.prototype.compileLLL=xt("eth_compileLLL");tt.prototype.compileSolidity=xt("eth_compileSolidity");tt.prototype.compileSerpent=xt("eth_compileSerpent");tt.prototype.newFilter=xt("eth_newFilter");tt.prototype.newBlockFilter=xt("eth_newBlockFilter");tt.prototype.newPendingTransactionFilter=xt("eth_newPendingTransactionFilter");tt.prototype.uninstallFilter=xt("eth_uninstallFilter");tt.prototype.getFilterChanges=xt("eth_getFilterChanges");tt.prototype.getFilterLogs=xt("eth_getFilterLogs");tt.prototype.getLogs=xt("eth_getLogs");tt.prototype.getWork=xt("eth_getWork");tt.prototype.submitWork=xt("eth_submitWork");tt.prototype.submitHashrate=xt("eth_submitHashrate");tt.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(kae(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function xt(e){return function(){let t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function Eh(e,t){return function(){let r=this;var n=[].slice.call(arguments),i=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},i)}}function kae(e){return Cae({id:Tae(),jsonrpc:"2.0",params:[]},e)}});var PP=E((wNe,Mx)=>{"use strict";var Uf=typeof Reflect=="object"?Reflect:null,MP=Uf&&typeof Uf.apply=="function"?Uf.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},W1;Uf&&typeof Uf.ownKeys=="function"?W1=Uf.ownKeys:Object.getOwnPropertySymbols?W1=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:W1=function(t){return Object.getOwnPropertyNames(t)};function Pae(e){console&&console.warn&&console.warn(e)}var EP=Number.isNaN||function(t){return t!==t};function Xt(){Xt.init.call(this)}Mx.exports=Xt;Mx.exports.once=Bae;Xt.EventEmitter=Xt;Xt.prototype._events=void 0;Xt.prototype._eventsCount=0;Xt.prototype._maxListeners=void 0;var SP=10;function z1(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Xt,"defaultMaxListeners",{enumerable:!0,get:function(){return SP},set:function(e){if(typeof e!="number"||e<0||EP(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");SP=e}});Xt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Xt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||EP(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function AP(e){return e._maxListeners===void 0?Xt.defaultMaxListeners:e._maxListeners}Xt.prototype.getMaxListeners=function(){return AP(this)};Xt.prototype.emit=function(t){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=t==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var v=o[t];if(v===void 0)return!1;if(typeof v=="function")MP(v,this,r);else for(var y=v.length,w=TP(v,y),n=0;n<y;++n)MP(w[n],this,r);return!0};function OP(e,t,r,n){var i,o,a;if(z1(r),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),a===void 0)a=o[t]=r,++e._eventsCount;else if(typeof a=="function"?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),i=AP(e),i>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,Pae(c)}return e}Xt.prototype.addListener=function(t,r){return OP(this,t,r,!1)};Xt.prototype.on=Xt.prototype.addListener;Xt.prototype.prependListener=function(t,r){return OP(this,t,r,!0)};function Nae(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function RP(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=Nae.bind(n);return i.listener=r,n.wrapFn=i,i}Xt.prototype.once=function(t,r){return z1(r),this.on(t,RP(this,t,r)),this};Xt.prototype.prependOnceListener=function(t,r){return z1(r),this.prependListener(t,RP(this,t,r)),this};Xt.prototype.removeListener=function(t,r){var n,i,o,a,c;if(z1(r),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){c=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():qae(n,o),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",t,c||r)}return this};Xt.prototype.off=Xt.prototype.removeListener;Xt.prototype.removeAllListeners=function(t){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),a;for(i=0;i<o.length;++i)a=o[i],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(t,r[i]);return this};function IP(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Lae(i):TP(i,i.length)}Xt.prototype.listeners=function(t){return IP(this,t,!0)};Xt.prototype.rawListeners=function(t){return IP(this,t,!1)};Xt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):CP.call(e,t)};Xt.prototype.listenerCount=CP;function CP(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Xt.prototype.eventNames=function(){return this._eventsCount>0?W1(this._events):[]};function TP(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function qae(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Lae(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function Bae(e,t){return new Promise(function(r,n){function i(a){e.removeListener(t,o),n(a)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",i),r([].slice.call(arguments))}kP(e,t,o,{once:!0}),t!=="error"&&Dae(e,i,{once:!0})})}function Dae(e,t,r){typeof e.on=="function"&&kP(e,"error",t,r)}function kP(e,t,r,n){if(typeof e.on=="function")n.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}});var BP=E((xNe,LP)=>{var jae=$o(),qP=PP(),Sx=typeof Reflect=="object"?Reflect:null,Fae=Sx&&typeof Sx.apply=="function"?Sx.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)};LP.exports=Ex;function Ex(){qP.call(this)}jae.inherits(Ex,qP);Ex.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n=e==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[e];if(c===void 0)return!1;if(typeof c=="function")NP(c,this,t);else for(var v=c.length,y=Uae(c,v),r=0;r<v;++r)NP(y[r],this,t);return!0};function NP(e,t,r){try{Fae(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Uae(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}});var UP=E((ENe,FP)=>{var MNe=xx(),SNe=wx(),Hae=BP(),Wae=1e3,zae=(e,t)=>e+t,DP=["sync","latest"],Ax=class extends Hae{constructor(t={}){super(),this._blockResetDuration=t.blockResetDuration||20*Wae,this._blockResetTimeout,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t,r){!DP.includes(t)||this._maybeStart()}_onRemoveListener(t,r){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){!this._isRunning||(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return DP.map(t=>this.listenerCount(t)).reduce(zae)}_newPotentialLatest(t){let r=this._currentBlock;r&&jP(t)<=jP(r)||this._setCurrentBlock(t)}_setCurrentBlock(t){let r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}};FP.exports=Ax;function jP(e){return Number.parseInt(e,16)}});var Rx=E((ANe,WP)=>{var Vae=wx(),$ae=UP(),Kae=1e3,Ox=class extends $ae{constructor(t={}){if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");let r=t.pollingInterval||20*Kae,n=t.retryTimeout||r/10,i=t.keepEventLoopActive!==void 0?t.keepEventLoopActive:!0,o=t.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:r},t)),this._provider=t.provider,this._pollingInterval=r,this._retryTimeout=n,this._keepEventLoopActive=i,this._setSkipCacheFlag=o}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}_start(){this._performSync().catch(t=>this.emit("error",t))}async _performSync(){for(;this._isRunning;)try{await this._updateLatestBlock(),await HP(this._pollingInterval,!this._keepEventLoopActive)}catch(t){let r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
539
+ ${t.stack}`);try{this.emit("error",r)}catch{console.error(r)}await HP(this._retryTimeout,!this._keepEventLoopActive)}}async _updateLatestBlock(){let t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){let t={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0);let r=await Vae(n=>this._provider.sendAsync(t,n))();if(r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
540
+ ${r.error}`);return r.result}};WP.exports=Ox;function HP(e,t){return new Promise(r=>{let n=setTimeout(r,e);n.unref&&t&&n.unref()})}});var Ix=E((ONe,zP)=>{var Gae=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis;zP.exports=Gae});var Cx=E((RNe,VP)=>{var Zae=Ix(),Yae=typeof self=="object"&&self&&self.Object===Object&&self,Jae=Zae||Yae||Function("return this")();VP.exports=Jae});var Tx=E((INe,$P)=>{var Qae=Cx(),Xae=Qae.Symbol;$P.exports=Xae});var YP=E((CNe,ZP)=>{var KP=Tx(),GP=Object.prototype,eue=GP.hasOwnProperty,tue=GP.toString,Ah=KP?KP.toStringTag:void 0;function rue(e){var t=eue.call(e,Ah),r=e[Ah];try{e[Ah]=void 0;var n=!0}catch{}var i=tue.call(e);return n&&(t?e[Ah]=r:delete e[Ah]),i}ZP.exports=rue});var QP=E((TNe,JP)=>{var nue=Object.prototype,iue=nue.toString;function oue(e){return iue.call(e)}JP.exports=oue});var V1=E((kNe,tN)=>{var XP=Tx(),sue=YP(),aue=QP(),uue="[object Null]",fue="[object Undefined]",eN=XP?XP.toStringTag:void 0;function cue(e){return e==null?e===void 0?fue:uue:eN&&eN in Object(e)?sue(e):aue(e)}tN.exports=cue});var kx=E((PNe,rN)=>{function lue(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}rN.exports=lue});var iN=E((NNe,nN)=>{var hue=V1(),due=kx(),pue="[object AsyncFunction]",vue="[object Function]",mue="[object GeneratorFunction]",gue="[object Proxy]";function bue(e){if(!due(e))return!1;var t=hue(e);return t==vue||t==mue||t==pue||t==gue}nN.exports=bue});var Px=E((qNe,oN)=>{var yue=9007199254740991;function _ue(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yue}oN.exports=_ue});var Oh=E((LNe,sN)=>{var wue=iN(),xue=Px();function Mue(e){return e!=null&&xue(e.length)&&!wue(e)}sN.exports=Mue});var Nx=E(($1,aN)=>{"use strict";Object.defineProperty($1,"__esModule",{value:!0});$1.default={};aN.exports=$1.default});var Hf=E((BNe,uN)=>{function Sue(){}uN.exports=Sue});var G1=E((K1,fN)=>{"use strict";Object.defineProperty(K1,"__esModule",{value:!0});K1.default=Eue;function Eue(e){return function(){if(e!==null){var t=e;e=null,t.apply(this,arguments)}}}fN.exports=K1.default});var lN=E((Z1,cN)=>{"use strict";Object.defineProperty(Z1,"__esModule",{value:!0});Z1.default=function(e){return qx&&e[qx]&&e[qx]()};var qx=typeof Symbol=="function"&&Symbol.iterator;cN.exports=Z1.default});var dN=E((DNe,hN)=>{function Aue(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}hN.exports=Aue});var Y1=E((jNe,pN)=>{function Oue(e){return e!=null&&typeof e=="object"}pN.exports=Oue});var mN=E((FNe,vN)=>{var Rue=V1(),Iue=Y1(),Cue="[object Arguments]";function Tue(e){return Iue(e)&&Rue(e)==Cue}vN.exports=Tue});var _N=E((UNe,yN)=>{var gN=mN(),kue=Y1(),bN=Object.prototype,Pue=bN.hasOwnProperty,Nue=bN.propertyIsEnumerable,que=gN(function(){return arguments}())?gN:function(e){return kue(e)&&Pue.call(e,"callee")&&!Nue.call(e,"callee")};yN.exports=que});var Lx=E((HNe,wN)=>{var Lue=Array.isArray;wN.exports=Lue});var MN=E((WNe,xN)=>{function Bue(){return!1}xN.exports=Bue});var ON=E((Rh,Wf)=>{var Due=Cx(),jue=MN(),AN=typeof Rh=="object"&&Rh&&!Rh.nodeType&&Rh,SN=AN&&typeof Wf=="object"&&Wf&&!Wf.nodeType&&Wf,Fue=SN&&SN.exports===AN,EN=Fue?Due.Buffer:void 0,Uue=EN?EN.isBuffer:void 0,Hue=Uue||jue;Wf.exports=Hue});var IN=E((zNe,RN)=>{var Wue=9007199254740991,zue=/^(?:0|[1-9]\d*)$/;function Vue(e,t){var r=typeof e;return t=t??Wue,!!t&&(r=="number"||r!="symbol"&&zue.test(e))&&e>-1&&e%1==0&&e<t}RN.exports=Vue});var TN=E((VNe,CN)=>{var $ue=V1(),Kue=Px(),Gue=Y1(),Zue="[object Arguments]",Yue="[object Array]",Jue="[object Boolean]",Que="[object Date]",Xue="[object Error]",efe="[object Function]",tfe="[object Map]",rfe="[object Number]",nfe="[object Object]",ife="[object RegExp]",ofe="[object Set]",sfe="[object String]",afe="[object WeakMap]",ufe="[object ArrayBuffer]",ffe="[object DataView]",cfe="[object Float32Array]",lfe="[object Float64Array]",hfe="[object Int8Array]",dfe="[object Int16Array]",pfe="[object Int32Array]",vfe="[object Uint8Array]",mfe="[object Uint8ClampedArray]",gfe="[object Uint16Array]",bfe="[object Uint32Array]",pr={};pr[cfe]=pr[lfe]=pr[hfe]=pr[dfe]=pr[pfe]=pr[vfe]=pr[mfe]=pr[gfe]=pr[bfe]=!0;pr[Zue]=pr[Yue]=pr[ufe]=pr[Jue]=pr[ffe]=pr[Que]=pr[Xue]=pr[efe]=pr[tfe]=pr[rfe]=pr[nfe]=pr[ife]=pr[ofe]=pr[sfe]=pr[afe]=!1;function yfe(e){return Gue(e)&&Kue(e.length)&&!!pr[$ue(e)]}CN.exports=yfe});var PN=E(($Ne,kN)=>{function _fe(e){return function(t){return e(t)}}kN.exports=_fe});var qN=E((Ih,zf)=>{var wfe=Ix(),NN=typeof Ih=="object"&&Ih&&!Ih.nodeType&&Ih,Ch=NN&&typeof zf=="object"&&zf&&!zf.nodeType&&zf,xfe=Ch&&Ch.exports===NN,Bx=xfe&&wfe.process,Mfe=function(){try{var e=Ch&&Ch.require&&Ch.require("util").types;return e||Bx&&Bx.binding&&Bx.binding("util")}catch{}}();zf.exports=Mfe});var jN=E((KNe,DN)=>{var Sfe=TN(),Efe=PN(),LN=qN(),BN=LN&&LN.isTypedArray,Afe=BN?Efe(BN):Sfe;DN.exports=Afe});var UN=E((GNe,FN)=>{var Ofe=dN(),Rfe=_N(),Ife=Lx(),Cfe=ON(),Tfe=IN(),kfe=jN(),Pfe=Object.prototype,Nfe=Pfe.hasOwnProperty;function qfe(e,t){var r=Ife(e),n=!r&&Rfe(e),i=!r&&!n&&Cfe(e),o=!r&&!n&&!i&&kfe(e),a=r||n||i||o,c=a?Ofe(e.length,String):[],v=c.length;for(var y in e)(t||Nfe.call(e,y))&&!(a&&(y=="length"||i&&(y=="offset"||y=="parent")||o&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||Tfe(y,v)))&&c.push(y);return c}FN.exports=qfe});var WN=E((ZNe,HN)=>{var Lfe=Object.prototype;function Bfe(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Lfe;return e===r}HN.exports=Bfe});var VN=E((YNe,zN)=>{function Dfe(e,t){return function(r){return e(t(r))}}zN.exports=Dfe});var KN=E((JNe,$N)=>{var jfe=VN(),Ffe=jfe(Object.keys,Object);$N.exports=Ffe});var ZN=E((QNe,GN)=>{var Ufe=WN(),Hfe=KN(),Wfe=Object.prototype,zfe=Wfe.hasOwnProperty;function Vfe(e){if(!Ufe(e))return Hfe(e);var t=[];for(var r in Object(e))zfe.call(e,r)&&r!="constructor"&&t.push(r);return t}GN.exports=Vfe});var JN=E((XNe,YN)=>{var $fe=UN(),Kfe=ZN(),Gfe=Oh();function Zfe(e){return Gfe(e)?$fe(e):Kfe(e)}YN.exports=Zfe});var XN=E((J1,QN)=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});J1.default=oce;var Yfe=Oh(),Jfe=Dx(Yfe),Qfe=lN(),Xfe=Dx(Qfe),ece=JN(),tce=Dx(ece);function Dx(e){return e&&e.__esModule?e:{default:e}}function rce(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}function nce(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}function ice(e){var t=(0,tce.default)(e),r=-1,n=t.length;return function i(){var o=t[++r];return o==="__proto__"?i():r<n?{value:e[o],key:o}:null}}function oce(e){if((0,Jfe.default)(e))return rce(e);var t=(0,Xfe.default)(e);return t?nce(t):ice(e)}QN.exports=J1.default});var X1=E((Q1,eq)=>{"use strict";Object.defineProperty(Q1,"__esModule",{value:!0});Q1.default=sce;function sce(e){return function(){if(e===null)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,arguments)}}eq.exports=Q1.default});var jx=E((em,tq)=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.default=gce;var ace=Hf(),uce=Th(ace),fce=G1(),cce=Th(fce),lce=XN(),hce=Th(lce),dce=X1(),pce=Th(dce),vce=Nx(),mce=Th(vce);function Th(e){return e&&e.__esModule?e:{default:e}}function gce(e){return function(t,r,n){if(n=(0,cce.default)(n||uce.default),e<=0||!t)return n(null);var i=(0,hce.default)(t),o=!1,a=0,c=!1;function v(w,M){if(a-=1,w)o=!0,n(w);else{if(M===mce.default||o&&a<=0)return o=!0,n(null);c||y()}}function y(){for(c=!0;a<e&&!o;){var w=i();if(w===null){o=!0,a<=0&&n(null);return}a+=1,r(w.value,w.key,(0,pce.default)(v))}c=!1}y()}}tq.exports=em.default});var kh=E((tm,rq)=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.default=bce;function bce(e,t){t=t|0;for(var r=Math.max(e.length-t,0),n=Array(r),i=0;i<r;i++)n[i]=e[t+i];return n}rq.exports=tm.default});var iq=E((rm,nq)=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.default=function(e){return function(){var t=(0,_ce.default)(arguments),r=t.pop();e.call(this,t,r)}};var yce=kh(),_ce=wce(yce);function wce(e){return e&&e.__esModule?e:{default:e}}nq.exports=rm.default});var aq=E(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.hasNextTick=Xo.hasSetImmediate=void 0;Xo.fallback=oq;Xo.wrap=sq;var xce=kh(),Mce=Sce(xce);function Sce(e){return e&&e.__esModule?e:{default:e}}var Ece=Xo.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,Ace=Xo.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function oq(e){setTimeout(e,0)}function sq(e){return function(t){var r=(0,Mce.default)(arguments,1);e(function(){t.apply(null,r)})}}var nm;Ece?nm=setImmediate:Ace?nm=process.nextTick:nm=oq;Xo.default=sq(nm)});var cq=E((im,fq)=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.default=Pce;var Oce=kx(),Rce=Fx(Oce),Ice=iq(),Cce=Fx(Ice),Tce=aq(),kce=Fx(Tce);function Fx(e){return e&&e.__esModule?e:{default:e}}function Pce(e){return(0,Cce.default)(function(t,r){var n;try{n=e.apply(this,t)}catch(i){return r(i)}(0,Rce.default)(n)&&typeof n.then=="function"?n.then(function(i){uq(r,null,i)},function(i){uq(r,i.message?i:new Error(i))}):r(null,n)})}function uq(e,t,r){try{e(t,r)}catch(n){(0,kce.default)(Nce,n)}}function Nce(e){throw e}fq.exports=im.default});var Ds=E(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.isAsync=void 0;var qce=cq(),Lce=Bce(qce);function Bce(e){return e&&e.__esModule?e:{default:e}}var Dce=typeof Symbol=="function";function lq(e){return Dce&&e[Symbol.toStringTag]==="AsyncFunction"}function jce(e){return lq(e)?(0,Lce.default)(e):e}Ph.default=jce;Ph.isAsync=lq});var pq=E((om,dq)=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.default=zce;var Fce=jx(),Uce=hq(Fce),Hce=Ds(),Wce=hq(Hce);function hq(e){return e&&e.__esModule?e:{default:e}}function zce(e,t,r,n){(0,Uce.default)(t)(e,(0,Wce.default)(r),n)}dq.exports=om.default});var Ux=E((sm,vq)=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.default=Vce;function Vce(e,t){return function(r,n,i){return e(r,t,n,i)}}vq.exports=sm.default});var Hx=E((am,mq)=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.default=function(e,t,r){var n=(0,Kce.default)(e)?ule:fle;n(e,(0,ale.default)(t),r)};var $ce=Oh(),Kce=js($ce),Gce=Nx(),Zce=js(Gce),Yce=pq(),Jce=js(Yce),Qce=Ux(),Xce=js(Qce),ele=Hf(),tle=js(ele),rle=G1(),nle=js(rle),ile=X1(),ole=js(ile),sle=Ds(),ale=js(sle);function js(e){return e&&e.__esModule?e:{default:e}}function ule(e,t,r){r=(0,nle.default)(r||tle.default);var n=0,i=0,o=e.length;o===0&&r(null);function a(c,v){c?r(c):(++i===o||v===Zce.default)&&r(null)}for(;n<o;n++)t(e[n],n,(0,ole.default)(a))}var fle=(0,Xce.default)(Jce.default,1/0);mq.exports=am.default});var yq=E((um,bq)=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.default=ple;var cle=Hx(),lle=gq(cle),hle=Ds(),dle=gq(hle);function gq(e){return e&&e.__esModule?e:{default:e}}function ple(e){return function(t,r,n){return e(lle.default,t,(0,dle.default)(r),n)}}bq.exports=um.default});var xq=E((fm,wq)=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.default=yle;var vle=Hf(),mle=_q(vle),gle=Ds(),ble=_q(gle);function _q(e){return e&&e.__esModule?e:{default:e}}function yle(e,t,r,n){n=n||mle.default,t=t||[];var i=[],o=0,a=(0,ble.default)(r);e(t,function(c,v,y){var w=o++;a(c,function(M,S){i[w]=S,y(M)})},function(c){n(c,i)})}wq.exports=fm.default});var Eq=E((cm,Sq)=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var _le=yq(),wle=Mq(_le),xle=xq(),Mle=Mq(xle);function Mq(e){return e&&e.__esModule?e:{default:e}}cm.default=(0,wle.default)(Mle.default);Sq.exports=cm.default});var Oq=E((lm,Aq)=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.default=Sle;function Sle(e){return function(t,r,n){return e(t,n)}}Aq.exports=lm.default});var Iq=E((hm,Rq)=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.default=Tle;var Ele=jx(),Ale=Wx(Ele),Ole=Oq(),Rle=Wx(Ole),Ile=Ds(),Cle=Wx(Ile);function Wx(e){return e&&e.__esModule?e:{default:e}}function Tle(e,t,r,n){(0,Ale.default)(t)(e,(0,Rle.default)((0,Cle.default)(r)),n)}Rq.exports=hm.default});var kq=E((dm,Tq)=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var kle=Iq(),Ple=Cq(kle),Nle=Ux(),qle=Cq(Nle);function Cq(e){return e&&e.__esModule?e:{default:e}}dm.default=(0,qle.default)(Ple.default,1);Tq.exports=dm.default});var qq=E((rqe,Nq)=>{var Pq=bf().EventEmitter,Lle=$o().inherits;Nq.exports=Nh;Lle(Nh,Pq);function Nh(){let e=this;Pq.call(e),e.isLocked=!0}Nh.prototype.go=function(){let e=this;e.isLocked=!1,e.emit("unlock")};Nh.prototype.stop=function(){let e=this;e.isLocked=!0,e.emit("lock")};Nh.prototype.await=function(e){let t=this;t.isLocked?t.once("unlock",e):setTimeout(e)}});var Fq=E((nqe,jq)=>{"use strict";var pm,rt,Lq={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
541
+ `,r:"\r",t:" "},zx;function Fs(e){throw{name:"SyntaxError",message:e,at:pm,text:zx}}function kt(e){return e&&e!==rt&&Fs("Expected '"+e+"' instead of '"+rt+"'"),rt=zx.charAt(pm),pm+=1,rt}function Bq(){var e,t="";for(rt==="-"&&(t="-",kt("-"));rt>="0"&&rt<="9";)t+=rt,kt();if(rt===".")for(t+=".";kt()&&rt>="0"&&rt<="9";)t+=rt;if(rt==="e"||rt==="E")for(t+=rt,kt(),(rt==="-"||rt==="+")&&(t+=rt,kt());rt>="0"&&rt<="9";)t+=rt,kt();return e=Number(t),isFinite(e)||Fs("Bad number"),e}function Dq(){var e,t,r="",n;if(rt==='"')for(;kt();){if(rt==='"')return kt(),r;if(rt==="\\")if(kt(),rt==="u"){for(n=0,t=0;t<4&&(e=parseInt(kt(),16),!!isFinite(e));t+=1)n=n*16+e;r+=String.fromCharCode(n)}else if(typeof Lq[rt]=="string")r+=Lq[rt];else break;else r+=rt}Fs("Bad string")}function es(){for(;rt&&rt<=" ";)kt()}function Ble(){switch(rt){case"t":return kt("t"),kt("r"),kt("u"),kt("e"),!0;case"f":return kt("f"),kt("a"),kt("l"),kt("s"),kt("e"),!1;case"n":return kt("n"),kt("u"),kt("l"),kt("l"),null;default:Fs("Unexpected '"+rt+"'")}}function Dle(){var e=[];if(rt==="["){if(kt("["),es(),rt==="]")return kt("]"),e;for(;rt;){if(e.push(vm()),es(),rt==="]")return kt("]"),e;kt(","),es()}}Fs("Bad array")}function jle(){var e,t={};if(rt==="{"){if(kt("{"),es(),rt==="}")return kt("}"),t;for(;rt;){if(e=Dq(),es(),kt(":"),Object.prototype.hasOwnProperty.call(t,e)&&Fs('Duplicate key "'+e+'"'),t[e]=vm(),es(),rt==="}")return kt("}"),t;kt(","),es()}}Fs("Bad object")}function vm(){switch(es(),rt){case"{":return jle();case"[":return Dle();case'"':return Dq();case"-":return Bq();default:return rt>="0"&&rt<="9"?Bq():Ble()}}jq.exports=function(e,t){var r;return zx=e,pm=0,rt=" ",r=vm(),es(),rt&&Fs("Syntax error"),typeof t=="function"?function n(i,o){var a,c,v=i[o];if(v&&typeof v=="object")for(a in vm)Object.prototype.hasOwnProperty.call(v,a)&&(c=n(v,a),typeof c>"u"?delete v[a]:v[a]=c);return t.call(i,o,v)}({"":r},""):r}});var Hq=E((iqe,Uq)=>{"use strict";var Vx=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,ti,mm,Fle={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},au;function $x(e){return Vx.lastIndex=0,Vx.test(e)?'"'+e.replace(Vx,function(t){var r=Fle[t];return typeof r=="string"?r:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function gm(e,t){var r,n,i,o,a=ti,c,v=t[e];switch(v&&typeof v=="object"&&typeof v.toJSON=="function"&&(v=v.toJSON(e)),typeof au=="function"&&(v=au.call(t,e,v)),typeof v){case"string":return $x(v);case"number":return isFinite(v)?String(v):"null";case"boolean":case"null":return String(v);case"object":if(!v)return"null";if(ti+=mm,c=[],Object.prototype.toString.apply(v)==="[object Array]"){for(o=v.length,r=0;r<o;r+=1)c[r]=gm(r,v)||"null";return i=c.length===0?"[]":ti?`[
542
+ `+ti+c.join(`,
543
+ `+ti)+`
544
+ `+a+"]":"["+c.join(",")+"]",ti=a,i}if(au&&typeof au=="object")for(o=au.length,r=0;r<o;r+=1)n=au[r],typeof n=="string"&&(i=gm(n,v),i&&c.push($x(n)+(ti?": ":":")+i));else for(n in v)Object.prototype.hasOwnProperty.call(v,n)&&(i=gm(n,v),i&&c.push($x(n)+(ti?": ":":")+i));return i=c.length===0?"{}":ti?`{
545
+ `+ti+c.join(`,
546
+ `+ti)+`
547
+ `+a+"}":"{"+c.join(",")+"}",ti=a,i;default:}}Uq.exports=function(e,t,r){var n;if(ti="",mm="",typeof r=="number")for(n=0;n<r;n+=1)mm+=" ";else typeof r=="string"&&(mm=r);if(au=t,t&&typeof t!="function"&&(typeof t!="object"||typeof t.length!="number"))throw new Error("JSON.stringify");return gm("",{"":e})}});var Wq=E(Kx=>{"use strict";Kx.parse=Fq();Kx.stringify=Hq()});var Gx=E((sqe,zq)=>{"use strict";var bm=typeof JSON<"u"?JSON:Wq(),Ule=Array.isArray||function(e){return{}.toString.call(e)==="[object Array]"},Hle=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},r=[];for(var n in e)t.call(e,n)&&r.push(n);return r};zq.exports=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var r=t.space||"";typeof r=="number"&&(r=Array(r+1).join(" "));var n=typeof t.cycles=="boolean"?t.cycles:!1,i=t.replacer||function(c,v){return v},o=t.cmp&&function(c){return function(v){return function(y,w){var M={key:y,value:v[y]},S={key:w,value:v[w]};return c(M,S)}}}(t.cmp),a=[];return function c(v,y,w,M){var S=r?`
548
+ `+new Array(M+1).join(r):"",R=r?": ":":";if(w&&w.toJSON&&typeof w.toJSON=="function"&&(w=w.toJSON()),w=i.call(v,y,w),w!==void 0){if(typeof w!="object"||w===null)return bm.stringify(w);if(Ule(w)){for(var q=[],C=0;C<w.length;C++){var B=c(w,C,w[C],M+1)||bm.stringify(null);q.push(S+r+B)}return"["+q.join(",")+S+"]"}if(a.indexOf(w)!==-1){if(n)return bm.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}else a.push(w);for(var N=Hle(w).sort(o&&o(w)),q=[],C=0;C<N.length;C++){var y=N[C],H=c(w,y,w[y],M+1);if(!!H){var D=bm.stringify(y)+R+H;q.push(S+r+D)}}return a.splice(a.indexOf(w),1),"{"+q.join(",")+S+"}"}}({"":e},"",e,0)}});var Yx=E((aqe,Gq)=>{var Wle=Gx();Gq.exports={cacheIdentifierForPayload:zle,canCache:Vq,blockTagForPayload:Vle,paramsWithoutBlockTag:$q,blockTagParamIndex:Zx,cacheTypeForPayload:Kq};function zle(e,t={}){if(!Vq(e))return null;let{includeBlockRef:r}=t,n=r?e.params:$q(e);return e.method+":"+Wle(n)}function Vq(e){return Kq(e)!=="never"}function Vle(e){var t=Zx(e);return t>=e.params.length?null:e.params[t]}function $q(e){var t=Zx(e);return t>=e.params.length?e.params:e.method==="eth_getBlockByNumber"?e.params.slice(1):e.params.slice(0,t)}function Zx(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function Kq(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}});var Yq=E((uqe,Zq)=>{Zq.exports=$le;function $le(){return Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}});var ym=E((fqe,Jq)=>{var Kle=Yq(),Gle=H1();Jq.exports=Zle;function Zle(e){return Gle({id:Kle(),jsonrpc:"2.0",params:[]},e)}});var eL=E((lqe,Xq)=>{var Qq=bf().EventEmitter,Yle=$o().inherits,Gr=Ff(),Jle=Rx(),Qle=Eq(),Xle=kq(),ehe=qq(),cqe=Yx(),the=ym(),rhe=function(){};Xq.exports=ri;Yle(ri,Qq);function ri(e){let t=this;Qq.call(t),t.setMaxListeners(30),e=e||{};let r={sendAsync:t._handleAsync.bind(t)},n=e.blockTrackerProvider||r;t._blockTracker=e.blockTracker||new Jle({provider:n,pollingInterval:e.pollingInterval||4e3,setSkipCacheFlag:!0}),t._ready=new ehe,t.currentBlock=null,t._providers=[]}ri.prototype.start=function(e=rhe){let t=this;t._ready.go(),t._blockTracker.on("latest",r=>{t._getBlockByNumberWithRetry(r,(n,i)=>{if(n){this.emit("error",n);return}if(!i){console.log(i),this.emit("error",new Error("Could not find block"));return}let o=nhe(i);t._setCurrentBlock(o),t.emit("rawBlock",i),t.emit("latest",i)})}),t._blockTracker.on("sync",t.emit.bind(t,"sync")),t._blockTracker.on("error",t.emit.bind(t,"error")),t._running=!0,t.emit("start")};ri.prototype.stop=function(){let e=this;e._blockTracker.removeAllListeners(),e._running=!1,e.emit("stop")};ri.prototype.isRunning=function(){return this._running};ri.prototype.addProvider=function(e,t){let r=this;typeof t=="number"?r._providers.splice(t,0,e):r._providers.push(e),e.setEngine(this)};ri.prototype.removeProvider=function(e){let t=this,r=t._providers.indexOf(e);if(r<0)throw new Error("Provider not found.");t._providers.splice(r,1)};ri.prototype.send=function(e){throw new Error("Web3ProviderEngine does not support synchronous requests.")};ri.prototype.sendAsync=function(e,t){let r=this;r._ready.await(function(){Array.isArray(e)?Qle(e,r._handleAsync.bind(r),t):r._handleAsync(e,t)})};ri.prototype._getBlockByNumberWithRetry=function(e,t){let r=this,n=5;i();return;function i(){r._getBlockByNumber(e,o)}function o(a,c){if(a)return t(a);if(!c)if(n>0){n--,setTimeout(function(){i()},1e3);return}else{t(null,null);return}t(null,c)}};ri.prototype._getBlockByNumber=function(e,t){let r=the({method:"eth_getBlockByNumber",params:[e,!1],skipCache:!0});this._handleAsync(r,(n,i)=>n?t(n):t(null,i.result))};ri.prototype._handleAsync=function(e,t){var r=this,n=-1,i=null,o=null,a=[];c();function c(y){if(n+=1,a.unshift(y),n>=r._providers.length)v(new Error('Request for method "'+e.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{var w=r._providers[n];w.handleRequest(e,c,v)}catch(M){v(M)}}function v(y,w){o=y,i=w,Xle(a,function(M,S){M?M(o,i,S):S()},function(){var M={id:e.id,jsonrpc:e.jsonrpc,result:i};o!=null?(M.error={message:o.stack||o.message||o,code:-32e3},t(o,M)):t(null,M)})}};ri.prototype._setCurrentBlock=function(e){let t=this;t.currentBlock=e,t.emit("block",e)};function nhe(e){return{number:Gr.toBuffer(e.number),hash:Gr.toBuffer(e.hash),parentHash:Gr.toBuffer(e.parentHash),nonce:Gr.toBuffer(e.nonce),mixHash:Gr.toBuffer(e.mixHash),sha3Uncles:Gr.toBuffer(e.sha3Uncles),logsBloom:Gr.toBuffer(e.logsBloom),transactionsRoot:Gr.toBuffer(e.transactionsRoot),stateRoot:Gr.toBuffer(e.stateRoot),receiptsRoot:Gr.toBuffer(e.receiptRoot||e.receiptsRoot),miner:Gr.toBuffer(e.miner),difficulty:Gr.toBuffer(e.difficulty),totalDifficulty:Gr.toBuffer(e.totalDifficulty),size:Gr.toBuffer(e.size),extraData:Gr.toBuffer(e.extraData),gasLimit:Gr.toBuffer(e.gasLimit),gasUsed:Gr.toBuffer(e.gasUsed),timestamp:Gr.toBuffer(e.timestamp),transactions:e.transactions}}});var qh=E((hqe,tL)=>{var ihe=ym();tL.exports=Vf;function Vf(){}Vf.prototype.setEngine=function(e){let t=this;t.engine||(t.engine=e,e.on("block",function(r){t.currentBlock=r}),e.on("start",function(){t.start()}),e.on("stop",function(){t.stop()}))};Vf.prototype.handleRequest=function(e,t,r){throw new Error("Subproviders should override `handleRequest`.")};Vf.prototype.emitPayload=function(e,t){this.engine.sendAsync(ihe(e),t)};Vf.prototype.stop=function(){};Vf.prototype.start=function(){}});var _m=E((dqe,rL)=>{var ohe=qh(),Jx=class extends ohe{constructor(t){if(super(),!t)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");this._constructorFn=t}setEngine(t){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");let r=t._blockTracker,n=this._constructorFn({engine:t,provider:t,blockTracker:r});if(!n)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if(typeof n!="function")throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=n}handleRequest(t,r,n){let i={id:t.id};this.middleware(t,i,o,a);function o(c){r((v,y,w)=>{v?(delete i.result,i.error={message:v.message||v}):i.result=y,c?c(w):w()})}function a(c){if(c)return n(c);n(null,i.result)}}};rL.exports=Jx});var aL=E((pqe,sL)=>{var she=Gx();sL.exports={cacheIdentifierForPayload:ahe,canCache:nL,blockTagForPayload:uhe,paramsWithoutBlockTag:iL,blockTagParamIndex:Qx,cacheTypeForPayload:oL};function ahe(e,t){let r=t?iL(e):e.params;return nL(e)?e.method+":"+she(r):null}function nL(e){return oL(e)!=="never"}function uhe(e){let t=Qx(e);return t>=e.params.length?null:e.params[t]}function iL(e){let t=Qx(e);return t>=e.params.length?e.params:e.method==="eth_getBlockByNumber"?e.params.slice(1):e.params.slice(0,t)}function Qx(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function oL(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}});var fL=E((vqe,uL)=>{uL.exports=function(t){return(r,n,i,o)=>{let a,c=new Promise(M=>{a=M}),v,y;t(r,n,async()=>{y=!0,i(M=>{v=M,a()}),await c}).then(async()=>{y?(await c,v(null)):o(null)}).catch(M=>{v?v(M):o(M)})}}});var lL=E((mqe,cL)=>{var $f=aL(),fhe=fL(),che=[void 0,null,"<nil>"];cL.exports=lhe;function lhe(e={}){let{blockTracker:t}=e;if(!t)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");let r=new Xx,n={perma:r,block:r,fork:r};return fhe(async(i,o,a)=>{if(i.skipCache)return a();let c=$f.cacheTypeForPayload(i),v=n[c];if(!v||!v.canCacheRequest(i))return a();let y=$f.blockTagForPayload(i);y||(y="latest");let w;if(y==="earliest")w="0x00";else if(y==="latest"){let S=await t.getLatestBlock();r.clearBefore(S),w=S}else w=y;let M=await v.get(i,w);M===void 0?(await a(),await v.set(i,w,o.result)):o.result=M})}var Xx=class{constructor(){this.cache={}}getBlockCacheForPayload(t,r){let n=Number.parseInt(r,16),i=this.cache[n];if(!i){let o={};this.cache[n]=o,i=o}return i}async get(t,r){let n=this.getBlockCacheForPayload(t,r);if(!n)return;let i=$f.cacheIdentifierForPayload(t,!0);return n[i]}async set(t,r,n){if(!this.canCacheResult(t,n))return;let o=this.getBlockCacheForPayload(t,r),a=$f.cacheIdentifierForPayload(t,!0);o[a]=n}canCacheRequest(t){return!(!$f.canCache(t)||$f.blockTagForPayload(t)==="pending")}canCacheResult(t,r){if(!che.includes(r))return!(["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(t.method)&&(!r||!r.blockHash||r.blockHash==="0x0000000000000000000000000000000000000000000000000000000000000000"))}clearBefore(t){let r=this,n=Number.parseInt(t,16);Object.keys(r.cache).map(Number).filter(i=>i<n).forEach(i=>delete r.cache[i])}}});var dL=E((gqe,hL)=>{var hhe=_m(),dhe=lL(),e3=class extends hhe{constructor(t){super(({blockTracker:r})=>dhe(Object.assign({blockTracker:r},t)))}};hL.exports=e3});var vL=E((bqe,pL)=>{var phe=$o().inherits,vhe=qh();pL.exports=t3;phe(t3,vhe);function t3(e){let t=this;e=e||{},t.staticResponses=e}t3.prototype.handleRequest=function(e,t,r){var i=this.staticResponses[e.method];typeof i=="function"?i(e,t,r):i!==void 0?setTimeout(()=>r(null,i)):t()}});var Sm=E((yqe,Mm)=>{var mL,gL,bL,yL,_L,wL,xL,ML,SL,EL,AL,OL,RL,wm,r3,IL,CL,TL,Kf,kL,PL,NL,qL,LL,BL,DL,jL,FL,xm;(function(e){var t=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Mm=="object"&&typeof Mm.exports=="object"?e(r(t,r(Mm.exports))):e(r(t));function r(n,i){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,a){return n[o]=i?i(o,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])};mL=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(n,i);function o(){this.constructor=n}n.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)},gL=Object.assign||function(n){for(var i,o=1,a=arguments.length;o<a;o++){i=arguments[o];for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&(n[c]=i[c])}return n},bL=function(n,i){var o={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(o[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)i.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(o[a[c]]=n[a[c]]);return o},yL=function(n,i,o,a){var c=arguments.length,v=c<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,o):a,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(n,i,o,a);else for(var w=n.length-1;w>=0;w--)(y=n[w])&&(v=(c<3?y(v):c>3?y(i,o,v):y(i,o))||v);return c>3&&v&&Object.defineProperty(i,o,v),v},_L=function(n,i){return function(o,a){i(o,a,n)}},wL=function(n,i,o,a,c,v){function y(ee){if(ee!==void 0&&typeof ee!="function")throw new TypeError("Function expected");return ee}for(var w=a.kind,M=w==="getter"?"get":w==="setter"?"set":"value",S=!i&&n?a.static?n:n.prototype:null,R=i||(S?Object.getOwnPropertyDescriptor(S,a.name):{}),C,B=!1,N=o.length-1;N>=0;N--){var q={};for(var H in a)q[H]=H==="access"?{}:a[H];for(var H in a.access)q.access[H]=a.access[H];q.addInitializer=function(ee){if(B)throw new TypeError("Cannot add initializers after decoration has completed");v.push(y(ee||null))};var D=(0,o[N])(w==="accessor"?{get:R.get,set:R.set}:R[M],q);if(w==="accessor"){if(D===void 0)continue;if(D===null||typeof D!="object")throw new TypeError("Object expected");(C=y(D.get))&&(R.get=C),(C=y(D.set))&&(R.set=C),(C=y(D.init))&&c.push(C)}else(C=y(D))&&(w==="field"?c.push(C):R[M]=C)}S&&Object.defineProperty(S,a.name,R),B=!0},xL=function(n,i,o){for(var a=arguments.length>2,c=0;c<i.length;c++)o=a?i[c].call(n,o):i[c].call(n);return a?o:void 0},ML=function(n){return typeof n=="symbol"?n:"".concat(n)},SL=function(n,i,o){return typeof i=="symbol"&&(i=i.description?"[".concat(i.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:o?"".concat(o," ",i):i})},EL=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},AL=function(n,i,o,a){function c(v){return v instanceof o?v:new o(function(y){y(v)})}return new(o||(o=Promise))(function(v,y){function w(R){try{S(a.next(R))}catch(C){y(C)}}function M(R){try{S(a.throw(R))}catch(C){y(C)}}function S(R){R.done?v(R.value):c(R.value).then(w,M)}S((a=a.apply(n,i||[])).next())})},OL=function(n,i){var o={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},a,c,v,y;return y={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function w(S){return function(R){return M([S,R])}}function M(S){if(a)throw new TypeError("Generator is already executing.");for(;y&&(y=0,S[0]&&(o=0)),o;)try{if(a=1,c&&(v=S[0]&2?c.return:S[0]?c.throw||((v=c.return)&&v.call(c),0):c.next)&&!(v=v.call(c,S[1])).done)return v;switch(c=0,v&&(S=[S[0]&2,v.value]),S[0]){case 0:case 1:v=S;break;case 4:return o.label++,{value:S[1],done:!1};case 5:o.label++,c=S[1],S=[0];continue;case 7:S=o.ops.pop(),o.trys.pop();continue;default:if(v=o.trys,!(v=v.length>0&&v[v.length-1])&&(S[0]===6||S[0]===2)){o=0;continue}if(S[0]===3&&(!v||S[1]>v[0]&&S[1]<v[3])){o.label=S[1];break}if(S[0]===6&&o.label<v[1]){o.label=v[1],v=S;break}if(v&&o.label<v[2]){o.label=v[2],o.ops.push(S);break}v[2]&&o.ops.pop(),o.trys.pop();continue}S=i.call(n,o)}catch(R){S=[6,R],c=0}finally{a=v=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}},RL=function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&xm(i,n,o)},xm=Object.create?function(n,i,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(i,o);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,c)}:function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]},wm=function(n){var i=typeof Symbol=="function"&&Symbol.iterator,o=i&&n[i],a=0;if(o)return o.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},r3=function(n,i){var o=typeof Symbol=="function"&&n[Symbol.iterator];if(!o)return n;var a=o.call(n),c,v=[],y;try{for(;(i===void 0||i-- >0)&&!(c=a.next()).done;)v.push(c.value)}catch(w){y={error:w}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(y)throw y.error}}return v},IL=function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(r3(arguments[i]));return n},CL=function(){for(var n=0,i=0,o=arguments.length;i<o;i++)n+=arguments[i].length;for(var a=Array(n),c=0,i=0;i<o;i++)for(var v=arguments[i],y=0,w=v.length;y<w;y++,c++)a[c]=v[y];return a},TL=function(n,i,o){if(o||arguments.length===2)for(var a=0,c=i.length,v;a<c;a++)(v||!(a in i))&&(v||(v=Array.prototype.slice.call(i,0,a)),v[a]=i[a]);return n.concat(v||Array.prototype.slice.call(i))},Kf=function(n){return this instanceof Kf?(this.v=n,this):new Kf(n)},kL=function(n,i,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(n,i||[]),c,v=[];return c={},y("next"),y("throw"),y("return"),c[Symbol.asyncIterator]=function(){return this},c;function y(B){a[B]&&(c[B]=function(N){return new Promise(function(q,H){v.push([B,N,q,H])>1||w(B,N)})})}function w(B,N){try{M(a[B](N))}catch(q){C(v[0][3],q)}}function M(B){B.value instanceof Kf?Promise.resolve(B.value.v).then(S,R):C(v[0][2],B)}function S(B){w("next",B)}function R(B){w("throw",B)}function C(B,N){B(N),v.shift(),v.length&&w(v[0][0],v[0][1])}},PL=function(n){var i,o;return i={},a("next"),a("throw",function(c){throw c}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(c,v){i[c]=n[c]?function(y){return(o=!o)?{value:Kf(n[c](y)),done:!1}:v?v(y):y}:v}},NL=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],o;return i?i.call(n):(n=typeof wm=="function"?wm(n):n[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(v){o[v]=n[v]&&function(y){return new Promise(function(w,M){y=n[v](y),c(w,M,y.done,y.value)})}}function c(v,y,w,M){Promise.resolve(M).then(function(S){v({value:S,done:w})},y)}},qL=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var r=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};LL=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var o in n)o!=="default"&&Object.prototype.hasOwnProperty.call(n,o)&&xm(i,n,o);return r(i,n),i},BL=function(n){return n&&n.__esModule?n:{default:n}},DL=function(n,i,o,a){if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?a:o==="a"?a.call(n):a?a.value:i.get(n)},jL=function(n,i,o,a,c){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?c.call(n,o):c?c.value=o:i.set(n,o),o},FL=function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},e("__extends",mL),e("__assign",gL),e("__rest",bL),e("__decorate",yL),e("__param",_L),e("__esDecorate",wL),e("__runInitializers",xL),e("__propKey",ML),e("__setFunctionName",SL),e("__metadata",EL),e("__awaiter",AL),e("__generator",OL),e("__exportStar",RL),e("__createBinding",xm),e("__values",wm),e("__read",r3),e("__spread",IL),e("__spreadArrays",CL),e("__spreadArray",TL),e("__await",Kf),e("__asyncGenerator",kL),e("__asyncDelegator",PL),e("__asyncValues",NL),e("__makeTemplateObject",qL),e("__importStar",LL),e("__importDefault",BL),e("__classPrivateFieldGet",DL),e("__classPrivateFieldSet",jL),e("__classPrivateFieldIn",FL)})});var i3=E(n3=>{"use strict";Object.defineProperty(n3,"__esModule",{value:!0});var UL=Sm(),mhe=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return UL.__awaiter(this,void 0,void 0,function(){var r,n,i;return UL.__generator(this,function(o){switch(o.label){case 0:return[4,this.acquire()];case 1:r=o.sent(),n=r[0],i=r[1],o.label=2;case 2:return o.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,o.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(!!r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();n3.default=mhe});var WL=E(o3=>{"use strict";Object.defineProperty(o3,"__esModule",{value:!0});var HL=Sm(),ghe=i3(),bhe=function(){function e(){this._semaphore=new ghe.default(1)}return e.prototype.acquire=function(){return HL.__awaiter(this,void 0,void 0,function(){var t,r;return HL.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();o3.default=bhe});var zL=E(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.withTimeout=void 0;var Em=Sm();function yhe(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,o){return Em.__awaiter(n,void 0,void 0,function(){var a,c,v;return Em.__generator(this,function(y){switch(y.label){case 0:return a=!1,setTimeout(function(){a=!0,o(r)},t),[4,e.acquire()];case 1:return c=y.sent(),a?(v=Array.isArray(c)?c[1]:c,v()):i(c),[2]}})})})},runExclusive:function(i){return Em.__awaiter(this,void 0,void 0,function(){var o,a;return Em.__generator(this,function(c){switch(c.label){case 0:o=function(){},c.label=1;case 1:return c.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=c.sent(),Array.isArray(a)?(o=a[1],[4,i(a[0])]):[3,4];case 3:return[2,c.sent()];case 4:return o=a,[4,i()];case 5:return[2,c.sent()];case 6:return[3,8];case 7:return o(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Am.withTimeout=yhe});var VL=E(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.withTimeout=Us.Semaphore=Us.Mutex=void 0;var _he=WL();Object.defineProperty(Us,"Mutex",{enumerable:!0,get:function(){return _he.default}});var whe=i3();Object.defineProperty(Us,"Semaphore",{enumerable:!0,get:function(){return whe.default}});var xhe=zL();Object.defineProperty(Us,"withTimeout",{enumerable:!0,get:function(){return xhe.withTimeout}})});var a3=E(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.getUniqueId=void 0;var $L=4294967295,s3=Math.floor(Math.random()*$L);function Mhe(){return s3=(s3+1)%$L,s3}Om.getUniqueId=Mhe});var KL=E(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.createIdRemapMiddleware=void 0;var She=a3();function Ehe(){return(e,t,r,n)=>{let i=e.id,o=She.getUniqueId();e.id=o,t.id=o,r(a=>{e.id=i,t.id=i,a()})}}Rm.createIdRemapMiddleware=Ehe});var GL=E(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.createAsyncMiddleware=void 0;function Ahe(e){return async(t,r,n,i)=>{let o,a=new Promise(w=>{o=w}),c=null,v=!1,y=async()=>{v=!0,n(w=>{c=w,o()}),await a};try{await e(t,r,y),v?(await a,c(null)):i(null)}catch(w){c?c(w):i(w)}}}Im.createAsyncMiddleware=Ahe});var ZL=E(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.createScaffoldMiddleware=void 0;function Ohe(e){return(t,r,n,i)=>{let o=e[t.method];return o===void 0?n():typeof o=="function"?o(t,r,n,i):(r.result=o,i())}}Cm.createScaffoldMiddleware=Ohe});var Lh=E(f3=>{"use strict";Object.defineProperty(f3,"__esModule",{value:!0});var Rhe=bf();function YL(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Ihe(e){let t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}var u3=class extends Rhe.EventEmitter{emit(t,...r){let n=t==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;let c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}let o=i[t];if(o===void 0)return!1;if(typeof o=="function")YL(o,this,r);else{let a=o.length,c=Ihe(o);for(let v=0;v<a;v+=1)YL(c[v],this,r)}return!0}};f3.default=u3});var h3=E((Iqe,tB)=>{tB.exports=Bh;Bh.default=Bh;Bh.stable=XL;Bh.stableStringify=XL;var Tm="[...]",JL="[Circular]",fu=[],uu=[];function QL(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Bh(e,t,r,n){typeof n>"u"&&(n=QL()),c3(e,"",0,[],void 0,0,n);var i;try{uu.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,eB(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;fu.length!==0;){var o=fu.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Gf(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),fu.push([n,r,t,i])):uu.push([t,r,e]):(n[r]=e,fu.push([n,r,t]))}function c3(e,t,r,n,i,o,a){o+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){Gf(JL,e,t,i);return}if(typeof a.depthLimit<"u"&&o>a.depthLimit){Gf(Tm,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Gf(Tm,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)c3(e[c],c,c,n,e,o,a);else{var v=Object.keys(e);for(c=0;c<v.length;c++){var y=v[c];c3(e[y],y,c,n,e,o,a)}}n.pop()}}function Che(e,t){return e<t?-1:e>t?1:0}function XL(e,t,r,n){typeof n>"u"&&(n=QL());var i=l3(e,"",0,[],void 0,0,n)||e,o;try{uu.length===0?o=JSON.stringify(i,t,r):o=JSON.stringify(i,eB(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;fu.length!==0;){var a=fu.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return o}function l3(e,t,r,n,i,o,a){o+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){Gf(JL,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof a.depthLimit<"u"&&o>a.depthLimit){Gf(Tm,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Gf(Tm,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)l3(e[c],c,c,n,e,o,a);else{var v={},y=Object.keys(e).sort(Che);for(c=0;c<y.length;c++){var w=y[c];l3(e[w],w,c,n,e,o,a),v[w]=e[w]}if(typeof i<"u")fu.push([i,t,e]),i[t]=v;else return v}n.pop()}}function eB(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(uu.length>0)for(var n=0;n<uu.length;n++){var i=uu[n];if(i[1]===t&&i[0]===r){r=i[2],uu.splice(n,1);break}}return e.call(this,t,r)}}});var Pm=E(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});Zf.EthereumProviderError=Zf.EthereumRpcError=void 0;var The=h3(),km=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return The.default(this.serialize(),Phe,2)}};Zf.EthereumRpcError=km;var d3=class extends km{constructor(t,r,n){if(!khe(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};Zf.EthereumProviderError=d3;function khe(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Phe(e,t){if(t!=="[Circular]")return t}});var Nm=E(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.errorValues=Yf.errorCodes=void 0;Yf.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Yf.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}});var m3=E(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.serializeError=Fi.isValidCode=Fi.getMessageFromCode=Fi.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var qm=Nm(),Nhe=Pm(),rB=qm.errorCodes.rpc.internal,qhe="Unspecified error message. This is a bug, please report it.",Lhe={code:rB,message:v3(rB)};Fi.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function v3(e,t=qhe){if(Number.isInteger(e)){let r=e.toString();if(p3(qm.errorValues,r))return qm.errorValues[r].message;if(oB(e))return Fi.JSON_RPC_SERVER_ERROR_MESSAGE}return t}Fi.getMessageFromCode=v3;function iB(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(qm.errorValues[t]||oB(e))}Fi.isValidCode=iB;function Bhe(e,{fallbackError:t=Lhe,shouldIncludeStack:r=!1}={}){var n,i;if(!t||!Number.isInteger(t.code)||typeof t.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof Nhe.EthereumRpcError)return e.serialize();let o={};if(e&&typeof e=="object"&&!Array.isArray(e)&&p3(e,"code")&&iB(e.code)){let c=e;o.code=c.code,c.message&&typeof c.message=="string"?(o.message=c.message,p3(c,"data")&&(o.data=c.data)):(o.message=v3(o.code),o.data={originalError:nB(e)})}else{o.code=t.code;let c=(n=e)===null||n===void 0?void 0:n.message;o.message=c&&typeof c=="string"?c:t.message,o.data={originalError:nB(e)}}let a=(i=e)===null||i===void 0?void 0:i.stack;return r&&e&&a&&typeof a=="string"&&(o.stack=a),o}Fi.serializeError=Bhe;function oB(e){return e>=-32099&&e<=-32e3}function nB(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.assign({},e):e}function p3(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var uB=E(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});Lm.ethErrors=void 0;var g3=Pm(),sB=m3(),bn=Nm();Lm.ethErrors={rpc:{parse:e=>xi(bn.errorCodes.rpc.parse,e),invalidRequest:e=>xi(bn.errorCodes.rpc.invalidRequest,e),invalidParams:e=>xi(bn.errorCodes.rpc.invalidParams,e),methodNotFound:e=>xi(bn.errorCodes.rpc.methodNotFound,e),internal:e=>xi(bn.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return xi(t,e)},invalidInput:e=>xi(bn.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>xi(bn.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>xi(bn.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>xi(bn.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>xi(bn.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>xi(bn.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Dh(bn.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Dh(bn.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Dh(bn.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Dh(bn.errorCodes.provider.disconnected,e),chainDisconnected:e=>Dh(bn.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new g3.EthereumProviderError(t,r,n)}}};function xi(e,t){let[r,n]=aB(t);return new g3.EthereumRpcError(e,r||sB.getMessageFromCode(e),n)}function Dh(e,t){let[r,n]=aB(t);return new g3.EthereumProviderError(e,r||sB.getMessageFromCode(e),n)}function aB(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}});var lB=E(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.getMessageFromCode=Vn.serializeError=Vn.EthereumProviderError=Vn.EthereumRpcError=Vn.ethErrors=Vn.errorCodes=void 0;var fB=Pm();Object.defineProperty(Vn,"EthereumRpcError",{enumerable:!0,get:function(){return fB.EthereumRpcError}});Object.defineProperty(Vn,"EthereumProviderError",{enumerable:!0,get:function(){return fB.EthereumProviderError}});var cB=m3();Object.defineProperty(Vn,"serializeError",{enumerable:!0,get:function(){return cB.serializeError}});Object.defineProperty(Vn,"getMessageFromCode",{enumerable:!0,get:function(){return cB.getMessageFromCode}});var Dhe=uB();Object.defineProperty(Vn,"ethErrors",{enumerable:!0,get:function(){return Dhe.ethErrors}});var jhe=Nm();Object.defineProperty(Vn,"errorCodes",{enumerable:!0,get:function(){return jhe.errorCodes}})});var y3=E(Jf=>{"use strict";var Fhe=Jf&&Jf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jf,"__esModule",{value:!0});Jf.JsonRpcEngine=void 0;var Uhe=Fhe(Lh()),Mi=lB(),Ui=class extends Uhe.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{let[o,a,c]=await Ui._runAllMiddleware(t,r,this._middleware);return a?(await Ui._runReturnHandlers(c),i(o)):n(async v=>{try{await Ui._runReturnHandlers(c)}catch(y){return v(y)}return v()})}catch(o){return i(o)}}}async _handleBatch(t,r){try{let n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){let a=new Mi.EthereumRpcError(Mi.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof t.method!="string"){let a=new Mi.EthereumRpcError(Mi.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(a,{id:t.id,jsonrpc:"2.0",error:a})}let n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc},o=null;try{await this._processRequest(n,i)}catch(a){o=a}return o&&(delete i.result,i.error||(i.error=Mi.serializeError(o))),r(o,i)}async _processRequest(t,r){let[n,i,o]=await Ui._runAllMiddleware(t,r,this._middleware);if(Ui._checkForCompletion(t,r,i),await Ui._runReturnHandlers(o),n)throw n}static async _runAllMiddleware(t,r,n){let i=[],o=null,a=!1;for(let c of n)if([o,a]=await Ui._runMiddleware(t,r,c,i),a)break;return[o,a,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(o=>{let a=v=>{let y=v||r.error;y&&(r.error=Mi.serializeError(y)),o([y,!0])},c=v=>{r.error?a(r.error):(v&&(typeof v!="function"&&a(new Mi.EthereumRpcError(Mi.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof v}" for request:
549
+ ${b3(t)}`,{request:t})),i.push(v)),o([null,!1]))};try{n(t,r,c,a)}catch(v){a(v)}})}static async _runReturnHandlers(t){for(let r of t)await new Promise((n,i)=>{r(o=>o?i(o):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new Mi.EthereumRpcError(Mi.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
550
+ ${b3(t)}`,{request:t});if(!n)throw new Mi.EthereumRpcError(Mi.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
551
+ ${b3(t)}`,{request:t})}};Jf.JsonRpcEngine=Ui;function b3(e){return JSON.stringify(e,null,2)}});var hB=E(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});Bm.mergeMiddleware=void 0;var Hhe=y3();function Whe(e){let t=new Hhe.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Bm.mergeMiddleware=Whe});var _3=E(Si=>{"use strict";var zhe=Si&&Si.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Qf=Si&&Si.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&zhe(t,e,r)};Object.defineProperty(Si,"__esModule",{value:!0});Qf(KL(),Si);Qf(GL(),Si);Qf(ZL(),Si);Qf(a3(),Si);Qf(y3(),Si);Qf(hB(),Si)});var pB=E((Dqe,dB)=>{dB.exports=function(t){return(r,n,i,o)=>{let a=t[r.method];return a===void 0?i():typeof a=="function"?a(r,n,i,o):(n.result=a,o())}}});var w3=E((jqe,vB)=>{vB.exports=pB()});var yB=E((Fqe,bB)=>{"use strict";var mB=(e,t,r,n)=>function(...i){let o=t.promiseModule;return new o((a,c)=>{t.multiArgs?i.push((...y)=>{t.errorFirst?y[0]?c(y):(y.shift(),a(y)):a(y)}):t.errorFirst?i.push((y,w)=>{y?c(y):a(w)}):i.push(a),Reflect.apply(e,this===r?n:this,i)})},gB=new WeakMap;bB.exports=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};let r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);let n=(a,c)=>{let v=gB.get(a);if(v||(v={},gB.set(a,v)),c in v)return v[c];let y=C=>typeof C=="string"||typeof c=="symbol"?c===C:C.test(c),w=Reflect.getOwnPropertyDescriptor(a,c),M=w===void 0||w.writable||w.configurable,R=(t.include?t.include.some(y):!t.exclude.some(y))&&M;return v[c]=R,R},i=new WeakMap,o=new Proxy(e,{apply(a,c,v){let y=i.get(a);if(y)return Reflect.apply(y,c,v);let w=t.excludeMain?a:mB(a,t,o,a);return i.set(a,w),Reflect.apply(w,c,v)},get(a,c){let v=a[c];if(!n(a,c)||v===Function.prototype[c])return v;let y=i.get(v);if(y)return y;if(typeof v=="function"){let w=mB(v,t,o,a);return i.set(v,w),w}return v}});return o}});var Dm=E((Uqe,_B)=>{var Vhe=Lh().default,x3=class extends Vhe{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){let t=this.updates;return this.updates=[],t}};_B.exports=x3});var xB=E((Hqe,wB)=>{var $he=Dm(),M3=class extends $he{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};wB.exports=M3});var Xf=E((Wqe,EB)=>{EB.exports={minBlockRef:Khe,maxBlockRef:Ghe,sortBlockRefs:S3,bnToHex:Zhe,blockRefIsNumber:Yhe,hexToInt:jm,incrementHexInt:Jhe,intToHex:SB,unsafeRandomBytes:Qhe};function Khe(...e){return S3(e)[0]}function Ghe(...e){let t=S3(e);return t[t.length-1]}function S3(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:jm(t)-jm(r))}function Zhe(e){return"0x"+e.toString(16)}function Yhe(e){return e&&!["earliest","latest","pending"].includes(e)}function jm(e){return e==null?e:Number.parseInt(e,16)}function Jhe(e){if(e==null)return e;let t=jm(e);return SB(t+1)}function SB(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function Qhe(e){let t="0x";for(let r=0;r<e;r++)t+=MB(),t+=MB();return t}function MB(){return Math.floor(Math.random()*16).toString(16)}});var OB=E((Vqe,AB)=>{var Xhe=xx(),e0e=yB(),t0e=xB(),{bnToHex:zqe,hexToInt:Fm,incrementHexInt:r0e,minBlockRef:n0e,blockRefIsNumber:i0e}=Xf(),E3=class extends t0e{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new Xhe(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;let n=n0e(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),o=await this._fetchLogs(i);this.addInitialResults(o)}async update({oldBlock:t,newBlock:r}){let n=r,i;t?i=r0e(t):i=r;let o=Object.assign({},this.params,{fromBlock:i,toBlock:n}),c=(await this._fetchLogs(o)).filter(v=>this.matchLog(v));this.addResults(c)}async _fetchLogs(t){return await e0e(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Fm(this.params.fromBlock)>=Fm(t.blockNumber)||i0e(this.params.toBlock)&&Fm(this.params.toBlock)<=Fm(t.blockNumber))return!1;let r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,o)=>{let a=t.topics[o];if(!a)return!1;a=a.toLowerCase();let c=Array.isArray(i)?i:[i];return c.includes(null)?!0:(c=c.map(w=>w.toLowerCase()),c.includes(a))})}};AB.exports=E3});var Um=E(($qe,IB)=>{IB.exports=o0e;async function o0e({provider:e,fromBlock:t,toBlock:r}){t||(t=r);let n=RB(t),o=RB(r)-n+1,a=Array(o).fill().map((v,y)=>n+y).map(s0e);return await Promise.all(a.map(v=>a0e(e,"eth_getBlockByNumber",[v,!1])))}function RB(e){return e==null?e:Number.parseInt(e,16)}function s0e(e){if(e==null)return e;let t=e.toString(16);return"0x"+t}function a0e(e,t,r){return new Promise((n,i)=>{e.sendAsync({id:1,jsonrpc:"2.0",method:t,params:r},(o,a)=>{if(o)return i(o);n(a.result)})})}});var TB=E((Kqe,CB)=>{var u0e=Dm(),f0e=Um(),{incrementHexInt:c0e}=Xf(),A3=class extends u0e{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){let n=r,i=c0e(t),a=(await f0e({provider:this.provider,fromBlock:i,toBlock:n})).map(c=>c.hash);this.addResults(a)}};CB.exports=A3});var PB=E((Gqe,kB)=>{var l0e=Dm(),h0e=Um(),{incrementHexInt:d0e}=Xf(),O3=class extends l0e{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){let r=t,n=d0e(t),i=await h0e({provider:this.provider,fromBlock:n,toBlock:r}),o=[];for(let a of i)o.push(...a.transactions);this.addResults(o)}};kB.exports=O3});var C3=E((Zqe,qB)=>{var p0e=VL().Mutex,{createAsyncMiddleware:v0e}=_3(),m0e=w3(),g0e=OB(),b0e=TB(),y0e=PB(),{intToHex:NB,hexToInt:R3}=Xf();qB.exports=_0e;function _0e({blockTracker:e,provider:t}){let r=0,n={},i=new p0e,o=w0e({mutex:i}),a=m0e({eth_newFilter:o(I3(v)),eth_newBlockFilter:o(I3(y)),eth_newPendingTransactionFilter:o(I3(w)),eth_uninstallFilter:o(Hm(R)),eth_getFilterChanges:o(Hm(M)),eth_getFilterLogs:o(Hm(S))}),c=async({oldBlock:H,newBlock:D})=>{if(n.length===0)return;let ee=await i.acquire();try{await Promise.all(ec(n).map(async ge=>{try{await ge.update({oldBlock:H,newBlock:D})}catch(K){console.error(K)}}))}catch(ge){console.error(ge)}ee()};return a.newLogFilter=v,a.newBlockFilter=y,a.newPendingTransactionFilter=w,a.uninstallFilter=R,a.getFilterChanges=M,a.getFilterLogs=S,a.destroy=()=>{N()},a;async function v(H){let D=new g0e({provider:t,params:H}),ee=await C(D);return D}async function y(){let H=new b0e({provider:t}),D=await C(H);return H}async function w(){let H=new y0e({provider:t}),D=await C(H);return H}async function M(H){let D=R3(H),ee=n[D];if(!ee)throw new Error(`No filter for index "${D}"`);return ee.getChangesAndClear()}async function S(H){let D=R3(H),ee=n[D];if(!ee)throw new Error(`No filter for index "${D}"`);return ee.type==="log"?results=ee.getAllResults():results=[],results}async function R(H){let D=R3(H),ee=n[D],ge=Boolean(ee);return ge&&await B(D),ge}async function C(H){let D=ec(n).length,ee=await e.getLatestBlock();await H.initialize({currentBlock:ee}),r++,n[r]=H,H.id=r,H.idHex=NB(r);let ge=ec(n).length;return q({prevFilterCount:D,newFilterCount:ge}),r}async function B(H){let D=ec(n).length;delete n[H];let ee=ec(n).length;q({prevFilterCount:D,newFilterCount:ee})}async function N(){let H=ec(n).length;n={},q({prevFilterCount:H,newFilterCount:0})}function q({prevFilterCount:H,newFilterCount:D}){if(H===0&&D>0){e.on("sync",c);return}if(H>0&&D===0){e.removeListener("sync",c);return}}}function I3(e){return Hm(async(...t)=>{let r=await e(...t);return NB(r.id)})}function Hm(e){return v0e(async(t,r)=>{let n=await e.apply(null,t.params);r.result=n})}function w0e({mutex:e}){return t=>async(r,n,i,o)=>{(await e.acquire())(),t(r,n,i,o)}}function ec(e,t){let r=[];for(let n in e)r.push(e[n]);return r}});var BB=E((Yqe,LB)=>{var x0e=_m(),M0e=C3(),T3=class extends x0e{constructor(){super(({blockTracker:t,provider:r,engine:n})=>M0e({blockTracker:t,provider:r}))}};LB.exports=T3});var jB=E((Wm,DB)=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.default=function(e,t){if(t=(0,I0e.default)(t||O0e.default),!(0,E0e.default)(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(o){var a=(0,q0e.default)(e[r++]);o.push((0,P0e.default)(i)),a.apply(null,o)}function i(o){if(o||r===e.length)return t.apply(null,arguments);n((0,T0e.default)(arguments,1))}n([])};var S0e=Lx(),E0e=tc(S0e),A0e=Hf(),O0e=tc(A0e),R0e=G1(),I0e=tc(R0e),C0e=kh(),T0e=tc(C0e),k0e=X1(),P0e=tc(k0e),N0e=Ds(),q0e=tc(N0e);function tc(e){return e&&e.__esModule?e:{default:e}}DB.exports=Wm.default});var UB=E((Vm,FB)=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.default=z0e;var L0e=Hf(),B0e=zm(L0e),D0e=Oh(),j0e=zm(D0e),F0e=kh(),U0e=zm(F0e),H0e=Ds(),W0e=zm(H0e);function zm(e){return e&&e.__esModule?e:{default:e}}function z0e(e,t,r){r=r||B0e.default;var n=(0,j0e.default)(t)?[]:{};e(t,function(i,o,a){(0,W0e.default)(i)(function(c,v){arguments.length>2&&(v=(0,U0e.default)(arguments,1)),n[o]=v,a(c)})},function(i){r(i,n)})}FB.exports=Vm.default});var zB=E(($m,WB)=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});$m.default=Z0e;var V0e=Hx(),$0e=HB(V0e),K0e=UB(),G0e=HB(K0e);function HB(e){return e&&e.__esModule?e:{default:e}}function Z0e(e,t){(0,G0e.default)($0e.default,e,t)}WB.exports=$m.default});var Hs=E((VB,k3)=>{(function(e,t){"use strict";function r(m,s){if(!m)throw new Error(s||"Assertion failed")}function n(m,s){m.super_=s;var l=function(){};l.prototype=s.prototype,m.prototype=new l,m.prototype.constructor=m}function i(m,s,l){if(i.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(m||0,s||10,l||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=fi().Buffer}catch{}i.isBN=function(s){return s instanceof i?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===i.wordSize&&Array.isArray(s.words)},i.max=function(s,l){return s.cmp(l)>0?s:l},i.min=function(s,l){return s.cmp(l)<0?s:l},i.prototype._init=function(s,l,d){if(typeof s=="number")return this._initNumber(s,l,d);if(typeof s=="object")return this._initArray(s,l,d);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f<s.length&&(l===16?this._parseHex(s,f,d):(this._parseBase(s,l,f),d==="le"&&this._initArray(this.toArray(),l,d)))},i.prototype._initNumber=function(s,l,d){s<0&&(this.negative=1,s=-s),s<67108864?(this.words=[s&67108863],this.length=1):s<4503599627370496?(this.words=[s&67108863,s/67108864&67108863],this.length=2):(r(s<9007199254740992),this.words=[s&67108863,s/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),l,d)},i.prototype._initArray=function(s,l,d){if(r(typeof s.length=="number"),s.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(s.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p,g,b=0;if(d==="be")for(f=s.length-1,p=0;f>=0;f-=3)g=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);else if(d==="le")for(f=0,p=0;f<s.length;f+=3)g=s[f]|s[f+1]<<8|s[f+2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);return this.strip()};function a(m,s){var l=m.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function c(m,s,l){var d=a(m,l);return l-1>=s&&(d|=a(m,l-1)<<4),d}i.prototype._parseHex=function(s,l,d){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p=0,g=0,b;if(d==="be")for(f=s.length-1;f>=l;f-=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8;else{var h=s.length-l;for(f=h%2===0?l+1:l;f<s.length;f+=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8}this.strip()};function v(m,s,l,d){for(var f=0,p=Math.min(m.length,l),g=s;g<p;g++){var b=m.charCodeAt(g)-48;f*=d,b>=49?f+=b-49+10:b>=17?f+=b-17+10:f+=b}return f}i.prototype._parseBase=function(s,l,d){this.words=[0],this.length=1;for(var f=0,p=1;p<=67108863;p*=l)f++;f--,p=p/l|0;for(var g=s.length-d,b=g%f,h=Math.min(g,g-b)+d,u=0,_=d;_<h;_+=f)u=v(s,_,_+f,l),this.imuln(p),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(b!==0){var A=1;for(u=v(s,_,s.length,l),_=0;_<b;_++)A*=l;this.imuln(A),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(s){s.words=new Array(this.length);for(var l=0;l<this.length;l++)s.words[l]=this.words[l];s.length=this.length,s.negative=this.negative,s.red=this.red},i.prototype.clone=function(){var s=new i(null);return this.copy(s),s},i.prototype._expand=function(s){for(;this.length<s;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,l){s=s||10,l=l|0||1;var d;if(s===16||s==="hex"){d="";for(var f=0,p=0,g=0;g<this.length;g++){var b=this.words[g],h=((b<<f|p)&16777215).toString(16);p=b>>>24-f&16777215,p!==0||g!==this.length-1?d=y[6-h.length]+h+d:d=h+d,f+=2,f>=26&&(f-=26,g--)}for(p!==0&&(d=p.toString(16)+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(s===(s|0)&&s>=2&&s<=36){var u=w[s],_=M[s];d="";var A=this.clone();for(A.negative=0;!A.isZero();){var x=A.modn(_).toString(s);A=A.idivn(_),A.isZero()?d=x+d:d=y[u-x.length]+x+d}for(this.isZero()&&(d="0"+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},i.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},i.prototype.toArrayLike=function(s,l,d){var f=this.byteLength(),p=d||Math.max(1,f);r(f<=p,"byte array longer than desired length"),r(p>0,"Requested array length <= 0"),this.strip();var g=l==="le",b=new s(p),h,u,_=this.clone();if(g){for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[u]=h;for(;u<p;u++)b[u]=0}else{for(u=0;u<p-f;u++)b[u]=0;for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[p-u-1]=h}return b},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var l=s,d=0;return l>=4096&&(d+=13,l>>>=13),l>=64&&(d+=7,l>>>=7),l>=8&&(d+=4,l>>>=4),l>=2&&(d+=2,l>>>=2),d+l},i.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,d=0;return(l&8191)===0&&(d+=13,l>>>=13),(l&127)===0&&(d+=7,l>>>=7),(l&15)===0&&(d+=4,l>>>=4),(l&3)===0&&(d+=2,l>>>=2),(l&1)===0&&d++,d},i.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function S(m){for(var s=new Array(m.bitLength()),l=0;l<s.length;l++){var d=l/26|0,f=l%26;s[l]=(m.words[d]&1<<f)>>>f}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;l<this.length;l++){var d=this._zeroBits(this.words[l]);if(s+=d,d!==26)break}return s},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(s){return this.negative!==0?this.abs().inotn(s).iaddn(1):this.clone()},i.prototype.fromTwos=function(s){return this.testn(s-1)?this.notn(s).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(s){for(;this.length<s.length;)this.words[this.length++]=0;for(var l=0;l<s.length;l++)this.words[l]=this.words[l]|s.words[l];return this.strip()},i.prototype.ior=function(s){return r((this.negative|s.negative)===0),this.iuor(s)},i.prototype.or=function(s){return this.length>s.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]&s.words[d];return this.length=l.length,this.strip()},i.prototype.iand=function(s){return r((this.negative|s.negative)===0),this.iuand(s)},i.prototype.and=function(s){return this.length>s.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var l,d;this.length>s.length?(l=this,d=s):(l=s,d=this);for(var f=0;f<d.length;f++)this.words[f]=l.words[f]^d.words[f];if(this!==l)for(;f<l.length;f++)this.words[f]=l.words[f];return this.length=l.length,this.strip()},i.prototype.ixor=function(s){return r((this.negative|s.negative)===0),this.iuxor(s)},i.prototype.xor=function(s){return this.length>s.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,d=s%26;this._expand(l),d>0&&l--;for(var f=0;f<l;f++)this.words[f]=~this.words[f]&67108863;return d>0&&(this.words[f]=~this.words[f]&67108863>>26-d),this.strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var d=s/26|0,f=s%26;return this._expand(d+1),l?this.words[d]=this.words[d]|1<<f:this.words[d]=this.words[d]&~(1<<f),this.strip()},i.prototype.iadd=function(s){var l;if(this.negative!==0&&s.negative===0)return this.negative=0,l=this.isub(s),this.negative^=1,this._normSign();if(this.negative===0&&s.negative!==0)return s.negative=0,l=this.isub(s),s.negative=1,l._normSign();var d,f;this.length>s.length?(d=this,f=s):(d=s,f=this);for(var p=0,g=0;g<f.length;g++)l=(d.words[g]|0)+(f.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;for(;p!==0&&g<d.length;g++)l=(d.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;if(this.length=d.length,p!==0)this.words[this.length]=p,this.length++;else if(d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this},i.prototype.add=function(s){var l;return s.negative!==0&&this.negative===0?(s.negative=0,l=this.sub(s),s.negative^=1,l):s.negative===0&&this.negative!==0?(this.negative=0,l=s.sub(this),this.negative=1,l):this.length>s.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var d=this.cmp(s);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,p;d>0?(f=this,p=s):(f=s,p=this);for(var g=0,b=0;b<p.length;b++)l=(f.words[b]|0)-(p.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;for(;g!==0&&b<f.length;b++)l=(f.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;if(g===0&&b<f.length&&f!==this)for(;b<f.length;b++)this.words[b]=f.words[b];return this.length=Math.max(this.length,b),f!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(s){return this.clone().isub(s)};function R(m,s,l){l.negative=s.negative^m.negative;var d=m.length+s.length|0;l.length=d,d=d-1|0;var f=m.words[0]|0,p=s.words[0]|0,g=f*p,b=g&67108863,h=g/67108864|0;l.words[0]=b;for(var u=1;u<d;u++){for(var _=h>>>26,A=h&67108863,x=Math.min(u,s.length-1),I=Math.max(0,u-m.length+1);I<=x;I++){var j=u-I|0;f=m.words[j]|0,p=s.words[I]|0,g=f*p+A,_+=g/67108864|0,A=g&67108863}l.words[u]=A|0,h=_|0}return h!==0?l.words[u]=h|0:l.length--,l.strip()}var C=function(s,l,d){var f=s.words,p=l.words,g=d.words,b=0,h,u,_,A=f[0]|0,x=A&8191,I=A>>>13,j=f[1]|0,O=j&8191,L=j>>>13,W=f[2]|0,F=W&8191,G=W>>>13,De=f[3]|0,Y=De&8191,Q=De>>>13,Ve=f[4]|0,J=Ve&8191,be=Ve>>>13,Ke=f[5]|0,ye=Ke&8191,Re=Ke>>>13,et=f[6]|0,oe=et&8191,xe=et>>>13,it=f[7]|0,ce=it&8191,Ie=it>>>13,ft=f[8]|0,le=ft&8191,Ce=ft>>>13,ot=f[9]|0,se=ot&8191,Me=ot>>>13,st=p[0]|0,ae=st&8191,Se=st>>>13,at=p[1]|0,re=at&8191,Te=at>>>13,ct=p[2]|0,ne=ct&8191,Ee=ct>>>13,lt=p[3]|0,te=lt&8191,ke=lt>>>13,ht=p[4]|0,ue=ht&8191,Pe=ht>>>13,dt=p[5]|0,he=dt&8191,Ne=dt>>>13,pt=p[6]|0,de=pt&8191,qe=pt>>>13,vt=p[7]|0,pe=vt&8191,Le=vt>>>13,ut=p[8]|0,ve=ut&8191,Be=ut>>>13,mt=p[9]|0,me=mt&8191,Ae=mt>>>13;d.negative=s.negative^l.negative,d.length=19,h=Math.imul(x,ae),u=Math.imul(x,Se),u=u+Math.imul(I,ae)|0,_=Math.imul(I,Se);var $t=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+($t>>>26)|0,$t&=67108863,h=Math.imul(O,ae),u=Math.imul(O,Se),u=u+Math.imul(L,ae)|0,_=Math.imul(L,Se),h=h+Math.imul(x,re)|0,u=u+Math.imul(x,Te)|0,u=u+Math.imul(I,re)|0,_=_+Math.imul(I,Te)|0;var Je=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Je>>>26)|0,Je&=67108863,h=Math.imul(F,ae),u=Math.imul(F,Se),u=u+Math.imul(G,ae)|0,_=Math.imul(G,Se),h=h+Math.imul(O,re)|0,u=u+Math.imul(O,Te)|0,u=u+Math.imul(L,re)|0,_=_+Math.imul(L,Te)|0,h=h+Math.imul(x,ne)|0,u=u+Math.imul(x,Ee)|0,u=u+Math.imul(I,ne)|0,_=_+Math.imul(I,Ee)|0;var Qe=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,h=Math.imul(Y,ae),u=Math.imul(Y,Se),u=u+Math.imul(Q,ae)|0,_=Math.imul(Q,Se),h=h+Math.imul(F,re)|0,u=u+Math.imul(F,Te)|0,u=u+Math.imul(G,re)|0,_=_+Math.imul(G,Te)|0,h=h+Math.imul(O,ne)|0,u=u+Math.imul(O,Ee)|0,u=u+Math.imul(L,ne)|0,_=_+Math.imul(L,Ee)|0,h=h+Math.imul(x,te)|0,u=u+Math.imul(x,ke)|0,u=u+Math.imul(I,te)|0,_=_+Math.imul(I,ke)|0;var Lt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(J,ae),u=Math.imul(J,Se),u=u+Math.imul(be,ae)|0,_=Math.imul(be,Se),h=h+Math.imul(Y,re)|0,u=u+Math.imul(Y,Te)|0,u=u+Math.imul(Q,re)|0,_=_+Math.imul(Q,Te)|0,h=h+Math.imul(F,ne)|0,u=u+Math.imul(F,Ee)|0,u=u+Math.imul(G,ne)|0,_=_+Math.imul(G,Ee)|0,h=h+Math.imul(O,te)|0,u=u+Math.imul(O,ke)|0,u=u+Math.imul(L,te)|0,_=_+Math.imul(L,ke)|0,h=h+Math.imul(x,ue)|0,u=u+Math.imul(x,Pe)|0,u=u+Math.imul(I,ue)|0,_=_+Math.imul(I,Pe)|0;var Bt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(ye,ae),u=Math.imul(ye,Se),u=u+Math.imul(Re,ae)|0,_=Math.imul(Re,Se),h=h+Math.imul(J,re)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(be,re)|0,_=_+Math.imul(be,Te)|0,h=h+Math.imul(Y,ne)|0,u=u+Math.imul(Y,Ee)|0,u=u+Math.imul(Q,ne)|0,_=_+Math.imul(Q,Ee)|0,h=h+Math.imul(F,te)|0,u=u+Math.imul(F,ke)|0,u=u+Math.imul(G,te)|0,_=_+Math.imul(G,ke)|0,h=h+Math.imul(O,ue)|0,u=u+Math.imul(O,Pe)|0,u=u+Math.imul(L,ue)|0,_=_+Math.imul(L,Pe)|0,h=h+Math.imul(x,he)|0,u=u+Math.imul(x,Ne)|0,u=u+Math.imul(I,he)|0,_=_+Math.imul(I,Ne)|0;var Dt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,h=Math.imul(oe,ae),u=Math.imul(oe,Se),u=u+Math.imul(xe,ae)|0,_=Math.imul(xe,Se),h=h+Math.imul(ye,re)|0,u=u+Math.imul(ye,Te)|0,u=u+Math.imul(Re,re)|0,_=_+Math.imul(Re,Te)|0,h=h+Math.imul(J,ne)|0,u=u+Math.imul(J,Ee)|0,u=u+Math.imul(be,ne)|0,_=_+Math.imul(be,Ee)|0,h=h+Math.imul(Y,te)|0,u=u+Math.imul(Y,ke)|0,u=u+Math.imul(Q,te)|0,_=_+Math.imul(Q,ke)|0,h=h+Math.imul(F,ue)|0,u=u+Math.imul(F,Pe)|0,u=u+Math.imul(G,ue)|0,_=_+Math.imul(G,Pe)|0,h=h+Math.imul(O,he)|0,u=u+Math.imul(O,Ne)|0,u=u+Math.imul(L,he)|0,_=_+Math.imul(L,Ne)|0,h=h+Math.imul(x,de)|0,u=u+Math.imul(x,qe)|0,u=u+Math.imul(I,de)|0,_=_+Math.imul(I,qe)|0;var jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(jt>>>26)|0,jt&=67108863,h=Math.imul(ce,ae),u=Math.imul(ce,Se),u=u+Math.imul(Ie,ae)|0,_=Math.imul(Ie,Se),h=h+Math.imul(oe,re)|0,u=u+Math.imul(oe,Te)|0,u=u+Math.imul(xe,re)|0,_=_+Math.imul(xe,Te)|0,h=h+Math.imul(ye,ne)|0,u=u+Math.imul(ye,Ee)|0,u=u+Math.imul(Re,ne)|0,_=_+Math.imul(Re,Ee)|0,h=h+Math.imul(J,te)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(be,te)|0,_=_+Math.imul(be,ke)|0,h=h+Math.imul(Y,ue)|0,u=u+Math.imul(Y,Pe)|0,u=u+Math.imul(Q,ue)|0,_=_+Math.imul(Q,Pe)|0,h=h+Math.imul(F,he)|0,u=u+Math.imul(F,Ne)|0,u=u+Math.imul(G,he)|0,_=_+Math.imul(G,Ne)|0,h=h+Math.imul(O,de)|0,u=u+Math.imul(O,qe)|0,u=u+Math.imul(L,de)|0,_=_+Math.imul(L,qe)|0,h=h+Math.imul(x,pe)|0,u=u+Math.imul(x,Le)|0,u=u+Math.imul(I,pe)|0,_=_+Math.imul(I,Le)|0;var Ft=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,h=Math.imul(le,ae),u=Math.imul(le,Se),u=u+Math.imul(Ce,ae)|0,_=Math.imul(Ce,Se),h=h+Math.imul(ce,re)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(Ie,re)|0,_=_+Math.imul(Ie,Te)|0,h=h+Math.imul(oe,ne)|0,u=u+Math.imul(oe,Ee)|0,u=u+Math.imul(xe,ne)|0,_=_+Math.imul(xe,Ee)|0,h=h+Math.imul(ye,te)|0,u=u+Math.imul(ye,ke)|0,u=u+Math.imul(Re,te)|0,_=_+Math.imul(Re,ke)|0,h=h+Math.imul(J,ue)|0,u=u+Math.imul(J,Pe)|0,u=u+Math.imul(be,ue)|0,_=_+Math.imul(be,Pe)|0,h=h+Math.imul(Y,he)|0,u=u+Math.imul(Y,Ne)|0,u=u+Math.imul(Q,he)|0,_=_+Math.imul(Q,Ne)|0,h=h+Math.imul(F,de)|0,u=u+Math.imul(F,qe)|0,u=u+Math.imul(G,de)|0,_=_+Math.imul(G,qe)|0,h=h+Math.imul(O,pe)|0,u=u+Math.imul(O,Le)|0,u=u+Math.imul(L,pe)|0,_=_+Math.imul(L,Le)|0,h=h+Math.imul(x,ve)|0,u=u+Math.imul(x,Be)|0,u=u+Math.imul(I,ve)|0,_=_+Math.imul(I,Be)|0;var lr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,h=Math.imul(se,ae),u=Math.imul(se,Se),u=u+Math.imul(Me,ae)|0,_=Math.imul(Me,Se),h=h+Math.imul(le,re)|0,u=u+Math.imul(le,Te)|0,u=u+Math.imul(Ce,re)|0,_=_+Math.imul(Ce,Te)|0,h=h+Math.imul(ce,ne)|0,u=u+Math.imul(ce,Ee)|0,u=u+Math.imul(Ie,ne)|0,_=_+Math.imul(Ie,Ee)|0,h=h+Math.imul(oe,te)|0,u=u+Math.imul(oe,ke)|0,u=u+Math.imul(xe,te)|0,_=_+Math.imul(xe,ke)|0,h=h+Math.imul(ye,ue)|0,u=u+Math.imul(ye,Pe)|0,u=u+Math.imul(Re,ue)|0,_=_+Math.imul(Re,Pe)|0,h=h+Math.imul(J,he)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(be,he)|0,_=_+Math.imul(be,Ne)|0,h=h+Math.imul(Y,de)|0,u=u+Math.imul(Y,qe)|0,u=u+Math.imul(Q,de)|0,_=_+Math.imul(Q,qe)|0,h=h+Math.imul(F,pe)|0,u=u+Math.imul(F,Le)|0,u=u+Math.imul(G,pe)|0,_=_+Math.imul(G,Le)|0,h=h+Math.imul(O,ve)|0,u=u+Math.imul(O,Be)|0,u=u+Math.imul(L,ve)|0,_=_+Math.imul(L,Be)|0,h=h+Math.imul(x,me)|0,u=u+Math.imul(x,Ae)|0,u=u+Math.imul(I,me)|0,_=_+Math.imul(I,Ae)|0;var hr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,h=Math.imul(se,re),u=Math.imul(se,Te),u=u+Math.imul(Me,re)|0,_=Math.imul(Me,Te),h=h+Math.imul(le,ne)|0,u=u+Math.imul(le,Ee)|0,u=u+Math.imul(Ce,ne)|0,_=_+Math.imul(Ce,Ee)|0,h=h+Math.imul(ce,te)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(Ie,te)|0,_=_+Math.imul(Ie,ke)|0,h=h+Math.imul(oe,ue)|0,u=u+Math.imul(oe,Pe)|0,u=u+Math.imul(xe,ue)|0,_=_+Math.imul(xe,Pe)|0,h=h+Math.imul(ye,he)|0,u=u+Math.imul(ye,Ne)|0,u=u+Math.imul(Re,he)|0,_=_+Math.imul(Re,Ne)|0,h=h+Math.imul(J,de)|0,u=u+Math.imul(J,qe)|0,u=u+Math.imul(be,de)|0,_=_+Math.imul(be,qe)|0,h=h+Math.imul(Y,pe)|0,u=u+Math.imul(Y,Le)|0,u=u+Math.imul(Q,pe)|0,_=_+Math.imul(Q,Le)|0,h=h+Math.imul(F,ve)|0,u=u+Math.imul(F,Be)|0,u=u+Math.imul(G,ve)|0,_=_+Math.imul(G,Be)|0,h=h+Math.imul(O,me)|0,u=u+Math.imul(O,Ae)|0,u=u+Math.imul(L,me)|0,_=_+Math.imul(L,Ae)|0;var or=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(or>>>26)|0,or&=67108863,h=Math.imul(se,ne),u=Math.imul(se,Ee),u=u+Math.imul(Me,ne)|0,_=Math.imul(Me,Ee),h=h+Math.imul(le,te)|0,u=u+Math.imul(le,ke)|0,u=u+Math.imul(Ce,te)|0,_=_+Math.imul(Ce,ke)|0,h=h+Math.imul(ce,ue)|0,u=u+Math.imul(ce,Pe)|0,u=u+Math.imul(Ie,ue)|0,_=_+Math.imul(Ie,Pe)|0,h=h+Math.imul(oe,he)|0,u=u+Math.imul(oe,Ne)|0,u=u+Math.imul(xe,he)|0,_=_+Math.imul(xe,Ne)|0,h=h+Math.imul(ye,de)|0,u=u+Math.imul(ye,qe)|0,u=u+Math.imul(Re,de)|0,_=_+Math.imul(Re,qe)|0,h=h+Math.imul(J,pe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(be,pe)|0,_=_+Math.imul(be,Le)|0,h=h+Math.imul(Y,ve)|0,u=u+Math.imul(Y,Be)|0,u=u+Math.imul(Q,ve)|0,_=_+Math.imul(Q,Be)|0,h=h+Math.imul(F,me)|0,u=u+Math.imul(F,Ae)|0,u=u+Math.imul(G,me)|0,_=_+Math.imul(G,Ae)|0;var Kt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,h=Math.imul(se,te),u=Math.imul(se,ke),u=u+Math.imul(Me,te)|0,_=Math.imul(Me,ke),h=h+Math.imul(le,ue)|0,u=u+Math.imul(le,Pe)|0,u=u+Math.imul(Ce,ue)|0,_=_+Math.imul(Ce,Pe)|0,h=h+Math.imul(ce,he)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(Ie,he)|0,_=_+Math.imul(Ie,Ne)|0,h=h+Math.imul(oe,de)|0,u=u+Math.imul(oe,qe)|0,u=u+Math.imul(xe,de)|0,_=_+Math.imul(xe,qe)|0,h=h+Math.imul(ye,pe)|0,u=u+Math.imul(ye,Le)|0,u=u+Math.imul(Re,pe)|0,_=_+Math.imul(Re,Le)|0,h=h+Math.imul(J,ve)|0,u=u+Math.imul(J,Be)|0,u=u+Math.imul(be,ve)|0,_=_+Math.imul(be,Be)|0,h=h+Math.imul(Y,me)|0,u=u+Math.imul(Y,Ae)|0,u=u+Math.imul(Q,me)|0,_=_+Math.imul(Q,Ae)|0;var sr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,h=Math.imul(se,ue),u=Math.imul(se,Pe),u=u+Math.imul(Me,ue)|0,_=Math.imul(Me,Pe),h=h+Math.imul(le,he)|0,u=u+Math.imul(le,Ne)|0,u=u+Math.imul(Ce,he)|0,_=_+Math.imul(Ce,Ne)|0,h=h+Math.imul(ce,de)|0,u=u+Math.imul(ce,qe)|0,u=u+Math.imul(Ie,de)|0,_=_+Math.imul(Ie,qe)|0,h=h+Math.imul(oe,pe)|0,u=u+Math.imul(oe,Le)|0,u=u+Math.imul(xe,pe)|0,_=_+Math.imul(xe,Le)|0,h=h+Math.imul(ye,ve)|0,u=u+Math.imul(ye,Be)|0,u=u+Math.imul(Re,ve)|0,_=_+Math.imul(Re,Be)|0,h=h+Math.imul(J,me)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(be,me)|0,_=_+Math.imul(be,Ae)|0;var Ut=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,h=Math.imul(se,he),u=Math.imul(se,Ne),u=u+Math.imul(Me,he)|0,_=Math.imul(Me,Ne),h=h+Math.imul(le,de)|0,u=u+Math.imul(le,qe)|0,u=u+Math.imul(Ce,de)|0,_=_+Math.imul(Ce,qe)|0,h=h+Math.imul(ce,pe)|0,u=u+Math.imul(ce,Le)|0,u=u+Math.imul(Ie,pe)|0,_=_+Math.imul(Ie,Le)|0,h=h+Math.imul(oe,ve)|0,u=u+Math.imul(oe,Be)|0,u=u+Math.imul(xe,ve)|0,_=_+Math.imul(xe,Be)|0,h=h+Math.imul(ye,me)|0,u=u+Math.imul(ye,Ae)|0,u=u+Math.imul(Re,me)|0,_=_+Math.imul(Re,Ae)|0;var dr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,h=Math.imul(se,de),u=Math.imul(se,qe),u=u+Math.imul(Me,de)|0,_=Math.imul(Me,qe),h=h+Math.imul(le,pe)|0,u=u+Math.imul(le,Le)|0,u=u+Math.imul(Ce,pe)|0,_=_+Math.imul(Ce,Le)|0,h=h+Math.imul(ce,ve)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(Ie,ve)|0,_=_+Math.imul(Ie,Be)|0,h=h+Math.imul(oe,me)|0,u=u+Math.imul(oe,Ae)|0,u=u+Math.imul(xe,me)|0,_=_+Math.imul(xe,Ae)|0;var Jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,h=Math.imul(se,pe),u=Math.imul(se,Le),u=u+Math.imul(Me,pe)|0,_=Math.imul(Me,Le),h=h+Math.imul(le,ve)|0,u=u+Math.imul(le,Be)|0,u=u+Math.imul(Ce,ve)|0,_=_+Math.imul(Ce,Be)|0,h=h+Math.imul(ce,me)|0,u=u+Math.imul(ce,Ae)|0,u=u+Math.imul(Ie,me)|0,_=_+Math.imul(Ie,Ae)|0;var tr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,h=Math.imul(se,ve),u=Math.imul(se,Be),u=u+Math.imul(Me,ve)|0,_=Math.imul(Me,Be),h=h+Math.imul(le,me)|0,u=u+Math.imul(le,Ae)|0,u=u+Math.imul(Ce,me)|0,_=_+Math.imul(Ce,Ae)|0;var Rr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,h=Math.imul(se,me),u=Math.imul(se,Ae),u=u+Math.imul(Me,me)|0,_=Math.imul(Me,Ae);var Qr=(b+h|0)+((u&8191)<<13)|0;return b=(_+(u>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,g[0]=$t,g[1]=Je,g[2]=Qe,g[3]=Lt,g[4]=Bt,g[5]=Dt,g[6]=jt,g[7]=Ft,g[8]=lr,g[9]=hr,g[10]=or,g[11]=Kt,g[12]=sr,g[13]=Ut,g[14]=dr,g[15]=Jt,g[16]=tr,g[17]=Rr,g[18]=Qr,b!==0&&(g[19]=b,d.length++),d};Math.imul||(C=R);function B(m,s,l){l.negative=s.negative^m.negative,l.length=m.length+s.length;for(var d=0,f=0,p=0;p<l.length-1;p++){var g=f;f=0;for(var b=d&67108863,h=Math.min(p,s.length-1),u=Math.max(0,p-m.length+1);u<=h;u++){var _=p-u,A=m.words[_]|0,x=s.words[u]|0,I=A*x,j=I&67108863;g=g+(I/67108864|0)|0,j=j+b|0,b=j&67108863,g=g+(j>>>26)|0,f+=g>>>26,g&=67108863}l.words[p]=b,d=g,g=f}return d!==0?l.words[p]=d:l.length--,l.strip()}function N(m,s,l){var d=new q;return d.mulp(m,s,l)}i.prototype.mulTo=function(s,l){var d,f=this.length+s.length;return this.length===10&&s.length===10?d=C(this,s,l):f<63?d=R(this,s,l):f<1024?d=B(this,s,l):d=N(this,s,l),d};function q(m,s){this.x=m,this.y=s}q.prototype.makeRBT=function(s){for(var l=new Array(s),d=i.prototype._countBits(s)-1,f=0;f<s;f++)l[f]=this.revBin(f,d,s);return l},q.prototype.revBin=function(s,l,d){if(s===0||s===d-1)return s;for(var f=0,p=0;p<l;p++)f|=(s&1)<<l-p-1,s>>=1;return f},q.prototype.permute=function(s,l,d,f,p,g){for(var b=0;b<g;b++)f[b]=l[s[b]],p[b]=d[s[b]]},q.prototype.transform=function(s,l,d,f,p,g){this.permute(g,s,l,d,f,p);for(var b=1;b<p;b<<=1)for(var h=b<<1,u=Math.cos(2*Math.PI/h),_=Math.sin(2*Math.PI/h),A=0;A<p;A+=h)for(var x=u,I=_,j=0;j<b;j++){var O=d[A+j],L=f[A+j],W=d[A+j+b],F=f[A+j+b],G=x*W-I*F;F=x*F+I*W,W=G,d[A+j]=O+W,f[A+j]=L+F,d[A+j+b]=O-W,f[A+j+b]=L-F,j!==h&&(G=u*x-_*I,I=u*I+_*x,x=G)}},q.prototype.guessLen13b=function(s,l){var d=Math.max(l,s)|1,f=d&1,p=0;for(d=d/2|0;d;d=d>>>1)p++;return 1<<p+1+f},q.prototype.conjugate=function(s,l,d){if(!(d<=1))for(var f=0;f<d/2;f++){var p=s[f];s[f]=s[d-f-1],s[d-f-1]=p,p=l[f],l[f]=-l[d-f-1],l[d-f-1]=-p}},q.prototype.normalize13b=function(s,l){for(var d=0,f=0;f<l/2;f++){var p=Math.round(s[2*f+1]/l)*8192+Math.round(s[2*f]/l)+d;s[f]=p&67108863,p<67108864?d=0:d=p/67108864|0}return s},q.prototype.convert13b=function(s,l,d,f){for(var p=0,g=0;g<l;g++)p=p+(s[g]|0),d[2*g]=p&8191,p=p>>>13,d[2*g+1]=p&8191,p=p>>>13;for(g=2*l;g<f;++g)d[g]=0;r(p===0),r((p&-8192)===0)},q.prototype.stub=function(s){for(var l=new Array(s),d=0;d<s;d++)l[d]=0;return l},q.prototype.mulp=function(s,l,d){var f=2*this.guessLen13b(s.length,l.length),p=this.makeRBT(f),g=this.stub(f),b=new Array(f),h=new Array(f),u=new Array(f),_=new Array(f),A=new Array(f),x=new Array(f),I=d.words;I.length=f,this.convert13b(s.words,s.length,b,f),this.convert13b(l.words,l.length,_,f),this.transform(b,g,h,u,f,p),this.transform(_,g,A,x,f,p);for(var j=0;j<f;j++){var O=h[j]*A[j]-u[j]*x[j];u[j]=h[j]*x[j]+u[j]*A[j],h[j]=O}return this.conjugate(h,u,f),this.transform(h,u,I,g,f,p),this.conjugate(I,g,f),this.normalize13b(I,f),d.negative=s.negative^l.negative,d.length=s.length+l.length,d.strip()},i.prototype.mul=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),this.mulTo(s,l)},i.prototype.mulf=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),N(this,s,l)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){r(typeof s=="number"),r(s<67108864);for(var l=0,d=0;d<this.length;d++){var f=(this.words[d]|0)*s,p=(f&67108863)+(l&67108863);l>>=26,l+=f/67108864|0,l+=p>>>26,this.words[d]=p&67108863}return l!==0&&(this.words[d]=l,this.length++),this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var l=S(s);if(l.length===0)return new i(1);for(var d=this,f=0;f<l.length&&l[f]===0;f++,d=d.sqr());if(++f<l.length)for(var p=d.sqr();f<l.length;f++,p=p.sqr())l[f]!==0&&(d=d.mul(p));return d},i.prototype.iushln=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=67108863>>>26-l<<26-l,p;if(l!==0){var g=0;for(p=0;p<this.length;p++){var b=this.words[p]&f,h=(this.words[p]|0)-b<<l;this.words[p]=h|g,g=b>>>26-l}g&&(this.words[p]=g,this.length++)}if(d!==0){for(p=this.length-1;p>=0;p--)this.words[p+d]=this.words[p];for(p=0;p<d;p++)this.words[p]=0;this.length+=d}return this.strip()},i.prototype.ishln=function(s){return r(this.negative===0),this.iushln(s)},i.prototype.iushrn=function(s,l,d){r(typeof s=="number"&&s>=0);var f;l?f=(l-l%26)/26:f=0;var p=s%26,g=Math.min((s-p)/26,this.length),b=67108863^67108863>>>p<<p,h=d;if(f-=g,f=Math.max(0,f),h){for(var u=0;u<g;u++)h.words[u]=this.words[u];h.length=g}if(g!==0)if(this.length>g)for(this.length-=g,u=0;u<this.length;u++)this.words[u]=this.words[u+g];else this.words[0]=0,this.length=1;var _=0;for(u=this.length-1;u>=0&&(_!==0||u>=f);u--){var A=this.words[u]|0;this.words[u]=_<<26-p|A>>>p,_=A&b}return h&&_!==0&&(h.words[h.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(s,l,d){return r(this.negative===0),this.iushrn(s,l,d)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return!1;var p=this.words[d];return!!(p&f)},i.prototype.imaskn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(l!==0&&d++,this.length=Math.min(d,this.length),l!==0){var f=67108863^67108863>>>l<<l;this.words[this.length-1]&=f}return this.strip()},i.prototype.maskn=function(s){return this.clone().imaskn(s)},i.prototype.iaddn=function(s){return r(typeof s=="number"),r(s<67108864),s<0?this.isubn(-s):this.negative!==0?this.length===1&&(this.words[0]|0)<s?(this.words[0]=s-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(s),this.negative=1,this):this._iaddn(s)},i.prototype._iaddn=function(s){this.words[0]+=s;for(var l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},i.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+1]-=1;return this.strip()},i.prototype.addn=function(s){return this.clone().iaddn(s)},i.prototype.subn=function(s){return this.clone().isubn(s)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(s,l,d){var f=s.length+d,p;this._expand(f);var g,b=0;for(p=0;p<s.length;p++){g=(this.words[p+d]|0)+b;var h=(s.words[p]|0)*l;g-=h&67108863,b=(g>>26)-(h/67108864|0),this.words[p+d]=g&67108863}for(;p<this.length-d;p++)g=(this.words[p+d]|0)+b,b=g>>26,this.words[p+d]=g&67108863;if(b===0)return this.strip();for(r(b===-1),b=0,p=0;p<this.length;p++)g=-(this.words[p]|0)+b,b=g>>26,this.words[p]=g&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(s,l){var d=this.length-s.length,f=this.clone(),p=s,g=p.words[p.length-1]|0,b=this._countBits(g);d=26-b,d!==0&&(p=p.ushln(d),f.iushln(d),g=p.words[p.length-1]|0);var h=f.length-p.length,u;if(l!=="mod"){u=new i(null),u.length=h+1,u.words=new Array(u.length);for(var _=0;_<u.length;_++)u.words[_]=0}var A=f.clone()._ishlnsubmul(p,1,h);A.negative===0&&(f=A,u&&(u.words[h]=1));for(var x=h-1;x>=0;x--){var I=(f.words[p.length+x]|0)*67108864+(f.words[p.length+x-1]|0);for(I=Math.min(I/g|0,67108863),f._ishlnsubmul(p,I,x);f.negative!==0;)I--,f.negative=0,f._ishlnsubmul(p,1,x),f.isZero()||(f.negative^=1);u&&(u.words[x]=I)}return u&&u.strip(),f.strip(),l!=="div"&&d!==0&&f.iushrn(d),{div:u||null,mod:f}},i.prototype.divmod=function(s,l,d){if(r(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var f,p,g;return this.negative!==0&&s.negative===0?(g=this.neg().divmod(s,l),l!=="mod"&&(f=g.div.neg()),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.iadd(s)),{div:f,mod:p}):this.negative===0&&s.negative!==0?(g=this.divmod(s.neg(),l),l!=="mod"&&(f=g.div.neg()),{div:f,mod:g.mod}):(this.negative&s.negative)!==0?(g=this.neg().divmod(s.neg(),l),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.isub(s)),{div:g.div,mod:p}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new i(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modn(s.words[0]))}:this._wordDiv(s,l)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var d=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),p=s.andln(1),g=d.cmp(f);return g<0||p===1&&g===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,d=0,f=this.length-1;f>=0;f--)d=(l*d+(this.words[f]|0))%s;return d},i.prototype.idivn=function(s){r(s<=67108863);for(var l=0,d=this.length-1;d>=0;d--){var f=(this.words[d]|0)+l*67108864;this.words[d]=f/s|0,l=f%s}return this.strip()},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=new i(0),b=new i(1),h=0;l.isEven()&&d.isEven();)l.iushrn(1),d.iushrn(1),++h;for(var u=d.clone(),_=l.clone();!l.isZero();){for(var A=0,x=1;(l.words[0]&x)===0&&A<26;++A,x<<=1);if(A>0)for(l.iushrn(A);A-- >0;)(f.isOdd()||p.isOdd())&&(f.iadd(u),p.isub(_)),f.iushrn(1),p.iushrn(1);for(var I=0,j=1;(d.words[0]&j)===0&&I<26;++I,j<<=1);if(I>0)for(d.iushrn(I);I-- >0;)(g.isOdd()||b.isOdd())&&(g.iadd(u),b.isub(_)),g.iushrn(1),b.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(g),p.isub(b)):(d.isub(l),g.isub(f),b.isub(p))}return{a:g,b,gcd:d.iushln(h)}},i.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=d.clone();l.cmpn(1)>0&&d.cmpn(1)>0;){for(var b=0,h=1;(l.words[0]&h)===0&&b<26;++b,h<<=1);if(b>0)for(l.iushrn(b);b-- >0;)f.isOdd()&&f.iadd(g),f.iushrn(1);for(var u=0,_=1;(d.words[0]&_)===0&&u<26;++u,_<<=1);if(u>0)for(d.iushrn(u);u-- >0;)p.isOdd()&&p.iadd(g),p.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(p)):(d.isub(l),p.isub(f))}var A;return l.cmpn(1)===0?A=f:A=p,A.cmpn(0)<0&&A.iadd(s),A},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),d=s.clone();l.negative=0,d.negative=0;for(var f=0;l.isEven()&&d.isEven();f++)l.iushrn(1),d.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;d.isEven();)d.iushrn(1);var p=l.cmp(d);if(p<0){var g=l;l=d,d=g}else if(p===0||d.cmpn(1)===0)break;l.isub(d)}while(!0);return d.iushln(f)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return this._expand(d+1),this.words[d]|=f,this;for(var p=f,g=d;p!==0&&g<this.length;g++){var b=this.words[g]|0;b+=p,p=b>>>26,b&=67108863,this.words[g]=b}return p!==0&&(this.words[g]=p,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var d;if(this.length>1)d=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;d=f===s?0:f<s?-1:1}return this.negative!==0?-d|0:d},i.prototype.cmp=function(s){if(this.negative!==0&&s.negative===0)return-1;if(this.negative===0&&s.negative!==0)return 1;var l=this.ucmp(s);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(s){if(this.length>s.length)return 1;if(this.length<s.length)return-1;for(var l=0,d=this.length-1;d>=0;d--){var f=this.words[d]|0,p=s.words[d]|0;if(f!==p){f<p?l=-1:f>p&&(l=1);break}}return l},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new V(s)},i.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var H={k256:null,p224:null,p192:null,p25519:null};function D(m,s){this.name=m,this.p=new i(s,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},D.prototype.ireduce=function(s){var l=s,d;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),d=l.bitLength();while(d>this.n);var f=d<this.n?-1:l.ucmp(this.p);return f===0?(l.words[0]=0,l.length=1):f>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},D.prototype.split=function(s,l){s.iushrn(this.n,0,l)},D.prototype.imulK=function(s){return s.imul(this.k)};function ee(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(ee,D),ee.prototype.split=function(s,l){for(var d=4194303,f=Math.min(s.length,9),p=0;p<f;p++)l.words[p]=s.words[p];if(l.length=f,s.length<=9){s.words[0]=0,s.length=1;return}var g=s.words[9];for(l.words[l.length++]=g&d,p=10;p<s.length;p++){var b=s.words[p]|0;s.words[p-10]=(b&d)<<4|g>>>22,g=b}g>>>=22,s.words[p-10]=g,g===0&&s.length>10?s.length-=10:s.length-=9},ee.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,d=0;d<s.length;d++){var f=s.words[d]|0;l+=f*977,s.words[d]=l&67108863,l=f*64+(l/67108864|0)}return s.words[s.length-1]===0&&(s.length--,s.words[s.length-1]===0&&s.length--),s};function ge(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ge,D);function K(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(K,D);function X(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(X,D),X.prototype.imulK=function(s){for(var l=0,d=0;d<s.length;d++){var f=(s.words[d]|0)*19+l,p=f&67108863;f>>>=26,s.words[d]=p,l=f}return l!==0&&(s.words[s.length++]=l),s},i._prime=function(s){if(H[s])return H[s];var l;if(s==="k256")l=new ee;else if(s==="p224")l=new ge;else if(s==="p192")l=new K;else if(s==="p25519")l=new X;else throw new Error("Unknown prime "+s);return H[s]=l,l};function V(m){if(typeof m=="string"){var s=i._prime(m);this.m=s.p,this.prime=s}else r(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}V.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},V.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},V.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},V.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},V.prototype.add=function(s,l){this._verify2(s,l);var d=s.add(l);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},V.prototype.iadd=function(s,l){this._verify2(s,l);var d=s.iadd(l);return d.cmp(this.m)>=0&&d.isub(this.m),d},V.prototype.sub=function(s,l){this._verify2(s,l);var d=s.sub(l);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},V.prototype.isub=function(s,l){this._verify2(s,l);var d=s.isub(l);return d.cmpn(0)<0&&d.iadd(this.m),d},V.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},V.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},V.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},V.prototype.isqr=function(s){return this.imul(s,s.clone())},V.prototype.sqr=function(s){return this.mul(s,s)},V.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var d=this.m.add(new i(1)).iushrn(2);return this.pow(s,d)}for(var f=this.m.subn(1),p=0;!f.isZero()&&f.andln(1)===0;)p++,f.iushrn(1);r(!f.isZero());var g=new i(1).toRed(this),b=g.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);this.pow(u,h).cmp(b)!==0;)u.redIAdd(b);for(var _=this.pow(u,f),A=this.pow(s,f.addn(1).iushrn(1)),x=this.pow(s,f),I=p;x.cmp(g)!==0;){for(var j=x,O=0;j.cmp(g)!==0;O++)j=j.redSqr();r(O<I);var L=this.pow(_,new i(1).iushln(I-O-1));A=A.redMul(L),_=L.redSqr(),x=x.redMul(_),I=O}return A},V.prototype.invm=function(s){var l=s._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},V.prototype.pow=function(s,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return s.clone();var d=4,f=new Array(1<<d);f[0]=new i(1).toRed(this),f[1]=s;for(var p=2;p<f.length;p++)f[p]=this.mul(f[p-1],s);var g=f[0],b=0,h=0,u=l.bitLength()%26;for(u===0&&(u=26),p=l.length-1;p>=0;p--){for(var _=l.words[p],A=u-1;A>=0;A--){var x=_>>A&1;if(g!==f[0]&&(g=this.sqr(g)),x===0&&b===0){h=0;continue}b<<=1,b|=x,h++,!(h!==d&&(p!==0||A!==0))&&(g=this.mul(g,f[b]),h=0,b=0)}u=26}return g},V.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},V.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},i.mont=function(s){return new T(s)};function T(m){V.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(T,V),T.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},T.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},T.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var d=s.imul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},T.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new i(0)._forceRed(this);var d=s.mul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},T.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof k3>"u"||k3,VB)});var KB=E(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});var cu=Hs(),Y0e=_1().ec,P3=new Y0e("secp256k1"),rc=P3.curve;nc.privateKeyExport=function(e,t){t===void 0&&(t=!0);var r=new cu(e);if(r.ucmp(rc.n)>=0)throw new Error("couldn't export to DER format");var n=P3.g.mul(r);return $B(n.getX(),n.getY(),t)};nc.privateKeyModInverse=function(e){var t=new cu(e);if(t.ucmp(rc.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(rc.n).toArrayLike(Buffer,"be",32)};nc.signatureImport=function(e){var t=new cu(e.r);t.ucmp(rc.n)>=0&&(t=new cu(0));var r=new cu(e.s);return r.ucmp(rc.n)>=0&&(r=new cu(0)),Buffer.concat([t.toArrayLike(Buffer,"be",32),r.toArrayLike(Buffer,"be",32)])};nc.ecdhUnsafe=function(e,t,r){r===void 0&&(r=!0);var n=P3.keyFromPublic(e),i=new cu(t);if(i.ucmp(rc.n)>=0||i.isZero())throw new Error("scalar was invalid (zero or overflow)");var o=n.pub.mul(i);return $B(o.getX(),o.getY(),r)};var $B=function(e,t,r){var n;return r?(n=Buffer.alloc(33),n[0]=t.isOdd()?3:2,e.toArrayLike(Buffer,"be",32).copy(n,1)):(n=Buffer.alloc(65),n[0]=4,e.toArrayLike(Buffer,"be",32).copy(n,1),t.toArrayLike(Buffer,"be",32).copy(n,33)),n}});var GB=E(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});var J0e=Buffer.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Q0e=Buffer.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);jh.privateKeyExport=function(e,t,r){r===void 0&&(r=!0);var n=Buffer.from(r?J0e:Q0e);return e.copy(n,r?8:9),t.copy(n,r?181:214),n};jh.privateKeyImport=function(e){var t=e.length,r=0;if(t<r+1||e[r]!==48||(r+=1,t<r+1||!(e[r]&128)))return null;var n=e[r]&127;if(r+=1,n<1||n>2||t<r+n)return null;var i=e[r+n-1]|(n>1?e[r+n-2]<<8:0);return r+=n,t<r+i||t<r+3||e[r]!==2||e[r+1]!==1||e[r+2]!==1||(r+=3,t<r+2||e[r]!==4||e[r+1]>32||t<r+2+e[r+1])?null:e.slice(r+2,r+2+e[r+1])};jh.signatureImportLax=function(e){var t=Buffer.alloc(32,0),r=Buffer.alloc(32,0),n=e.length,i=0;if(e[i++]!==48)return null;var o=e[i++];if(o&128&&(i+=o-128,i>n)||e[i++]!==2)return null;var a=e[i++];if(a&128){if(o=a-128,i+o>n)return null;for(;o>0&&e[i]===0;i+=1,o-=1);for(a=0;o>0;i+=1,o-=1)a=(a<<8)+e[i]}if(a>n-i)return null;var c=i;if(i+=a,e[i++]!==2)return null;var v=e[i++];if(v&128){if(o=v-128,i+o>n)return null;for(;o>0&&e[i]===0;i+=1,o-=1);for(v=0;o>0;i+=1,o-=1)v=(v<<8)+e[i]}if(v>n-i)return null;var y=i;for(i+=v;a>0&&e[c]===0;a-=1,c+=1);if(a>32)return null;var w=e.slice(c,c+a);for(w.copy(t,32-w.length);v>0&&e[y]===0;v-=1,y+=1);if(v>32)return null;var M=e.slice(y,y+v);return M.copy(r,32-M.length),{r:t,s:r}}});var Gm=E(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.ecdhUnsafe=Xe.ecdh=Xe.recover=Xe.verify=Xe.sign=Xe.signatureImportLax=Xe.signatureImport=Xe.signatureExport=Xe.signatureNormalize=Xe.publicKeyCombine=Xe.publicKeyTweakMul=Xe.publicKeyTweakAdd=Xe.publicKeyVerify=Xe.publicKeyConvert=Xe.publicKeyCreate=Xe.privateKeyTweakMul=Xe.privateKeyTweakAdd=Xe.privateKeyModInverse=Xe.privateKeyNegate=Xe.privateKeyImport=Xe.privateKeyExport=Xe.privateKeyVerify=void 0;var on=G2(),Km=KB(),N3=GB();Xe.privateKeyVerify=function(e){return e.length!==32?!1:on.privateKeyVerify(Uint8Array.from(e))};Xe.privateKeyExport=function(e,t){if(e.length!==32)throw new RangeError("private key length is invalid");var r=Km.privateKeyExport(e,t);return N3.privateKeyExport(e,r,t)};Xe.privateKeyImport=function(e){if(e=N3.privateKeyImport(e),e!==null&&e.length===32&&Xe.privateKeyVerify(e))return e;throw new Error("couldn't import from DER format")};Xe.privateKeyNegate=function(e){return Buffer.from(on.privateKeyNegate(Uint8Array.from(e)))};Xe.privateKeyModInverse=function(e){if(e.length!==32)throw new Error("private key length is invalid");return Buffer.from(Km.privateKeyModInverse(Uint8Array.from(e)))};Xe.privateKeyTweakAdd=function(e,t){return Buffer.from(on.privateKeyTweakAdd(Uint8Array.from(e),t))};Xe.privateKeyTweakMul=function(e,t){return Buffer.from(on.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t)))};Xe.publicKeyCreate=function(e,t){return Buffer.from(on.publicKeyCreate(Uint8Array.from(e),t))};Xe.publicKeyConvert=function(e,t){return Buffer.from(on.publicKeyConvert(Uint8Array.from(e),t))};Xe.publicKeyVerify=function(e){return e.length!==33&&e.length!==65?!1:on.publicKeyVerify(Uint8Array.from(e))};Xe.publicKeyTweakAdd=function(e,t,r){return Buffer.from(on.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(t),r))};Xe.publicKeyTweakMul=function(e,t,r){return Buffer.from(on.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t),r))};Xe.publicKeyCombine=function(e,t){var r=[];return e.forEach(function(n){r.push(Uint8Array.from(n))}),Buffer.from(on.publicKeyCombine(r,t))};Xe.signatureNormalize=function(e){return Buffer.from(on.signatureNormalize(Uint8Array.from(e)))};Xe.signatureExport=function(e){return Buffer.from(on.signatureExport(Uint8Array.from(e)))};Xe.signatureImport=function(e){return Buffer.from(on.signatureImport(Uint8Array.from(e)))};Xe.signatureImportLax=function(e){if(e.length===0)throw new RangeError("signature length is invalid");var t=N3.signatureImportLax(e);if(t===null)throw new Error("couldn't parse DER signature");return Km.signatureImport(t)};Xe.sign=function(e,t,r){if(r===null)throw new TypeError("options should be an Object");var n=void 0;if(r){if(n={},r.data===null)throw new TypeError("options.data should be a Buffer");if(r.data){if(r.data.length!=32)throw new RangeError("options.data length is invalid");n.data=new Uint8Array(r.data)}if(r.noncefn===null)throw new TypeError("options.noncefn should be a Function");r.noncefn&&(n.noncefn=function(o,a,c,v,y){var w=c!=null?Buffer.from(c):null,M=v!=null?Buffer.from(v):null,S=Buffer.from("");return r.noncefn&&(S=r.noncefn(Buffer.from(o),Buffer.from(a),w,M,y)),new Uint8Array(S)})}var i=on.ecdsaSign(Uint8Array.from(e),Uint8Array.from(t),n);return{signature:Buffer.from(i.signature),recovery:i.recid}};Xe.verify=function(e,t,r){return on.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),r)};Xe.recover=function(e,t,r,n){return Buffer.from(on.ecdsaRecover(Uint8Array.from(t),r,Uint8Array.from(e),n))};Xe.ecdh=function(e,t){return Buffer.from(on.ecdh(Uint8Array.from(e),Uint8Array.from(t),{}))};Xe.ecdhUnsafe=function(e,t,r){if(e.length!==33&&e.length!==65)throw new RangeError("public key length is invalid");if(t.length!==32)throw new RangeError("private key length is invalid");return Buffer.from(Km.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),r))}});var YB=E(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.KECCAK256_RLP=kr.KECCAK256_RLP_S=kr.KECCAK256_RLP_ARRAY=kr.KECCAK256_RLP_ARRAY_S=kr.KECCAK256_NULL=kr.KECCAK256_NULL_S=kr.TWO_POW256=kr.MAX_INTEGER=void 0;var ZB=Hs();kr.MAX_INTEGER=new ZB("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16);kr.TWO_POW256=new ZB("10000000000000000000000000000000000000000000000000000000000000000",16);kr.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";kr.KECCAK256_NULL=Buffer.from(kr.KECCAK256_NULL_S,"hex");kr.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347";kr.KECCAK256_RLP_ARRAY=Buffer.from(kr.KECCAK256_RLP_ARRAY_S,"hex");kr.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421";kr.KECCAK256_RLP=Buffer.from(kr.KECCAK256_RLP_S,"hex")});var oc=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.baToJSON=Et.addHexPrefix=Et.toUnsigned=Et.fromSigned=Et.bufferToHex=Et.bufferToInt=Et.toBuffer=Et.stripZeros=Et.unpad=Et.setLengthRight=Et.setLength=Et.setLengthLeft=Et.zeros=void 0;var ic=su(),q3=Hs();Et.zeros=function(e){return Buffer.allocUnsafe(e).fill(0)};Et.setLengthLeft=function(e,t,r){r===void 0&&(r=!1);var n=Et.zeros(t);return e=Et.toBuffer(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)};Et.setLength=Et.setLengthLeft;Et.setLengthRight=function(e,t){return Et.setLength(e,t,!0)};Et.unpad=function(e){e=ic.stripHexPrefix(e);for(var t=e[0];e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e};Et.stripZeros=Et.unpad;Et.toBuffer=function(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")if(ic.isHexString(e))e=Buffer.from(ic.padToEven(ic.stripHexPrefix(e)),"hex");else throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);else if(typeof e=="number")e=ic.intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(q3.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e};Et.bufferToInt=function(e){return new q3(Et.toBuffer(e)).toNumber()};Et.bufferToHex=function(e){return e=Et.toBuffer(e),"0x"+e.toString("hex")};Et.fromSigned=function(e){return new q3(e).fromTwos(256)};Et.toUnsigned=function(e){return Buffer.from(e.toTwos(256).toArray())};Et.addHexPrefix=function(e){return typeof e!="string"||ic.isHexPrefixed(e)?e:"0x"+e};Et.baToJSON=function(e){if(Buffer.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var t=[],r=0;r<e.length;r++)t.push(Et.baToJSON(e[r]));return t}}});var Jm=E($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.rlphash=$n.ripemd160=$n.sha256=$n.keccak256=$n.keccak=void 0;var Ym=y2(),X0e=Ym.keccak224,ede=Ym.keccak384,tde=Ym.keccak256,rde=Ym.keccak512,JB=bx(),nde=su(),ide=ph(),Zm=oc();$n.keccak=function(e,t){switch(t===void 0&&(t=256),typeof e=="string"&&!nde.isHexString(e)?e=Buffer.from(e,"utf8"):e=Zm.toBuffer(e),t||(t=256),t){case 224:return X0e(e);case 256:return tde(e);case 384:return ede(e);case 512:return rde(e);default:throw new Error("Invald algorithm: keccak"+t)}};$n.keccak256=function(e){return $n.keccak(e)};$n.sha256=function(e){return e=Zm.toBuffer(e),JB("sha256").update(e).digest()};$n.ripemd160=function(e,t){e=Zm.toBuffer(e);var r=JB("rmd160").update(e).digest();return t===!0?Zm.setLength(r,32):r};$n.rlphash=function(e){return $n.keccak(ide.encode(e))}});var QB=E(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.importPublic=Mt.privateToPublic=Mt.privateToAddress=Mt.publicToAddress=Mt.pubToAddress=Mt.isValidPublic=Mt.isValidPrivate=Mt.isPrecompiled=Mt.generateAddress2=Mt.generateAddress=Mt.isValidChecksumAddress=Mt.toChecksumAddress=Mt.isZeroAddress=Mt.isValidAddress=Mt.zeroAddress=void 0;var L3=R1(),ode=su(),sc=Gm(),sde=Hs(),Hi=oc(),ac=Jm();Mt.zeroAddress=function(){var e=20,t=Hi.zeros(e);return Hi.bufferToHex(t)};Mt.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)};Mt.isZeroAddress=function(e){var t=Mt.zeroAddress();return t===Hi.addHexPrefix(e)};Mt.toChecksumAddress=function(e,t){e=ode.stripHexPrefix(e).toLowerCase();for(var r=t!==void 0?t.toString()+"0x":"",n=ac.keccak(r+e).toString("hex"),i="0x",o=0;o<e.length;o++)parseInt(n[o],16)>=8?i+=e[o].toUpperCase():i+=e[o];return i};Mt.isValidChecksumAddress=function(e,t){return Mt.isValidAddress(e)&&Mt.toChecksumAddress(e,t)===e};Mt.generateAddress=function(e,t){e=Hi.toBuffer(e);var r=new sde(t);return r.isZero()?ac.rlphash([e,null]).slice(-20):ac.rlphash([e,Buffer.from(r.toArray())]).slice(-20)};Mt.generateAddress2=function(e,t,r){var n=Hi.toBuffer(e),i=Hi.toBuffer(t),o=Hi.toBuffer(r);L3(n.length===20),L3(i.length===32);var a=ac.keccak256(Buffer.concat([Buffer.from("ff","hex"),n,i,ac.keccak256(o)]));return a.slice(-20)};Mt.isPrecompiled=function(e){var t=Hi.unpad(e);return t.length===1&&t[0]>=1&&t[0]<=8};Mt.isValidPrivate=function(e){return sc.privateKeyVerify(e)};Mt.isValidPublic=function(e,t){return t===void 0&&(t=!1),e.length===64?sc.publicKeyVerify(Buffer.concat([Buffer.from([4]),e])):t?sc.publicKeyVerify(e):!1};Mt.pubToAddress=function(e,t){return t===void 0&&(t=!1),e=Hi.toBuffer(e),t&&e.length!==64&&(e=sc.publicKeyConvert(e,!1).slice(1)),L3(e.length===64),ac.keccak(e).slice(-20)};Mt.publicToAddress=Mt.pubToAddress;Mt.privateToAddress=function(e){return Mt.publicToAddress(Mt.privateToPublic(e))};Mt.privateToPublic=function(e){return e=Hi.toBuffer(e),sc.publicKeyCreate(e,!1).slice(1)};Mt.importPublic=function(e){return e=Hi.toBuffer(e),e.length!==64&&(e=sc.publicKeyConvert(e,!1).slice(1)),e}});var XB=E(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.hashPersonalMessage=Kn.isValidSignature=Kn.fromRpcSig=Kn.toRpcSig=Kn.ecrecover=Kn.ecsign=void 0;var B3=Gm(),Qm=Hs(),lu=oc(),ade=Jm();Kn.ecsign=function(e,t,r){var n=B3.sign(e,t),i=n.recovery,o={r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?i+(r*2+35):i+27};return o};Kn.ecrecover=function(e,t,r,n,i){var o=Buffer.concat([lu.setLength(r,32),lu.setLength(n,32)],64),a=D3(t,i);if(!j3(a))throw new Error("Invalid signature v value");var c=B3.recover(e,o,a);return B3.publicKeyConvert(c,!1).slice(1)};Kn.toRpcSig=function(e,t,r,n){var i=D3(e,n);if(!j3(i))throw new Error("Invalid signature v value");return lu.bufferToHex(Buffer.concat([lu.setLengthLeft(t,32),lu.setLengthLeft(r,32),lu.toBuffer(e)]))};Kn.fromRpcSig=function(e){var t=lu.toBuffer(e);if(t.length!==65)throw new Error("Invalid signature length");var r=t[64];return r<27&&(r+=27),{v:r,r:t.slice(0,32),s:t.slice(32,64)}};Kn.isValidSignature=function(e,t,r,n,i){n===void 0&&(n=!0);var o=new Qm("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new Qm("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(t.length!==32||r.length!==32||!j3(D3(e,i)))return!1;var c=new Qm(t),v=new Qm(r);return!(c.isZero()||c.gt(a)||v.isZero()||v.gt(a)||n&&v.cmp(o)===1)};Kn.hashPersonalMessage=function(e){var t=Buffer.from(`Ethereum Signed Message:
552
+ `+e.length.toString(),"utf-8");return ade.keccak(Buffer.concat([t,e]))};function D3(e,t){return t?e-(2*t+35):e-27}function j3(e){return e===0||e===1}});var rD=E(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.defineProperties=void 0;var eD=R1(),ude=su(),tD=ph(),Xm=oc();eg.defineProperties=function(e,t,r){if(e.raw=[],e._fields=[],e.toJSON=function(i){if(i===void 0&&(i=!1),i){var o={};return e._fields.forEach(function(a){o[a]="0x"+e[a].toString("hex")}),o}return Xm.baToJSON(e.raw)},e.serialize=function(){return tD.encode(e.raw)},t.forEach(function(i,o){e._fields.push(i.name);function a(){return e.raw[o]}function c(v){v=Xm.toBuffer(v),v.toString("hex")==="00"&&!i.allowZero&&(v=Buffer.allocUnsafe(0)),i.allowLess&&i.length?(v=Xm.stripZeros(v),eD(i.length>=v.length,"The field "+i.name+" must not have more "+i.length+" bytes")):!(i.allowZero&&v.length===0)&&i.length&&eD(i.length===v.length,"The field "+i.name+" must have byte length of "+i.length),e.raw[o]=v}Object.defineProperty(e,i.name,{enumerable:!0,configurable:!0,get:a,set:c}),i.default&&(e[i.name]=i.default),i.alias&&Object.defineProperty(e,i.alias,{enumerable:!1,configurable:!0,set:c,get:a})}),r)if(typeof r=="string"&&(r=Buffer.from(ude.stripHexPrefix(r),"hex")),Buffer.isBuffer(r)&&(r=tD.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach(function(i,o){e[e._fields[o]]=Xm.toBuffer(i)})}else if(typeof r=="object"){var n=Object.keys(r);t.forEach(function(i){n.indexOf(i.name)!==-1&&(e[i.name]=r[i.name]),n.indexOf(i.alias)!==-1&&(e[i.alias]=r[i.alias])})}else throw new Error("invalid data")}});var nD=E(jr=>{"use strict";var fde=jr&&jr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),uc=jr&&jr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&fde(t,e,r)};Object.defineProperty(jr,"__esModule",{value:!0});jr.secp256k1=jr.rlp=jr.BN=void 0;var cde=Gm();jr.secp256k1=cde;var lde=su(),hde=Hs();jr.BN=hde;var dde=ph();jr.rlp=dde;Object.assign(jr,lde);uc(YB(),jr);uc(QB(),jr);uc(Jm(),jr);uc(XB(),jr);uc(oc(),jr);uc(rD(),jr)});var aD=E((aLe,sD)=>{var _o=nD(),Gn=Hs(),gr=function(){};function tg(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}gr.eventID=function(e,t){var r=e+"("+t.map(tg).join(",")+")";return _o.keccak256(Buffer.from(r))};gr.methodID=function(e,t){return gr.eventID(e,t).slice(0,4)};function Ws(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function F3(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Uh(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function hu(e){var t=typeof e;if(t==="string")return _o.isHexPrefixed(e)?new Gn(_o.stripHexPrefix(e),16):new Gn(e,10);if(t==="number")return new Gn(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function oD(e){var t=/^(\w+)\((.*)\)$/.exec(e);if(t.length!==3)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(t[2]);if(r!==null&&r.length===3)return{method:t[1],args:r[1].split(","),retargs:r[2].split(",")};var n=t[2].split(",");return n.length===1&&n[0]===""&&(n=[]),{method:t[1],args:n}}function yo(e,t){var r,n,i,o;if(e==="address")return yo("uint160",hu(t));if(e==="bool")return yo("uint8",t?1:0);if(e==="string")return yo("bytes",Buffer.from(t,"utf8"));if(Fh(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Uh(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(o in t)i.push(yo(e,t[o]));if(r==="dynamic"){var a=yo("uint256",t.length);i.unshift(a)}return Buffer.concat(i)}else{if(e==="bytes")return t=Buffer.from(t),i=Buffer.concat([yo("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,_o.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Ws(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return _o.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Ws(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=hu(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Ws(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=hu(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=F3(e),n=hu(t),n<0)throw new Error("Supplied ufixed is negative");return yo("uint256",n.mul(new Gn(2).pow(new Gn(r[1]))))}else if(e.startsWith("fixed"))return r=F3(e),yo("int256",hu(t).mul(new Gn(2).pow(new Gn(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Wi(e,t,r){typeof e=="string"&&(e=U3(e));var n,i,o,a;if(e.name==="address")return Wi(e.rawType,t,r).toArrayLike(Buffer,"be",20).toString("hex");if(e.name==="bool")return Wi(e.rawType,t,r).toString()===new Gn(1).toString();if(e.name==="string"){var c=Wi(e.rawType,t,r);return Buffer.from(c,"utf8").toString()}else if(e.isArray){for(o=[],n=e.size,e.size==="dynamic"&&(r=Wi("uint256",t,r).toNumber(),n=Wi("uint256",t,r).toNumber(),r=r+32),a=0;a<n;a++){var v=Wi(e.subArray,t,r);o.push(v),r+=e.subArray.memoryUsage}return o}else{if(e.name==="bytes")return r=Wi("uint256",t,r).toNumber(),n=Wi("uint256",t,r).toNumber(),t.slice(r+32,r+32+n);if(e.name.startsWith("bytes"))return t.slice(r,r+e.size);if(e.name.startsWith("uint")){if(i=new Gn(t.slice(r,r+32),16,"be"),i.bitLength()>e.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+i.bitLength());return i}else if(e.name.startsWith("int")){if(i=new Gn(t.slice(r,r+32),16,"be").fromTwos(256),i.bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+i.bitLength());return i}else if(e.name.startsWith("ufixed")){if(n=new Gn(2).pow(new Gn(e.size[1])),i=Wi("uint256",t,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}else if(e.name.startsWith("fixed")){if(n=new Gn(2).pow(new Gn(e.size[1])),i=Wi("int256",t,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}}throw new Error("Unsupported or invalid type: "+e.name)}function U3(e){var t,r;if(Fh(e)){t=Uh(e);var n=e.slice(0,e.lastIndexOf("["));return n=U3(n),r={isArray:!0,name:e,size:t,memoryUsage:t==="dynamic"?32:n.memoryUsage*t,subArray:n},r}else{var i;switch(e){case"address":i="uint160";break;case"bool":i="uint8";break;case"string":i="bytes";break}if(r={rawType:i,name:e,memoryUsage:32},e.startsWith("bytes")&&e!=="bytes"||e.startsWith("uint")||e.startsWith("int")?r.size=Ws(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(r.size=F3(e)),e.startsWith("bytes")&&e!=="bytes"&&(r.size<1||r.size>32))throw new Error("Invalid bytes<N> width: "+r.size);if((e.startsWith("uint")||e.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint<N> width: "+r.size);return r}}function pde(e){return e==="string"||e==="bytes"||Uh(e)==="dynamic"}function Fh(e){return e.lastIndexOf("]")===e.length-1}gr.rawEncode=function(e,t){var r=[],n=[],i=0;e.forEach(function(y){if(Fh(y)){var w=Uh(y);w!=="dynamic"?i+=32*w:i+=32}else i+=32});for(var o=0;o<e.length;o++){var a=tg(e[o]),c=t[o],v=yo(a,c);pde(a)?(r.push(yo("uint256",i)),n.push(v),i+=v.length):r.push(v)}return Buffer.concat(r.concat(n))};gr.rawDecode=function(e,t){var r=[];t=Buffer.from(t);for(var n=0,i=0;i<e.length;i++){var o=tg(e[i]),a=U3(o,t,n),c=Wi(a,t,n);n+=a.memoryUsage,r.push(c)}return r};gr.simpleEncode=function(e){var t=Array.prototype.slice.call(arguments).slice(1),r=oD(e);if(t.length!==r.args.length)throw new Error("Argument count mismatch");return Buffer.concat([gr.methodID(r.method,r.args),gr.rawEncode(r.args,t)])};gr.simpleDecode=function(e,t){var r=oD(e);if(!r.retargs)throw new Error("No return values in method");return gr.rawDecode(r.retargs,t)};function iD(e,t){return e.startsWith("address")||e.startsWith("bytes")?"0x"+t.toString("hex"):t.toString()}gr.stringify=function(e,t){var r=[];for(var n in e){var i=e[n],o=t[n];/^[^\[]+\[.*\]$/.test(i)?o=o.map(function(a){return iD(i,a)}).join(", "):o=iD(i,o),r.push(o)}return r};gr.solidityHexValue=function(e,t,r){var n,i;if(Fh(e)){var o=e.replace(/\[.*?\]/,"");if(!Fh(o)){var a=Uh(e);if(a!=="dynamic"&&a!==0&&t.length>a)throw new Error("Elements exceed array size: "+a)}var c=t.map(function(w){return gr.solidityHexValue(o,w,256)});return Buffer.concat(c)}else{if(e==="bytes")return t;if(e==="string")return Buffer.from(t,"utf8");if(e==="bool"){r=r||8;var v=Array(r/4).join("0");return Buffer.from(t?v+"1":v+"0","hex")}else if(e==="address"){var y=20;return r&&(y=r/8),_o.setLengthLeft(t,y)}else if(e.startsWith("bytes")){if(n=Ws(e),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return _o.setLengthRight(t,n)}else if(e.startsWith("uint")){if(n=Ws(e),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(i=hu(t),i.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toArrayLike(Buffer,"be",r/8)}else if(e.startsWith("int")){if(n=Ws(e),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(i=hu(t),i.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toTwos(n).toArrayLike(Buffer,"be",r/8)}else throw new Error("Unsupported or invalid type: "+e)}};gr.solidityPack=function(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r=[],n=0;n<e.length;n++){var i=tg(e[n]),o=t[n];r.push(gr.solidityHexValue(i,o,null))}return Buffer.concat(r)};gr.soliditySHA3=function(e,t){return _o.keccak256(gr.solidityPack(e,t))};gr.soliditySHA256=function(e,t){return _o.sha256(gr.solidityPack(e,t))};gr.solidityRIPEMD160=function(e,t){return _o.ripemd160(gr.solidityPack(e,t),!0)};function vde(e){return e>="0"&&e<="9"}gr.fromSerpent=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n==="s")t.push("bytes");else if(n==="b"){for(var i="bytes",o=r+1;o<e.length&&vde(e[o]);)i+=e[o]-"0",o++;r=o-1,t.push(i)}else if(n==="i")t.push("int256");else if(n==="a")t.push("int256[]");else throw new Error("Unsupported or invalid type: "+n)}return t};gr.toSerpent=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n==="bytes")t.push("s");else if(n.startsWith("bytes"))t.push("b"+Ws(n));else if(n==="int256")t.push("i");else if(n==="int256[]")t.push("a");else throw new Error("Unsupported or invalid type: "+n)}return t.join("")};sD.exports=gr});var fD=E((uLe,uD)=>{uD.exports=aD()});var pD=E((fLe,dD)=>{var er=Ff(),H3=fD();dD.exports={concatSig:function(e,t,r){let n=er.fromSigned(t),i=er.fromSigned(r),o=er.bufferToInt(e),a=lD(er.toUnsigned(n).toString("hex"),64),c=lD(er.toUnsigned(i).toString("hex"),64),v=er.stripHexPrefix(er.intToHex(o));return er.addHexPrefix(a.concat(c,v)).toString("hex")},normalize:function(e){if(!!e){if(typeof e=="number"){let r=er.toBuffer(e);e=er.bufferToHex(r)}if(typeof e!="string"){var t="eth-sig-util.normalize() requires hex string or integer input.";throw t+=" received "+typeof e+": "+e,new Error(t)}return er.addHexPrefix(e.toLowerCase())}},personalSign:function(e,t){var r=er.toBuffer(t.data),n=er.hashPersonalMessage(r),i=er.ecsign(n,e),o=er.bufferToHex(this.concatSig(i.v,i.r,i.s));return o},recoverPersonalSignature:function(e){let t=cD(e),r=er.publicToAddress(t);return er.bufferToHex(r)},extractPublicKey:function(e){let t=cD(e);return"0x"+t.toString("hex")},typedSignatureHash:function(e){let t=W3(e);return er.bufferToHex(t)},signTypedData:function(e,t){let r=W3(t.data),n=er.ecsign(r,e);return er.bufferToHex(this.concatSig(n.v,n.r,n.s))},recoverTypedSignature:function(e){let t=W3(e.data),r=hD(t,e.sig),n=er.publicToAddress(r);return er.bufferToHex(n)}};function W3(e){let t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;let r=e.map(function(o){return o.type==="bytes"?er.toBuffer(o.value):o.value}),n=e.map(function(o){return o.type}),i=e.map(function(o){if(!o.name)throw t;return o.type+" "+o.name});return H3.soliditySHA3(["bytes32","bytes32"],[H3.soliditySHA3(new Array(e.length).fill("string"),i),H3.soliditySHA3(n,r)])}function hD(e,t){let r=er.toBuffer(t),n=er.fromRpcSig(r);return er.ecrecover(e,n.v,n.r,n.s)}function cD(e){let t=er.toBuffer(e.data),r=er.hashPersonalMessage(t);return hD(r,e.sig)}function lD(e,t){for(var r=""+e;r.length<t;)r="0"+r;return r}});var mD=E((z3,vD)=>{(function(e){"use strict";var t=function(n){setTimeout(n,0)};typeof process<"u"&&process&&typeof process.nextTick=="function"&&(t=process.nextTick);function r(n){var i={capacity:n||1,current:0,queue:[],firstHere:!1,take:function(){if(i.firstHere===!1){i.current++,i.firstHere=!0;var o=1}else var o=0;var a={n:1};typeof arguments[0]=="function"?a.task=arguments[0]:a.n=arguments[0],arguments.length>=2&&(typeof arguments[1]=="function"?a.task=arguments[1]:a.n=arguments[1]);var c=a.task;if(a.task=function(){c(i.leave)},i.current+a.n-o>i.capacity)return o===1&&(i.current--,i.firstHere=!1),i.queue.push(a);i.current+=a.n-o,a.task(i.leave),o===1&&(i.firstHere=!1)},leave:function(o){if(o=o||1,i.current-=o,!i.queue.length){if(i.current<0)throw new Error("leave called too many times.");return}var a=i.queue[0];a.n+i.current>i.capacity||(i.queue.shift(),i.current+=a.n,t(a.task))},available:function(o){return o=o||1,i.current+o<=i.capacity}};return i}typeof z3=="object"?vD.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):e.semaphore=r})(z3)});var bD=E((cLe,gD)=>{var mde=ym();gD.exports=gde;function gde(e,t,r){e.sendAsync(mde({method:"eth_estimateGas",params:[t]}),function(n,i){if(n)return n.message==="no contract code at given address"?r(null,"0xcf08"):r(n);r(null,i.result)})}});var wD=E((lLe,_D)=>{var yn=jB(),bde=zB(),yde=$o().inherits,rg=Ff(),_de=pD(),cc=H1(),wde=mD(),xde=qh(),Mde=bD(),Sde=/^[0-9A-Fa-f]+$/g;_D.exports=zt;yde(zt,xde);function zt(e){let t=this;t.nonceLock=wde(1),e.getAccounts&&(t.getAccounts=e.getAccounts),e.processTransaction&&(t.processTransaction=e.processTransaction),e.processMessage&&(t.processMessage=e.processMessage),e.processPersonalMessage&&(t.processPersonalMessage=e.processPersonalMessage),e.processTypedMessage&&(t.processTypedMessage=e.processTypedMessage),t.approveTransaction=e.approveTransaction||t.autoApprove,t.approveMessage=e.approveMessage||t.autoApprove,t.approvePersonalMessage=e.approvePersonalMessage||t.autoApprove,t.approveDecryptMessage=e.approveDecryptMessage||t.autoApprove,t.approveEncryptionPublicKey=e.approveEncryptionPublicKey||t.autoApprove,t.approveTypedMessage=e.approveTypedMessage||t.autoApprove,e.signTransaction&&(t.signTransaction=e.signTransaction||fc("signTransaction")),e.signMessage&&(t.signMessage=e.signMessage||fc("signMessage")),e.signPersonalMessage&&(t.signPersonalMessage=e.signPersonalMessage||fc("signPersonalMessage")),e.decryptMessage&&(t.decryptMessage=e.decryptMessage||fc("decryptMessage")),e.encryptionPublicKey&&(t.encryptionPublicKey=e.encryptionPublicKey||fc("encryptionPublicKey")),e.signTypedMessage&&(t.signTypedMessage=e.signTypedMessage||fc("signTypedMessage")),e.recoverPersonalSignature&&(t.recoverPersonalSignature=e.recoverPersonalSignature),e.publishTransaction&&(t.publishTransaction=e.publishTransaction),t.estimateGas=e.estimateGas||t.estimateGas,t.getGasPrice=e.getGasPrice||t.getGasPrice}zt.prototype.handleRequest=function(e,t,r){let n=this;n._parityRequests={},n._parityRequestCount=0;let i,o,a,c,v;switch(e.method){case"eth_coinbase":n.getAccounts(function(y,w){if(y)return r(y);let M=w[0]||null;r(null,M)});return;case"eth_accounts":n.getAccounts(function(y,w){if(y)return r(y);r(null,w)});return;case"eth_sendTransaction":i=e.params[0],yn([y=>n.validateTransaction(i,y),y=>n.processTransaction(i,y)],r);return;case"eth_signTransaction":i=e.params[0],yn([y=>n.validateTransaction(i,y),y=>n.processSignTransaction(i,y)],r);return;case"eth_sign":v=e.params[0],c=e.params[1],a=e.params[2]||{},o=cc(a,{from:v,data:c}),yn([y=>n.validateMessage(o,y),y=>n.processMessage(o,y)],r);return;case"personal_sign":return function(){let y=e.params[0],w=e.params[1];if(yD(w)&&V3(y)){let M="The eth_personalSign method requires params ordered ";M+="[message, address]. This was previously handled incorrectly, ",M+="and has been corrected automatically. ",M+="Please switch this param order for smooth behavior in the future.",console.warn(M),v=e.params[0],c=e.params[1]}else c=e.params[0],v=e.params[1];a=e.params[2]||{},o=cc(a,{from:v,data:c}),yn([M=>n.validatePersonalMessage(o,M),M=>n.processPersonalMessage(o,M)],r)}();case"eth_decryptMessage":return function(){let y=e.params[0],w=e.params[1];if(yD(w)&&V3(y)){let M="The eth_decryptMessage method requires params ordered ";M+="[message, address]. This was previously handled incorrectly, ",M+="and has been corrected automatically. ",M+="Please switch this param order for smooth behavior in the future.",console.warn(M),v=e.params[0],c=e.params[1]}else c=e.params[0],v=e.params[1];a=e.params[2]||{},o=cc(a,{from:v,data:c}),yn([M=>n.validateDecryptMessage(o,M),M=>n.processDecryptMessage(o,M)],r)}();case"encryption_public_key":return function(){let y=e.params[0];yn([w=>n.validateEncryptionPublicKey(y,w),w=>n.processEncryptionPublicKey(y,w)],r)}();case"personal_ecRecover":return function(){c=e.params[0];let y=e.params[1];a=e.params[2]||{},o=cc(a,{sig:y,data:c}),n.recoverPersonalSignature(o,r)}();case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){let y=e.params[0],w=e.params[1];V3(y)?(v=y,c=w):(c=y,v=w),a=e.params[2]||{},o=cc(a,{from:v,data:c}),yn([M=>n.validateTypedMessage(o,M),M=>n.processTypedMessage(o,M)],r)}();case"parity_postTransaction":i=e.params[0],n.parityPostTransaction(i,r);return;case"parity_postSign":v=e.params[0],c=e.params[1],n.parityPostSign(v,c,r);return;case"parity_checkRequest":return function(){let y=e.params[0];n.parityCheckRequest(y,r)}();case"parity_defaultAccount":n.getAccounts(function(y,w){if(y)return r(y);let M=w[0]||null;r(null,M)});return;default:t();return}};zt.prototype.getAccounts=function(e){e(null,[])};zt.prototype.processTransaction=function(e,t){let r=this;yn([n=>r.approveTransaction(e,n),(n,i)=>r.checkApproval("transaction",n,i),n=>r.finalizeAndSubmitTx(e,n)],t)};zt.prototype.processSignTransaction=function(e,t){let r=this;yn([n=>r.approveTransaction(e,n),(n,i)=>r.checkApproval("transaction",n,i),n=>r.finalizeTx(e,n)],t)};zt.prototype.processMessage=function(e,t){let r=this;yn([n=>r.approveMessage(e,n),(n,i)=>r.checkApproval("message",n,i),n=>r.signMessage(e,n)],t)};zt.prototype.processPersonalMessage=function(e,t){let r=this;yn([n=>r.approvePersonalMessage(e,n),(n,i)=>r.checkApproval("message",n,i),n=>r.signPersonalMessage(e,n)],t)};zt.prototype.processDecryptMessage=function(e,t){let r=this;yn([n=>r.approveDecryptMessage(e,n),(n,i)=>r.checkApproval("decryptMessage",n,i),n=>r.decryptMessage(e,n)],t)};zt.prototype.processEncryptionPublicKey=function(e,t){let r=this;yn([n=>r.approveEncryptionPublicKey(e,n),(n,i)=>r.checkApproval("encryptionPublicKey",n,i),n=>r.encryptionPublicKey(e,n)],t)};zt.prototype.processTypedMessage=function(e,t){let r=this;yn([n=>r.approveTypedMessage(e,n),(n,i)=>r.checkApproval("message",n,i),n=>r.signTypedMessage(e,n)],t)};zt.prototype.autoApprove=function(e,t){t(null,!0)};zt.prototype.checkApproval=function(e,t,r){r(t?null:new Error("User denied "+e+" signature."))};zt.prototype.parityPostTransaction=function(e,t){let r=this,i=`0x${r._parityRequestCount.toString(16)}`;r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[e]},function(o,a){if(o){r._parityRequests[i]={error:o};return}let c=a.result;r._parityRequests[i]=c}),t(null,i)};zt.prototype.parityPostSign=function(e,t,r){let n=this,o=`0x${n._parityRequestCount.toString(16)}`;n._parityRequestCount++,n.emitPayload({method:"eth_sign",params:[e,t]},function(a,c){if(a){n._parityRequests[o]={error:a};return}let v=c.result;n._parityRequests[o]=v}),r(null,o)};zt.prototype.parityCheckRequest=function(e,t){let n=this._parityRequests[e]||null;if(!n)return t(null,null);if(n.error)return t(n.error);t(null,n)};zt.prototype.recoverPersonalSignature=function(e,t){let r;try{r=_de.recoverPersonalSignature(e)}catch(n){return t(n)}t(null,r)};zt.prototype.validateTransaction=function(e,t){let r=this;if(e.from===void 0)return t(new Error("Undefined address - from address required to sign transaction."));r.validateSender(e.from,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to sign transaction for this address: "${e.from}"`));t()})};zt.prototype.validateMessage=function(e,t){let r=this;if(e.from===void 0)return t(new Error("Undefined address - from address required to sign message."));r.validateSender(e.from,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`));t()})};zt.prototype.validatePersonalMessage=function(e,t){let r=this;if(e.from===void 0)return t(new Error("Undefined address - from address required to sign personal message."));if(e.data===void 0)return t(new Error("Undefined message - message required to sign personal message."));if(!$3(e.data))return t(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."));r.validateSender(e.from,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`));t()})};zt.prototype.validateDecryptMessage=function(e,t){let r=this;if(e.from===void 0)return t(new Error("Undefined address - from address required to decrypt message."));if(e.data===void 0)return t(new Error("Undefined message - message required to decrypt message."));if(!$3(e.data))return t(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."));r.validateSender(e.from,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to decrypt message for this address: "${e.from}"`));t()})};zt.prototype.validateEncryptionPublicKey=function(e,t){this.validateSender(e,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to obtain encryption public key for this address: "${e}"`));t()})};zt.prototype.validateTypedMessage=function(e,t){if(e.from===void 0)return t(new Error("Undefined address - from address required to sign typed data."));if(e.data===void 0)return t(new Error("Undefined data - message required to sign typed data."));this.validateSender(e.from,function(r,n){if(r)return t(r);if(!n)return t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`));t()})};zt.prototype.validateSender=function(e,t){let r=this;if(!e)return t(null,!1);r.getAccounts(function(n,i){if(n)return t(n);let o=i.map(Ade).indexOf(e.toLowerCase())!==-1;t(null,o)})};zt.prototype.finalizeAndSubmitTx=function(e,t){let r=this;r.nonceLock.take(function(){yn([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r),r.publishTransaction.bind(r)],function(n,i){if(r.nonceLock.leave(),n)return t(n);t(null,i)})})};zt.prototype.finalizeTx=function(e,t){let r=this;r.nonceLock.take(function(){yn([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r)],function(n,i){if(r.nonceLock.leave(),n)return t(n);t(null,{raw:i,tx:e})})})};zt.prototype.publishTransaction=function(e,t){this.emitPayload({method:"eth_sendRawTransaction",params:[e]},function(n,i){if(n)return t(n);t(null,i.result)})};zt.prototype.estimateGas=function(e,t){Mde(this.engine,e,t)};zt.prototype.getGasPrice=function(e){this.emitPayload({method:"eth_gasPrice",params:[]},function(r,n){if(r)return e(r);e(null,n.result)})};zt.prototype.fillInTxExtras=function(e,t){let r=this,n=e.from,i={};e.gasPrice===void 0&&(i.gasPrice=r.getGasPrice.bind(r)),e.nonce===void 0&&(i.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[n,"pending"]})),e.gas===void 0&&(i.gas=r.estimateGas.bind(r,Ede(e))),bde(i,function(o,a){if(o)return t(o);let c={};a.gasPrice&&(c.gasPrice=a.gasPrice),a.nonce&&(c.nonce=a.nonce.result),a.gas&&(c.gas=a.gas),t(null,cc(e,c))})};function Ede(e){return{from:e.from,to:e.to,value:e.value,data:e.data,gas:e.gas,gasPrice:e.gasPrice,nonce:e.nonce}}function Ade(e){return e.toLowerCase()}function V3(e){let t=rg.addHexPrefix(e);return rg.isValidAddress(t)}function yD(e){let t=rg.addHexPrefix(e);return!rg.isValidAddress(t)&&$3(e)}function $3(e){return!(typeof e=="string")||!(e.slice(0,2)==="0x")?!1:e.slice(2).match(Sde)}function fc(e){return function(t,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+e+'" fn in constructor options'))}}});var xD=E((hLe,Ode)=>{Ode.exports={genesisGasLimit:{v:5e3,d:"Gas limit of the Genesis block."},genesisDifficulty:{v:17179869184,d:"Difficulty of the Genesis block."},genesisNonce:{v:"0x0000000000000042",d:"the geneis nonce"},genesisExtraData:{v:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",d:"extra data "},genesisHash:{v:"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",d:"genesis hash"},genesisStateRoot:{v:"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",d:"the genesis state root"},minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be."},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations."},minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be."},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations."},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},maximumExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis."},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs."},stackLimit:{v:1024,d:"Maximum size of VM stack allowed."},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack."},tierStepGas:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them."},expGas:{v:10,d:"Once per EXP instuction."},expByteGas:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction."},sha3Gas:{v:30,d:"Once per SHA3 operation."},sha3WordGas:{v:6,d:"Once per word of the SHA3 operation's data."},sloadGas:{v:50,d:"Once per SLOAD operation."},sstoreSetGas:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero."},sstoreResetGas:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero."},sstoreRefundGas:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero."},jumpdestGas:{v:1,d:"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},logGas:{v:375,d:"Per LOG* operation."},logDataGas:{v:8,d:"Per byte in a LOG* operation's data."},logTopicGas:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},createGas:{v:32e3,d:"Once per CREATE operation & contract-creation transaction."},callGas:{v:40,d:"Once per CALL operation & message call transaction."},callStipend:{v:2300,d:"Free gas given at beginning of call."},callValueTransferGas:{v:9e3,d:"Paid for CALL when the value transfor is non-zero."},callNewAccountGas:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior."},suicideRefundGas:{v:24e3,d:"Refunded following a suicide operation."},memoryGas:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation."},createDataGas:{v:200,d:""},txGas:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions."},txCreation:{v:32e3,d:"the cost of creating a contract via tx"},txDataZeroGas:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},txDataNonZeroGas:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},copyGas:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},ecrecoverGas:{v:3e3,d:""},sha256Gas:{v:60,d:""},sha256WordGas:{v:12,d:""},ripemd160Gas:{v:600,d:""},ripemd160WordGas:{v:120,d:""},identityGas:{v:15,d:""},identityWordGas:{v:3,d:""},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},ommerReward:{v:"625000000000000000",d:"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},niblingReward:{v:"156250000000000000",d:"the amount a miner gets for inculding a uncle"},homeSteadForkNumber:{v:115e4,d:"the block that the Homestead fork started at"},homesteadRepriceForkNumber:{v:2463e3,d:"the block that the Homestead Reprice (EIP150) fork started at"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},freeBlockPeriod:{v:2}}});var SD=E((dLe,MD)=>{"use strict";function Rde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var zs=Ff(),ng=xD(),du=zs.BN,Ide=new du("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),Cde=function(){function e(t){Rde(this,e),t=t||{};var r=[{name:"nonce",length:32,allowLess:!0,default:new Buffer([])},{name:"gasPrice",length:32,allowLess:!0,default:new Buffer([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new Buffer([])},{name:"to",allowZero:!0,length:20,default:new Buffer([])},{name:"value",length:32,allowLess:!0,default:new Buffer([])},{name:"data",alias:"input",allowZero:!0,default:new Buffer([])},{name:"v",allowZero:!0,default:new Buffer([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])}];zs.defineProperties(this,r,t),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var n=zs.bufferToInt(this.v),i=Math.floor((n-35)/2);i<0&&(i=0),this._chainId=i||t.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return this.to.toString("hex")===""},e.prototype.hash=function(r){r===void 0&&(r=!0);var n=void 0;if(r)n=this.raw;else if(this._chainId>0){var i=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,n=this.raw,this.raw=i}else n=this.raw.slice(0,6);return zs.rlphash(n)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var r=this.getSenderPublicKey();return this._from=zs.publicToAddress(r),this._from},e.prototype.getSenderPublicKey=function(){if((!this._senderPubKey||!this._senderPubKey.length)&&!this.verifySignature())throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var r=this.hash(!1);if(this._homestead&&new du(this.s).cmp(Ide)===1)return!1;try{var n=zs.bufferToInt(this.v);this._chainId>0&&(n-=this._chainId*2+8),this._senderPubKey=zs.ecrecover(r,n,this.r,this.s)}catch{return!1}return!!this._senderPubKey},e.prototype.sign=function(r){var n=this.hash(!1),i=zs.ecsign(n,r);this._chainId>0&&(i.v+=this._chainId*2+8),Object.assign(this,i)},e.prototype.getDataFee=function(){for(var r=this.raw[5],n=new du(0),i=0;i<r.length;i++)r[i]===0?n.iaddn(ng.txDataZeroGas.v):n.iaddn(ng.txDataNonZeroGas.v);return n},e.prototype.getBaseFee=function(){var r=this.getDataFee().iaddn(ng.txGas.v);return this._homestead&&this.toCreationAddress()&&r.iaddn(ng.txCreation.v),r},e.prototype.getUpfrontCost=function(){return new du(this.gasLimit).imul(new du(this.gasPrice)).iadd(new du(this.value))},e.prototype.validate=function(r){var n=[];return this.verifySignature()||n.push("Invalid Signature"),this.getBaseFee().cmp(new du(this.gasLimit))>0&&n.push(["gas limit is too low. Need at least "+this.getBaseFee()]),r===void 0||r===!1?n.length===0:n.join(" ")},e}();MD.exports=Cde});var AD=E((pLe,ED)=>{var Tde=$o().inherits,kde=SD(),ig=Ff(),Pde=qh(),Nde=Yx().blockTagForPayload;ED.exports=K3;Tde(K3,Pde);function K3(e){let t=this;t.nonceCache={}}K3.prototype.handleRequest=function(e,t,r){let n=this;switch(e.method){case"eth_getTransactionCount":var i=Nde(e),o=e.params[0].toLowerCase(),a=n.nonceCache[o];i==="pending"?a?r(null,a):t(function(c,v,y){if(c)return y();n.nonceCache[o]===void 0&&(n.nonceCache[o]=v),y()}):t();return;case"eth_sendRawTransaction":t(function(c,v,y){if(c)return y();var w=e.params[0],M=ig.stripHexPrefix(w),S=Buffer.from(ig.stripHexPrefix(w),"hex"),R=new kde(Buffer.from(ig.stripHexPrefix(w),"hex")),C="0x"+R.getSenderAddress().toString("hex").toLowerCase(),B=ig.bufferToInt(R.nonce);B++;var N=B.toString(16);N.length%2&&(N="0"+N),N="0x"+N,n.nonceCache[C]=N,y()});return;case"evm_revert":n.nonceCache={},t();return;default:t();return}}});var G3=E((vLe,RD)=>{var qde=Lh().default,Lde=w3(),{createAsyncMiddleware:OD}=_3(),Bde=C3(),{unsafeRandomBytes:Dde,incrementHexInt:jde}=Xf(),Fde=Um();RD.exports=Ude;function Ude({blockTracker:e,provider:t}){let r={},n=Bde({blockTracker:e,provider:t}),i=!1,o=new qde,a=Lde({eth_subscribe:OD(c),eth_unsubscribe:OD(v)});return a.destroy=w,{events:o,middleware:a};async function c(M,S){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");let R=M.params[0],C=Dde(16),B;switch(R){case"newHeads":B=N({subId:C});break;case"logs":let H=M.params[1],D=await n.newLogFilter(H);B=q({subId:C,filter:D});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${R}"`)}r[C]=B,S.result=C;return;function N({subId:H}){let D={type:R,destroy:async()=>{e.removeListener("sync",D.update)},update:async({oldBlock:ee,newBlock:ge})=>{let K=ge,X=jde(ee);(await Fde({provider:t,fromBlock:X,toBlock:K})).map(Hde).forEach(m=>{y(H,m)})}};return e.on("sync",D.update),D}function q({subId:H,filter:D}){return D.on("update",ge=>y(H,ge)),{type:R,destroy:async()=>await n.uninstallFilter(D.idHex)}}}async function v(M,S){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");let R=M.params[0],C=r[R];if(!C){S.result=!1;return}delete r[R],await C.destroy(),S.result=!0}function y(M,S){o.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:M,result:S}})}function w(){o.removeAllListeners();for(let M in r)r[M].destroy(),delete r[M];i=!0}}function Hde(e){return{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}});var CD=E((mLe,ID)=>{var Wde=_m(),zde=G3(),Z3=class extends Wde{constructor(){super(({blockTracker:t,provider:r,engine:n})=>{let{events:i,middleware:o}=zde({blockTracker:t,provider:r});return i.on("notification",a=>n.emit("data",null,a)),o})}};ID.exports=Z3});var PD=E(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});og.walletLogo=void 0;var Qde=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};og.walletLogo=Qde});var ND=E(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.ScopedLocalStorage=void 0;var J3=class{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){let t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){let i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}};sg.ScopedLocalStorage=J3});var ug=E(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.EthereumProviderError=lc.EthereumRpcError=void 0;var Xde=h3(),ag=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Xde.default(this.serialize(),tpe,2)}};lc.EthereumRpcError=ag;var Q3=class extends ag{constructor(t,r,n){if(!epe(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};lc.EthereumProviderError=Q3;function epe(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function tpe(e,t){if(t!=="[Circular]")return t}});var fg=E(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.errorValues=hc.errorCodes=void 0;hc.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};hc.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}});var t4=E(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.serializeError=zi.isValidCode=zi.getMessageFromCode=zi.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var cg=fg(),rpe=ug(),qD=cg.errorCodes.rpc.internal,npe="Unspecified error message. This is a bug, please report it.",ipe={code:qD,message:e4(qD)};zi.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function e4(e,t=npe){if(Number.isInteger(e)){let r=e.toString();if(X3(cg.errorValues,r))return cg.errorValues[r].message;if(DD(e))return zi.JSON_RPC_SERVER_ERROR_MESSAGE}return t}zi.getMessageFromCode=e4;function BD(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(cg.errorValues[t]||DD(e))}zi.isValidCode=BD;function ope(e,{fallbackError:t=ipe,shouldIncludeStack:r=!1}={}){var n,i;if(!t||!Number.isInteger(t.code)||typeof t.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof rpe.EthereumRpcError)return e.serialize();let o={};if(e&&typeof e=="object"&&!Array.isArray(e)&&X3(e,"code")&&BD(e.code)){let c=e;o.code=c.code,c.message&&typeof c.message=="string"?(o.message=c.message,X3(c,"data")&&(o.data=c.data)):(o.message=e4(o.code),o.data={originalError:LD(e)})}else{o.code=t.code;let c=(n=e)===null||n===void 0?void 0:n.message;o.message=c&&typeof c=="string"?c:t.message,o.data={originalError:LD(e)}}let a=(i=e)===null||i===void 0?void 0:i.stack;return r&&e&&a&&typeof a=="string"&&(o.stack=a),o}zi.serializeError=ope;function DD(e){return e>=-32099&&e<=-32e3}function LD(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.assign({},e):e}function X3(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var UD=E(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.ethErrors=void 0;var r4=ug(),jD=t4(),_n=fg();lg.ethErrors={rpc:{parse:e=>Ei(_n.errorCodes.rpc.parse,e),invalidRequest:e=>Ei(_n.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ei(_n.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ei(_n.errorCodes.rpc.methodNotFound,e),internal:e=>Ei(_n.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ei(t,e)},invalidInput:e=>Ei(_n.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ei(_n.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ei(_n.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ei(_n.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ei(_n.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ei(_n.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Hh(_n.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Hh(_n.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Hh(_n.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Hh(_n.errorCodes.provider.disconnected,e),chainDisconnected:e=>Hh(_n.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new r4.EthereumProviderError(t,r,n)}}};function Ei(e,t){let[r,n]=FD(t);return new r4.EthereumRpcError(e,r||jD.getMessageFromCode(e),n)}function Hh(e,t){let[r,n]=FD(t);return new r4.EthereumProviderError(e,r||jD.getMessageFromCode(e),n)}function FD(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}});var hg=E(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.getMessageFromCode=Zn.serializeError=Zn.EthereumProviderError=Zn.EthereumRpcError=Zn.ethErrors=Zn.errorCodes=void 0;var HD=ug();Object.defineProperty(Zn,"EthereumRpcError",{enumerable:!0,get:function(){return HD.EthereumRpcError}});Object.defineProperty(Zn,"EthereumProviderError",{enumerable:!0,get:function(){return HD.EthereumProviderError}});var WD=t4();Object.defineProperty(Zn,"serializeError",{enumerable:!0,get:function(){return WD.serializeError}});Object.defineProperty(Zn,"getMessageFromCode",{enumerable:!0,get:function(){return WD.getMessageFromCode}});var spe=UD();Object.defineProperty(Zn,"ethErrors",{enumerable:!0,get:function(){return spe.ethErrors}});var ape=fg();Object.defineProperty(Zn,"errorCodes",{enumerable:!0,get:function(){return ape.errorCodes}})});var pg=E(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});dg.EVENTS=void 0;dg.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}});var dc=E(n4=>{"use strict";Object.defineProperty(n4,"__esModule",{value:!0});function upe(e){return typeof e=="function"}n4.isFunction=upe});var Wh=E(o4=>{"use strict";Object.defineProperty(o4,"__esModule",{value:!0});var i4=!1;o4.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){var t=new Error;console.warn(`DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at:
553
+ `+t.stack)}else i4&&console.log("RxJS: Back to a better error behavior. Thank you. <3");i4=e},get useDeprecatedSynchronousErrorHandling(){return i4}}});var vg=E(s4=>{"use strict";Object.defineProperty(s4,"__esModule",{value:!0});function fpe(e){setTimeout(function(){throw e},0)}s4.hostReportError=fpe});var u4=E(a4=>{"use strict";Object.defineProperty(a4,"__esModule",{value:!0});var cpe=Wh(),lpe=vg();a4.empty={closed:!0,next:function(e){},error:function(e){if(cpe.config.useDeprecatedSynchronousErrorHandling)throw e;lpe.hostReportError(e)},complete:function(){}}});var Pn=E(f4=>{"use strict";Object.defineProperty(f4,"__esModule",{value:!0});f4.isArray=function(){return Array.isArray||function(e){return e&&typeof e.length=="number"}}()});var mg=E(c4=>{"use strict";Object.defineProperty(c4,"__esModule",{value:!0});function hpe(e){return e!==null&&typeof e=="object"}c4.isObject=hpe});var h4=E(l4=>{"use strict";Object.defineProperty(l4,"__esModule",{value:!0});var dpe=function(){function e(t){return Error.call(this),this.message=t?t.length+` errors occurred during unsubscription:
554
+ `+t.map(function(r,n){return n+1+") "+r.toString()}).join(`
555
+ `):"",this.name="UnsubscriptionError",this.errors=t,this}return e.prototype=Object.create(Error.prototype),e}();l4.UnsubscriptionError=dpe});var Fr=E(d4=>{"use strict";Object.defineProperty(d4,"__esModule",{value:!0});var ppe=Pn(),vpe=mg(),mpe=dc(),gg=h4(),gpe=function(){function e(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,o=r._unsubscribe,a=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(n!==null)for(var c=0;c<n.length;++c){var v=n[c];v.remove(this)}if(mpe.isFunction(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(M){t=M instanceof gg.UnsubscriptionError?zD(M.errors):[M]}}if(ppe.isArray(a))for(var c=-1,y=a.length;++c<y;){var w=a[c];if(vpe.isObject(w))try{w.unsubscribe()}catch(S){t=t||[],S instanceof gg.UnsubscriptionError?t=t.concat(zD(S.errors)):t.push(S)}}if(t)throw new gg.UnsubscriptionError(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||typeof r.unsubscribe!="function")return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;r=new e,r._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(i===null)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return r;var o=this._subscriptions;return o===null?this._subscriptions=[r]:o.push(r),r},e.prototype.remove=function(t){var r=this._subscriptions;if(r){var n=r.indexOf(t);n!==-1&&r.splice(n,1)}},e.EMPTY=function(t){return t.closed=!0,t}(new e),e}();d4.Subscription=gpe;function zD(e){return e.reduce(function(t,r){return t.concat(r instanceof gg.UnsubscriptionError?r.errors:r)},[])}});var bg=E(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.rxSubscriber=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}();zh.$$rxSubscriber=zh.rxSubscriber});var Ze=E(vc=>{"use strict";var $D=vc&&vc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(vc,"__esModule",{value:!0});var VD=dc(),p4=u4(),bpe=Fr(),ype=bg(),pc=Wh(),yg=vg(),KD=function(e){$D(t,e);function t(r,n,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=p4.empty;break;case 1:if(!r){o.destination=p4.empty;break}if(typeof r=="object"){r instanceof t?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new v4(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new v4(o,r,n,i);break}return o}return t.prototype[ype.rxSubscriber]=function(){return this},t.create=function(r,n,i){var o=new t(r,n,i);return o.syncErrorThrowable=!1,o},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){this.destination.error(r),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=r,this},t}(bpe.Subscription);vc.Subscriber=KD;var v4=function(e){$D(t,e);function t(r,n,i,o){var a=e.call(this)||this;a._parentSubscriber=r;var c,v=a;return VD.isFunction(n)?c=n:n&&(c=n.next,i=n.error,o=n.complete,n!==p4.empty&&(v=Object.create(n),VD.isFunction(v.unsubscribe)&&a.add(v.unsubscribe.bind(v)),v.unsubscribe=a.unsubscribe.bind(a))),a._context=v,a._next=c,a._error=i,a._complete=o,a}return t.prototype.next=function(r){if(!this.isStopped&&this._next){var n=this._parentSubscriber;!pc.config.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?this.__tryOrUnsub(this._next,r):this.__tryOrSetError(n,this._next,r)&&this.unsubscribe()}},t.prototype.error=function(r){if(!this.isStopped){var n=this._parentSubscriber,i=pc.config.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!n.syncErrorThrowable?(this.__tryOrUnsub(this._error,r),this.unsubscribe()):(this.__tryOrSetError(n,this._error,r),this.unsubscribe());else if(n.syncErrorThrowable)i?(n.syncErrorValue=r,n.syncErrorThrown=!0):yg.hostReportError(r),this.unsubscribe();else{if(this.unsubscribe(),i)throw r;yg.hostReportError(r)}}},t.prototype.complete=function(){var r=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var i=function(){return r._complete.call(r._context)};!pc.config.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(n,i),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(r,n){try{r.call(this._context,n)}catch(i){if(this.unsubscribe(),pc.config.useDeprecatedSynchronousErrorHandling)throw i;yg.hostReportError(i)}},t.prototype.__tryOrSetError=function(r,n,i){if(!pc.config.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,i)}catch(o){return pc.config.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=o,r.syncErrorThrown=!0,!0):(yg.hostReportError(o),!0)}return!1},t.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},t}(KD);vc.SafeSubscriber=v4});var _g=E(m4=>{"use strict";Object.defineProperty(m4,"__esModule",{value:!0});var _pe=Ze();function wpe(e){for(;e;){var t=e,r=t.closed,n=t.destination,i=t.isStopped;if(r||i)return!1;n&&n instanceof _pe.Subscriber?e=n:e=null}return!0}m4.canReportError=wpe});var ZD=E(b4=>{"use strict";Object.defineProperty(b4,"__esModule",{value:!0});var g4=Ze(),GD=bg(),xpe=u4();function Mpe(e,t,r){if(e){if(e instanceof g4.Subscriber)return e;if(e[GD.rxSubscriber])return e[GD.rxSubscriber]()}return!e&&!t&&!r?new g4.Subscriber(xpe.empty):new g4.Subscriber(e,t,r)}b4.toSubscriber=Mpe});var pu=E(y4=>{"use strict";Object.defineProperty(y4,"__esModule",{value:!0});y4.observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}()});var Vs=E(_4=>{"use strict";Object.defineProperty(_4,"__esModule",{value:!0});function Spe(e){return e}_4.identity=Spe});var xg=E(wg=>{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});var Epe=Vs();function Ape(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return YD(e)}wg.pipe=Ape;function YD(e){return e.length===0?Epe.identity:e.length===1?e[0]:function(r){return e.reduce(function(n,i){return i(n)},r)}}wg.pipeFromArray=YD});var Ct=E(w4=>{"use strict";Object.defineProperty(w4,"__esModule",{value:!0});var Ope=_g(),Rpe=ZD(),Ipe=pu(),Cpe=xg(),Mg=Wh(),Tpe=function(){function e(t){this._isScalar=!1,t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this.operator,o=Rpe.toSubscriber(t,r,n);if(i?o.add(i.call(o,this.source)):o.add(this.source||Mg.config.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),Mg.config.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){Mg.config.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=r),Ope.canReportError(t)?t.error(r):console.warn(r)}},e.prototype.forEach=function(t,r){var n=this;return r=JD(r),new r(function(i,o){var a;a=n.subscribe(function(c){try{t(c)}catch(v){o(v),a&&a.unsubscribe()}},o,i)})},e.prototype._subscribe=function(t){var r=this.source;return r&&r.subscribe(t)},e.prototype[Ipe.observable]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length===0?this:Cpe.pipeFromArray(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=JD(t),new t(function(n,i){var o;r.subscribe(function(a){return o=a},function(a){return i(a)},function(){return n(o)})})},e.create=function(t){return new e(t)},e}();w4.Observable=Tpe;function JD(e){if(e||(e=Mg.config.Promise||Promise),!e)throw new Error("no Promise impl found");return e}});var Vh=E(x4=>{"use strict";Object.defineProperty(x4,"__esModule",{value:!0});var kpe=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}();x4.ObjectUnsubscribedError=kpe});var M4=E($h=>{"use strict";var Ppe=$h&&$h.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($h,"__esModule",{value:!0});var Npe=Fr(),qpe=function(e){Ppe(t,e);function t(r,n){var i=e.call(this)||this;return i.subject=r,i.subscriber=n,i.closed=!1,i}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var r=this.subject,n=r.observers;if(this.subject=null,!(!n||n.length===0||r.isStopped||r.closed)){var i=n.indexOf(this.subscriber);i!==-1&&n.splice(i,1)}}},t}(Npe.Subscription);$h.SubjectSubscription=qpe});var wn=E(vu=>{"use strict";var A4=vu&&vu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(vu,"__esModule",{value:!0});var QD=Ct(),Lpe=Ze(),S4=Fr(),Kh=Vh(),Bpe=M4(),Dpe=bg(),XD=function(e){A4(t,e);function t(r){var n=e.call(this,r)||this;return n.destination=r,n}return t}(Lpe.Subscriber);vu.SubjectSubscriber=XD;var ej=function(e){A4(t,e);function t(){var r=e.call(this)||this;return r.observers=[],r.closed=!1,r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype[Dpe.rxSubscriber]=function(){return new XD(this)},t.prototype.lift=function(r){var n=new E4(this,this);return n.operator=r,n},t.prototype.next=function(r){if(this.closed)throw new Kh.ObjectUnsubscribedError;if(!this.isStopped)for(var n=this.observers,i=n.length,o=n.slice(),a=0;a<i;a++)o[a].next(r)},t.prototype.error=function(r){if(this.closed)throw new Kh.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=r,this.isStopped=!0;for(var n=this.observers,i=n.length,o=n.slice(),a=0;a<i;a++)o[a].error(r);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new Kh.ObjectUnsubscribedError;this.isStopped=!0;for(var r=this.observers,n=r.length,i=r.slice(),o=0;o<n;o++)i[o].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(r){if(this.closed)throw new Kh.ObjectUnsubscribedError;return e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){if(this.closed)throw new Kh.ObjectUnsubscribedError;return this.hasError?(r.error(this.thrownError),S4.Subscription.EMPTY):this.isStopped?(r.complete(),S4.Subscription.EMPTY):(this.observers.push(r),new Bpe.SubjectSubscription(this,r))},t.prototype.asObservable=function(){var r=new QD.Observable;return r.source=this,r},t.create=function(r,n){return new E4(r,n)},t}(QD.Observable);vu.Subject=ej;var E4=function(e){A4(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n=this.destination;n&&n.next&&n.next(r)},t.prototype.error=function(r){var n=this.destination;n&&n.error&&this.destination.error(r)},t.prototype.complete=function(){var r=this.destination;r&&r.complete&&this.destination.complete()},t.prototype._subscribe=function(r){var n=this.source;return n?this.source.subscribe(r):S4.Subscription.EMPTY},t}(ej);vu.AnonymousSubject=E4});var Sg=E(Gh=>{"use strict";var jpe=Gh&&Gh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Gh,"__esModule",{value:!0});var Fpe=Ze();function Upe(){return function(t){return t.lift(new Hpe(t))}}Gh.refCount=Upe;var Hpe=function(){function e(t){this.connectable=t}return e.prototype.call=function(t,r){var n=this.connectable;n._refCount++;var i=new Wpe(t,n),o=r.subscribe(i);return i.closed||(i.connection=n.connect()),o},e}(),Wpe=function(e){jpe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.connectable=n,i}return t.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,o=r._connection;this.connection=null,o&&(!i||o===i)&&o.unsubscribe()},t}(Fpe.Subscriber)});var R4=E(mc=>{"use strict";var O4=mc&&mc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(mc,"__esModule",{value:!0});var zpe=wn(),Vpe=Ct(),$pe=Ze(),tj=Fr(),Kpe=Sg(),rj=function(e){O4(t,e);function t(r,n){var i=e.call(this)||this;return i.source=r,i.subjectFactory=n,i._refCount=0,i._isComplete=!1,i}return t.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},t.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var r=this._connection;return r||(this._isComplete=!1,r=this._connection=new tj.Subscription,r.add(this.source.subscribe(new Gpe(this.getSubject(),this))),r.closed&&(this._connection=null,r=tj.Subscription.EMPTY)),r},t.prototype.refCount=function(){return Kpe.refCount()(this)},t}(Vpe.Observable);mc.ConnectableObservable=rj;mc.connectableObservableDescriptor=function(){var e=rj.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}();var Gpe=function(e){O4(t,e);function t(r,n){var i=e.call(this,r)||this;return i.connectable=n,i}return t.prototype._error=function(r){this._unsubscribe(),e.prototype._error.call(this,r)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var r=this.connectable;if(r){this.connectable=null;var n=r._connection;r._refCount=0,r._subject=null,r._connection=null,n&&n.unsubscribe()}},t}(zpe.SubjectSubscriber),ZLe=function(){function e(t){this.connectable=t}return e.prototype.call=function(t,r){var n=this.connectable;n._refCount++;var i=new Zpe(t,n),o=r.subscribe(i);return i.closed||(i.connection=n.connect()),o},e}(),Zpe=function(e){O4(t,e);function t(r,n){var i=e.call(this,r)||this;return i.connectable=n,i}return t.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,o=r._connection;this.connection=null,o&&(!i||o===i)&&o.unsubscribe()},t}($pe.Subscriber)});var C4=E(gc=>{"use strict";var Eg=gc&&gc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(gc,"__esModule",{value:!0});var nj=Ze(),ij=Fr(),Ype=Ct(),Jpe=wn();function Qpe(e,t,r,n){return function(i){return i.lift(new Xpe(e,t,r,n))}}gc.groupBy=Qpe;var Xpe=function(){function e(t,r,n,i){this.keySelector=t,this.elementSelector=r,this.durationSelector=n,this.subjectSelector=i}return e.prototype.call=function(t,r){return r.subscribe(new eve(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),eve=function(e){Eg(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;return c.keySelector=n,c.elementSelector=i,c.durationSelector=o,c.subjectSelector=a,c.groups=null,c.attemptedToUnsubscribe=!1,c.count=0,c}return t.prototype._next=function(r){var n;try{n=this.keySelector(r)}catch(i){this.error(i);return}this._group(r,n)},t.prototype._group=function(r,n){var i=this.groups;i||(i=this.groups=new Map);var o=i.get(n),a;if(this.elementSelector)try{a=this.elementSelector(r)}catch(y){this.error(y)}else a=r;if(!o){o=this.subjectSelector?this.subjectSelector():new Jpe.Subject,i.set(n,o);var c=new I4(n,o,this);if(this.destination.next(c),this.durationSelector){var v=void 0;try{v=this.durationSelector(new I4(n,o))}catch(y){this.error(y);return}this.add(v.subscribe(new tve(n,o,this)))}}o.closed||o.next(a)},t.prototype._error=function(r){var n=this.groups;n&&(n.forEach(function(i,o){i.error(r)}),n.clear()),this.destination.error(r)},t.prototype._complete=function(){var r=this.groups;r&&(r.forEach(function(n,i){n.complete()}),r.clear()),this.destination.complete()},t.prototype.removeGroup=function(r){this.groups.delete(r)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&e.prototype.unsubscribe.call(this))},t}(nj.Subscriber),tve=function(e){Eg(t,e);function t(r,n,i){var o=e.call(this,n)||this;return o.key=r,o.group=n,o.parent=i,o}return t.prototype._next=function(r){this.complete()},t.prototype._unsubscribe=function(){var r=this,n=r.parent,i=r.key;this.key=this.parent=null,n&&n.removeGroup(i)},t}(nj.Subscriber),I4=function(e){Eg(t,e);function t(r,n,i){var o=e.call(this)||this;return o.key=r,o.groupSubject=n,o.refCountSubscription=i,o}return t.prototype._subscribe=function(r){var n=new ij.Subscription,i=this,o=i.refCountSubscription,a=i.groupSubject;return o&&!o.closed&&n.add(new rve(o)),n.add(a.subscribe(r)),n},t}(Ype.Observable);gc.GroupedObservable=I4;var rve=function(e){Eg(t,e);function t(r){var n=e.call(this)||this;return n.parent=r,r.count++,n}return t.prototype.unsubscribe=function(){var r=this.parent;!r.closed&&!this.closed&&(e.prototype.unsubscribe.call(this),r.count-=1,r.count===0&&r.attemptedToUnsubscribe&&r.unsubscribe())},t}(ij.Subscription)});var T4=E(Zh=>{"use strict";var nve=Zh&&Zh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Zh,"__esModule",{value:!0});var ive=wn(),ove=Vh(),sve=function(e){nve(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return n&&!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new ove.ObjectUnsubscribedError;return this._value},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(ive.Subject);Zh.BehaviorSubject=sve});var oj=E(Yh=>{"use strict";var ave=Yh&&Yh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Yh,"__esModule",{value:!0});var uve=Fr(),fve=function(e){ave(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t}(uve.Subscription);Yh.Action=fve});var bc=E(Jh=>{"use strict";var cve=Jh&&Jh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Jh,"__esModule",{value:!0});var lve=oj(),hve=function(e){cve(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(o,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return n;clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o=void 0;try{this.work(r)}catch(a){i=!0,o=!!a&&a||new Error(a)}if(i)return this.unsubscribe(),o},t.prototype._unsubscribe=function(){var r=this.id,n=this.scheduler,i=n.actions,o=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,o!==-1&&i.splice(o,1),r!=null&&(this.id=this.recycleAsyncId(n,r,null)),this.delay=null},t}(lve.Action);Jh.AsyncAction=hve});var sj=E(Qh=>{"use strict";var dve=Qh&&Qh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Qh,"__esModule",{value:!0});var pve=bc(),vve=function(e){dve(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return t.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?e.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,n){return n>0||this.closed?e.prototype.execute.call(this,r,n):this._execute(r,n)},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},t}(pve.AsyncAction);Qh.QueueAction=vve});var P4=E(k4=>{"use strict";Object.defineProperty(k4,"__esModule",{value:!0});var mve=function(){function e(t,r){r===void 0&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.SchedulerAction(this,t).schedule(n,r)},e.now=function(){return Date.now()},e}();k4.Scheduler=mve});var yc=E(Xh=>{"use strict";var gve=Xh&&Xh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Xh,"__esModule",{value:!0});var aj=P4(),bve=function(e){gve(t,e);function t(r,n){n===void 0&&(n=aj.Scheduler.now);var i=e.call(this,r,function(){return t.delegate&&t.delegate!==i?t.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return t.prototype.schedule=function(r,n,i){return n===void 0&&(n=0),t.delegate&&t.delegate!==this?t.delegate.schedule(r,n,i):e.prototype.schedule.call(this,r,n,i)},t.prototype.flush=function(r){var n=this.actions;if(this.active){n.push(r);return}var i;this.active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this.active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t}(aj.Scheduler);Xh.AsyncScheduler=bve});var uj=E(e0=>{"use strict";var yve=e0&&e0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e0,"__esModule",{value:!0});var _ve=yc(),wve=function(e){yve(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(_ve.AsyncScheduler);e0.QueueScheduler=wve});var N4=E(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var xve=sj(),Mve=uj();t0.queueScheduler=new Mve.QueueScheduler(xve.QueueAction);t0.queue=t0.queueScheduler});var Vi=E(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var fj=Ct();r0.EMPTY=new fj.Observable(function(e){return e.complete()});function Sve(e){return e?Eve(e):r0.EMPTY}r0.empty=Sve;function Eve(e){return new fj.Observable(function(t){return e.schedule(function(){return t.complete()})})}});var $i=E(q4=>{"use strict";Object.defineProperty(q4,"__esModule",{value:!0});function Ave(e){return e&&typeof e.schedule=="function"}q4.isScheduler=Ave});var B4=E(L4=>{"use strict";Object.defineProperty(L4,"__esModule",{value:!0});L4.subscribeToArray=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}}});var Ag=E(D4=>{"use strict";Object.defineProperty(D4,"__esModule",{value:!0});var Ove=Ct(),Rve=Fr();function Ive(e,t){return new Ove.Observable(function(r){var n=new Rve.Subscription,i=0;return n.add(t.schedule(function(){if(i===e.length){r.complete();return}r.next(e[i++]),r.closed||n.add(this.schedule())})),n})}D4.scheduleArray=Ive});var _c=E(j4=>{"use strict";Object.defineProperty(j4,"__esModule",{value:!0});var Cve=Ct(),Tve=B4(),kve=Ag();function Pve(e,t){return t?kve.scheduleArray(e,t):new Cve.Observable(Tve.subscribeToArray(e))}j4.fromArray=Pve});var n0=E(F4=>{"use strict";Object.defineProperty(F4,"__esModule",{value:!0});var Nve=$i(),qve=_c(),Lve=Ag();function Bve(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return Nve.isScheduler(r)?(e.pop(),Lve.scheduleArray(e,r)):qve.fromArray(e)}F4.of=Bve});var Og=E(U4=>{"use strict";Object.defineProperty(U4,"__esModule",{value:!0});var cj=Ct();function Dve(e,t){return t?new cj.Observable(function(r){return t.schedule(jve,0,{error:e,subscriber:r})}):new cj.Observable(function(r){return r.error(e)})}U4.throwError=Dve;function jve(e){var t=e.error,r=e.subscriber;r.error(t)}});var o0=E(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var Fve=Vi(),Uve=n0(),Hve=Og(),Wve;(function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"})(Wve=i0.NotificationKind||(i0.NotificationKind={}));var zve=function(){function e(t,r,n){this.kind=t,this.value=r,this.error=n,this.hasValue=t==="N"}return e.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},e.prototype.do=function(t,r,n){var i=this.kind;switch(i){case"N":return t&&t(this.value);case"E":return r&&r(this.error);case"C":return n&&n()}},e.prototype.accept=function(t,r,n){return t&&typeof t.next=="function"?this.observe(t):this.do(t,r,n)},e.prototype.toObservable=function(){var t=this.kind;switch(t){case"N":return Uve.of(this.value);case"E":return Hve.throwError(this.error);case"C":return Fve.empty()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return typeof t<"u"?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();i0.Notification=zve});var W4=E($s=>{"use strict";var Vve=$s&&$s.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($s,"__esModule",{value:!0});var $ve=Ze(),H4=o0();function Kve(e,t){return t===void 0&&(t=0),function(n){return n.lift(new lj(e,t))}}$s.observeOn=Kve;var lj=function(){function e(t,r){r===void 0&&(r=0),this.scheduler=t,this.delay=r}return e.prototype.call=function(t,r){return r.subscribe(new hj(t,this.scheduler,this.delay))},e}();$s.ObserveOnOperator=lj;var hj=function(e){Vve(t,e);function t(r,n,i){i===void 0&&(i=0);var o=e.call(this,r)||this;return o.scheduler=n,o.delay=i,o}return t.dispatch=function(r){var n=r.notification,i=r.destination;n.observe(i),this.unsubscribe()},t.prototype.scheduleMessage=function(r){var n=this.destination;n.add(this.scheduler.schedule(t.dispatch,this.delay,new dj(r,this.destination)))},t.prototype._next=function(r){this.scheduleMessage(H4.Notification.createNext(r))},t.prototype._error=function(r){this.scheduleMessage(H4.Notification.createError(r)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(H4.Notification.createComplete()),this.unsubscribe()},t}($ve.Subscriber);$s.ObserveOnSubscriber=hj;var dj=function(){function e(t,r){this.notification=t,this.destination=r}return e}();$s.ObserveOnMessage=dj});var Rg=E(s0=>{"use strict";var Gve=s0&&s0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(s0,"__esModule",{value:!0});var Zve=wn(),Yve=N4(),Jve=Fr(),Qve=W4(),Xve=Vh(),e1e=M4(),t1e=function(e){Gve(t,e);function t(r,n,i){r===void 0&&(r=Number.POSITIVE_INFINITY),n===void 0&&(n=Number.POSITIVE_INFINITY);var o=e.call(this)||this;return o.scheduler=i,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=r<1?1:r,o._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return t.prototype.nextInfiniteTimeWindow=function(r){if(!this.isStopped){var n=this._events;n.push(r),n.length>this._bufferSize&&n.shift()}e.prototype.next.call(this,r)},t.prototype.nextTimeWindow=function(r){this.isStopped||(this._events.push(new r1e(this._getNow(),r)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){var n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,a=i.length,c;if(this.closed)throw new Xve.ObjectUnsubscribedError;if(this.isStopped||this.hasError?c=Jve.Subscription.EMPTY:(this.observers.push(r),c=new e1e.SubjectSubscription(this,r)),o&&r.add(r=new Qve.ObserveOnSubscriber(r,o)),n)for(var v=0;v<a&&!r.closed;v++)r.next(i[v]);else for(var v=0;v<a&&!r.closed;v++)r.next(i[v].value);return this.hasError?r.error(this.thrownError):this.isStopped&&r.complete(),c},t.prototype._getNow=function(){return(this.scheduler||Yve.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var r=this._getNow(),n=this._bufferSize,i=this._windowTime,o=this._events,a=o.length,c=0;c<a&&!(r-o[c].time<i);)c++;return a>n&&(c=Math.max(c,a-n)),c>0&&o.splice(0,c),o},t}(Zve.Subject);s0.ReplaySubject=t1e;var r1e=function(){function e(t,r){this.time=t,this.value=r}return e}()});var u0=E(a0=>{"use strict";var n1e=a0&&a0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(a0,"__esModule",{value:!0});var i1e=wn(),pj=Fr(),o1e=function(e){n1e(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.value=null,r.hasNext=!1,r.hasCompleted=!1,r}return t.prototype._subscribe=function(r){return this.hasError?(r.error(this.thrownError),pj.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),pj.Subscription.EMPTY):e.prototype._subscribe.call(this,r)},t.prototype.next=function(r){this.hasCompleted||(this.value=r,this.hasNext=!0)},t.prototype.error=function(r){this.hasCompleted||e.prototype.error.call(this,r)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(i1e.Subject);a0.AsyncSubject=o1e});var mj=E(Cg=>{"use strict";Object.defineProperty(Cg,"__esModule",{value:!0});var s1e=1,a1e=function(){return Promise.resolve()}(),Ig={};function vj(e){return e in Ig?(delete Ig[e],!0):!1}Cg.Immediate={setImmediate:function(e){var t=s1e++;return Ig[t]=!0,a1e.then(function(){return vj(t)&&e()}),t},clearImmediate:function(e){vj(e)}};Cg.TestTools={pending:function(){return Object.keys(Ig).length}}});var bj=E(f0=>{"use strict";var u1e=f0&&f0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(f0,"__esModule",{value:!0});var gj=mj(),f1e=bc(),c1e=function(e){u1e(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=gj.Immediate.setImmediate(r.flush.bind(r,null))))},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(gj.Immediate.clearImmediate(n),r.scheduled=void 0)},t}(f1e.AsyncAction);f0.AsapAction=c1e});var yj=E(c0=>{"use strict";var l1e=c0&&c0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(c0,"__esModule",{value:!0});var h1e=yc(),d1e=function(e){l1e(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,o=-1,a=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++o<a&&(r=n.shift()));if(this.active=!1,i){for(;++o<a&&(r=n.shift());)r.unsubscribe();throw i}},t}(h1e.AsyncScheduler);c0.AsapScheduler=d1e});var z4=E(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});var p1e=bj(),v1e=yj();l0.asapScheduler=new v1e.AsapScheduler(p1e.AsapAction);l0.asap=l0.asapScheduler});var Nn=E(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var m1e=bc(),g1e=yc();h0.asyncScheduler=new g1e.AsyncScheduler(m1e.AsyncAction);h0.async=h0.asyncScheduler});var _j=E(d0=>{"use strict";var b1e=d0&&d0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(d0,"__esModule",{value:!0});var y1e=bc(),_1e=function(e){b1e(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=requestAnimationFrame(function(){return r.flush(null)})))},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(cancelAnimationFrame(n),r.scheduled=void 0)},t}(y1e.AsyncAction);d0.AnimationFrameAction=_1e});var wj=E(p0=>{"use strict";var w1e=p0&&p0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(p0,"__esModule",{value:!0});var x1e=yc(),M1e=function(e){w1e(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,o=-1,a=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++o<a&&(r=n.shift()));if(this.active=!1,i){for(;++o<a&&(r=n.shift());)r.unsubscribe();throw i}},t}(x1e.AsyncScheduler);p0.AnimationFrameScheduler=M1e});var xj=E(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var S1e=_j(),E1e=wj();v0.animationFrameScheduler=new E1e.AnimationFrameScheduler(S1e.AnimationFrameAction);v0.animationFrame=v0.animationFrameScheduler});var Ej=E(wc=>{"use strict";var Mj=wc&&wc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(wc,"__esModule",{value:!0});var A1e=bc(),O1e=yc(),R1e=function(e){Mj(t,e);function t(r,n){r===void 0&&(r=Sj),n===void 0&&(n=Number.POSITIVE_INFINITY);var i=e.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return t.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,o,a;(a=n[0])&&a.delay<=i&&(n.shift(),this.frame=a.delay,!(o=a.execute(a.state,a.delay))););if(o){for(;a=n.shift();)a.unsubscribe();throw o}},t.frameTimeFactor=10,t}(O1e.AsyncScheduler);wc.VirtualTimeScheduler=R1e;var Sj=function(e){Mj(t,e);function t(r,n,i){i===void 0&&(i=r.index+=1);var o=e.call(this,r,n)||this;return o.scheduler=r,o.work=n,o.index=i,o.active=!0,o.index=r.index=i,o}return t.prototype.schedule=function(r,n){if(n===void 0&&(n=0),!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},t.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var o=r.actions;return o.push(this),o.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(r,n,i){i===void 0&&(i=0)},t.prototype._execute=function(r,n){if(this.active===!0)return e.prototype._execute.call(this,r,n)},t.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},t}(A1e.AsyncAction);wc.VirtualAction=Sj});var Tg=E(V4=>{"use strict";Object.defineProperty(V4,"__esModule",{value:!0});function I1e(){}V4.noop=I1e});var Aj=E($4=>{"use strict";Object.defineProperty($4,"__esModule",{value:!0});var C1e=Ct();function T1e(e){return!!e&&(e instanceof C1e.Observable||typeof e.lift=="function"&&typeof e.subscribe=="function")}$4.isObservable=T1e});var xc=E(K4=>{"use strict";Object.defineProperty(K4,"__esModule",{value:!0});var k1e=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}();K4.ArgumentOutOfRangeError=k1e});var Mc=E(G4=>{"use strict";Object.defineProperty(G4,"__esModule",{value:!0});var P1e=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}();G4.EmptyError=P1e});var Y4=E(Z4=>{"use strict";Object.defineProperty(Z4,"__esModule",{value:!0});var N1e=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}();Z4.TimeoutError=N1e});var ni=E(Sc=>{"use strict";var q1e=Sc&&Sc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Sc,"__esModule",{value:!0});var L1e=Ze();function B1e(e,t){return function(n){if(typeof e!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Oj(e,t))}}Sc.map=B1e;var Oj=function(){function e(t,r){this.project=t,this.thisArg=r}return e.prototype.call=function(t,r){return r.subscribe(new D1e(t,this.project,this.thisArg))},e}();Sc.MapOperator=Oj;var D1e=function(e){q1e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.project=n,o.count=0,o.thisArg=i||o,o}return t.prototype._next=function(r){var n;try{n=this.project.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(n)},t}(L1e.Subscriber)});var Cj=E(J4=>{"use strict";Object.defineProperty(J4,"__esModule",{value:!0});var j1e=Ct(),Rj=u0(),F1e=ni(),U1e=_g(),H1e=Pn(),W1e=$i();function Ij(e,t,r){if(t)if(W1e.isScheduler(t))r=t;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Ij(e,r).apply(void 0,n).pipe(F1e.map(function(o){return H1e.isArray(o)?t.apply(void 0,o):t(o)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=this,a,c={context:o,subject:a,callbackFunc:e,scheduler:r};return new j1e.Observable(function(v){if(r){var w={args:n,subscriber:v,params:c};return r.schedule(z1e,0,w)}else{if(!a){a=new Rj.AsyncSubject;var y=function(){for(var M=[],S=0;S<arguments.length;S++)M[S]=arguments[S];a.next(M.length<=1?M[0]:M),a.complete()};try{e.apply(o,n.concat([y]))}catch(M){U1e.canReportError(a)?a.error(M):console.warn(M)}}return a.subscribe(v)}})}}J4.bindCallback=Ij;function z1e(e){var t=this,r=this,n=e.args,i=e.subscriber,o=e.params,a=o.callbackFunc,c=o.context,v=o.scheduler,y=o.subject;if(!y){y=o.subject=new Rj.AsyncSubject;var w=function(){for(var M=[],S=0;S<arguments.length;S++)M[S]=arguments[S];var R=M.length<=1?M[0]:M;t.add(v.schedule(V1e,0,{value:R,subject:y}))};try{a.apply(c,n.concat([w]))}catch(M){y.error(M)}}this.add(y.subscribe(i))}function V1e(e){var t=e.value,r=e.subject;r.next(t),r.complete()}});var Nj=E(Q4=>{"use strict";Object.defineProperty(Q4,"__esModule",{value:!0});var $1e=Ct(),kj=u0(),K1e=ni(),G1e=_g(),Z1e=$i(),Y1e=Pn();function Pj(e,t,r){if(t)if(Z1e.isScheduler(t))r=t;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Pj(e,r).apply(void 0,n).pipe(K1e.map(function(o){return Y1e.isArray(o)?t.apply(void 0,o):t(o)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o={subject:void 0,args:n,callbackFunc:e,scheduler:r,context:this};return new $1e.Observable(function(a){var c=o.context,v=o.subject;if(r)return r.schedule(J1e,0,{params:o,subscriber:a,context:c});if(!v){v=o.subject=new kj.AsyncSubject;var y=function(){for(var w=[],M=0;M<arguments.length;M++)w[M]=arguments[M];var S=w.shift();if(S){v.error(S);return}v.next(w.length<=1?w[0]:w),v.complete()};try{e.apply(c,n.concat([y]))}catch(w){G1e.canReportError(v)?v.error(w):console.warn(w)}}return v.subscribe(a)})}}Q4.bindNodeCallback=Pj;function J1e(e){var t=this,r=e.params,n=e.subscriber,i=e.context,o=r.callbackFunc,a=r.args,c=r.scheduler,v=r.subject;if(!v){v=r.subject=new kj.AsyncSubject;var y=function(){for(var w=[],M=0;M<arguments.length;M++)w[M]=arguments[M];var S=w.shift();if(S)t.add(c.schedule(Tj,0,{err:S,subject:v}));else{var R=w.length<=1?w[0]:w;t.add(c.schedule(Q1e,0,{value:R,subject:v}))}};try{o.apply(i,a.concat([y]))}catch(w){this.add(c.schedule(Tj,0,{err:w,subject:v}))}}this.add(v.subscribe(n))}function Q1e(e){var t=e.value,r=e.subject;r.next(t),r.complete()}function Tj(e){var t=e.err,r=e.subject;r.error(t)}});var Ks=E(m0=>{"use strict";var X1e=m0&&m0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(m0,"__esModule",{value:!0});var eme=Ze(),tme=function(e){X1e(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.notifyNext=function(r,n,i,o,a){this.destination.next(n)},t.prototype.notifyError=function(r,n){this.destination.error(r)},t.prototype.notifyComplete=function(r){this.destination.complete()},t}(eme.Subscriber);m0.OuterSubscriber=tme});var qj=E(g0=>{"use strict";var rme=g0&&g0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(g0,"__esModule",{value:!0});var nme=Ze(),ime=function(e){rme(t,e);function t(r,n,i){var o=e.call(this)||this;return o.parent=r,o.outerValue=n,o.outerIndex=i,o.index=0,o}return t.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this.index++,this)},t.prototype._error=function(r){this.parent.notifyError(r,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(nme.Subscriber);g0.InnerSubscriber=ime});var Lj=E(X4=>{"use strict";Object.defineProperty(X4,"__esModule",{value:!0});var ome=vg();X4.subscribeToPromise=function(e){return function(t){return e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,ome.hostReportError),t}}});var Ac=E(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});function Bj(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}Ec.getSymbolIterator=Bj;Ec.iterator=Bj();Ec.$$iterator=Ec.iterator});var Dj=E(e6=>{"use strict";Object.defineProperty(e6,"__esModule",{value:!0});var sme=Ac();e6.subscribeToIterable=function(e){return function(t){var r=e[sme.iterator]();do{var n=void 0;try{n=r.next()}catch(i){return t.error(i),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}while(!0);return typeof r.return=="function"&&t.add(function(){r.return&&r.return()}),t}}});var jj=E(t6=>{"use strict";Object.defineProperty(t6,"__esModule",{value:!0});var ame=pu();t6.subscribeToObservable=function(e){return function(t){var r=e[ame.observable]();if(typeof r.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(t)}}});var n6=E(r6=>{"use strict";Object.defineProperty(r6,"__esModule",{value:!0});r6.isArrayLike=function(e){return e&&typeof e.length=="number"&&typeof e!="function"}});var o6=E(i6=>{"use strict";Object.defineProperty(i6,"__esModule",{value:!0});function ume(e){return!!e&&typeof e.subscribe!="function"&&typeof e.then=="function"}i6.isPromise=ume});var b0=E(s6=>{"use strict";Object.defineProperty(s6,"__esModule",{value:!0});var fme=B4(),cme=Lj(),lme=Dj(),hme=jj(),dme=n6(),pme=o6(),vme=mg(),mme=Ac(),gme=pu();s6.subscribeTo=function(e){if(!!e&&typeof e[gme.observable]=="function")return hme.subscribeToObservable(e);if(dme.isArrayLike(e))return fme.subscribeToArray(e);if(pme.isPromise(e))return cme.subscribeToPromise(e);if(!!e&&typeof e[mme.iterator]=="function")return lme.subscribeToIterable(e);var t=vme.isObject(e)?"an invalid object":"'"+e+"'",r="You provided "+t+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(r)}});var Gs=E(a6=>{"use strict";Object.defineProperty(a6,"__esModule",{value:!0});var bme=qj(),yme=b0(),_me=Ct();function wme(e,t,r,n,i){if(i===void 0&&(i=new bme.InnerSubscriber(e,r,n)),!i.closed)return t instanceof _me.Observable?t.subscribe(i):yme.subscribeTo(t)(i)}a6.subscribeToResult=wme});var kg=E(mu=>{"use strict";var xme=mu&&mu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(mu,"__esModule",{value:!0});var Mme=$i(),Sme=Pn(),Eme=Ks(),Ame=Gs(),Ome=_c(),Fj={};function Rme(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0,n=void 0;return Mme.isScheduler(e[e.length-1])&&(n=e.pop()),typeof e[e.length-1]=="function"&&(r=e.pop()),e.length===1&&Sme.isArray(e[0])&&(e=e[0]),Ome.fromArray(e,n).lift(new Uj(r))}mu.combineLatest=Rme;var Uj=function(){function e(t){this.resultSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new Hj(t,this.resultSelector))},e}();mu.CombineLatestOperator=Uj;var Hj=function(e){xme(t,e);function t(r,n){var i=e.call(this,r)||this;return i.resultSelector=n,i.active=0,i.values=[],i.observables=[],i}return t.prototype._next=function(r){this.values.push(Fj),this.observables.push(r)},t.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{this.active=n,this.toRespond=n;for(var i=0;i<n;i++){var o=r[i];this.add(Ame.subscribeToResult(this,o,void 0,i))}}},t.prototype.notifyComplete=function(r){(this.active-=1)===0&&this.destination.complete()},t.prototype.notifyNext=function(r,n,i){var o=this.values,a=o[i],c=this.toRespond?a===Fj?--this.toRespond:this.toRespond:0;o[i]=n,c===0&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))},t.prototype._tryResultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},t}(Eme.OuterSubscriber);mu.CombineLatestSubscriber=Hj});var Wj=E(u6=>{"use strict";Object.defineProperty(u6,"__esModule",{value:!0});var Ime=Ct(),Cme=Fr(),Tme=pu();function kme(e,t){return new Ime.Observable(function(r){var n=new Cme.Subscription;return n.add(t.schedule(function(){var i=e[Tme.observable]();n.add(i.subscribe({next:function(o){n.add(t.schedule(function(){return r.next(o)}))},error:function(o){n.add(t.schedule(function(){return r.error(o)}))},complete:function(){n.add(t.schedule(function(){return r.complete()}))}}))})),n})}u6.scheduleObservable=kme});var zj=E(f6=>{"use strict";Object.defineProperty(f6,"__esModule",{value:!0});var Pme=Ct(),Nme=Fr();function qme(e,t){return new Pme.Observable(function(r){var n=new Nme.Subscription;return n.add(t.schedule(function(){return e.then(function(i){n.add(t.schedule(function(){r.next(i),n.add(t.schedule(function(){return r.complete()}))}))},function(i){n.add(t.schedule(function(){return r.error(i)}))})})),n})}f6.schedulePromise=qme});var Vj=E(c6=>{"use strict";Object.defineProperty(c6,"__esModule",{value:!0});var Lme=Ct(),Bme=Fr(),Dme=Ac();function jme(e,t){if(!e)throw new Error("Iterable cannot be null");return new Lme.Observable(function(r){var n=new Bme.Subscription,i;return n.add(function(){i&&typeof i.return=="function"&&i.return()}),n.add(t.schedule(function(){i=e[Dme.iterator](),n.add(t.schedule(function(){if(!r.closed){var o,a;try{var c=i.next();o=c.value,a=c.done}catch(v){r.error(v);return}a?r.complete():(r.next(o),this.schedule())}}))})),n})}c6.scheduleIterable=jme});var $j=E(l6=>{"use strict";Object.defineProperty(l6,"__esModule",{value:!0});var Fme=pu();function Ume(e){return e&&typeof e[Fme.observable]=="function"}l6.isInteropObservable=Ume});var Kj=E(h6=>{"use strict";Object.defineProperty(h6,"__esModule",{value:!0});var Hme=Ac();function Wme(e){return e&&typeof e[Hme.iterator]=="function"}h6.isIterable=Wme});var p6=E(d6=>{"use strict";Object.defineProperty(d6,"__esModule",{value:!0});var zme=Wj(),Vme=zj(),$me=Ag(),Kme=Vj(),Gme=$j(),Zme=o6(),Yme=n6(),Jme=Kj();function Qme(e,t){if(e!=null){if(Gme.isInteropObservable(e))return zme.scheduleObservable(e,t);if(Zme.isPromise(e))return Vme.schedulePromise(e,t);if(Yme.isArrayLike(e))return $me.scheduleArray(e,t);if(Jme.isIterable(e)||typeof e=="string")return Kme.scheduleIterable(e,t)}throw new TypeError((e!==null&&typeof e||e)+" is not observable")}d6.scheduled=Qme});var Ki=E(v6=>{"use strict";Object.defineProperty(v6,"__esModule",{value:!0});var Gj=Ct(),Xme=b0(),ege=p6();function tge(e,t){return t?ege.scheduled(e,t):e instanceof Gj.Observable?e:new Gj.Observable(Xme.subscribeTo(e))}v6.from=tge});var wr=E(ts=>{"use strict";var Pg=ts&&ts.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ts,"__esModule",{value:!0});var Ng=Ze(),rge=Ct(),nge=b0(),ige=function(e){Pg(t,e);function t(r){var n=e.call(this)||this;return n.parent=r,n}return t.prototype._next=function(r){this.parent.notifyNext(r)},t.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(Ng.Subscriber);ts.SimpleInnerSubscriber=ige;var oge=function(e){Pg(t,e);function t(r,n,i){var o=e.call(this)||this;return o.parent=r,o.outerValue=n,o.outerIndex=i,o}return t.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this)},t.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(Ng.Subscriber);ts.ComplexInnerSubscriber=oge;var sge=function(e){Pg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.notifyNext=function(r){this.destination.next(r)},t.prototype.notifyError=function(r){this.destination.error(r)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(Ng.Subscriber);ts.SimpleOuterSubscriber=sge;var age=function(e){Pg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.notifyNext=function(r,n,i,o){this.destination.next(n)},t.prototype.notifyError=function(r){this.destination.error(r)},t.prototype.notifyComplete=function(r){this.destination.complete()},t}(Ng.Subscriber);ts.ComplexOuterSubscriber=age;function uge(e,t){if(!t.closed){if(e instanceof rge.Observable)return e.subscribe(t);var r;try{r=nge.subscribeTo(e)(t)}catch(n){t.error(n)}return r}}ts.innerSubscribe=uge});var y0=E(Zs=>{"use strict";var fge=Zs&&Zs.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Zs,"__esModule",{value:!0});var cge=ni(),lge=Ki(),m6=wr();function g6(e,t,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof t=="function"?function(n){return n.pipe(g6(function(i,o){return lge.from(e(i,o)).pipe(cge.map(function(a,c){return t(i,a,o,c)}))},r))}:(typeof t=="number"&&(r=t),function(n){return n.lift(new Zj(e,r))})}Zs.mergeMap=g6;var Zj=function(){function e(t,r){r===void 0&&(r=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=r}return e.prototype.call=function(t,r){return r.subscribe(new Yj(t,this.project,this.concurrent))},e}();Zs.MergeMapOperator=Zj;var Yj=function(e){fge(t,e);function t(r,n,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var o=e.call(this,r)||this;return o.project=n,o.concurrent=i,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return t.prototype._next=function(r){this.active<this.concurrent?this._tryNext(r):this.buffer.push(r)},t.prototype._tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(o){this.destination.error(o);return}this.active++,this._innerSub(n)},t.prototype._innerSub=function(r){var n=new m6.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=m6.innerSubscribe(r,n);o!==n&&i.add(o)},t.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(r){this.destination.next(r)},t.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},t}(m6.SimpleOuterSubscriber);Zs.MergeMapSubscriber=Yj;Zs.flatMap=g6});var qg=E(b6=>{"use strict";Object.defineProperty(b6,"__esModule",{value:!0});var hge=y0(),dge=Vs();function pge(e){return e===void 0&&(e=Number.POSITIVE_INFINITY),hge.mergeMap(dge.identity,e)}b6.mergeAll=pge});var _6=E(y6=>{"use strict";Object.defineProperty(y6,"__esModule",{value:!0});var vge=qg();function mge(){return vge.mergeAll(1)}y6.concatAll=mge});var _0=E(w6=>{"use strict";Object.defineProperty(w6,"__esModule",{value:!0});var gge=n0(),bge=_6();function yge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return bge.concatAll()(gge.of.apply(void 0,e))}w6.concat=yge});var Lg=E(x6=>{"use strict";Object.defineProperty(x6,"__esModule",{value:!0});var _ge=Ct(),wge=Ki(),xge=Vi();function Mge(e){return new _ge.Observable(function(t){var r;try{r=e()}catch(i){t.error(i);return}var n=r?wge.from(r):xge.empty();return n.subscribe(t)})}x6.defer=Mge});var Qj=E(M6=>{"use strict";Object.defineProperty(M6,"__esModule",{value:!0});var Sge=Ct(),Jj=Pn(),Ege=ni(),Age=mg(),Oge=Ki();function Rge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var r=e[0];if(Jj.isArray(r))return Bg(r,null);if(Age.isObject(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return Bg(n.map(function(o){return r[o]}),n)}}if(typeof e[e.length-1]=="function"){var i=e.pop();return e=e.length===1&&Jj.isArray(e[0])?e[0]:e,Bg(e,null).pipe(Ege.map(function(o){return i.apply(void 0,o)}))}return Bg(e,null)}M6.forkJoin=Rge;function Bg(e,t){return new Sge.Observable(function(r){var n=e.length;if(n===0){r.complete();return}for(var i=new Array(n),o=0,a=0,c=function(y){var w=Oge.from(e[y]),M=!1;r.add(w.subscribe({next:function(S){M||(M=!0,a++),i[y]=S},error:function(S){return r.error(S)},complete:function(){o++,(o===n||!M)&&(a===n&&r.next(t?t.reduce(function(S,R,C){return S[R]=i[C],S},{}):i),r.complete())}}))},v=0;v<n;v++)c(v)})}});var tF=E(S6=>{"use strict";Object.defineProperty(S6,"__esModule",{value:!0});var Ige=Ct(),Cge=Pn(),Tge=dc(),kge=ni(),oDe=function(){return Object.prototype.toString}();function Xj(e,t,r,n){return Tge.isFunction(r)&&(n=r,r=void 0),n?Xj(e,t,r).pipe(kge.map(function(i){return Cge.isArray(i)?n.apply(void 0,i):n(i)})):new Ige.Observable(function(i){function o(a){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(a)}eF(e,t,o,i,r)})}S6.fromEvent=Xj;function eF(e,t,r,n,i){var o;if(qge(e)){var a=e;e.addEventListener(t,r,i),o=function(){return a.removeEventListener(t,r,i)}}else if(Nge(e)){var c=e;e.on(t,r),o=function(){return c.off(t,r)}}else if(Pge(e)){var v=e;e.addListener(t,r),o=function(){return v.removeListener(t,r)}}else if(e&&e.length)for(var y=0,w=e.length;y<w;y++)eF(e[y],t,r,n,i);else throw new TypeError("Invalid event target");n.add(o)}function Pge(e){return e&&typeof e.addListener=="function"&&typeof e.removeListener=="function"}function Nge(e){return e&&typeof e.on=="function"&&typeof e.off=="function"}function qge(e){return e&&typeof e.addEventListener=="function"&&typeof e.removeEventListener=="function"}});var nF=E(E6=>{"use strict";Object.defineProperty(E6,"__esModule",{value:!0});var Lge=Ct(),Bge=Pn(),Dge=dc(),jge=ni();function rF(e,t,r){return r?rF(e,t).pipe(jge.map(function(n){return Bge.isArray(n)?r.apply(void 0,n):r(n)})):new Lge.Observable(function(n){var i=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return n.next(a.length===1?a[0]:a)},o;try{o=e(i)}catch(a){n.error(a);return}if(!!Dge.isFunction(t))return function(){return t(i,o)}})}E6.fromEventPattern=rF});var oF=E(A6=>{"use strict";Object.defineProperty(A6,"__esModule",{value:!0});var Fge=Ct(),iF=Vs(),Uge=$i();function Hge(e,t,r,n,i){var o,a;if(arguments.length==1){var c=e;a=c.initialState,t=c.condition,r=c.iterate,o=c.resultSelector||iF.identity,i=c.scheduler}else n===void 0||Uge.isScheduler(n)?(a=e,o=iF.identity,i=n):(a=e,o=n);return new Fge.Observable(function(v){var y=a;if(i)return i.schedule(Wge,0,{subscriber:v,iterate:r,condition:t,resultSelector:o,state:y});do{if(t){var w=void 0;try{w=t(y)}catch(S){v.error(S);return}if(!w){v.complete();break}}var M=void 0;try{M=o(y)}catch(S){v.error(S);return}if(v.next(M),v.closed)break;try{y=r(y)}catch(S){v.error(S);return}}while(!0)})}A6.generate=Hge;function Wge(e){var t=e.subscriber,r=e.condition;if(!t.closed){if(e.needIterate)try{e.state=e.iterate(e.state)}catch(o){t.error(o);return}else e.needIterate=!0;if(r){var n=void 0;try{n=r(e.state)}catch(o){t.error(o);return}if(!n){t.complete();return}if(t.closed)return}var i;try{i=e.resultSelector(e.state)}catch(o){t.error(o);return}if(!t.closed&&(t.next(i),!t.closed))return this.schedule(e)}}});var aF=E(O6=>{"use strict";Object.defineProperty(O6,"__esModule",{value:!0});var zge=Lg(),sF=Vi();function Vge(e,t,r){return t===void 0&&(t=sF.EMPTY),r===void 0&&(r=sF.EMPTY),zge.defer(function(){return e()?t:r})}O6.iif=Vge});var w0=E(R6=>{"use strict";Object.defineProperty(R6,"__esModule",{value:!0});var $ge=Pn();function Kge(e){return!$ge.isArray(e)&&e-parseFloat(e)+1>=0}R6.isNumeric=Kge});var fF=E(I6=>{"use strict";Object.defineProperty(I6,"__esModule",{value:!0});var Gge=Ct(),uF=Nn(),Zge=w0();function Yge(e,t){return e===void 0&&(e=0),t===void 0&&(t=uF.async),(!Zge.isNumeric(e)||e<0)&&(e=0),(!t||typeof t.schedule!="function")&&(t=uF.async),new Gge.Observable(function(r){return r.add(t.schedule(Jge,e,{subscriber:r,counter:0,period:e})),r})}I6.interval=Yge;function Jge(e){var t=e.subscriber,r=e.counter,n=e.period;t.next(r),this.schedule({subscriber:t,counter:r+1,period:n},n)}});var T6=E(C6=>{"use strict";Object.defineProperty(C6,"__esModule",{value:!0});var Qge=Ct(),Xge=$i(),ebe=qg(),tbe=_c();function rbe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Number.POSITIVE_INFINITY,n=null,i=e[e.length-1];return Xge.isScheduler(i)?(n=e.pop(),e.length>1&&typeof e[e.length-1]=="number"&&(r=e.pop())):typeof i=="number"&&(r=e.pop()),n===null&&e.length===1&&e[0]instanceof Qge.Observable?e[0]:ebe.mergeAll(r)(tbe.fromArray(e,n))}C6.merge=rbe});var k6=E(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});var nbe=Ct(),ibe=Tg();x0.NEVER=new nbe.Observable(ibe.noop);function obe(){return x0.NEVER}x0.never=obe});var cF=E(N6=>{"use strict";Object.defineProperty(N6,"__esModule",{value:!0});var sbe=Ct(),abe=Ki(),ube=Pn(),fbe=Vi();function P6(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===0)return fbe.EMPTY;var r=e[0],n=e.slice(1);return e.length===1&&ube.isArray(r)?P6.apply(void 0,r):new sbe.Observable(function(i){var o=function(){return i.add(P6.apply(void 0,n).subscribe(i))};return abe.from(r).subscribe({next:function(a){i.next(a)},error:o,complete:o})})}N6.onErrorResumeNext=P6});var dF=E(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});var lF=Ct(),cbe=Fr();function lbe(e,t){return t?new lF.Observable(function(r){var n=Object.keys(e),i=new cbe.Subscription;return i.add(t.schedule(hF,0,{keys:n,index:0,subscriber:r,subscription:i,obj:e})),i}):new lF.Observable(function(r){for(var n=Object.keys(e),i=0;i<n.length&&!r.closed;i++){var o=n[i];e.hasOwnProperty(o)&&r.next([o,e[o]])}r.complete()})}Dg.pairs=lbe;function hF(e){var t=e.keys,r=e.index,n=e.subscriber,i=e.subscription,o=e.obj;if(!n.closed)if(r<t.length){var a=t[r];n.next([a,o[a]]),i.add(this.schedule({keys:t,index:r+1,subscriber:n,subscription:i,obj:o}))}else n.complete()}Dg.dispatch=hF});var L6=E(q6=>{"use strict";Object.defineProperty(q6,"__esModule",{value:!0});function hbe(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}q6.not=hbe});var gu=E(M0=>{"use strict";var dbe=M0&&M0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(M0,"__esModule",{value:!0});var pbe=Ze();function vbe(e,t){return function(n){return n.lift(new mbe(e,t))}}M0.filter=vbe;var mbe=function(){function e(t,r){this.predicate=t,this.thisArg=r}return e.prototype.call=function(t,r){return r.subscribe(new gbe(t,this.predicate,this.thisArg))},e}(),gbe=function(e){dbe(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.predicate=n,o.thisArg=i,o.count=0,o}return t.prototype._next=function(r){var n;try{n=this.predicate.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}n&&this.destination.next(r)},t}(pbe.Subscriber)});var gF=E(B6=>{"use strict";Object.defineProperty(B6,"__esModule",{value:!0});var bbe=L6(),pF=b0(),vF=gu(),mF=Ct();function ybe(e,t,r){return[vF.filter(t,r)(new mF.Observable(pF.subscribeTo(e))),vF.filter(bbe.not(t,r))(new mF.Observable(pF.subscribeTo(e)))]}B6.partition=ybe});var D6=E(bu=>{"use strict";var _be=bu&&bu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(bu,"__esModule",{value:!0});var wbe=Pn(),xbe=_c(),Mbe=Ks(),Sbe=Gs();function Ebe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1)if(wbe.isArray(e[0]))e=e[0];else return e[0];return xbe.fromArray(e,void 0).lift(new bF)}bu.race=Ebe;var bF=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new yF(t))},e}();bu.RaceOperator=bF;var yF=function(e){_be(t,e);function t(r){var n=e.call(this,r)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return t.prototype._next=function(r){this.observables.push(r)},t.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{for(var i=0;i<n&&!this.hasFirst;i++){var o=r[i],a=Sbe.subscribeToResult(this,o,void 0,i);this.subscriptions&&this.subscriptions.push(a),this.add(a)}this.observables=null}},t.prototype.notifyNext=function(r,n,i){if(!this.hasFirst){this.hasFirst=!0;for(var o=0;o<this.subscriptions.length;o++)if(o!==i){var a=this.subscriptions[o];a.unsubscribe(),this.remove(a)}this.subscriptions=null}this.destination.next(n)},t}(Mbe.OuterSubscriber);bu.RaceSubscriber=yF});var wF=E(jg=>{"use strict";Object.defineProperty(jg,"__esModule",{value:!0});var Abe=Ct();function Obe(e,t,r){return e===void 0&&(e=0),new Abe.Observable(function(n){t===void 0&&(t=e,e=0);var i=0,o=e;if(r)return r.schedule(_F,0,{index:i,count:t,start:e,subscriber:n});do{if(i++>=t){n.complete();break}if(n.next(o++),n.closed)break}while(!0)})}jg.range=Obe;function _F(e){var t=e.start,r=e.index,n=e.count,i=e.subscriber;if(r>=n){i.complete();return}i.next(t),!i.closed&&(e.index=r+1,e.start=t+1,this.schedule(e))}jg.dispatch=_F});var F6=E(j6=>{"use strict";Object.defineProperty(j6,"__esModule",{value:!0});var Rbe=Ct(),Ibe=Nn(),xF=w0(),MF=$i();function Cbe(e,t,r){e===void 0&&(e=0);var n=-1;return xF.isNumeric(t)?n=Number(t)<1&&1||Number(t):MF.isScheduler(t)&&(r=t),MF.isScheduler(r)||(r=Ibe.async),new Rbe.Observable(function(i){var o=xF.isNumeric(e)?e:+e-r.now();return r.schedule(Tbe,o,{index:0,period:n,subscriber:i})})}j6.timer=Cbe;function Tbe(e){var t=e.index,r=e.period,n=e.subscriber;if(n.next(t),!n.closed){if(r===-1)return n.complete();e.index=t+1,this.schedule(e,r)}}});var SF=E(U6=>{"use strict";Object.defineProperty(U6,"__esModule",{value:!0});var kbe=Ct(),Pbe=Ki(),Nbe=Vi();function qbe(e,t){return new kbe.Observable(function(r){var n;try{n=e()}catch(c){r.error(c);return}var i;try{i=t(n)}catch(c){r.error(c);return}var o=i?Pbe.from(i):Nbe.EMPTY,a=o.subscribe(r);return function(){a.unsubscribe(),n&&n.unsubscribe()}})}U6.using=qbe});var Ug=E(yu=>{"use strict";var EF=yu&&yu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(yu,"__esModule",{value:!0});var Lbe=_c(),Bbe=Pn(),Dbe=Ze(),Fg=Ac(),H6=wr();function jbe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return typeof r=="function"&&e.pop(),Lbe.fromArray(e,void 0).lift(new AF(r))}yu.zip=jbe;var AF=function(){function e(t){this.resultSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new OF(t,this.resultSelector))},e}();yu.ZipOperator=AF;var OF=function(e){EF(t,e);function t(r,n,i){i===void 0&&(i=Object.create(null));var o=e.call(this,r)||this;return o.resultSelector=n,o.iterators=[],o.active=0,o.resultSelector=typeof n=="function"?n:void 0,o}return t.prototype._next=function(r){var n=this.iterators;Bbe.isArray(r)?n.push(new Ube(r)):typeof r[Fg.iterator]=="function"?n.push(new Fbe(r[Fg.iterator]())):n.push(new Hbe(this.destination,this,r))},t.prototype._complete=function(){var r=this.iterators,n=r.length;if(this.unsubscribe(),n===0){this.destination.complete();return}this.active=n;for(var i=0;i<n;i++){var o=r[i];if(o.stillUnsubscribed){var a=this.destination;a.add(o.subscribe())}else this.active--}},t.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},t.prototype.checkIterators=function(){for(var r=this.iterators,n=r.length,i=this.destination,o=0;o<n;o++){var a=r[o];if(typeof a.hasValue=="function"&&!a.hasValue())return}for(var c=!1,v=[],o=0;o<n;o++){var a=r[o],y=a.next();if(a.hasCompleted()&&(c=!0),y.done){i.complete();return}v.push(y.value)}this.resultSelector?this._tryresultSelector(v):i.next(v),c&&i.complete()},t.prototype._tryresultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},t}(Dbe.Subscriber);yu.ZipSubscriber=OF;var Fbe=function(){function e(t){this.iterator=t,this.nextResult=t.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},e.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},e}(),Ube=function(){function e(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return e.prototype[Fg.iterator]=function(){return this},e.prototype.next=function(t){var r=this.index++,n=this.array;return r<this.length?{value:n[r],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),Hbe=function(e){EF(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.parent=n,o.observable=i,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return t.prototype[Fg.iterator]=function(){return this},t.prototype.next=function(){var r=this.buffer;return r.length===0&&this.isComplete?{value:null,done:!0}:{value:r.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(r){this.buffer.push(r),this.parent.checkIterators()},t.prototype.subscribe=function(){return H6.innerSubscribe(this.observable,new H6.SimpleInnerSubscriber(this))},t}(H6.SimpleOuterSubscriber)});var _u=E(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});var Wbe=Ct();We.Observable=Wbe.Observable;var zbe=R4();We.ConnectableObservable=zbe.ConnectableObservable;var Vbe=C4();We.GroupedObservable=Vbe.GroupedObservable;var $be=pu();We.observable=$be.observable;var Kbe=wn();We.Subject=Kbe.Subject;var Gbe=T4();We.BehaviorSubject=Gbe.BehaviorSubject;var Zbe=Rg();We.ReplaySubject=Zbe.ReplaySubject;var Ybe=u0();We.AsyncSubject=Ybe.AsyncSubject;var RF=z4();We.asap=RF.asap;We.asapScheduler=RF.asapScheduler;var IF=Nn();We.async=IF.async;We.asyncScheduler=IF.asyncScheduler;var CF=N4();We.queue=CF.queue;We.queueScheduler=CF.queueScheduler;var TF=xj();We.animationFrame=TF.animationFrame;We.animationFrameScheduler=TF.animationFrameScheduler;var kF=Ej();We.VirtualTimeScheduler=kF.VirtualTimeScheduler;We.VirtualAction=kF.VirtualAction;var Jbe=P4();We.Scheduler=Jbe.Scheduler;var Qbe=Fr();We.Subscription=Qbe.Subscription;var Xbe=Ze();We.Subscriber=Xbe.Subscriber;var PF=o0();We.Notification=PF.Notification;We.NotificationKind=PF.NotificationKind;var eye=xg();We.pipe=eye.pipe;var tye=Tg();We.noop=tye.noop;var rye=Vs();We.identity=rye.identity;var nye=Aj();We.isObservable=nye.isObservable;var iye=xc();We.ArgumentOutOfRangeError=iye.ArgumentOutOfRangeError;var oye=Mc();We.EmptyError=oye.EmptyError;var sye=Vh();We.ObjectUnsubscribedError=sye.ObjectUnsubscribedError;var aye=h4();We.UnsubscriptionError=aye.UnsubscriptionError;var uye=Y4();We.TimeoutError=uye.TimeoutError;var fye=Cj();We.bindCallback=fye.bindCallback;var cye=Nj();We.bindNodeCallback=cye.bindNodeCallback;var lye=kg();We.combineLatest=lye.combineLatest;var hye=_0();We.concat=hye.concat;var dye=Lg();We.defer=dye.defer;var pye=Vi();We.empty=pye.empty;var vye=Qj();We.forkJoin=vye.forkJoin;var mye=Ki();We.from=mye.from;var gye=tF();We.fromEvent=gye.fromEvent;var bye=nF();We.fromEventPattern=bye.fromEventPattern;var yye=oF();We.generate=yye.generate;var _ye=aF();We.iif=_ye.iif;var wye=fF();We.interval=wye.interval;var xye=T6();We.merge=xye.merge;var Mye=k6();We.never=Mye.never;var Sye=n0();We.of=Sye.of;var Eye=cF();We.onErrorResumeNext=Eye.onErrorResumeNext;var Aye=dF();We.pairs=Aye.pairs;var Oye=gF();We.partition=Oye.partition;var Rye=D6();We.race=Rye.race;var Iye=wF();We.range=Iye.range;var Cye=Og();We.throwError=Cye.throwError;var Tye=F6();We.timer=Tye.timer;var kye=SF();We.using=kye.using;var Pye=Ug();We.zip=Pye.zip;var Nye=p6();We.scheduled=Nye.scheduled;var qye=Vi();We.EMPTY=qye.EMPTY;var Lye=k6();We.NEVER=Lye.NEVER;var Bye=Wh();We.config=Bye.config});var z6=E(S0=>{"use strict";var Dye=S0&&S0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(S0,"__esModule",{value:!0});var W6=wr();function jye(e){return function(r){return r.lift(new Fye(e))}}S0.audit=jye;var Fye=function(){function e(t){this.durationSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new Uye(t,this.durationSelector))},e}(),Uye=function(e){Dye(t,e);function t(r,n){var i=e.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return t.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(a){return this.destination.error(a)}var o=W6.innerSubscribe(n,new W6.SimpleInnerSubscriber(this));!o||o.closed?this.clearThrottle():this.add(this.throttled=o)}},t.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,o=r.throttled;o&&(this.remove(o),this.throttled=void 0,o.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(W6.SimpleOuterSubscriber)});var NF=E(V6=>{"use strict";Object.defineProperty(V6,"__esModule",{value:!0});var Hye=Nn(),Wye=z6(),zye=F6();function Vye(e,t){return t===void 0&&(t=Hye.async),Wye.audit(function(){return zye.timer(e,t)})}V6.auditTime=Vye});var qF=E(E0=>{"use strict";var $ye=E0&&E0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(E0,"__esModule",{value:!0});var $6=wr();function Kye(e){return function(r){return r.lift(new Gye(e))}}E0.buffer=Kye;var Gye=function(){function e(t){this.closingNotifier=t}return e.prototype.call=function(t,r){return r.subscribe(new Zye(t,this.closingNotifier))},e}(),Zye=function(e){$ye(t,e);function t(r,n){var i=e.call(this,r)||this;return i.buffer=[],i.add($6.innerSubscribe(n,new $6.SimpleInnerSubscriber(i))),i}return t.prototype._next=function(r){this.buffer.push(r)},t.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},t}($6.SimpleOuterSubscriber)});var DF=E(A0=>{"use strict";var LF=A0&&A0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(A0,"__esModule",{value:!0});var BF=Ze();function Yye(e,t){return t===void 0&&(t=null),function(n){return n.lift(new Jye(e,t))}}A0.bufferCount=Yye;var Jye=function(){function e(t,r){this.bufferSize=t,this.startBufferEvery=r,!r||t===r?this.subscriberClass=Qye:this.subscriberClass=Xye}return e.prototype.call=function(t,r){return r.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},e}(),Qye=function(e){LF(t,e);function t(r,n){var i=e.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return t.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},t.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),e.prototype._complete.call(this)},t}(BF.Subscriber),Xye=function(e){LF(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.bufferSize=n,o.startBufferEvery=i,o.buffers=[],o.count=0,o}return t.prototype._next=function(r){var n=this,i=n.bufferSize,o=n.startBufferEvery,a=n.buffers,c=n.count;this.count++,c%o===0&&a.push([]);for(var v=a.length;v--;){var y=a[v];y.push(r),y.length===i&&(a.splice(v,1),this.destination.next(y))}},t.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var o=n.shift();o.length>0&&i.next(o)}e.prototype._complete.call(this)},t}(BF.Subscriber)});var UF=E(O0=>{"use strict";var e_e=O0&&O0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(O0,"__esModule",{value:!0});var t_e=Nn(),r_e=Ze(),n_e=$i();function i_e(e){var t=arguments.length,r=t_e.async;n_e.isScheduler(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],t--);var n=null;t>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return t>=3&&(i=arguments[2]),function(a){return a.lift(new o_e(e,n,i,r))}}O0.bufferTime=i_e;var o_e=function(){function e(t,r,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler=i}return e.prototype.call=function(t,r){return r.subscribe(new a_e(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),s_e=function(){function e(){this.buffer=[]}return e}(),a_e=function(e){e_e(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;c.bufferTimeSpan=n,c.bufferCreationInterval=i,c.maxBufferSize=o,c.scheduler=a,c.contexts=[];var v=c.openContext();if(c.timespanOnly=i==null||i<0,c.timespanOnly){var y={subscriber:c,context:v,bufferTimeSpan:n};c.add(v.closeAction=a.schedule(jF,n,y))}else{var w={subscriber:c,context:v},M={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:c,scheduler:a};c.add(v.closeAction=a.schedule(FF,n,w)),c.add(a.schedule(u_e,i,M))}return c}return t.prototype._next=function(r){for(var n=this.contexts,i=n.length,o,a=0;a<i;a++){var c=n[a],v=c.buffer;v.push(r),v.length==this.maxBufferSize&&(o=c)}o&&this.onBufferFull(o)},t.prototype._error=function(r){this.contexts.length=0,e.prototype._error.call(this,r)},t.prototype._complete=function(){for(var r=this,n=r.contexts,i=r.destination;n.length>0;){var o=n.shift();i.next(o.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,o={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(jF,i,o))}},t.prototype.openContext=function(){var r=new s_e;return this.contexts.push(r),r},t.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},t}(r_e.Subscriber);function jF(e){var t=e.subscriber,r=e.context;r&&t.closeContext(r),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function u_e(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openContext(),a=this;n.closed||(n.add(o.closeAction=i.schedule(FF,r,{subscriber:n,context:o})),a.schedule(e,t))}function FF(e){var t=e.subscriber,r=e.context;t.closeContext(r)}});var WF=E(R0=>{"use strict";var f_e=R0&&R0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(R0,"__esModule",{value:!0});var c_e=Fr(),HF=Gs(),l_e=Ks();function h_e(e,t){return function(n){return n.lift(new d_e(e,t))}}R0.bufferToggle=h_e;var d_e=function(){function e(t,r){this.openings=t,this.closingSelector=r}return e.prototype.call=function(t,r){return r.subscribe(new p_e(t,this.openings,this.closingSelector))},e}(),p_e=function(e){f_e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.closingSelector=i,o.contexts=[],o.add(HF.subscribeToResult(o,n)),o}return t.prototype._next=function(r){for(var n=this.contexts,i=n.length,o=0;o<i;o++)n[o].buffer.push(r)},t.prototype._error=function(r){for(var n=this.contexts;n.length>0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,e.prototype._error.call(this,r)},t.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},t.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},t.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(o){this._error(o)}},t.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,o=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(o),o.unsubscribe()}},t.prototype.trySubscribe=function(r){var n=this.contexts,i=[],o=new c_e.Subscription,a={buffer:i,subscription:o};n.push(a);var c=HF.subscribeToResult(this,r,a);!c||c.closed?this.closeBuffer(a):(c.context=a,this.add(c),o.add(c))},t}(l_e.OuterSubscriber)});var zF=E(I0=>{"use strict";var v_e=I0&&I0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(I0,"__esModule",{value:!0});var m_e=Fr(),K6=wr();function g_e(e){return function(t){return t.lift(new b_e(e))}}I0.bufferWhen=g_e;var b_e=function(){function e(t){this.closingSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new y_e(t,this.closingSelector))},e}(),y_e=function(e){v_e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return t.prototype._next=function(r){this.buffer.push(r)},t.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var o=this.closingSelector;i=o()}catch(a){return this.error(a)}r=new m_e.Subscription,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(K6.innerSubscribe(i,new K6.SimpleInnerSubscriber(this))),this.subscribing=!1},t}(K6.SimpleOuterSubscriber)});var VF=E(C0=>{"use strict";var __e=C0&&C0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(C0,"__esModule",{value:!0});var G6=wr();function w_e(e){return function(r){var n=new x_e(e),i=r.lift(n);return n.caught=i}}C0.catchError=w_e;var x_e=function(){function e(t){this.selector=t}return e.prototype.call=function(t,r){return r.subscribe(new M_e(t,this.selector,this.caught))},e}(),M_e=function(e){__e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.selector=n,o.caught=i,o}return t.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(a){e.prototype.error.call(this,a);return}this._unsubscribeAndRecycle();var i=new G6.SimpleInnerSubscriber(this);this.add(i);var o=G6.innerSubscribe(n,i);o!==i&&this.add(o)}},t}(G6.SimpleOuterSubscriber)});var $F=E(Z6=>{"use strict";Object.defineProperty(Z6,"__esModule",{value:!0});var S_e=kg();function E_e(e){return function(t){return t.lift(new S_e.CombineLatestOperator(e))}}Z6.combineAll=E_e});var KF=E(Y6=>{"use strict";Object.defineProperty(Y6,"__esModule",{value:!0});var A_e=Pn(),O_e=kg(),R_e=Ki();function I_e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=null;return typeof e[e.length-1]=="function"&&(r=e.pop()),e.length===1&&A_e.isArray(e[0])&&(e=e[0].slice()),function(n){return n.lift.call(R_e.from([n].concat(e)),new O_e.CombineLatestOperator(r))}}Y6.combineLatest=I_e});var GF=E(J6=>{"use strict";Object.defineProperty(J6,"__esModule",{value:!0});var C_e=_0();function T_e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){return r.lift.call(C_e.concat.apply(void 0,[r].concat(e)))}}J6.concat=T_e});var X6=E(Q6=>{"use strict";Object.defineProperty(Q6,"__esModule",{value:!0});var k_e=y0();function P_e(e,t){return k_e.mergeMap(e,t,1)}Q6.concatMap=P_e});var ZF=E(eM=>{"use strict";Object.defineProperty(eM,"__esModule",{value:!0});var N_e=X6();function q_e(e,t){return N_e.concatMap(function(){return e},t)}eM.concatMapTo=q_e});var YF=E(T0=>{"use strict";var L_e=T0&&T0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(T0,"__esModule",{value:!0});var B_e=Ze();function D_e(e){return function(t){return t.lift(new j_e(e,t))}}T0.count=D_e;var j_e=function(){function e(t,r){this.predicate=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new F_e(t,this.predicate,this.source))},e}(),F_e=function(e){L_e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.predicate=n,o.source=i,o.count=0,o.index=0,o}return t.prototype._next=function(r){this.predicate?this._tryPredicate(r):this.count++},t.prototype._tryPredicate=function(r){var n;try{n=this.predicate(r,this.index++,this.source)}catch(i){this.destination.error(i);return}n&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(B_e.Subscriber)});var JF=E(k0=>{"use strict";var U_e=k0&&k0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(k0,"__esModule",{value:!0});var tM=wr();function H_e(e){return function(t){return t.lift(new W_e(e))}}k0.debounce=H_e;var W_e=function(){function e(t){this.durationSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new z_e(t,this.durationSelector))},e}(),z_e=function(e){U_e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return t.prototype._next=function(r){try{var n=this.durationSelector.call(this,r);n&&this._tryNext(r,n)}catch(i){this.destination.error(i)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(r,n){var i=this.durationSubscription;this.value=r,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=tM.innerSubscribe(n,new tM.SimpleInnerSubscriber(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var r=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,r)}},t}(tM.SimpleOuterSubscriber)});var QF=E(P0=>{"use strict";var V_e=P0&&P0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(P0,"__esModule",{value:!0});var $_e=Ze(),K_e=Nn();function G_e(e,t){return t===void 0&&(t=K_e.async),function(r){return r.lift(new Z_e(e,t))}}P0.debounceTime=G_e;var Z_e=function(){function e(t,r){this.dueTime=t,this.scheduler=r}return e.prototype.call=function(t,r){return r.subscribe(new Y_e(t,this.dueTime,this.scheduler))},e}(),Y_e=function(e){V_e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.dueTime=n,o.scheduler=i,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return t.prototype._next=function(r){this.clearDebounce(),this.lastValue=r,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(J_e,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var r=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(r)}},t.prototype.clearDebounce=function(){var r=this.debouncedSubscription;r!==null&&(this.remove(r),r.unsubscribe(),this.debouncedSubscription=null)},t}($_e.Subscriber);function J_e(e){e.debouncedNext()}});var Oc=E(N0=>{"use strict";var Q_e=N0&&N0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(N0,"__esModule",{value:!0});var X_e=Ze();function ewe(e){return e===void 0&&(e=null),function(t){return t.lift(new twe(e))}}N0.defaultIfEmpty=ewe;var twe=function(){function e(t){this.defaultValue=t}return e.prototype.call=function(t,r){return r.subscribe(new rwe(t,this.defaultValue))},e}(),rwe=function(e){Q_e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.defaultValue=n,i.isEmpty=!0,i}return t.prototype._next=function(r){this.isEmpty=!1,this.destination.next(r)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(X_e.Subscriber)});var nM=E(rM=>{"use strict";Object.defineProperty(rM,"__esModule",{value:!0});function nwe(e){return e instanceof Date&&!isNaN(+e)}rM.isDate=nwe});var eU=E(q0=>{"use strict";var iwe=q0&&q0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(q0,"__esModule",{value:!0});var owe=Nn(),swe=nM(),awe=Ze(),XF=o0();function uwe(e,t){t===void 0&&(t=owe.async);var r=swe.isDate(e),n=r?+e-t.now():Math.abs(e);return function(i){return i.lift(new fwe(n,t))}}q0.delay=uwe;var fwe=function(){function e(t,r){this.delay=t,this.scheduler=r}return e.prototype.call=function(t,r){return r.subscribe(new cwe(t,this.delay,this.scheduler))},e}(),cwe=function(e){iwe(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.delay=n,o.scheduler=i,o.queue=[],o.active=!1,o.errored=!1,o}return t.dispatch=function(r){for(var n=r.source,i=n.queue,o=r.scheduler,a=r.destination;i.length>0&&i[0].time-o.now()<=0;)i.shift().notification.observe(a);if(i.length>0){var c=Math.max(0,i[0].time-o.now());this.schedule(r,c)}else this.unsubscribe(),n.active=!1},t.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},t.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new lwe(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},t.prototype._next=function(r){this.scheduleNotification(XF.Notification.createNext(r))},t.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(XF.Notification.createComplete()),this.unsubscribe()},t}(awe.Subscriber),lwe=function(){function e(t,r){this.time=t,this.notification=r}return e}()});var rU=E(L0=>{"use strict";var iM=L0&&L0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(L0,"__esModule",{value:!0});var hwe=Ze(),dwe=Ct(),pwe=Ks(),vwe=Gs();function mwe(e,t){return t?function(r){return new bwe(r,t).lift(new tU(e))}:function(r){return r.lift(new tU(e))}}L0.delayWhen=mwe;var tU=function(){function e(t){this.delayDurationSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new gwe(t,this.delayDurationSelector))},e}(),gwe=function(e){iM(t,e);function t(r,n){var i=e.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return t.prototype.notifyNext=function(r,n,i,o,a){this.destination.next(r),this.removeSubscription(a),this.tryComplete()},t.prototype.notifyError=function(r,n){this._error(r)},t.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},t.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(o){this.destination.error(o)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},t.prototype.tryDelay=function(r,n){var i=vwe.subscribeToResult(this,r,n);if(i&&!i.closed){var o=this.destination;o.add(i),this.delayNotifierSubscriptions.push(i)}},t.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},t}(pwe.OuterSubscriber),bwe=function(e){iM(t,e);function t(r,n){var i=e.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return t.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new ywe(r,this.source))},t}(dwe.Observable),ywe=function(e){iM(t,e);function t(r,n){var i=e.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return t.prototype._next=function(r){this.subscribeToSource()},t.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(hwe.Subscriber)});var nU=E(B0=>{"use strict";var _we=B0&&B0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(B0,"__esModule",{value:!0});var wwe=Ze();function xwe(){return function(t){return t.lift(new Mwe)}}B0.dematerialize=xwe;var Mwe=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new Swe(t))},e}(),Swe=function(e){_we(t,e);function t(r){return e.call(this,r)||this}return t.prototype._next=function(r){r.observe(this.destination)},t}(wwe.Subscriber)});var oU=E(Rc=>{"use strict";var Ewe=Rc&&Rc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Rc,"__esModule",{value:!0});var oM=wr();function Awe(e,t){return function(r){return r.lift(new Owe(e,t))}}Rc.distinct=Awe;var Owe=function(){function e(t,r){this.keySelector=t,this.flushes=r}return e.prototype.call=function(t,r){return r.subscribe(new iU(t,this.keySelector,this.flushes))},e}(),iU=function(e){Ewe(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.keySelector=n,o.values=new Set,i&&o.add(oM.innerSubscribe(i,new oM.SimpleInnerSubscriber(o))),o}return t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(r){this._error(r)},t.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},t.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(o){i.error(o);return}this._finalizeNext(n,r)},t.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},t}(oM.SimpleOuterSubscriber);Rc.DistinctSubscriber=iU});var sM=E(D0=>{"use strict";var Rwe=D0&&D0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(D0,"__esModule",{value:!0});var Iwe=Ze();function Cwe(e,t){return function(r){return r.lift(new Twe(e,t))}}D0.distinctUntilChanged=Cwe;var Twe=function(){function e(t,r){this.compare=t,this.keySelector=r}return e.prototype.call=function(t,r){return r.subscribe(new kwe(t,this.compare,this.keySelector))},e}(),kwe=function(e){Rwe(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.keySelector=i,o.hasKey=!1,typeof n=="function"&&(o.compare=n),o}return t.prototype.compare=function(r,n){return r===n},t.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(c){return this.destination.error(c)}var o=!1;if(this.hasKey)try{var a=this.compare;o=a(this.key,n)}catch(c){return this.destination.error(c)}else this.hasKey=!0;o||(this.key=n,this.destination.next(r))},t}(Iwe.Subscriber)});var sU=E(aM=>{"use strict";Object.defineProperty(aM,"__esModule",{value:!0});var Pwe=sM();function Nwe(e,t){return Pwe.distinctUntilChanged(function(r,n){return t?t(r[e],n[e]):r[e]===n[e]})}aM.distinctUntilKeyChanged=Nwe});var F0=E(j0=>{"use strict";var qwe=j0&&j0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(j0,"__esModule",{value:!0});var Lwe=Mc(),Bwe=Ze();function Dwe(e){return e===void 0&&(e=Uwe),function(t){return t.lift(new jwe(e))}}j0.throwIfEmpty=Dwe;var jwe=function(){function e(t){this.errorFactory=t}return e.prototype.call=function(t,r){return r.subscribe(new Fwe(t,this.errorFactory))},e}(),Fwe=function(e){qwe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return t.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},t}(Bwe.Subscriber);function Uwe(){return new Lwe.EmptyError}});var Hg=E(U0=>{"use strict";var Hwe=U0&&U0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(U0,"__esModule",{value:!0});var Wwe=Ze(),zwe=xc(),Vwe=Vi();function $we(e){return function(t){return e===0?Vwe.empty():t.lift(new Kwe(e))}}U0.take=$we;var Kwe=function(){function e(t){if(this.total=t,this.total<0)throw new zwe.ArgumentOutOfRangeError}return e.prototype.call=function(t,r){return r.subscribe(new Gwe(t,this.total))},e}(),Gwe=function(e){Hwe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.total=n,i.count=0,i}return t.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},t}(Wwe.Subscriber)});var uU=E(uM=>{"use strict";Object.defineProperty(uM,"__esModule",{value:!0});var aU=xc(),Zwe=gu(),Ywe=F0(),Jwe=Oc(),Qwe=Hg();function Xwe(e,t){if(e<0)throw new aU.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(n){return n.pipe(Zwe.filter(function(i,o){return o===e}),Qwe.take(1),r?Jwe.defaultIfEmpty(t):Ywe.throwIfEmpty(function(){return new aU.ArgumentOutOfRangeError}))}}uM.elementAt=Xwe});var fU=E(fM=>{"use strict";Object.defineProperty(fM,"__esModule",{value:!0});var e2e=_0(),t2e=n0();function r2e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){return e2e.concat(r,t2e.of.apply(void 0,e))}}fM.endWith=r2e});var cU=E(H0=>{"use strict";var n2e=H0&&H0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(H0,"__esModule",{value:!0});var i2e=Ze();function o2e(e,t){return function(r){return r.lift(new s2e(e,t,r))}}H0.every=o2e;var s2e=function(){function e(t,r,n){this.predicate=t,this.thisArg=r,this.source=n}return e.prototype.call=function(t,r){return r.subscribe(new a2e(t,this.predicate,this.thisArg,this.source))},e}(),a2e=function(e){n2e(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.predicate=n,a.thisArg=i,a.source=o,a.index=0,a.thisArg=i||a,a}return t.prototype.notifyComplete=function(r){this.destination.next(r),this.destination.complete()},t.prototype._next=function(r){var n=!1;try{n=this.predicate.call(this.thisArg,r,this.index++,this.source)}catch(i){this.destination.error(i);return}n||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(i2e.Subscriber)});var lU=E(W0=>{"use strict";var u2e=W0&&W0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(W0,"__esModule",{value:!0});var cM=wr();function f2e(){return function(e){return e.lift(new c2e)}}W0.exhaust=f2e;var c2e=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new l2e(t))},e}(),l2e=function(e){u2e(t,e);function t(r){var n=e.call(this,r)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return t.prototype._next=function(r){this.hasSubscription||(this.hasSubscription=!0,this.add(cM.innerSubscribe(r,new cM.SimpleInnerSubscriber(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(cM.SimpleOuterSubscriber)});var dU=E(z0=>{"use strict";var h2e=z0&&z0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(z0,"__esModule",{value:!0});var d2e=ni(),p2e=Ki(),lM=wr();function hU(e,t){return t?function(r){return r.pipe(hU(function(n,i){return p2e.from(e(n,i)).pipe(d2e.map(function(o,a){return t(n,o,i,a)}))}))}:function(r){return r.lift(new v2e(e))}}z0.exhaustMap=hU;var v2e=function(){function e(t){this.project=t}return e.prototype.call=function(t,r){return r.subscribe(new m2e(t,this.project))},e}(),m2e=function(e){h2e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.project=n,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return t.prototype._next=function(r){this.hasSubscription||this.tryNext(r)},t.prototype.tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(o){this.destination.error(o);return}this.hasSubscription=!0,this._innerSub(n)},t.prototype._innerSub=function(r){var n=new lM.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=lM.innerSubscribe(r,n);o!==n&&i.add(o)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(r){this.destination.next(r)},t.prototype.notifyError=function(r){this.destination.error(r)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(lM.SimpleOuterSubscriber)});var mU=E(wu=>{"use strict";var g2e=wu&&wu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(wu,"__esModule",{value:!0});var hM=wr();function b2e(e,t,r){return t===void 0&&(t=Number.POSITIVE_INFINITY),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(n){return n.lift(new pU(e,t,r))}}wu.expand=b2e;var pU=function(){function e(t,r,n){this.project=t,this.concurrent=r,this.scheduler=n}return e.prototype.call=function(t,r){return r.subscribe(new vU(t,this.project,this.concurrent,this.scheduler))},e}();wu.ExpandOperator=pU;var vU=function(e){g2e(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.project=n,a.concurrent=i,a.scheduler=o,a.index=0,a.active=0,a.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(a.buffer=[]),a}return t.dispatch=function(r){var n=r.subscriber,i=r.result,o=r.value,a=r.index;n.subscribeToProjection(i,o,a)},t.prototype._next=function(r){var n=this.destination;if(n.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){n.next(r);try{var o=this.project,a=o(r,i);if(!this.scheduler)this.subscribeToProjection(a,r,i);else{var c={subscriber:this,result:a,value:r,index:i},v=this.destination;v.add(this.scheduler.schedule(t.dispatch,0,c))}}catch(y){n.error(y)}}else this.buffer.push(r)},t.prototype.subscribeToProjection=function(r,n,i){this.active++;var o=this.destination;o.add(hM.innerSubscribe(r,new hM.SimpleInnerSubscriber(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(r){this._next(r)},t.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r&&r.length>0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},t}(hM.SimpleOuterSubscriber);wu.ExpandSubscriber=vU});var gU=E(V0=>{"use strict";var y2e=V0&&V0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(V0,"__esModule",{value:!0});var _2e=Ze(),w2e=Fr();function x2e(e){return function(t){return t.lift(new M2e(e))}}V0.finalize=x2e;var M2e=function(){function e(t){this.callback=t}return e.prototype.call=function(t,r){return r.subscribe(new S2e(t,this.callback))},e}(),S2e=function(e){y2e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.add(new w2e.Subscription(n)),i}return t}(_2e.Subscriber)});var dM=E(xu=>{"use strict";var E2e=xu&&xu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(xu,"__esModule",{value:!0});var A2e=Ze();function O2e(e,t){if(typeof e!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new bU(e,r,!1,t))}}xu.find=O2e;var bU=function(){function e(t,r,n,i){this.predicate=t,this.source=r,this.yieldIndex=n,this.thisArg=i}return e.prototype.call=function(t,r){return r.subscribe(new yU(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();xu.FindValueOperator=bU;var yU=function(e){E2e(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;return c.predicate=n,c.source=i,c.yieldIndex=o,c.thisArg=a,c.index=0,c}return t.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},t.prototype._next=function(r){var n=this,i=n.predicate,o=n.thisArg,a=this.index++;try{var c=i.call(o||this,r,a,this.source);c&&this.notifyComplete(this.yieldIndex?a:r)}catch(v){this.destination.error(v)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(A2e.Subscriber);xu.FindValueSubscriber=yU});var _U=E(pM=>{"use strict";Object.defineProperty(pM,"__esModule",{value:!0});var R2e=dM();function I2e(e,t){return function(r){return r.lift(new R2e.FindValueOperator(e,r,!0,t))}}pM.findIndex=I2e});var wU=E(vM=>{"use strict";Object.defineProperty(vM,"__esModule",{value:!0});var C2e=Mc(),T2e=gu(),k2e=Hg(),P2e=Oc(),N2e=F0(),q2e=Vs();function L2e(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?T2e.filter(function(i,o){return e(i,o,n)}):q2e.identity,k2e.take(1),r?P2e.defaultIfEmpty(t):N2e.throwIfEmpty(function(){return new C2e.EmptyError}))}}vM.first=L2e});var xU=E($0=>{"use strict";var B2e=$0&&$0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($0,"__esModule",{value:!0});var D2e=Ze();function j2e(){return function(t){return t.lift(new F2e)}}$0.ignoreElements=j2e;var F2e=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new U2e(t))},e}(),U2e=function(e){B2e(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._next=function(r){},t}(D2e.Subscriber)});var MU=E(K0=>{"use strict";var H2e=K0&&K0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(K0,"__esModule",{value:!0});var W2e=Ze();function z2e(){return function(e){return e.lift(new V2e)}}K0.isEmpty=z2e;var V2e=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new $2e(t))},e}(),$2e=function(e){H2e(t,e);function t(r){return e.call(this,r)||this}return t.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},t.prototype._next=function(r){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(W2e.Subscriber)});var Wg=E(G0=>{"use strict";var K2e=G0&&G0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(G0,"__esModule",{value:!0});var G2e=Ze(),Z2e=xc(),Y2e=Vi();function J2e(e){return function(r){return e===0?Y2e.empty():r.lift(new Q2e(e))}}G0.takeLast=J2e;var Q2e=function(){function e(t){if(this.total=t,this.total<0)throw new Z2e.ArgumentOutOfRangeError}return e.prototype.call=function(t,r){return r.subscribe(new X2e(t,this.total))},e}(),X2e=function(e){K2e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return t.prototype._next=function(r){var n=this.ring,i=this.total,o=this.count++;if(n.length<i)n.push(r);else{var a=o%i;n[a]=r}},t.prototype._complete=function(){var r=this.destination,n=this.count;if(n>0)for(var i=this.count>=this.total?this.total:this.count,o=this.ring,a=0;a<i;a++){var c=n++%i;r.next(o[c])}r.complete()},t}(G2e.Subscriber)});var SU=E(mM=>{"use strict";Object.defineProperty(mM,"__esModule",{value:!0});var exe=Mc(),txe=gu(),rxe=Wg(),nxe=F0(),ixe=Oc(),oxe=Vs();function sxe(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?txe.filter(function(i,o){return e(i,o,n)}):oxe.identity,rxe.takeLast(1),r?ixe.defaultIfEmpty(t):nxe.throwIfEmpty(function(){return new exe.EmptyError}))}}mM.last=sxe});var EU=E(Z0=>{"use strict";var axe=Z0&&Z0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Z0,"__esModule",{value:!0});var uxe=Ze();function fxe(e){return function(t){return t.lift(new cxe(e))}}Z0.mapTo=fxe;var cxe=function(){function e(t){this.value=t}return e.prototype.call=function(t,r){return r.subscribe(new lxe(t,this.value))},e}(),lxe=function(e){axe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.value=n,i}return t.prototype._next=function(r){this.destination.next(this.value)},t}(uxe.Subscriber)});var AU=E(Y0=>{"use strict";var hxe=Y0&&Y0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Y0,"__esModule",{value:!0});var dxe=Ze(),gM=o0();function pxe(){return function(t){return t.lift(new vxe)}}Y0.materialize=pxe;var vxe=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new mxe(t))},e}(),mxe=function(e){hxe(t,e);function t(r){return e.call(this,r)||this}return t.prototype._next=function(r){this.destination.next(gM.Notification.createNext(r))},t.prototype._error=function(r){var n=this.destination;n.next(gM.Notification.createError(r)),n.complete()},t.prototype._complete=function(){var r=this.destination;r.next(gM.Notification.createComplete()),r.complete()},t}(dxe.Subscriber)});var zg=E(J0=>{"use strict";var gxe=J0&&J0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(J0,"__esModule",{value:!0});var bxe=Ze();function yxe(e,t){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new _xe(e,t,r))}}J0.scan=yxe;var _xe=function(){function e(t,r,n){n===void 0&&(n=!1),this.accumulator=t,this.seed=r,this.hasSeed=n}return e.prototype.call=function(t,r){return r.subscribe(new wxe(t,this.accumulator,this.seed,this.hasSeed))},e}(),wxe=function(e){gxe(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.accumulator=n,a._seed=i,a.hasSeed=o,a.index=0,a}return Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),t.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},t.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(o){this.destination.error(o)}this.seed=i,this.destination.next(i)},t}(bxe.Subscriber)});var Q0=E(bM=>{"use strict";Object.defineProperty(bM,"__esModule",{value:!0});var OU=zg(),RU=Wg(),xxe=Oc(),IU=xg();function Mxe(e,t){return arguments.length>=2?function(n){return IU.pipe(OU.scan(e,t),RU.takeLast(1),xxe.defaultIfEmpty(t))(n)}:function(n){return IU.pipe(OU.scan(function(i,o,a){return e(i,o,a+1)}),RU.takeLast(1))(n)}}bM.reduce=Mxe});var CU=E(yM=>{"use strict";Object.defineProperty(yM,"__esModule",{value:!0});var Sxe=Q0();function Exe(e){var t=typeof e=="function"?function(r,n){return e(r,n)>0?r:n}:function(r,n){return r>n?r:n};return Sxe.reduce(t)}yM.max=Exe});var TU=E(_M=>{"use strict";Object.defineProperty(_M,"__esModule",{value:!0});var Axe=T6();function Oxe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){return r.lift.call(Axe.merge.apply(void 0,[r].concat(e)))}}_M.merge=Oxe});var PU=E(wM=>{"use strict";Object.defineProperty(wM,"__esModule",{value:!0});var kU=y0();function Rxe(e,t,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof t=="function"?kU.mergeMap(function(){return e},t,r):(typeof t=="number"&&(r=t),kU.mergeMap(function(){return e},r))}wM.mergeMapTo=Rxe});var LU=E(Mu=>{"use strict";var Ixe=Mu&&Mu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Mu,"__esModule",{value:!0});var xM=wr();function Cxe(e,t,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new NU(e,t,r))}}Mu.mergeScan=Cxe;var NU=function(){function e(t,r,n){this.accumulator=t,this.seed=r,this.concurrent=n}return e.prototype.call=function(t,r){return r.subscribe(new qU(t,this.accumulator,this.seed,this.concurrent))},e}();Mu.MergeScanOperator=NU;var qU=function(e){Ixe(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.accumulator=n,a.acc=i,a.concurrent=o,a.hasValue=!1,a.hasCompleted=!1,a.buffer=[],a.active=0,a.index=0,a}return t.prototype._next=function(r){if(this.active<this.concurrent){var n=this.index++,i=this.destination,o=void 0;try{var a=this.accumulator;o=a(this.acc,r,n)}catch(c){return i.error(c)}this.active++,this._innerSub(o)}else this.buffer.push(r)},t.prototype._innerSub=function(r){var n=new xM.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=xM.innerSubscribe(r,n);o!==n&&i.add(o)},t.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(r){var n=this.destination;this.acc=r,this.hasValue=!0,n.next(r)},t.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},t}(xM.SimpleOuterSubscriber);Mu.MergeScanSubscriber=qU});var BU=E(MM=>{"use strict";Object.defineProperty(MM,"__esModule",{value:!0});var Txe=Q0();function kxe(e){var t=typeof e=="function"?function(r,n){return e(r,n)<0?r:n}:function(r,n){return r<n?r:n};return Txe.reduce(t)}MM.min=kxe});var Su=E(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});var Pxe=R4();function Nxe(e,t){return function(n){var i;if(typeof e=="function"?i=e:i=function(){return e},typeof t=="function")return n.lift(new DU(i,t));var o=Object.create(n,Pxe.connectableObservableDescriptor);return o.source=n,o.subjectFactory=i,o}}Vg.multicast=Nxe;var DU=function(){function e(t,r){this.subjectFactory=t,this.selector=r}return e.prototype.call=function(t,r){var n=this.selector,i=this.subjectFactory(),o=n(i).subscribe(t);return o.add(r.subscribe(i)),o},e}();Vg.MulticastOperator=DU});var UU=E(Ic=>{"use strict";var qxe=Ic&&Ic.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ic,"__esModule",{value:!0});var Lxe=Ki(),jU=Pn(),SM=wr();function Bxe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1&&jU.isArray(e[0])&&(e=e[0]),function(r){return r.lift(new FU(e))}}Ic.onErrorResumeNext=Bxe;function Dxe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0;return e.length===1&&jU.isArray(e[0])&&(e=e[0]),r=e.shift(),Lxe.from(r).lift(new FU(e))}Ic.onErrorResumeNextStatic=Dxe;var FU=function(){function e(t){this.nextSources=t}return e.prototype.call=function(t,r){return r.subscribe(new jxe(t,this.nextSources))},e}(),jxe=function(e){qxe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.destination=r,i.nextSources=n,i}return t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(r){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var r=this.nextSources.shift();if(r){var n=new SM.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=SM.innerSubscribe(r,n);o!==n&&i.add(o)}else this.destination.complete()},t}(SM.SimpleOuterSubscriber)});var HU=E(X0=>{"use strict";var Fxe=X0&&X0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(X0,"__esModule",{value:!0});var Uxe=Ze();function Hxe(){return function(e){return e.lift(new Wxe)}}X0.pairwise=Hxe;var Wxe=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new zxe(t))},e}(),zxe=function(e){Fxe(t,e);function t(r){var n=e.call(this,r)||this;return n.hasPrev=!1,n}return t.prototype._next=function(r){var n;this.hasPrev?n=[this.prev,r]:this.hasPrev=!0,this.prev=r,n&&this.destination.next(n)},t}(Uxe.Subscriber)});var zU=E(EM=>{"use strict";Object.defineProperty(EM,"__esModule",{value:!0});var Vxe=L6(),WU=gu();function $xe(e,t){return function(r){return[WU.filter(e,t)(r),WU.filter(Vxe.not(e,t))(r)]}}EM.partition=$xe});var VU=E(AM=>{"use strict";Object.defineProperty(AM,"__esModule",{value:!0});var Kxe=ni();function Gxe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(r===0)throw new Error("list of properties cannot be empty.");return function(n){return Kxe.map(Zxe(e,r))(n)}}AM.pluck=Gxe;function Zxe(e,t){var r=function(n){for(var i=n,o=0;o<t;o++){var a=i?.[e[o]];if(a!==void 0)i=a;else return}return i};return r}});var GU=E(OM=>{"use strict";Object.defineProperty(OM,"__esModule",{value:!0});var $U=wn(),KU=Su();function Yxe(e){return e?KU.multicast(function(){return new $U.Subject},e):KU.multicast(new $U.Subject)}OM.publish=Yxe});var ZU=E(RM=>{"use strict";Object.defineProperty(RM,"__esModule",{value:!0});var Jxe=T4(),Qxe=Su();function Xxe(e){return function(t){return Qxe.multicast(new Jxe.BehaviorSubject(e))(t)}}RM.publishBehavior=Xxe});var YU=E(IM=>{"use strict";Object.defineProperty(IM,"__esModule",{value:!0});var e3e=u0(),t3e=Su();function r3e(){return function(e){return t3e.multicast(new e3e.AsyncSubject)(e)}}IM.publishLast=r3e});var JU=E(CM=>{"use strict";Object.defineProperty(CM,"__esModule",{value:!0});var n3e=Rg(),i3e=Su();function o3e(e,t,r,n){r&&typeof r!="function"&&(n=r);var i=typeof r=="function"?r:void 0,o=new n3e.ReplaySubject(e,t,n);return function(a){return i3e.multicast(function(){return o},i)(a)}}CM.publishReplay=o3e});var QU=E(TM=>{"use strict";Object.defineProperty(TM,"__esModule",{value:!0});var s3e=Pn(),a3e=D6();function u3e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.length===1&&s3e.isArray(e[0])&&(e=e[0]),n.lift.call(a3e.race.apply(void 0,[n].concat(e)))}}TM.race=u3e});var eH=E(ed=>{"use strict";var f3e=ed&&ed.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ed,"__esModule",{value:!0});var c3e=Ze(),l3e=Vi();function h3e(e){return e===void 0&&(e=-1),function(t){return e===0?l3e.empty():e<0?t.lift(new XU(-1,t)):t.lift(new XU(e-1,t))}}ed.repeat=h3e;var XU=function(){function e(t,r){this.count=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new d3e(t,this.count,this.source))},e}(),d3e=function(e){f3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.count=n,o.source=i,o}return t.prototype.complete=function(){if(!this.isStopped){var r=this,n=r.source,i=r.count;if(i===0)return e.prototype.complete.call(this);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},t}(c3e.Subscriber)});var tH=E(td=>{"use strict";var p3e=td&&td.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(td,"__esModule",{value:!0});var v3e=wn(),kM=wr();function m3e(e){return function(t){return t.lift(new g3e(e))}}td.repeatWhen=m3e;var g3e=function(){function e(t){this.notifier=t}return e.prototype.call=function(t,r){return r.subscribe(new b3e(t,this.notifier,r))},e}(),b3e=function(e){p3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.notifier=n,o.source=i,o.sourceIsBeingSubscribedTo=!0,o}return t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},t.prototype.subscribeToRetries=function(){this.notifications=new v3e.Subject;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return e.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=kM.innerSubscribe(r,new kM.SimpleInnerSubscriber(this))},t}(kM.SimpleOuterSubscriber)});var rH=E(rd=>{"use strict";var y3e=rd&&rd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(rd,"__esModule",{value:!0});var _3e=Ze();function w3e(e){return e===void 0&&(e=-1),function(t){return t.lift(new x3e(e,t))}}rd.retry=w3e;var x3e=function(){function e(t,r){this.count=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new M3e(t,this.count,this.source))},e}(),M3e=function(e){y3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.count=n,o.source=i,o}return t.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,o=n.count;if(o===0)return e.prototype.error.call(this,r);o>-1&&(this.count=o-1),i.subscribe(this._unsubscribeAndRecycle())}},t}(_3e.Subscriber)});var nH=E(nd=>{"use strict";var S3e=nd&&nd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(nd,"__esModule",{value:!0});var E3e=wn(),PM=wr();function A3e(e){return function(t){return t.lift(new O3e(e,t))}}nd.retryWhen=A3e;var O3e=function(){function e(t,r){this.notifier=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new R3e(t,this.notifier,this.source))},e}(),R3e=function(e){S3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.notifier=n,o.source=i,o}return t.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,o=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new E3e.Subject;try{var a=this.notifier;i=a(n)}catch(c){return e.prototype.error.call(this,c)}o=PM.innerSubscribe(i,new PM.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=o,n.next(r)}},t.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},t}(PM.SimpleOuterSubscriber)});var iH=E(id=>{"use strict";var I3e=id&&id.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(id,"__esModule",{value:!0});var NM=wr();function C3e(e){return function(t){return t.lift(new T3e(e))}}id.sample=C3e;var T3e=function(){function e(t){this.notifier=t}return e.prototype.call=function(t,r){var n=new k3e(t),i=r.subscribe(n);return i.add(NM.innerSubscribe(this.notifier,new NM.SimpleInnerSubscriber(n))),i},e}(),k3e=function(e){I3e(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.hasValue=!1,r}return t.prototype._next=function(r){this.value=r,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(NM.SimpleOuterSubscriber)});var oH=E(od=>{"use strict";var P3e=od&&od.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(od,"__esModule",{value:!0});var N3e=Ze(),q3e=Nn();function L3e(e,t){return t===void 0&&(t=q3e.async),function(r){return r.lift(new B3e(e,t))}}od.sampleTime=L3e;var B3e=function(){function e(t,r){this.period=t,this.scheduler=r}return e.prototype.call=function(t,r){return r.subscribe(new D3e(t,this.period,this.scheduler))},e}(),D3e=function(e){P3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.period=n,o.scheduler=i,o.hasValue=!1,o.add(i.schedule(j3e,n,{subscriber:o,period:n})),o}return t.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(N3e.Subscriber);function j3e(e){var t=e.subscriber,r=e.period;t.notifyNext(),this.schedule(e,r)}});var cH=E(Eu=>{"use strict";var sH=Eu&&Eu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Eu,"__esModule",{value:!0});var aH=Ze();function F3e(e,t){return function(r){return r.lift(new uH(e,t))}}Eu.sequenceEqual=F3e;var uH=function(){function e(t,r){this.compareTo=t,this.comparator=r}return e.prototype.call=function(t,r){return r.subscribe(new fH(t,this.compareTo,this.comparator))},e}();Eu.SequenceEqualOperator=uH;var fH=function(e){sH(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.compareTo=n,o.comparator=i,o._a=[],o._b=[],o._oneComplete=!1,o.destination.add(n.subscribe(new U3e(r,o))),o}return t.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,o=r.comparator;n.length>0&&i.length>0;){var a=n.shift(),c=i.shift(),v=!1;try{v=o?o(a,c):a===c}catch(y){this.destination.error(y)}v||this.emit(!1)}},t.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},t.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},t}(aH.Subscriber);Eu.SequenceEqualSubscriber=fH;var U3e=function(e){sH(t,e);function t(r,n){var i=e.call(this,r)||this;return i.parent=n,i}return t.prototype._next=function(r){this.parent.nextB(r)},t.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(aH.Subscriber)});var lH=E(qM=>{"use strict";Object.defineProperty(qM,"__esModule",{value:!0});var H3e=Su(),W3e=Sg(),z3e=wn();function V3e(){return new z3e.Subject}function $3e(){return function(e){return W3e.refCount()(H3e.multicast(V3e)(e))}}qM.share=$3e});var hH=E(LM=>{"use strict";Object.defineProperty(LM,"__esModule",{value:!0});var K3e=Rg();function G3e(e,t,r){var n;return e&&typeof e=="object"?n=e:n={bufferSize:e,windowTime:t,refCount:!1,scheduler:r},function(i){return i.lift(Z3e(n))}}LM.shareReplay=G3e;function Z3e(e){var t=e.bufferSize,r=t===void 0?Number.POSITIVE_INFINITY:t,n=e.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,o=e.refCount,a=e.scheduler,c,v=0,y,w=!1,M=!1;return function(R){v++;var C;!c||w?(w=!1,c=new K3e.ReplaySubject(r,i,a),C=c.subscribe(this),y=R.subscribe({next:function(B){c.next(B)},error:function(B){w=!0,c.error(B)},complete:function(){M=!0,y=void 0,c.complete()}}),M&&(y=void 0)):C=c.subscribe(this),this.add(function(){v--,C.unsubscribe(),C=void 0,y&&!M&&o&&v===0&&(y.unsubscribe(),y=void 0,c=void 0)})}}});var dH=E(sd=>{"use strict";var Y3e=sd&&sd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(sd,"__esModule",{value:!0});var J3e=Ze(),Q3e=Mc();function X3e(e){return function(t){return t.lift(new e4e(e,t))}}sd.single=X3e;var e4e=function(){function e(t,r){this.predicate=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new t4e(t,this.predicate,this.source))},e}(),t4e=function(e){Y3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.predicate=n,o.source=i,o.seenValue=!1,o.index=0,o}return t.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},t.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},t.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},t.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new Q3e.EmptyError)},t}(J3e.Subscriber)});var pH=E(ad=>{"use strict";var r4e=ad&&ad.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ad,"__esModule",{value:!0});var n4e=Ze();function i4e(e){return function(t){return t.lift(new o4e(e))}}ad.skip=i4e;var o4e=function(){function e(t){this.total=t}return e.prototype.call=function(t,r){return r.subscribe(new s4e(t,this.total))},e}(),s4e=function(e){r4e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.total=n,i.count=0,i}return t.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},t}(n4e.Subscriber)});var mH=E(ud=>{"use strict";var a4e=ud&&ud.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ud,"__esModule",{value:!0});var vH=Ze(),u4e=xc();function f4e(e){return function(t){return t.lift(new c4e(e))}}ud.skipLast=f4e;var c4e=function(){function e(t){if(this._skipCount=t,this._skipCount<0)throw new u4e.ArgumentOutOfRangeError}return e.prototype.call=function(t,r){return this._skipCount===0?r.subscribe(new vH.Subscriber(t)):r.subscribe(new l4e(t,this._skipCount))},e}(),l4e=function(e){a4e(t,e);function t(r,n){var i=e.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return t.prototype._next=function(r){var n=this._skipCount,i=this._count++;if(i<n)this._ring[i]=r;else{var o=i%n,a=this._ring,c=a[o];a[o]=r,this.destination.next(c)}},t}(vH.Subscriber)});var gH=E(fd=>{"use strict";var h4e=fd&&fd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(fd,"__esModule",{value:!0});var BM=wr();function d4e(e){return function(t){return t.lift(new p4e(e))}}fd.skipUntil=d4e;var p4e=function(){function e(t){this.notifier=t}return e.prototype.call=function(t,r){return r.subscribe(new v4e(t,this.notifier))},e}(),v4e=function(e){h4e(t,e);function t(r,n){var i=e.call(this,r)||this;i.hasValue=!1;var o=new BM.SimpleInnerSubscriber(i);i.add(o),i.innerSubscription=o;var a=BM.innerSubscribe(n,o);return a!==o&&(i.add(a),i.innerSubscription=a),i}return t.prototype._next=function(r){this.hasValue&&e.prototype._next.call(this,r)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(BM.SimpleOuterSubscriber)});var bH=E(cd=>{"use strict";var m4e=cd&&cd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(cd,"__esModule",{value:!0});var g4e=Ze();function b4e(e){return function(t){return t.lift(new y4e(e))}}cd.skipWhile=b4e;var y4e=function(){function e(t){this.predicate=t}return e.prototype.call=function(t,r){return r.subscribe(new _4e(t,this.predicate))},e}(),_4e=function(e){m4e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.predicate=n,i.skipping=!0,i.index=0,i}return t.prototype._next=function(r){var n=this.destination;this.skipping&&this.tryCallPredicate(r),this.skipping||n.next(r)},t.prototype.tryCallPredicate=function(r){try{var n=this.predicate(r,this.index++);this.skipping=Boolean(n)}catch(i){this.destination.error(i)}},t}(g4e.Subscriber)});var _H=E(DM=>{"use strict";Object.defineProperty(DM,"__esModule",{value:!0});var yH=_0(),w4e=$i();function x4e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return w4e.isScheduler(r)?(e.pop(),function(n){return yH.concat(e,n,r)}):function(n){return yH.concat(e,n)}}DM.startWith=x4e});var wH=E(ld=>{"use strict";var M4e=ld&&ld.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ld,"__esModule",{value:!0});var S4e=Ct(),jM=z4(),E4e=w0(),A4e=function(e){M4e(t,e);function t(r,n,i){n===void 0&&(n=0),i===void 0&&(i=jM.asap);var o=e.call(this)||this;return o.source=r,o.delayTime=n,o.scheduler=i,(!E4e.isNumeric(n)||n<0)&&(o.delayTime=0),(!i||typeof i.schedule!="function")&&(o.scheduler=jM.asap),o}return t.create=function(r,n,i){return n===void 0&&(n=0),i===void 0&&(i=jM.asap),new t(r,n,i)},t.dispatch=function(r){var n=r.source,i=r.subscriber;return this.add(n.subscribe(i))},t.prototype._subscribe=function(r){var n=this.delayTime,i=this.source,o=this.scheduler;return o.schedule(t.dispatch,n,{source:i,subscriber:r})},t}(S4e.Observable);ld.SubscribeOnObservable=A4e});var xH=E(FM=>{"use strict";Object.defineProperty(FM,"__esModule",{value:!0});var O4e=wH();function R4e(e,t){return t===void 0&&(t=0),function(n){return n.lift(new I4e(e,t))}}FM.subscribeOn=R4e;var I4e=function(){function e(t,r){this.scheduler=t,this.delay=r}return e.prototype.call=function(t,r){return new O4e.SubscribeOnObservable(r,this.delay,this.scheduler).subscribe(t)},e}()});var $g=E(hd=>{"use strict";var C4e=hd&&hd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(hd,"__esModule",{value:!0});var T4e=ni(),k4e=Ki(),UM=wr();function MH(e,t){return typeof t=="function"?function(r){return r.pipe(MH(function(n,i){return k4e.from(e(n,i)).pipe(T4e.map(function(o,a){return t(n,o,i,a)}))}))}:function(r){return r.lift(new P4e(e))}}hd.switchMap=MH;var P4e=function(){function e(t){this.project=t}return e.prototype.call=function(t,r){return r.subscribe(new N4e(t,this.project))},e}(),N4e=function(e){C4e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.project=n,i.index=0,i}return t.prototype._next=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(o){this.destination.error(o);return}this._innerSub(n)},t.prototype._innerSub=function(r){var n=this.innerSubscription;n&&n.unsubscribe();var i=new UM.SimpleInnerSubscriber(this),o=this.destination;o.add(i),this.innerSubscription=UM.innerSubscribe(r,i),this.innerSubscription!==i&&o.add(this.innerSubscription)},t.prototype._complete=function(){var r=this.innerSubscription;(!r||r.closed)&&e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(r){this.destination.next(r)},t}(UM.SimpleOuterSubscriber)});var SH=E(HM=>{"use strict";Object.defineProperty(HM,"__esModule",{value:!0});var q4e=$g(),L4e=Vs();function B4e(){return q4e.switchMap(L4e.identity)}HM.switchAll=B4e});var AH=E(WM=>{"use strict";Object.defineProperty(WM,"__esModule",{value:!0});var EH=$g();function D4e(e,t){return t?EH.switchMap(function(){return e},t):EH.switchMap(function(){return e})}WM.switchMapTo=D4e});var OH=E(dd=>{"use strict";var j4e=dd&&dd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(dd,"__esModule",{value:!0});var zM=wr();function F4e(e){return function(t){return t.lift(new U4e(e))}}dd.takeUntil=F4e;var U4e=function(){function e(t){this.notifier=t}return e.prototype.call=function(t,r){var n=new H4e(t),i=zM.innerSubscribe(this.notifier,new zM.SimpleInnerSubscriber(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},e}(),H4e=function(e){j4e(t,e);function t(r){var n=e.call(this,r)||this;return n.seenValue=!1,n}return t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(zM.SimpleOuterSubscriber)});var RH=E(pd=>{"use strict";var W4e=pd&&pd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(pd,"__esModule",{value:!0});var z4e=Ze();function V4e(e,t){return t===void 0&&(t=!1),function(r){return r.lift(new $4e(e,t))}}pd.takeWhile=V4e;var $4e=function(){function e(t,r){this.predicate=t,this.inclusive=r}return e.prototype.call=function(t,r){return r.subscribe(new K4e(t,this.predicate,this.inclusive))},e}(),K4e=function(e){W4e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.predicate=n,o.inclusive=i,o.index=0,o}return t.prototype._next=function(r){var n=this.destination,i;try{i=this.predicate(r,this.index++)}catch(o){n.error(o);return}this.nextOrComplete(r,i)},t.prototype.nextOrComplete=function(r,n){var i=this.destination;Boolean(n)?i.next(r):(this.inclusive&&i.next(r),i.complete())},t}(z4e.Subscriber)});var IH=E(vd=>{"use strict";var G4e=vd&&vd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(vd,"__esModule",{value:!0});var Z4e=Ze(),Ys=Tg(),Y4e=dc();function J4e(e,t,r){return function(i){return i.lift(new Q4e(e,t,r))}}vd.tap=J4e;var Q4e=function(){function e(t,r,n){this.nextOrObserver=t,this.error=r,this.complete=n}return e.prototype.call=function(t,r){return r.subscribe(new X4e(t,this.nextOrObserver,this.error,this.complete))},e}(),X4e=function(e){G4e(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a._tapNext=Ys.noop,a._tapError=Ys.noop,a._tapComplete=Ys.noop,a._tapError=i||Ys.noop,a._tapComplete=o||Ys.noop,Y4e.isFunction(n)?(a._context=a,a._tapNext=n):n&&(a._context=n,a._tapNext=n.next||Ys.noop,a._tapError=n.error||Ys.noop,a._tapComplete=n.complete||Ys.noop),a}return t.prototype._next=function(r){try{this._tapNext.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.next(r)},t.prototype._error=function(r){try{this._tapError.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.error(r)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(r){this.destination.error(r);return}return this.destination.complete()},t}(Z4e.Subscriber)});var $M=E(Au=>{"use strict";var e6e=Au&&Au.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Au,"__esModule",{value:!0});var VM=wr();Au.defaultThrottleConfig={leading:!0,trailing:!1};function t6e(e,t){return t===void 0&&(t=Au.defaultThrottleConfig),function(r){return r.lift(new r6e(e,!!t.leading,!!t.trailing))}}Au.throttle=t6e;var r6e=function(){function e(t,r,n){this.durationSelector=t,this.leading=r,this.trailing=n}return e.prototype.call=function(t,r){return r.subscribe(new n6e(t,this.durationSelector,this.leading,this.trailing))},e}(),n6e=function(e){e6e(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.destination=r,a.durationSelector=n,a._leading=i,a._trailing=o,a._hasValue=!1,a}return t.prototype._next=function(r){this._hasValue=!0,this._sendValue=r,this._throttled||(this._leading?this.send():this.throttle(r))},t.prototype.send=function(){var r=this,n=r._hasValue,i=r._sendValue;n&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(r){var n=this.tryDurationSelector(r);n&&this.add(this._throttled=VM.innerSubscribe(n,new VM.SimpleInnerSubscriber(this)))},t.prototype.tryDurationSelector=function(r){try{return this.durationSelector(r)}catch(n){return this.destination.error(n),null}},t.prototype.throttlingDone=function(){var r=this,n=r._throttled,i=r._trailing;n&&n.unsubscribe(),this._throttled=void 0,i&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(VM.SimpleOuterSubscriber)});var CH=E(md=>{"use strict";var i6e=md&&md.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(md,"__esModule",{value:!0});var o6e=Ze(),s6e=Nn(),a6e=$M();function u6e(e,t,r){return t===void 0&&(t=s6e.async),r===void 0&&(r=a6e.defaultThrottleConfig),function(n){return n.lift(new f6e(e,t,r.leading,r.trailing))}}md.throttleTime=u6e;var f6e=function(){function e(t,r,n,i){this.duration=t,this.scheduler=r,this.leading=n,this.trailing=i}return e.prototype.call=function(t,r){return r.subscribe(new c6e(t,this.duration,this.scheduler,this.leading,this.trailing))},e}(),c6e=function(e){i6e(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;return c.duration=n,c.scheduler=i,c.leading=o,c.trailing=a,c._hasTrailingValue=!1,c._trailingValue=null,c}return t.prototype._next=function(r){this.throttled?this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(l6e,this.duration,{subscriber:this})),this.leading?this.destination.next(r):this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var r=this.throttled;r&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),r.unsubscribe(),this.remove(r),this.throttled=null)},t}(o6e.Subscriber);function l6e(e){var t=e.subscriber;t.clearThrottle()}});var kH=E(Kg=>{"use strict";Object.defineProperty(Kg,"__esModule",{value:!0});var h6e=Nn(),d6e=zg(),p6e=Lg(),v6e=ni();function m6e(e){return e===void 0&&(e=h6e.async),function(t){return p6e.defer(function(){return t.pipe(d6e.scan(function(r,n){var i=r.current;return{value:n,current:e.now(),last:i}},{current:e.now(),value:void 0,last:void 0}),v6e.map(function(r){var n=r.current,i=r.last,o=r.value;return new TH(o,n-i)}))})}}Kg.timeInterval=m6e;var TH=function(){function e(t,r){this.value=t,this.interval=r}return e}();Kg.TimeInterval=TH});var GM=E(gd=>{"use strict";var g6e=gd&&gd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(gd,"__esModule",{value:!0});var b6e=Nn(),y6e=nM(),KM=wr();function _6e(e,t,r){return r===void 0&&(r=b6e.async),function(n){var i=y6e.isDate(e),o=i?+e-r.now():Math.abs(e);return n.lift(new w6e(o,i,t,r))}}gd.timeoutWith=_6e;var w6e=function(){function e(t,r,n,i){this.waitFor=t,this.absoluteTimeout=r,this.withObservable=n,this.scheduler=i}return e.prototype.call=function(t,r){return r.subscribe(new x6e(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),x6e=function(e){g6e(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;return c.absoluteTimeout=n,c.waitFor=i,c.withObservable=o,c.scheduler=a,c.scheduleTimeout(),c}return t.dispatchTimeout=function(r){var n=r.withObservable;r._unsubscribeAndRecycle(),r.add(KM.innerSubscribe(n,new KM.SimpleInnerSubscriber(r)))},t.prototype.scheduleTimeout=function(){var r=this.action;r?this.action=r.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(r){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,r)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(KM.SimpleOuterSubscriber)});var PH=E(ZM=>{"use strict";Object.defineProperty(ZM,"__esModule",{value:!0});var M6e=Nn(),S6e=Y4(),E6e=GM(),A6e=Og();function O6e(e,t){return t===void 0&&(t=M6e.async),E6e.timeoutWith(e,A6e.throwError(new S6e.TimeoutError),t)}ZM.timeout=O6e});var qH=E(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});var R6e=Nn(),I6e=ni();function C6e(e){return e===void 0&&(e=R6e.async),I6e.map(function(t){return new NH(t,e.now())})}Gg.timestamp=C6e;var NH=function(){function e(t,r){this.value=t,this.timestamp=r}return e}();Gg.Timestamp=NH});var LH=E(YM=>{"use strict";Object.defineProperty(YM,"__esModule",{value:!0});var T6e=Q0();function k6e(e,t,r){return r===0?[t]:(e.push(t),e)}function P6e(){return T6e.reduce(k6e,[])}YM.toArray=P6e});var DH=E(bd=>{"use strict";var N6e=bd&&bd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(bd,"__esModule",{value:!0});var BH=wn(),JM=wr();function q6e(e){return function(r){return r.lift(new L6e(e))}}bd.window=q6e;var L6e=function(){function e(t){this.windowBoundaries=t}return e.prototype.call=function(t,r){var n=new B6e(t),i=r.subscribe(n);return i.closed||n.add(JM.innerSubscribe(this.windowBoundaries,new JM.SimpleInnerSubscriber(n))),i},e}(),B6e=function(e){N6e(t,e);function t(r){var n=e.call(this,r)||this;return n.window=new BH.Subject,r.next(n.window),n}return t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(r){this._error(r)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(r){this.window.next(r)},t.prototype._error=function(r){this.window.error(r),this.destination.error(r)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var r=this.window;r&&r.complete();var n=this.destination,i=this.window=new BH.Subject;n.next(i)},t}(JM.SimpleOuterSubscriber)});var FH=E(yd=>{"use strict";var D6e=yd&&yd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(yd,"__esModule",{value:!0});var j6e=Ze(),jH=wn();function F6e(e,t){return t===void 0&&(t=0),function(n){return n.lift(new U6e(e,t))}}yd.windowCount=F6e;var U6e=function(){function e(t,r){this.windowSize=t,this.startWindowEvery=r}return e.prototype.call=function(t,r){return r.subscribe(new H6e(t,this.windowSize,this.startWindowEvery))},e}(),H6e=function(e){D6e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.destination=r,o.windowSize=n,o.startWindowEvery=i,o.windows=[new jH.Subject],o.count=0,r.next(o.windows[0]),o}return t.prototype._next=function(r){for(var n=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,o=this.windowSize,a=this.windows,c=a.length,v=0;v<c&&!this.closed;v++)a[v].next(r);var y=this.count-o+1;if(y>=0&&y%n===0&&!this.closed&&a.shift().complete(),++this.count%n===0&&!this.closed){var w=new jH.Subject;a.push(w),i.next(w)}},t.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},t.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(j6e.Subscriber)});var zH=E(_d=>{"use strict";var HH=_d&&_d.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(_d,"__esModule",{value:!0});var W6e=wn(),z6e=Nn(),V6e=Ze(),UH=w0(),QM=$i();function $6e(e){var t=z6e.async,r=null,n=Number.POSITIVE_INFINITY;return QM.isScheduler(arguments[3])&&(t=arguments[3]),QM.isScheduler(arguments[2])?t=arguments[2]:UH.isNumeric(arguments[2])&&(n=Number(arguments[2])),QM.isScheduler(arguments[1])?t=arguments[1]:UH.isNumeric(arguments[1])&&(r=Number(arguments[1])),function(o){return o.lift(new K6e(e,r,n,t))}}_d.windowTime=$6e;var K6e=function(){function e(t,r,n,i){this.windowTimeSpan=t,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return e.prototype.call=function(t,r){return r.subscribe(new Z6e(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),G6e=function(e){HH(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return t.prototype.next=function(r){this._numberOfNextedValues++,e.prototype.next.call(this,r)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(W6e.Subject),Z6e=function(e){HH(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;c.destination=r,c.windowTimeSpan=n,c.windowCreationInterval=i,c.maxWindowSize=o,c.scheduler=a,c.windows=[];var v=c.openWindow();if(i!==null&&i>=0){var y={subscriber:c,window:v,context:null},w={windowTimeSpan:n,windowCreationInterval:i,subscriber:c,scheduler:a};c.add(a.schedule(WH,n,y)),c.add(a.schedule(J6e,i,w))}else{var M={subscriber:c,window:v,windowTimeSpan:n};c.add(a.schedule(Y6e,n,M))}return c}return t.prototype._next=function(r){for(var n=this.windows,i=n.length,o=0;o<i;o++){var a=n[o];a.closed||(a.next(r),a.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(a))}},t.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},t.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},t.prototype.openWindow=function(){var r=new G6e;this.windows.push(r);var n=this.destination;return n.next(r),r},t.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},t}(V6e.Subscriber);function Y6e(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&t.closeWindow(n),e.window=t.openWindow(),this.schedule(e,r)}function J6e(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,o=r.openWindow(),a=this,c={action:a,subscription:null},v={subscriber:r,window:o,context:c};c.subscription=n.schedule(WH,t,v),a.add(c.subscription),a.schedule(e,i)}function WH(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}});var $H=E(wd=>{"use strict";var Q6e=wd&&wd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(wd,"__esModule",{value:!0});var X6e=wn(),eMe=Fr(),tMe=Ks(),VH=Gs();function rMe(e,t){return function(r){return r.lift(new nMe(e,t))}}wd.windowToggle=rMe;var nMe=function(){function e(t,r){this.openings=t,this.closingSelector=r}return e.prototype.call=function(t,r){return r.subscribe(new iMe(t,this.openings,this.closingSelector))},e}(),iMe=function(e){Q6e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.openings=n,o.closingSelector=i,o.contexts=[],o.add(o.openSubscription=VH.subscribeToResult(o,n,n)),o}return t.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,o=0;o<i;o++)n[o].window.next(r)},t.prototype._error=function(r){var n=this.contexts;if(this.contexts=null,n)for(var i=n.length,o=-1;++o<i;){var a=n[o];a.window.error(r),a.subscription.unsubscribe()}e.prototype._error.call(this,r)},t.prototype._complete=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.complete(),o.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.unsubscribe(),o.subscription.unsubscribe()}},t.prototype.notifyNext=function(r,n,i,o,a){if(r===this.openings){var c=void 0;try{var v=this.closingSelector;c=v(n)}catch(R){return this.error(R)}var y=new X6e.Subject,w=new eMe.Subscription,M={window:y,subscription:w};this.contexts.push(M);var S=VH.subscribeToResult(this,c,M);S.closed?this.closeWindow(this.contexts.length-1):(S.context=M,w.add(S)),this.destination.next(y)}else this.closeWindow(this.contexts.indexOf(r))},t.prototype.notifyError=function(r){this.error(r)},t.prototype.notifyComplete=function(r){r!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(r.context))},t.prototype.closeWindow=function(r){if(r!==-1){var n=this.contexts,i=n[r],o=i.window,a=i.subscription;n.splice(r,1),o.complete(),a.unsubscribe()}},t}(tMe.OuterSubscriber)});var KH=E(xd=>{"use strict";var oMe=xd&&xd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(xd,"__esModule",{value:!0});var sMe=wn(),aMe=Ks(),uMe=Gs();function fMe(e){return function(r){return r.lift(new cMe(e))}}xd.windowWhen=fMe;var cMe=function(){function e(t){this.closingSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new lMe(t,this.closingSelector))},e}(),lMe=function(e){oMe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.destination=r,i.closingSelector=n,i.openWindow(),i}return t.prototype.notifyNext=function(r,n,i,o,a){this.openWindow(a)},t.prototype.notifyError=function(r){this._error(r)},t.prototype.notifyComplete=function(r){this.openWindow(r)},t.prototype._next=function(r){this.window.next(r)},t.prototype._error=function(r){this.window.error(r),this.destination.error(r),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(r){r===void 0&&(r=null),r&&(this.remove(r),r.unsubscribe());var n=this.window;n&&n.complete();var i=this.window=new sMe.Subject;this.destination.next(i);var o;try{var a=this.closingSelector;o=a()}catch(c){this.destination.error(c),this.window.error(c);return}this.add(this.closingNotification=uMe.subscribeToResult(this,o))},t}(aMe.OuterSubscriber)});var GH=E(Md=>{"use strict";var hMe=Md&&Md.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Md,"__esModule",{value:!0});var dMe=Ks(),pMe=Gs();function vMe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){var n;typeof e[e.length-1]=="function"&&(n=e.pop());var i=e;return r.lift(new mMe(i,n))}}Md.withLatestFrom=vMe;var mMe=function(){function e(t,r){this.observables=t,this.project=r}return e.prototype.call=function(t,r){return r.subscribe(new gMe(t,this.observables,this.project))},e}(),gMe=function(e){hMe(t,e);function t(r,n,i){var o=e.call(this,r)||this;o.observables=n,o.project=i,o.toRespond=[];var a=n.length;o.values=new Array(a);for(var c=0;c<a;c++)o.toRespond.push(c);for(var c=0;c<a;c++){var v=n[c];o.add(pMe.subscribeToResult(o,v,void 0,c))}return o}return t.prototype.notifyNext=function(r,n,i){this.values[i]=n;var o=this.toRespond;if(o.length>0){var a=o.indexOf(i);a!==-1&&o.splice(a,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},t.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},t}(dMe.OuterSubscriber)});var ZH=E(XM=>{"use strict";Object.defineProperty(XM,"__esModule",{value:!0});var bMe=Ug();function yMe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return n.lift.call(bMe.zip.apply(void 0,[n].concat(e)))}}XM.zip=yMe});var YH=E(e5=>{"use strict";Object.defineProperty(e5,"__esModule",{value:!0});var _Me=Ug();function wMe(e){return function(t){return t.lift(new _Me.ZipOperator(e))}}e5.zipAll=wMe});var Sd=E(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});var xMe=z6();we.audit=xMe.audit;var MMe=NF();we.auditTime=MMe.auditTime;var SMe=qF();we.buffer=SMe.buffer;var EMe=DF();we.bufferCount=EMe.bufferCount;var AMe=UF();we.bufferTime=AMe.bufferTime;var OMe=WF();we.bufferToggle=OMe.bufferToggle;var RMe=zF();we.bufferWhen=RMe.bufferWhen;var IMe=VF();we.catchError=IMe.catchError;var CMe=$F();we.combineAll=CMe.combineAll;var TMe=KF();we.combineLatest=TMe.combineLatest;var kMe=GF();we.concat=kMe.concat;var PMe=_6();we.concatAll=PMe.concatAll;var NMe=X6();we.concatMap=NMe.concatMap;var qMe=ZF();we.concatMapTo=qMe.concatMapTo;var LMe=YF();we.count=LMe.count;var BMe=JF();we.debounce=BMe.debounce;var DMe=QF();we.debounceTime=DMe.debounceTime;var jMe=Oc();we.defaultIfEmpty=jMe.defaultIfEmpty;var FMe=eU();we.delay=FMe.delay;var UMe=rU();we.delayWhen=UMe.delayWhen;var HMe=nU();we.dematerialize=HMe.dematerialize;var WMe=oU();we.distinct=WMe.distinct;var zMe=sM();we.distinctUntilChanged=zMe.distinctUntilChanged;var VMe=sU();we.distinctUntilKeyChanged=VMe.distinctUntilKeyChanged;var $Me=uU();we.elementAt=$Me.elementAt;var KMe=fU();we.endWith=KMe.endWith;var GMe=cU();we.every=GMe.every;var ZMe=lU();we.exhaust=ZMe.exhaust;var YMe=dU();we.exhaustMap=YMe.exhaustMap;var JMe=mU();we.expand=JMe.expand;var QMe=gu();we.filter=QMe.filter;var XMe=gU();we.finalize=XMe.finalize;var e5e=dM();we.find=e5e.find;var t5e=_U();we.findIndex=t5e.findIndex;var r5e=wU();we.first=r5e.first;var n5e=C4();we.groupBy=n5e.groupBy;var i5e=xU();we.ignoreElements=i5e.ignoreElements;var o5e=MU();we.isEmpty=o5e.isEmpty;var s5e=SU();we.last=s5e.last;var a5e=ni();we.map=a5e.map;var u5e=EU();we.mapTo=u5e.mapTo;var f5e=AU();we.materialize=f5e.materialize;var c5e=CU();we.max=c5e.max;var l5e=TU();we.merge=l5e.merge;var h5e=qg();we.mergeAll=h5e.mergeAll;var JH=y0();we.mergeMap=JH.mergeMap;we.flatMap=JH.flatMap;var d5e=PU();we.mergeMapTo=d5e.mergeMapTo;var p5e=LU();we.mergeScan=p5e.mergeScan;var v5e=BU();we.min=v5e.min;var m5e=Su();we.multicast=m5e.multicast;var g5e=W4();we.observeOn=g5e.observeOn;var b5e=UU();we.onErrorResumeNext=b5e.onErrorResumeNext;var y5e=HU();we.pairwise=y5e.pairwise;var _5e=zU();we.partition=_5e.partition;var w5e=VU();we.pluck=w5e.pluck;var x5e=GU();we.publish=x5e.publish;var M5e=ZU();we.publishBehavior=M5e.publishBehavior;var S5e=YU();we.publishLast=S5e.publishLast;var E5e=JU();we.publishReplay=E5e.publishReplay;var A5e=QU();we.race=A5e.race;var O5e=Q0();we.reduce=O5e.reduce;var R5e=eH();we.repeat=R5e.repeat;var I5e=tH();we.repeatWhen=I5e.repeatWhen;var C5e=rH();we.retry=C5e.retry;var T5e=nH();we.retryWhen=T5e.retryWhen;var k5e=Sg();we.refCount=k5e.refCount;var P5e=iH();we.sample=P5e.sample;var N5e=oH();we.sampleTime=N5e.sampleTime;var q5e=zg();we.scan=q5e.scan;var L5e=cH();we.sequenceEqual=L5e.sequenceEqual;var B5e=lH();we.share=B5e.share;var D5e=hH();we.shareReplay=D5e.shareReplay;var j5e=dH();we.single=j5e.single;var F5e=pH();we.skip=F5e.skip;var U5e=mH();we.skipLast=U5e.skipLast;var H5e=gH();we.skipUntil=H5e.skipUntil;var W5e=bH();we.skipWhile=W5e.skipWhile;var z5e=_H();we.startWith=z5e.startWith;var V5e=xH();we.subscribeOn=V5e.subscribeOn;var $5e=SH();we.switchAll=$5e.switchAll;var K5e=$g();we.switchMap=K5e.switchMap;var G5e=AH();we.switchMapTo=G5e.switchMapTo;var Z5e=Hg();we.take=Z5e.take;var Y5e=Wg();we.takeLast=Y5e.takeLast;var J5e=OH();we.takeUntil=J5e.takeUntil;var Q5e=RH();we.takeWhile=Q5e.takeWhile;var X5e=IH();we.tap=X5e.tap;var eSe=$M();we.throttle=eSe.throttle;var tSe=CH();we.throttleTime=tSe.throttleTime;var rSe=F0();we.throwIfEmpty=rSe.throwIfEmpty;var nSe=kH();we.timeInterval=nSe.timeInterval;var iSe=PH();we.timeout=iSe.timeout;var oSe=GM();we.timeoutWith=oSe.timeoutWith;var sSe=qH();we.timestamp=sSe.timestamp;var aSe=LH();we.toArray=aSe.toArray;var uSe=DH();we.window=uSe.window;var fSe=FH();we.windowCount=fSe.windowCount;var cSe=zH();we.windowTime=cSe.windowTime;var lSe=$H();we.windowToggle=lSe.windowToggle;var hSe=KH();we.windowWhen=hSe.windowWhen;var dSe=GH();we.withLatestFrom=dSe.withLatestFrom;var pSe=ZH();we.zip=pSe.zip;var vSe=YH();we.zipAll=vSe.zipAll});var XH=E((vFe,QH)=>{"use strict";QH.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==i||a.enumerable!==!0)return!1}return!0}});var rW=E((mFe,tW)=>{"use strict";var eW=typeof Symbol<"u"&&Symbol,mSe=XH();tW.exports=function(){return typeof eW!="function"||typeof Symbol!="function"||typeof eW("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:mSe()}});var iW=E((gFe,nW)=>{"use strict";var gSe="Function.prototype.bind called on incompatible ",t5=Array.prototype.slice,bSe=Object.prototype.toString,ySe="[object Function]";nW.exports=function(t){var r=this;if(typeof r!="function"||bSe.call(r)!==ySe)throw new TypeError(gSe+r);for(var n=t5.call(arguments,1),i,o=function(){if(this instanceof i){var w=r.apply(this,n.concat(t5.call(arguments)));return Object(w)===w?w:this}else return r.apply(t,n.concat(t5.call(arguments)))},a=Math.max(0,r.length-n.length),c=[],v=0;v<a;v++)c.push("$"+v);if(i=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var y=function(){};y.prototype=r.prototype,i.prototype=new y,y.prototype=null}return i}});var Zg=E((bFe,oW)=>{"use strict";var _Se=iW();oW.exports=Function.prototype.bind||_Se});var aW=E((yFe,sW)=>{"use strict";var wSe=Zg();sW.exports=wSe.call(Function.call,Object.prototype.hasOwnProperty)});var Qg=E((_Fe,hW)=>{"use strict";var At,Pc=SyntaxError,lW=Function,kc=TypeError,r5=function(e){try{return lW('"use strict"; return ('+e+").constructor;")()}catch{}},Ou=Object.getOwnPropertyDescriptor;if(Ou)try{Ou({},"")}catch{Ou=null}var n5=function(){throw new kc},xSe=Ou?function(){try{return arguments.callee,n5}catch{try{return Ou(arguments,"callee").get}catch{return n5}}}():n5,Cc=rW()(),wo=Object.getPrototypeOf||function(e){return e.__proto__},Tc={},MSe=typeof Uint8Array>"u"?At:wo(Uint8Array),Ru={"%AggregateError%":typeof AggregateError>"u"?At:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?At:ArrayBuffer,"%ArrayIteratorPrototype%":Cc?wo([][Symbol.iterator]()):At,"%AsyncFromSyncIteratorPrototype%":At,"%AsyncFunction%":Tc,"%AsyncGenerator%":Tc,"%AsyncGeneratorFunction%":Tc,"%AsyncIteratorPrototype%":Tc,"%Atomics%":typeof Atomics>"u"?At:Atomics,"%BigInt%":typeof BigInt>"u"?At:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?At:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?At:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?At:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?At:Float32Array,"%Float64Array%":typeof Float64Array>"u"?At:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?At:FinalizationRegistry,"%Function%":lW,"%GeneratorFunction%":Tc,"%Int8Array%":typeof Int8Array>"u"?At:Int8Array,"%Int16Array%":typeof Int16Array>"u"?At:Int16Array,"%Int32Array%":typeof Int32Array>"u"?At:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Cc?wo(wo([][Symbol.iterator]())):At,"%JSON%":typeof JSON=="object"?JSON:At,"%Map%":typeof Map>"u"?At:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Cc?At:wo(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?At:Promise,"%Proxy%":typeof Proxy>"u"?At:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?At:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?At:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Cc?At:wo(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?At:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Cc?wo(""[Symbol.iterator]()):At,"%Symbol%":Cc?Symbol:At,"%SyntaxError%":Pc,"%ThrowTypeError%":xSe,"%TypedArray%":MSe,"%TypeError%":kc,"%Uint8Array%":typeof Uint8Array>"u"?At:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?At:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?At:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?At:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?At:WeakMap,"%WeakRef%":typeof WeakRef>"u"?At:WeakRef,"%WeakSet%":typeof WeakSet>"u"?At:WeakSet};try{null.error}catch(e){uW=wo(wo(e)),Ru["%Error.prototype%"]=uW}var uW,SSe=function e(t){var r;if(t==="%AsyncFunction%")r=r5("async function () {}");else if(t==="%GeneratorFunction%")r=r5("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=r5("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&(r=wo(i.prototype))}return Ru[t]=r,r},fW={"%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"]},Ed=Zg(),Yg=aW(),ESe=Ed.call(Function.call,Array.prototype.concat),ASe=Ed.call(Function.apply,Array.prototype.splice),cW=Ed.call(Function.call,String.prototype.replace),Jg=Ed.call(Function.call,String.prototype.slice),OSe=Ed.call(Function.call,RegExp.prototype.exec),RSe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ISe=/\\(\\)?/g,CSe=function(t){var r=Jg(t,0,1),n=Jg(t,-1);if(r==="%"&&n!=="%")throw new Pc("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Pc("invalid intrinsic syntax, expected opening `%`");var i=[];return cW(t,RSe,function(o,a,c,v){i[i.length]=c?cW(v,ISe,"$1"):a||o}),i},TSe=function(t,r){var n=t,i;if(Yg(fW,n)&&(i=fW[n],n="%"+i[0]+"%"),Yg(Ru,n)){var o=Ru[n];if(o===Tc&&(o=SSe(n)),typeof o>"u"&&!r)throw new kc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new Pc("intrinsic "+t+" does not exist!")};hW.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new kc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new kc('"allowMissing" argument must be a boolean');if(OSe(/^%?[^%]*%?$/,t)===null)throw new Pc("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=CSe(t),i=n.length>0?n[0]:"",o=TSe("%"+i+"%",r),a=o.name,c=o.value,v=!1,y=o.alias;y&&(i=y[0],ASe(n,ESe([0,1],y)));for(var w=1,M=!0;w<n.length;w+=1){var S=n[w],R=Jg(S,0,1),C=Jg(S,-1);if((R==='"'||R==="'"||R==="`"||C==='"'||C==="'"||C==="`")&&R!==C)throw new Pc("property names with quotes must have matching quotes");if((S==="constructor"||!M)&&(v=!0),i+="."+S,a="%"+i+"%",Yg(Ru,a))c=Ru[a];else if(c!=null){if(!(S in c)){if(!r)throw new kc("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ou&&w+1>=n.length){var B=Ou(c,S);M=!!B,M&&"get"in B&&!("originalValue"in B.get)?c=B.get:c=c[S]}else M=Yg(c,S),c=c[S];M&&!v&&(Ru[a]=c)}}return c}});var bW=E((wFe,Xg)=>{"use strict";var i5=Zg(),Nc=Qg(),vW=Nc("%Function.prototype.apply%"),mW=Nc("%Function.prototype.call%"),gW=Nc("%Reflect.apply%",!0)||i5.call(mW,vW),dW=Nc("%Object.getOwnPropertyDescriptor%",!0),Iu=Nc("%Object.defineProperty%",!0),kSe=Nc("%Math.max%");if(Iu)try{Iu({},"a",{value:1})}catch{Iu=null}Xg.exports=function(t){var r=gW(i5,mW,arguments);if(dW&&Iu){var n=dW(r,"length");n.configurable&&Iu(r,"length",{value:1+kSe(0,t.length-(arguments.length-1))})}return r};var pW=function(){return gW(i5,vW,arguments)};Iu?Iu(Xg.exports,"apply",{value:pW}):Xg.exports.apply=pW});var xW=E((xFe,wW)=>{"use strict";var yW=Qg(),_W=bW(),PSe=_W(yW("String.prototype.indexOf"));wW.exports=function(t,r){var n=yW(t,!!r);return typeof n=="function"&&PSe(t,".prototype.")>-1?_W(n):n}});var MW=E(()=>{});var WW=E((EFe,HW)=>{var p5=typeof Map=="function"&&Map.prototype,o5=Object.getOwnPropertyDescriptor&&p5?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,tb=p5&&o5&&typeof o5.get=="function"?o5.get:null,SW=p5&&Map.prototype.forEach,v5=typeof Set=="function"&&Set.prototype,s5=Object.getOwnPropertyDescriptor&&v5?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,rb=v5&&s5&&typeof s5.get=="function"?s5.get:null,EW=v5&&Set.prototype.forEach,NSe=typeof WeakMap=="function"&&WeakMap.prototype,Od=NSe?WeakMap.prototype.has:null,qSe=typeof WeakSet=="function"&&WeakSet.prototype,Rd=qSe?WeakSet.prototype.has:null,LSe=typeof WeakRef=="function"&&WeakRef.prototype,AW=LSe?WeakRef.prototype.deref:null,BSe=Boolean.prototype.valueOf,DSe=Object.prototype.toString,jSe=Function.prototype.toString,FSe=String.prototype.match,m5=String.prototype.slice,Qs=String.prototype.replace,USe=String.prototype.toUpperCase,OW=String.prototype.toLowerCase,LW=RegExp.prototype.test,RW=Array.prototype.concat,xo=Array.prototype.join,HSe=Array.prototype.slice,IW=Math.floor,f5=typeof BigInt=="function"?BigInt.prototype.valueOf:null,a5=Object.getOwnPropertySymbols,c5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,qc=typeof Symbol=="function"&&typeof Symbol.iterator=="object",xn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===qc?"object":"symbol")?Symbol.toStringTag:null,BW=Object.prototype.propertyIsEnumerable,CW=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function TW(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||LW.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-IW(-e):IW(e);if(n!==e){var i=String(n),o=m5.call(t,i.length+1);return Qs.call(i,r,"$&_")+"."+Qs.call(Qs.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Qs.call(t,r,"$&_")}var l5=MW(),kW=l5.custom,PW=jW(kW)?kW:null;HW.exports=function e(t,r,n,i){var o=r||{};if(Js(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Js(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Js(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Js(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Js(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return UW(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var v=String(t);return c?TW(t,v):v}if(typeof t=="bigint"){var y=String(t)+"n";return c?TW(t,y):y}var w=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=w&&w>0&&typeof t=="object")return h5(t)?"[Array]":"[Object]";var M=sEe(o,n);if(typeof i>"u")i=[];else if(FW(i,t)>=0)return"[Circular]";function S(d,f,p){if(f&&(i=HSe.call(i),i.push(f)),p){var g={depth:o.depth};return Js(o,"quoteStyle")&&(g.quoteStyle=o.quoteStyle),e(d,g,n+1,i)}return e(d,o,n+1,i)}if(typeof t=="function"&&!NW(t)){var R=JSe(t),C=eb(t,S);return"[Function"+(R?": "+R:" (anonymous)")+"]"+(C.length>0?" { "+xo.call(C,", ")+" }":"")}if(jW(t)){var B=qc?Qs.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):c5.call(t);return typeof t=="object"&&!qc?Ad(B):B}if(nEe(t)){for(var N="<"+OW.call(String(t.nodeName)),q=t.attributes||[],H=0;H<q.length;H++)N+=" "+q[H].name+"="+DW(WSe(q[H].value),"double",o);return N+=">",t.childNodes&&t.childNodes.length&&(N+="..."),N+="</"+OW.call(String(t.nodeName))+">",N}if(h5(t)){if(t.length===0)return"[]";var D=eb(t,S);return M&&!oEe(D)?"["+d5(D,M)+"]":"[ "+xo.call(D,", ")+" ]"}if(VSe(t)){var ee=eb(t,S);return!("cause"in Error.prototype)&&"cause"in t&&!BW.call(t,"cause")?"{ ["+String(t)+"] "+xo.call(RW.call("[cause]: "+S(t.cause),ee),", ")+" }":ee.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+xo.call(ee,", ")+" }"}if(typeof t=="object"&&a){if(PW&&typeof t[PW]=="function"&&l5)return l5(t,{depth:w-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(QSe(t)){var ge=[];return SW&&SW.call(t,function(d,f){ge.push(S(f,t,!0)+" => "+S(d,t))}),qW("Map",tb.call(t),ge,M)}if(tEe(t)){var K=[];return EW&&EW.call(t,function(d){K.push(S(d,t))}),qW("Set",rb.call(t),K,M)}if(XSe(t))return u5("WeakMap");if(rEe(t))return u5("WeakSet");if(eEe(t))return u5("WeakRef");if(KSe(t))return Ad(S(Number(t)));if(ZSe(t))return Ad(S(f5.call(t)));if(GSe(t))return Ad(BSe.call(t));if($Se(t))return Ad(S(String(t)));if(!zSe(t)&&!NW(t)){var X=eb(t,S),V=CW?CW(t)===Object.prototype:t instanceof Object||t.constructor===Object,T=t instanceof Object?"":"null prototype",m=!V&&xn&&Object(t)===t&&xn in t?m5.call(Xs(t),8,-1):T?"Object":"",s=V||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",l=s+(m||T?"["+xo.call(RW.call([],m||[],T||[]),": ")+"] ":"");return X.length===0?l+"{}":M?l+"{"+d5(X,M)+"}":l+"{ "+xo.call(X,", ")+" }"}return String(t)};function DW(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function WSe(e){return Qs.call(String(e),/"/g,"&quot;")}function h5(e){return Xs(e)==="[object Array]"&&(!xn||!(typeof e=="object"&&xn in e))}function zSe(e){return Xs(e)==="[object Date]"&&(!xn||!(typeof e=="object"&&xn in e))}function NW(e){return Xs(e)==="[object RegExp]"&&(!xn||!(typeof e=="object"&&xn in e))}function VSe(e){return Xs(e)==="[object Error]"&&(!xn||!(typeof e=="object"&&xn in e))}function $Se(e){return Xs(e)==="[object String]"&&(!xn||!(typeof e=="object"&&xn in e))}function KSe(e){return Xs(e)==="[object Number]"&&(!xn||!(typeof e=="object"&&xn in e))}function GSe(e){return Xs(e)==="[object Boolean]"&&(!xn||!(typeof e=="object"&&xn in e))}function jW(e){if(qc)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!c5)return!1;try{return c5.call(e),!0}catch{}return!1}function ZSe(e){if(!e||typeof e!="object"||!f5)return!1;try{return f5.call(e),!0}catch{}return!1}var YSe=Object.prototype.hasOwnProperty||function(e){return e in this};function Js(e,t){return YSe.call(e,t)}function Xs(e){return DSe.call(e)}function JSe(e){if(e.name)return e.name;var t=FSe.call(jSe.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function FW(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function QSe(e){if(!tb||!e||typeof e!="object")return!1;try{tb.call(e);try{rb.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function XSe(e){if(!Od||!e||typeof e!="object")return!1;try{Od.call(e,Od);try{Rd.call(e,Rd)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function eEe(e){if(!AW||!e||typeof e!="object")return!1;try{return AW.call(e),!0}catch{}return!1}function tEe(e){if(!rb||!e||typeof e!="object")return!1;try{rb.call(e);try{tb.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function rEe(e){if(!Rd||!e||typeof e!="object")return!1;try{Rd.call(e,Rd);try{Od.call(e,Od)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function nEe(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function UW(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return UW(m5.call(e,0,t.maxStringLength),t)+n}var i=Qs.call(Qs.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,iEe);return DW(i,"single",t)}function iEe(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+USe.call(t.toString(16))}function Ad(e){return"Object("+e+")"}function u5(e){return e+" { ? }"}function qW(e,t,r,n){var i=n?d5(r,n):xo.call(r,", ");return e+" ("+t+") {"+i+"}"}function oEe(e){for(var t=0;t<e.length;t++)if(FW(e[t],`
556
+ `)>=0)return!1;return!0}function sEe(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=xo.call(Array(e.indent+1)," ");else return null;return{base:r,prev:xo.call(Array(t+1),r)}}function d5(e,t){if(e.length===0)return"";var r=`
557
+ `+t.prev+t.base;return r+xo.call(e,","+r)+`
558
+ `+t.prev}function eb(e,t){var r=h5(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=Js(e,i)?t(e[i],e):""}var o=typeof a5=="function"?a5(e):[],a;if(qc){a={};for(var c=0;c<o.length;c++)a["$"+o[c]]=o[c]}for(var v in e)!Js(e,v)||r&&String(Number(v))===v&&v<e.length||qc&&a["$"+v]instanceof Symbol||(LW.call(/[^\w$]/,v)?n.push(t(v,e)+": "+t(e[v],e)):n.push(v+": "+t(e[v],e)));if(typeof a5=="function")for(var y=0;y<o.length;y++)BW.call(e,o[y])&&n.push("["+t(o[y])+"]: "+t(e[o[y]],e));return n}});var VW=E((AFe,zW)=>{"use strict";var g5=Qg(),Lc=xW(),aEe=WW(),uEe=g5("%TypeError%"),nb=g5("%WeakMap%",!0),ib=g5("%Map%",!0),fEe=Lc("WeakMap.prototype.get",!0),cEe=Lc("WeakMap.prototype.set",!0),lEe=Lc("WeakMap.prototype.has",!0),hEe=Lc("Map.prototype.get",!0),dEe=Lc("Map.prototype.set",!0),pEe=Lc("Map.prototype.has",!0),b5=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},vEe=function(e,t){var r=b5(e,t);return r&&r.value},mEe=function(e,t,r){var n=b5(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},gEe=function(e,t){return!!b5(e,t)};zW.exports=function(){var t,r,n,i={assert:function(o){if(!i.has(o))throw new uEe("Side channel does not contain "+aEe(o))},get:function(o){if(nb&&o&&(typeof o=="object"||typeof o=="function")){if(t)return fEe(t,o)}else if(ib){if(r)return hEe(r,o)}else if(n)return vEe(n,o)},has:function(o){if(nb&&o&&(typeof o=="object"||typeof o=="function")){if(t)return lEe(t,o)}else if(ib){if(r)return pEe(r,o)}else if(n)return gEe(n,o);return!1},set:function(o,a){nb&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new nb),cEe(t,o,a)):ib?(r||(r=new ib),dEe(r,o,a)):(n||(n={key:{},next:null}),mEe(n,o,a))}};return i}});var ob=E((OFe,$W)=>{"use strict";var bEe=String.prototype.replace,yEe=/%20/g,y5={RFC1738:"RFC1738",RFC3986:"RFC3986"};$W.exports={default:y5.RFC3986,formatters:{RFC1738:function(e){return bEe.call(e,yEe,"+")},RFC3986:function(e){return String(e)}},RFC1738:y5.RFC1738,RFC3986:y5.RFC3986}});var w5=E((RFe,GW)=>{"use strict";var _Ee=ob(),_5=Object.prototype.hasOwnProperty,Cu=Array.isArray,Mo=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),wEe=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(Cu(n)){for(var i=[],o=0;o<n.length;++o)typeof n[o]<"u"&&i.push(n[o]);r.obj[r.prop]=i}}},KW=function(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(n[i]=t[i]);return n},xEe=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(Cu(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!_5.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object")return[t].concat(r);var i=t;return Cu(t)&&!Cu(r)&&(i=KW(t,n)),Cu(t)&&Cu(r)?(r.forEach(function(o,a){if(_5.call(t,a)){var c=t[a];c&&typeof c=="object"&&o&&typeof o=="object"?t[a]=e(c,o,n):t.push(o)}else t[a]=o}),t):Object.keys(r).reduce(function(o,a){var c=r[a];return _5.call(o,a)?o[a]=e(o[a],c,n):o[a]=c,o},i)},MEe=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},SEe=function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},EEe=function(t,r,n,i,o){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),n==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(w){return"%26%23"+parseInt(w.slice(2),16)+"%3B"});for(var c="",v=0;v<a.length;++v){var y=a.charCodeAt(v);if(y===45||y===46||y===95||y===126||y>=48&&y<=57||y>=65&&y<=90||y>=97&&y<=122||o===_Ee.RFC1738&&(y===40||y===41)){c+=a.charAt(v);continue}if(y<128){c=c+Mo[y];continue}if(y<2048){c=c+(Mo[192|y>>6]+Mo[128|y&63]);continue}if(y<55296||y>=57344){c=c+(Mo[224|y>>12]+Mo[128|y>>6&63]+Mo[128|y&63]);continue}v+=1,y=65536+((y&1023)<<10|a.charCodeAt(v)&1023),c+=Mo[240|y>>18]+Mo[128|y>>12&63]+Mo[128|y>>6&63]+Mo[128|y&63]}return c},AEe=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var o=r[i],a=o.obj[o.prop],c=Object.keys(a),v=0;v<c.length;++v){var y=c[v],w=a[y];typeof w=="object"&&w!==null&&n.indexOf(w)===-1&&(r.push({obj:a,prop:y}),n.push(w))}return wEe(r),t},OEe=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},REe=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},IEe=function(t,r){return[].concat(t,r)},CEe=function(t,r){if(Cu(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)};GW.exports={arrayToObject:KW,assign:MEe,combine:IEe,compact:AEe,decode:SEe,encode:EEe,isBuffer:REe,isRegExp:OEe,maybeMap:CEe,merge:xEe}});var ez=E((IFe,XW)=>{"use strict";var JW=VW(),M5=w5(),Id=ob(),TEe=Object.prototype.hasOwnProperty,ZW={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},rs=Array.isArray,kEe=String.prototype.split,PEe=Array.prototype.push,QW=function(e,t){PEe.apply(e,rs(t)?t:[t])},NEe=Date.prototype.toISOString,YW=Id.default,sn={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:M5.encode,encodeValuesOnly:!1,format:YW,formatter:Id.formatters[YW],indices:!1,serializeDate:function(t){return NEe.call(t)},skipNulls:!1,strictNullHandling:!1},qEe=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},x5={},LEe=function e(t,r,n,i,o,a,c,v,y,w,M,S,R,C,B,N){for(var q=t,H=N,D=0,ee=!1;(H=H.get(x5))!==void 0&&!ee;){var ge=H.get(t);if(D+=1,typeof ge<"u"){if(ge===D)throw new RangeError("Cyclic object value");ee=!0}typeof H.get(x5)>"u"&&(D=0)}if(typeof v=="function"?q=v(r,q):q instanceof Date?q=M(q):n==="comma"&&rs(q)&&(q=M5.maybeMap(q,function(u){return u instanceof Date?M(u):u})),q===null){if(o)return c&&!C?c(r,sn.encoder,B,"key",S):r;q=""}if(qEe(q)||M5.isBuffer(q)){if(c){var K=C?r:c(r,sn.encoder,B,"key",S);if(n==="comma"&&C){for(var X=kEe.call(String(q),","),V="",T=0;T<X.length;++T)V+=(T===0?"":",")+R(c(X[T],sn.encoder,B,"value",S));return[R(K)+(i&&rs(q)&&X.length===1?"[]":"")+"="+V]}return[R(K)+"="+R(c(q,sn.encoder,B,"value",S))]}return[R(r)+"="+R(String(q))]}var m=[];if(typeof q>"u")return m;var s;if(n==="comma"&&rs(q))s=[{value:q.length>0?q.join(",")||null:void 0}];else if(rs(v))s=v;else{var l=Object.keys(q);s=y?l.sort(y):l}for(var d=i&&rs(q)&&q.length===1?r+"[]":r,f=0;f<s.length;++f){var p=s[f],g=typeof p=="object"&&typeof p.value<"u"?p.value:q[p];if(!(a&&g===null)){var b=rs(q)?typeof n=="function"?n(d,p):d:d+(w?"."+p:"["+p+"]");N.set(t,D);var h=JW();h.set(x5,N),QW(m,e(g,b,n,i,o,a,c,v,y,w,M,S,R,C,B,h))}}return m},BEe=function(t){if(!t)return sn;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||sn.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Id.default;if(typeof t.format<"u"){if(!TEe.call(Id.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=Id.formatters[n],o=sn.filter;return(typeof t.filter=="function"||rs(t.filter))&&(o=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:sn.addQueryPrefix,allowDots:typeof t.allowDots>"u"?sn.allowDots:!!t.allowDots,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:sn.charsetSentinel,delimiter:typeof t.delimiter>"u"?sn.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:sn.encode,encoder:typeof t.encoder=="function"?t.encoder:sn.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:sn.encodeValuesOnly,filter:o,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:sn.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:sn.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:sn.strictNullHandling}};XW.exports=function(e,t){var r=e,n=BEe(t),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):rs(n.filter)&&(o=n.filter,i=o);var a=[];if(typeof r!="object"||r===null)return"";var c;t&&t.arrayFormat in ZW?c=t.arrayFormat:t&&"indices"in t?c=t.indices?"indices":"repeat":c="indices";var v=ZW[c];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y=v==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var w=JW(),M=0;M<i.length;++M){var S=i[M];n.skipNulls&&r[S]===null||QW(a,LEe(r[S],S,v,y,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,w))}var R=a.join(n.delimiter),C=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),R.length>0?C+R:""}});var nz=E((CFe,rz)=>{"use strict";var Bc=w5(),S5=Object.prototype.hasOwnProperty,DEe=Array.isArray,Zr={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Bc.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},jEe=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},tz=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},FEe="utf8=%26%2310003%3B",UEe="utf8=%E2%9C%93",HEe=function(t,r){var n={},i=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=r.parameterLimit===1/0?void 0:r.parameterLimit,a=i.split(r.delimiter,o),c=-1,v,y=r.charset;if(r.charsetSentinel)for(v=0;v<a.length;++v)a[v].indexOf("utf8=")===0&&(a[v]===UEe?y="utf-8":a[v]===FEe&&(y="iso-8859-1"),c=v,v=a.length);for(v=0;v<a.length;++v)if(v!==c){var w=a[v],M=w.indexOf("]="),S=M===-1?w.indexOf("="):M+1,R,C;S===-1?(R=r.decoder(w,Zr.decoder,y,"key"),C=r.strictNullHandling?null:""):(R=r.decoder(w.slice(0,S),Zr.decoder,y,"key"),C=Bc.maybeMap(tz(w.slice(S+1),r),function(B){return r.decoder(B,Zr.decoder,y,"value")})),C&&r.interpretNumericEntities&&y==="iso-8859-1"&&(C=jEe(C)),w.indexOf("[]=")>-1&&(C=DEe(C)?[C]:C),S5.call(n,R)?n[R]=Bc.combine(n[R],C):n[R]=C}return n},WEe=function(e,t,r,n){for(var i=n?t:tz(t,r),o=e.length-1;o>=0;--o){var a,c=e[o];if(c==="[]"&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var v=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,y=parseInt(v,10);!r.parseArrays&&v===""?a={0:i}:!isNaN(y)&&c!==v&&String(y)===v&&y>=0&&r.parseArrays&&y<=r.arrayLimit?(a=[],a[y]=i):v!=="__proto__"&&(a[v]=i)}i=a}return i},zEe=function(t,r,n,i){if(!!t){var o=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/,c=/(\[[^[\]]*])/g,v=n.depth>0&&a.exec(o),y=v?o.slice(0,v.index):o,w=[];if(y){if(!n.plainObjects&&S5.call(Object.prototype,y)&&!n.allowPrototypes)return;w.push(y)}for(var M=0;n.depth>0&&(v=c.exec(o))!==null&&M<n.depth;){if(M+=1,!n.plainObjects&&S5.call(Object.prototype,v[1].slice(1,-1))&&!n.allowPrototypes)return;w.push(v[1])}return v&&w.push("["+o.slice(v.index)+"]"),WEe(w,r,n,i)}},VEe=function(t){if(!t)return Zr;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof t.charset>"u"?Zr.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?Zr.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Zr.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Zr.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Zr.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Zr.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Zr.comma,decoder:typeof t.decoder=="function"?t.decoder:Zr.decoder,delimiter:typeof t.delimiter=="string"||Bc.isRegExp(t.delimiter)?t.delimiter:Zr.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Zr.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Zr.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Zr.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Zr.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Zr.strictNullHandling}};rz.exports=function(e,t){var r=VEe(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?HEe(e,r):e,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),a=0;a<o.length;++a){var c=o[a],v=zEe(c,n[c],r,typeof e=="string");i=Bc.merge(i,v,r)}return r.allowSparse===!0?i:Bc.compact(i)}});var oz=E((TFe,iz)=>{"use strict";var $Ee=ez(),KEe=nz(),GEe=ob();iz.exports={formats:GEe,parse:KEe,stringify:$Ee}});var Td=E(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.ProviderType=an.RegExpString=an.IntNumber=an.BigIntString=an.AddressString=an.HexString=an.OpaqueType=void 0;function Cd(){return e=>e}an.OpaqueType=Cd;an.HexString=Cd();an.AddressString=Cd();an.BigIntString=Cd();function ZEe(e){return Math.floor(e)}an.IntNumber=ZEe;an.RegExpString=Cd();var YEe;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(YEe=an.ProviderType||(an.ProviderType={}))});var ns=E($e=>{"use strict";var JEe=$e&&$e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($e,"__esModule",{value:!0});$e.isInIFrame=$e.createQrUrl=$e.getFavicon=$e.range=$e.isBigNumber=$e.ensureParsedJSONObject=$e.ensureBN=$e.ensureRegExpString=$e.ensureIntNumber=$e.ensureBuffer=$e.ensureAddressString=$e.ensureEvenLengthHexString=$e.ensureHexString=$e.isHexString=$e.prepend0x=$e.strip0x=$e.has0xPrefix=$e.hexStringFromIntNumber=$e.intNumberFromHexString=$e.bigIntStringFromBN=$e.hexStringFromBuffer=$e.hexStringToUint8Array=$e.uint8ArrayToHex=$e.randomBytesHex=void 0;var ea=JEe(jf()),QEe=oz(),Ai=Td(),sz=/^[0-9]*$/,az=/^[a-f0-9]*$/;function XEe(e){return uz(crypto.getRandomValues(new Uint8Array(e)))}$e.randomBytesHex=XEe;function uz(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}$e.uint8ArrayToHex=uz;function e8e(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}$e.hexStringToUint8Array=e8e;function t8e(e,t=!1){let r=e.toString("hex");return(0,Ai.HexString)(t?"0x"+r:r)}$e.hexStringFromBuffer=t8e;function r8e(e){return(0,Ai.BigIntString)(e.toString(10))}$e.bigIntStringFromBN=r8e;function n8e(e){return(0,Ai.IntNumber)(new ea.default(Pd(e,!1),16).toNumber())}$e.intNumberFromHexString=n8e;function i8e(e){return(0,Ai.HexString)("0x"+new ea.default(e).toString(16))}$e.hexStringFromIntNumber=i8e;function E5(e){return e.startsWith("0x")||e.startsWith("0X")}$e.has0xPrefix=E5;function sb(e){return E5(e)?e.slice(2):e}$e.strip0x=sb;function fz(e){return E5(e)?"0x"+e.slice(2):"0x"+e}$e.prepend0x=fz;function kd(e){if(typeof e!="string")return!1;let t=sb(e).toLowerCase();return az.test(t)}$e.isHexString=kd;function cz(e,t=!1){if(typeof e=="string"){let r=sb(e).toLowerCase();if(az.test(r))return(0,Ai.HexString)(t?"0x"+r:r)}throw new Error(`"${String(e)}" is not a hexadecimal string`)}$e.ensureHexString=cz;function Pd(e,t=!1){let r=cz(e,!1);return r.length%2===1&&(r=(0,Ai.HexString)("0"+r)),t?(0,Ai.HexString)("0x"+r):r}$e.ensureEvenLengthHexString=Pd;function o8e(e){if(typeof e=="string"){let t=sb(e).toLowerCase();if(kd(t)&&t.length===40)return(0,Ai.AddressString)(fz(t))}throw new Error(`Invalid Ethereum address: ${String(e)}`)}$e.ensureAddressString=o8e;function s8e(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string")if(kd(e)){let t=Pd(e,!1);return Buffer.from(t,"hex")}else return Buffer.from(e,"utf8");throw new Error(`Not binary data: ${String(e)}`)}$e.ensureBuffer=s8e;function lz(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Ai.IntNumber)(e);if(typeof e=="string"){if(sz.test(e))return(0,Ai.IntNumber)(Number(e));if(kd(e))return(0,Ai.IntNumber)(new ea.default(Pd(e,!1),16).toNumber())}throw new Error(`Not an integer: ${String(e)}`)}$e.ensureIntNumber=lz;function a8e(e){if(e instanceof RegExp)return(0,Ai.RegExpString)(e.toString());throw new Error(`Not a RegExp: ${String(e)}`)}$e.ensureRegExpString=a8e;function u8e(e){if(e!==null&&(ea.default.isBN(e)||hz(e)))return new ea.default(e.toString(10),10);if(typeof e=="number")return new ea.default(lz(e));if(typeof e=="string"){if(sz.test(e))return new ea.default(e,10);if(kd(e))return new ea.default(Pd(e,!1),16)}throw new Error(`Not an integer: ${String(e)}`)}$e.ensureBN=u8e;function f8e(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error(`Not a JSON string or an object: ${String(e)}`)}$e.ensureParsedJSONObject=f8e;function hz(e){if(e==null||typeof e.constructor!="function")return!1;let{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}$e.isBigNumber=hz;function c8e(e,t){return Array.from({length:t-e},(r,n)=>e+n)}$e.range=c8e;function l8e(){let e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}$e.getFavicon=l8e;function h8e(e,t,r,n,i,o){let a=n?"parent-id":"id",c=(0,QEe.stringify)({[a]:e,secret:t,server:r,v:i,chainId:o});return`${r}/#/link?${c}`}$e.createQrUrl=h8e;function d8e(){try{return window.frameElement!==null}catch{return!1}}$e.isInIFrame=d8e});var ub=E(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});ab.Session=void 0;var p8e=_u(),dz=Sd(),pz=gx(),vz=ns(),A5="session:id",mz="session:secret",gz="session:linked",Nd=class{constructor(t,r,n,i){this._storage=t,this._id=r||(0,vz.randomBytesHex)(16),this._secret=n||(0,vz.randomBytesHex)(32),this._key=new pz.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){let r=t.getItem(A5),n=t.getItem(gz),i=t.getItem(mz);return r&&i?new Nd(t,r,i,n==="1"):null}static get persistedSessionIdChange$(){return(0,p8e.fromEvent)(window,"storage").pipe((0,dz.filter)(t=>t.key===A5),(0,dz.map)(t=>({oldValue:t.oldValue||null,newValue:t.newValue||null})))}static hash(t){return new pz.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(A5,this._id),this._storage.setItem(mz,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(gz,this._linked?"1":"0")}};ab.Session=Nd});var R5=E(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.WalletSDKRelayAbstract=So.APP_VERSION_KEY=So.LOCAL_STORAGE_ADDRESSES_KEY=So.WALLET_USER_NAME_KEY=void 0;var bz=hg();So.WALLET_USER_NAME_KEY="walletUsername";So.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";So.APP_VERSION_KEY="AppVersion";var O5=class{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw bz.ethErrors.rpc.parse({});let i=n,{error:o}=i;if(o)throw(0,bz.serializeError)(o);return i})}};So.WalletSDKRelayAbstract=O5});var I5=E((LFe,Mz)=>{var v8e=b2(),m8e=jf();function yz(e){return Buffer.allocUnsafe(e).fill(0)}function _z(e,t,r){let n=yz(t);return e=fb(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function g8e(e,t){return _z(e,t,!0)}function fb(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")wz(e)?e=Buffer.from(_8e(xz(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(m8e.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function b8e(e){return e=fb(e),"0x"+e.toString("hex")}function y8e(e,t){return e=fb(e),t||(t=256),v8e("keccak"+t).update(e).digest()}function _8e(e){return e.length%2?"0"+e:e}function wz(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function xz(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}Mz.exports={zeros:yz,setLength:_z,setLengthRight:g8e,isHexString:wz,stripHexPrefix:xz,toBuffer:fb,bufferToHex:b8e,keccak:y8e}});var Iz=E((BFe,Rz)=>{var Pu=I5(),ku=jf();function Ez(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Dc(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Sz(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Az(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function Tu(e){var t=typeof e;if(t==="string")return Pu.isHexString(e)?new ku(Pu.stripHexPrefix(e),16):new ku(e,10);if(t==="number")return new ku(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Eo(e,t){var r,n,i,o;if(e==="address")return Eo("uint160",Tu(t));if(e==="bool")return Eo("uint8",t?1:0);if(e==="string")return Eo("bytes",new Buffer(t,"utf8"));if(x8e(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Az(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(o in t)i.push(Eo(e,t[o]));if(r==="dynamic"){var a=Eo("uint256",t.length);i.unshift(a)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([Eo("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,Pu.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Dc(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return Pu.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Dc(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Tu(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Dc(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Tu(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=Sz(e),n=Tu(t),n<0)throw new Error("Supplied ufixed is negative");return Eo("uint256",n.mul(new ku(2).pow(new ku(r[1]))))}else if(e.startsWith("fixed"))return r=Sz(e),Eo("int256",Tu(t).mul(new ku(2).pow(new ku(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function w8e(e){return e==="string"||e==="bytes"||Az(e)==="dynamic"}function x8e(e){return e.lastIndexOf("]")===e.length-1}function M8e(e,t){var r=[],n=[],i=32*e.length;for(var o in e){var a=Ez(e[o]),c=t[o],v=Eo(a,c);w8e(a)?(r.push(Eo("uint256",i)),n.push(v),i+=v.length):r.push(v)}return Buffer.concat(r.concat(n))}function Oz(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],o=0;o<e.length;o++){var a=Ez(e[o]),c=t[o];if(a==="bytes")i.push(c);else if(a==="string")i.push(new Buffer(c,"utf8"));else if(a==="bool")i.push(new Buffer(c?"01":"00","hex"));else if(a==="address")i.push(Pu.setLength(c,20));else if(a.startsWith("bytes")){if(r=Dc(a),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(Pu.setLengthRight(c,r))}else if(a.startsWith("uint")){if(r=Dc(a),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Tu(c),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(a.startsWith("int")){if(r=Dc(a),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Tu(c),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function S8e(e,t){return Pu.keccak(Oz(e,t))}Rz.exports={rawEncode:M8e,solidityPack:Oz,soliditySHA3:S8e}});var kz=E((DFe,Tz)=>{var Gi=I5(),qd=Iz(),Cz={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},C5={encodeData(e,t,r,n=!0){let i=["bytes32"],o=[this.hashType(e,r)];if(n){let a=(c,v,y)=>{if(r[v]!==void 0)return["bytes32",y==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Gi.keccak(this.encodeData(v,y,r,n))];if(y===void 0)throw new Error(`missing value for field ${c} of type ${v}`);if(v==="bytes")return["bytes32",Gi.keccak(y)];if(v==="string")return typeof y=="string"&&(y=Buffer.from(y,"utf8")),["bytes32",Gi.keccak(y)];if(v.lastIndexOf("]")===v.length-1){let w=v.slice(0,v.lastIndexOf("[")),M=y.map(S=>a(c,w,S));return["bytes32",Gi.keccak(qd.rawEncode(M.map(([S])=>S),M.map(([,S])=>S)))]}return[v,y]};for(let c of r[e]){let[v,y]=a(c.name,c.type,t[c.name]);i.push(v),o.push(y)}}else for(let a of r[e]){let c=t[a.name];if(c!==void 0)if(a.type==="bytes")i.push("bytes32"),c=Gi.keccak(c),o.push(c);else if(a.type==="string")i.push("bytes32"),typeof c=="string"&&(c=Buffer.from(c,"utf8")),c=Gi.keccak(c),o.push(c);else if(r[a.type]!==void 0)i.push("bytes32"),c=Gi.keccak(this.encodeData(a.type,c,r,n)),o.push(c);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),o.push(c)}}return qd.rawEncode(i,o)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(let i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:a,type:c})=>c+" "+a).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(let n of t[e])for(let i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return Gi.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Gi.keccak(this.encodeType(e,t))},sanitizeData(e){let t={};for(let r in Cz.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){let r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Gi.keccak(Buffer.concat(n))}};Tz.exports={TYPED_MESSAGE_SCHEMA:Cz,TypedDataUtils:C5,hashForSignTypedDataLegacy:function(e){return E8e(e.data)},hashForSignTypedData_v3:function(e){return C5.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return C5.hash(e.data)}};function E8e(e){let t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;let r=e.map(function(o){return o.type==="bytes"?Gi.toBuffer(o.value):o.value}),n=e.map(function(o){return o.type}),i=e.map(function(o){if(!o.name)throw t;return o.type+" "+o.name});return qd.soliditySHA3(["bytes32","bytes32"],[qd.soliditySHA3(new Array(e.length).fill("string"),i),qd.soliditySHA3(n,r)])}});var Bz=E(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.filterFromParam=Fc.FilterPolyfill=void 0;var jc=Td(),qn=ns(),A8e=5*60*1e3,Nu={jsonrpc:"2.0",id:0},T5=class{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,jc.IntNumber)(1),this.provider=t}async newFilter(t){let r=Lz(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,qn.hexStringFromIntNumber)(n)}async newBlockFilter(){let t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,qn.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){let t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,qn.hexStringFromIntNumber)(t)}uninstallFilter(t){let r=(0,qn.intNumberFromHexString)(t);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){let r=(0,qn.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(cb())}async getFilterLogs(t){let r=(0,qn.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Nu),{method:"eth_getLogs",params:[Pz(n)]})):cb()}makeFilterId(){return(0,jc.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,o)=>{if(i)return n(i);if(Array.isArray(o)||o==null)return n(new Error(`unexpected response received: ${JSON.stringify(o)}`));r(o)})})}deleteFilter(t){console.log(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){let r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return cb();let i=await this.getCurrentBlockHeight(),o=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return lb();console.log(`Fetching logs from ${n} to ${o} for filter ${t}`);let a=await this.sendAsyncPromise(Object.assign(Object.assign({},Nu),{method:"eth_getLogs",params:[Pz(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:o}))]}));if(Array.isArray(a.result)){let c=a.result.map(y=>(0,qn.intNumberFromHexString)(y.blockNumber||"0x0")),v=Math.max(...c);if(v&&v>n){let y=(0,jc.IntNumber)(v+1);console.log(`Moving cursor position for filter (${t}) from ${n} to ${y}`),this.cursors.set(t,y)}}return a}async getBlockFilterChanges(t){let r=this.cursors.get(t);if(!r)return cb();let n=await this.getCurrentBlockHeight();if(r>n)return lb();console.log(`Fetching blocks from ${r} to ${n} for filter (${t})`);let i=(await Promise.all((0,qn.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,jc.IntNumber)(a))))).filter(a=>!!a),o=(0,jc.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${t}) from ${r} to ${o}`),this.cursors.set(t,o),Object.assign(Object.assign({},Nu),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(lb())}async setInitialCursorPosition(t,r){let n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){let r=this.timeouts.get(t);r&&window.clearTimeout(r);let n=window.setTimeout(()=>{console.log(`Filter (${t}) timed out`),this.deleteFilter(t)},A8e);this.timeouts.set(t,n)}async getCurrentBlockHeight(){let{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},Nu),{method:"eth_blockNumber",params:[]}));return(0,qn.intNumberFromHexString)((0,qn.ensureHexString)(t))}async getBlockHashByNumber(t){let r=await this.sendAsyncPromise(Object.assign(Object.assign({},Nu),{method:"eth_getBlockByNumber",params:[(0,qn.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,qn.ensureHexString)(r.result.hash):null}};Fc.FilterPolyfill=T5;function Lz(e){return{fromBlock:Nz(e.fromBlock),toBlock:Nz(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Fc.filterFromParam=Lz;function Pz(e){let t={fromBlock:qz(e.fromBlock),toBlock:qz(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function Nz(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,jc.IntNumber)(0);if((0,qn.isHexString)(e))return(0,qn.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function qz(e){return e==="latest"?e:(0,qn.hexStringFromIntNumber)(e)}function cb(){return Object.assign(Object.assign({},Nu),{error:{code:-32e3,message:"filter not found"}})}function lb(){return Object.assign(Object.assign({},Nu),{result:[]})}});var Dz=E(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.JSONRPCMethod=void 0;var O8e;(function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"})(O8e=Ld.JSONRPCMethod||(Ld.JSONRPCMethod={}))});var Fz=E(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});hb.SubscriptionManager=void 0;var R8e=Rx(),I8e=G3(),jz=()=>{},k5=class{constructor(t){let r=new R8e({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=I8e({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){let r={};return await this.subscriptionMiddleware(t,r,jz,jz),r}destroy(){this.subscriptionMiddleware.destroy()}};hb.SubscriptionManager=k5});var db=E(Uc=>{"use strict";var L5=Uc&&Uc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Uc,"__esModule",{value:!0});Uc.CoinbaseWalletProvider=void 0;var C8e=L5(Lh()),T8e=L5(jf()),Mn=hg(),P5=pg(),Uz=ub(),Hz=R5(),gt=ns(),N5=L5(kz()),k8e=Bz(),Vt=Dz(),P8e=Fz(),Wz="DefaultChainId",zz="DefaultJsonRpcUrl",q5=class extends C8e.default{constructor(t){var r,n;super(),this._filterPolyfill=new k8e.FilterPolyfill(this),this._subscriptionManager=new P8e.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this._send=this.send.bind(this),this._sendAsync=this.sendAsync.bind(this),this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl,this.supportsAddressSwitching=t.supportsAddressSwitching,this.isLedger=t.isLedger;let i=this.getChainId(),o=(0,gt.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:o});let a=this._storage.getItem(Hz.LOCAL_STORAGE_ADDRESSES_KEY);if(a){let c=a.split(" ");c[0]!==""&&(this._addresses=c.map(v=>(0,gt.ensureAddressString)(v)),this.emit("accountsChanged",c))}this._subscriptionManager.events.on("notification",c=>{this.emit("message",{type:c.method,data:c.params})}),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",c=>{var v;if(!(c.origin!==location.origin||c.source!==window)&&c.data.type==="walletLinkMessage"){if(c.data.data.action==="defaultChainChanged"||c.data.data.action==="dappChainSwitched"){let y=c.data.data.chainId,w=(v=c.data.data.jsonRpcUrl)!==null&&v!==void 0?v:this.jsonRpcUrl;this.updateProviderInfo(w,Number(y))}c.data.data.action==="addressChanged"&&this._setAddresses([c.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,gt.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(zz))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(zz,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;let n=this.getChainId();this._storage.setItem(Wz,r.toString(10)),((0,gt.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,o,a){return!!(await(await this.initializeRelay()).watchAsset(t,r,n,i,o,a?.toString()).promise).result}async addEthereumChain(t,r,n,i,o,a){var c,v;if((0,gt.ensureIntNumber)(t)===this.getChainId())return!1;let y=await this.initializeRelay(),w=y.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!w&&await y.requestEthereumAccounts().promise;let M=await y.addEthereumChain(t.toString(),r,o,n,i,a).promise;return((c=M.result)===null||c===void 0?void 0:c.isApproved)===!0&&this.updateProviderInfo(r[0],t),((v=M.result)===null||v===void 0?void 0:v.isApproved)===!0}async switchEthereumChain(t){let n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if(n.errorCode)throw Mn.ethErrors.provider.custom({code:n.errorCode});let i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(P5.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Uz.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(Vt.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){if(typeof t=="string"){let i=t,o=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:o};return this._sendRequestAsync(a).then(c=>c.result)}if(typeof r=="function"){let i=t,o=r;return this._sendAsync(i,o)}if(Array.isArray(t))return t.map(o=>this._sendRequest(o));let n=t;return this._sendRequest(n)}async sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){let i=r;this._sendMultipleRequestsAsync(t).then(o=>i(null,o)).catch(o=>i(o,null));return}let n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){if(!t||typeof t!="object"||Array.isArray(t))throw Mn.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});let{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw Mn.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Mn.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});let i=n===void 0?[]:n,o=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:o})).result}async scanQRCode(t){let n=await(await this.initializeRelay()).scanQRCode((0,gt.ensureRegExpString)(t)).promise;if(typeof n.result!="string")throw new Error("result was not a string");return n.result}async genericRequest(t,r){let i=await(await this.initializeRelay()).genericRequest(t,r).promise;if(typeof i.result!="string")throw new Error("result was not a string");return i.result}async selectProvider(t){let n=await(await this.initializeRelay()).selectProvider(t).promise;if(typeof n.result!="string")throw new Error("result was not a string");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){let r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");let n=t.map(i=>(0,gt.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!r||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Hz.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}_sendRequestAsync(t){return new Promise((r,n)=>{try{let i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});let o=this._handleAsynchronousFilterMethods(t);if(o!==void 0){o.then(c=>r(Object.assign(Object.assign({},c),{id:t.id}))).catch(c=>n(c));return}let a=this._handleSubscriptionMethods(t);if(a!==void 0){a.then(c=>r({jsonrpc:"2.0",id:t.id,result:c.result})).catch(c=>n(c));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){let{method:r}=t,n=t.params||[];switch(r){case Vt.JSONRPCMethod.eth_accounts:return this._eth_accounts();case Vt.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case Vt.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case Vt.JSONRPCMethod.net_version:return this._net_version();case Vt.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){let{method:r}=t,n=t.params||[];switch(r){case Vt.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case Vt.JSONRPCMethod.eth_sign:return this._eth_sign(n);case Vt.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case Vt.JSONRPCMethod.personal_sign:return this._personal_sign(n);case Vt.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case Vt.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case Vt.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case Vt.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case Vt.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case Vt.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case Vt.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case Vt.JSONRPCMethod.eth_signTypedData_v4:case Vt.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case Vt.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case Vt.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case Vt.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case Vt.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(t){let{method:r}=t,n=t.params||[];switch(r){case Vt.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case Vt.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case Vt.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case Vt.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case Vt.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case Vt.JSONRPCMethod.eth_subscribe:case Vt.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{let r=(0,gt.ensureAddressString)(t);return this._addresses.map(i=>(0,gt.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(P5.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){let r=t.from?(0,gt.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);let n=t.to?(0,gt.ensureAddressString)(t.to):null,i=t.value!=null?(0,gt.ensureBN)(t.value):new T8e.default(0),o=t.data?(0,gt.ensureBuffer)(t.data):Buffer.alloc(0),a=t.nonce!=null?(0,gt.ensureIntNumber)(t.nonce):null,c=t.gasPrice!=null?(0,gt.ensureBN)(t.gasPrice):null,v=t.maxFeePerGas!=null?(0,gt.ensureBN)(t.maxFeePerGas):null,y=t.maxPriorityFeePerGas!=null?(0,gt.ensureBN)(t.maxPriorityFeePerGas):null,w=t.gas!=null?(0,gt.ensureBN)(t.gas):null,M=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:o,nonce:a,gasPriceInWei:c,maxFeePerGas:v,maxPriorityFeePerGas:y,gasLimit:w,chainId:M}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Mn.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Mn.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{let a=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;return{jsonrpc:"2.0",id:0,result:a.result}}catch(o){throw typeof o.message=="string"&&o.message.match(/(denied|rejected)/i)?Mn.ethErrors.provider.userRejectedRequest("User denied message signature"):o}}async _ethereumAddressFromSignedMessage(t,r,n){let o=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;return{jsonrpc:"2.0",id:0,result:o.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,gt.hexStringFromIntNumber)(this.getChainId())}getChainId(){let t=this._storage.getItem(Wz);if(!t)return(0,gt.ensureIntNumber)(this._chainIdFromOpts);let r=parseInt(t,10);return(0,gt.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(P5.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Uz.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{r=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Mn.ethErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();let r=(0,gt.ensureAddressString)(t[0]),n=(0,gt.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){let r=(0,gt.ensureBuffer)(t[0]),n=(0,gt.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();let r=(0,gt.ensureBuffer)(t[0]),n=(0,gt.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){let r=(0,gt.ensureBuffer)(t[0]),n=(0,gt.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();let r=this._prepareTransactionParams(t[0]||{});try{let i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Mn.ethErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){let r=(0,gt.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();let r=this._prepareTransactionParams(t[0]||{});try{let i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Mn.ethErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();let r=(0,gt.ensureParsedJSONObject)(t[0]),n=(0,gt.ensureAddressString)(t[1]);this._ensureKnownAddress(n);let i=N5.default.hashForSignTypedDataLegacy({data:r}),o=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,o)}async _eth_signTypedData_v3(t){this._requireAuthorization();let r=(0,gt.ensureAddressString)(t[0]),n=(0,gt.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);let i=N5.default.hashForSignTypedData_v3({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _eth_signTypedData_v4(t){this._requireAuthorization();let r=(0,gt.ensureAddressString)(t[0]),n=(0,gt.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);let i=N5.default.hashForSignTypedData_v4({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _cbwallet_arbitrary(t){let r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");let i=await this.genericRequest(r,n);return{jsonrpc:"2.0",id:0,result:i}}async _wallet_addEthereumChain(t){var r,n,i,o;let a=t[0];if(((r=a.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw Mn.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!a.nativeCurrency)throw Mn.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});let c=parseInt(a.chainId,16);return await this.addEthereumChain(c,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(o=a.iconUrls)!==null&&o!==void 0?o:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){let r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){let r=Array.isArray(t)?t[0]:t;if(!r.type)throw Mn.ethErrors.rpc.invalidParams({message:"Type is required"});if(r?.type!=="ERC20")throw Mn.ethErrors.rpc.invalidParams({message:`Asset of type '${r.type}' is not supported`});if(!r?.options)throw Mn.ethErrors.rpc.invalidParams({message:"Options are required"});if(!r?.options.address)throw Mn.ethErrors.rpc.invalidParams({message:"Address is required"});let n=this.getChainId(),{address:i,symbol:o,image:a,decimals:c}=r.options,v=await this.watchAsset(r.type,i,o,c,a,n);return{jsonrpc:"2.0",id:0,result:v}}_eth_uninstallFilter(t){let r=(0,gt.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){let r=t[0],n=await this._filterPolyfill.newFilter(r);return{jsonrpc:"2.0",id:0,result:n}}async _eth_newBlockFilter(){let t=await this._filterPolyfill.newBlockFilter();return{jsonrpc:"2.0",id:0,result:t}}async _eth_newPendingTransactionFilter(){let t=await this._filterPolyfill.newPendingTransactionFilter();return{jsonrpc:"2.0",id:0,result:t}}_eth_getFilterChanges(t){let r=(0,gt.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){let r=(0,gt.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}};Uc.CoinbaseWalletProvider=q5});var Yn={};Mr(Yn,{Component:()=>Dd,Fragment:()=>Ud,cloneElement:()=>F8e,createContext:()=>U8e,createElement:()=>tV,createRef:()=>q8e,h:()=>tV,hydrate:()=>hV,isValidElement:()=>Yz,options:()=>nt,render:()=>lV,toChildArray:()=>oV});function is(e,t){for(var r in t)e[r]=t[r];return e}function eV(e){var t=e.parentNode;t&&t.removeChild(e)}function tV(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Fd.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Bd(e,a,n,i,null)}function Bd(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Zz};return i==null&&nt.vnode!=null&&nt.vnode(o),o}function q8e(){return{current:null}}function Ud(e){return e.children}function L8e(e,t,r,n,i){var o;for(o in r)o==="children"||o==="key"||o in t||vb(e,o,null,r[o],n);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||r[o]===t[o]||vb(e,o,t[o],r[o],n)}function $z(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||N8e.test(t)?r:r+"px"}function vb(e,t,r,n,i){var o;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||$z(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||$z(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n||e.addEventListener(t,o?Gz:Kz,o):e.removeEventListener(t,o?Gz:Kz,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t.indexOf("-")==-1?e.removeAttribute(t):e.setAttribute(t,r))}}function Kz(e){Hc=!0;try{return this.l[e.type+!1](nt.event?nt.event(e):e)}finally{Hc=!1}}function Gz(e){Hc=!0;try{return this.l[e.type+!0](nt.event?nt.event(e):e)}finally{Hc=!1}}function Dd(e,t){this.props=e,this.context=t}function jd(e,t){if(t==null)return e.__?jd(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?jd(e):null}function rV(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return rV(e)}}function B8e(e){Hc?setTimeout(e):Jz(e)}function B5(e){(!e.__d&&(e.__d=!0)&&qu.push(e)&&!mb.__r++||Vz!==nt.debounceRendering)&&((Vz=nt.debounceRendering)||B8e)(mb)}function mb(){var e,t,r,n,i,o,a,c;for(qu.sort(function(v,y){return v.__v.__b-y.__v.__b});e=qu.shift();)e.__d&&(t=qu.length,n=void 0,i=void 0,a=(o=(r=e).__v).__e,(c=r.__P)&&(n=[],(i=is({},o)).__v=o.__v+1,D5(c,o,i,r.__n,c.ownerSVGElement!==void 0,o.__h!=null?[a]:null,n,a??jd(o),o.__h),uV(n,o),o.__e!=a&&rV(o)),qu.length>t&&qu.sort(function(v,y){return v.__v.__b-y.__v.__b}));mb.__r=0}function nV(e,t,r,n,i,o,a,c,v,y){var w,M,S,R,C,B,N,q=n&&n.__k||Xz,H=q.length;for(r.__k=[],w=0;w<t.length;w++)if((R=r.__k[w]=(R=t[w])==null||typeof R=="boolean"?null:typeof R=="string"||typeof R=="number"||typeof R=="bigint"?Bd(null,R,null,null,R):Array.isArray(R)?Bd(Ud,{children:R},null,null,null):R.__b>0?Bd(R.type,R.props,R.key,R.ref?R.ref:null,R.__v):R)!=null){if(R.__=r,R.__b=r.__b+1,(S=q[w])===null||S&&R.key==S.key&&R.type===S.type)q[w]=void 0;else for(M=0;M<H;M++){if((S=q[M])&&R.key==S.key&&R.type===S.type){q[M]=void 0;break}S=null}D5(e,R,S=S||pb,i,o,a,c,v,y),C=R.__e,(M=R.ref)&&S.ref!=M&&(N||(N=[]),S.ref&&N.push(S.ref,null,R),N.push(M,R.__c||C,R)),C!=null?(B==null&&(B=C),typeof R.type=="function"&&R.__k===S.__k?R.__d=v=iV(R,v,e):v=sV(e,R,S,q,C,v),typeof r.type=="function"&&(r.__d=v)):v&&S.__e==v&&v.parentNode!=e&&(v=jd(S))}for(r.__e=B,w=H;w--;)q[w]!=null&&(typeof r.type=="function"&&q[w].__e!=null&&q[w].__e==r.__d&&(r.__d=aV(n).nextSibling),cV(q[w],q[w]));if(N)for(w=0;w<N.length;w++)fV(N[w],N[++w],N[++w])}function iV(e,t,r){for(var n,i=e.__k,o=0;i&&o<i.length;o++)(n=i[o])&&(n.__=e,t=typeof n.type=="function"?iV(n,t,r):sV(r,n,n,i,n.__e,t));return t}function oV(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(r){oV(r,t)}):t.push(e)),t}function sV(e,t,r,n,i,o){var a,c,v;if(t.__d!==void 0)a=t.__d,t.__d=void 0;else if(r==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),a=null;else{for(c=o,v=0;(c=c.nextSibling)&&v<n.length;v+=1)if(c==i)break e;e.insertBefore(i,o),a=o}return a!==void 0?a:i.nextSibling}function aV(e){var t,r,n;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((r=e.__k[t])&&(n=aV(r)))return n}return null}function D5(e,t,r,n,i,o,a,c,v){var y,w,M,S,R,C,B,N,q,H,D,ee,ge,K,X,V=t.type;if(t.constructor!==void 0)return null;r.__h!=null&&(v=r.__h,c=t.__e=r.__e,t.__h=null,o=[c]),(y=nt.__b)&&y(t);try{e:if(typeof V=="function"){if(N=t.props,q=(y=V.contextType)&&n[y.__c],H=y?q?q.props.value:y.__:n,r.__c?B=(w=t.__c=r.__c).__=w.__E:("prototype"in V&&V.prototype.render?t.__c=w=new V(N,H):(t.__c=w=new Dd(N,H),w.constructor=V,w.render=j8e),q&&q.sub(w),w.props=N,w.state||(w.state={}),w.context=H,w.__n=n,M=w.__d=!0,w.__h=[],w._sb=[]),w.__s==null&&(w.__s=w.state),V.getDerivedStateFromProps!=null&&(w.__s==w.state&&(w.__s=is({},w.__s)),is(w.__s,V.getDerivedStateFromProps(N,w.__s))),S=w.props,R=w.state,w.__v=t,M)V.getDerivedStateFromProps==null&&w.componentWillMount!=null&&w.componentWillMount(),w.componentDidMount!=null&&w.__h.push(w.componentDidMount);else{if(V.getDerivedStateFromProps==null&&N!==S&&w.componentWillReceiveProps!=null&&w.componentWillReceiveProps(N,H),!w.__e&&w.shouldComponentUpdate!=null&&w.shouldComponentUpdate(N,w.__s,H)===!1||t.__v===r.__v){for(t.__v!==r.__v&&(w.props=N,w.state=w.__s,w.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(T){T&&(T.__=t)}),D=0;D<w._sb.length;D++)w.__h.push(w._sb[D]);w._sb=[],w.__h.length&&a.push(w);break e}w.componentWillUpdate!=null&&w.componentWillUpdate(N,w.__s,H),w.componentDidUpdate!=null&&w.__h.push(function(){w.componentDidUpdate(S,R,C)})}if(w.context=H,w.props=N,w.__P=e,ee=nt.__r,ge=0,"prototype"in V&&V.prototype.render){for(w.state=w.__s,w.__d=!1,ee&&ee(t),y=w.render(w.props,w.state,w.context),K=0;K<w._sb.length;K++)w.__h.push(w._sb[K]);w._sb=[]}else do w.__d=!1,ee&&ee(t),y=w.render(w.props,w.state,w.context),w.state=w.__s;while(w.__d&&++ge<25);w.state=w.__s,w.getChildContext!=null&&(n=is(is({},n),w.getChildContext())),M||w.getSnapshotBeforeUpdate==null||(C=w.getSnapshotBeforeUpdate(S,R)),X=y!=null&&y.type===Ud&&y.key==null?y.props.children:y,nV(e,Array.isArray(X)?X:[X],t,r,n,i,o,a,c,v),w.base=t.__e,t.__h=null,w.__h.length&&a.push(w),B&&(w.__E=w.__=null),w.__e=!1}else o==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=D8e(r.__e,t,r,n,i,o,a,v);(y=nt.diffed)&&y(t)}catch(T){t.__v=null,(v||o!=null)&&(t.__e=c,t.__h=!!v,o[o.indexOf(c)]=null),nt.__e(T,t,r)}}function uV(e,t){nt.__c&&nt.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(n){n.call(r)})}catch(n){nt.__e(n,r.__v)}})}function D8e(e,t,r,n,i,o,a,c){var v,y,w,M=r.props,S=t.props,R=t.type,C=0;if(R==="svg"&&(i=!0),o!=null){for(;C<o.length;C++)if((v=o[C])&&"setAttribute"in v==!!R&&(R?v.localName===R:v.nodeType===3)){e=v,o[C]=null;break}}if(e==null){if(R===null)return document.createTextNode(S);e=i?document.createElementNS("http://www.w3.org/2000/svg",R):document.createElement(R,S.is&&S),o=null,c=!1}if(R===null)M===S||c&&e.data===S||(e.data=S);else{if(o=o&&Fd.call(e.childNodes),y=(M=r.props||pb).dangerouslySetInnerHTML,w=S.dangerouslySetInnerHTML,!c){if(o!=null)for(M={},C=0;C<e.attributes.length;C++)M[e.attributes[C].name]=e.attributes[C].value;(w||y)&&(w&&(y&&w.__html==y.__html||w.__html===e.innerHTML)||(e.innerHTML=w&&w.__html||""))}if(L8e(e,S,M,i,c),w)t.__k=[];else if(C=t.props.children,nV(e,Array.isArray(C)?C:[C],t,r,n,i&&R!=="foreignObject",o,a,o?o[0]:r.__k&&jd(r,0),c),o!=null)for(C=o.length;C--;)o[C]!=null&&eV(o[C]);c||("value"in S&&(C=S.value)!==void 0&&(C!==e.value||R==="progress"&&!C||R==="option"&&C!==M.value)&&vb(e,"value",C,M.value,!1),"checked"in S&&(C=S.checked)!==void 0&&C!==e.checked&&vb(e,"checked",C,M.checked,!1))}return e}function fV(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){nt.__e(n,r)}}function cV(e,t,r){var n,i;if(nt.unmount&&nt.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||fV(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){nt.__e(o,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&cV(n[i],t,r||typeof e.type!="function");r||e.__e==null||eV(e.__e),e.__=e.__e=e.__d=void 0}function j8e(e,t,r){return this.constructor(e,r)}function lV(e,t,r){var n,i,o;nt.__&&nt.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],D5(t,e=(!n&&r||t).__k=tV(Ud,null,[e]),i||pb,pb,t.ownerSVGElement!==void 0,!n&&r?[r]:i?null:t.firstChild?Fd.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n),uV(o,e)}function hV(e,t){lV(e,t,hV)}function F8e(e,t,r){var n,i,o,a=is({},e.props);for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];return arguments.length>2&&(a.children=arguments.length>3?Fd.call(arguments,2):r),Bd(e.type,a,n||e.key,i||e.ref,null)}function U8e(e,t){var r={__c:t="__cC"+Qz++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(c){c.__e=!0,B5(c)})},this.sub=function(a){i.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),c&&c.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}var Fd,nt,Zz,Yz,Hc,qu,Vz,Jz,Qz,pb,Xz,N8e,Ln=yt(()=>{pb={},Xz=[],N8e=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;Fd=Xz.slice,nt={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(c){e=c}throw e}},Zz=0,Yz=function(e){return e!=null&&e.constructor===void 0},Hc=!1,Dd.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=is({},this.state),typeof e=="function"&&(e=e(is({},r),this.props)),e&&is(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),B5(this))},Dd.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),B5(this))},Dd.prototype.render=Ud,qu=[],Jz=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,mb.__r=0,Qz=0});var Hd=E((WFe,j5)=>{function pV(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=pV(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function dV(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=pV(e))&&(n&&(n+=" "),n+=t);return n}j5.exports=dV,j5.exports.clsx=dV});var zc={};Mr(zc,{useCallback:()=>V8e,useContext:()=>$8e,useDebugValue:()=>K8e,useEffect:()=>H8e,useErrorBoundary:()=>G8e,useId:()=>Z8e,useImperativeHandle:()=>z8e,useLayoutEffect:()=>EV,useMemo:()=>H5,useReducer:()=>SV,useRef:()=>W8e,useState:()=>MV});function Lu(e,t){nt.__h&&nt.__h(vr,e,Wc||t),Wc=0;var r=vr.__H||(vr.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:gb}),r.__[e]}function MV(e){return Wc=1,SV(AV,e)}function SV(e,t,r){var n=Lu(ta++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):AV(void 0,t),function(o){var a=n.__N?n.__N[0]:n.__[0],c=n.t(a,o);a!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=vr,!vr.u)){vr.u=!0;var i=vr.shouldComponentUpdate;vr.shouldComponentUpdate=function(o,a,c){if(!n.__c.__H)return!0;var v=n.__c.__H.__.filter(function(w){return w.__c});if(v.every(function(w){return!w.__N}))return!i||i.call(this,o,a,c);var y=!1;return v.forEach(function(w){if(w.__N){var M=w.__[0];w.__=w.__N,w.__N=void 0,M!==w.__[0]&&(y=!0)}}),!(!y&&n.__c.props===o)&&(!i||i.call(this,o,a,c))}}return n.__N||n.__}function H8e(e,t){var r=Lu(ta++,3);!nt.__s&&W5(r.__H,t)&&(r.__=e,r.i=t,vr.__H.__h.push(r))}function EV(e,t){var r=Lu(ta++,4);!nt.__s&&W5(r.__H,t)&&(r.__=e,r.i=t,vr.__h.push(r))}function W8e(e){return Wc=5,H5(function(){return{current:e}},[])}function z8e(e,t,r){Wc=6,EV(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function H5(e,t){var r=Lu(ta++,7);return W5(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function V8e(e,t){return Wc=8,H5(function(){return e},t)}function $8e(e){var t=vr.context[e.__c],r=Lu(ta++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(vr)),t.props.value):e.__}function K8e(e,t){nt.useDebugValue&&nt.useDebugValue(t?t(e):e)}function G8e(e){var t=Lu(ta++,10),r=MV();return t.__=e,vr.componentDidCatch||(vr.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Z8e(){var e=Lu(ta++,11);if(!e.__){for(var t=vr.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Y8e(){for(var e;e=xV.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(bb),e.__H.__h.forEach(U5),e.__H.__h=[]}catch(t){e.__H.__h=[],nt.__e(t,e.__v)}}function J8e(e){var t,r=function(){clearTimeout(n),wV&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);wV&&(t=requestAnimationFrame(r))}function bb(e){var t=vr,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),vr=t}function U5(e){var t=vr;e.__c=e.__(),vr=t}function W5(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function AV(e,t){return typeof t=="function"?t(e):t}var ta,vr,F5,vV,Wc,xV,gb,mV,gV,bV,yV,_V,wV,Vc=yt(()=>{Ln();Wc=0,xV=[],gb=[],mV=nt.__b,gV=nt.__r,bV=nt.diffed,yV=nt.__c,_V=nt.unmount;nt.__b=function(e){vr=null,mV&&mV(e)},nt.__r=function(e){gV&&gV(e),ta=0;var t=(vr=e.__c).__H;t&&(F5===vr?(t.__h=[],vr.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=gb,r.__N=r.i=void 0})):(t.__h.forEach(bb),t.__h.forEach(U5),t.__h=[])),F5=vr},nt.diffed=function(e){bV&&bV(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(xV.push(t)!==1&&vV===nt.requestAnimationFrame||((vV=nt.requestAnimationFrame)||J8e)(Y8e)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==gb&&(r.__=r.__V),r.i=void 0,r.__V=gb})),F5=vr=null},nt.__c=function(e,t){t.some(function(r){try{r.__h.forEach(bb),r.__h=r.__h.filter(function(n){return!n.__||U5(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],nt.__e(n,r.__v)}}),yV&&yV(e,t)},nt.unmount=function(e){_V&&_V(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{bb(n)}catch(i){t=i}}),r.__H=void 0,t&&nt.__e(t,r.__v))};wV=typeof requestAnimationFrame=="function"});var OV=E(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});yb.LIB_VERSION=void 0;yb.LIB_VERSION="3.6.3"});var IV=E(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});_b.CloseIcon=void 0;var RV=(Ln(),Pt(Yn));function Q8e(e){return(0,RV.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,RV.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}_b.CloseIcon=Q8e});var CV=E(z5=>{"use strict";Object.defineProperty(z5,"__esModule",{value:!0});z5.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4="});var TV=E(V5=>{"use strict";Object.defineProperty(V5,"__esModule",{value:!0});V5.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg=="});var kV=E(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});wb.QRCodeIcon=void 0;var Ao=(Ln(),Pt(Yn));function X8e(e){return(0,Ao.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ao.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Ao.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,Ao.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Ao.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,Ao.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Ao.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,Ao.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Ao.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Ao.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}wb.QRCodeIcon=X8e});var PV=E($5=>{"use strict";Object.defineProperty($5,"__esModule",{value:!0});var e9e=`
559
+ <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
560
+ <path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>
561
+ <path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>
562
+ <path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>
563
+ </svg>
564
+ `;$5.default=e9e});var NV=E(K5=>{"use strict";Object.defineProperty(K5,"__esModule",{value:!0});K5.default=`
565
+ <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
566
+ <circle cx="50" cy="50" r="50" fill="white"/>
567
+ <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>
568
+ <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>
569
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>
570
+ </svg>
571
+ `});var LV=E(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});xb.StatusDotIcon=void 0;var qV=(Ln(),Pt(Yn));function t9e(e){return(0,qV.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,qV.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}xb.StatusDotIcon=t9e});var UV=E((XFe,FV)=>{function BV(e){this.mode=ii.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}BV.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Ro(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Ro.prototype={addData:function(e){var t=new BV(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Ro.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=xr.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var o=0;o<this.modules.length;o++)for(var a=o*i,c=0;c<this.modules[o].length;c++){var v=c*i,y=this.modules[o][c];y&&(n.beginFill(0,100),n.moveTo(v,a),n.lineTo(v+i,a),n.lineTo(v+i,a+i),n.lineTo(v,a+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=xr.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var o=-2;o<=2;o++)for(var a=-2;a<=2;a++)o==-2||o==2||a==-2||a==2||o==0&&a==0?this.modules[n+o][i+a]=!0:this.modules[n+o][i+a]=!1}},setupTypeNumber:function(e){for(var t=xr.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=xr.getBCHTypeInfo(r),i=0;i<15;i++){var o=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(var i=0;i<15;i++){var o=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[n][a-c]==null){var v=!1;o<e.length&&(v=(e[o]>>>i&1)==1);var y=xr.getMask(t,n,a-c);y&&(v=!v),this.modules[n][a-c]=v,i--,i==-1&&(o++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Ro.PAD0=236;Ro.PAD1=17;Ro.createData=function(e,t,r){for(var n=Oo.getRSBlocks(e,t),i=new DV,o=0;o<r.length;o++){var a=r[o];i.put(a.mode,4),i.put(a.getLength(),xr.getLengthInBits(a.mode,e)),a.write(i)}for(var c=0,o=0;o<n.length;o++)c+=n[o].dataCount;if(i.getLengthInBits()>c*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(Ro.PAD0,8),i.getLengthInBits()>=c*8));)i.put(Ro.PAD1,8);return Ro.createBytes(i,n)};Ro.createBytes=function(e,t){for(var r=0,n=0,i=0,o=new Array(t.length),a=new Array(t.length),c=0;c<t.length;c++){var v=t[c].dataCount,y=t[c].totalCount-v;n=Math.max(n,v),i=Math.max(i,y),o[c]=new Array(v);for(var w=0;w<o[c].length;w++)o[c][w]=255&e.buffer[w+r];r+=v;var M=xr.getErrorCorrectPolynomial(y),S=new $c(o[c],M.getLength()-1),R=S.mod(M);a[c]=new Array(M.getLength()-1);for(var w=0;w<a[c].length;w++){var C=w+R.getLength()-a[c].length;a[c][w]=C>=0?R.get(C):0}}for(var B=0,w=0;w<t.length;w++)B+=t[w].totalCount;for(var N=new Array(B),q=0,w=0;w<n;w++)for(var c=0;c<t.length;c++)w<o[c].length&&(N[q++]=o[c][w]);for(var w=0;w<i;w++)for(var c=0;c<t.length;c++)w<a[c].length&&(N[q++]=a[c][w]);return N};var ii={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3},na={L:1,M:0,Q:3,H:2},ra={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},xr={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(e){for(var t=e<<10;xr.getBCHDigit(t)-xr.getBCHDigit(xr.G15)>=0;)t^=xr.G15<<xr.getBCHDigit(t)-xr.getBCHDigit(xr.G15);return(e<<10|t)^xr.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;xr.getBCHDigit(t)-xr.getBCHDigit(xr.G18)>=0;)t^=xr.G18<<xr.getBCHDigit(t)-xr.getBCHDigit(xr.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return xr.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case ra.PATTERN000:return(t+r)%2==0;case ra.PATTERN001:return t%2==0;case ra.PATTERN010:return r%3==0;case ra.PATTERN011:return(t+r)%3==0;case ra.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case ra.PATTERN101:return t*r%2+t*r%3==0;case ra.PATTERN110:return(t*r%2+t*r%3)%2==0;case ra.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new $c([1],0),r=0;r<e;r++)t=t.multiply(new $c([1,Yr.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ii.MODE_NUMBER:return 10;case ii.MODE_ALPHA_NUM:return 9;case ii.MODE_8BIT_BYTE:return 8;case ii.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ii.MODE_NUMBER:return 12;case ii.MODE_ALPHA_NUM:return 11;case ii.MODE_8BIT_BYTE:return 16;case ii.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ii.MODE_NUMBER:return 14;case ii.MODE_ALPHA_NUM:return 13;case ii.MODE_8BIT_BYTE:return 16;case ii.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var o=0,a=e.isDark(n,i),c=-1;c<=1;c++)if(!(n+c<0||t<=n+c))for(var v=-1;v<=1;v++)i+v<0||t<=i+v||c==0&&v==0||a==e.isDark(n+c,i+v)&&o++;o>5&&(r+=3+o-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var y=0;e.isDark(n,i)&&y++,e.isDark(n+1,i)&&y++,e.isDark(n,i+1)&&y++,e.isDark(n+1,i+1)&&y++,(y==0||y==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var w=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&w++;var M=Math.abs(100*w/t/t-50)/5;return r+=M*10,r}},Yr={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Yr.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Yr.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(qr=0;qr<8;qr++)Yr.EXP_TABLE[qr]=1<<qr;var qr;for(qr=8;qr<256;qr++)Yr.EXP_TABLE[qr]=Yr.EXP_TABLE[qr-4]^Yr.EXP_TABLE[qr-5]^Yr.EXP_TABLE[qr-6]^Yr.EXP_TABLE[qr-8];var qr;for(qr=0;qr<255;qr++)Yr.LOG_TABLE[Yr.EXP_TABLE[qr]]=qr;var qr;function $c(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}$c.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Yr.gexp(Yr.glog(this.get(r))+Yr.glog(e.get(n)));return new $c(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Yr.glog(this.get(0))-Yr.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Yr.gexp(Yr.glog(e.get(n))+t);return new $c(r,0).mod(e)}};function Oo(e,t){this.totalCount=e,this.dataCount=t}Oo.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Oo.getRSBlocks=function(e,t){var r=Oo.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],o=0;o<n;o++)for(var a=r[o*3+0],c=r[o*3+1],v=r[o*3+2],y=0;y<a;y++)i.push(new Oo(c,v));return i};Oo.getRsBlockTable=function(e,t){switch(t){case na.L:return Oo.RS_BLOCK_TABLE[(e-1)*4+0];case na.M:return Oo.RS_BLOCK_TABLE[(e-1)*4+1];case na.Q:return Oo.RS_BLOCK_TABLE[(e-1)*4+2];case na.H:return Oo.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function DV(){this.buffer=[],this.length=0}DV.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var G5=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function jV(e){var t=this;if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var r in e)this.options[r]=e[r];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function n(y){switch(y){case"L":return na.L;case"M":return na.M;case"Q":return na.Q;case"H":return na.H;default:throw new Error("Unknwon error correction level: "+y)}}function i(y,w){for(var M=o(y),S=1,R=0,C=0,B=G5.length;C<=B;C++){var N=G5[C];if(!N)throw new Error("Content too long: expected "+R+" but got "+M);switch(w){case"L":R=N[0];break;case"M":R=N[1];break;case"Q":R=N[2];break;case"H":R=N[3];break;default:throw new Error("Unknwon error correction level: "+w)}if(M<=R)break;S++}if(S>G5.length)throw new Error("Content too long");return S}function o(y){var w=encodeURI(y).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return w.length+(w.length!=y?3:0)}var a=this.options.content,c=i(a,this.options.ecl),v=n(this.options.ecl);this.qrcode=new Ro(c,v),this.qrcode.addData(a),this.qrcode.make()}jV.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",o=n?`\r
572
+ `:"",a=t.width,c=t.height,v=r.length,y=a/(v+2*t.padding),w=c/(v+2*t.padding),M=typeof t.join<"u"?!!t.join:!1,S=typeof t.swap<"u"?!!t.swap:!1,R=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,C=typeof t.predefined<"u"?!!t.predefined:!1,B=C?i+'<defs><path id="qrmodule" d="M0 0 h'+w+" v"+y+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+o:"",N=i+'<rect x="0" y="0" width="'+a+'" height="'+c+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+o,q="",H="",D=0;D<v;D++)for(var ee=0;ee<v;ee++){var ge=r[ee][D];if(ge){var K=ee*y+t.padding*y,X=D*w+t.padding*w;if(S){var V=K;K=X,X=V}if(M){var T=y+K,m=w+X;K=Number.isInteger(K)?Number(K):K.toFixed(2),X=Number.isInteger(X)?Number(X):X.toFixed(2),T=Number.isInteger(T)?Number(T):T.toFixed(2),m=Number.isInteger(m)?Number(m):m.toFixed(2),H+="M"+K+","+X+" V"+m+" H"+T+" V"+X+" H"+K+" Z "}else C?q+=i+'<use x="'+K.toString()+'" y="'+X.toString()+'" href="#qrmodule" />'+o:q+=i+'<rect x="'+K.toString()+'" y="'+X.toString()+'" width="'+y+'" height="'+w+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+o}}M&&(q=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+H+'" />');let s="";if(this.options.image!==void 0&&this.options.image.svg){let d=a*this.options.image.width/100,f=c*this.options.image.height/100,p=a/2-d/2,g=c/2-f/2;s+=`<svg x="${p}" y="${g}" width="${d}" height="${f}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,s+=this.options.image.svg+o,s+="</svg>"}var l="";switch(e.container){case"svg":R&&(l+='<?xml version="1.0" standalone="yes"?>'+o),l+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+a+'" height="'+c+'">'+o,l+=B+N+q,l+=s,l+="</svg>";break;case"svg-viewbox":R&&(l+='<?xml version="1.0" standalone="yes"?>'+o),l+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+a+" "+c+'">'+o,l+=B+N+q,l+=s,l+="</svg>";break;case"g":l+='<g width="'+a+'" height="'+c+'">'+o,l+=B+N+q,l+=s,l+="</g>";break;default:l+=(B+N+q+s).replace(/^\s+/,"");break}return l};FV.exports=jV});var WV=E(Kc=>{"use strict";var r9e=Kc&&Kc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kc,"__esModule",{value:!0});Kc.QRCode=void 0;var n9e=(Ln(),Pt(Yn)),HV=(Vc(),Pt(zc)),i9e=r9e(UV()),o9e=e=>{let[t,r]=(0,HV.useState)("");return(0,HV.useEffect)(()=>{var n,i;let o=new i9e.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),a=Buffer.from(o.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)}),t?(0,n9e.h)("img",{src:t,alt:"QR Code"}):null};Kc.QRCode=o9e});var zV=E(Z5=>{"use strict";Object.defineProperty(Z5,"__esModule",{value:!0});Z5.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}"});var VV=E(Gc=>{"use strict";var s9e=Gc&&Gc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.Spinner=void 0;var Mb=(Ln(),Pt(Yn)),a9e=s9e(zV()),u9e=e=>{var t;let r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,Mb.h)("div",{class:"-cbwsdk-spinner"},(0,Mb.h)("style",null,a9e.default),(0,Mb.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Mb.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Gc.Spinner=u9e});var $V=E(Y5=>{"use strict";Object.defineProperty(Y5,"__esModule",{value:!0});Y5.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}"});var XV=E(Ri=>{"use strict";var Zc=Ri&&Ri.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.CoinbaseAppSteps=Ri.CoinbaseWalletSteps=Ri.ConnectItem=Ri.ConnectContent=void 0;var Oi=Zc(Hd()),Ye=(Ln(),Pt(Yn)),KV=(Vc(),Pt(zc)),f9e=ns(),c9e=OV(),l9e=IV(),h9e=Zc(CV()),d9e=Zc(TV()),ZV=kV(),p9e=Zc(PV()),v9e=Zc(NV()),m9e=LV(),g9e=WV(),b9e=VV(),y9e=Zc($V()),GV={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:d9e.default,steps:JV},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:h9e.default,steps:QV}},_9e=e=>{switch(e){case"coinbase-app":return p9e.default;case"coinbase-wallet-app":default:return v9e.default}},J5=e=>e==="light"?"#FFFFFF":"#0A0B0D";function w9e(e){let{theme:t}=e,[r,n]=(0,KV.useState)("coinbase-wallet-app"),i=(0,KV.useCallback)(y=>{n(y)},[]),o=(0,f9e.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),a=GV[r];if(!r)return null;let c=a.steps,v=r==="coinbase-app";return(0,Ye.h)("div",{"data-testid":"connect-content",class:(0,Oi.default)("-cbwsdk-connect-content",t)},(0,Ye.h)("style",null,y9e.default),(0,Ye.h)("div",{class:"-cbwsdk-connect-content-header"},(0,Ye.h)("h2",{class:(0,Oi.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with one of our mobile apps"),e.onCancel&&(0,Ye.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,Ye.h)(l9e.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ye.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,Ye.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,Ye.h)("div",null,Object.entries(GV).map(([y,w])=>(0,Ye.h)(YV,{key:y,title:w.title,description:w.description,icon:w.icon,selected:r===y,onClick:()=>i(y),theme:t}))),v&&(0,Ye.h)("div",{class:(0,Oi.default)("-cbwsdk-connect-content-update-app",t)},"Don\u2019t see a ",(0,Ye.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,Ye.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,Ye.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,Ye.h)(g9e.QRCode,{content:o,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:_9e(r),width:25,height:25}}),(0,Ye.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:c9e.LIB_VERSION}),(0,Ye.h)("input",{type:"hidden",value:o})),(0,Ye.h)(c,{theme:t}),!e.isConnected&&(0,Ye.h)("div",{"data-testid":"connecting-spinner",class:(0,Oi.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,Ye.h)(b9e.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,Ye.h)("p",null,"Connecting...")))))}Ri.ConnectContent=w9e;function YV({title:e,description:t,icon:r,selected:n,theme:i,onClick:o}){return(0,Ye.h)("div",{onClick:o,class:(0,Oi.default)("-cbwsdk-connect-item",i,{selected:n})},(0,Ye.h)("div",null,(0,Ye.h)("img",{src:r,alt:e})),(0,Ye.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,Ye.h)("h3",{class:"-cbwsdk-connect-item-title"},e),(0,Ye.h)("p",{class:"-cbwsdk-connect-item-description"},t)))}Ri.ConnectItem=YV;function JV({theme:e}){return(0,Ye.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,Ye.h)("li",{class:(0,Oi.default)("-cbwsdk-wallet-steps-item",e)},(0,Ye.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,Ye.h)("li",{class:(0,Oi.default)("-cbwsdk-wallet-steps-item",e)},(0,Ye.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,Ye.h)("span",null,"Tap ",(0,Ye.h)("strong",null,"Scan")," "),(0,Ye.h)("span",{class:(0,Oi.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,Ye.h)(ZV.QRCodeIcon,{fill:J5(e)})))))}Ri.CoinbaseWalletSteps=JV;function QV({theme:e}){return(0,Ye.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,Ye.h)("li",{class:(0,Oi.default)("-cbwsdk-wallet-steps-item",e)},(0,Ye.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,Ye.h)("li",{class:(0,Oi.default)("-cbwsdk-wallet-steps-item",e)},(0,Ye.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,Ye.h)("span",null,"Tap ",(0,Ye.h)("strong",null,"More")),(0,Ye.h)("span",{class:(0,Oi.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,Ye.h)(m9e.StatusDotIcon,{fill:J5(e)})),(0,Ye.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,Ye.h)("strong",null,"Scan")),(0,Ye.h)("span",{class:(0,Oi.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,Ye.h)(ZV.QRCodeIcon,{fill:J5(e)})))))}Ri.CoinbaseAppSteps=QV});var t$=E(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});Sb.ArrowLeftIcon=void 0;var e$=(Ln(),Pt(Yn));function x9e(e){return(0,e$.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,e$.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Sb.ArrowLeftIcon=x9e});var r$=E(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});Eb.LaptopIcon=void 0;var Q5=(Ln(),Pt(Yn));function M9e(e){return(0,Q5.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Q5.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Q5.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Eb.LaptopIcon=M9e});var i$=E(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});Ab.SafeIcon=void 0;var n$=(Ln(),Pt(Yn));function S9e(e){return(0,n$.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,n$.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Ab.SafeIcon=S9e});var o$=E(X5=>{"use strict";Object.defineProperty(X5,"__esModule",{value:!0});X5.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}"});var a$=E(Yc=>{"use strict";var s$=Yc&&Yc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.TryExtensionContent=void 0;var Bu=s$(Hd()),Lr=(Ln(),Pt(Yn)),eS=(Vc(),Pt(zc)),E9e=t$(),A9e=r$(),O9e=i$(),R9e=s$(o$());function I9e({theme:e}){let[t,r]=(0,eS.useState)(!1),n=(0,eS.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,eS.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Lr.h)("div",{class:(0,Bu.default)("-cbwsdk-try-extension",e)},(0,Lr.h)("style",null,R9e.default),(0,Lr.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Lr.h)("h3",{class:(0,Bu.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Lr.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Lr.h)("button",{class:(0,Bu.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Lr.h)("div",null,!t&&(0,Lr.h)(E9e.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Lr.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Lr.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Lr.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Lr.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Lr.h)("span",{class:(0,Bu.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Lr.h)(A9e.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Lr.h)("div",{class:(0,Bu.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Lr.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Lr.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Lr.h)("span",{class:(0,Bu.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Lr.h)(O9e.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Lr.h)("div",{class:(0,Bu.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Yc.TryExtensionContent=I9e});var u$=E(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});tS.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}"});var c$=E(Jc=>{"use strict";var f$=Jc&&Jc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jc,"__esModule",{value:!0});Jc.ConnectDialog=void 0;var rS=f$(Hd()),Du=(Ln(),Pt(Yn)),nS=(Vc(),Pt(zc)),C9e=XV(),T9e=a$(),k9e=f$(u$()),P9e=e=>{let{isOpen:t,darkMode:r}=e,[n,i]=(0,nS.useState)(!t),[o,a]=(0,nS.useState)(!t);(0,nS.useEffect)(()=>{let v=[window.setTimeout(()=>{a(!t)},10)];return t?i(!1):v.push(window.setTimeout(()=>{i(!0)},360)),()=>{v.forEach(window.clearTimeout)}},[e.isOpen]);let c=r?"dark":"light";return(0,Du.h)("div",{class:(0,rS.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Du.h)("style",null,k9e.default),(0,Du.h)("div",{class:(0,rS.default)("-cbwsdk-connect-dialog-backdrop",c,o&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Du.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Du.h)("div",{class:(0,rS.default)("-cbwsdk-connect-dialog-box",o&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,Du.h)(C9e.ConnectContent,{theme:c,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,Du.h)(T9e.TryExtensionContent,{theme:c}))))};Jc.ConnectDialog=P9e});var h$=E(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});Ob.LinkFlow=void 0;var iS=(Ln(),Pt(Yn)),l$=_u(),N9e=c$(),oS=class{constructor(t){this.extensionUI$=new l$.BehaviorSubject({}),this.subscriptions=new l$.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection,this.connected$=t.connected$,this.chainId$=t.chainId$}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var t;!this.root||(this.subscriptions.unsubscribe(),(0,iS.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;let t=this.extensionUI$.subscribe(()=>{!this.root||(0,iS.render)((0,iS.h)(N9e.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(t)}};Ob.LinkFlow=oS});var d$=E(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});sS.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"});var v$=E(Ii=>{"use strict";var p$=Ii&&Ii.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.SnackbarInstance=Ii.SnackbarContainer=Ii.Snackbar=void 0;var Rb=p$(Hd()),Br=(Ln(),Pt(Yn)),aS=(Vc(),Pt(zc)),q9e=p$(d$()),L9e="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function B9e(e){switch(e){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}var uS=class{constructor(t){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",t.appendChild(this.root),this.render()}presentItem(t){let r=this.nextItemKey++;return this.items.set(r,t),this.render(),()=>{this.items.delete(r),this.render()}}clear(){this.items.clear(),this.render()}render(){!this.root||(0,Br.render)((0,Br.h)("div",null,(0,Br.h)(Ii.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([t,r])=>(0,Br.h)(Ii.SnackbarInstance,Object.assign({},r,{key:t}))))),this.root)}};Ii.Snackbar=uS;var D9e=e=>(0,Br.h)("div",{class:(0,Rb.default)("-cbwsdk-snackbar-container")},(0,Br.h)("style",null,q9e.default),(0,Br.h)("div",{class:"-cbwsdk-snackbar"},e.children));Ii.SnackbarContainer=D9e;var j9e=({autoExpand:e,message:t,menuItems:r,appSrc:n})=>{let[i,o]=(0,aS.useState)(!0),[a,c]=(0,aS.useState)(e??!1);(0,aS.useEffect)(()=>{let y=[window.setTimeout(()=>{o(!1)},1),window.setTimeout(()=>{c(!0)},1e4)];return()=>{y.forEach(window.clearTimeout)}});let v=()=>{c(!a)};return(0,Br.h)("div",{class:(0,Rb.default)("-cbwsdk-snackbar-instance",i&&"-cbwsdk-snackbar-instance-hidden",a&&"-cbwsdk-snackbar-instance-expanded")},(0,Br.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:v},(0,Br.h)("img",{src:B9e(n),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,Br.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,Br.h)("div",{class:"-gear-container"},!a&&(0,Br.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Br.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,Br.h)("img",{src:L9e,class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,Br.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((y,w)=>(0,Br.h)("div",{class:(0,Rb.default)("-cbwsdk-snackbar-instance-menu-item",y.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:y.onClick,key:w},(0,Br.h)("svg",{width:y.svgWidth,height:y.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Br.h)("path",{"fill-rule":y.defaultFillRule,"clip-rule":y.defaultClipRule,d:y.path,fill:"#AAAAAA"})),(0,Br.h)("span",{class:(0,Rb.default)("-cbwsdk-snackbar-instance-menu-item-info",y.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},y.info)))))};Ii.SnackbarInstance=j9e});var m$=E(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});fS.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'});var g$=E(Qc=>{"use strict";var F9e=Qc&&Qc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qc,"__esModule",{value:!0});Qc.injectCssReset=void 0;var U9e=F9e(m$());function H9e(){let e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(U9e.default)),document.documentElement.appendChild(e)}Qc.injectCssReset=H9e});var b$=E(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});Ib.WalletSDKUI=void 0;var W9e=h$(),z9e=v$(),V9e=g$(),cS=class{constructor(t){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new z9e.Snackbar({darkMode:t.darkMode}),this.linkFlow=new W9e.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,connected$:t.connected$,chainId$:t.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");let t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,V9e.injectCssReset)()}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(t){}watchAsset(t){}switchEthereumChain(t){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(t){}signEthereumTransaction(t){}submitEthereumTransaction(t){}ethereumAddressFromSignedMessage(t){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(t){this.appSrc=t}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(t){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}};Ib.WalletSDKUI=cS});var _$=E(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var Xc;(function(e){e.typeOfFunction="function",e.boolTrue=!0})(Xc||(Xc={}));function y$(e,t,r){if(!r||typeof r.value!==Xc.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+t+"> is not a method!");return{configurable:Xc.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,t,{value:n,configurable:Xc.boolTrue,writable:Xc.boolTrue}),n}}}Cb.bind=y$;Cb.default=y$});var w$=E(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.ClientMessagePublishEvent=Ci.ClientMessageSetSessionConfig=Ci.ClientMessageGetSessionConfig=Ci.ClientMessageIsLinked=Ci.ClientMessageHostSession=void 0;function $9e(e){return Object.assign({type:"HostSession"},e)}Ci.ClientMessageHostSession=$9e;function K9e(e){return Object.assign({type:"IsLinked"},e)}Ci.ClientMessageIsLinked=K9e;function G9e(e){return Object.assign({type:"GetSessionConfig"},e)}Ci.ClientMessageGetSessionConfig=G9e;function Z9e(e){return Object.assign({type:"SetSessionConfig"},e)}Ci.ClientMessageSetSessionConfig=Z9e;function Y9e(e){return Object.assign({type:"PublishEvent"},e)}Ci.ClientMessagePublishEvent=Y9e});var M$=E(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.RxWebSocket=ju.ConnectionState=void 0;var el=_u(),x$=Sd(),tl;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(tl=ju.ConnectionState||(ju.ConnectionState={}));var lS=class{constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.connectionStateSubject=new el.BehaviorSubject(tl.DISCONNECTED),this.incomingDataSubject=new el.Subject,this.url=t.replace(/^http/,"ws")}connect(){return this.webSocket?(0,el.throwError)(new Error("webSocket object is not null")):new el.Observable(t=>{let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(n){t.error(n);return}this.connectionStateSubject.next(tl.CONNECTING),r.onclose=n=>{this.clearWebSocket(),t.error(new Error(`websocket error ${n.code}: ${n.reason}`)),this.connectionStateSubject.next(tl.DISCONNECTED)},r.onopen=n=>{t.next(),t.complete(),this.connectionStateSubject.next(tl.CONNECTED)},r.onmessage=n=>{this.incomingDataSubject.next(n.data)}}).pipe((0,x$.take)(1))}disconnect(){let{webSocket:t}=this;if(!!t){this.clearWebSocket(),this.connectionStateSubject.next(tl.DISCONNECTED);try{t.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,x$.flatMap)(t=>{let r;try{r=JSON.parse(t)}catch{return(0,el.empty)()}return(0,el.of)(r)}))}sendData(t){let{webSocket:r}=this;if(!r)throw new Error("websocket is not connected");r.send(t)}clearWebSocket(){let{webSocket:t}=this;!t||(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};ju.RxWebSocket=lS});var S$=E(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});Tb.isServerMessageFail=void 0;function J9e(e){return e&&e.type==="Fail"&&typeof e.id=="number"&&typeof e.sessionId=="string"&&typeof e.error=="string"}Tb.isServerMessageFail=J9e});var A$=E(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});Pb.WalletSDKConnection=void 0;var Zi=_u(),Rt=Sd(),Wd=ub(),rl=Td(),zd=w$(),Vd=pg(),kb=M$(),hS=S$(),E$=1e4,Q9e=6e4,dS=class{constructor(t,r,n,i,o=WebSocket){this.sessionId=t,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new Zi.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,rl.IntNumber)(1),this.connectedSubject=new Zi.BehaviorSubject(!1),this.linkedSubject=new Zi.BehaviorSubject(!1),this.sessionConfigSubject=new Zi.ReplaySubject(1);let a=new kb.RxWebSocket(n+"/rpc",o);this.ws=a,this.subscriptions.add(a.connectionState$.pipe((0,Rt.tap)(c=>{var v;return(v=this.diagnostic)===null||v===void 0?void 0:v.log(Vd.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:Wd.Session.hash(t)})}),(0,Rt.skip)(1),(0,Rt.filter)(c=>c===kb.ConnectionState.DISCONNECTED&&!this.destroyed),(0,Rt.delay)(5e3),(0,Rt.filter)(c=>!this.destroyed),(0,Rt.flatMap)(c=>a.connect()),(0,Rt.retry)()).subscribe()),this.subscriptions.add(a.connectionState$.pipe((0,Rt.skip)(2),(0,Rt.switchMap)(c=>(0,Zi.iif)(()=>c===kb.ConnectionState.CONNECTED,this.authenticate().pipe((0,Rt.tap)(v=>this.sendIsLinked()),(0,Rt.tap)(v=>this.sendGetSessionConfig()),(0,Rt.map)(v=>!0)),(0,Zi.of)(!1))),(0,Rt.distinctUntilChanged)(),(0,Rt.catchError)(c=>(0,Zi.of)(!1))).subscribe(c=>this.connectedSubject.next(c))),this.subscriptions.add(a.connectionState$.pipe((0,Rt.skip)(1),(0,Rt.switchMap)(c=>(0,Zi.iif)(()=>c===kb.ConnectionState.CONNECTED,(0,Zi.timer)(0,E$)))).subscribe(c=>c===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(a.incomingData$.pipe((0,Rt.filter)(c=>c==="h")).subscribe(c=>this.updateLastHeartbeat())),this.subscriptions.add(a.incomingJSONData$.pipe((0,Rt.filter)(c=>["IsLinkedOK","Linked"].includes(c.type))).subscribe(c=>{var v;let y=c;(v=this.diagnostic)===null||v===void 0||v.log(Vd.EVENTS.LINKED,{sessionIdHash:Wd.Session.hash(t),linked:y.linked,type:c.type,onlineGuests:y.onlineGuests}),this.linkedSubject.next(y.linked||y.onlineGuests>0)})),this.subscriptions.add(a.incomingJSONData$.pipe((0,Rt.filter)(c=>["GetSessionConfigOK","SessionConfigUpdated"].includes(c.type))).subscribe(c=>{var v;let y=c;(v=this.diagnostic)===null||v===void 0||v.log(Vd.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Wd.Session.hash(t),metadata_keys:y&&y.metadata?Object.keys(y.metadata):void 0}),this.sessionConfigSubject.next({webhookId:y.webhookId,webhookUrl:y.webhookUrl,metadata:y.metadata})}))}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Vd.EVENTS.STARTED_CONNECTING,{sessionIdHash:Wd.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var t;this.subscriptions.unsubscribe(),this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Vd.EVENTS.DISCONNECTED,{sessionIdHash:Wd.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,Rt.filter)(t=>t),(0,Rt.take)(1),(0,Rt.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,Rt.filter)(t=>t),(0,Rt.take)(1),(0,Rt.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,Rt.filter)(t=>{if(t.type!=="Event")return!1;let r=t;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,Rt.map)(t=>t))}setSessionMetadata(t,r){let n=(0,zd.ClientMessageSetSessionConfig)({id:(0,rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[t]:r}});return this.onceConnected$.pipe((0,Rt.flatMap)(i=>this.makeRequest(n)),(0,Rt.map)(i=>{if((0,hS.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(t,r,n=!1){let i=(0,zd.ClientMessagePublishEvent)({id:(0,rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:t,data:r,callWebhook:n});return this.onceLinked$.pipe((0,Rt.flatMap)(o=>this.makeRequest(i)),(0,Rt.map)(o=>{if((0,hS.isServerMessageFail)(o))throw new Error(o.error||"failed to publish event");return o.eventId}))}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>E$*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(t,r=Q9e){let n=t.id;try{this.sendData(t)}catch(i){return(0,Zi.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,Rt.timeoutWith)(r,(0,Zi.throwError)(new Error(`request ${n} timed out`))),(0,Rt.filter)(i=>i.id===n),(0,Rt.take)(1))}authenticate(){let t=(0,zd.ClientMessageHostSession)({id:(0,rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(t).pipe((0,Rt.map)(r=>{if((0,hS.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){let t=(0,zd.ClientMessageIsLinked)({id:(0,rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}sendGetSessionConfig(){let t=(0,zd.ClientMessageGetSessionConfig)({id:(0,rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}};Pb.WalletSDKConnection=dS});var O$=E(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});Nb.WalletUIError=void 0;var Fu=class extends Error{constructor(t,r){super(t),this.message=t,this.errorCode=r}};Nb.WalletUIError=Fu;Fu.UserRejectedRequest=new Fu("User rejected request");Fu.SwitchEthereumChainUnsupportedChainId=new Fu("Unsupported chainId",4902)});var R$=E(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.decrypt=nl.encrypt=void 0;var X9e=_u(),qb=ns();async function e7e(e,t){if(t.length!==64)throw Error("secret must be 256 bits");let r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,qb.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(e)),a=16,c=o.slice(o.byteLength-a),v=o.slice(0,o.byteLength-a),y=new Uint8Array(c),w=new Uint8Array(v),M=new Uint8Array([...r,...y,...w]);return(0,qb.uint8ArrayToHex)(M)}nl.encrypt=e7e;function t7e(e,t){if(t.length!==64)throw Error("secret must be 256 bits");return new X9e.Observable(r=>{(async function(){let n=await crypto.subtle.importKey("raw",(0,qb.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=(0,qb.hexStringToUint8Array)(e),o=i.slice(0,12),a=i.slice(12,28),c=i.slice(28),v=new Uint8Array([...c,...a]),y={name:"AES-GCM",iv:new Uint8Array(o)};try{let w=await window.crypto.subtle.decrypt(y,n,v),M=new TextDecoder;r.next(M.decode(w)),r.complete()}catch(w){r.error(w)}})()})}nl.decrypt=t7e});var pS=E($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.Web3Method=void 0;var r7e;(function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"})(r7e=$d.Web3Method||($d.Web3Method={}))});var Lb=E(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.RelayMessageType=void 0;var n7e;(function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"})(n7e=Kd.RelayMessageType||(Kd.RelayMessageType={}))});var I$=E(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});Bb.Web3RequestCanceledMessage=void 0;var i7e=Lb();function o7e(e){return{type:i7e.RelayMessageType.WEB3_REQUEST_CANCELED,id:e}}Bb.Web3RequestCanceledMessage=o7e});var C$=E(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});Db.Web3RequestMessage=void 0;var s7e=Lb();function a7e(e){return Object.assign({type:s7e.RelayMessageType.WEB3_REQUEST},e)}Db.Web3RequestMessage=a7e});var T$=E(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.EthereumAddressFromSignedMessageResponse=br.SubmitEthereumTransactionResponse=br.SignEthereumTransactionResponse=br.SignEthereumMessageResponse=br.isRequestEthereumAccountsResponse=br.SelectProviderResponse=br.WatchAssetReponse=br.RequestEthereumAccountsResponse=br.SwitchEthereumChainResponse=br.AddEthereumChainResponse=br.ErrorResponse=void 0;var Io=pS();function u7e(e,t,r){return{method:e,errorMessage:t,errorCode:r}}br.ErrorResponse=u7e;function f7e(e){return{method:Io.Web3Method.addEthereumChain,result:e}}br.AddEthereumChainResponse=f7e;function c7e(e){return{method:Io.Web3Method.switchEthereumChain,result:e}}br.SwitchEthereumChainResponse=c7e;function l7e(e){return{method:Io.Web3Method.requestEthereumAccounts,result:e}}br.RequestEthereumAccountsResponse=l7e;function h7e(e){return{method:Io.Web3Method.watchAsset,result:e}}br.WatchAssetReponse=h7e;function d7e(e){return{method:Io.Web3Method.selectProvider,result:e}}br.SelectProviderResponse=d7e;function p7e(e){return e&&e.method===Io.Web3Method.requestEthereumAccounts}br.isRequestEthereumAccountsResponse=p7e;function v7e(e){return{method:Io.Web3Method.signEthereumMessage,result:e}}br.SignEthereumMessageResponse=v7e;function m7e(e){return{method:Io.Web3Method.signEthereumTransaction,result:e}}br.SignEthereumTransactionResponse=m7e;function g7e(e){return{method:Io.Web3Method.submitEthereumTransaction,result:e}}br.SubmitEthereumTransactionResponse=g7e;function b7e(e){return{method:Io.Web3Method.ethereumAddressFromSignedMessage,result:e}}br.EthereumAddressFromSignedMessageResponse=b7e});var P$=E(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.isWeb3ResponseMessage=il.Web3ResponseMessage=void 0;var k$=Lb();function y7e(e){return Object.assign({type:k$.RelayMessageType.WEB3_RESPONSE},e)}il.Web3ResponseMessage=y7e;function _7e(e){return e&&e.type===k$.RelayMessageType.WEB3_RESPONSE}il.isWeb3ResponseMessage=_7e});var B$=E(Jn=>{"use strict";var w7e=Jn&&Jn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),x7e=Jn&&Jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),q$=Jn&&Jn.__decorate||function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},M7e=Jn&&Jn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&w7e(t,e,r);return x7e(t,e),t},S7e=Jn&&Jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.WalletSDKRelay=void 0;var L$=S7e(_$()),N$=hg(),Gd=_u(),Ur=Sd(),Sn=pg(),E7e=A$(),vS=O$(),A7e=Td(),yr=ns(),ia=M7e(R$()),oa=ub(),jb=R5(),Jr=pS(),O7e=I$(),R7e=C$(),oi=T$(),Bn=P$(),si=class extends jb.WalletSDKRelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new Gd.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new Gd.Subscription,this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;let{session:n,ui:i,connection:o}=this.subscribe();if(this._session=n,this.connection=o,this.relayEventManager=t.relayEventManager,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this.diagnostic={log:t.eventListener.onEvent}:this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));let t=oa.Session.load(this.storage)||new oa.Session(this.storage).save(),r=new E7e.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Sn.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,Ur.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,Ur.skip)(1),(0,Ur.tap)(i=>{var o;this.isLinked=i;let a=this.storage.getItem(jb.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,a){let c=a.split(" "),v=this.storage.getItem("IsStandaloneSigning")==="true";if(c[0]!==""&&!i&&this.session.linked&&!v){this.isUnlinkedErrorState=!0;let y=this.getSessionIdHash();(o=this.diagnostic)===null||o===void 0||o.log(Sn.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:y})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;let o=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(Sn.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:o,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,Ur.mergeMap)(i=>ia.decrypt(i.metadata.WalletUsername,t.secret))).subscribe({next:i=>{this.storage.setItem(jb.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Sn.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,Ur.mergeMap)(i=>ia.decrypt(i.metadata.AppVersion,t.secret))).subscribe({next:i=>{this.storage.setItem(jb.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Sn.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,Ur.mergeMap)(i=>(0,Gd.zip)(ia.decrypt(i.metadata.ChainId,t.secret),ia.decrypt(i.metadata.JsonRpcUrl,t.secret)))).pipe((0,Ur.distinctUntilChanged)()).subscribe({next:([i,o])=>{this.chainCallback&&this.chainCallback(i,o)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Sn.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,Ur.mergeMap)(i=>ia.decrypt(i.metadata.EthereumAddress,t.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),si.accountRequestCallbackIds.size>0&&(Array.from(si.accountRequestCallbackIds.values()).forEach(o=>{let a=(0,Bn.Web3ResponseMessage)({id:o,response:(0,oi.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},a),{id:o}))}),si.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Sn.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,Ur.mergeMap)(i=>ia.decrypt(i.metadata.AppSrc,t.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Sn.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));let n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:t,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:t,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Ur.timeout)(1e3),(0,Ur.catchError)(t=>(0,Gd.of)(null))).subscribe(t=>{var r,n,i;let o=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log(Sn.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(Sn.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();let a=oa.Session.load(this.storage);if(a?.id===this._session.id?this.storage.clear():a&&((i=this.diagnostic)===null||i===void 0||i.log(Sn.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:oa.Session.hash(a.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);let{session:c,ui:v,connection:y}=this.subscribe();this._session=c,this.connection=y,this.ui=v,o&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Sn.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:Jr.Web3Method.signEthereumMessage,params:{message:(0,yr.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:Jr.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,yr.hexStringFromBuffer)(t,!0),signature:(0,yr.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:Jr.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,yr.bigIntStringFromBN)(t.weiValue),data:(0,yr.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,yr.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,yr.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,yr.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,yr.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:Jr.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,yr.bigIntStringFromBN)(t.weiValue),data:(0,yr.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,yr.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,yr.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,yr.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,yr.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:Jr.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,yr.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:Jr.Web3Method.scanQRCode,params:{regExp:t}})}getQRCodeUrl(){return(0,yr.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:Jr.Web3Method.generic,params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null,n=(0,yr.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r?.()};return{promise:new Promise((a,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,v=>{if(r?.(),v.errorMessage)return c(new Error(v.errorMessage));a(v)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChainSubject.next(t)}publishWeb3RequestEvent(t,r){var n;let i=(0,R7e.Web3RequestMessage)({id:t,request:r}),o=oa.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Sn.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?oa.Session.hash(o.id):"",isSessionMismatched:(o?.id!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(Sn.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?oa.Session.hash(o.id):"",isSessionMismatched:(o?.id!==this._session.id).toString()})},error:a=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:a.message}}))}}))}publishWeb3RequestCanceledEvent(t){let r=(0,O7e.Web3RequestCanceledMessage)(t);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(t,r,n){let i=this.session.secret;return new Gd.Observable(o=>{ia.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(a=>{o.next(a),o.complete()})}).pipe((0,Ur.mergeMap)(o=>this.connection.publishEvent(t,o,n)))}handleIncomingEvent(t){try{this.subscriptions.add(ia.decrypt(t.data,this.session.secret).pipe((0,Ur.map)(r=>JSON.parse(r))).subscribe({next:r=>{let n=(0,Bn.isWeb3ResponseMessage)(r)?r:null;!n||this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Sn.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(t){var r;let{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(Sn.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,oi.isRequestEthereumAccountsResponse)(n)){si.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),si.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:t,response:(0,oi.ErrorResponse)(r,(n??vS.WalletUIError.UserRejectedRequest).message,i)}))}invokeCallback(t){let r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){let t={method:Jr.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=null,n=(0,yr.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r?.()};return{promise:new Promise((a,c)=>{var v;this.relayEventManager.callbacks.set(n,w=>{if(this.ui.hideRequestEthereumAccounts(),r?.(),w.errorMessage)return c(new Error(w.errorMessage));a(w)});let y=((v=window?.navigator)===null||v===void 0?void 0:v.userAgent)||null;if(y&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(y)){let w;try{(0,yr.isInIFrame)()&&window.top?w=window.top.location:w=window.location}catch{w=window.location}w.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(w.href)}`;return}if(this.ui.inlineAccountsResponse()){let w=M=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:n,response:(0,oi.RequestEthereumAccountsResponse)(M)}))};this.ui.requestEthereumAccounts({onCancel:i,onAccounts:w})}else{let w=N$.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>i(w)})}si.accountRequestCallbackIds.add(n),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(n,t)}),cancel:i}}selectProvider(t){let r={method:Jr.Web3Method.selectProvider,params:{providerOptions:t}},n=(0,yr.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},o=new Promise((a,c)=>{this.relayEventManager.callbacks.set(n,w=>{if(w.errorMessage)return c(new Error(w.errorMessage));a(w)});let v=w=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:n,response:(0,oi.SelectProviderResponse)(A7e.ProviderType.Unselected)}))},y=w=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:n,response:(0,oi.SelectProviderResponse)(w)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:y,onCancel:v,providerOptions:t})});return{cancel:i,promise:o}}watchAsset(t,r,n,i,o,a){let c={method:Jr.Web3Method.watchAsset,params:{type:t,options:{address:r,symbol:n,decimals:i,image:o},chainId:a}},v=null,y=(0,yr.randomBytesHex)(8),w=S=>{this.publishWeb3RequestCanceledEvent(y),this.handleErrorResponse(y,c.method,S),v?.()};this.ui.inlineWatchAsset()||(v=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:w,onResetConnection:this.resetAndReload}));let M=new Promise((S,R)=>{this.relayEventManager.callbacks.set(y,N=>{if(v?.(),N.errorMessage)return R(new Error(N.errorMessage));S(N)});let C=N=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:y,response:(0,oi.WatchAssetReponse)(!1)}))},B=()=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:y,response:(0,oi.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:B,onCancel:C,type:t,address:r,symbol:n,decimals:i,image:o,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(y,c)});return{cancel:w,promise:M}}addEthereumChain(t,r,n,i,o,a){let c={method:Jr.Web3Method.addEthereumChain,params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:o,iconUrls:n,nativeCurrency:a}},v=null,y=(0,yr.randomBytesHex)(8),w=S=>{this.publishWeb3RequestCanceledEvent(y),this.handleErrorResponse(y,c.method,S),v?.()};return this.ui.inlineAddEthereumChain(t)||(v=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:w,onResetConnection:this.resetAndReload})),{promise:new Promise((S,R)=>{this.relayEventManager.callbacks.set(y,N=>{if(v?.(),N.errorMessage)return R(new Error(N.errorMessage));S(N)});let C=N=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:y,response:(0,oi.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},B=N=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:y,response:(0,oi.AddEthereumChainResponse)({isApproved:!0,rpcUrl:N})}))};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:C,onApprove:B,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(y,c)}),cancel:w}}switchEthereumChain(t,r){let n={method:Jr.Web3Method.switchEthereumChain,params:Object.assign({chainId:t},{address:r})},i=(0,yr.randomBytesHex)(8),o=c=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,c)};return{promise:new Promise((c,v)=>{this.relayEventManager.callbacks.set(i,M=>{if(M.errorMessage&&M.errorCode)return v(N$.ethErrors.provider.custom({code:M.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(M.errorMessage)return v(new Error(M.errorMessage));c(M)});let y=M=>{if(typeof M=="number"){let S=M;this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:i,response:(0,oi.ErrorResponse)(Jr.Web3Method.switchEthereumChain,vS.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,S)}))}else M instanceof vS.WalletUIError?this.handleErrorResponse(i,Jr.Web3Method.switchEthereumChain,M,M.errorCode):this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:i,response:(0,oi.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},w=M=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:i,response:(0,oi.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:M})}))};this.ui.switchEthereumChain({onCancel:y,onApprove:w,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:o}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return oa.Session.hash(this._session.id)}sendRequestStandalone(t,r){let n=o=>{this.handleErrorResponse(t,r.method,o)},i=o=>{this.handleWeb3ResponseMessage((0,Bn.Web3ResponseMessage)({id:t,response:o}))};switch(r.method){case Jr.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case Jr.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Jr.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Jr.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(t){}};si.accountRequestCallbackIds=new Set;q$([L$.default],si.prototype,"resetAndReload",null);q$([L$.default],si.prototype,"handleIncomingEvent",null);Jn.WalletSDKRelay=si});var D$=E(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});Fb.WalletSDKRelayEventManager=void 0;var I7e=ns(),mS=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;let t=this._nextRequestId,r=(0,I7e.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}};Fb.WalletSDKRelayEventManager=mS});var j$=E((PUe,C7e)=>{C7e.exports={name:"@coinbase/wallet-sdk",version:"3.6.3",description:"Coinbase Wallet JavaScript SDK",keywords:["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],main:"dist/index.js",types:"dist/index.d.ts",repository:"https://github.com/coinbase/coinbase-wallet-sdk.git",author:"Coinbase, Inc.",license:"Apache-2.0",scripts:{"pretest:unit":"node compile-assets.js","test:unit":"jest","test:unit:coverage":"yarn test:unit && open coverage/lcov-report/index.html","test:karma":"yarn build-npm && karma start",prebuild:`rm -rf ./build && node -p "'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/version.ts`,build:"node compile-assets.js && webpack --config webpack.config.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export LINK_API_URL='http://localhost:3000'; yarn build","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --exec 'yarn build:dev'","build:prod":`yarn prebuild && yarn build && yarn build-npm && cp ./package.json ../../README.md ./LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i.bak 's| "private": true,||g' build/npm/package.json && rm -f build/npm/package.json.bak`,"lint:types":"tsc --noEmit","lint:prettier":'prettier --check "{src,__tests__}/**/*.(js|ts|tsx)"',"lint:eslint":"eslint ./src --ext .ts,.tsx",lint:"yarn lint:eslint && yarn lint:types && yarn lint:prettier","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier . --write",release:"./scripts/release.sh"},dependencies:{"@metamask/safe-event-emitter":"2.0.0","@solana/web3.js":"^1.70.1","bind-decorator":"^1.0.11","bn.js":"^5.1.1",buffer:"^6.0.3",clsx:"^1.1.0","eth-block-tracker":"4.4.3","eth-json-rpc-filters":"4.2.2","eth-rpc-errors":"4.0.2","json-rpc-engine":"6.1.0",keccak:"^3.0.1",preact:"^10.5.9",qs:"^6.10.3",rxjs:"^6.6.3","sha.js":"^2.4.11","stream-browserify":"^3.0.0",util:"^0.12.4"},devDependencies:{"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/plugin-transform-react-jsx":"^7.17.3","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@peculiar/webcrypto":"^1.3.3","@testing-library/jest-dom":"^5.16.4","@testing-library/preact":"^2.0.1","@types/bn.js":"^4.11.6","@types/jest":"^27.4.1","@types/node":"^14.14.20","@types/qs":"^6.9.7","@types/sha.js":"^2.4.0","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/eslint-plugin-tslint":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.5.1",browserify:"17.0.0","copy-webpack-plugin":"^6.4.1","core-js":"^3.8.2",eslint:"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2","jest-websocket-mock":"^2.3.0",karma:"^6.3.15","karma-browserify":"8.1.0","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1",nodemon:"^2.0.6",prettier:"^2.5.1","raw-loader":"^4.0.2","regenerator-runtime":"^0.13.7",sass:"^1.50.0",svgo:"^2.8.0","ts-jest":"^27.1.4","ts-loader":"^8.0.13","ts-node":"^10.7.0",tslib:"^2.0.3",typescript:"^4.1.3",watchify:"4.0.0",webpack:"^5.72.0","webpack-cli":"^4.9.2","whatwg-fetch":"^3.5.0"},engines:{node:">= 10.0.0"}}});var gS=E(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});Ub.CoinbaseWalletSDK=void 0;var T7e=PD(),k7e=ND(),P7e=db(),N7e=b$(),q7e=B$(),L7e=D$(),B7e=ns(),D7e=process.env.LINK_API_URL||"https://www.walletlink.org",F$=process.env.SDK_VERSION||j$().version||"unknown",ol=class{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;let o=t.linkAPIUrl||D7e,a;if(t.uiConstructor?a=t.uiConstructor:a=y=>new N7e.WalletSDKUI(y),typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this._diagnosticLogger={log:t.eventListener.onEvent}:this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;let c=new URL(o),v=`${c.protocol}//${c.host}`;this._storage=new k7e.ScopedLocalStorage(`-walletlink:${v}`),this._storage.setItem("version",ol.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new L7e.WalletSDKRelayEventManager,this._relay=new q7e.WalletSDKRelay({linkAPIUrl:o,version:F$,darkMode:!!t.darkMode,uiConstructor:a,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger}),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI())}makeWeb3Provider(t="",r=1){let n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;let i=this.coinbaseBrowser;if(i)return i;let o=this._relay;if(!o||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||o.setConnectDisabled(!0),new P7e.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(o),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,B7e.getFavicon)();let i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;let r=this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,T7e.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{let n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}};Ub.CoinbaseWalletSDK=ol;ol.VERSION=F$});var H$=E(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.CoinbaseWalletProvider=Uu.CoinbaseWalletSDK=void 0;var bS=gS(),U$=db(),j7e=gS();Object.defineProperty(Uu,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return j7e.CoinbaseWalletSDK}});var F7e=db();Object.defineProperty(Uu,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return F7e.CoinbaseWalletProvider}});Uu.default=bS.CoinbaseWalletSDK;typeof window<"u"&&(window.CoinbaseWalletSDK=bS.CoinbaseWalletSDK,window.CoinbaseWalletProvider=U$.CoinbaseWalletProvider,window.WalletLink=bS.CoinbaseWalletSDK,window.WalletLinkProvider=U$.CoinbaseWalletProvider)});var EK=E((SK,IS)=>{(function(e){if(typeof SK=="object"&&typeof IS<"u")IS.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof globalThis<"u"?t=globalThis:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(i,o,a){function c(w,M){if(!o[w]){if(!i[w]){var S=typeof vl=="function"&&vl;if(!M&&S)return S(w,!0);if(v)return v(w,!0);var R=new Error("Cannot find module '"+w+"'");throw R.code="MODULE_NOT_FOUND",R}var C=o[w]={exports:{}};i[w][0].call(C.exports,function(B){var N=i[w][1][B];return c(N||B)},C,C.exports,n,i,o,a)}return o[w].exports}for(var v=typeof vl=="function"&&vl,y=0;y<a.length;y++)c(a[y]);return c}({1:[function(n,i,o){(function(a){"use strict";var c=a.MutationObserver||a.WebKitMutationObserver,v;if(c){var y=0,w=new c(B),M=a.document.createTextNode("");w.observe(M,{characterData:!0}),v=function(){M.data=y=++y%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var S=new a.MessageChannel;S.port1.onmessage=B,v=function(){S.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?v=function(){var q=a.document.createElement("script");q.onreadystatechange=function(){B(),q.onreadystatechange=null,q.parentNode.removeChild(q),q=null},a.document.documentElement.appendChild(q)}:v=function(){setTimeout(B,0)};var R,C=[];function B(){R=!0;for(var q,H,D=C.length;D;){for(H=C,C=[],q=-1;++q<D;)H[q]();D=C.length}R=!1}i.exports=N;function N(q){C.push(q)===1&&!R&&v()}}).call(this,typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function c(){}var v={},y=["REJECTED"],w=["FULFILLED"],M=["PENDING"];i.exports=S;function S(K){if(typeof K!="function")throw new TypeError("resolver must be a function");this.state=M,this.queue=[],this.outcome=void 0,K!==c&&N(this,K)}S.prototype.catch=function(K){return this.then(null,K)},S.prototype.then=function(K,X){if(typeof K!="function"&&this.state===w||typeof X!="function"&&this.state===y)return this;var V=new this.constructor(c);if(this.state!==M){var T=this.state===w?K:X;C(V,T,this.outcome)}else this.queue.push(new R(V,K,X));return V};function R(K,X,V){this.promise=K,typeof X=="function"&&(this.onFulfilled=X,this.callFulfilled=this.otherCallFulfilled),typeof V=="function"&&(this.onRejected=V,this.callRejected=this.otherCallRejected)}R.prototype.callFulfilled=function(K){v.resolve(this.promise,K)},R.prototype.otherCallFulfilled=function(K){C(this.promise,this.onFulfilled,K)},R.prototype.callRejected=function(K){v.reject(this.promise,K)},R.prototype.otherCallRejected=function(K){C(this.promise,this.onRejected,K)};function C(K,X,V){a(function(){var T;try{T=X(V)}catch(m){return v.reject(K,m)}T===K?v.reject(K,new TypeError("Cannot resolve promise with itself")):v.resolve(K,T)})}v.resolve=function(K,X){var V=q(B,X);if(V.status==="error")return v.reject(K,V.value);var T=V.value;if(T)N(K,T);else{K.state=w,K.outcome=X;for(var m=-1,s=K.queue.length;++m<s;)K.queue[m].callFulfilled(X)}return K},v.reject=function(K,X){K.state=y,K.outcome=X;for(var V=-1,T=K.queue.length;++V<T;)K.queue[V].callRejected(X);return K};function B(K){var X=K&&K.then;if(K&&(typeof K=="object"||typeof K=="function")&&typeof X=="function")return function(){X.apply(K,arguments)}}function N(K,X){var V=!1;function T(d){V||(V=!0,v.reject(K,d))}function m(d){V||(V=!0,v.resolve(K,d))}function s(){X(m,T)}var l=q(s);l.status==="error"&&T(l.value)}function q(K,X){var V={};try{V.value=K(X),V.status="success"}catch(T){V.status="error",V.value=T}return V}S.resolve=H;function H(K){return K instanceof this?K:v.resolve(new this(c),K)}S.reject=D;function D(K){var X=new this(c);return v.reject(X,K)}S.all=ee;function ee(K){var X=this;if(Object.prototype.toString.call(K)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=K.length,T=!1;if(!V)return this.resolve([]);for(var m=new Array(V),s=0,l=-1,d=new this(c);++l<V;)f(K[l],l);return d;function f(p,g){X.resolve(p).then(b,function(h){T||(T=!0,v.reject(d,h))});function b(h){m[g]=h,++s===V&&!T&&(T=!0,v.resolve(d,m))}}}S.race=ge;function ge(K){var X=this;if(Object.prototype.toString.call(K)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=K.length,T=!1;if(!V)return this.resolve([]);for(var m=-1,s=new this(c);++m<V;)l(K[m]);return s;function l(d){X.resolve(d).then(function(f){T||(T=!0,v.resolve(s,f))},function(f){T||(T=!0,v.reject(s,f))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k};function c(k,U){if(!(k instanceof U))throw new TypeError("Cannot call a class as a function")}function v(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var y=v();function w(){try{if(!y||!y.open)return!1;var k=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),U=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!k||U)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function M(k,U){k=k||[],U=U||{};try{return new Blob(k,U)}catch(z){if(z.name!=="TypeError")throw z;for(var P=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,$=new P,Z=0;Z<k.length;Z+=1)$.append(k[Z]);return $.getBlob(U.type)}}typeof Promise>"u"&&n(3);var S=Promise;function R(k,U){U&&k.then(function(P){U(null,P)},function(P){U(P)})}function C(k,U,P){typeof U=="function"&&k.then(U),typeof P=="function"&&k.catch(P)}function B(k){return typeof k!="string"&&(console.warn(k+" used as a key, but it is not a string."),k=String(k)),k}function N(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var q="local-forage-detect-blob-support",H=void 0,D={},ee=Object.prototype.toString,ge="readonly",K="readwrite";function X(k){for(var U=k.length,P=new ArrayBuffer(U),$=new Uint8Array(P),Z=0;Z<U;Z++)$[Z]=k.charCodeAt(Z);return P}function V(k){return new S(function(U){var P=k.transaction(q,K),$=M([""]);P.objectStore(q).put($,"key"),P.onabort=function(Z){Z.preventDefault(),Z.stopPropagation(),U(!1)},P.oncomplete=function(){var Z=navigator.userAgent.match(/Chrome\/(\d+)/),z=navigator.userAgent.match(/Edge\//);U(z||!Z||parseInt(Z[1],10)>=43)}}).catch(function(){return!1})}function T(k){return typeof H=="boolean"?S.resolve(H):V(k).then(function(U){return H=U,H})}function m(k){var U=D[k.name],P={};P.promise=new S(function($,Z){P.resolve=$,P.reject=Z}),U.deferredOperations.push(P),U.dbReady?U.dbReady=U.dbReady.then(function(){return P.promise}):U.dbReady=P.promise}function s(k){var U=D[k.name],P=U.deferredOperations.pop();if(P)return P.resolve(),P.promise}function l(k,U){var P=D[k.name],$=P.deferredOperations.pop();if($)return $.reject(U),$.promise}function d(k,U){return new S(function(P,$){if(D[k.name]=D[k.name]||I(),k.db)if(U)m(k),k.db.close();else return P(k.db);var Z=[k.name];U&&Z.push(k.version);var z=y.open.apply(y,Z);U&&(z.onupgradeneeded=function(fe){var Oe=z.result;try{Oe.createObjectStore(k.storeName),fe.oldVersion<=1&&Oe.createObjectStore(q)}catch(je){if(je.name==="ConstraintError")console.warn('The database "'+k.name+'" has been upgraded from version '+fe.oldVersion+" to version "+fe.newVersion+', but the storage "'+k.storeName+'" already exists.');else throw je}}),z.onerror=function(fe){fe.preventDefault(),$(z.error)},z.onsuccess=function(){var fe=z.result;fe.onversionchange=function(Oe){Oe.target.close()},P(fe),s(k)}})}function f(k){return d(k,!1)}function p(k){return d(k,!0)}function g(k,U){if(!k.db)return!0;var P=!k.db.objectStoreNames.contains(k.storeName),$=k.version<k.db.version,Z=k.version>k.db.version;if($&&(k.version!==U&&console.warn('The database "'+k.name+`" can't be downgraded from version `+k.db.version+" to version "+k.version+"."),k.version=k.db.version),Z||P){if(P){var z=k.db.version+1;z>k.version&&(k.version=z)}return!0}return!1}function b(k){return new S(function(U,P){var $=new FileReader;$.onerror=P,$.onloadend=function(Z){var z=btoa(Z.target.result||"");U({__local_forage_encoded_blob:!0,data:z,type:k.type})},$.readAsBinaryString(k)})}function h(k){var U=X(atob(k.data));return M([U],{type:k.type})}function u(k){return k&&k.__local_forage_encoded_blob}function _(k){var U=this,P=U._initReady().then(function(){var $=D[U._dbInfo.name];if($&&$.dbReady)return $.dbReady});return C(P,k,k),P}function A(k){m(k);for(var U=D[k.name],P=U.forages,$=0;$<P.length;$++){var Z=P[$];Z._dbInfo.db&&(Z._dbInfo.db.close(),Z._dbInfo.db=null)}return k.db=null,f(k).then(function(z){return k.db=z,g(k)?p(k):z}).then(function(z){k.db=U.db=z;for(var fe=0;fe<P.length;fe++)P[fe]._dbInfo.db=z}).catch(function(z){throw l(k,z),z})}function x(k,U,P,$){$===void 0&&($=1);try{var Z=k.db.transaction(k.storeName,U);P(null,Z)}catch(z){if($>0&&(!k.db||z.name==="InvalidStateError"||z.name==="NotFoundError"))return S.resolve().then(function(){if(!k.db||z.name==="NotFoundError"&&!k.db.objectStoreNames.contains(k.storeName)&&k.version<=k.db.version)return k.db&&(k.version=k.db.version+1),p(k)}).then(function(){return A(k).then(function(){x(k,U,P,$-1)})}).catch(P);P(z)}}function I(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function j(k){var U=this,P={db:null};if(k)for(var $ in k)P[$]=k[$];var Z=D[P.name];Z||(Z=I(),D[P.name]=Z),Z.forages.push(U),U._initReady||(U._initReady=U.ready,U.ready=_);var z=[];function fe(){return S.resolve()}for(var Oe=0;Oe<Z.forages.length;Oe++){var je=Z.forages[Oe];je!==U&&z.push(je._initReady().catch(fe))}var Fe=Z.forages.slice(0);return S.all(z).then(function(){return P.db=Z.db,f(P)}).then(function(Ue){return P.db=Ue,g(P,U._defaultConfig.version)?p(P):Ue}).then(function(Ue){P.db=Z.db=Ue,U._dbInfo=P;for(var ze=0;ze<Fe.length;ze++){var bt=Fe[ze];bt!==U&&(bt._dbInfo.db=P.db,bt._dbInfo.version=P.version)}})}function O(k,U){var P=this;k=B(k);var $=new S(function(Z,z){P.ready().then(function(){x(P._dbInfo,ge,function(fe,Oe){if(fe)return z(fe);try{var je=Oe.objectStore(P._dbInfo.storeName),Fe=je.get(k);Fe.onsuccess=function(){var Ue=Fe.result;Ue===void 0&&(Ue=null),u(Ue)&&(Ue=h(Ue)),Z(Ue)},Fe.onerror=function(){z(Fe.error)}}catch(Ue){z(Ue)}})}).catch(z)});return R($,U),$}function L(k,U){var P=this,$=new S(function(Z,z){P.ready().then(function(){x(P._dbInfo,ge,function(fe,Oe){if(fe)return z(fe);try{var je=Oe.objectStore(P._dbInfo.storeName),Fe=je.openCursor(),Ue=1;Fe.onsuccess=function(){var ze=Fe.result;if(ze){var bt=ze.value;u(bt)&&(bt=h(bt));var Ht=k(bt,ze.key,Ue++);Ht!==void 0?Z(Ht):ze.continue()}else Z()},Fe.onerror=function(){z(Fe.error)}}catch(ze){z(ze)}})}).catch(z)});return R($,U),$}function W(k,U,P){var $=this;k=B(k);var Z=new S(function(z,fe){var Oe;$.ready().then(function(){return Oe=$._dbInfo,ee.call(U)==="[object Blob]"?T(Oe.db).then(function(je){return je?U:b(U)}):U}).then(function(je){x($._dbInfo,K,function(Fe,Ue){if(Fe)return fe(Fe);try{var ze=Ue.objectStore($._dbInfo.storeName);je===null&&(je=void 0);var bt=ze.put(je,k);Ue.oncomplete=function(){je===void 0&&(je=null),z(je)},Ue.onabort=Ue.onerror=function(){var Ht=bt.error?bt.error:bt.transaction.error;fe(Ht)}}catch(Ht){fe(Ht)}})}).catch(fe)});return R(Z,P),Z}function F(k,U){var P=this;k=B(k);var $=new S(function(Z,z){P.ready().then(function(){x(P._dbInfo,K,function(fe,Oe){if(fe)return z(fe);try{var je=Oe.objectStore(P._dbInfo.storeName),Fe=je.delete(k);Oe.oncomplete=function(){Z()},Oe.onerror=function(){z(Fe.error)},Oe.onabort=function(){var Ue=Fe.error?Fe.error:Fe.transaction.error;z(Ue)}}catch(Ue){z(Ue)}})}).catch(z)});return R($,U),$}function G(k){var U=this,P=new S(function($,Z){U.ready().then(function(){x(U._dbInfo,K,function(z,fe){if(z)return Z(z);try{var Oe=fe.objectStore(U._dbInfo.storeName),je=Oe.clear();fe.oncomplete=function(){$()},fe.onabort=fe.onerror=function(){var Fe=je.error?je.error:je.transaction.error;Z(Fe)}}catch(Fe){Z(Fe)}})}).catch(Z)});return R(P,k),P}function De(k){var U=this,P=new S(function($,Z){U.ready().then(function(){x(U._dbInfo,ge,function(z,fe){if(z)return Z(z);try{var Oe=fe.objectStore(U._dbInfo.storeName),je=Oe.count();je.onsuccess=function(){$(je.result)},je.onerror=function(){Z(je.error)}}catch(Fe){Z(Fe)}})}).catch(Z)});return R(P,k),P}function Y(k,U){var P=this,$=new S(function(Z,z){if(k<0){Z(null);return}P.ready().then(function(){x(P._dbInfo,ge,function(fe,Oe){if(fe)return z(fe);try{var je=Oe.objectStore(P._dbInfo.storeName),Fe=!1,Ue=je.openKeyCursor();Ue.onsuccess=function(){var ze=Ue.result;if(!ze){Z(null);return}k===0||Fe?Z(ze.key):(Fe=!0,ze.advance(k))},Ue.onerror=function(){z(Ue.error)}}catch(ze){z(ze)}})}).catch(z)});return R($,U),$}function Q(k){var U=this,P=new S(function($,Z){U.ready().then(function(){x(U._dbInfo,ge,function(z,fe){if(z)return Z(z);try{var Oe=fe.objectStore(U._dbInfo.storeName),je=Oe.openKeyCursor(),Fe=[];je.onsuccess=function(){var Ue=je.result;if(!Ue){$(Fe);return}Fe.push(Ue.key),Ue.continue()},je.onerror=function(){Z(je.error)}}catch(Ue){Z(Ue)}})}).catch(Z)});return R(P,k),P}function Ve(k,U){U=N.apply(this,arguments);var P=this.config();k=typeof k!="function"&&k||{},k.name||(k.name=k.name||P.name,k.storeName=k.storeName||P.storeName);var $=this,Z;if(!k.name)Z=S.reject("Invalid arguments");else{var z=k.name===P.name&&$._dbInfo.db,fe=z?S.resolve($._dbInfo.db):f(k).then(function(Oe){var je=D[k.name],Fe=je.forages;je.db=Oe;for(var Ue=0;Ue<Fe.length;Ue++)Fe[Ue]._dbInfo.db=Oe;return Oe});k.storeName?Z=fe.then(function(Oe){if(!!Oe.objectStoreNames.contains(k.storeName)){var je=Oe.version+1;m(k);var Fe=D[k.name],Ue=Fe.forages;Oe.close();for(var ze=0;ze<Ue.length;ze++){var bt=Ue[ze];bt._dbInfo.db=null,bt._dbInfo.version=je}var Ht=new S(function(Gt,Pr){var Ir=y.open(k.name,je);Ir.onerror=function(ai){var dl=Ir.result;dl.close(),Pr(ai)},Ir.onupgradeneeded=function(){var ai=Ir.result;ai.deleteObjectStore(k.storeName)},Ir.onsuccess=function(){var ai=Ir.result;ai.close(),Gt(ai)}});return Ht.then(function(Gt){Fe.db=Gt;for(var Pr=0;Pr<Ue.length;Pr++){var Ir=Ue[Pr];Ir._dbInfo.db=Gt,s(Ir._dbInfo)}}).catch(function(Gt){throw(l(k,Gt)||S.resolve()).catch(function(){}),Gt})}}):Z=fe.then(function(Oe){m(k);var je=D[k.name],Fe=je.forages;Oe.close();for(var Ue=0;Ue<Fe.length;Ue++){var ze=Fe[Ue];ze._dbInfo.db=null}var bt=new S(function(Ht,Gt){var Pr=y.deleteDatabase(k.name);Pr.onerror=function(){var Ir=Pr.result;Ir&&Ir.close(),Gt(Pr.error)},Pr.onblocked=function(){console.warn('dropInstance blocked for database "'+k.name+'" until all open connections are closed')},Pr.onsuccess=function(){var Ir=Pr.result;Ir&&Ir.close(),Ht(Ir)}});return bt.then(function(Ht){je.db=Ht;for(var Gt=0;Gt<Fe.length;Gt++){var Pr=Fe[Gt];s(Pr._dbInfo)}}).catch(function(Ht){throw(l(k,Ht)||S.resolve()).catch(function(){}),Ht})})}return R(Z,U),Z}var J={_driver:"asyncStorage",_initStorage:j,_support:w(),iterate:L,getItem:O,setItem:W,removeItem:F,clear:G,length:De,key:Y,keys:Q,dropInstance:Ve};function be(){return typeof openDatabase=="function"}var Ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ye="~~local_forage_type~",Re=/^~~local_forage_type~([^~]+)~/,et="__lfsc__:",oe=et.length,xe="arbf",it="blob",ce="si08",Ie="ui08",ft="uic8",le="si16",Ce="si32",ot="ur16",se="ui32",Me="fl32",st="fl64",ae=oe+xe.length,Se=Object.prototype.toString;function at(k){var U=k.length*.75,P=k.length,$,Z=0,z,fe,Oe,je;k[k.length-1]==="="&&(U--,k[k.length-2]==="="&&U--);var Fe=new ArrayBuffer(U),Ue=new Uint8Array(Fe);for($=0;$<P;$+=4)z=Ke.indexOf(k[$]),fe=Ke.indexOf(k[$+1]),Oe=Ke.indexOf(k[$+2]),je=Ke.indexOf(k[$+3]),Ue[Z++]=z<<2|fe>>4,Ue[Z++]=(fe&15)<<4|Oe>>2,Ue[Z++]=(Oe&3)<<6|je&63;return Fe}function re(k){var U=new Uint8Array(k),P="",$;for($=0;$<U.length;$+=3)P+=Ke[U[$]>>2],P+=Ke[(U[$]&3)<<4|U[$+1]>>4],P+=Ke[(U[$+1]&15)<<2|U[$+2]>>6],P+=Ke[U[$+2]&63];return U.length%3===2?P=P.substring(0,P.length-1)+"=":U.length%3===1&&(P=P.substring(0,P.length-2)+"=="),P}function Te(k,U){var P="";if(k&&(P=Se.call(k)),k&&(P==="[object ArrayBuffer]"||k.buffer&&Se.call(k.buffer)==="[object ArrayBuffer]")){var $,Z=et;k instanceof ArrayBuffer?($=k,Z+=xe):($=k.buffer,P==="[object Int8Array]"?Z+=ce:P==="[object Uint8Array]"?Z+=Ie:P==="[object Uint8ClampedArray]"?Z+=ft:P==="[object Int16Array]"?Z+=le:P==="[object Uint16Array]"?Z+=ot:P==="[object Int32Array]"?Z+=Ce:P==="[object Uint32Array]"?Z+=se:P==="[object Float32Array]"?Z+=Me:P==="[object Float64Array]"?Z+=st:U(new Error("Failed to get type for BinaryArray"))),U(Z+re($))}else if(P==="[object Blob]"){var z=new FileReader;z.onload=function(){var fe=ye+k.type+"~"+re(this.result);U(et+it+fe)},z.readAsArrayBuffer(k)}else try{U(JSON.stringify(k))}catch(fe){console.error("Couldn't convert value into a JSON string: ",k),U(null,fe)}}function ct(k){if(k.substring(0,oe)!==et)return JSON.parse(k);var U=k.substring(ae),P=k.substring(oe,ae),$;if(P===it&&Re.test(U)){var Z=U.match(Re);$=Z[1],U=U.substring(Z[0].length)}var z=at(U);switch(P){case xe:return z;case it:return M([z],{type:$});case ce:return new Int8Array(z);case Ie:return new Uint8Array(z);case ft:return new Uint8ClampedArray(z);case le:return new Int16Array(z);case ot:return new Uint16Array(z);case Ce:return new Int32Array(z);case se:return new Uint32Array(z);case Me:return new Float32Array(z);case st:return new Float64Array(z);default:throw new Error("Unkown type: "+P)}}var ne={serialize:Te,deserialize:ct,stringToBuffer:at,bufferToString:re};function Ee(k,U,P,$){k.executeSql("CREATE TABLE IF NOT EXISTS "+U.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],P,$)}function lt(k){var U=this,P={db:null};if(k)for(var $ in k)P[$]=typeof k[$]!="string"?k[$].toString():k[$];var Z=new S(function(z,fe){try{P.db=openDatabase(P.name,String(P.version),P.description,P.size)}catch(Oe){return fe(Oe)}P.db.transaction(function(Oe){Ee(Oe,P,function(){U._dbInfo=P,z()},function(je,Fe){fe(Fe)})},fe)});return P.serializer=ne,Z}function te(k,U,P,$,Z,z){k.executeSql(P,$,Z,function(fe,Oe){Oe.code===Oe.SYNTAX_ERR?fe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[U.storeName],function(je,Fe){Fe.rows.length?z(je,Oe):Ee(je,U,function(){je.executeSql(P,$,Z,z)},z)},z):z(fe,Oe)},z)}function ke(k,U){var P=this;k=B(k);var $=new S(function(Z,z){P.ready().then(function(){var fe=P._dbInfo;fe.db.transaction(function(Oe){te(Oe,fe,"SELECT * FROM "+fe.storeName+" WHERE key = ? LIMIT 1",[k],function(je,Fe){var Ue=Fe.rows.length?Fe.rows.item(0).value:null;Ue&&(Ue=fe.serializer.deserialize(Ue)),Z(Ue)},function(je,Fe){z(Fe)})})}).catch(z)});return R($,U),$}function ht(k,U){var P=this,$=new S(function(Z,z){P.ready().then(function(){var fe=P._dbInfo;fe.db.transaction(function(Oe){te(Oe,fe,"SELECT * FROM "+fe.storeName,[],function(je,Fe){for(var Ue=Fe.rows,ze=Ue.length,bt=0;bt<ze;bt++){var Ht=Ue.item(bt),Gt=Ht.value;if(Gt&&(Gt=fe.serializer.deserialize(Gt)),Gt=k(Gt,Ht.key,bt+1),Gt!==void 0){Z(Gt);return}}Z()},function(je,Fe){z(Fe)})})}).catch(z)});return R($,U),$}function ue(k,U,P,$){var Z=this;k=B(k);var z=new S(function(fe,Oe){Z.ready().then(function(){U===void 0&&(U=null);var je=U,Fe=Z._dbInfo;Fe.serializer.serialize(U,function(Ue,ze){ze?Oe(ze):Fe.db.transaction(function(bt){te(bt,Fe,"INSERT OR REPLACE INTO "+Fe.storeName+" (key, value) VALUES (?, ?)",[k,Ue],function(){fe(je)},function(Ht,Gt){Oe(Gt)})},function(bt){if(bt.code===bt.QUOTA_ERR){if($>0){fe(ue.apply(Z,[k,je,P,$-1]));return}Oe(bt)}})})}).catch(Oe)});return R(z,P),z}function Pe(k,U,P){return ue.apply(this,[k,U,P,1])}function dt(k,U){var P=this;k=B(k);var $=new S(function(Z,z){P.ready().then(function(){var fe=P._dbInfo;fe.db.transaction(function(Oe){te(Oe,fe,"DELETE FROM "+fe.storeName+" WHERE key = ?",[k],function(){Z()},function(je,Fe){z(Fe)})})}).catch(z)});return R($,U),$}function he(k){var U=this,P=new S(function($,Z){U.ready().then(function(){var z=U._dbInfo;z.db.transaction(function(fe){te(fe,z,"DELETE FROM "+z.storeName,[],function(){$()},function(Oe,je){Z(je)})})}).catch(Z)});return R(P,k),P}function Ne(k){var U=this,P=new S(function($,Z){U.ready().then(function(){var z=U._dbInfo;z.db.transaction(function(fe){te(fe,z,"SELECT COUNT(key) as c FROM "+z.storeName,[],function(Oe,je){var Fe=je.rows.item(0).c;$(Fe)},function(Oe,je){Z(je)})})}).catch(Z)});return R(P,k),P}function pt(k,U){var P=this,$=new S(function(Z,z){P.ready().then(function(){var fe=P._dbInfo;fe.db.transaction(function(Oe){te(Oe,fe,"SELECT key FROM "+fe.storeName+" WHERE id = ? LIMIT 1",[k+1],function(je,Fe){var Ue=Fe.rows.length?Fe.rows.item(0).key:null;Z(Ue)},function(je,Fe){z(Fe)})})}).catch(z)});return R($,U),$}function de(k){var U=this,P=new S(function($,Z){U.ready().then(function(){var z=U._dbInfo;z.db.transaction(function(fe){te(fe,z,"SELECT key FROM "+z.storeName,[],function(Oe,je){for(var Fe=[],Ue=0;Ue<je.rows.length;Ue++)Fe.push(je.rows.item(Ue).key);$(Fe)},function(Oe,je){Z(je)})})}).catch(Z)});return R(P,k),P}function qe(k){return new S(function(U,P){k.transaction(function($){$.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(Z,z){for(var fe=[],Oe=0;Oe<z.rows.length;Oe++)fe.push(z.rows.item(Oe).name);U({db:k,storeNames:fe})},function(Z,z){P(z)})},function($){P($)})})}function vt(k,U){U=N.apply(this,arguments);var P=this.config();k=typeof k!="function"&&k||{},k.name||(k.name=k.name||P.name,k.storeName=k.storeName||P.storeName);var $=this,Z;return k.name?Z=new S(function(z){var fe;k.name===P.name?fe=$._dbInfo.db:fe=openDatabase(k.name,"","",0),k.storeName?z({db:fe,storeNames:[k.storeName]}):z(qe(fe))}).then(function(z){return new S(function(fe,Oe){z.db.transaction(function(je){function Fe(Ht){return new S(function(Gt,Pr){je.executeSql("DROP TABLE IF EXISTS "+Ht,[],function(){Gt()},function(Ir,ai){Pr(ai)})})}for(var Ue=[],ze=0,bt=z.storeNames.length;ze<bt;ze++)Ue.push(Fe(z.storeNames[ze]));S.all(Ue).then(function(){fe()}).catch(function(Ht){Oe(Ht)})},function(je){Oe(je)})})}):Z=S.reject("Invalid arguments"),R(Z,U),Z}var pe={_driver:"webSQLStorage",_initStorage:lt,_support:be(),iterate:ht,getItem:ke,setItem:Pe,removeItem:dt,clear:he,length:Ne,key:pt,keys:de,dropInstance:vt};function Le(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ut(k,U){var P=k.name+"/";return k.storeName!==U.storeName&&(P+=k.storeName+"/"),P}function ve(){var k="_localforage_support_test";try{return localStorage.setItem(k,!0),localStorage.removeItem(k),!1}catch{return!0}}function Be(){return!ve()||localStorage.length>0}function mt(k){var U=this,P={};if(k)for(var $ in k)P[$]=k[$];return P.keyPrefix=ut(k,U._defaultConfig),Be()?(U._dbInfo=P,P.serializer=ne,S.resolve()):S.reject()}function me(k){var U=this,P=U.ready().then(function(){for(var $=U._dbInfo.keyPrefix,Z=localStorage.length-1;Z>=0;Z--){var z=localStorage.key(Z);z.indexOf($)===0&&localStorage.removeItem(z)}});return R(P,k),P}function Ae(k,U){var P=this;k=B(k);var $=P.ready().then(function(){var Z=P._dbInfo,z=localStorage.getItem(Z.keyPrefix+k);return z&&(z=Z.serializer.deserialize(z)),z});return R($,U),$}function $t(k,U){var P=this,$=P.ready().then(function(){for(var Z=P._dbInfo,z=Z.keyPrefix,fe=z.length,Oe=localStorage.length,je=1,Fe=0;Fe<Oe;Fe++){var Ue=localStorage.key(Fe);if(Ue.indexOf(z)===0){var ze=localStorage.getItem(Ue);if(ze&&(ze=Z.serializer.deserialize(ze)),ze=k(ze,Ue.substring(fe),je++),ze!==void 0)return ze}}});return R($,U),$}function Je(k,U){var P=this,$=P.ready().then(function(){var Z=P._dbInfo,z;try{z=localStorage.key(k)}catch{z=null}return z&&(z=z.substring(Z.keyPrefix.length)),z});return R($,U),$}function Qe(k){var U=this,P=U.ready().then(function(){for(var $=U._dbInfo,Z=localStorage.length,z=[],fe=0;fe<Z;fe++){var Oe=localStorage.key(fe);Oe.indexOf($.keyPrefix)===0&&z.push(Oe.substring($.keyPrefix.length))}return z});return R(P,k),P}function Lt(k){var U=this,P=U.keys().then(function($){return $.length});return R(P,k),P}function Bt(k,U){var P=this;k=B(k);var $=P.ready().then(function(){var Z=P._dbInfo;localStorage.removeItem(Z.keyPrefix+k)});return R($,U),$}function Dt(k,U,P){var $=this;k=B(k);var Z=$.ready().then(function(){U===void 0&&(U=null);var z=U;return new S(function(fe,Oe){var je=$._dbInfo;je.serializer.serialize(U,function(Fe,Ue){if(Ue)Oe(Ue);else try{localStorage.setItem(je.keyPrefix+k,Fe),fe(z)}catch(ze){(ze.name==="QuotaExceededError"||ze.name==="NS_ERROR_DOM_QUOTA_REACHED")&&Oe(ze),Oe(ze)}})})});return R(Z,P),Z}function jt(k,U){if(U=N.apply(this,arguments),k=typeof k!="function"&&k||{},!k.name){var P=this.config();k.name=k.name||P.name,k.storeName=k.storeName||P.storeName}var $=this,Z;return k.name?Z=new S(function(z){k.storeName?z(ut(k,$._defaultConfig)):z(k.name+"/")}).then(function(z){for(var fe=localStorage.length-1;fe>=0;fe--){var Oe=localStorage.key(fe);Oe.indexOf(z)===0&&localStorage.removeItem(Oe)}}):Z=S.reject("Invalid arguments"),R(Z,U),Z}var Ft={_driver:"localStorageWrapper",_initStorage:mt,_support:Le(),iterate:$t,getItem:Ae,setItem:Dt,removeItem:Bt,clear:me,length:Lt,key:Je,keys:Qe,dropInstance:jt},lr=function(U,P){return U===P||typeof U=="number"&&typeof P=="number"&&isNaN(U)&&isNaN(P)},hr=function(U,P){for(var $=U.length,Z=0;Z<$;){if(lr(U[Z],P))return!0;Z++}return!1},or=Array.isArray||function(k){return Object.prototype.toString.call(k)==="[object Array]"},Kt={},sr={},Ut={INDEXEDDB:J,WEBSQL:pe,LOCALSTORAGE:Ft},dr=[Ut.INDEXEDDB._driver,Ut.WEBSQL._driver,Ut.LOCALSTORAGE._driver],Jt=["dropInstance"],tr=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Jt),Rr={description:"",driver:dr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Qr(k,U){k[U]=function(){var P=arguments;return k.ready().then(function(){return k[U].apply(k,P)})}}function ua(){for(var k=1;k<arguments.length;k++){var U=arguments[k];if(U)for(var P in U)U.hasOwnProperty(P)&&(or(U[P])?arguments[0][P]=U[P].slice():arguments[0][P]=U[P])}return arguments[0]}var ll=function(){function k(U){c(this,k);for(var P in Ut)if(Ut.hasOwnProperty(P)){var $=Ut[P],Z=$._driver;this[P]=Z,Kt[Z]||this.defineDriver($)}this._defaultConfig=ua({},Rr),this._config=ua({},this._defaultConfig,U),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return k.prototype.config=function(P){if((typeof P>"u"?"undefined":a(P))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var $ in P){if($==="storeName"&&(P[$]=P[$].replace(/\W/g,"_")),$==="version"&&typeof P[$]!="number")return new Error("Database version must be a number.");this._config[$]=P[$]}return"driver"in P&&P.driver?this.setDriver(this._config.driver):!0}else return typeof P=="string"?this._config[P]:this._config},k.prototype.defineDriver=function(P,$,Z){var z=new S(function(fe,Oe){try{var je=P._driver,Fe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!P._driver){Oe(Fe);return}for(var Ue=tr.concat("_initStorage"),ze=0,bt=Ue.length;ze<bt;ze++){var Ht=Ue[ze],Gt=!hr(Jt,Ht);if((Gt||P[Ht])&&typeof P[Ht]!="function"){Oe(Fe);return}}var Pr=function(){for(var dl=function(IK){return function(){var CK=new Error("Method "+IK+" is not implemented by the current driver"),TS=S.reject(CK);return R(TS,arguments[arguments.length-1]),TS}},iy=0,RK=Jt.length;iy<RK;iy++){var oy=Jt[iy];P[oy]||(P[oy]=dl(oy))}};Pr();var Ir=function(dl){Kt[je]&&console.info("Redefining LocalForage driver: "+je),Kt[je]=P,sr[je]=dl,fe()};"_support"in P?P._support&&typeof P._support=="function"?P._support().then(Ir,Oe):Ir(!!P._support):Ir(!0)}catch(ai){Oe(ai)}});return C(z,$,Z),z},k.prototype.driver=function(){return this._driver||null},k.prototype.getDriver=function(P,$,Z){var z=Kt[P]?S.resolve(Kt[P]):S.reject(new Error("Driver not found."));return C(z,$,Z),z},k.prototype.getSerializer=function(P){var $=S.resolve(ne);return C($,P),$},k.prototype.ready=function(P){var $=this,Z=$._driverSet.then(function(){return $._ready===null&&($._ready=$._initDriver()),$._ready});return C(Z,P,P),Z},k.prototype.setDriver=function(P,$,Z){var z=this;or(P)||(P=[P]);var fe=this._getSupportedDrivers(P);function Oe(){z._config.driver=z.driver()}function je(ze){return z._extend(ze),Oe(),z._ready=z._initStorage(z._config),z._ready}function Fe(ze){return function(){var bt=0;function Ht(){for(;bt<ze.length;){var Gt=ze[bt];return bt++,z._dbInfo=null,z._ready=null,z.getDriver(Gt).then(je).catch(Ht)}Oe();var Pr=new Error("No available storage method found.");return z._driverSet=S.reject(Pr),z._driverSet}return Ht()}}var Ue=this._driverSet!==null?this._driverSet.catch(function(){return S.resolve()}):S.resolve();return this._driverSet=Ue.then(function(){var ze=fe[0];return z._dbInfo=null,z._ready=null,z.getDriver(ze).then(function(bt){z._driver=bt._driver,Oe(),z._wrapLibraryMethodsWithReady(),z._initDriver=Fe(fe)})}).catch(function(){Oe();var ze=new Error("No available storage method found.");return z._driverSet=S.reject(ze),z._driverSet}),C(this._driverSet,$,Z),this._driverSet},k.prototype.supports=function(P){return!!sr[P]},k.prototype._extend=function(P){ua(this,P)},k.prototype._getSupportedDrivers=function(P){for(var $=[],Z=0,z=P.length;Z<z;Z++){var fe=P[Z];this.supports(fe)&&$.push(fe)}return $},k.prototype._wrapLibraryMethodsWithReady=function(){for(var P=0,$=tr.length;P<$;P++)Qr(this,tr[P])},k.prototype.createInstance=function(P){return new k(P)},k}(),hl=new ll;i.exports=hl},{3:3}]},{},[4])(4)})});var OK=E((ty,AK)=>{(function(e,t){typeof ty=="object"&&typeof AK<"u"?t(ty):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],t):t(e.LocalforageDriverMemory={})})(typeof self<"u"?self:ty,function(e){"use strict";var t="localforage-driver-memory";function r(g){var b=typeof Symbol=="function"&&g[Symbol.iterator],h=0;return b?b.call(g):{next:function(){return g&&h>=g.length&&(g=void 0),{value:g&&g[h++],done:!g}}}}function n(g,b){g=g||[],b=b||{};try{return new Blob(g,b)}catch(A){if(A.name!=="TypeError")throw A;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,u=new h,_=0;_<g.length;_+=1)u.append(g[_]);return u.getBlob(b.type)}}var i=/^~~local_forage_type~([^~]+)~/,o=9,a=o+4,c=Object.prototype.toString;function v(g){var b=g.length*.75,h=g.length;g[g.length-1]==="="&&(b--,g[g.length-2]==="="&&b--);for(var u=new ArrayBuffer(b),_=new Uint8Array(u),A=0,x=0;A<h;A+=4){var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(g[A]),j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(g[A+1]),O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(g[A+2]),L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(g[A+3]);_[x++]=I<<2|j>>4,_[x++]=(j&15)<<4|O>>2,_[x++]=(O&3)<<6|L&63}return u}function y(g){for(var b=new Uint8Array(g),h="",u=0;u<b.length;u+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[b[u]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(b[u]&3)<<4|b[u+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(b[u+1]&15)<<2|b[u+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[b[u+2]&63];return b.length%3===2?h=h.substring(0,h.length-1)+"=":b.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(g,b){var h="";if(g&&(h=c.call(g)),g&&(h==="[object ArrayBuffer]"||g.buffer&&c.call(g.buffer)==="[object ArrayBuffer]")){var u=void 0,_="__lfsc__:";g instanceof ArrayBuffer?(u=g,_+="arbf"):(u=g.buffer,h==="[object Int8Array]"?_+="si08":h==="[object Uint8Array]"?_+="ui08":h==="[object Uint8ClampedArray]"?_+="uic8":h==="[object Int16Array]"?_+="si16":h==="[object Uint16Array]"?_+="ur16":h==="[object Int32Array]"?_+="si32":h==="[object Uint32Array]"?_+="ui32":h==="[object Float32Array]"?_+="fl32":h==="[object Float64Array]"?_+="fl64":b(new Error("Failed to get type for BinaryArray"))),b(_+y(u))}else if(h==="[object Blob]"){var A=new FileReader;A.onload=function(){var x="~~local_forage_type~"+g.type+"~"+y(this.result);b("__lfsc__:blob"+x)},A.readAsArrayBuffer(g)}else try{b(JSON.stringify(g))}catch(x){console.error("Couldn't convert value into a JSON string: ",g),b(null,x)}}function M(g){if(g.substring(0,o)!=="__lfsc__:")return JSON.parse(g);var b=g.substring(a),h=g.substring(o,a),u;if(h==="blob"&&i.test(b)){var _=b.match(i);u=_[1],b=b.substring(_[0].length)}var A=v(b);switch(h){case"arbf":return A;case"blob":return n([A],{type:u});case"si08":return new Int8Array(A);case"ui08":return new Uint8Array(A);case"uic8":return new Uint8ClampedArray(A);case"si16":return new Int16Array(A);case"ur16":return new Uint16Array(A);case"si32":return new Int32Array(A);case"ui32":return new Uint32Array(A);case"fl32":return new Float32Array(A);case"fl64":return new Float64Array(A);default:throw new Error("Unkown type: "+h)}}function S(g){var b,h;if(g===null||typeof g!="object"||"isActiveClone"in g)return g;var u=g instanceof Date?new Date(g):g.constructor();try{for(var _=r(Object.keys(g)),A=_.next();!A.done;A=_.next()){var x=A.value;Object.prototype.hasOwnProperty.call(g,x)&&(g.isActiveClone=null,u[x]=S(g[x]),delete g.isActiveClone)}}catch(I){b={error:I}}finally{try{A&&!A.done&&(h=_.return)&&h.call(_)}finally{if(b)throw b.error}}return u}function R(g,b){return(g.name||b.name)+"/"+(g.storeName||b.storeName)+"/"}function C(g,b){b&&g.then(function(h){b(null,h)},function(h){b(h)})}function B(){for(var g=[],b=0;b<arguments.length;b++)g[b]=arguments[b];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function N(g,b){var h=this;if(b=B.apply(this,arguments),g=typeof g!="function"&&g||{},!g.name){var u=this.config();g.name=g.name||u.name,g.storeName=g.storeName||u.storeName}var _;return g.name?_=new Promise(function(A){g.storeName?A(R(g,h._defaultConfig)):A(g.name+"/")}):_=Promise.reject("Invalid arguments"),{promise:_,callback:b}}function q(g){return typeof g!="string"&&(console.warn(g+" used as a key, but it is not a string."),g=String(g)),g}var H={bufferToString:y,deserialize:M,serialize:w,stringToBuffer:v},D={},ee=function(){function g(b){this.kp=b,this.data={}}return g.resolve=function(b){return D[b]||(D[b]=new g(b)),D[b]},g.prototype.clear=function(){this.data={}},g.prototype.drop=function(){this.clear(),delete D[this.kp]},g.prototype.get=function(b){return this.data[b]},g.prototype.key=function(b){return this.keys()[b]},g.prototype.keys=function(){return Object.keys(this.data)},g.prototype.rm=function(b){delete this.data[b]},g.prototype.set=function(b,h){this.data[b]=h},g}();function ge(g){var b=g?S(g):{},h=R(b,this._defaultConfig),u=ee.resolve(h);return this._dbInfo=b,this._dbInfo.serializer=H,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=u,Promise.resolve()}function K(g){var b=this,h=this.ready().then(function(){b._dbInfo.mStore.clear()});return C(h,g),h}function X(g,b){var h=N.apply(this,arguments),u=h.promise,_=h.callback,A=u.then(function(x){ee.resolve(x).drop()});return C(A,_),u}function V(g,b){var h=this;g=q(g);var u=this.ready().then(function(){var _=h._dbInfo.mStore.get(g);return _==null?null:h._dbInfo.serializer.deserialize(_)});return C(u,b),u}function T(g,b){var h=this,u=this.ready().then(function(){for(var _=h._dbInfo.mStore,A=_.keys(),x=0;x<A.length;x++){var I=_.get(A[x]);if(I&&(I=h._dbInfo.serializer.deserialize(I)),I=g(I,A[x],x+1),I!==void 0)return I}});return C(u,b),u}function m(g,b){var h=this,u=this.ready().then(function(){var _;try{_=h._dbInfo.mStore.key(g),_===void 0&&(_=null)}catch{_=null}return _});return C(u,b),u}function s(g){var b=this,h=this.ready().then(function(){return b._dbInfo.mStore.keys()});return C(h,g),h}function l(g){var b=this.keys().then(function(h){return h.length});return C(b,g),b}function d(g,b){var h=this;g=q(g);var u=this.ready().then(function(){h._dbInfo.mStore.rm(g)});return C(u,b),u}function f(g,b,h){var u=this;g=q(g);var _=this.ready().then(function(){b===void 0&&(b=null);var A=b;return new Promise(function(x,I){u._dbInfo.serializer.serialize(b,function(j,O){if(O)I(O);else try{u._dbInfo.mStore.set(g,j),x(A)}catch(L){I(L)}})})});return C(_,h),_}var p=!0;e._support=p,e._driver=t,e._initStorage=ge,e.clear=K,e.dropInstance=X,e.getItem=V,e.iterate=T,e.key=m,e.keys=s,e.length=l,e.removeItem=d,e.setItem=f,Object.defineProperty(e,"__esModule",{value:!0})})});var qOe={};Mr(qOe,{default:()=>NOe});var Co=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(Co||{}),Vu=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(Vu||{}),$u=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))($u||{}),An=(e=>(e.MetaMask="metamask",e.WalletConnect="wallet_connect",e.CoinbaseWallet="coinbase_wallet",e))(An||{}),To=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e.DisplayUri="display_uri",e.Uri="uri",e))(To||{}),ko=(e=>(e.WalletConnectError="Missing Wallet Connect Config",e.CoinbaseWalletError="Missing Coinbase Wallet Config",e))(ko||{}),_t=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e))(_t||{}),Po=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e))(Po||{}),fa=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(fa||{}),LS=(e=>(e.Harmony="HARMONY",e))(LS||{});vy();var sE=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],Zu=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];var aE={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var HE=Hr(RE());var lZ=Hr(xy()),NE=Hr(PE()),qE="hex",LE="utf8";var dp="0";function ss(e){return new Uint8Array(e)}function My(e,t=!1){let r=e.toString(qE);return t?qo(r):r}function BE(e){return e.toString(LE)}function Yu(e){return(0,NE.default)(e)}function as(e,t=!1){return My(Yu(e),t)}function Sy(e){return BE(Yu(e))}function DE(e){return Buffer.from(ci(e),qE)}function us(e){return ss(DE(e))}function pp(e){return Buffer.from(e,LE)}function Ey(e){return ss(pp(e))}function jE(e,t=!1){return My(pp(e),t)}function FE(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function Ay(...e){let t=[];return e.forEach(r=>t=t.concat(Array.from(r))),new Uint8Array([...t])}function hZ(e,t=8){let r=e%t;return r?(e-r)/t*t+t:e}function dZ(e,t=8,r=dp){return pZ(e,hZ(e.length,t),r)}function pZ(e,t,r=dp){return vZ(e,t,!0,r)}function ci(e){return e.replace(/^0x/,"")}function qo(e){return e.startsWith("0x")?e:`0x${e}`}function vp(e){return e=ci(e),e=dZ(e,2),e&&(e=qo(e)),e}function UE(e){let t=e.startsWith("0x");return e=ci(e),e=e.startsWith(dp)?e.substring(1):e,t?qo(e):e}function vZ(e,t,r,n=dp){let i=t-e.length,o=e;if(i>0){let a=n.repeat(i);o=r?a+e:e+a}return o}function gp(e){return Yu(new Uint8Array(e))}function WE(e,t){return as(new Uint8Array(e),!t)}function zE(e){return ss(e).buffer}function VE(e){return pp(e)}function $E(e,t){return jE(e,!t)}function KE(e){return us(e).buffer}function bp(e,t){let r=ci(vp(new HE.default(e).toString(16)));return t?r:qo(r)}var F8=Hr(GE());var li={};Mr(li,{DEFAULT_ERROR:()=>Ml,IBaseJsonRpcProvider:()=>Tp,IEvents:()=>Xu,IJsonRpcConnection:()=>Cy,IJsonRpcProvider:()=>Ty,INTERNAL_ERROR:()=>_p,INVALID_PARAMS:()=>QE,INVALID_REQUEST:()=>YE,METHOD_NOT_FOUND:()=>JE,PARSE_ERROR:()=>ZE,RESERVED_ERROR_CODES:()=>Oy,SERVER_ERROR:()=>xl,SERVER_ERROR_CODE_RANGE:()=>wp,STANDARD_ERROR_MAP:()=>fs,formatErrorMessage:()=>I8,formatJsonRpcError:()=>MZ,formatJsonRpcRequest:()=>wZ,formatJsonRpcResult:()=>xZ,getError:()=>Mp,getErrorByCode:()=>Sp,isHttpUrl:()=>CZ,isJsonRpcError:()=>k8,isJsonRpcPayload:()=>ky,isJsonRpcRequest:()=>PZ,isJsonRpcResponse:()=>NZ,isJsonRpcResult:()=>T8,isJsonRpcValidationInvalid:()=>qZ,isLocalhostUrl:()=>kZ,isNodeJs:()=>R8,isReservedErrorCode:()=>xp,isServerErrorCode:()=>mZ,isValidDefaultRoute:()=>Ip,isValidErrorCode:()=>XE,isValidLeadingWildcardRoute:()=>EZ,isValidRoute:()=>SZ,isValidTrailingWildcardRoute:()=>AZ,isValidWildcardRoute:()=>Cp,isWsUrl:()=>TZ,parseConnectionError:()=>bZ,payloadId:()=>Rp,validateJsonRpcError:()=>gZ});var ZE="PARSE_ERROR",YE="INVALID_REQUEST",JE="METHOD_NOT_FOUND",QE="INVALID_PARAMS",_p="INTERNAL_ERROR",xl="SERVER_ERROR",Oy=[-32700,-32600,-32601,-32602,-32603],wp=[-32e3,-32099],fs={[ZE]:{code:-32700,message:"Parse error"},[YE]:{code:-32600,message:"Invalid Request"},[JE]:{code:-32601,message:"Method not found"},[QE]:{code:-32602,message:"Invalid params"},[_p]:{code:-32603,message:"Internal error"},[xl]:{code:-32e3,message:"Server error"}},Ml=xl;function mZ(e){return e<=wp[0]&&e>=wp[1]}function xp(e){return Oy.includes(e)}function XE(e){return typeof e=="number"}function Mp(e){return Object.keys(fs).includes(e)?fs[e]:fs[Ml]}function Sp(e){let t=Object.values(fs).find(r=>r.code===e);return t||fs[Ml]}function gZ(e){if(typeof e.error.code>"u")return{valid:!1,error:"Missing code for JSON-RPC error"};if(typeof e.error.message>"u")return{valid:!1,error:"Missing message for JSON-RPC error"};if(!XE(e.error.code))return{valid:!1,error:`Invalid error code type for JSON-RPC: ${e.error.code}`};if(xp(e.error.code)){let t=Sp(e.error.code);if(t.message!==fs[Ml].message&&e.error.message===t.message)return{valid:!1,error:`Invalid error code message for JSON-RPC: ${e.error.code}`}}return{valid:!0}}function bZ(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var On={};Mr(On,{isNodeJs:()=>R8});var O8=Hr(Qu());rr(On,Hr(Qu()));var R8=O8.isNode;rr(li,On);function Rp(){let e=Date.now()*Math.pow(10,3),t=Math.floor(Math.random()*Math.pow(10,3));return e+t}function wZ(e,t,r){return{id:r||Rp(),jsonrpc:"2.0",method:e,params:t}}function xZ(e,t){return{id:e,jsonrpc:"2.0",result:t}}function MZ(e,t,r){return{id:e,jsonrpc:"2.0",error:I8(t,r)}}function I8(e,t){return typeof e>"u"?Mp(_p):(typeof e=="string"&&(e=Object.assign(Object.assign({},Mp(xl)),{message:e})),typeof t<"u"&&(e.data=t),xp(e.code)&&(e=Sp(e.code)),e)}function SZ(e){return e.includes("*")?Cp(e):!/\W/g.test(e)}function Ip(e){return e==="*"}function Cp(e){return Ip(e)?!0:!(!e.includes("*")||e.split("*").length!==2||e.split("*").filter(t=>t.trim()==="").length!==1)}function EZ(e){return!Ip(e)&&Cp(e)&&!e.split("*")[0].trim()}function AZ(e){return!Ip(e)&&Cp(e)&&!e.split("*")[1].trim()}var Xu=class{};var Cy=class extends Xu{constructor(t){super()}},Tp=class extends Xu{constructor(){super()}},Ty=class extends Tp{constructor(t){super()}};var OZ="^https?:",RZ="^wss?:";function IZ(e){let t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function C8(e,t){let r=IZ(e);return typeof r>"u"?!1:new RegExp(t).test(r)}function CZ(e){return C8(e,OZ)}function TZ(e){return C8(e,RZ)}function kZ(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function ky(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function PZ(e){return ky(e)&&"method"in e}function NZ(e){return ky(e)&&(T8(e)||k8(e))}function T8(e){return"result"in e}function k8(e){return"error"in e}function qZ(e){return"error"in e&&e.valid===!1}function Sl(e){return vp(e)}function P8(e){return UE(qo(e))}var El=Rp;function kp(){return((t,r)=>{for(r=t="";t++<36;r+=t*51&52?(t^15?8^Math.random()*(t^20?16:4):4).toString(16):"-");return r})()}function LZ(e,t){let r,n=aE[e];return n&&(r=`https://${n}.infura.io/v3/${t}`),r}function N8(e,t){let r,n=LZ(e,t.infuraId);return t.custom&&t.custom[e]?r=t.custom[e]:n&&(r=n),r}function q8(e){return e===""||typeof e=="string"&&e.trim()===""}function L8(e){return!(e&&e.length)}function Py(e,t){return FE(e,t)}function B8(e){return typeof e.method<"u"}function va(e){return typeof e.result<"u"}function ef(e){return typeof e.error<"u"}function Ny(e){return typeof e.event<"u"}function D8(e){return sE.includes(e)||e.startsWith("wc_")}function j8(e){return e.method.startsWith("wc_")?!0:!Zu.includes(e.method)}function BZ(e){e=ci(e.toLowerCase());let t=ci((0,F8.keccak_256)(VE(e))),r="";for(let n=0;n<e.length;n++)parseInt(t[n],16)>7?r+=e[n].toUpperCase():r+=e[n];return qo(r)}var DZ=e=>e?e.toLowerCase().substring(0,2)!=="0x"?!1:/^(0x)?[0-9a-f]{40}$/i.test(e)?/^(0x)?[0-9a-f]{40}$/.test(e)||/^(0x)?[0-9A-F]{40}$/.test(e)?!0:e===BZ(e):!1:!1;function tf(e){return!L8(e)&&!Py(e[0])&&(e[0]=$E(e[0])),e}function Pp(e){if(typeof e.type<"u"&&e.type!=="0")return e;if(typeof e.from>"u"||!DZ(e.from))throw new Error("Transaction object must include a valid 'from' value.");function t(i){let o=i;return(typeof i=="number"||typeof i=="string"&&!q8(i))&&(Py(i)?typeof i=="string"&&(o=Sl(i)):o=bp(i)),typeof o=="string"&&(o=P8(o)),o}let r={from:Sl(e.from),to:typeof e.to>"u"?void 0:Sl(e.to),gasPrice:typeof e.gasPrice>"u"?"":t(e.gasPrice),gas:typeof e.gas>"u"?typeof e.gasLimit>"u"?"":t(e.gasLimit):t(e.gas),value:typeof e.value>"u"?"":t(e.value),nonce:typeof e.nonce>"u"?"":t(e.nonce),data:typeof e.data>"u"?"":Sl(e.data)||"0x"},n=["gasPrice","gas","value","nonce"];return Object.keys(r).forEach(i=>{(typeof r[i]>"u"||typeof r[i]=="string"&&!r[i].trim().length)&&n.includes(i)&&delete r[i]}),r}function U8(e){let t=e.message||"Failed or Rejected Request",r=-32e3;if(e&&!e.code)switch(t){case"Parse error":r=-32700;break;case"Invalid request":r=-32600;break;case"Method not found":r=-32601;break;case"Invalid params":r=-32602;break;case"Internal error":r=-32603;break;default:r=-32e3;break}let n={code:r,message:t};return e.data&&(n.data=e.data),n}var Np=Hr(i9());function o9(e){let t=e.indexOf("?")!==-1?e.indexOf("?"):void 0;return typeof t<"u"?e.substr(t):""}function s9(e,t){let r=Ly(e);return r=Object.assign(Object.assign({},r),t),e=KZ(r),e}function Ly(e){return Np.parse(e)}function KZ(e){return Np.stringify(e)}function a9(e){return typeof e.bridge<"u"}function u9(e){let t=e.indexOf(":"),r=e.indexOf("?")!==-1?e.indexOf("?"):void 0,n=e.substring(0,t),i=e.substring(t+1,r);function o(M){let S="@",R=M.split(S);return{handshakeTopic:R[0],version:parseInt(R[1],10)}}let a=o(i),c=typeof r<"u"?e.substr(r):"";function v(M){let S=Ly(M);return{key:S.key||"",bridge:S.bridge||""}}let y=v(c);return Object.assign(Object.assign({protocol:n},a),y)}var By=class{constructor(){this._eventEmitters=[],typeof window<"u"&&typeof window.addEventListener<"u"&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(t,r){this._eventEmitters.push({event:t,callback:r})}trigger(t){let r=[];t&&(r=this._eventEmitters.filter(n=>n.event===t)),r.forEach(n=>{n.callback()})}},f9=By;var GZ=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:l9(),Dy=class{constructor(t){if(this.opts=t,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=t.protocol,this._version=t.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new f9,!t.url||typeof t.url!="string")throw new Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(t){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(t){}get connecting(){return this.readyState===0}set connected(t){}get connected(){return this.readyState===1}set closing(t){}get closing(){return this.readyState===2}set closed(t){}get closed(){return this.readyState===3}open(){this._socketCreate()}close(){this._socketClose()}send(t,r,n){if(!r||typeof r!="string")throw new Error("Missing or invalid topic field");this._socketSend({topic:r,type:"pub",payload:t,silent:!!n})}subscribe(t){this._socketSend({topic:t,type:"sub",payload:"",silent:!0})}on(t,r){this._events.push({event:t,callback:r})}_socketCreate(){if(this._nextSocket)return;let t=ZZ(this._url,this._protocol,this._version);if(this._nextSocket=new GZ(t),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=r=>this._socketReceive(r),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=r=>this._socketError(r),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(t){let r=JSON.stringify(t);this._socket&&this._socket.readyState===1?this._socket.send(r):(this._setToQueue(t),this._socketCreate())}async _socketReceive(t){let r;try{r=JSON.parse(t.data)}catch{return}if(this._socketSend({topic:r.topic,type:"ack",payload:"",silent:!0}),this._socket&&this._socket.readyState===1){let n=this._events.filter(i=>i.event==="message");n&&n.length&&n.forEach(i=>i.callback(r))}}_socketError(t){let r=this._events.filter(n=>n.event==="error");r&&r.length&&r.forEach(n=>n.callback(t))}_queueSubscriptions(){this._subscriptions.forEach(r=>this._queue.push({topic:r,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(t){this._queue.push(t)}_pushQueue(){this._queue.forEach(r=>this._socketSend(r)),this._queue=[]}};function ZZ(e,t,r){var n,i;let a=(e.startsWith("https")?e.replace("https","wss"):e.startsWith("http")?e.replace("http","ws"):e).split("?"),c=ay()?{protocol:t,version:r,env:"browser",host:((n=fy())===null||n===void 0?void 0:n.host)||""}:{protocol:t,version:r,env:((i=ml())===null||i===void 0?void 0:i.name)||""},v=s9(o9(a[1]||""),c);return a[0]+"?"+v}var h9=Dy;var qp="Session currently connected",hs="Session currently disconnected",d9="Session Rejected",p9="Missing JSON RPC response",v9='JSON-RPC success response must include "result" field',m9='JSON-RPC error response must include "error" field',g9='JSON RPC request must have valid "method" value',b9='JSON RPC request must have valid "id" value',y9="Missing one of the required parameters: bridge / uri / session",jy="JSON RPC response format is invalid",_9="URI format is invalid",w9="QRCode Modal not provided",Fy="User close QRCode Modal";var Uy=class{constructor(){this._eventEmitters=[]}subscribe(t){this._eventEmitters.push(t)}unsubscribe(t){this._eventEmitters=this._eventEmitters.filter(r=>r.event!==t)}trigger(t){let r=[],n;B8(t)?n=t.method:va(t)||ef(t)?n=`response:${t.id}`:Ny(t)?n=t.event:n="",n&&(r=this._eventEmitters.filter(i=>i.event===n)),(!r||!r.length)&&!D8(n)&&!Ny(n)&&(r=this._eventEmitters.filter(i=>i.event==="call_request")),r.forEach(i=>{if(ef(t)){let o=new Error(t.error.message);i.callback(o,null)}else i.callback(null,t)})}},x9=Uy;var Hy=class{constructor(t="walletconnect"){this.storageId=t}getSession(){let t=null,r=yl(this.storageId);return r&&a9(r)&&(t=r),t}setSession(t){return bl(this.storageId,t),t}removeSession(){_l(this.storageId)}},M9=Hy;var YZ="walletconnect.org",JZ="abcdefghijklmnopqrstuvwxyz0123456789",S9=JZ.split("").map(e=>`https://${e}.bridge.walletconnect.org`);function QZ(e){let t=e.indexOf("//")>-1?e.split("/")[2]:e.split("/")[0];return t=t.split(":")[0],t=t.split("?")[0],t}function XZ(e){return QZ(e).split(".").slice(-2).join(".")}function eY(){return Math.floor(Math.random()*S9.length)}function tY(){return S9[eY()]}function rY(e){return XZ(e)===YZ}function E9(e){return rY(e)?tY():e}var Wy=class{constructor(t){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new x9,this._clientMeta=op()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new M9(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[...Zu,...t.connectorOpts.signingMethods||[]],!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error(y9);t.connectorOpts.bridge&&(this.bridge=E9(t.connectorOpts.bridge)),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);let r=t.connectorOpts.session||this._getStorageSession();r&&(this.session=r),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new h9({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}set bridge(t){!t||(this._bridge=t)}get bridge(){return this._bridge}set key(t){if(!t)return;let r=KE(t);this._key=r}get key(){return this._key?WE(this._key,!0):""}set clientId(t){!t||(this._clientId=t)}get clientId(){let t=this._clientId;return t||(t=this._clientId=kp()),this._clientId}set peerId(t){!t||(this._peerId=t)}get peerId(){return this._peerId}set clientMeta(t){}get clientMeta(){let t=this._clientMeta;return t||(t=this._clientMeta=op()),t}set peerMeta(t){this._peerMeta=t}get peerMeta(){return this._peerMeta}set handshakeTopic(t){!t||(this._handshakeTopic=t)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(t){!t||(this._handshakeId=t)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(t){if(!t)return;let{handshakeTopic:r,bridge:n,key:i}=this._parseUri(t);this.handshakeTopic=r,this.bridge=n,this.key=i}set chainId(t){this._chainId=t}get chainId(){return this._chainId}set networkId(t){this._networkId=t}get networkId(){return this._networkId}set accounts(t){this._accounts=t}get accounts(){return this._accounts}set rpcUrl(t){this._rpcUrl=t}get rpcUrl(){return this._rpcUrl}set connected(t){}get connected(){return this._connected}set pending(t){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(t){!t||(this._connected=t.connected,this.accounts=t.accounts,this.chainId=t.chainId,this.bridge=t.bridge,this.key=t.key,this.clientId=t.clientId,this.clientMeta=t.clientMeta,this.peerId=t.peerId,this.peerMeta=t.peerMeta,this.handshakeId=t.handshakeId,this.handshakeTopic=t.handshakeTopic)}on(t,r){let n={event:t,callback:r};this._eventManager.subscribe(n)}off(t){this._eventManager.unsubscribe(t)}async createInstantRequest(t){this._key=await this._generateKey();let r=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]});this.handshakeId=r.id,this.handshakeTopic=kp(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw new Error(Fy)});let n=()=>{this.killSession()};try{let i=await this._sendCallRequest(r);return i&&n(),i}catch(i){throw n(),i}}async connect(t){if(!this._qrcodeModal)throw new Error(w9);return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(t),new Promise(async(r,n)=>{this.on("modal_closed",()=>n(new Error(Fy))),this.on("connect",(i,o)=>{if(i)return n(i);r(o.params[0])})}))}async createSession(t){if(this._connected)throw new Error(qp);if(this.pending)return;this._key=await this._generateKey();let r=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]});this.handshakeId=r.id,this.handshakeTopic=kp(),this._sendSessionRequest(r,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(t){if(this._connected)throw new Error(qp);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";let r={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},n={id:this.handshakeId,jsonrpc:"2.0",result:r};this._sendResponse(n),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(t){if(this._connected)throw new Error(qp);let r=t&&t.message?t.message:d9,n=this._formatResponse({id:this.handshakeId,error:{message:r}});this._sendResponse(n),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:r}]}),this._removeStorageSession()}updateSession(t){if(!this._connected)throw new Error(hs);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";let r={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},n=this._formatRequest({method:"wc_sessionUpdate",params:[r]});this._sendSessionRequest(n,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(t){let r=t?t.message:"Session Disconnected",n={approved:!1,chainId:null,networkId:null,accounts:null},i=this._formatRequest({method:"wc_sessionUpdate",params:[n]});await this._sendRequest(i),this._handleSessionDisconnect(r)}async sendTransaction(t){if(!this._connected)throw new Error(hs);let r=Pp(t),n=this._formatRequest({method:"eth_sendTransaction",params:[r]});return await this._sendCallRequest(n)}async signTransaction(t){if(!this._connected)throw new Error(hs);let r=Pp(t),n=this._formatRequest({method:"eth_signTransaction",params:[r]});return await this._sendCallRequest(n)}async signMessage(t){if(!this._connected)throw new Error(hs);let r=this._formatRequest({method:"eth_sign",params:t});return await this._sendCallRequest(r)}async signPersonalMessage(t){if(!this._connected)throw new Error(hs);t=tf(t);let r=this._formatRequest({method:"personal_sign",params:t});return await this._sendCallRequest(r)}async signTypedData(t){if(!this._connected)throw new Error(hs);let r=this._formatRequest({method:"eth_signTypedData",params:t});return await this._sendCallRequest(r)}async updateChain(t){if(!this._connected)throw new Error("Session currently disconnected");let r=this._formatRequest({method:"wallet_updateChain",params:[t]});return await this._sendCallRequest(r)}unsafeSend(t,r){return this._sendRequest(t,r),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:r}]}),new Promise((n,i)=>{this._subscribeToResponse(t.id,(o,a)=>{if(o){i(o);return}if(!a)throw new Error(p9);n(a)})})}async sendCustomRequest(t,r){if(!this._connected)throw new Error(hs);switch(t.method){case"eth_accounts":return this.accounts;case"eth_chainId":return bp(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":t.params&&(t.params[0]=Pp(t.params[0]));break;case"personal_sign":t.params&&(t.params=tf(t.params));break;default:break}let n=this._formatRequest(t);return await this._sendCallRequest(n,r)}approveRequest(t){if(va(t)){let r=this._formatResponse(t);this._sendResponse(r)}else throw new Error(v9)}rejectRequest(t){if(ef(t)){let r=this._formatResponse(t);this._sendResponse(r)}else throw new Error(m9)}transportClose(){this._transport.close()}async _sendRequest(t,r){let n=this._formatRequest(t),i=await this._encrypt(n),o=typeof r?.topic<"u"?r.topic:this.peerId,a=JSON.stringify(i),c=typeof r?.forcePushNotification<"u"?!r.forcePushNotification:j8(n);this._transport.send(a,o,c)}async _sendResponse(t){let r=await this._encrypt(t),n=this.peerId,i=JSON.stringify(r),o=!0;this._transport.send(i,n,o)}async _sendSessionRequest(t,r,n){this._sendRequest(t,n),this._subscribeToSessionResponse(t.id,r)}_sendCallRequest(t,r){return this._sendRequest(t,r),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:r}]}),this._subscribeToCallResponse(t.id)}_formatRequest(t){if(typeof t.method>"u")throw new Error(g9);return{id:typeof t.id>"u"?El():t.id,jsonrpc:"2.0",method:t.method,params:typeof t.params>"u"?[]:t.params}}_formatResponse(t){if(typeof t.id>"u")throw new Error(b9);let r={id:t.id,jsonrpc:"2.0"};if(ef(t)){let n=U8(t.error);return Object.assign(Object.assign(Object.assign({},r),t),{error:n})}else if(va(t))return Object.assign(Object.assign({},r),t);throw new Error(jy)}_handleSessionDisconnect(t){let r=t||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),_l(wl)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:r}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(t,r){r?r.approved?(this._connected?(r.chainId&&(this.chainId=r.chainId),r.accounts&&(this.accounts=r.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,r.chainId&&(this.chainId=r.chainId),r.accounts&&(this.accounts=r.accounts),r.peerId&&!this.peerId&&(this.peerId=r.peerId),r.peerMeta&&!this.peerMeta&&(this.peerMeta=r.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(t):this._handleSessionDisconnect(t)}async _handleIncomingMessages(t){if(![this.clientId,this.handshakeTopic].includes(t.topic))return;let n;try{n=JSON.parse(t.payload)}catch{return}let i=await this._decrypt(n);i&&this._eventManager.trigger(i)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(t,r){this.on(`response:${t}`,r)}_subscribeToSessionResponse(t,r){this._subscribeToResponse(t,(n,i)=>{if(n){this._handleSessionResponse(n.message);return}va(i)?this._handleSessionResponse(r,i.result):i.error&&i.error.message?this._handleSessionResponse(i.error.message):this._handleSessionResponse(r)})}_subscribeToCallResponse(t){return new Promise((r,n)=>{this._subscribeToResponse(t,(i,o)=>{if(i){n(i);return}va(o)?r(o.result):o.error&&o.error.message?n(o.error):n(new Error(jy))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(t,r)=>{let{request:n}=r.params[0];if(sy()&&this._signingMethods.includes(n.method)){let i=yl(wl);i&&(window.location.href=i.href)}}),this.on("wc_sessionRequest",(t,r)=>{t&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),this.handshakeId=r.id,this.peerId=r.params[0].peerId,this.peerMeta=r.params[0].peerMeta;let n=Object.assign(Object.assign({},r),{method:"session_request"});this._eventManager.trigger(n)}),this.on("wc_sessionUpdate",(t,r)=>{t&&this._handleSessionResponse(t.message),this._handleSessionResponse("Session disconnected",r.params[0])})}_initTransport(){this._transport.on("message",t=>this._handleIncomingMessages(t)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){let t=this.protocol,r=this.handshakeTopic,n=this.version,i=encodeURIComponent(this.bridge),o=this.key;return`${t}:${r}@${n}?bridge=${i}&key=${o}`}_parseUri(t){let r=u9(t);if(r.protocol===this.protocol){if(!r.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");let n=r.handshakeTopic;if(!r.bridge)throw Error("Invalid or missing bridge url parameter value");let i=decodeURIComponent(r.bridge);if(!r.key)throw Error("Invalid or missing key parameter value");let o=r.key;return{handshakeTopic:n,bridge:i,key:o}}else throw new Error(_9)}async _generateKey(){return this._cryptoLib?await this._cryptoLib.generateKey():null}async _encrypt(t){let r=this._key;return this._cryptoLib&&r?await this._cryptoLib.encrypt(t,r):null}async _decrypt(t){let r=this._key;return this._cryptoLib&&r?await this._cryptoLib.decrypt(t,r):null}_getStorageSession(){let t=null;return this._sessionStorage&&(t=this._sessionStorage.getSession()),t}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(t){if(!t.url||typeof t.url!="string")throw Error("Invalid or missing pushServerOpts.url parameter value");if(!t.type||typeof t.type!="string")throw Error("Invalid or missing pushServerOpts.type parameter value");if(!t.token||typeof t.token!="string")throw Error("Invalid or missing pushServerOpts.token parameter value");let r={bridge:this.bridge,topic:this.clientId,type:t.type,token:t.token,peerName:"",language:t.language||""};this.on("connect",async(n,i)=>{if(n)throw n;if(t.peerMeta){let o=i.params[0].peerMeta.name;r.peerName=o}try{if(!(await(await fetch(`${t.url}/new`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r)})).json()).success)throw Error("Failed to register in Push Server")}catch{throw Error("Failed to register in Push Server")}})}},A9=Wy;var o_={};Mr(o_,{decrypt:()=>IY,encrypt:()=>RY,generateKey:()=>N9,verifyHmac:()=>q9});var eo={};Mr(eo,{AES_BROWSER_ALGO:()=>Xi,AES_LENGTH:()=>Ol,AES_NODE_ALGO:()=>aY,DECRYPT_OP:()=>Qy,ENCRYPT_OP:()=>Jy,ERROR_BAD_MAC:()=>bY,HEX_ENC:()=>mY,HMAC_BROWSER:()=>ma,HMAC_BROWSER_ALGO:()=>Gy,HMAC_LENGTH:()=>Dp,HMAC_NODE_ALGO:()=>uY,IV_LENGTH:()=>pY,KEY_LENGTH:()=>dY,LENGTH_0:()=>nY,LENGTH_1:()=>Vy,LENGTH_1024:()=>sY,LENGTH_128:()=>oY,LENGTH_16:()=>$y,LENGTH_256:()=>Bp,LENGTH_32:()=>Lp,LENGTH_512:()=>Ky,LENGTH_64:()=>iY,MAC_LENGTH:()=>vY,PREFIX_LENGTH:()=>hY,RIPEMD160_NODE_ALGO:()=>lY,SHA256_BROWSER_ALGO:()=>Zy,SHA256_NODE_ALGO:()=>fY,SHA512_BROWSER_ALGO:()=>Yy,SHA512_NODE_ALGO:()=>cY,SIGN_OP:()=>Xy,UTF8_ENC:()=>gY,VERIFY_OP:()=>e_,aesCbcDecrypt:()=>i_,aesCbcEncrypt:()=>n_,assert:()=>P9,hmacSha256Sign:()=>Fp,hmacSha256Verify:()=>xY,hmacSha512Sign:()=>MY,hmacSha512Verify:()=>SY,isConstantTime:()=>Rl,pkcs7:()=>k9,randomBytes:()=>zy,ripemd160:()=>OY,sha256:()=>EY,sha512:()=>AY});var O9=Hr(Qu());function zy(e){return O9.getBrowerCrypto().getRandomValues(new Uint8Array(e))}var ds=Hr(Qu());var nY=0,Vy=1,$y=16,Lp=32,iY=64,oY=128,Bp=256,Ky=512,sY=1024;var Ol=256,Dp=256,Xi="AES-CBC",Gy=`SHA-${Ol}`,ma="HMAC",Zy="SHA-256",Yy="SHA-512",aY=`aes-${Ol}-cbc`,uY=`sha${Dp}`,fY="sha256",cY="sha512",lY="ripemd160",hY=1,dY=32,pY=16,vY=32;var mY="hex",gY="utf8";var bY="Bad MAC";var Jy="encrypt",Qy="decrypt",Xy="sign",e_="verify";function yY(e){return e===Xi?{length:Ol,name:Xi}:{hash:{name:Gy},name:ma}}function _Y(e){return e===Xi?[Jy,Qy]:[Xy,e_]}async function jp(e,t=Xi){return ds.getSubtleCrypto().importKey("raw",e,yY(t),!0,_Y(t))}async function R9(e,t,r){let n=ds.getSubtleCrypto(),i=await jp(t,Xi),o=await n.encrypt({iv:e,name:Xi},i,r);return new Uint8Array(o)}async function I9(e,t,r){let n=ds.getSubtleCrypto(),i=await jp(t,Xi),o=await n.decrypt({iv:e,name:Xi},i,r);return new Uint8Array(o)}async function t_(e,t){let r=ds.getSubtleCrypto(),n=await jp(e,ma),i=await r.sign({length:Dp,name:ma},n,t);return new Uint8Array(i)}async function r_(e,t){let r=ds.getSubtleCrypto(),n=await jp(e,ma),i=await r.sign({length:512,name:ma},n,t);return new Uint8Array(i)}async function C9(e){let r=await ds.getSubtleCrypto().digest({name:Zy},e);return new Uint8Array(r)}async function T9(e){let r=await ds.getSubtleCrypto().digest({name:Yy},e);return new Uint8Array(r)}function n_(e,t,r){return R9(e,t,r)}function i_(e,t,r){return I9(e,t,r)}var Rn={};Mr(Rn,{assert:()=>P9,isConstantTime:()=>Rl,pkcs7:()=>k9});var Bo={};rr(Bo,Hr(Qu()));rr(Rn,Bo);var wY=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]],k9={pad(e){let t=wY[e.byteLength%16||0],r=new Uint8Array(e.byteLength+t.length);return r.set(e),r.set(t,e.byteLength),r},unpad(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}};function P9(e,t){if(!e)throw new Error(t||"Assertion failed")}function Rl(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 r===0}async function Fp(e,t){return await t_(e,t)}async function xY(e,t,r){let n=await t_(e,t);return Rl(n,r)}async function MY(e,t){return await r_(e,t)}async function SY(e,t,r){let n=await r_(e,t);return Rl(n,r)}async function EY(e){return await C9(e)}async function AY(e){return await T9(e)}async function OY(e){throw new Error("Not supported for Browser async methods, use sync instead!")}rr(eo,Rn);async function N9(e){let t=(e||256)/8,r=zy(t);return zE(Yu(r))}async function q9(e,t){let r=us(e.data),n=us(e.iv),i=us(e.hmac),o=as(i,!1),a=Ay(r,n),c=await Fp(t,a),v=as(c,!1);return ci(o)===ci(v)}async function RY(e,t,r){let n=ss(gp(t)),i=r||await N9(128),o=ss(gp(i)),a=as(o,!1),c=JSON.stringify(e),v=Ey(c),y=await n_(o,n,v),w=as(y,!1),M=Ay(y,o),S=await Fp(n,M),R=as(S,!1);return{data:w,hmac:R,iv:a}}async function IY(e,t){let r=ss(gp(t));if(!r)throw new Error("Missing key: required for decryption");if(!await q9(e,r))return null;let i=us(e.data),o=us(e.iv),a=await i_(o,r,i),c=Sy(a),v;try{v=JSON.parse(c)}catch{return null}return v}var s_=class extends A9{constructor(t,r){super({cryptoLib:o_,connectorOpts:t,pushServerOpts:r})}},L9=s_;var TD=Hr(KA());var zR=Hr(ZA()),VR=Hr(WR());var cte=uy("XMLHttpRequest")||VR.XMLHttpRequest,Uw=class extends zR.default{constructor(t){super(),this.url=t}formatError(t,r,n=-1){return{error:{message:r,code:n},id:t.id,jsonrpc:t.jsonrpc}}send(t,r){return new Promise(n=>{if(t.method==="eth_subscribe"){let c=this.formatError(t,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",c),n(c)}let i=new cte,o=!1,a=(c,v)=>{if(!o)if(i.abort(),o=!0,r)r(c,v);else{let{id:y,jsonrpc:w}=t,M=c?{id:y,jsonrpc:w,error:{message:c.message,code:c.code}}:{id:y,jsonrpc:w,result:v};this.emit("payload",M),n(M)}};i.open("POST",this.url,!0),i.setRequestHeader("Content-Type","application/json"),i.timeout=60*1e3,i.onerror=a,i.ontimeout=a,i.onreadystatechange=()=>{if(i.readyState===4)try{let c=JSON.parse(i.responseText);a(c.error,c.result)}catch(c){a(c)}},i.send(JSON.stringify(t))})}},$R=Uw;var Vde=eL(),$de=dL(),Kde=vL(),Gde=BB(),Zde=wD(),Yde=AD(),Jde=CD(),Y3=class extends Vde{constructor(t){if(super({pollingInterval:t.pollingInterval||8e3}),this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModal=TD.default,this.qrcodeModalOptions=void 0,this.rpc=null,this.infuraId="",this.http=null,this.isConnecting=!1,this.connected=!1,this.connectCallbacks=[],this.accounts=[],this.chainId=1,this.rpcUrl="",this.enable=async()=>{let r=await this.getWalletConnector();if(r)return this.start(),this.subscribeWalletConnector(),r.accounts;throw new Error("Failed to connect to WalleConnect")},this.request=async r=>this.send(r),this.send=async(r,n)=>{var i;if(typeof r=="string"){let o=r,a=n;return o==="personal_sign"&&(a=tf(a)),this.sendAsyncPromise(o,a)}if(r=Object.assign({id:El(),jsonrpc:"2.0"},r),r.method==="personal_sign"&&(r.params=tf(r.params)),n){this.sendAsync(r,n);return}if(r.method==="eth_signTypedData_v4"&&((i=this.walletMeta)===null||i===void 0?void 0:i.name)==="MetaMask"){let{result:o}=await this.handleOtherRequests(r);return o}else return this.sendAsyncPromise(r.method,r.params)},this.onConnect=r=>{this.connectCallbacks.push(r)},this.triggerConnect=r=>{this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach(n=>n(r))},this.bridge=t.connector?t.connector.bridge:t.bridge||"https://bridge.walletconnect.org",this.qrcode=typeof t.qrcode>"u"||t.qrcode!==!1,this.qrcodeModal=t.qrcodeModal||this.qrcodeModal,this.qrcodeModalOptions=t.qrcodeModalOptions,this.wc=t.connector||new L9({bridge:this.bridge,qrcodeModal:this.qrcode?this.qrcodeModal:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:t?.storageId,signingMethods:t?.signingMethods,clientMeta:t?.clientMeta}),this.rpc=t.rpc||null,!this.rpc&&(!t.infuraId||typeof t.infuraId!="string"||!t.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");this.infuraId=t.infuraId||"",this.chainId=t?.chainId||this.chainId,this.initialize()}get isWalletConnect(){return!0}get connector(){return this.wc}get walletMeta(){return this.wc.peerMeta}async disconnect(){this.close()}async close(){await(await this.getWalletConnector({disableSessionCreation:!0})).killSession(),await this.onDisconnect()}async handleRequest(t){try{let r,n=null,i=await this.getWalletConnector();switch(t.method){case"wc_killSession":await this.close(),n=null;break;case"eth_accounts":n=i.accounts;break;case"eth_coinbase":n=i.accounts[0];break;case"eth_chainId":n=i.chainId;break;case"net_version":n=i.chainId;break;case"eth_uninstallFilter":this.sendAsync(t,o=>o),n=!0;break;default:r=await this.handleOtherRequests(t)}return r||this.formatResponse(t,n)}catch(r){throw this.emit("error",r),r}}async handleOtherRequests(t){if(!Zu.includes(t.method)&&t.method.startsWith("eth_"))return this.handleReadRequests(t);let n=await(await this.getWalletConnector()).sendCustomRequest(t);return this.formatResponse(t,n)}async handleReadRequests(t){if(!this.http){let r=new Error("HTTP Connection not available");throw this.emit("error",r),r}return this.http.send(t)}formatResponse(t,r){return{id:t.id,jsonrpc:t.jsonrpc,result:r}}getWalletConnector(t={}){let{disableSessionCreation:r=!1}=t;return new Promise((n,i)=>{let o=this.wc;this.isConnecting?this.onConnect(a=>n(a)):!o.connected&&!r?(this.isConnecting=!0,o.on("modal_closed",()=>{i(new Error("User closed modal"))}),o.createSession({chainId:this.chainId}).then(()=>{o.on("connect",(a,c)=>{if(a)return this.isConnecting=!1,i(a);this.isConnecting=!1,this.connected=!0,c&&this.updateState(c.params[0]),this.emit("connect"),this.triggerConnect(o),n(o)})}).catch(a=>{this.isConnecting=!1,i(a)})):(this.connected||(this.connected=!0,this.updateState(o.session)),n(o))})}async subscribeWalletConnector(){let t=await this.getWalletConnector();t.on("disconnect",r=>{if(r){this.emit("error",r);return}this.onDisconnect()}),t.on("session_update",(r,n)=>{if(r){this.emit("error",r);return}this.updateState(n.params[0])})}async onDisconnect(){await this.stop(),this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected"),this.connected=!1}async updateState(t){let{accounts:r,chainId:n,networkId:i,rpcUrl:o}=t;(!this.accounts||r&&this.accounts!==r)&&(this.accounts=r,this.emit("accountsChanged",r)),(!this.chainId||n&&this.chainId!==n)&&(this.chainId=n,this.emit("chainChanged",n)),(!this.networkId||i&&this.networkId!==i)&&(this.networkId=i,this.emit("networkChanged",i)),this.updateRpcUrl(this.chainId,o||"")}updateRpcUrl(t,r=""){let n={infuraId:this.infuraId,custom:this.rpc||void 0};r=r||N8(t,n),r?(this.rpcUrl=r,this.updateHttpConnection()):this.emit("error",new Error(`No RPC Url available for chainId: ${t}`))}updateHttpConnection(){this.rpcUrl&&(this.http=new $R(this.rpcUrl),this.http.on("payload",t=>this.emit("payload",t)),this.http.on("error",t=>this.emit("error",t)))}sendAsyncPromise(t,r){return new Promise((n,i)=>{this.sendAsync({id:El(),jsonrpc:"2.0",method:t,params:r||[]},(o,a)=>{if(o){i(o);return}n(a.result)})})}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new Kde({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new $de),this.addProvider(new Jde),this.addProvider(new Gde),this.addProvider(new Yde),this.addProvider(new Zde(this.configWallet())),this.addProvider({handleRequest:async(t,r,n)=>{try{let{error:i,result:o}=await this.handleRequest(t);n(i,o)}catch(i){n(i)}},setEngine:t=>t})}configWallet(){return{getAccounts:async t=>{try{let n=(await this.getWalletConnector()).accounts;n&&n.length?t(null,n):t(new Error("Failed to get accounts"))}catch(r){t(r)}},processMessage:async(t,r)=>{try{let i=await(await this.getWalletConnector()).signMessage([t.from,t.data]);r(null,i)}catch(n){r(n)}},processPersonalMessage:async(t,r)=>{try{let i=await(await this.getWalletConnector()).signPersonalMessage([t.data,t.from]);r(null,i)}catch(n){r(n)}},processSignTransaction:async(t,r)=>{try{let i=await(await this.getWalletConnector()).signTransaction(t);r(null,i)}catch(n){r(n)}},processTransaction:async(t,r)=>{try{let i=await(await this.getWalletConnector()).sendTransaction(t);r(null,i)}catch(n){r(n)}},processTypedMessage:async(t,r)=>{try{let i=await(await this.getWalletConnector()).signTypedData([t.from,t.data]);r(null,i)}catch(n){r(n)}}}}},kD=Y3;var wK=Hr(H$());var U7e=Object.create,Xb=Object.defineProperty,H7e=Object.defineProperties,W7e=Object.getOwnPropertyDescriptor,z7e=Object.getOwnPropertyDescriptors,V7e=Object.getOwnPropertyNames,W$=Object.getOwnPropertySymbols,$7e=Object.getPrototypeOf,nK=Object.prototype.hasOwnProperty,K7e=Object.prototype.propertyIsEnumerable,z$=(e,t,r)=>t in e?Xb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gb=(e,t)=>{for(var r in t||(t={}))nK.call(t,r)&&z$(e,r,t[r]);if(W$)for(var r of W$(t))K7e.call(t,r)&&z$(e,r,t[r]);return e},_S=(e,t)=>H7e(e,z7e(t)),G7e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Z7e=(e,t)=>{for(var r in t)Xb(e,r,{get:t[r],enumerable:!0})},Y7e=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of V7e(t))!nK.call(e,i)&&i!==r&&Xb(e,i,{get:()=>t[i],enumerable:!(n=W7e(t,i))||n.enumerable});return e},J7e=(e,t,r)=>(r=e!=null?U7e($7e(e)):{},Y7e(t||!e||!e.__esModule?Xb(r,"default",{value:e,enumerable:!0}):r,e)),Dn=(e,t,r)=>new Promise((n,i)=>{var o=v=>{try{c(r.next(v))}catch(y){i(y)}},a=v=>{try{c(r.throw(v))}catch(y){i(y)}},c=v=>v.done?n(v.value):Promise.resolve(v.value).then(o,a);c((r=r.apply(e,t)).next())}),Q7e=G7e((e,t)=>{"use strict";var r=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function o(y,w,M){this.fn=y,this.context=w,this.once=M||!1}function a(y,w,M,S,R){if(typeof M!="function")throw new TypeError("The listener must be a function");var C=new o(M,S||y,R),B=n?n+w:w;return y._events[B]?y._events[B].fn?y._events[B]=[y._events[B],C]:y._events[B].push(C):(y._events[B]=C,y._eventsCount++),y}function c(y,w){--y._eventsCount===0?y._events=new i:delete y._events[w]}function v(){this._events=new i,this._eventsCount=0}v.prototype.eventNames=function(){var y=[],w,M;if(this._eventsCount===0)return y;for(M in w=this._events)r.call(w,M)&&y.push(n?M.slice(1):M);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(w)):y},v.prototype.listeners=function(y){var w=n?n+y:y,M=this._events[w];if(!M)return[];if(M.fn)return[M.fn];for(var S=0,R=M.length,C=new Array(R);S<R;S++)C[S]=M[S].fn;return C},v.prototype.listenerCount=function(y){var w=n?n+y:y,M=this._events[w];return M?M.fn?1:M.length:0},v.prototype.emit=function(y,w,M,S,R,C){var B=n?n+y:y;if(!this._events[B])return!1;var N=this._events[B],q=arguments.length,H,D;if(N.fn){switch(N.once&&this.removeListener(y,N.fn,void 0,!0),q){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,w),!0;case 3:return N.fn.call(N.context,w,M),!0;case 4:return N.fn.call(N.context,w,M,S),!0;case 5:return N.fn.call(N.context,w,M,S,R),!0;case 6:return N.fn.call(N.context,w,M,S,R,C),!0}for(D=1,H=new Array(q-1);D<q;D++)H[D-1]=arguments[D];N.fn.apply(N.context,H)}else{var ee=N.length,ge;for(D=0;D<ee;D++)switch(N[D].once&&this.removeListener(y,N[D].fn,void 0,!0),q){case 1:N[D].fn.call(N[D].context);break;case 2:N[D].fn.call(N[D].context,w);break;case 3:N[D].fn.call(N[D].context,w,M);break;case 4:N[D].fn.call(N[D].context,w,M,S);break;default:if(!H)for(ge=1,H=new Array(q-1);ge<q;ge++)H[ge-1]=arguments[ge];N[D].fn.apply(N[D].context,H)}}return!0},v.prototype.on=function(y,w,M){return a(this,y,w,M,!1)},v.prototype.once=function(y,w,M){return a(this,y,w,M,!0)},v.prototype.removeListener=function(y,w,M,S){var R=n?n+y:y;if(!this._events[R])return this;if(!w)return c(this,R),this;var C=this._events[R];if(C.fn)C.fn===w&&(!S||C.once)&&(!M||C.context===M)&&c(this,R);else{for(var B=0,N=[],q=C.length;B<q;B++)(C[B].fn!==w||S&&!C[B].once||M&&C[B].context!==M)&&N.push(C[B]);N.length?this._events[R]=N.length===1?N[0]:N:c(this,R)}return this},v.prototype.removeAllListeners=function(y){var w;return y?(w=n?n+y:y,this._events[w]&&c(this,w)):(this._events=new i,this._eventsCount=0),this},v.prototype.off=v.prototype.removeListener,v.prototype.addListener=v.prototype.on,v.prefixed=n,v.EventEmitter=v,typeof t<"u"&&(t.exports=v)});function X7e(e){let t={exports:{}};return e(t,t.exports),t.exports}var eAe=Number.MAX_SAFE_INTEGER||9007199254740991,xS={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:eAe,MAX_SAFE_COMPONENT_LENGTH:16},tAe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},Yt=tAe,ep=X7e(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=xS,n=(t=e.exports={}).re=[],i=t.src=[],o=t.t={},a=0,c=(v,y,w)=>{let M=a++;Yt(M,y),o[v]=M,i[M]=y,n[M]=new RegExp(y,w?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${i[o.NUMERICIDENTIFIER]})\\.(${i[o.NUMERICIDENTIFIER]})\\.(${i[o.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${i[o.NUMERICIDENTIFIERLOOSE]})\\.(${i[o.NUMERICIDENTIFIERLOOSE]})\\.(${i[o.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${i[o.NUMERICIDENTIFIER]}|${i[o.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${i[o.NUMERICIDENTIFIERLOOSE]}|${i[o.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${i[o.PRERELEASEIDENTIFIER]}(?:\\.${i[o.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${i[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[o.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${i[o.BUILDIDENTIFIER]}(?:\\.${i[o.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${i[o.MAINVERSION]}${i[o.PRERELEASE]}?${i[o.BUILD]}?`),c("FULL",`^${i[o.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${i[o.MAINVERSIONLOOSE]}${i[o.PRERELEASELOOSE]}?${i[o.BUILD]}?`),c("LOOSE",`^${i[o.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${i[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${i[o.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${i[o.XRANGEIDENTIFIER]})(?:\\.(${i[o.XRANGEIDENTIFIER]})(?:\\.(${i[o.XRANGEIDENTIFIER]})(?:${i[o.PRERELEASE]})?${i[o.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:${i[o.PRERELEASELOOSE]})?${i[o.BUILD]}?)?)?`),c("XRANGE",`^${i[o.GTLT]}\\s*${i[o.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${i[o.GTLT]}\\s*${i[o.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),c("COERCERTL",i[o.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${i[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${i[o.LONETILDE]}${i[o.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${i[o.LONETILDE]}${i[o.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${i[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${i[o.LONECARET]}${i[o.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${i[o.LONECARET]}${i[o.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${i[o.GTLT]}\\s*(${i[o.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${i[o.GTLT]}\\s*(${i[o.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${i[o.GTLT]}\\s*(${i[o.LOOSEPLAIN]}|${i[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${i[o.XRANGEPLAIN]})\\s+-\\s+(${i[o.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${i[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[o.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0.0.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),V$=/^[0-9]+$/,iK=(e,t)=>{let r=V$.test(e),n=V$.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},rAe=(e,t)=>iK(t,e),nAe={compareIdentifiers:iK,rcompareIdentifiers:rAe},{MAX_LENGTH:$$,MAX_SAFE_INTEGER:Hb}=xS,{re:K$,t:G$}=ep,{compareIdentifiers:Zd}=nAe,un=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof un){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>$$)throw new TypeError(`version is longer than ${$$} characters`);Yt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?K$[G$.LOOSE]:K$[G$.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Hb||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Hb||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Hb||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Hb)return i}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Yt("SemVer.compare",this.version,this.options,e),!(e instanceof un)){if(typeof e=="string"&&e===this.version)return 0;e=new un(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof un||(e=new un(e,this.options)),Zd(this.major,e.major)||Zd(this.minor,e.minor)||Zd(this.patch,e.patch)}comparePre(e){if(e instanceof un||(e=new un(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Yt("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return Zd(r,n)}while(++t)}compareBuild(e){e instanceof un||(e=new un(e,this.options));let t=0;do{let r=this.build[t],n=e.build[t];if(Yt("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return Zd(r,n)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},iAe=(e,t,r)=>new un(e,r).compare(new un(t,r)),fl=iAe,oAe=(e,t,r)=>fl(e,t,r)===0,sAe=oAe,aAe=(e,t,r)=>fl(e,t,r)!==0,uAe=aAe,fAe=(e,t,r)=>fl(e,t,r)>0,cAe=fAe,lAe=(e,t,r)=>fl(e,t,r)>=0,hAe=lAe,dAe=(e,t,r)=>fl(e,t,r)<0,pAe=dAe,vAe=(e,t,r)=>fl(e,t,r)<=0,mAe=vAe,gAe=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return sAe(e,r,n);case"!=":return uAe(e,r,n);case">":return cAe(e,r,n);case">=":return hAe(e,r,n);case"<":return pAe(e,r,n);case"<=":return mAe(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}},yS=gAe,Yd=Symbol("SemVer ANY"),Qd=class{static get ANY(){return Yd}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Qd){if(e.loose===!!t.loose)return e;e=e.value}Yt("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Yd?this.value="":this.value=this.operator+this.semver.version,Yt("comp",this)}parse(e){let t=this.options.loose?Z$[Y$.COMPARATORLOOSE]:Z$[Y$.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new un(r[2],this.options.loose):this.semver=Yd}toString(){return this.value}test(e){if(Yt("Comparator.test",e,this.options.loose),this.semver===Yd||e===Yd)return!0;if(typeof e=="string")try{e=new un(e,this.options)}catch(t){return!1}return yS(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Qd))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new al(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new al(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),n=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),i=this.semver.version===e.semver.version,o=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=yS(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),c=yS(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||n||i&&o||a||c}},{re:Z$,t:Y$}=ep,al=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof al)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new al(e.raw,t);if(e instanceof Qd)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let r=t?En[fn.HYPHENRANGELOOSE]:En[fn.HYPHENRANGE];e=e.replace(r,CAe(this.options.includePrerelease)),Yt("hyphen replace",e),e=e.replace(En[fn.COMPARATORTRIM],bAe),Yt("comparator trim",e,En[fn.COMPARATORTRIM]),e=(e=(e=e.replace(En[fn.TILDETRIM],yAe)).replace(En[fn.CARETTRIM],_Ae)).split(/\s+/).join(" ");let n=t?En[fn.COMPARATORLOOSE]:En[fn.COMPARATOR];return e.split(" ").map(i=>wAe(i,this.options)).join(" ").split(/\s+/).map(i=>IAe(i,this.options)).filter(this.options.loose?i=>!!i.match(n):()=>!0).map(i=>new Qd(i,this.options))}intersects(e,t){if(!(e instanceof al))throw new TypeError("a Range is required");return this.set.some(r=>J$(r,t)&&e.set.some(n=>J$(n,t)&&r.every(i=>n.every(o=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new un(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(TAe(this.set[t],e,this.options))return!0;return!1}},{re:En,t:fn,comparatorTrimReplace:bAe,tildeTrimReplace:yAe,caretTrimReplace:_Ae}=ep,J$=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},wAe=(e,t)=>(Yt("comp",e,t),e=SAe(e,t),Yt("caret",e),e=xAe(e,t),Yt("tildes",e),e=AAe(e,t),Yt("xrange",e),e=RAe(e,t),Yt("stars",e),e),jn=e=>!e||e.toLowerCase()==="x"||e==="*",xAe=(e,t)=>e.trim().split(/\s+/).map(r=>MAe(r,t)).join(" "),MAe=(e,t)=>{let r=t.loose?En[fn.TILDELOOSE]:En[fn.TILDE];return e.replace(r,(n,i,o,a,c)=>{let v;return Yt("tilde",e,n,i,o,a,c),jn(i)?v="":jn(o)?v=`>=${i}.0.0 <${+i+1}.0.0-0`:jn(a)?v=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:c?(Yt("replaceTilde pr",c),v=`>=${i}.${o}.${a}-${c} <${i}.${+o+1}.0-0`):v=`>=${i}.${o}.${a} <${i}.${+o+1}.0-0`,Yt("tilde return",v),v})},SAe=(e,t)=>e.trim().split(/\s+/).map(r=>EAe(r,t)).join(" "),EAe=(e,t)=>{Yt("caret",e,t);let r=t.loose?En[fn.CARETLOOSE]:En[fn.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,a,c,v)=>{let y;return Yt("caret",e,i,o,a,c,v),jn(o)?y="":jn(a)?y=`>=${o}.0.0${n} <${+o+1}.0.0-0`:jn(c)?y=o==="0"?`>=${o}.${a}.0${n} <${o}.${+a+1}.0-0`:`>=${o}.${a}.0${n} <${+o+1}.0.0-0`:v?(Yt("replaceCaret pr",v),y=o==="0"?a==="0"?`>=${o}.${a}.${c}-${v} <${o}.${a}.${+c+1}-0`:`>=${o}.${a}.${c}-${v} <${o}.${+a+1}.0-0`:`>=${o}.${a}.${c}-${v} <${+o+1}.0.0-0`):(Yt("no pr"),y=o==="0"?a==="0"?`>=${o}.${a}.${c}${n} <${o}.${a}.${+c+1}-0`:`>=${o}.${a}.${c}${n} <${o}.${+a+1}.0-0`:`>=${o}.${a}.${c} <${+o+1}.0.0-0`),Yt("caret return",y),y})},AAe=(e,t)=>(Yt("replaceXRanges",e,t),e.split(/\s+/).map(r=>OAe(r,t)).join(" ")),OAe=(e,t)=>{e=e.trim();let r=t.loose?En[fn.XRANGELOOSE]:En[fn.XRANGE];return e.replace(r,(n,i,o,a,c,v)=>{Yt("xRange",e,n,i,o,a,c,v);let y=jn(o),w=y||jn(a),M=w||jn(c),S=M;return i==="="&&S&&(i=""),v=t.includePrerelease?"-0":"",y?n=i===">"||i==="<"?"<0.0.0-0":"*":i&&S?(w&&(a=0),c=0,i===">"?(i=">=",w?(o=+o+1,a=0,c=0):(a=+a+1,c=0)):i==="<="&&(i="<",w?o=+o+1:a=+a+1),i==="<"&&(v="-0"),n=`${i+o}.${a}.${c}${v}`):w?n=`>=${o}.0.0${v} <${+o+1}.0.0-0`:M&&(n=`>=${o}.${a}.0${v} <${o}.${+a+1}.0-0`),Yt("xRange return",n),n})},RAe=(e,t)=>(Yt("replaceStars",e,t),e.trim().replace(En[fn.STAR],"")),IAe=(e,t)=>(Yt("replaceGTE0",e,t),e.trim().replace(En[t.includePrerelease?fn.GTE0PRE:fn.GTE0],"")),CAe=e=>(t,r,n,i,o,a,c,v,y,w,M,S,R)=>`${r=jn(n)?"":jn(i)?`>=${n}.0.0${e?"-0":""}`:jn(o)?`>=${n}.${i}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${v=jn(y)?"":jn(w)?`<${+y+1}.0.0-0`:jn(M)?`<${y}.${+w+1}.0-0`:S?`<=${y}.${w}.${M}-${S}`:e?`<${y}.${w}.${+M+1}-0`:`<=${v}`}`.trim(),TAe=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Yt(e[n].semver),e[n].semver!==Qd.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0},kAe=(e,t,r)=>{try{t=new al(t,r)}catch(n){return!1}return t.test(e)},{MAX_LENGTH:PAe}=xS,{re:Q$,t:X$}=ep,NAe=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof un)return e;if(typeof e!="string"||e.length>PAe||!(t.loose?Q$[X$.LOOSE]:Q$[X$.FULL]).test(e))return null;try{return new un(e,t)}catch(r){return null}},qAe=NAe,{re:Wb,t:zb}=ep,LAe=(e,t)=>{if(e instanceof un)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let n;for(;(n=Wb[zb.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),Wb[zb.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Wb[zb.COERCERTL].lastIndex=-1}else r=e.match(Wb[zb.COERCE]);return r===null?null:qAe(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function BAe(e){return String.fromCharCode(parseInt(e.slice(1),16))}function DAe(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function jAe(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,BAe))}function FAe(e){return decodeURIComponent(Array.from(atob(e),DAe).join(""))}function oK(e){return jAe(JSON.stringify(e))}function UAe(e){return JSON.parse(FAe(e))}function Jd(e){return typeof e=="undefined"}function HAe(e){return e===null}function sK(e){return HAe(e)||Jd(e)}function WAe(e){return sK(e)?!1:!Jd(e.jsonrpc)&&!Jd(e.id)&&(!Jd(e.result)||!Jd(e.error))}function zAe(e){return sK(e)?!1:typeof e=="number"&&Object.values($u).includes(e)}function wS(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var Dr={};function aK(e,t){return Object.assign(Dr,t),e}var VAe={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},os=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,os.prototype)}},ul=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=zAe(t)?t:$u.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,Object.setPrototypeOf(this,ul.prototype)}},tp=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},ey=class extends Error{constructor(e,t,r,n){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=n,this.__proto__=Error,Object.setPrototypeOf(this,ey.prototype)}},Zb=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function $Ae(){return new os(Co.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function uK(){return new os(Co.ModalNotReady,"Modal is not ready.")}function KAe(){return new os(Co.MalformedResponse,"Response from the Magic iframe is malformed.")}function GAe(e){return new os(Co.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function ZAe(e){let t=`Some extensions are incompatible with \`${Dr.sdkName}@${Dr.version}\`:`;return e.filter(r=>typeof r.compat!="undefined"&&r.compat!==null).forEach(r=>{let n=r.compat[Dr.sdkName];typeof n=="string"?t+=`
573
+ - Extension \`${r.name}\` supports version(s) \`${n}\``:n||(t+=`
574
+ - Extension \`${r.name}\` does not support ${Dr.platform} environments.`)}),new os(Co.IncompatibleExtensions,t)}function YAe(e){let t=r=>{let n=r+1,i=n%10,o=n%100;return i===1&&o!==11?`${n}st`:i===2&&o!==12?`${n}nd`:i===3&&o!==13?`${n}rd`:`${n}th`};return new os(Co.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
4
575
  Expected: \`${e.expected}\`
5
- Received: \`${e.received}\``)}function wr(){return new Ye(Ae.DuplicateIframe,"Duplicate iframes found.")}function eo(){return new Ye(Ae.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function to(){return new Ye(Ae.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${z.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function*ro(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var no=ro();function Ar(){return no.next().value}var Sr=Symbol("Payload pre-processed by Magic SDK");function Nr(e){return Object.defineProperty(e,Sr,{value:!0,enumerable:!1}),e}function io(e){return!!e[Sr]}function et(e){var t,n,o;return io(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=Ar(),e.method=(n=e.method)!=null?n:"noop",e.params=(o=e.params)!=null?o:[],Nr(e)),e}function V(e,t=[]){return Nr({params:t,method:e,jsonrpc:"2.0",id:Ar()})}var It=class{constructor(e){e instanceof It?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):Ki(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error!="undefined"&&this._error!==null}get hasResult(){return typeof this._result!="undefined"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},oo=ei(ti()),ao=class extends oo.default{};function Tr(){let e=new ao;return{emitter:e,createChainingEmitterMethod:(t,n)=>(...o)=>(e[t].apply(e,o),n),createBoundEmitterMethod:t=>(...n)=>e[t].apply(e,n)}}var Or=Symbol("isPromiEvent");function bt(e){return!!e[Or]}function Lr(e){let t=Mr(e),{createBoundEmitterMethod:n,createChainingEmitterMethod:o}=Tr(),s=Symbol("Promise.then"),c=Symbol("Promise.catch"),g=Symbol("Promise.finally"),p=(y,N)=>(...I)=>{let T=N[y].apply(N,I);return m(T)},m=y=>Object.assign(y,{[Or]:!0,[s]:y[s]||y.then,[c]:y[c]||y.catch,[g]:y[g]||y.finally,then:p(s,y),catch:p(c,y),finally:p(g,y),on:o("on",y),once:o("once",y),addListener:o("addListener",y),off:o("off",y),removeListener:o("removeListener",y),removeAllListeners:o("removeAllListeners",y),emit:n("emit"),eventNames:n("eventNames"),listeners:n("listeners"),listenerCount:n("listenerCount")}),v=m(t.then(y=>(v.emit("done",y),v.emit("settled"),y),y=>{throw v.emit("error",y),v.emit("settled"),y}));return v}function Mr(e){return new Promise((t,n)=>{let o=e(t,n);Promise.resolve(o).catch(n)})}var Me=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(_e.MAGIC_HANDLE_REQUEST,et(e)),n=Lr((s,c)=>{t.then(g=>{if(o(),g.hasError)c(new Oe(g.payload.error));else if(g.hasResult)s(g.payload.result);else throw zi()}).catch(g=>{o(),c(g)})}),o=this.overlay.on(fe.MAGIC_HANDLE_EVENT,s=>{var c;let{response:g}=s.data;if(g.id===e.id&&((c=g.result)==null?void 0:c.event)){let{event:p,params:m=[]}=g.result;n.emit(p,...m)}});return n}createIntermediaryEvent(e,t){return n=>{let o=V(U.IntermediaryEvent,[{payloadId:t,eventType:e,args:n}]);this.request(o)}}},so=class extends Me{loginWithMagicLink(e){let{email:t,showUI:n=!0,redirectURI:o}=e,s=V(this.sdk.testMode?U.LoginWithMagicLinkTestMode:U.LoginWithMagicLink,[{email:t,showUI:n,redirectURI:o}]);return this.request(s)}loginWithSMS(e){let{phoneNumber:t}=e,n=V(this.sdk.testMode?U.LoginWithSmsTestMode:U.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(n)}loginWithEmailOTP(e){let{email:t}=e,n=V(this.sdk.testMode?U.LoginWithEmailOTPTestMode:U.LoginWithEmailOTP,[{email:t,showUI:!0}]);return this.request(n)}loginWithCredential(e){let t=e!=null?e:"";if(!e&&z.platform==="web"){t=window.location.search;let o=window.location.origin+window.location.pathname;window.history.replaceState(null,"",o)}let n=V(this.sdk.testMode?U.LoginWithCredentialTestMode:U.LoginWithCredential,[t]);return this.request(n)}},$r={};Qn($r,{clear:()=>uo,getItem:()=>je,iterate:()=>ho,key:()=>lo,keys:()=>fo,length:()=>co,removeItem:()=>Et,setItem:()=>tt});var ze;function ge(e){return(...t)=>de(this,null,function*(){return ze||(ze=yield z.configureStorage()),yield ze.ready(),ze[e](...t)})}var je=ge("getItem"),tt=ge("setItem"),Et=ge("removeItem"),uo=ge("clear"),co=ge("length"),lo=ge("key"),fo=ge("keys"),ho=ge("iterate");function po(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var Rt="STORE_KEY_PRIVATE_KEY",rt="STORE_KEY_PUBLIC_JWK",wt="ECDSA",Pr="P-256",mo={name:wt,namedCurve:Pr},vo={name:wt,namedCurve:Pr};function Dr(){Et(rt),Et(Rt)}function go(){return de(this,null,function*(){let e=yield yo();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,n=yield je(Rt);if(!n||!t){console.info("unable to find private key or webcrypto unsupported");return}let o={iat:Math.floor(new Date().getTime()/1e3),jti:po()},s={typ:"dpop+jwt",alg:"ES256",jwk:e},c={protected:pr(JSON.stringify(s)),claims:pr(JSON.stringify(o))},g=Io(`${c.protected}.${c.claims}`),p={name:wt,hash:{name:"SHA-256"}},m=Ro(new Uint8Array(yield t.sign(p,n,g)));return`${c.protected}.${c.claims}.${m}`})}function yo(){return de(this,null,function*(){if(!_o()){console.info("webcrypto is not supported");return}return(yield je(rt))||(yield Eo()),je(rt)})}function Eo(){return de(this,null,function*(){let e=null,{subtle:t}=window.crypto,n=yield t.generateKey(mo,!0,["sign"]),o=yield t.exportKey("jwk",n.privateKey);e=yield t.exportKey("jwk",n.publicKey);let s=yield t.importKey("jwk",o,vo,!1,["sign"]);yield tt(Rt,s),yield tt(rt,e)})}function _o(){let e=typeof window!="undefined"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function pr(e){return Cr(bo(e))}function Io(e){return new TextEncoder().encode(e)}function Cr(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function bo(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(parseInt(n,16)))}function Ro(e){let t="";return e.forEach(n=>{t+=String.fromCharCode(n)}),Cr(t)}var wo=class extends Me{getIdToken(e){let t=V(this.sdk.testMode?U.GetIdTokenTestMode:U.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=V(this.sdk.testMode?U.GenerateIdTokenTestMode:U.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=V(this.sdk.testMode?U.GetMetadataTestMode:U.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:n=!0}=e,o=V(this.sdk.testMode?U.UpdateEmailTestMode:U.UpdateEmail,[{email:t,showUI:n}]);return this.request(o)}isLoggedIn(){let e=V(this.sdk.testMode?U.IsLoggedInTestMode:U.IsLoggedIn);return this.request(e)}logout(){Dr();let e=V(this.sdk.testMode?U.LogoutTestMode:U.Logout);return this.request(e)}showSettings(){let e=V(this.sdk.testMode?U.UserSettingsTestMode:U.UserSettings);return this.request(e)}updatePhoneNumber(){let e=V(this.sdk.testMode?U.UpdatePhoneNumberTestMode:U.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=V(this.sdk.testMode?U.RecoverAccountTestMode:U.RecoverAccount,[e]);return this.request(t)}},Ao=class extends Me{connectWithUI(){let e=V(U.RequestAccounts);return this.request(e)}showUI(){let e=V(U.ShowUI);return this.request(e)}getInfo(){let e=V(U.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=V(U.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){Dr();let e=V(U.Disconnect);return this.request(e)}},{createBoundEmitterMethod:Je,createChainingEmitterMethod:Ne}=Tr(),So=class extends Me{constructor(){super(...arguments),this.isMagic=!0,this.on=Ne("on",this),this.once=Ne("once",this),this.addListener=Ne("addListener",this),this.off=Ne("off",this),this.removeListener=Ne("removeListener",this),this.removeAllListeners=Ne("removeAllListeners",this),this.emit=Je("emit"),this.eventNames=Je("eventNames"),this.listeners=Je("listeners"),this.listenerCount=Je("listenerCount")}sendAsync(e,t){if(!t)throw Zi({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(_e.MAGIC_HANDLE_REQUEST,e.map(n=>{let o=et(n);return this.prefixPayloadMethodForTestMode(o),o})).then(n=>{t(null,n.map(o=>zn(yr({},o.payload),{error:o.hasError?new Oe(o.payload.error):null})))});else{let n=et(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(_e.MAGIC_HANDLE_REQUEST,n).then(o=>{t(o.hasError?new Oe(o.payload.error):null,o.payload)})}}send(e,t){if(typeof e=="string"){let o=V(e,Array.isArray(t)?t:[]);return this.request(o)}if(Array.isArray(e)||!!t){this.sendAsync(e,t);return}let n=eo();return n.log(),new It(e).applyError({code:-32603,message:n.rawMessage}).payload}enable(){let e=V("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}};function ke(e,t){return t?new URL(e,t):new URL(e)}var mr=["request","overlay","sdk"];function No(e){let t=Object.getPrototypeOf(e),n=[t];for(;t!==Me.prototype;)t=Object.getPrototypeOf(t),n.push(t);return n}var xr=class extends Me{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Lr,isPromiEvent:bt,encodeJSON:_r,decodeJSON:Yi,createJsonRpcRequestPayload:V,standardizeJsonRpcRequestPayload:et,storage:$r};let e=[this,...No(this)];mr.forEach(t=>{let n=e.map(g=>Object.getOwnPropertyDescriptor(g,t)),o=n.findIndex(g=>!!g),s=o>0,c=n[o];c&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:c,isPrototypeField:s}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Ji(t)}}))})}init(e){this.__is_initialized__||(mr.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:n,isPrototypeField:o}=this.__sdk_access_field_descriptors__.get(t);o?delete this[t]:Object.defineProperty(this,t,n)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:n,useInstead:o}=e,s=o?` Use \`${o}\` instead.`:"",c=`\`${t}\` will be removed from this Extension in version \`${n}\`.${s}`;return new Ze(this,"DEPRECATION_NOTICE",c)}createWarning(e,t){return new Ze(this,e,t)}createError(e,t,n){return new it(this,e,t,n)}},To=class extends xr{},Ie=class extends xr{};Ie.Internal=To,Ie.Anonymous="anonymous extension";function vr(e){return e.compat&&e.compat[z.sdkName]!=null?typeof e.compat[z.sdkName]=="string"?Ci(Fi(z.version),e.compat[z.sdkName]):!!e.compat[z.sdkName]:!0}function Oo(e){var t;let n=(t=e==null?void 0:e.extensions)!=null?t:[],o={},s=[];if(Array.isArray(n)?n.forEach(c=>{vr(c)?(c.init(this),(c.name||c.name!==Ie.Anonymous)&&(this[c.name]=c),c instanceof Ie.Internal&&(yt(c.config)||(o[c.name]=c.config))):s.push(c)}):Object.keys(n).forEach(c=>{if(vr(n[c])){n[c].init(this);let g=n[c];this[c]=g,g instanceof Ie.Internal&&(yt(g.config)||(o[n[c].name]=g.config))}else s.push(n[c])}),s.length)throw Qi(s);return o}var Qe=class{constructor(e,t){this.apiKey=e;var n;if(!e)throw qi();z.platform==="react-native"&&(t==null?void 0:t.endpoint)&&to().log();let{defaultEndpoint:o,version:s}=z;this.testMode=!!(t!=null&&t.testMode),this.endpoint=ke((n=t==null?void 0:t.endpoint)!=null?n:o).origin,this.auth=new so(this),this.user=new wo(this),this.wallet=new Ao(this),this.rpcProvider=new So(this);let c=Oo.call(this,t);this.parameters=_r(yr({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:ke(this.endpoint).host,sdk:Xi[z.sdkName],version:s,ext:yt(c)?void 0:c,locale:(t==null?void 0:t.locale)||"en_US"},z.bundleId?{bundleId:z.bundleId}:{}))}get overlay(){if(!Qe.__overlays__.has(this.parameters)){let e=new z.ViewController(this.endpoint,this.parameters);e.init(),Qe.__overlays__.set(this.parameters,e)}return Qe.__overlays__.get(this.parameters)}preload(){return de(this,null,function*(){yield this.overlay.ready})}},At=Qe;At.__overlays__=new Map;function Lo(e,t){return t&&Array.isArray(e)?e.find(n=>n.id===t):e}function Mo(e,t){var n;let o=(n=t.data.response)==null?void 0:n.id,s=Lo(e,o);if(o&&s){let c=new It(s).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:o,response:c}}return{}}function $o(e,t){return de(this,null,function*(){let n=yield je("rt"),o;if(z.platform==="web")try{o=yield go()}catch(s){console.error("webcrypto error",s)}return o?n?{msgType:e,payload:t,jwt:o,rt:n}:{msgType:e,payload:t,jwt:o}:{msgType:e,payload:t}})}function Po(e){return de(this,null,function*(){!e.data.rt||(yield tt("rt",e.data.rt))})}var Ur=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return de(this,null,function*(){return Mr(n=>de(this,null,function*(){yield this.ready;let o=[],s=Array.isArray(t)?t.map(m=>m.id):[],c=yield $o(`${e}-${this.parameters}`,t);yield this._post(c);let g=m=>v=>{let{id:y,response:N}=Mo(t,v);Po(v),y&&N&&Array.isArray(t)&&s.includes(y)?(o.push(N),o.length===t.length&&(m(),n(o))):y&&N&&!Array.isArray(t)&&y===t.id&&(m(),n(N))},p=this.on(fe.MAGIC_HANDLE_RESPONSE,g(()=>p()))}))})}on(e,t){let n=t.bind(window),o=s=>{s.data.msgType===`${e}-${this.parameters}`&&n(s)};return this.messageHandlers.add(o),()=>this.messageHandlers.delete(o)}waitForReady(){return new Promise(e=>{this.on(fe.MAGIC_OVERLAY_READY,()=>e())})}listen(){this.on(fe.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(fe.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}};var St={};Zt(St,{EthChainType:()=>rr,Extension:()=>Ie,ExtensionError:()=>it,ExtensionWarning:()=>Ze,MagicIncomingWindowMessage:()=>fe,MagicOutgoingWindowMessage:()=>_e,MagicPayloadMethod:()=>U,RPCError:()=>Oe,RPCErrorCode:()=>Se,SDKError:()=>he,SDKErrorCode:()=>le,SDKWarning:()=>Ye,SDKWarningCode:()=>Ae,isPromiEvent:()=>bt});var st=tr(Fr()),Tt=tr(jr());var Do={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function Co(e){for(let[t,n]of Object.entries(Do))e.style[t]=n}function xo(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(n=>n.src.includes(e)))}var at=class extends Ur{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(n=>{let o=()=>{if(xo(encodeURIComponent(this.parameters)))wr().log();else{let s=document.createElement("iframe");s.classList.add("magic-iframe"),s.dataset.magicIframeLabel=ke(this.endpoint).host,s.title="Secure Modal",s.src=ke(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,Co(s),document.body.appendChild(s),n(s)}};["loaded","interactive","complete"].includes(document.readyState)?o():window.addEventListener("load",o,!1)}),window.addEventListener("message",n=>{var o;if(n.origin===this.endpoint&&n.data&&n.data.msgType&&this.messageHandlers.size){n.data.response=(o=n.data.response)!=null?o:{};for(let s of this.messageHandlers.values())s(n)}})}showOverlay(){return we(this,null,function*(){let n=yield this.iframe;n.style.display="block",this.activeElement=document.activeElement,n.focus()})}hideOverlay(){return we(this,null,function*(){var o;let n=yield this.iframe;n.style.display="none",(o=this.activeElement)!=null&&o.focus&&this.activeElement.focus(),this.activeElement=null})}_post(n){return we(this,null,function*(){let o=yield this.iframe;if(o&&o.contentWindow)o.contentWindow.postMessage(n,this.endpoint);else throw Rr()})}};var Uo=Object.assign(br(At,{platform:"web",sdkName:"magic-sdk",version:"13.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:at,configureStorage:()=>we(void 0,null,function*(){let e=st.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(Tt),yield e.setDriver([st.default.INDEXEDDB,st.default.LOCALSTORAGE,Tt._driver]),e})}),Jt({},St)),Bo=Uo;return kn(Fo);})();
576
+ Received: \`${e.received}\``)}function fK(){return new tp(Vu.DuplicateIframe,"Duplicate iframes found.")}function JAe(){return new tp(Vu.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function QAe(){return new tp(Vu.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${Dr.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function*XAe(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var eOe=XAe();function cK(){return eOe.next().value}var lK=Symbol("Payload pre-processed by Magic SDK");function hK(e){return Object.defineProperty(e,lK,{value:!0,enumerable:!1}),e}function tOe(e){return!!e[lK]}function Yb(e){var t,r,n;return tOe(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=cK(),e.method=(r=e.method)!=null?r:"noop",e.params=(n=e.params)!=null?n:[],hK(e)),e}function Or(e,t=[]){return hK({params:t,method:e,jsonrpc:"2.0",id:cK()})}var MS=class{constructor(e){e instanceof MS?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):WAe(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error!="undefined"&&this._error!==null}get hasResult(){return typeof this._result!="undefined"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},rOe=J7e(Q7e()),nOe=class extends rOe.default{};function dK(){let e=new nOe;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...n)=>(e[t].apply(e,n),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var pK=Symbol("isPromiEvent");function SS(e){return!!e[pK]}function vK(e){let t=mK(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=dK(),i=Symbol("Promise.then"),o=Symbol("Promise.catch"),a=Symbol("Promise.finally"),c=(w,M)=>(...S)=>{let R=M[w].apply(M,S);return v(R)},v=w=>Object.assign(w,{[pK]:!0,[i]:w[i]||w.then,[o]:w[o]||w.catch,[a]:w[a]||w.finally,then:c(i,w),catch:c(o,w),finally:c(a,w),on:n("on",w),once:n("once",w),addListener:n("addListener",w),off:n("off",w),removeListener:n("removeListener",w),removeAllListeners:n("removeAllListeners",w),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),y=v(t.then(w=>(y.emit("done",w),y.emit("settled"),w),w=>{throw y.emit("error",w),y.emit("settled"),w}));return y}function mK(e){return new Promise((t,r)=>{let n=e(t,r);Promise.resolve(n).catch(r)})}var cl=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(fa.MAGIC_HANDLE_REQUEST,Yb(e)),r=vK((i,o)=>{t.then(a=>{if(n(),a.hasError)o(new ul(a.payload.error));else if(a.hasResult)i(a.payload.result);else throw KAe()}).catch(a=>{n(),o(a)})}),n=this.overlay.on(Po.MAGIC_HANDLE_EVENT,i=>{var o;let{response:a}=i.data;if(a.id===e.id&&((o=a.result)==null?void 0:o.event)){let{event:c,params:v=[]}=a.result;r.emit(c,...v)}});return r}createIntermediaryEvent(e,t){return r=>{let n=Or(_t.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(n)}}},iOe=class extends cl{loginWithMagicLink(e){let{email:t,showUI:r=!0,redirectURI:n}=e,i=Or(this.sdk.testMode?_t.LoginWithMagicLinkTestMode:_t.LoginWithMagicLink,[{email:t,showUI:r,redirectURI:n}]);return this.request(i)}loginWithSMS(e){let{phoneNumber:t}=e,r=Or(this.sdk.testMode?_t.LoginWithSmsTestMode:_t.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t}=e,r=Or(this.sdk.testMode?_t.LoginWithEmailOTPTestMode:_t.LoginWithEmailOTP,[{email:t,showUI:!0}]);return this.request(r)}loginWithCredential(e){let t=e!=null?e:"";if(!e&&Dr.platform==="web"){t=window.location.search;let n=window.location.origin+window.location.pathname;window.history.replaceState(null,"",n)}let r=Or(this.sdk.testMode?_t.LoginWithCredentialTestMode:_t.LoginWithCredential,[t]);return this.request(r)}},gK={};Z7e(gK,{clear:()=>oOe,getItem:()=>sa,iterate:()=>fOe,key:()=>aOe,keys:()=>uOe,length:()=>sOe,removeItem:()=>Jb,setItem:()=>Hu});var Vb;function aa(e){return(...t)=>Dn(this,null,function*(){return Vb||(Vb=yield Dr.configureStorage()),yield Vb.ready(),Vb[e](...t)})}var sa=aa("getItem"),Hu=aa("setItem"),Jb=aa("removeItem"),oOe=aa("clear"),sOe=aa("length"),aOe=aa("key"),uOe=aa("keys"),fOe=aa("iterate");function cOe(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var ES="STORE_KEY_PRIVATE_KEY",Qb="STORE_KEY_PUBLIC_JWK",AS="ECDSA",bK="P-256",lOe={name:AS,namedCurve:bK},hOe={name:AS,namedCurve:bK};function yK(){Jb(Qb),Jb(ES)}function dOe(){return Dn(this,null,function*(){let e=yield pOe();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,r=yield sa(ES);if(!r||!t){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:cOe()},i={typ:"dpop+jwt",alg:"ES256",jwk:e},o={protected:eK(JSON.stringify(i)),claims:eK(JSON.stringify(n))},a=gOe(`${o.protected}.${o.claims}`),c={name:AS,hash:{name:"SHA-256"}},v=yOe(new Uint8Array(yield t.sign(c,r,a)));return`${o.protected}.${o.claims}.${v}`})}function pOe(){return Dn(this,null,function*(){if(!mOe()){console.info("webcrypto is not supported");return}return(yield sa(Qb))||(yield vOe()),sa(Qb)})}function vOe(){return Dn(this,null,function*(){let e=null,{subtle:t}=window.crypto,r=yield t.generateKey(lOe,!0,["sign"]),n=yield t.exportKey("jwk",r.privateKey);e=yield t.exportKey("jwk",r.publicKey);let i=yield t.importKey("jwk",n,hOe,!1,["sign"]);yield Hu(ES,i),yield Hu(Qb,e)})}function mOe(){let e=typeof window!="undefined"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function eK(e){return _K(bOe(e))}function gOe(e){return new TextEncoder().encode(e)}function _K(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function bOe(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,r)=>String.fromCharCode(parseInt(r,16)))}function yOe(e){let t="";return e.forEach(r=>{t+=String.fromCharCode(r)}),_K(t)}var _Oe=class extends cl{getIdToken(e){let t=Or(this.sdk.testMode?_t.GetIdTokenTestMode:_t.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=Or(this.sdk.testMode?_t.GenerateIdTokenTestMode:_t.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=Or(this.sdk.testMode?_t.GetMetadataTestMode:_t.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:r=!0}=e,n=Or(this.sdk.testMode?_t.UpdateEmailTestMode:_t.UpdateEmail,[{email:t,showUI:r}]);return this.request(n)}isLoggedIn(){let e=Or(this.sdk.testMode?_t.IsLoggedInTestMode:_t.IsLoggedIn);return this.request(e)}logout(){yK();let e=Or(this.sdk.testMode?_t.LogoutTestMode:_t.Logout);return this.request(e)}showSettings(){let e=Or(this.sdk.testMode?_t.UserSettingsTestMode:_t.UserSettings);return this.request(e)}updatePhoneNumber(){let e=Or(this.sdk.testMode?_t.UpdatePhoneNumberTestMode:_t.UpdatePhoneNumber);return this.request(e)}},wOe=class extends cl{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){if(this.isMetaMaskBrowser()||this.isCoinbaseWalletBrowser())return this.autoConnectIfWalletBrowser();let e=this.getUserEnv(),t=Or(_t.Login,[e]),r=this.request(t);return r.on(To.WalletSelected,n=>Dn(this,null,function*(){try{let i=yield this.connectToThirdPartyWallet(n.wallet,t.id,n.showModal);Hu(this.localForageKey,n.wallet),this.createIntermediaryEvent(To.WalletConnected,t.id)(i)}catch(i){this.createIntermediaryEvent(To.WalletRejected,t.id)()}})),r}getProvider(){return Dn(this,null,function*(){var e,t;switch(yield sa(this.localForageKey)){case An.MetaMask:return this.getMetaMaskProvider();case An.WalletConnect:if(!((e=this.sdk.thirdPartyWalletOptions)!=null&&e.walletConnect))throw new Error(ko.WalletConnectError);return this.getWalletConnectProvider(!1);case An.CoinbaseWallet:if(!((t=this.sdk.thirdPartyWalletOptions)!=null&&t.coinbaseWallet))throw new Error(ko.CoinbaseWalletError);return this.getCoinbaseProvider().provider;default:return this.sdk.rpcProvider}})}showUI(){let e=Or(_t.ShowUI);return this.request(e)}getInfo(){let e=Or(_t.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=Or(_t.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){return Dn(this,null,function*(){yK();let e=yield sa(this.localForageKey);e===An.WalletConnect&&(yield this.getWalletConnectProvider(!1)).disconnect(),e===An.CoinbaseWallet&&this.getCoinbaseProvider().provider.disconnect(),Jb(this.localForageKey);let t=Or(_t.Disconnect);return this.request(t)})}isMetaMaskInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(n=>n==null?void 0:n.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}getWalletConnectProvider(e){return Dn(this,null,function*(){var t;let r=(t=this.sdk.thirdPartyWalletOptions)==null?void 0:t.walletConnect;if(!r)throw new Error(ko.WalletConnectError);let n=new kD(_S(Gb({},r),{qrcode:e})),i=yield sa(this.localForageKey),o=localStorage.getItem("walletconnect");return i&&o&&(yield n.enable()),n})}connectToWalletConnect(e,t){return Dn(this,null,function*(){var r;if(!((r=this.sdk.thirdPartyWalletOptions)!=null&&r.walletConnect))throw new Error(ko.WalletConnectError);let n=yield this.getWalletConnectProvider(!!t);return n.connector.on(To.DisplayUri,(i,o)=>{if(!t){let a=o.params[0];this.createIntermediaryEvent(To.Uri,e)(a)}}),n.enable()})}isCoinbaseWalletInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(n=>n==null?void 0:n.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,t,r,n;let i=(t=(e=this.sdk.thirdPartyWalletOptions)==null?void 0:e.coinbaseWallet)==null?void 0:t.provider,o=(n=(r=this.sdk.thirdPartyWalletOptions)==null?void 0:r.coinbaseWallet)==null?void 0:n.sdk;if(!i||!o)throw new Error(ko.CoinbaseWalletError);let a=new wK.CoinbaseWalletSDK(_S(Gb({},o),{overrideIsMetaMask:!1,headlessMode:!0})),c=a.getQrUrl();return{provider:a.makeWeb3Provider(i.jsonRpcUrl,i.chainId),qrCodeUrl:c}}connectToCoinbaseWallet(e){var t;if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let n=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=n}if(!((t=this.sdk.thirdPartyWalletOptions)!=null&&t.coinbaseWallet))throw new Error(ko.CoinbaseWalletError);let r=this.getCoinbaseProvider();return r.qrCodeUrl&&this.createIntermediaryEvent(To.Uri,e)(r.qrCodeUrl),r.provider.request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e,t,r){switch(e){case An.MetaMask:return this.connectToMetaMask();case An.WalletConnect:return this.connectToWalletConnect(t,r);case An.CoinbaseWallet:return this.connectToCoinbaseWallet(t);default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask", "coinbase_wallet", or "wallet_connect".`)}}autoConnectIfWalletBrowser(){return Dn(this,null,function*(){let e,t;if(this.isMetaMaskBrowser())try{e=An.MetaMask,t=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"}),Hu(this.localForageKey,An.MetaMask)}catch(n){console.error(n)}else if(this.isCoinbaseWalletBrowser())try{e=An.CoinbaseWallet,t=yield this.getCoinbaseProvider().provider.request({method:"eth_requestAccounts"}),Hu(this.localForageKey,An.CoinbaseWallet)}catch(n){console.error(n)}let r=Or(_t.AutoConnect,[{wallet:e,address:t}]);return this.request(r)})}},{createBoundEmitterMethod:$b,createChainingEmitterMethod:sl}=dK(),xOe=class extends cl{constructor(){super(...arguments),this.isMagic=!0,this.on=sl("on",this),this.once=sl("once",this),this.addListener=sl("addListener",this),this.off=sl("off",this),this.removeListener=sl("removeListener",this),this.removeAllListeners=sl("removeAllListeners",this),this.emit=$b("emit"),this.eventNames=$b("eventNames"),this.listeners=$b("listeners"),this.listenerCount=$b("listenerCount")}sendAsync(e,t){if(!t)throw YAe({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(fa.MAGIC_HANDLE_REQUEST,e.map(r=>{let n=Yb(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{t(null,r.map(n=>_S(Gb({},n.payload),{error:n.hasError?new ul(n.payload.error):null})))});else{let r=Yb(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(fa.MAGIC_HANDLE_REQUEST,r).then(n=>{t(n.hasError?new ul(n.payload.error):null,n.payload)})}}send(e,t){if(typeof e=="string"){let n=Or(e,Array.isArray(t)?t:[]);return this.request(n)}if(Array.isArray(e)||!!t){this.sendAsync(e,t);return}let r=JAe();return r.log(),new MS(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=Or("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}};function Xd(e,t){return t?new URL(e,t):new URL(e)}var tK=["request","overlay","sdk"];function MOe(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==cl.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var xK=class extends cl{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:vK,isPromiEvent:SS,encodeJSON:oK,decodeJSON:UAe,createJsonRpcRequestPayload:Or,standardizeJsonRpcRequestPayload:Yb,storage:gK};let e=[this,...MOe(this)];tK.forEach(t=>{let r=e.map(a=>Object.getOwnPropertyDescriptor(a,t)),n=r.findIndex(a=>!!a),i=n>0,o=r[n];o&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:o,isPrototypeField:i}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw GAe(t)}}))})}init(e){this.__is_initialized__||(tK.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:r,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(t);n?delete this[t]:Object.defineProperty(this,t,r)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:n}=e,i=n?` Use \`${n}\` instead.`:"",o=`\`${t}\` will be removed from this Extension in version \`${r}\`.${i}`;return new Zb(this,"DEPRECATION_NOTICE",o)}createWarning(e,t){return new Zb(this,e,t)}createError(e,t,r){return new ey(this,e,t,r)}},SOe=class extends xK{},Wu=class extends xK{};Wu.Internal=SOe,Wu.Anonymous="anonymous extension";function rK(e){return e.compat&&e.compat[Dr.sdkName]!=null?typeof e.compat[Dr.sdkName]=="string"?kAe(LAe(Dr.version),e.compat[Dr.sdkName]):!!e.compat[Dr.sdkName]:!0}function EOe(e){var t;let r=(t=e==null?void 0:e.extensions)!=null?t:[],n={},i=[];if(Array.isArray(r)?r.forEach(o=>{rK(o)?(o.init(this),(o.name||o.name!==Wu.Anonymous)&&(this[o.name]=o),o instanceof Wu.Internal&&(wS(o.config)||(n[o.name]=o.config))):i.push(o)}):Object.keys(r).forEach(o=>{if(rK(r[o])){r[o].init(this);let a=r[o];this[o]=a,a instanceof Wu.Internal&&(wS(a.config)||(n[r[o].name]=a.config))}else i.push(r[o])}),i.length)throw ZAe(i);return n}var Kb=class{constructor(e,t){this.apiKey=e;var r;if(!e)throw $Ae();Dr.platform==="react-native"&&(t==null?void 0:t.endpoint)&&QAe().log();let{defaultEndpoint:n,version:i,thirdPartyWalletOptions:o}=Dr;this.testMode=!!(t!=null&&t.testMode),this.endpoint=Xd((r=t==null?void 0:t.endpoint)!=null?r:n).origin,this.thirdPartyWalletOptions=o||(t==null?void 0:t.thirdPartyWalletOptions),this.auth=new iOe(this),this.user=new _Oe(this),this.wallet=new wOe(this),this.rpcProvider=new xOe(this);let a=EOe.call(this,t);this.parameters=oK(Gb({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:Xd(this.endpoint).host,sdk:VAe[Dr.sdkName],version:i,ext:wS(a)?void 0:a,locale:(t==null?void 0:t.locale)||"en_US"},Dr.bundleId?{bundleId:Dr.bundleId}:{}))}get overlay(){if(!Kb.__overlays__.has(this.parameters)){let e=new Dr.ViewController(this.endpoint,this.parameters);e.init(),Kb.__overlays__.set(this.parameters,e)}return Kb.__overlays__.get(this.parameters)}preload(){return Dn(this,null,function*(){yield this.overlay.ready})}},OS=Kb;OS.__overlays__=new Map;function AOe(e,t){return t&&Array.isArray(e)?e.find(r=>r.id===t):e}function OOe(e,t){var r;let n=(r=t.data.response)==null?void 0:r.id,i=AOe(e,n);if(n&&i){let o=new MS(i).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:n,response:o}}return{}}function ROe(e,t){return Dn(this,null,function*(){let r=yield sa("rt"),n;if(Dr.platform==="web")try{n=yield dOe()}catch(i){console.error("webcrypto error",i)}return n?r?{msgType:e,payload:t,jwt:n,rt:r}:{msgType:e,payload:t,jwt:n}:{msgType:e,payload:t}})}function IOe(e){return Dn(this,null,function*(){!e.data.rt||(yield Hu("rt",e.data.rt))})}var MK=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return Dn(this,null,function*(){return mK(r=>Dn(this,null,function*(){yield this.ready;let n=[],i=Array.isArray(t)?t.map(v=>v.id):[],o=yield ROe(`${e}-${this.parameters}`,t);yield this._post(o);let a=v=>y=>{let{id:w,response:M}=OOe(t,y);IOe(y),w&&M&&Array.isArray(t)&&i.includes(w)?(n.push(M),n.length===t.length&&(v(),r(n))):w&&M&&!Array.isArray(t)&&w===t.id&&(v(),r(M))},c=this.on(Po.MAGIC_HANDLE_RESPONSE,a(()=>c()))}))})}on(e,t){let r=t.bind(window),n=i=>{i.data.msgType===`${e}-${this.parameters}`&&r(i)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise(e=>{this.on(Po.MAGIC_OVERLAY_READY,()=>e())})}listen(){this.on(Po.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Po.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}};var RS={};Mr(RS,{Errors:()=>ko,EthChainType:()=>LS,Events:()=>To,Extension:()=>Wu,ExtensionError:()=>ey,ExtensionWarning:()=>Zb,MagicIncomingWindowMessage:()=>Po,MagicOutgoingWindowMessage:()=>fa,MagicPayloadMethod:()=>_t,RPCError:()=>ul,RPCErrorCode:()=>$u,SDKError:()=>os,SDKErrorCode:()=>Co,SDKWarning:()=>tp,SDKWarningCode:()=>Vu,Wallets:()=>An,isPromiEvent:()=>SS});var ny=Hr(EK()),CS=Hr(OK());var COe={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function TOe(e){for(let[t,r]of Object.entries(COe))e.style[t]=r}function kOe(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(r=>r.src.includes(e)))}var ry=class extends MK{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(r=>{let n=()=>{if(kOe(encodeURIComponent(this.parameters)))fK().log();else{let i=document.createElement("iframe");i.classList.add("magic-iframe"),i.dataset.magicIframeLabel=Xd(this.endpoint).host,i.title="Secure Modal",i.src=Xd(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,TOe(i),document.body.appendChild(i),r(i)}};["loaded","interactive","complete"].includes(document.readyState)?n():window.addEventListener("load",n,!1)}),window.addEventListener("message",r=>{var n;if(r.origin===this.endpoint&&r.data&&r.data.msgType&&this.messageHandlers.size){r.data.response=(n=r.data.response)!=null?n:{};for(let i of this.messageHandlers.values())i(r)}})}showOverlay(){return zu(this,null,function*(){let r=yield this.iframe;r.style.display="block",this.activeElement=document.activeElement,r.focus()})}hideOverlay(){return zu(this,null,function*(){var n;let r=yield this.iframe;r.style.display="none",(n=this.activeElement)!=null&&n.focus&&this.activeElement.focus(),this.activeElement=null})}_post(r){return zu(this,null,function*(){let n=yield this.iframe;if(n&&n.contentWindow)n.contentWindow.postMessage(r,this.endpoint);else throw uK()})}};var POe=Object.assign(aK(OS,{platform:"web",sdkName:"magic-sdk",version:"14.0.0-b537cbc",defaultEndpoint:"https://auth.magic.link/",ViewController:ry,configureStorage:()=>zu(void 0,null,function*(){let e=ny.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(CS),yield e.setDriver([ny.default.INDEXEDDB,ny.default.LOCALSTORAGE,CS._driver]),e})}),qS({},RS)),NOe=POe;return Pt(qOe);})();
6
577
  if (Magic && Magic.default != null) { Magic = Object.assign(Magic.default, Magic); delete Magic.default; }