UNPKG

@reclaimprotocol/attestor-core

Version:

<div> <div> <img src="https://raw.githubusercontent.com/reclaimprotocol/.github/main/assets/banners/Attestor-Core.png" /> </div> </div>

1 lines 1.63 MB
var HS=Object.create;var Kg=Object.defineProperty;var YS=Object.getOwnPropertyDescriptor;var jS=Object.getOwnPropertyNames;var WS=Object.getPrototypeOf,zS=Object.prototype.hasOwnProperty;var JS=(t,e)=>()=>(t&&(e=t(t=0)),e);var $t=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Yi=(t,e)=>{for(var r in e)Kg(t,r,{get:e[r],enumerable:!0})},qS=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jS(e))!zS.call(t,i)&&i!==r&&Kg(t,i,{get:()=>e[i],enumerable:!(n=YS(e,i))||n.enumerable});return t};var Tr=(t,e,r)=>(r=t!=null?HS(WS(t)):{},qS(e||!t||!t.__esModule?Kg(r,"default",{value:t,enumerable:!0}):r,t));var yT=$t(()=>{var xT;(function(t){(function(e){var r=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),n=i(t);typeof r.Reflect<"u"&&(n=i(r.Reflect,n)),e(n,r),typeof r.Reflect>"u"&&(r.Reflect=t);function i(c,l){return function(f,d){Object.defineProperty(c,f,{configurable:!0,writable:!0,value:d}),l&&l(f,d)}}function s(){try{return Function("return this;")()}catch{}}function o(){try{return(0,eval)("(function() { return this; })()")}catch{}}function a(){return s()||o()}})(function(e,r){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",o=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,l=!a&&!c,f={create:a?function(){return lt(Object.create(null))}:c?function(){return lt({__proto__:null})}:function(){return lt({})},has:l?function(Z,W){return n.call(Z,W)}:function(Z,W){return W in Z},get:l?function(Z,W){return n.call(Z,W)?Z[W]:void 0}:function(Z,W){return Z[W]}},d=Object.getPrototypeOf(Function),E=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ct(),m=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:cr(),b=typeof WeakMap=="function"?WeakMap:yt(),v=i?Symbol.for("@reflect-metadata:registry"):void 0,U=ge(),k=Je(U);function G(Z,W,J,ve){if(A(J)){if(!He(Z))throw new TypeError;if(!we(W))throw new TypeError;return Be(Z,W)}else{if(!He(Z))throw new TypeError;if(!w(W))throw new TypeError;if(!w(ve)&&!A(ve)&&!B(ve))throw new TypeError;return B(ve)&&(ve=void 0),J=Ye(J),R(Z,W,J,ve)}}e("decorate",G);function q(Z,W){function J(ve,Pe){if(!w(ve))throw new TypeError;if(!A(Pe)&&!qe(Pe))throw new TypeError;S(Z,W,ve,Pe)}return J}e("metadata",q);function z(Z,W,J,ve){if(!w(J))throw new TypeError;return A(ve)||(ve=Ye(ve)),S(Z,W,J,ve)}e("defineMetadata",z);function P(Z,W,J){if(!w(W))throw new TypeError;return A(J)||(J=Ye(J)),h(Z,W,J)}e("hasMetadata",P);function ne(Z,W,J){if(!w(W))throw new TypeError;return A(J)||(J=Ye(J)),x(Z,W,J)}e("hasOwnMetadata",ne);function Ae(Z,W,J){if(!w(W))throw new TypeError;return A(J)||(J=Ye(J)),I(Z,W,J)}e("getMetadata",Ae);function ie(Z,W,J){if(!w(W))throw new TypeError;return A(J)||(J=Ye(J)),N(Z,W,J)}e("getOwnMetadata",ie);function Ee(Z,W){if(!w(Z))throw new TypeError;return A(W)||(W=Ye(W)),T(Z,W)}e("getMetadataKeys",Ee);function ye(Z,W){if(!w(Z))throw new TypeError;return A(W)||(W=Ye(W)),M(Z,W)}e("getOwnMetadataKeys",ye);function $(Z,W,J){if(!w(W))throw new TypeError;if(A(J)||(J=Ye(J)),!w(W))throw new TypeError;A(J)||(J=Ye(J));var ve=ce(W,J,!1);return A(ve)?!1:ve.OrdinaryDeleteMetadata(Z,W,J)}e("deleteMetadata",$);function Be(Z,W){for(var J=Z.length-1;J>=0;--J){var ve=Z[J],Pe=ve(W);if(!A(Pe)&&!B(Pe)){if(!we(Pe))throw new TypeError;W=Pe}}return W}function R(Z,W,J,ve){for(var Pe=Z.length-1;Pe>=0;--Pe){var tt=Z[Pe],vt=tt(W,J,ve);if(!A(vt)&&!B(vt)){if(!w(vt))throw new TypeError;ve=vt}}return ve}function h(Z,W,J){var ve=x(Z,W,J);if(ve)return!0;var Pe=Ne(W);return B(Pe)?!1:h(Z,Pe,J)}function x(Z,W,J){var ve=ce(W,J,!1);return A(ve)?!1:ae(ve.OrdinaryHasOwnMetadata(Z,W,J))}function I(Z,W,J){var ve=x(Z,W,J);if(ve)return N(Z,W,J);var Pe=Ne(W);if(!B(Pe))return I(Z,Pe,J)}function N(Z,W,J){var ve=ce(W,J,!1);if(!A(ve))return ve.OrdinaryGetOwnMetadata(Z,W,J)}function S(Z,W,J,ve){var Pe=ce(J,ve,!0);Pe.OrdinaryDefineOwnMetadata(Z,W,J,ve)}function T(Z,W){var J=M(Z,W),ve=Ne(Z);if(ve===null)return J;var Pe=T(ve,W);if(Pe.length<=0)return J;if(J.length<=0)return Pe;for(var tt=new m,vt=[],Ke=0,le=J;Ke<le.length;Ke++){var je=le[Ke],Fe=tt.has(je);Fe||(tt.add(je),vt.push(je))}for(var _e=0,ot=Pe;_e<ot.length;_e++){var je=ot[_e],Fe=tt.has(je);Fe||(tt.add(je),vt.push(je))}return vt}function M(Z,W){var J=ce(Z,W,!1);return J?J.OrdinaryOwnMetadataKeys(Z,W):[]}function D(Z){if(Z===null)return 1;switch(typeof Z){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return Z===null?1:6;default:return 6}}function A(Z){return Z===void 0}function B(Z){return Z===null}function oe(Z){return typeof Z=="symbol"}function w(Z){return typeof Z=="object"?Z!==null:typeof Z=="function"}function j(Z,W){switch(D(Z)){case 0:return Z;case 1:return Z;case 2:return Z;case 3:return Z;case 4:return Z;case 5:return Z}var J=W===3?"string":W===5?"number":"default",ve=sr(Z,s);if(ve!==void 0){var Pe=ve.call(Z,J);if(w(Pe))throw new TypeError;return Pe}return X(Z,J==="default"?"number":J)}function X(Z,W){if(W==="string"){var J=Z.toString;if(Re(J)){var ve=J.call(Z);if(!w(ve))return ve}var Pe=Z.valueOf;if(Re(Pe)){var ve=Pe.call(Z);if(!w(ve))return ve}}else{var Pe=Z.valueOf;if(Re(Pe)){var ve=Pe.call(Z);if(!w(ve))return ve}var tt=Z.toString;if(Re(tt)){var ve=tt.call(Z);if(!w(ve))return ve}}throw new TypeError}function ae(Z){return!!Z}function be(Z){return""+Z}function Ye(Z){var W=j(Z,3);return oe(W)?W:be(W)}function He(Z){return Array.isArray?Array.isArray(Z):Z instanceof Object?Z instanceof Array:Object.prototype.toString.call(Z)==="[object Array]"}function Re(Z){return typeof Z=="function"}function we(Z){return typeof Z=="function"}function qe(Z){switch(D(Z)){case 3:return!0;case 4:return!0;default:return!1}}function me(Z,W){return Z===W||Z!==Z&&W!==W}function sr(Z,W){var J=Z[W];if(J!=null){if(!Re(J))throw new TypeError;return J}}function ht(Z){var W=sr(Z,o);if(!Re(W))throw new TypeError;var J=W.call(Z);if(!w(J))throw new TypeError;return J}function it(Z){return Z.value}function se(Z){var W=Z.next();return W.done?!1:W}function de(Z){var W=Z.return;W&&W.call(Z)}function Ne(Z){var W=Object.getPrototypeOf(Z);if(typeof Z!="function"||Z===d||W!==d)return W;var J=Z.prototype,ve=J&&Object.getPrototypeOf(J);if(ve==null||ve===Object.prototype)return W;var Pe=ve.constructor;return typeof Pe!="function"||Pe===Z?W:Pe}function Ze(){var Z;!A(v)&&typeof r.Reflect<"u"&&!(v in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(Z=pt(r.Reflect));var W,J,ve,Pe=new b,tt={registerProvider:vt,getProvider:le,setProvider:Fe};return tt;function vt(_e){if(!Object.isExtensible(tt))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case Z===_e:break;case A(W):W=_e;break;case W===_e:break;case A(J):J=_e;break;case J===_e:break;default:ve===void 0&&(ve=new m),ve.add(_e);break}}function Ke(_e,ot){if(!A(W)){if(W.isProviderFor(_e,ot))return W;if(!A(J)){if(J.isProviderFor(_e,ot))return W;if(!A(ve))for(var u=ht(ve);;){var g=se(u);if(!g)return;var O=it(g);if(O.isProviderFor(_e,ot))return de(u),O}}}if(!A(Z)&&Z.isProviderFor(_e,ot))return Z}function le(_e,ot){var u=Pe.get(_e),g;return A(u)||(g=u.get(ot)),A(g)&&(g=Ke(_e,ot),A(g)||(A(u)&&(u=new E,Pe.set(_e,u)),u.set(ot,g))),g}function je(_e){if(A(_e))throw new TypeError;return W===_e||J===_e||!A(ve)&&ve.has(_e)}function Fe(_e,ot,u){if(!je(u))throw new Error("Metadata provider not registered.");var g=le(_e,ot);if(g!==u){if(!A(g))return!1;var O=Pe.get(_e);A(O)&&(O=new E,Pe.set(_e,O)),O.set(ot,u)}return!0}}function ge(){var Z;return!A(v)&&w(r.Reflect)&&Object.isExtensible(r.Reflect)&&(Z=r.Reflect[v]),A(Z)&&(Z=Ze()),!A(v)&&w(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,v,{enumerable:!1,configurable:!1,writable:!1,value:Z}),Z}function Je(Z){var W=new b,J={isProviderFor:function(je,Fe){var _e=W.get(je);return A(_e)?!1:_e.has(Fe)},OrdinaryDefineOwnMetadata:vt,OrdinaryHasOwnMetadata:Pe,OrdinaryGetOwnMetadata:tt,OrdinaryOwnMetadataKeys:Ke,OrdinaryDeleteMetadata:le};return U.registerProvider(J),J;function ve(je,Fe,_e){var ot=W.get(je),u=!1;if(A(ot)){if(!_e)return;ot=new E,W.set(je,ot),u=!0}var g=ot.get(Fe);if(A(g)){if(!_e)return;if(g=new E,ot.set(Fe,g),!Z.setProvider(je,Fe,J))throw ot.delete(Fe),u&&W.delete(je),new Error("Wrong provider for target.")}return g}function Pe(je,Fe,_e){var ot=ve(Fe,_e,!1);return A(ot)?!1:ae(ot.has(je))}function tt(je,Fe,_e){var ot=ve(Fe,_e,!1);if(!A(ot))return ot.get(je)}function vt(je,Fe,_e,ot){var u=ve(_e,ot,!0);u.set(je,Fe)}function Ke(je,Fe){var _e=[],ot=ve(je,Fe,!1);if(A(ot))return _e;for(var u=ot.keys(),g=ht(u),O=0;;){var H=se(g);if(!H)return _e.length=O,_e;var Q=it(H);try{_e[O]=Q}catch(K){try{de(g)}finally{throw K}}O++}}function le(je,Fe,_e){var ot=ve(Fe,_e,!1);if(A(ot)||!ot.delete(je))return!1;if(ot.size===0){var u=W.get(Fe);A(u)||(u.delete(_e),u.size===0&&W.delete(u))}return!0}}function pt(Z){var W=Z.defineMetadata,J=Z.hasOwnMetadata,ve=Z.getOwnMetadata,Pe=Z.getOwnMetadataKeys,tt=Z.deleteMetadata,vt=new b,Ke={isProviderFor:function(le,je){var Fe=vt.get(le);return!A(Fe)&&Fe.has(je)?!0:Pe(le,je).length?(A(Fe)&&(Fe=new m,vt.set(le,Fe)),Fe.add(je),!0):!1},OrdinaryDefineOwnMetadata:W,OrdinaryHasOwnMetadata:J,OrdinaryGetOwnMetadata:ve,OrdinaryOwnMetadataKeys:Pe,OrdinaryDeleteMetadata:tt};return Ke}function ce(Z,W,J){var ve=U.getProvider(Z,W);if(!A(ve))return ve;if(J){if(U.setProvider(Z,W,k))return k;throw new Error("Illegal state.")}}function ct(){var Z={},W=[],J=function(){function Ke(le,je,Fe){this._index=0,this._keys=le,this._values=je,this._selector=Fe}return Ke.prototype["@@iterator"]=function(){return this},Ke.prototype[o]=function(){return this},Ke.prototype.next=function(){var le=this._index;if(le>=0&&le<this._keys.length){var je=this._selector(this._keys[le],this._values[le]);return le+1>=this._keys.length?(this._index=-1,this._keys=W,this._values=W):this._index++,{value:je,done:!1}}return{value:void 0,done:!0}},Ke.prototype.throw=function(le){throw this._index>=0&&(this._index=-1,this._keys=W,this._values=W),le},Ke.prototype.return=function(le){return this._index>=0&&(this._index=-1,this._keys=W,this._values=W),{value:le,done:!0}},Ke}(),ve=function(){function Ke(){this._keys=[],this._values=[],this._cacheKey=Z,this._cacheIndex=-2}return Object.defineProperty(Ke.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Ke.prototype.has=function(le){return this._find(le,!1)>=0},Ke.prototype.get=function(le){var je=this._find(le,!1);return je>=0?this._values[je]:void 0},Ke.prototype.set=function(le,je){var Fe=this._find(le,!0);return this._values[Fe]=je,this},Ke.prototype.delete=function(le){var je=this._find(le,!1);if(je>=0){for(var Fe=this._keys.length,_e=je+1;_e<Fe;_e++)this._keys[_e-1]=this._keys[_e],this._values[_e-1]=this._values[_e];return this._keys.length--,this._values.length--,me(le,this._cacheKey)&&(this._cacheKey=Z,this._cacheIndex=-2),!0}return!1},Ke.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=Z,this._cacheIndex=-2},Ke.prototype.keys=function(){return new J(this._keys,this._values,Pe)},Ke.prototype.values=function(){return new J(this._keys,this._values,tt)},Ke.prototype.entries=function(){return new J(this._keys,this._values,vt)},Ke.prototype["@@iterator"]=function(){return this.entries()},Ke.prototype[o]=function(){return this.entries()},Ke.prototype._find=function(le,je){if(!me(this._cacheKey,le)){this._cacheIndex=-1;for(var Fe=0;Fe<this._keys.length;Fe++)if(me(this._keys[Fe],le)){this._cacheIndex=Fe;break}}return this._cacheIndex<0&&je&&(this._cacheIndex=this._keys.length,this._keys.push(le),this._values.push(void 0)),this._cacheIndex},Ke}();return ve;function Pe(Ke,le){return Ke}function tt(Ke,le){return le}function vt(Ke,le){return[Ke,le]}}function cr(){var Z=function(){function W(){this._map=new E}return Object.defineProperty(W.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),W.prototype.has=function(J){return this._map.has(J)},W.prototype.add=function(J){return this._map.set(J,J),this},W.prototype.delete=function(J){return this._map.delete(J)},W.prototype.clear=function(){this._map.clear()},W.prototype.keys=function(){return this._map.keys()},W.prototype.values=function(){return this._map.keys()},W.prototype.entries=function(){return this._map.entries()},W.prototype["@@iterator"]=function(){return this.keys()},W.prototype[o]=function(){return this.keys()},W}();return Z}function yt(){var Z=16,W=f.create(),J=ve();return function(){function le(){this._key=ve()}return le.prototype.has=function(je){var Fe=Pe(je,!1);return Fe!==void 0?f.has(Fe,this._key):!1},le.prototype.get=function(je){var Fe=Pe(je,!1);return Fe!==void 0?f.get(Fe,this._key):void 0},le.prototype.set=function(je,Fe){var _e=Pe(je,!0);return _e[this._key]=Fe,this},le.prototype.delete=function(je){var Fe=Pe(je,!1);return Fe!==void 0?delete Fe[this._key]:!1},le.prototype.clear=function(){this._key=ve()},le}();function ve(){var le;do le="@@WeakMap@@"+Ke();while(f.has(W,le));return W[le]=!0,le}function Pe(le,je){if(!n.call(le,J)){if(!je)return;Object.defineProperty(le,J,{value:f.create()})}return le[J]}function tt(le,je){for(var Fe=0;Fe<je;++Fe)le[Fe]=Math.random()*255|0;return le}function vt(le){if(typeof Uint8Array=="function"){var je=new Uint8Array(le);return typeof crypto<"u"?crypto.getRandomValues(je):typeof msCrypto<"u"?msCrypto.getRandomValues(je):tt(je,le),je}return tt(new Array(le),le)}function Ke(){var le=vt(Z);le[6]=le[6]&79|64,le[8]=le[8]&191|128;for(var je="",Fe=0;Fe<Z;++Fe){var _e=le[Fe];(Fe===4||Fe===6||Fe===8)&&(je+="-"),_e<16&&(je+="0"),je+=_e.toString(16).toLowerCase()}return je}}function lt(Z){return Z.__=void 0,delete Z.__,Z}})})(xT||(xT={}))});var Ao=$t(g0=>{"use strict";var pR="[object ArrayBuffer]",po=class t{static isArrayBuffer(e){return Object.prototype.toString.call(e)===pR}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,r){if(e.constructor===r)return e;if(this.isArrayBuffer(e))return new r(e);if(this.isArrayBufferView(e))return new r(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,r){let n=t.toUint8Array(e),i=t.toUint8Array(r);if(n.length!==i.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[s]!==i[s])return!1;return!0}static concat(...e){let r;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?r=e[0]:e[e.length-1]instanceof Function?r=e.slice(0,e.length-1):r=e;let n=0;for(let o of r)n+=o.byteLength;let i=new Uint8Array(n),s=0;for(let o of r){let a=this.toUint8Array(o);i.set(a,s),s+=a.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}},CE="string",AR=/^[0-9a-f\s]+$/i,mR=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,gR=/^[a-zA-Z0-9-_]+$/,Up=class{static fromString(e){let r=unescape(encodeURIComponent(e)),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n.buffer}static toString(e){let r=po.toUint8Array(e),n="";for(let s=0;s<r.length;s++)n+=String.fromCharCode(r[s]);return decodeURIComponent(escape(n))}},pi=class{static toString(e,r=!1){let n=po.toArrayBuffer(e),i=new DataView(n),s="";for(let o=0;o<n.byteLength;o+=2){let a=i.getUint16(o,r);s+=String.fromCharCode(a)}return s}static fromString(e,r=!1){let n=new ArrayBuffer(e.length*2),i=new DataView(n);for(let s=0;s<e.length;s++)i.setUint16(s*2,e.charCodeAt(s),r);return n}},Qp=class t{static isHex(e){return typeof e===CE&&AR.test(e)}static isBase64(e){return typeof e===CE&&mR.test(e)}static isBase64Url(e){return typeof e===CE&&gR.test(e)}static ToString(e,r="utf8"){let n=po.toUint8Array(e);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return pi.toString(n,!0);case"utf16":case"utf16be":return pi.toString(n);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,r="utf8"){if(!e)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return pi.fromString(e,!0);case"utf16":case"utf16be":return pi.fromString(e);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(e){let r=po.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(r,"binary");return btoa(n)}else return Buffer.from(r).toString("base64")}static FromBase64(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(e);case"utf8":return Up.fromString(e);case"utf16":case"utf16be":return pi.fromString(e);case"utf16le":case"usc2":return pi.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(e);case"utf8":return Up.toString(e);case"utf16":case"utf16be":return pi.toString(e);case"utf16le":case"usc2":return pi.toString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(e){let r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);return n.buffer}static ToBinary(e){let r=po.toUint8Array(e),n="";for(let i=0;i<r.length;i++)n+=String.fromCharCode(r[i]);return n}static ToHex(e){let r=po.toUint8Array(e),n="",i=r.length;for(let s=0;s<i;s++){let o=r[s];o<16&&(n+="0"),n+=o.toString(16)}return n}static FromHex(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);let n=new Uint8Array(r.length/2);for(let i=0;i<r.length;i=i+2){let s=r.slice(i,i+2);n[i/2]=parseInt(s,16)}return n.buffer}static ToUtf16String(e,r=!1){return pi.toString(e,r)}static FromUtf16String(e,r=!1){return pi.fromString(e,r)}static Base64Padding(e){let r=4-e.length%4;if(r<4)for(let n=0;n<r;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Qp.DEFAULT_UTF8_ENCODING="utf8";function ER(t,...e){let r=arguments[0];for(let n=1;n<arguments.length;n++){let i=arguments[n];for(let s in i)r[s]=i[s]}return r}function xR(...t){let e=t.map(i=>i.byteLength).reduce((i,s)=>i+s),r=new Uint8Array(e),n=0;return t.map(i=>new Uint8Array(i)).forEach(i=>{for(let s of i)r[n++]=s}),r.buffer}function yR(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)if(r[i]!==n[i])return!1;return!0}g0.BufferSourceConverter=po;g0.Convert=Qp;g0.assign=ER;g0.combine=xR;g0.isEqual=yR});var $3=$t(()=>{});var qy=$t((e5,Jy)=>{(function(t,e){"use strict";function r(R,h){if(!R)throw new Error(h||"Assertion failed")}function n(R,h){R.super_=h;var x=function(){};x.prototype=h.prototype,R.prototype=new x,R.prototype.constructor=R}function i(R,h,x){if(i.isBN(R))return R;this.negative=0,this.words=null,this.length=0,this.red=null,R!==null&&((h==="le"||h==="be")&&(x=h,h=10),this._init(R||0,h||10,x||"be"))}typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=$3().Buffer}catch{}i.isBN=function(h){return h instanceof i?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===i.wordSize&&Array.isArray(h.words)},i.max=function(h,x){return h.cmp(x)>0?h:x},i.min=function(h,x){return h.cmp(x)<0?h:x},i.prototype._init=function(h,x,I){if(typeof h=="number")return this._initNumber(h,x,I);if(typeof h=="object")return this._initArray(h,x,I);x==="hex"&&(x=16),r(x===(x|0)&&x>=2&&x<=36),h=h.toString().replace(/\s+/g,"");var N=0;h[0]==="-"&&(N++,this.negative=1),N<h.length&&(x===16?this._parseHex(h,N,I):(this._parseBase(h,x,N),I==="le"&&this._initArray(this.toArray(),x,I)))},i.prototype._initNumber=function(h,x,I){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(r(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),I==="le"&&this._initArray(this.toArray(),x,I)},i.prototype._initArray=function(h,x,I){if(r(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var S,T,M=0;if(I==="be")for(N=h.length-1,S=0;N>=0;N-=3)T=h[N]|h[N-1]<<8|h[N-2]<<16,this.words[S]|=T<<M&67108863,this.words[S+1]=T>>>26-M&67108863,M+=24,M>=26&&(M-=26,S++);else if(I==="le")for(N=0,S=0;N<h.length;N+=3)T=h[N]|h[N+1]<<8|h[N+2]<<16,this.words[S]|=T<<M&67108863,this.words[S+1]=T>>>26-M&67108863,M+=24,M>=26&&(M-=26,S++);return this._strip()};function o(R,h){var x=R.charCodeAt(h);if(x>=48&&x<=57)return x-48;if(x>=65&&x<=70)return x-55;if(x>=97&&x<=102)return x-87;r(!1,"Invalid character in "+R)}function a(R,h,x){var I=o(R,x);return x-1>=h&&(I|=o(R,x-1)<<4),I}i.prototype._parseHex=function(h,x,I){this.length=Math.ceil((h.length-x)/6),this.words=new Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var S=0,T=0,M;if(I==="be")for(N=h.length-1;N>=x;N-=2)M=a(h,x,N)<<S,this.words[T]|=M&67108863,S>=18?(S-=18,T+=1,this.words[T]|=M>>>26):S+=8;else{var D=h.length-x;for(N=D%2===0?x+1:x;N<h.length;N+=2)M=a(h,x,N)<<S,this.words[T]|=M&67108863,S>=18?(S-=18,T+=1,this.words[T]|=M>>>26):S+=8}this._strip()};function c(R,h,x,I){for(var N=0,S=0,T=Math.min(R.length,x),M=h;M<T;M++){var D=R.charCodeAt(M)-48;N*=I,D>=49?S=D-49+10:D>=17?S=D-17+10:S=D,r(D>=0&&S<I,"Invalid character"),N+=S}return N}i.prototype._parseBase=function(h,x,I){this.words=[0],this.length=1;for(var N=0,S=1;S<=67108863;S*=x)N++;N--,S=S/x|0;for(var T=h.length-I,M=T%N,D=Math.min(T,T-M)+I,A=0,B=I;B<D;B+=N)A=c(h,B,B+N,x),this.imuln(S),this.words[0]+A<67108864?this.words[0]+=A:this._iaddn(A);if(M!==0){var oe=1;for(A=c(h,B,h.length,x),B=0;B<M;B++)oe*=x;this.imuln(oe),this.words[0]+A<67108864?this.words[0]+=A:this._iaddn(A)}this._strip()},i.prototype.copy=function(h){h.words=new Array(this.length);for(var x=0;x<this.length;x++)h.words[x]=this.words[x];h.length=this.length,h.negative=this.negative,h.red=this.red};function l(R,h){R.words=h.words,R.length=h.length,R.negative=h.negative,R.red=h.red}if(i.prototype._move=function(h){l(h,this)},i.prototype.clone=function(){var h=new i(null);return this.copy(h),h},i.prototype._expand=function(h){for(;this.length<h;)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")]=f}catch{i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],E=[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(h,x){h=h||10,x=x|0||1;var I;if(h===16||h==="hex"){I="";for(var N=0,S=0,T=0;T<this.length;T++){var M=this.words[T],D=((M<<N|S)&16777215).toString(16);S=M>>>24-N&16777215,N+=2,N>=26&&(N-=26,T--),S!==0||T!==this.length-1?I=d[6-D.length]+D+I:I=D+I}for(S!==0&&(I=S.toString(16)+I);I.length%x!==0;)I="0"+I;return this.negative!==0&&(I="-"+I),I}if(h===(h|0)&&h>=2&&h<=36){var A=E[h],B=m[h];I="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var w=oe.modrn(B).toString(h);oe=oe.idivn(B),oe.isZero()?I=w+I:I=d[A-w.length]+w+I}for(this.isZero()&&(I="0"+I);I.length%x!==0;)I="0"+I;return this.negative!==0&&(I="-"+I),I}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},i.prototype.toJSON=function(){return this.toString(16,2)},s&&(i.prototype.toBuffer=function(h,x){return this.toArrayLike(s,h,x)}),i.prototype.toArray=function(h,x){return this.toArrayLike(Array,h,x)};var b=function(h,x){return h.allocUnsafe?h.allocUnsafe(x):new h(x)};i.prototype.toArrayLike=function(h,x,I){this._strip();var N=this.byteLength(),S=I||Math.max(1,N);r(N<=S,"byte array longer than desired length"),r(S>0,"Requested array length <= 0");var T=b(h,S),M=x==="le"?"LE":"BE";return this["_toArrayLike"+M](T,N),T},i.prototype._toArrayLikeLE=function(h,x){for(var I=0,N=0,S=0,T=0;S<this.length;S++){var M=this.words[S]<<T|N;h[I++]=M&255,I<h.length&&(h[I++]=M>>8&255),I<h.length&&(h[I++]=M>>16&255),T===6?(I<h.length&&(h[I++]=M>>24&255),N=0,T=0):(N=M>>>24,T+=2)}if(I<h.length)for(h[I++]=N;I<h.length;)h[I++]=0},i.prototype._toArrayLikeBE=function(h,x){for(var I=h.length-1,N=0,S=0,T=0;S<this.length;S++){var M=this.words[S]<<T|N;h[I--]=M&255,I>=0&&(h[I--]=M>>8&255),I>=0&&(h[I--]=M>>16&255),T===6?(I>=0&&(h[I--]=M>>24&255),N=0,T=0):(N=M>>>24,T+=2)}if(I>=0)for(h[I--]=N;I>=0;)h[I--]=0},Math.clz32?i.prototype._countBits=function(h){return 32-Math.clz32(h)}:i.prototype._countBits=function(h){var x=h,I=0;return x>=4096&&(I+=13,x>>>=13),x>=64&&(I+=7,x>>>=7),x>=8&&(I+=4,x>>>=4),x>=2&&(I+=2,x>>>=2),I+x},i.prototype._zeroBits=function(h){if(h===0)return 26;var x=h,I=0;return(x&8191)===0&&(I+=13,x>>>=13),(x&127)===0&&(I+=7,x>>>=7),(x&15)===0&&(I+=4,x>>>=4),(x&3)===0&&(I+=2,x>>>=2),(x&1)===0&&I++,I},i.prototype.bitLength=function(){var h=this.words[this.length-1],x=this._countBits(h);return(this.length-1)*26+x};function v(R){for(var h=new Array(R.bitLength()),x=0;x<h.length;x++){var I=x/26|0,N=x%26;h[x]=R.words[I]>>>N&1}return h}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,x=0;x<this.length;x++){var I=this._zeroBits(this.words[x]);if(h+=I,I!==26)break}return h},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},i.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).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(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var x=0;x<h.length;x++)this.words[x]=this.words[x]|h.words[x];return this._strip()},i.prototype.ior=function(h){return r((this.negative|h.negative)===0),this.iuor(h)},i.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},i.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},i.prototype.iuand=function(h){var x;this.length>h.length?x=h:x=this;for(var I=0;I<x.length;I++)this.words[I]=this.words[I]&h.words[I];return this.length=x.length,this._strip()},i.prototype.iand=function(h){return r((this.negative|h.negative)===0),this.iuand(h)},i.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},i.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},i.prototype.iuxor=function(h){var x,I;this.length>h.length?(x=this,I=h):(x=h,I=this);for(var N=0;N<I.length;N++)this.words[N]=x.words[N]^I.words[N];if(this!==x)for(;N<x.length;N++)this.words[N]=x.words[N];return this.length=x.length,this._strip()},i.prototype.ixor=function(h){return r((this.negative|h.negative)===0),this.iuxor(h)},i.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},i.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},i.prototype.inotn=function(h){r(typeof h=="number"&&h>=0);var x=Math.ceil(h/26)|0,I=h%26;this._expand(x),I>0&&x--;for(var N=0;N<x;N++)this.words[N]=~this.words[N]&67108863;return I>0&&(this.words[N]=~this.words[N]&67108863>>26-I),this._strip()},i.prototype.notn=function(h){return this.clone().inotn(h)},i.prototype.setn=function(h,x){r(typeof h=="number"&&h>=0);var I=h/26|0,N=h%26;return this._expand(I+1),x?this.words[I]=this.words[I]|1<<N:this.words[I]=this.words[I]&~(1<<N),this._strip()},i.prototype.iadd=function(h){var x;if(this.negative!==0&&h.negative===0)return this.negative=0,x=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,x=this.isub(h),h.negative=1,x._normSign();var I,N;this.length>h.length?(I=this,N=h):(I=h,N=this);for(var S=0,T=0;T<N.length;T++)x=(I.words[T]|0)+(N.words[T]|0)+S,this.words[T]=x&67108863,S=x>>>26;for(;S!==0&&T<I.length;T++)x=(I.words[T]|0)+S,this.words[T]=x&67108863,S=x>>>26;if(this.length=I.length,S!==0)this.words[this.length]=S,this.length++;else if(I!==this)for(;T<I.length;T++)this.words[T]=I.words[T];return this},i.prototype.add=function(h){var x;return h.negative!==0&&this.negative===0?(h.negative=0,x=this.sub(h),h.negative^=1,x):h.negative===0&&this.negative!==0?(this.negative=0,x=h.sub(this),this.negative=1,x):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},i.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var x=this.iadd(h);return h.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var I=this.cmp(h);if(I===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,S;I>0?(N=this,S=h):(N=h,S=this);for(var T=0,M=0;M<S.length;M++)x=(N.words[M]|0)-(S.words[M]|0)+T,T=x>>26,this.words[M]=x&67108863;for(;T!==0&&M<N.length;M++)x=(N.words[M]|0)+T,T=x>>26,this.words[M]=x&67108863;if(T===0&&M<N.length&&N!==this)for(;M<N.length;M++)this.words[M]=N.words[M];return this.length=Math.max(this.length,M),N!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(h){return this.clone().isub(h)};function U(R,h,x){x.negative=h.negative^R.negative;var I=R.length+h.length|0;x.length=I,I=I-1|0;var N=R.words[0]|0,S=h.words[0]|0,T=N*S,M=T&67108863,D=T/67108864|0;x.words[0]=M;for(var A=1;A<I;A++){for(var B=D>>>26,oe=D&67108863,w=Math.min(A,h.length-1),j=Math.max(0,A-R.length+1);j<=w;j++){var X=A-j|0;N=R.words[X]|0,S=h.words[j]|0,T=N*S+oe,B+=T/67108864|0,oe=T&67108863}x.words[A]=oe|0,D=B|0}return D!==0?x.words[A]=D|0:x.length--,x._strip()}var k=function(h,x,I){var N=h.words,S=x.words,T=I.words,M=0,D,A,B,oe=N[0]|0,w=oe&8191,j=oe>>>13,X=N[1]|0,ae=X&8191,be=X>>>13,Ye=N[2]|0,He=Ye&8191,Re=Ye>>>13,we=N[3]|0,qe=we&8191,me=we>>>13,sr=N[4]|0,ht=sr&8191,it=sr>>>13,se=N[5]|0,de=se&8191,Ne=se>>>13,Ze=N[6]|0,ge=Ze&8191,Je=Ze>>>13,pt=N[7]|0,ce=pt&8191,ct=pt>>>13,cr=N[8]|0,yt=cr&8191,lt=cr>>>13,Z=N[9]|0,W=Z&8191,J=Z>>>13,ve=S[0]|0,Pe=ve&8191,tt=ve>>>13,vt=S[1]|0,Ke=vt&8191,le=vt>>>13,je=S[2]|0,Fe=je&8191,_e=je>>>13,ot=S[3]|0,u=ot&8191,g=ot>>>13,O=S[4]|0,H=O&8191,Q=O>>>13,K=S[5]|0,Se=K&8191,$e=K>>>13,xt=S[6]|0,Me=xt&8191,Ge=xt>>>13,zr=S[7]|0,Qt=zr&8191,Lt=zr>>>13,wn=S[8]|0,Ht=wn&8191,Yt=wn>>>13,ho=S[9]|0,Zt=ho&8191,Xt=ho>>>13;I.negative=h.negative^x.negative,I.length=19,D=Math.imul(w,Pe),A=Math.imul(w,tt),A=A+Math.imul(j,Pe)|0,B=Math.imul(j,tt);var ps=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(ps>>>26)|0,ps&=67108863,D=Math.imul(ae,Pe),A=Math.imul(ae,tt),A=A+Math.imul(be,Pe)|0,B=Math.imul(be,tt),D=D+Math.imul(w,Ke)|0,A=A+Math.imul(w,le)|0,A=A+Math.imul(j,Ke)|0,B=B+Math.imul(j,le)|0;var Oe=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,D=Math.imul(He,Pe),A=Math.imul(He,tt),A=A+Math.imul(Re,Pe)|0,B=Math.imul(Re,tt),D=D+Math.imul(ae,Ke)|0,A=A+Math.imul(ae,le)|0,A=A+Math.imul(be,Ke)|0,B=B+Math.imul(be,le)|0,D=D+Math.imul(w,Fe)|0,A=A+Math.imul(w,_e)|0,A=A+Math.imul(j,Fe)|0,B=B+Math.imul(j,_e)|0;var mt=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(mt>>>26)|0,mt&=67108863,D=Math.imul(qe,Pe),A=Math.imul(qe,tt),A=A+Math.imul(me,Pe)|0,B=Math.imul(me,tt),D=D+Math.imul(He,Ke)|0,A=A+Math.imul(He,le)|0,A=A+Math.imul(Re,Ke)|0,B=B+Math.imul(Re,le)|0,D=D+Math.imul(ae,Fe)|0,A=A+Math.imul(ae,_e)|0,A=A+Math.imul(be,Fe)|0,B=B+Math.imul(be,_e)|0,D=D+Math.imul(w,u)|0,A=A+Math.imul(w,g)|0,A=A+Math.imul(j,u)|0,B=B+Math.imul(j,g)|0;var pr=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(pr>>>26)|0,pr&=67108863,D=Math.imul(ht,Pe),A=Math.imul(ht,tt),A=A+Math.imul(it,Pe)|0,B=Math.imul(it,tt),D=D+Math.imul(qe,Ke)|0,A=A+Math.imul(qe,le)|0,A=A+Math.imul(me,Ke)|0,B=B+Math.imul(me,le)|0,D=D+Math.imul(He,Fe)|0,A=A+Math.imul(He,_e)|0,A=A+Math.imul(Re,Fe)|0,B=B+Math.imul(Re,_e)|0,D=D+Math.imul(ae,u)|0,A=A+Math.imul(ae,g)|0,A=A+Math.imul(be,u)|0,B=B+Math.imul(be,g)|0,D=D+Math.imul(w,H)|0,A=A+Math.imul(w,Q)|0,A=A+Math.imul(j,H)|0,B=B+Math.imul(j,Q)|0;var Jr=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,D=Math.imul(de,Pe),A=Math.imul(de,tt),A=A+Math.imul(Ne,Pe)|0,B=Math.imul(Ne,tt),D=D+Math.imul(ht,Ke)|0,A=A+Math.imul(ht,le)|0,A=A+Math.imul(it,Ke)|0,B=B+Math.imul(it,le)|0,D=D+Math.imul(qe,Fe)|0,A=A+Math.imul(qe,_e)|0,A=A+Math.imul(me,Fe)|0,B=B+Math.imul(me,_e)|0,D=D+Math.imul(He,u)|0,A=A+Math.imul(He,g)|0,A=A+Math.imul(Re,u)|0,B=B+Math.imul(Re,g)|0,D=D+Math.imul(ae,H)|0,A=A+Math.imul(ae,Q)|0,A=A+Math.imul(be,H)|0,B=B+Math.imul(be,Q)|0,D=D+Math.imul(w,Se)|0,A=A+Math.imul(w,$e)|0,A=A+Math.imul(j,Se)|0,B=B+Math.imul(j,$e)|0;var Ef=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Ef>>>26)|0,Ef&=67108863,D=Math.imul(ge,Pe),A=Math.imul(ge,tt),A=A+Math.imul(Je,Pe)|0,B=Math.imul(Je,tt),D=D+Math.imul(de,Ke)|0,A=A+Math.imul(de,le)|0,A=A+Math.imul(Ne,Ke)|0,B=B+Math.imul(Ne,le)|0,D=D+Math.imul(ht,Fe)|0,A=A+Math.imul(ht,_e)|0,A=A+Math.imul(it,Fe)|0,B=B+Math.imul(it,_e)|0,D=D+Math.imul(qe,u)|0,A=A+Math.imul(qe,g)|0,A=A+Math.imul(me,u)|0,B=B+Math.imul(me,g)|0,D=D+Math.imul(He,H)|0,A=A+Math.imul(He,Q)|0,A=A+Math.imul(Re,H)|0,B=B+Math.imul(Re,Q)|0,D=D+Math.imul(ae,Se)|0,A=A+Math.imul(ae,$e)|0,A=A+Math.imul(be,Se)|0,B=B+Math.imul(be,$e)|0,D=D+Math.imul(w,Me)|0,A=A+Math.imul(w,Ge)|0,A=A+Math.imul(j,Me)|0,B=B+Math.imul(j,Ge)|0;var Ug=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Ug>>>26)|0,Ug&=67108863,D=Math.imul(ce,Pe),A=Math.imul(ce,tt),A=A+Math.imul(ct,Pe)|0,B=Math.imul(ct,tt),D=D+Math.imul(ge,Ke)|0,A=A+Math.imul(ge,le)|0,A=A+Math.imul(Je,Ke)|0,B=B+Math.imul(Je,le)|0,D=D+Math.imul(de,Fe)|0,A=A+Math.imul(de,_e)|0,A=A+Math.imul(Ne,Fe)|0,B=B+Math.imul(Ne,_e)|0,D=D+Math.imul(ht,u)|0,A=A+Math.imul(ht,g)|0,A=A+Math.imul(it,u)|0,B=B+Math.imul(it,g)|0,D=D+Math.imul(qe,H)|0,A=A+Math.imul(qe,Q)|0,A=A+Math.imul(me,H)|0,B=B+Math.imul(me,Q)|0,D=D+Math.imul(He,Se)|0,A=A+Math.imul(He,$e)|0,A=A+Math.imul(Re,Se)|0,B=B+Math.imul(Re,$e)|0,D=D+Math.imul(ae,Me)|0,A=A+Math.imul(ae,Ge)|0,A=A+Math.imul(be,Me)|0,B=B+Math.imul(be,Ge)|0,D=D+Math.imul(w,Qt)|0,A=A+Math.imul(w,Lt)|0,A=A+Math.imul(j,Qt)|0,B=B+Math.imul(j,Lt)|0;var Qg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Qg>>>26)|0,Qg&=67108863,D=Math.imul(yt,Pe),A=Math.imul(yt,tt),A=A+Math.imul(lt,Pe)|0,B=Math.imul(lt,tt),D=D+Math.imul(ce,Ke)|0,A=A+Math.imul(ce,le)|0,A=A+Math.imul(ct,Ke)|0,B=B+Math.imul(ct,le)|0,D=D+Math.imul(ge,Fe)|0,A=A+Math.imul(ge,_e)|0,A=A+Math.imul(Je,Fe)|0,B=B+Math.imul(Je,_e)|0,D=D+Math.imul(de,u)|0,A=A+Math.imul(de,g)|0,A=A+Math.imul(Ne,u)|0,B=B+Math.imul(Ne,g)|0,D=D+Math.imul(ht,H)|0,A=A+Math.imul(ht,Q)|0,A=A+Math.imul(it,H)|0,B=B+Math.imul(it,Q)|0,D=D+Math.imul(qe,Se)|0,A=A+Math.imul(qe,$e)|0,A=A+Math.imul(me,Se)|0,B=B+Math.imul(me,$e)|0,D=D+Math.imul(He,Me)|0,A=A+Math.imul(He,Ge)|0,A=A+Math.imul(Re,Me)|0,B=B+Math.imul(Re,Ge)|0,D=D+Math.imul(ae,Qt)|0,A=A+Math.imul(ae,Lt)|0,A=A+Math.imul(be,Qt)|0,B=B+Math.imul(be,Lt)|0,D=D+Math.imul(w,Ht)|0,A=A+Math.imul(w,Yt)|0,A=A+Math.imul(j,Ht)|0,B=B+Math.imul(j,Yt)|0;var _g=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(_g>>>26)|0,_g&=67108863,D=Math.imul(W,Pe),A=Math.imul(W,tt),A=A+Math.imul(J,Pe)|0,B=Math.imul(J,tt),D=D+Math.imul(yt,Ke)|0,A=A+Math.imul(yt,le)|0,A=A+Math.imul(lt,Ke)|0,B=B+Math.imul(lt,le)|0,D=D+Math.imul(ce,Fe)|0,A=A+Math.imul(ce,_e)|0,A=A+Math.imul(ct,Fe)|0,B=B+Math.imul(ct,_e)|0,D=D+Math.imul(ge,u)|0,A=A+Math.imul(ge,g)|0,A=A+Math.imul(Je,u)|0,B=B+Math.imul(Je,g)|0,D=D+Math.imul(de,H)|0,A=A+Math.imul(de,Q)|0,A=A+Math.imul(Ne,H)|0,B=B+Math.imul(Ne,Q)|0,D=D+Math.imul(ht,Se)|0,A=A+Math.imul(ht,$e)|0,A=A+Math.imul(it,Se)|0,B=B+Math.imul(it,$e)|0,D=D+Math.imul(qe,Me)|0,A=A+Math.imul(qe,Ge)|0,A=A+Math.imul(me,Me)|0,B=B+Math.imul(me,Ge)|0,D=D+Math.imul(He,Qt)|0,A=A+Math.imul(He,Lt)|0,A=A+Math.imul(Re,Qt)|0,B=B+Math.imul(Re,Lt)|0,D=D+Math.imul(ae,Ht)|0,A=A+Math.imul(ae,Yt)|0,A=A+Math.imul(be,Ht)|0,B=B+Math.imul(be,Yt)|0,D=D+Math.imul(w,Zt)|0,A=A+Math.imul(w,Xt)|0,A=A+Math.imul(j,Zt)|0,B=B+Math.imul(j,Xt)|0;var Lg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Lg>>>26)|0,Lg&=67108863,D=Math.imul(W,Ke),A=Math.imul(W,le),A=A+Math.imul(J,Ke)|0,B=Math.imul(J,le),D=D+Math.imul(yt,Fe)|0,A=A+Math.imul(yt,_e)|0,A=A+Math.imul(lt,Fe)|0,B=B+Math.imul(lt,_e)|0,D=D+Math.imul(ce,u)|0,A=A+Math.imul(ce,g)|0,A=A+Math.imul(ct,u)|0,B=B+Math.imul(ct,g)|0,D=D+Math.imul(ge,H)|0,A=A+Math.imul(ge,Q)|0,A=A+Math.imul(Je,H)|0,B=B+Math.imul(Je,Q)|0,D=D+Math.imul(de,Se)|0,A=A+Math.imul(de,$e)|0,A=A+Math.imul(Ne,Se)|0,B=B+Math.imul(Ne,$e)|0,D=D+Math.imul(ht,Me)|0,A=A+Math.imul(ht,Ge)|0,A=A+Math.imul(it,Me)|0,B=B+Math.imul(it,Ge)|0,D=D+Math.imul(qe,Qt)|0,A=A+Math.imul(qe,Lt)|0,A=A+Math.imul(me,Qt)|0,B=B+Math.imul(me,Lt)|0,D=D+Math.imul(He,Ht)|0,A=A+Math.imul(He,Yt)|0,A=A+Math.imul(Re,Ht)|0,B=B+Math.imul(Re,Yt)|0,D=D+Math.imul(ae,Zt)|0,A=A+Math.imul(ae,Xt)|0,A=A+Math.imul(be,Zt)|0,B=B+Math.imul(be,Xt)|0;var Vg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Vg>>>26)|0,Vg&=67108863,D=Math.imul(W,Fe),A=Math.imul(W,_e),A=A+Math.imul(J,Fe)|0,B=Math.imul(J,_e),D=D+Math.imul(yt,u)|0,A=A+Math.imul(yt,g)|0,A=A+Math.imul(lt,u)|0,B=B+Math.imul(lt,g)|0,D=D+Math.imul(ce,H)|0,A=A+Math.imul(ce,Q)|0,A=A+Math.imul(ct,H)|0,B=B+Math.imul(ct,Q)|0,D=D+Math.imul(ge,Se)|0,A=A+Math.imul(ge,$e)|0,A=A+Math.imul(Je,Se)|0,B=B+Math.imul(Je,$e)|0,D=D+Math.imul(de,Me)|0,A=A+Math.imul(de,Ge)|0,A=A+Math.imul(Ne,Me)|0,B=B+Math.imul(Ne,Ge)|0,D=D+Math.imul(ht,Qt)|0,A=A+Math.imul(ht,Lt)|0,A=A+Math.imul(it,Qt)|0,B=B+Math.imul(it,Lt)|0,D=D+Math.imul(qe,Ht)|0,A=A+Math.imul(qe,Yt)|0,A=A+Math.imul(me,Ht)|0,B=B+Math.imul(me,Yt)|0,D=D+Math.imul(He,Zt)|0,A=A+Math.imul(He,Xt)|0,A=A+Math.imul(Re,Zt)|0,B=B+Math.imul(Re,Xt)|0;var Gg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Gg>>>26)|0,Gg&=67108863,D=Math.imul(W,u),A=Math.imul(W,g),A=A+Math.imul(J,u)|0,B=Math.imul(J,g),D=D+Math.imul(yt,H)|0,A=A+Math.imul(yt,Q)|0,A=A+Math.imul(lt,H)|0,B=B+Math.imul(lt,Q)|0,D=D+Math.imul(ce,Se)|0,A=A+Math.imul(ce,$e)|0,A=A+Math.imul(ct,Se)|0,B=B+Math.imul(ct,$e)|0,D=D+Math.imul(ge,Me)|0,A=A+Math.imul(ge,Ge)|0,A=A+Math.imul(Je,Me)|0,B=B+Math.imul(Je,Ge)|0,D=D+Math.imul(de,Qt)|0,A=A+Math.imul(de,Lt)|0,A=A+Math.imul(Ne,Qt)|0,B=B+Math.imul(Ne,Lt)|0,D=D+Math.imul(ht,Ht)|0,A=A+Math.imul(ht,Yt)|0,A=A+Math.imul(it,Ht)|0,B=B+Math.imul(it,Yt)|0,D=D+Math.imul(qe,Zt)|0,A=A+Math.imul(qe,Xt)|0,A=A+Math.imul(me,Zt)|0,B=B+Math.imul(me,Xt)|0;var Hg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Hg>>>26)|0,Hg&=67108863,D=Math.imul(W,H),A=Math.imul(W,Q),A=A+Math.imul(J,H)|0,B=Math.imul(J,Q),D=D+Math.imul(yt,Se)|0,A=A+Math.imul(yt,$e)|0,A=A+Math.imul(lt,Se)|0,B=B+Math.imul(lt,$e)|0,D=D+Math.imul(ce,Me)|0,A=A+Math.imul(ce,Ge)|0,A=A+Math.imul(ct,Me)|0,B=B+Math.imul(ct,Ge)|0,D=D+Math.imul(ge,Qt)|0,A=A+Math.imul(ge,Lt)|0,A=A+Math.imul(Je,Qt)|0,B=B+Math.imul(Je,Lt)|0,D=D+Math.imul(de,Ht)|0,A=A+Math.imul(de,Yt)|0,A=A+Math.imul(Ne,Ht)|0,B=B+Math.imul(Ne,Yt)|0,D=D+Math.imul(ht,Zt)|0,A=A+Math.imul(ht,Xt)|0,A=A+Math.imul(it,Zt)|0,B=B+Math.imul(it,Xt)|0;var Yg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Yg>>>26)|0,Yg&=67108863,D=Math.imul(W,Se),A=Math.imul(W,$e),A=A+Math.imul(J,Se)|0,B=Math.imul(J,$e),D=D+Math.imul(yt,Me)|0,A=A+Math.imul(yt,Ge)|0,A=A+Math.imul(lt,Me)|0,B=B+Math.imul(lt,Ge)|0,D=D+Math.imul(ce,Qt)|0,A=A+Math.imul(ce,Lt)|0,A=A+Math.imul(ct,Qt)|0,B=B+Math.imul(ct,Lt)|0,D=D+Math.imul(ge,Ht)|0,A=A+Math.imul(ge,Yt)|0,A=A+Math.imul(Je,Ht)|0,B=B+Math.imul(Je,Yt)|0,D=D+Math.imul(de,Zt)|0,A=A+Math.imul(de,Xt)|0,A=A+Math.imul(Ne,Zt)|0,B=B+Math.imul(Ne,Xt)|0;var jg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(jg>>>26)|0,jg&=67108863,D=Math.imul(W,Me),A=Math.imul(W,Ge),A=A+Math.imul(J,Me)|0,B=Math.imul(J,Ge),D=D+Math.imul(yt,Qt)|0,A=A+Math.imul(yt,Lt)|0,A=A+Math.imul(lt,Qt)|0,B=B+Math.imul(lt,Lt)|0,D=D+Math.imul(ce,Ht)|0,A=A+Math.imul(ce,Yt)|0,A=A+Math.imul(ct,Ht)|0,B=B+Math.imul(ct,Yt)|0,D=D+Math.imul(ge,Zt)|0,A=A+Math.imul(ge,Xt)|0,A=A+Math.imul(Je,Zt)|0,B=B+Math.imul(Je,Xt)|0;var Wg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Wg>>>26)|0,Wg&=67108863,D=Math.imul(W,Qt),A=Math.imul(W,Lt),A=A+Math.imul(J,Qt)|0,B=Math.imul(J,Lt),D=D+Math.imul(yt,Ht)|0,A=A+Math.imul(yt,Yt)|0,A=A+Math.imul(lt,Ht)|0,B=B+Math.imul(lt,Yt)|0,D=D+Math.imul(ce,Zt)|0,A=A+Math.imul(ce,Xt)|0,A=A+Math.imul(ct,Zt)|0,B=B+Math.imul(ct,Xt)|0;var zg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(zg>>>26)|0,zg&=67108863,D=Math.imul(W,Ht),A=Math.imul(W,Yt),A=A+Math.imul(J,Ht)|0,B=Math.imul(J,Yt),D=D+Math.imul(yt,Zt)|0,A=A+Math.imul(yt,Xt)|0,A=A+Math.imul(lt,Zt)|0,B=B+Math.imul(lt,Xt)|0;var Jg=(M+D|0)+((A&8191)<<13)|0;M=(B+(A>>>13)|0)+(Jg>>>26)|0,Jg&=67108863,D=Math.imul(W,Zt),A=Math.imul(W,Xt),A=A+Math.imul(J,Zt)|0,B=Math.imul(J,Xt);var qg=(M+D|0)+((A&8191)<<13)|0;return M=(B+(A>>>13)|0)+(qg>>>26)|0,qg&=67108863,T[0]=ps,T[1]=Oe,T[2]=mt,T[3]=pr,T[4]=Jr,T[5]=Ef,T[6]=Ug,T[7]=Qg,T[8]=_g,T[9]=Lg,T[10]=Vg,T[11]=Gg,T[12]=Hg,T[13]=Yg,T[14]=jg,T[15]=Wg,T[16]=zg,T[17]=Jg,T[18]=qg,M!==0&&(T[19]=M,I.length++),I};Math.imul||(k=U);function G(R,h,x){x.negative=h.negative^R.negative,x.length=R.length+h.length;for(var I=0,N=0,S=0;S<x.length-1;S++){var T=N;N=0;for(var M=I&67108863,D=Math.min(S,h.length-1),A=Math.max(0,S-R.length+1);A<=D;A++){var B=S-A,oe=R.words[B]|0,w=h.words[A]|0,j=oe*w,X=j&67108863;T=T+(j/67108864|0)|0,X=X+M|0,M=X&67108863,T=T+(X>>>26)|0,N+=T>>>26,T&=67108863}x.words[S]=M,I=T,T=N}return I!==0?x.words[S]=I:x.length--,x._strip()}function q(R,h,x){return G(R,h,x)}i.prototype.mulTo=function(h,x){var I,N=this.length+h.length;return this.length===10&&h.length===10?I=k(this,h,x):N<63?I=U(this,h,x):N<1024?I=G(this,h,x):I=q(this,h,x),I};function z(R,h){this.x=R,this.y=h}z.prototype.makeRBT=function(h){for(var x=new Array(h),I=i.prototype._countBits(h)-1,N=0;N<h;N++)x[N]=this.revBin(N,I,h);return x},z.prototype.revBin=function(h,x,I){if(h===0||h===I-1)return h;for(var N=0,S=0;S<x;S++)N|=(h&1)<<x-S-1,h>>=1;return N},z.prototype.permute=function(h,x,I,N,S,T){for(var M=0;M<T;M++)N[M]=x[h[M]],S[M]=I[h[M]]},z.prototype.transform=function(h,x,I,N,S,T){this.permute(T,h,x,I,N,S);for(var M=1;M<S;M<<=1)for(var D=M<<1,A=Math.cos(2*Math.PI/D),B=Math.sin(2*Math.PI/D),oe=0;oe<S;oe+=D)for(var w=A,j=B,X=0;X<M;X++){var ae=I[oe+X],be=N[oe+X],Ye=I[oe+X+M],He=N[oe+X+M],Re=w*Ye-j*He;He=w*He+j*Ye,Ye=Re,I[oe+X]=ae+Ye,N[oe+X]=be+He,I[oe+X+M]=ae-Ye,N[oe+X+M]=be-He,X!==D&&(Re=A*w-B*j,j=A*j+B*w,w=Re)}},z.prototype.guessLen13b=function(h,x){var I=Math.max(x,h)|1,N=I&1,S=0;for(I=I/2|0;I;I=I>>>1)S++;return 1<<S+1+N},z.prototype.conjugate=function(h,x,I){if(!(I<=1))for(var N=0;N<I/2;N++){var S=h[N];h[N]=h[I-N-1],h[I-N-1]=S,S=x[N],x[N]=-x[I-N-1],x[I-N-1]=-S}},z.prototype.normalize13b=function(h,x){for(var I=0,N=0;N<x/2;N++){var S=Math.round(h[2*N+1]/x)*8192+Math.round(h[2*N]/x)+I;h[N]=S&67108863,S<67108864?I=0:I=S/67108864|0}return h},z.prototype.convert13b=function(h,x,I,N){for(var S=0,T=0;T<x;T++)S=S+(h[T]|0),I[2*T]=S&8191,S=S>>>13,I[2*T+1]=S&8191,S=S>>>13;for(T=2*x;T<N;++T)I[T]=0;r(S===0),r((S&-8192)===0)},z.prototype.stub=function(h){for(var x=new Array(h),I=0;I<h;I++)x[I]=0;return x},z.prototype.mulp=function(h,x,I){var N=2*this.guessLen13b(h.length,x.length),S=this.makeRBT(N),T=this.stub(N),M=new Array(N),D=new Array(N),A=new Array(N),B=new Array(N),oe=new Array(N),w=new Array(N),j=I.words;j.length=N,this.convert13b(h.words,h.length,M,N),this.convert13b(x.words,x.length,B,N),this.transform(M,T,D,A,N,S),this.transform(B,T,oe,w,N,S);for(var X=0;X<N;X++){var ae=D[X]*oe[X]-A[X]*w[X];A[X]=D[X]*w[X]+A[X]*oe[X],D[X]=ae}return this.conjugate(D,A,N),this.transform(D,A,j,T,N,S),this.conjugate(j,T,N),this.normalize13b(j,N),I.negative=h.negative^x.negative,I.length=h.length+x.length,I._strip()},i.prototype.mul=function(h){var x=new i(null);return x.words=new Array(this.length+h.length),this.mulTo(h,x)},i.prototype.mulf=function(h){var x=new i(null);return x.words=new Array(this.length+h.length),q(this,h,x)},i.prototype.imul=function(h){return this.clone().mulTo(h,this)},i.prototype.imuln=function(h){var x=h<0;x&&(h=-h),r(typeof h=="number"),r(h<67108864);for(var I=0,N=0;N<this.length;N++){var S=(this.words[N]|0)*h,T=(S&67108863)+(I&67108863);I>>=26,I+=S/67108864|0,I+=T>>>26,this.words[N]=T&67108863}return I!==0&&(this.words[N]=I,this.length++),x?this.ineg():this},i.prototype.muln=function(h){return this.clone().imuln(h)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(h){var x=v(h);if(x.length===0)return new i(1);for(var I=this,N=0;N<x.length&&x[N]===0;N++,I=I.sqr());if(++N<x.length)for(var S=I.sqr();N<x.length;N++,S=S.sqr())x[N]!==0&&(I=I.mul(S));return I},i.prototype.iushln=function(h){r(typeof h=="number"&&h>=0);var x=h%26,I=(h-x)/26,N=67108863>>>26-x<<26-x,S;if(x!==0){var T=0;for(S=0;S<this.length;S++){var M=this.words[S]&N,D=(this.words[S]|0)-M<<x;this.words[S]=D|T,T=M>>>26-x}T&&(this.words[S]=T,this.length++)}if(I!==0){for(S=this.length-1;S>=0;S--)this.words[S+I]=this.words[S];for(S=0;S<I;S++)this.words[S]=0;this.length+=I}return this._strip()},i.prototype.ishln=function(h){return r(this.negative===0),this.iushln(h)},i.prototype.iushrn=function(h,x,I){r(typeof h=="number"&&h>=0);var N;x?N=(x-x%26)/26:N=0;var S=h%26,T=Math.min((h-S)/26,this.length),M=67108863^67108863>>>S<<S,D=I;if(N-=T,N=Math.max(0,N),D){for(var A=0;A<T;A++)D.words[A]=this.words[A];D.length=T}if(T!==0)if(this.length>T)for(this.length-=T,A=0;A<this.length;A++)this.words[A]=this.words[A+T];else this.words[0]=0,this.length=1;var B=0;for(A=this.length-1;A>=0&&(B!==0||A>=N);A--){var oe=this.words[A]|0;this.words[A]=B<<26-S|oe>>>S,B=oe&M}return D&&B!==0&&(D.words[D.length++]=B),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(h,x,I){return r(this.negative===0),this.iushrn(h,x,I)},i.prototype.shln=function(h){return this.clone().ishln(h)},i.prototype.ushln=function(h){return this.clone().iushln(h)},i.prototype.shrn=function(h){return this.clone().ishrn(h)},i.prototype.ushrn=function(h){return this.clone().iushrn(h)},i.prototype.testn=function(h){r(typeof h=="number"&&h>=0);var x=h%26,I=(h-x)/26,N=1<<x;if(this.length<=I)return!1;var S=this.words[I];return!!(S&N)},i.prototype.imaskn=function(h){r(typeof h=="number"&&h>=0);var x=h%26,I=(h-x)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=I)return this;if(x!==0&&I++,this.length=Math.min(I,this.length),x!==0){var N=67108863^67108863>>>x<<x;this.words[this.length-1]&=N}return this._strip()},i.prototype.maskn=function(h){return this.clone().imaskn(h)},i.prototype.iaddn=function(h){return r(typeof h=="number"),r(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<=h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},i.prototype._iaddn=function(h){this.words[0]+=h;for(var x=0;x<this.length&&this.words[x]>=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},i.prototype.isubn=function(h){if(r(typeof h=="number"),r(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x<this.length&&this.words[x]<0;x++)this.words[x]+=67108864,this.words[x+1]-=1;return this._strip()},i.prototype.addn