UNPKG

dcp-client

Version:

Core libraries for accessing DCP network

2 lines 16.4 MB
/*! For license information please see pyodide-core.js.LICENSE.txt */ (()=>{var __webpack_modules__={9809:(A,I,g)=>{"use strict";const B=I;B.bignum=g(4590),B.define=g(2500).define,B.base=g(1979),B.constants=g(6826),B.decoders=g(8307),B.encoders=g(6579)},2500:(A,I,g)=>{"use strict";const B=g(6579),Q=g(8307),C=g(5717);function E(A,I){this.name=A,this.body=I,this.decoders={},this.encoders={}}I.define=function(A,I){return new E(A,I)},E.prototype._createNamed=function(A){const I=this.name;function g(A){this._initNamed(A,I)}return C(g,A),g.prototype._initNamed=function(I,g){A.call(this,I,g)},new g(this)},E.prototype._getDecoder=function(A){return A=A||"der",this.decoders.hasOwnProperty(A)||(this.decoders[A]=this._createNamed(Q[A])),this.decoders[A]},E.prototype.decode=function(A,I,g){return this._getDecoder(I).decode(A,g)},E.prototype._getEncoder=function(A){return A=A||"der",this.encoders.hasOwnProperty(A)||(this.encoders[A]=this._createNamed(B[A])),this.encoders[A]},E.prototype.encode=function(A,I,g){return this._getEncoder(I).encode(A,g)}},6625:(A,I,g)=>{"use strict";const B=g(5717),Q=g(8465).b,C=g(2399).Buffer;function E(A,I){Q.call(this,I),C.isBuffer(A)?(this.base=A,this.offset=0,this.length=A.length):this.error("Input not Buffer")}function i(A,I){if(Array.isArray(A))this.length=0,this.value=A.map((function(A){return i.isEncoderBuffer(A)||(A=new i(A,I)),this.length+=A.length,A}),this);else if("number"==typeof A){if(!(0<=A&&A<=255))return I.error("non-byte EncoderBuffer value");this.value=A,this.length=1}else if("string"==typeof A)this.value=A,this.length=C.byteLength(A);else{if(!C.isBuffer(A))return I.error("Unsupported type: "+typeof A);this.value=A,this.length=A.length}}B(E,Q),I.C=E,E.isDecoderBuffer=function(A){return A instanceof E||"object"==typeof A&&C.isBuffer(A.base)&&"DecoderBuffer"===A.constructor.name&&"number"==typeof A.offset&&"number"==typeof A.length&&"function"==typeof A.save&&"function"==typeof A.restore&&"function"==typeof A.isEmpty&&"function"==typeof A.readUInt8&&"function"==typeof A.skip&&"function"==typeof A.raw},E.prototype.save=function(){return{offset:this.offset,reporter:Q.prototype.save.call(this)}},E.prototype.restore=function(A){const I=new E(this.base);return I.offset=A.offset,I.length=this.offset,this.offset=A.offset,Q.prototype.restore.call(this,A.reporter),I},E.prototype.isEmpty=function(){return this.offset===this.length},E.prototype.readUInt8=function(A){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(A||"DecoderBuffer overrun")},E.prototype.skip=function(A,I){if(!(this.offset+A<=this.length))return this.error(I||"DecoderBuffer overrun");const g=new E(this.base);return g._reporterState=this._reporterState,g.offset=this.offset,g.length=this.offset+A,this.offset+=A,g},E.prototype.raw=function(A){return this.base.slice(A?A.offset:this.offset,this.length)},I.R=i,i.isEncoderBuffer=function(A){return A instanceof i||"object"==typeof A&&"EncoderBuffer"===A.constructor.name&&"number"==typeof A.length&&"function"==typeof A.join},i.prototype.join=function(A,I){return A||(A=C.alloc(this.length)),I||(I=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(g){g.join(A,I),I+=g.length})):("number"==typeof this.value?A[I]=this.value:"string"==typeof this.value?A.write(this.value,I):C.isBuffer(this.value)&&this.value.copy(A,I),I+=this.length)),A}},1979:(A,I,g)=>{"use strict";const B=I;B.Reporter=g(8465).b,B.DecoderBuffer=g(6625).C,B.EncoderBuffer=g(6625).R,B.Node=g(1949)},1949:(A,I,g)=>{"use strict";const B=g(8465).b,Q=g(6625).R,C=g(6625).C,E=g(9746),i=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],o=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(i);function D(A,I,g){const B={};this._baseState=B,B.name=g,B.enc=A,B.parent=I||null,B.children=null,B.tag=null,B.args=null,B.reverseArgs=null,B.choice=null,B.optional=!1,B.any=!1,B.obj=!1,B.use=null,B.useDecoder=null,B.key=null,B.default=null,B.explicit=null,B.implicit=null,B.contains=null,B.parent||(B.children=[],this._wrap())}A.exports=D;const w=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];D.prototype.clone=function(){const A=this._baseState,I={};w.forEach((function(g){I[g]=A[g]}));const g=new this.constructor(I.parent);return g._baseState=I,g},D.prototype._wrap=function(){const A=this._baseState;o.forEach((function(I){this[I]=function(){const g=new this.constructor(this);return A.children.push(g),g[I].apply(g,arguments)}}),this)},D.prototype._init=function(A){const I=this._baseState;E(null===I.parent),A.call(this),I.children=I.children.filter((function(A){return A._baseState.parent===this}),this),E.equal(I.children.length,1,"Root node can have only one child")},D.prototype._useArgs=function(A){const I=this._baseState,g=A.filter((function(A){return A instanceof this.constructor}),this);A=A.filter((function(A){return!(A instanceof this.constructor)}),this),0!==g.length&&(E(null===I.children),I.children=g,g.forEach((function(A){A._baseState.parent=this}),this)),0!==A.length&&(E(null===I.args),I.args=A,I.reverseArgs=A.map((function(A){if("object"!=typeof A||A.constructor!==Object)return A;const I={};return Object.keys(A).forEach((function(g){g==(0|g)&&(g|=0);const B=A[g];I[B]=g})),I})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(A){D.prototype[A]=function(){const I=this._baseState;throw new Error(A+" not implemented for encoding: "+I.enc)}})),i.forEach((function(A){D.prototype[A]=function(){const I=this._baseState,g=Array.prototype.slice.call(arguments);return E(null===I.tag),I.tag=A,this._useArgs(g),this}})),D.prototype.use=function(A){E(A);const I=this._baseState;return E(null===I.use),I.use=A,this},D.prototype.optional=function(){return this._baseState.optional=!0,this},D.prototype.def=function(A){const I=this._baseState;return E(null===I.default),I.default=A,I.optional=!0,this},D.prototype.explicit=function(A){const I=this._baseState;return E(null===I.explicit&&null===I.implicit),I.explicit=A,this},D.prototype.implicit=function(A){const I=this._baseState;return E(null===I.explicit&&null===I.implicit),I.implicit=A,this},D.prototype.obj=function(){const A=this._baseState,I=Array.prototype.slice.call(arguments);return A.obj=!0,0!==I.length&&this._useArgs(I),this},D.prototype.key=function(A){const I=this._baseState;return E(null===I.key),I.key=A,this},D.prototype.any=function(){return this._baseState.any=!0,this},D.prototype.choice=function(A){const I=this._baseState;return E(null===I.choice),I.choice=A,this._useArgs(Object.keys(A).map((function(I){return A[I]}))),this},D.prototype.contains=function(A){const I=this._baseState;return E(null===I.use),I.contains=A,this},D.prototype._decode=function(A,I){const g=this._baseState;if(null===g.parent)return A.wrapResult(g.children[0]._decode(A,I));let B,Q=g.default,E=!0,i=null;if(null!==g.key&&(i=A.enterKey(g.key)),g.optional){let B=null;if(null!==g.explicit?B=g.explicit:null!==g.implicit?B=g.implicit:null!==g.tag&&(B=g.tag),null!==B||g.any){if(E=this._peekTag(A,B,g.any),A.isError(E))return E}else{const B=A.save();try{null===g.choice?this._decodeGeneric(g.tag,A,I):this._decodeChoice(A,I),E=!0}catch(A){E=!1}A.restore(B)}}if(g.obj&&E&&(B=A.enterObject()),E){if(null!==g.explicit){const I=this._decodeTag(A,g.explicit);if(A.isError(I))return I;A=I}const B=A.offset;if(null===g.use&&null===g.choice){let I;g.any&&(I=A.save());const B=this._decodeTag(A,null!==g.implicit?g.implicit:g.tag,g.any);if(A.isError(B))return B;g.any?Q=A.raw(I):A=B}if(I&&I.track&&null!==g.tag&&I.track(A.path(),B,A.length,"tagged"),I&&I.track&&null!==g.tag&&I.track(A.path(),A.offset,A.length,"content"),g.any||(Q=null===g.choice?this._decodeGeneric(g.tag,A,I):this._decodeChoice(A,I)),A.isError(Q))return Q;if(g.any||null!==g.choice||null===g.children||g.children.forEach((function(g){g._decode(A,I)})),g.contains&&("octstr"===g.tag||"bitstr"===g.tag)){const B=new C(Q);Q=this._getUse(g.contains,A._reporterState.obj)._decode(B,I)}}return g.obj&&E&&(Q=A.leaveObject(B)),null===g.key||null===Q&&!0!==E?null!==i&&A.exitKey(i):A.leaveKey(i,g.key,Q),Q},D.prototype._decodeGeneric=function(A,I,g){const B=this._baseState;return"seq"===A||"set"===A?null:"seqof"===A||"setof"===A?this._decodeList(I,A,B.args[0],g):/str$/.test(A)?this._decodeStr(I,A,g):"objid"===A&&B.args?this._decodeObjid(I,B.args[0],B.args[1],g):"objid"===A?this._decodeObjid(I,null,null,g):"gentime"===A||"utctime"===A?this._decodeTime(I,A,g):"null_"===A?this._decodeNull(I,g):"bool"===A?this._decodeBool(I,g):"objDesc"===A?this._decodeStr(I,A,g):"int"===A||"enum"===A?this._decodeInt(I,B.args&&B.args[0],g):null!==B.use?this._getUse(B.use,I._reporterState.obj)._decode(I,g):I.error("unknown tag: "+A)},D.prototype._getUse=function(A,I){const g=this._baseState;return g.useDecoder=this._use(A,I),E(null===g.useDecoder._baseState.parent),g.useDecoder=g.useDecoder._baseState.children[0],g.implicit!==g.useDecoder._baseState.implicit&&(g.useDecoder=g.useDecoder.clone(),g.useDecoder._baseState.implicit=g.implicit),g.useDecoder},D.prototype._decodeChoice=function(A,I){const g=this._baseState;let B=null,Q=!1;return Object.keys(g.choice).some((function(C){const E=A.save(),i=g.choice[C];try{const g=i._decode(A,I);if(A.isError(g))return!1;B={type:C,value:g},Q=!0}catch(I){return A.restore(E),!1}return!0}),this),Q?B:A.error("Choice not matched")},D.prototype._createEncoderBuffer=function(A){return new Q(A,this.reporter)},D.prototype._encode=function(A,I,g){const B=this._baseState;if(null!==B.default&&B.default===A)return;const Q=this._encodeValue(A,I,g);return void 0===Q||this._skipDefault(Q,I,g)?void 0:Q},D.prototype._encodeValue=function(A,I,g){const Q=this._baseState;if(null===Q.parent)return Q.children[0]._encode(A,I||new B);let C=null;if(this.reporter=I,Q.optional&&void 0===A){if(null===Q.default)return;A=Q.default}let E=null,i=!1;if(Q.any)C=this._createEncoderBuffer(A);else if(Q.choice)C=this._encodeChoice(A,I);else if(Q.contains)E=this._getUse(Q.contains,g)._encode(A,I),i=!0;else if(Q.children)E=Q.children.map((function(g){if("null_"===g._baseState.tag)return g._encode(null,I,A);if(null===g._baseState.key)return I.error("Child should have a key");const B=I.enterKey(g._baseState.key);if("object"!=typeof A)return I.error("Child expected, but input is not object");const Q=g._encode(A[g._baseState.key],I,A);return I.leaveKey(B),Q}),this).filter((function(A){return A})),E=this._createEncoderBuffer(E);else if("seqof"===Q.tag||"setof"===Q.tag){if(!Q.args||1!==Q.args.length)return I.error("Too many args for : "+Q.tag);if(!Array.isArray(A))return I.error("seqof/setof, but data is not Array");const g=this.clone();g._baseState.implicit=null,E=this._createEncoderBuffer(A.map((function(g){const B=this._baseState;return this._getUse(B.args[0],A)._encode(g,I)}),g))}else null!==Q.use?C=this._getUse(Q.use,g)._encode(A,I):(E=this._encodePrimitive(Q.tag,A),i=!0);if(!Q.any&&null===Q.choice){const A=null!==Q.implicit?Q.implicit:Q.tag,g=null===Q.implicit?"universal":"context";null===A?null===Q.use&&I.error("Tag could be omitted only for .use()"):null===Q.use&&(C=this._encodeComposite(A,i,g,E))}return null!==Q.explicit&&(C=this._encodeComposite(Q.explicit,!1,"context",C)),C},D.prototype._encodeChoice=function(A,I){const g=this._baseState,B=g.choice[A.type];return B||E(!1,A.type+" not found in "+JSON.stringify(Object.keys(g.choice))),B._encode(A.value,I)},D.prototype._encodePrimitive=function(A,I){const g=this._baseState;if(/str$/.test(A))return this._encodeStr(I,A);if("objid"===A&&g.args)return this._encodeObjid(I,g.reverseArgs[0],g.args[1]);if("objid"===A)return this._encodeObjid(I,null,null);if("gentime"===A||"utctime"===A)return this._encodeTime(I,A);if("null_"===A)return this._encodeNull();if("int"===A||"enum"===A)return this._encodeInt(I,g.args&&g.reverseArgs[0]);if("bool"===A)return this._encodeBool(I);if("objDesc"===A)return this._encodeStr(I,A);throw new Error("Unsupported tag: "+A)},D.prototype._isNumstr=function(A){return/^[0-9 ]*$/.test(A)},D.prototype._isPrintstr=function(A){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(A)}},8465:(A,I,g)=>{"use strict";const B=g(5717);function Q(A){this._reporterState={obj:null,path:[],options:A||{},errors:[]}}function C(A,I){this.path=A,this.rethrow(I)}I.b=Q,Q.prototype.isError=function(A){return A instanceof C},Q.prototype.save=function(){const A=this._reporterState;return{obj:A.obj,pathLen:A.path.length}},Q.prototype.restore=function(A){const I=this._reporterState;I.obj=A.obj,I.path=I.path.slice(0,A.pathLen)},Q.prototype.enterKey=function(A){return this._reporterState.path.push(A)},Q.prototype.exitKey=function(A){const I=this._reporterState;I.path=I.path.slice(0,A-1)},Q.prototype.leaveKey=function(A,I,g){const B=this._reporterState;this.exitKey(A),null!==B.obj&&(B.obj[I]=g)},Q.prototype.path=function(){return this._reporterState.path.join("/")},Q.prototype.enterObject=function(){const A=this._reporterState,I=A.obj;return A.obj={},I},Q.prototype.leaveObject=function(A){const I=this._reporterState,g=I.obj;return I.obj=A,g},Q.prototype.error=function(A){let I;const g=this._reporterState,B=A instanceof C;if(I=B?A:new C(g.path.map((function(A){return"["+JSON.stringify(A)+"]"})).join(""),A.message||A,A.stack),!g.options.partial)throw I;return B||g.errors.push(I),I},Q.prototype.wrapResult=function(A){const I=this._reporterState;return I.options.partial?{result:this.isError(A)?null:A,errors:I.errors}:A},B(C,Error),C.prototype.rethrow=function(A){if(this.message=A+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,C),!this.stack)try{throw new Error(this.message)}catch(A){this.stack=A.stack}return this}},160:(A,I)=>{"use strict";function g(A){const I={};return Object.keys(A).forEach((function(g){(0|g)==g&&(g|=0);const B=A[g];I[B]=g})),I}I.tagClass={0:"universal",1:"application",2:"context",3:"private"},I.tagClassByName=g(I.tagClass),I.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},I.tagByName=g(I.tag)},6826:(A,I,g)=>{"use strict";const B=I;B._reverse=function(A){const I={};return Object.keys(A).forEach((function(g){(0|g)==g&&(g|=0);const B=A[g];I[B]=g})),I},B.der=g(160)},1671:(A,I,g)=>{"use strict";const B=g(5717),Q=g(4590),C=g(6625).C,E=g(1949),i=g(160);function o(A){this.enc="der",this.name=A.name,this.entity=A,this.tree=new D,this.tree._init(A.body)}function D(A){E.call(this,"der",A)}function w(A,I){let g=A.readUInt8(I);if(A.isError(g))return g;const B=i.tagClass[g>>6],Q=0==(32&g);if(31==(31&g)){let B=g;for(g=0;128==(128&B);){if(B=A.readUInt8(I),A.isError(B))return B;g<<=7,g|=127&B}}else g&=31;return{cls:B,primitive:Q,tag:g,tagStr:i.tag[g]}}function a(A,I,g){let B=A.readUInt8(g);if(A.isError(B))return B;if(!I&&128===B)return null;if(0==(128&B))return B;const Q=127&B;if(Q>4)return A.error("length octect is too long");B=0;for(let I=0;I<Q;I++){B<<=8;const I=A.readUInt8(g);if(A.isError(I))return I;B|=I}return B}A.exports=o,o.prototype.decode=function(A,I){return C.isDecoderBuffer(A)||(A=new C(A,I)),this.tree._decode(A,I)},B(D,E),D.prototype._peekTag=function(A,I,g){if(A.isEmpty())return!1;const B=A.save(),Q=w(A,'Failed to peek tag: "'+I+'"');return A.isError(Q)?Q:(A.restore(B),Q.tag===I||Q.tagStr===I||Q.tagStr+"of"===I||g)},D.prototype._decodeTag=function(A,I,g){const B=w(A,'Failed to decode tag of "'+I+'"');if(A.isError(B))return B;let Q=a(A,B.primitive,'Failed to get length of "'+I+'"');if(A.isError(Q))return Q;if(!g&&B.tag!==I&&B.tagStr!==I&&B.tagStr+"of"!==I)return A.error('Failed to match tag: "'+I+'"');if(B.primitive||null!==Q)return A.skip(Q,'Failed to match body of: "'+I+'"');const C=A.save(),E=this._skipUntilEnd(A,'Failed to skip indefinite length body: "'+this.tag+'"');return A.isError(E)?E:(Q=A.offset-C.offset,A.restore(C),A.skip(Q,'Failed to match body of: "'+I+'"'))},D.prototype._skipUntilEnd=function(A,I){for(;;){const g=w(A,I);if(A.isError(g))return g;const B=a(A,g.primitive,I);if(A.isError(B))return B;let Q;if(Q=g.primitive||null!==B?A.skip(B):this._skipUntilEnd(A,I),A.isError(Q))return Q;if("end"===g.tagStr)break}},D.prototype._decodeList=function(A,I,g,B){const Q=[];for(;!A.isEmpty();){const I=this._peekTag(A,"end");if(A.isError(I))return I;const C=g.decode(A,"der",B);if(A.isError(C)&&I)break;Q.push(C)}return Q},D.prototype._decodeStr=function(A,I){if("bitstr"===I){const I=A.readUInt8();return A.isError(I)?I:{unused:I,data:A.raw()}}if("bmpstr"===I){const I=A.raw();if(I.length%2==1)return A.error("Decoding of string type: bmpstr length mismatch");let g="";for(let A=0;A<I.length/2;A++)g+=String.fromCharCode(I.readUInt16BE(2*A));return g}if("numstr"===I){const I=A.raw().toString("ascii");return this._isNumstr(I)?I:A.error("Decoding of string type: numstr unsupported characters")}if("octstr"===I)return A.raw();if("objDesc"===I)return A.raw();if("printstr"===I){const I=A.raw().toString("ascii");return this._isPrintstr(I)?I:A.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(I)?A.raw().toString():A.error("Decoding of string type: "+I+" unsupported")},D.prototype._decodeObjid=function(A,I,g){let B;const Q=[];let C=0,E=0;for(;!A.isEmpty();)E=A.readUInt8(),C<<=7,C|=127&E,0==(128&E)&&(Q.push(C),C=0);128&E&&Q.push(C);const i=Q[0]/40|0,o=Q[0]%40;if(B=g?Q:[i,o].concat(Q.slice(1)),I){let A=I[B.join(" ")];void 0===A&&(A=I[B.join(".")]),void 0!==A&&(B=A)}return B},D.prototype._decodeTime=function(A,I){const g=A.raw().toString();let B,Q,C,E,i,o;if("gentime"===I)B=0|g.slice(0,4),Q=0|g.slice(4,6),C=0|g.slice(6,8),E=0|g.slice(8,10),i=0|g.slice(10,12),o=0|g.slice(12,14);else{if("utctime"!==I)return A.error("Decoding "+I+" time is not supported yet");B=0|g.slice(0,2),Q=0|g.slice(2,4),C=0|g.slice(4,6),E=0|g.slice(6,8),i=0|g.slice(8,10),o=0|g.slice(10,12),B=B<70?2e3+B:1900+B}return Date.UTC(B,Q-1,C,E,i,o,0)},D.prototype._decodeNull=function(){return null},D.prototype._decodeBool=function(A){const I=A.readUInt8();return A.isError(I)?I:0!==I},D.prototype._decodeInt=function(A,I){const g=A.raw();let B=new Q(g);return I&&(B=I[B.toString(10)]||B),B},D.prototype._use=function(A,I){return"function"==typeof A&&(A=A(I)),A._getDecoder("der").tree}},8307:(A,I,g)=>{"use strict";const B=I;B.der=g(1671),B.pem=g(9631)},9631:(A,I,g)=>{"use strict";const B=g(5717),Q=g(2399).Buffer,C=g(1671);function E(A){C.call(this,A),this.enc="pem"}B(E,C),A.exports=E,E.prototype.decode=function(A,I){const g=A.toString().split(/[\r\n]+/g),B=I.label.toUpperCase(),E=/^-----(BEGIN|END) ([^-]+)-----$/;let i=-1,o=-1;for(let A=0;A<g.length;A++){const I=g[A].match(E);if(null!==I&&I[2]===B){if(-1!==i){if("END"!==I[1])break;o=A;break}if("BEGIN"!==I[1])break;i=A}}if(-1===i||-1===o)throw new Error("PEM section not found for: "+B);const D=g.slice(i+1,o).join("");D.replace(/[^a-z0-9+/=]+/gi,"");const w=Q.from(D,"base64");return C.prototype.decode.call(this,w,I)}},6984:(A,I,g)=>{"use strict";const B=g(5717),Q=g(2399).Buffer,C=g(1949),E=g(160);function i(A){this.enc="der",this.name=A.name,this.entity=A,this.tree=new o,this.tree._init(A.body)}function o(A){C.call(this,"der",A)}function D(A){return A<10?"0"+A:A}A.exports=i,i.prototype.encode=function(A,I){return this.tree._encode(A,I).join()},B(o,C),o.prototype._encodeComposite=function(A,I,g,B){const C=function(A,I,g,B){let Q;if("seqof"===A?A="seq":"setof"===A&&(A="set"),E.tagByName.hasOwnProperty(A))Q=E.tagByName[A];else{if("number"!=typeof A||(0|A)!==A)return B.error("Unknown tag: "+A);Q=A}return Q>=31?B.error("Multi-octet tag encoding unsupported"):(I||(Q|=32),Q|=E.tagClassByName[g||"universal"]<<6,Q)}(A,I,g,this.reporter);if(B.length<128){const A=Q.alloc(2);return A[0]=C,A[1]=B.length,this._createEncoderBuffer([A,B])}let i=1;for(let A=B.length;A>=256;A>>=8)i++;const o=Q.alloc(2+i);o[0]=C,o[1]=128|i;for(let A=1+i,I=B.length;I>0;A--,I>>=8)o[A]=255&I;return this._createEncoderBuffer([o,B])},o.prototype._encodeStr=function(A,I){if("bitstr"===I)return this._createEncoderBuffer([0|A.unused,A.data]);if("bmpstr"===I){const I=Q.alloc(2*A.length);for(let g=0;g<A.length;g++)I.writeUInt16BE(A.charCodeAt(g),2*g);return this._createEncoderBuffer(I)}return"numstr"===I?this._isNumstr(A)?this._createEncoderBuffer(A):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===I?this._isPrintstr(A)?this._createEncoderBuffer(A):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(I)||"objDesc"===I?this._createEncoderBuffer(A):this.reporter.error("Encoding of string type: "+I+" unsupported")},o.prototype._encodeObjid=function(A,I,g){if("string"==typeof A){if(!I)return this.reporter.error("string objid given, but no values map found");if(!I.hasOwnProperty(A))return this.reporter.error("objid not found in values map");A=I[A].split(/[\s.]+/g);for(let I=0;I<A.length;I++)A[I]|=0}else if(Array.isArray(A)){A=A.slice();for(let I=0;I<A.length;I++)A[I]|=0}if(!Array.isArray(A))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(A));if(!g){if(A[1]>=40)return this.reporter.error("Second objid identifier OOB");A.splice(0,2,40*A[0]+A[1])}let B=0;for(let I=0;I<A.length;I++){let g=A[I];for(B++;g>=128;g>>=7)B++}const C=Q.alloc(B);let E=C.length-1;for(let I=A.length-1;I>=0;I--){let g=A[I];for(C[E--]=127&g;(g>>=7)>0;)C[E--]=128|127&g}return this._createEncoderBuffer(C)},o.prototype._encodeTime=function(A,I){let g;const B=new Date(A);return"gentime"===I?g=[D(B.getUTCFullYear()),D(B.getUTCMonth()+1),D(B.getUTCDate()),D(B.getUTCHours()),D(B.getUTCMinutes()),D(B.getUTCSeconds()),"Z"].join(""):"utctime"===I?g=[D(B.getUTCFullYear()%100),D(B.getUTCMonth()+1),D(B.getUTCDate()),D(B.getUTCHours()),D(B.getUTCMinutes()),D(B.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+I+" time is not supported yet"),this._encodeStr(g,"octstr")},o.prototype._encodeNull=function(){return this._createEncoderBuffer("")},o.prototype._encodeInt=function(A,I){if("string"==typeof A){if(!I)return this.reporter.error("String int or enum given, but no values map");if(!I.hasOwnProperty(A))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(A));A=I[A]}if("number"!=typeof A&&!Q.isBuffer(A)){const I=A.toArray();!A.sign&&128&I[0]&&I.unshift(0),A=Q.from(I)}if(Q.isBuffer(A)){let I=A.length;0===A.length&&I++;const g=Q.alloc(I);return A.copy(g),0===A.length&&(g[0]=0),this._createEncoderBuffer(g)}if(A<128)return this._createEncoderBuffer(A);if(A<256)return this._createEncoderBuffer([0,A]);let g=1;for(let I=A;I>=256;I>>=8)g++;const B=new Array(g);for(let I=B.length-1;I>=0;I--)B[I]=255&A,A>>=8;return 128&B[0]&&B.unshift(0),this._createEncoderBuffer(Q.from(B))},o.prototype._encodeBool=function(A){return this._createEncoderBuffer(A?255:0)},o.prototype._use=function(A,I){return"function"==typeof A&&(A=A(I)),A._getEncoder("der").tree},o.prototype._skipDefault=function(A,I,g){const B=this._baseState;let Q;if(null===B.default)return!1;const C=A.join();if(void 0===B.defaultBuffer&&(B.defaultBuffer=this._encodeValue(B.default,I,g).join()),C.length!==B.defaultBuffer.length)return!1;for(Q=0;Q<C.length;Q++)if(C[Q]!==B.defaultBuffer[Q])return!1;return!0}},6579:(A,I,g)=>{"use strict";const B=I;B.der=g(6984),B.pem=g(2883)},2883:(A,I,g)=>{"use strict";const B=g(5717),Q=g(6984);function C(A){Q.call(this,A),this.enc="pem"}B(C,Q),A.exports=C,C.prototype.encode=function(A,I){const g=Q.prototype.encode.call(this,A).toString("base64"),B=["-----BEGIN "+I.label+"-----"];for(let A=0;A<g.length;A+=64)B.push(g.slice(A,A+64));return B.push("-----END "+I.label+"-----"),B.join("\n")}},4590:function(A,I,g){!function(A,I){"use strict";function B(A,I){if(!A)throw new Error(I||"Assertion failed")}function Q(A,I){A.super_=I;var g=function(){};g.prototype=I.prototype,A.prototype=new g,A.prototype.constructor=A}function C(A,I,g){if(C.isBN(A))return A;this.negative=0,this.words=null,this.length=0,this.red=null,null!==A&&("le"!==I&&"be"!==I||(g=I,I=10),this._init(A||0,I||10,g||"be"))}var E;"object"==typeof A?A.exports=C:I.BN=C,C.BN=C,C.wordSize=26;try{E="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:g(950).Buffer}catch(A){}function i(A,I){var g=A.charCodeAt(I);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function o(A,I,g){var B=i(A,g);return g-1>=I&&(B|=i(A,g-1)<<4),B}function D(A,I,g,B){for(var Q=0,C=Math.min(A.length,g),E=I;E<C;E++){var i=A.charCodeAt(E)-48;Q*=B,Q+=i>=49?i-49+10:i>=17?i-17+10:i}return Q}C.isBN=function(A){return A instanceof C||null!==A&&"object"==typeof A&&A.constructor.wordSize===C.wordSize&&Array.isArray(A.words)},C.max=function(A,I){return A.cmp(I)>0?A:I},C.min=function(A,I){return A.cmp(I)<0?A:I},C.prototype._init=function(A,I,g){if("number"==typeof A)return this._initNumber(A,I,g);if("object"==typeof A)return this._initArray(A,I,g);"hex"===I&&(I=16),B(I===(0|I)&&I>=2&&I<=36);var Q=0;"-"===(A=A.toString().replace(/\s+/g,""))[0]&&(Q++,this.negative=1),Q<A.length&&(16===I?this._parseHex(A,Q,g):(this._parseBase(A,I,Q),"le"===g&&this._initArray(this.toArray(),I,g)))},C.prototype._initNumber=function(A,I,g){A<0&&(this.negative=1,A=-A),A<67108864?(this.words=[67108863&A],this.length=1):A<4503599627370496?(this.words=[67108863&A,A/67108864&67108863],this.length=2):(B(A<9007199254740992),this.words=[67108863&A,A/67108864&67108863,1],this.length=3),"le"===g&&this._initArray(this.toArray(),I,g)},C.prototype._initArray=function(A,I,g){if(B("number"==typeof A.length),A.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(A.length/3),this.words=new Array(this.length);for(var Q=0;Q<this.length;Q++)this.words[Q]=0;var C,E,i=0;if("be"===g)for(Q=A.length-1,C=0;Q>=0;Q-=3)E=A[Q]|A[Q-1]<<8|A[Q-2]<<16,this.words[C]|=E<<i&67108863,this.words[C+1]=E>>>26-i&67108863,(i+=24)>=26&&(i-=26,C++);else if("le"===g)for(Q=0,C=0;Q<A.length;Q+=3)E=A[Q]|A[Q+1]<<8|A[Q+2]<<16,this.words[C]|=E<<i&67108863,this.words[C+1]=E>>>26-i&67108863,(i+=24)>=26&&(i-=26,C++);return this.strip()},C.prototype._parseHex=function(A,I,g){this.length=Math.ceil((A.length-I)/6),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var Q,C=0,E=0;if("be"===g)for(B=A.length-1;B>=I;B-=2)Q=o(A,I,B)<<C,this.words[E]|=67108863&Q,C>=18?(C-=18,E+=1,this.words[E]|=Q>>>26):C+=8;else for(B=(A.length-I)%2==0?I+1:I;B<A.length;B+=2)Q=o(A,I,B)<<C,this.words[E]|=67108863&Q,C>=18?(C-=18,E+=1,this.words[E]|=Q>>>26):C+=8;this.strip()},C.prototype._parseBase=function(A,I,g){this.words=[0],this.length=1;for(var B=0,Q=1;Q<=67108863;Q*=I)B++;B--,Q=Q/I|0;for(var C=A.length-g,E=C%B,i=Math.min(C,C-E)+g,o=0,w=g;w<i;w+=B)o=D(A,w,w+B,I),this.imuln(Q),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o);if(0!==E){var a=1;for(o=D(A,w,A.length,I),w=0;w<E;w++)a*=I;this.imuln(a),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o)}this.strip()},C.prototype.copy=function(A){A.words=new Array(this.length);for(var I=0;I<this.length;I++)A.words[I]=this.words[I];A.length=this.length,A.negative=this.negative,A.red=this.red},C.prototype.clone=function(){var A=new C(null);return this.copy(A),A},C.prototype._expand=function(A){for(;this.length<A;)this.words[this.length++]=0;return this},C.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},C.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},C.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],a=[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],G=[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];function F(A,I,g){g.negative=I.negative^A.negative;var B=A.length+I.length|0;g.length=B,B=B-1|0;var Q=0|A.words[0],C=0|I.words[0],E=Q*C,i=67108863&E,o=E/67108864|0;g.words[0]=i;for(var D=1;D<B;D++){for(var w=o>>>26,a=67108863&o,G=Math.min(D,I.length-1),F=Math.max(0,D-A.length+1);F<=G;F++){var N=D-F|0;w+=(E=(Q=0|A.words[N])*(C=0|I.words[F])+a)/67108864|0,a=67108863&E}g.words[D]=0|a,o=0|w}return 0!==o?g.words[D]=0|o:g.length--,g.strip()}C.prototype.toString=function(A,I){var g;if(I=0|I||1,16===(A=A||10)||"hex"===A){g="";for(var Q=0,C=0,E=0;E<this.length;E++){var i=this.words[E],o=(16777215&(i<<Q|C)).toString(16);g=0!=(C=i>>>24-Q&16777215)||E!==this.length-1?w[6-o.length]+o+g:o+g,(Q+=2)>=26&&(Q-=26,E--)}for(0!==C&&(g=C.toString(16)+g);g.length%I!=0;)g="0"+g;return 0!==this.negative&&(g="-"+g),g}if(A===(0|A)&&A>=2&&A<=36){var D=a[A],F=G[A];g="";var N=this.clone();for(N.negative=0;!N.isZero();){var M=N.modn(F).toString(A);g=(N=N.idivn(F)).isZero()?M+g:w[D-M.length]+M+g}for(this.isZero()&&(g="0"+g);g.length%I!=0;)g="0"+g;return 0!==this.negative&&(g="-"+g),g}B(!1,"Base should be between 2 and 36")},C.prototype.toNumber=function(){var A=this.words[0];return 2===this.length?A+=67108864*this.words[1]:3===this.length&&1===this.words[2]?A+=4503599627370496+67108864*this.words[1]:this.length>2&&B(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-A:A},C.prototype.toJSON=function(){return this.toString(16)},C.prototype.toBuffer=function(A,I){return B(void 0!==E),this.toArrayLike(E,A,I)},C.prototype.toArray=function(A,I){return this.toArrayLike(Array,A,I)},C.prototype.toArrayLike=function(A,I,g){var Q=this.byteLength(),C=g||Math.max(1,Q);B(Q<=C,"byte array longer than desired length"),B(C>0,"Requested array length <= 0"),this.strip();var E,i,o="le"===I,D=new A(C),w=this.clone();if(o){for(i=0;!w.isZero();i++)E=w.andln(255),w.iushrn(8),D[i]=E;for(;i<C;i++)D[i]=0}else{for(i=0;i<C-Q;i++)D[i]=0;for(i=0;!w.isZero();i++)E=w.andln(255),w.iushrn(8),D[C-i-1]=E}return D},Math.clz32?C.prototype._countBits=function(A){return 32-Math.clz32(A)}:C.prototype._countBits=function(A){var I=A,g=0;return I>=4096&&(g+=13,I>>>=13),I>=64&&(g+=7,I>>>=7),I>=8&&(g+=4,I>>>=4),I>=2&&(g+=2,I>>>=2),g+I},C.prototype._zeroBits=function(A){if(0===A)return 26;var I=A,g=0;return 0==(8191&I)&&(g+=13,I>>>=13),0==(127&I)&&(g+=7,I>>>=7),0==(15&I)&&(g+=4,I>>>=4),0==(3&I)&&(g+=2,I>>>=2),0==(1&I)&&g++,g},C.prototype.bitLength=function(){var A=this.words[this.length-1],I=this._countBits(A);return 26*(this.length-1)+I},C.prototype.zeroBits=function(){if(this.isZero())return 0;for(var A=0,I=0;I<this.length;I++){var g=this._zeroBits(this.words[I]);if(A+=g,26!==g)break}return A},C.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},C.prototype.toTwos=function(A){return 0!==this.negative?this.abs().inotn(A).iaddn(1):this.clone()},C.prototype.fromTwos=function(A){return this.testn(A-1)?this.notn(A).iaddn(1).ineg():this.clone()},C.prototype.isNeg=function(){return 0!==this.negative},C.prototype.neg=function(){return this.clone().ineg()},C.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},C.prototype.iuor=function(A){for(;this.length<A.length;)this.words[this.length++]=0;for(var I=0;I<A.length;I++)this.words[I]=this.words[I]|A.words[I];return this.strip()},C.prototype.ior=function(A){return B(0==(this.negative|A.negative)),this.iuor(A)},C.prototype.or=function(A){return this.length>A.length?this.clone().ior(A):A.clone().ior(this)},C.prototype.uor=function(A){return this.length>A.length?this.clone().iuor(A):A.clone().iuor(this)},C.prototype.iuand=function(A){var I;I=this.length>A.length?A:this;for(var g=0;g<I.length;g++)this.words[g]=this.words[g]&A.words[g];return this.length=I.length,this.strip()},C.prototype.iand=function(A){return B(0==(this.negative|A.negative)),this.iuand(A)},C.prototype.and=function(A){return this.length>A.length?this.clone().iand(A):A.clone().iand(this)},C.prototype.uand=function(A){return this.length>A.length?this.clone().iuand(A):A.clone().iuand(this)},C.prototype.iuxor=function(A){var I,g;this.length>A.length?(I=this,g=A):(I=A,g=this);for(var B=0;B<g.length;B++)this.words[B]=I.words[B]^g.words[B];if(this!==I)for(;B<I.length;B++)this.words[B]=I.words[B];return this.length=I.length,this.strip()},C.prototype.ixor=function(A){return B(0==(this.negative|A.negative)),this.iuxor(A)},C.prototype.xor=function(A){return this.length>A.length?this.clone().ixor(A):A.clone().ixor(this)},C.prototype.uxor=function(A){return this.length>A.length?this.clone().iuxor(A):A.clone().iuxor(this)},C.prototype.inotn=function(A){B("number"==typeof A&&A>=0);var I=0|Math.ceil(A/26),g=A%26;this._expand(I),g>0&&I--;for(var Q=0;Q<I;Q++)this.words[Q]=67108863&~this.words[Q];return g>0&&(this.words[Q]=~this.words[Q]&67108863>>26-g),this.strip()},C.prototype.notn=function(A){return this.clone().inotn(A)},C.prototype.setn=function(A,I){B("number"==typeof A&&A>=0);var g=A/26|0,Q=A%26;return this._expand(g+1),this.words[g]=I?this.words[g]|1<<Q:this.words[g]&~(1<<Q),this.strip()},C.prototype.iadd=function(A){var I,g,B;if(0!==this.negative&&0===A.negative)return this.negative=0,I=this.isub(A),this.negative^=1,this._normSign();if(0===this.negative&&0!==A.negative)return A.negative=0,I=this.isub(A),A.negative=1,I._normSign();this.length>A.length?(g=this,B=A):(g=A,B=this);for(var Q=0,C=0;C<B.length;C++)I=(0|g.words[C])+(0|B.words[C])+Q,this.words[C]=67108863&I,Q=I>>>26;for(;0!==Q&&C<g.length;C++)I=(0|g.words[C])+Q,this.words[C]=67108863&I,Q=I>>>26;if(this.length=g.length,0!==Q)this.words[this.length]=Q,this.length++;else if(g!==this)for(;C<g.length;C++)this.words[C]=g.words[C];return this},C.prototype.add=function(A){var I;return 0!==A.negative&&0===this.negative?(A.negative=0,I=this.sub(A),A.negative^=1,I):0===A.negative&&0!==this.negative?(this.negative=0,I=A.sub(this),this.negative=1,I):this.length>A.length?this.clone().iadd(A):A.clone().iadd(this)},C.prototype.isub=function(A){if(0!==A.negative){A.negative=0;var I=this.iadd(A);return A.negative=1,I._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(A),this.negative=1,this._normSign();var g,B,Q=this.cmp(A);if(0===Q)return this.negative=0,this.length=1,this.words[0]=0,this;Q>0?(g=this,B=A):(g=A,B=this);for(var C=0,E=0;E<B.length;E++)C=(I=(0|g.words[E])-(0|B.words[E])+C)>>26,this.words[E]=67108863&I;for(;0!==C&&E<g.length;E++)C=(I=(0|g.words[E])+C)>>26,this.words[E]=67108863&I;if(0===C&&E<g.length&&g!==this)for(;E<g.length;E++)this.words[E]=g.words[E];return this.length=Math.max(this.length,E),g!==this&&(this.negative=1),this.strip()},C.prototype.sub=function(A){return this.clone().isub(A)};var N=function(A,I,g){var B,Q,C,E=A.words,i=I.words,o=g.words,D=0,w=0|E[0],a=8191&w,G=w>>>13,F=0|E[1],N=8191&F,M=F>>>13,s=0|E[2],R=8191&s,c=s>>>13,l=0|E[3],y=8191&l,h=l>>>13,Y=0|E[4],U=8191&Y,J=Y>>>13,e=0|E[5],k=8191&e,t=e>>>13,d=0|E[6],S=8191&d,W=d>>>13,Z=0|E[7],H=8191&Z,r=Z>>>13,V=0|E[8],n=8191&V,j=V>>>13,m=0|E[9],L=8191&m,X=m>>>13,b=0|i[0],K=8191&b,f=b>>>13,p=0|i[1],u=8191&p,q=p>>>13,x=0|i[2],T=8191&x,z=x>>>13,P=0|i[3],v=8191&P,O=P>>>13,_=0|i[4],$=8191&_,AA=_>>>13,IA=0|i[5],gA=8191&IA,BA=IA>>>13,QA=0|i[6],CA=8191&QA,EA=QA>>>13,iA=0|i[7],oA=8191&iA,DA=iA>>>13,wA=0|i[8],aA=8191&wA,GA=wA>>>13,FA=0|i[9],NA=8191&FA,MA=FA>>>13;g.negative=A.negative^I.negative,g.length=19;var sA=(D+(B=Math.imul(a,K))|0)+((8191&(Q=(Q=Math.imul(a,f))+Math.imul(G,K)|0))<<13)|0;D=((C=Math.imul(G,f))+(Q>>>13)|0)+(sA>>>26)|0,sA&=67108863,B=Math.imul(N,K),Q=(Q=Math.imul(N,f))+Math.imul(M,K)|0,C=Math.imul(M,f);var RA=(D+(B=B+Math.imul(a,u)|0)|0)+((8191&(Q=(Q=Q+Math.imul(a,q)|0)+Math.imul(G,u)|0))<<13)|0;D=((C=C+Math.imul(G,q)|0)+(Q>>>13)|0)+(RA>>>26)|0,RA&=67108863,B=Math.imul(R,K),Q=(Q=Math.imul(R,f))+Math.imul(c,K)|0,C=Math.imul(c,f),B=B+Math.imul(N,u)|0,Q=(Q=Q+Math.imul(N,q)|0)+Math.imul(M,u)|0,C=C+Math.imul(M,q)|0;var cA=(D+(B=B+Math.imul(a,T)|0)|0)+((8191&(Q=(Q=Q+Math.imul(a,z)|0)+Math.imul(G,T)|0))<<13)|0;D=((C=C+Math.imul(G,z)|0)+(Q>>>13)|0)+(cA>>>26)|0,cA&=67108863,B=Math.imul(y,K),Q=(Q=Math.imul(y,f))+Math.imul(h,K)|0,C=Math.imul(h,f),B=B+Math.imul(R,u)|0,Q=(Q=Q+Math.imul(R,q)|0)+Math.imul(c,u)|0,C=C+Math.imul(c,q)|0,B=B+Math.imul(N,T)|0,Q=(Q=Q+Math.imul(N,z)|0)+Math.imul(M,T)|0,C=C+Math.imul(M,z)|0;var lA=(D+(B=B+Math.imul(a,v)|0)|0)+((8191&(Q=(Q=Q+Math.imul(a,O)|0)+Math.imul(G,v)|0))<<13)|0;D=((C=C+Math.imul(G,O)|0)+(Q>>>13)|0)+(lA>>>26)|0,lA&=67108863,B=Math.imul(U,K),Q=(Q=Math.imul(U,f))+Math.imul(J,K)|0,C=Math.imul(J,f),B=B+Math.imul(y,u)|0,Q=(Q=Q+Math.imul(y,q)|0)+Math.imul(h,u)|0,C=C+Math.imul(h,q)|0,B=B+Math.imul(R,T)|0,Q=(Q=Q+Math.imul(R,z)|0)+Math.imul(c,T)|0,C=C+Math.imul(c,z)|0,B=B+Math.imul(N,v)|0,Q=(Q=Q+Math.imul(N,O)|0)+Math.imul(M,v)|0,C=C+Math.imul(M,O)|0;var yA=(D+(B=B+Math.imul(a,$)|0)|0)+((8191&(Q=(Q=Q+Math.imul(a,AA)|0)+Math.imul(G,$)|0))<<13)|0;D=((C=C+Math.imul(G,AA)|0)+(Q>>>13)|0)+(yA>>>26)|0,yA&=67108863,B=Math.imul(k,K),Q=(Q=Math.imul(k,f))+Math.imul(t,K)|0,C=Math.imul(t,f),B=B+Math.imul(U,u)|0,Q=(Q=Q+Math.imul(U,q)|0)+Math.imul(J,u)|0,C=C+Math.imul(J,q)|0,B=B+Math.imul(y,T)|0,Q=(Q=Q+Math.imul(y,z)|0)+Math.imul(h,T)|0,C=C+Math.imul(h,z)|0,B=B+Math.imul(R,v)|0,Q=(Q=Q+Math.imul(R,O)|0)+Math.imul(c,v)|0,C=C+Math.imul(c,O)|0,B=B+Math.imul(N,$)|0,Q=(Q=Q+Math.imul(N,AA)|0)+Math.imul(M,$)|0,C=C+Math.imul(M,AA)|0;var hA=(D+(B=B+Math.imul(a,gA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(a,BA)|0)+Math.imul(G,gA)|0))<<13)|0;D=((C=C+Math.imul(G,BA)|0)+(Q>>>13)|0)+(hA>>>26)|0,hA&=67108863,B=Math.imul(S,K),Q=(Q=Math.imul(S,f))+Math.imul(W,K)|0,C=Math.imul(W,f),B=B+Math.imul(k,u)|0,Q=(Q=Q+Math.imul(k,q)|0)+Math.imul(t,u)|0,C=C+Math.imul(t,q)|0,B=B+Math.imul(U,T)|0,Q=(Q=Q+Math.imul(U,z)|0)+Math.imul(J,T)|0,C=C+Math.imul(J,z)|0,B=B+Math.imul(y,v)|0,Q=(Q=Q+Math.imul(y,O)|0)+Math.imul(h,v)|0,C=C+Math.imul(h,O)|0,B=B+Math.imul(R,$)|0,Q=(Q=Q+Math.imul(R,AA)|0)+Math.imul(c,$)|0,C=C+Math.imul(c,AA)|0,B=B+Math.imul(N,gA)|0,Q=(Q=Q+Math.imul(N,BA)|0)+Math.imul(M,gA)|0,C=C+Math.imul(M,BA)|0;var YA=(D+(B=B+Math.imul(a,CA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(a,EA)|0)+Math.imul(G,CA)|0))<<13)|0;D=((C=C+Math.imul(G,EA)|0)+(Q>>>13)|0)+(YA>>>26)|0,YA&=67108863,B=Math.imul(H,K),Q=(Q=Math.imul(H,f))+Math.imul(r,K)|0,C=Math.imul(r,f),B=B+Math.imul(S,u)|0,Q=(Q=Q+Math.imul(S,q)|0)+Math.imul(W,u)|0,C=C+Math.imul(W,q)|0,B=B+Math.imul(k,T)|0,Q=(Q=Q+Math.imul(k,z)|0)+Math.imul(t,T)|0,C=C+Math.imul(t,z)|0,B=B+Math.imul(U,v)|0,Q=(Q=Q+Math.imul(U,O)|0)+Math.imul(J,v)|0,C=C+Math.imul(J,O)|0,B=B+Math.imul(y,$)|0,Q=(Q=Q+Math.imul(y,AA)|0)+Math.imul(h,$)|0,C=C+Math.imul(h,AA)|0,B=B+Math.imul(R,gA)|0,Q=(Q=Q+Math.imul(R,BA)|0)+Math.imul(c,gA)|0,C=C+Math.imul(c,BA)|0,B=B+Math.imul(N,CA)|0,Q=(Q=Q+Math.imul(N,EA)|0)+Math.imul(M,CA)|0,C=C+Math.imul(M,EA)|0;var UA=(D+(B=B+Math.imul(a,oA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(a,DA)|0)+Math.imul(G,oA)|0))<<13)|0;D=((C=C+Math.imul(G,DA)|0)+(Q>>>13)|0)+(UA>>>26)|0,UA&=67108863,B=Math.imul(n,K),Q=(Q=Math.imul(n,f))+Math.imul(j,K)|0,C=Math.imul(j,f),B=B+Math.imul(H,u)|0,Q=(Q=Q+Math.imul(H,q)|0)+Math.imul(r,u)|0,C=C+Math.imul(r,q)|0,B=B+Math.imul(S,T)|0,Q=(Q=Q+Math.imul(S,z)|0)+Math.imul(W,T)|0,C=C+Math.imul(W,z)|0,B=B+Math.imul(k,v)|0,Q=(Q=Q+Math.imul(k,O)|0)+Math.imul(t,v)|0,C=C+Math.imul(t,O)|0,B=B+Math.imul(U,$)|0,Q=(Q=Q+Math.imul(U,AA)|0)+Math.imul(J,$)|0,C=C+Math.imul(J,AA)|0,B=B+Math.imul(y,gA)|0,Q=(Q=Q+Math.imul(y,BA)|0)+Math.imul(h,gA)|0,C=C+Math.imul(h,BA)|0,B=B+Math.imul(R,CA)|0,Q=(Q=Q+Math.imul(R,EA)|0)+Math.imul(c,CA)|0,C=C+Math.imul(c,EA)|0,B=B+Math.imul(N,oA)|0,Q=(Q=Q+Math.imul(N,DA)|0)+Math.imul(M,oA)|0,C=C+Math.imul(M,DA)|0;var JA=(D+(B=B+Math.imul(a,aA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(a,GA)|0)+Math.imul(G,aA)|0))<<13)|0;D=((C=C+Math.imul(G,GA)|0)+(Q>>>13)|0)+(JA>>>26)|0,JA&=67108863,B=Math.imul(L,K),Q=(Q=Math.imul(L,f))+Math.imul(X,K)|0,C=Math.imul(X,f),B=B+Math.imul(n,u)|0,Q=(Q=Q+Math.imul(n,q)|0)+Math.imul(j,u)|0,C=C+Math.imul(j,q)|0,B=B+Math.imul(H,T)|0,Q=(Q=Q+Math.imul(H,z)|0)+Math.imul(r,T)|0,C=C+Math.imul(r,z)|0,B=B+Math.imul(S,v)|0,Q=(Q=Q+Math.imul(S,O)|0)+Math.imul(W,v)|0,C=C+Math.imul(W,O)|0,B=B+Math.imul(k,$)|0,Q=(Q=Q+Math.imul(k,AA)|0)+Math.imul(t,$)|0,C=C+Math.imul(t,AA)|0,B=B+Math.imul(U,gA)|0,Q=(Q=Q+Math.imul(U,BA)|0)+Math.imul(J,gA)|0,C=C+Math.imul(J,BA)|0,B=B+Math.imul(y,CA)|0,Q=(Q=Q+Math.imul(y,EA)|0)+Math.imul(h,CA)|0,C=C+Math.imul(h,EA)|0,B=B+Math.imul(R,oA)|0,Q=(Q=Q+Math.imul(R,DA)|0)+Math.imul(c,oA)|0,C=C+Math.imul(c,DA)|0,B=B+Math.imul(N,aA)|0,Q=(Q=Q+Math.imul(N,GA)|0)+Math.imul(M,aA)|0,C=C+Math.imul(M,GA)|0;var eA=(D+(B=B+Math.imul(a,NA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(a,MA)|0)+Math.imul(G,NA)|0))<<13)|0;D=((C=C+Math.imul(G,MA)|0)+(Q>>>13)|0)+(eA>>>26)|0,eA&=67108863,B=Math.imul(L,u),Q=(Q=Math.imul(L,q))+Math.imul(X,u)|0,C=Math.imul(X,q),B=B+Math.imul(n,T)|0,Q=(Q=Q+Math.imul(n,z)|0)+Math.imul(j,T)|0,C=C+Math.imul(j,z)|0,B=B+Math.imul(H,v)|0,Q=(Q=Q+Math.imul(H,O)|0)+Math.imul(r,v)|0,C=C+Math.imul(r,O)|0,B=B+Math.imul(S,$)|0,Q=(Q=Q+Math.imul(S,AA)|0)+Math.imul(W,$)|0,C=C+Math.imul(W,AA)|0,B=B+Math.imul(k,gA)|0,Q=(Q=Q+Math.imul(k,BA)|0)+Math.imul(t,gA)|0,C=C+Math.imul(t,BA)|0,B=B+Math.imul(U,CA)|0,Q=(Q=Q+Math.imul(U,EA)|0)+Math.imul(J,CA)|0,C=C+Math.imul(J,EA)|0,B=B+Math.imul(y,oA)|0,Q=(Q=Q+Math.imul(y,DA)|0)+Math.imul(h,oA)|0,C=C+Math.imul(h,DA)|0,B=B+Math.imul(R,aA)|0,Q=(Q=Q+Math.imul(R,GA)|0)+Math.imul(c,aA)|0,C=C+Math.imul(c,GA)|0;var kA=(D+(B=B+Math.imul(N,NA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(N,MA)|0)+Math.imul(M,NA)|0))<<13)|0;D=((C=C+Math.imul(M,MA)|0)+(Q>>>13)|0)+(kA>>>26)|0,kA&=67108863,B=Math.imul(L,T),Q=(Q=Math.imul(L,z))+Math.imul(X,T)|0,C=Math.imul(X,z),B=B+Math.imul(n,v)|0,Q=(Q=Q+Math.imul(n,O)|0)+Math.imul(j,v)|0,C=C+Math.imul(j,O)|0,B=B+Math.imul(H,$)|0,Q=(Q=Q+Math.imul(H,AA)|0)+Math.imul(r,$)|0,C=C+Math.imul(r,AA)|0,B=B+Math.imul(S,gA)|0,Q=(Q=Q+Math.imul(S,BA)|0)+Math.imul(W,gA)|0,C=C+Math.imul(W,BA)|0,B=B+Math.imul(k,CA)|0,Q=(Q=Q+Math.imul(k,EA)|0)+Math.imul(t,CA)|0,C=C+Math.imul(t,EA)|0,B=B+Math.imul(U,oA)|0,Q=(Q=Q+Math.imul(U,DA)|0)+Math.imul(J,oA)|0,C=C+Math.imul(J,DA)|0,B=B+Math.imul(y,aA)|0,Q=(Q=Q+Math.imul(y,GA)|0)+Math.imul(h,aA)|0,C=C+Math.imul(h,GA)|0;var tA=(D+(B=B+Math.imul(R,NA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(R,MA)|0)+Math.imul(c,NA)|0))<<13)|0;D=((C=C+Math.imul(c,MA)|0)+(Q>>>13)|0)+(tA>>>26)|0,tA&=67108863,B=Math.imul(L,v),Q=(Q=Math.imul(L,O))+Math.imul(X,v)|0,C=Math.imul(X,O),B=B+Math.imul(n,$)|0,Q=(Q=Q+Math.imul(n,AA)|0)+Math.imul(j,$)|0,C=C+Math.imul(j,AA)|0,B=B+Math.imul(H,gA)|0,Q=(Q=Q+Math.imul(H,BA)|0)+Math.imul(r,gA)|0,C=C+Math.imul(r,BA)|0,B=B+Math.imul(S,CA)|0,Q=(Q=Q+Math.imul(S,EA)|0)+Math.imul(W,CA)|0,C=C+Math.imul(W,EA)|0,B=B+Math.imul(k,oA)|0,Q=(Q=Q+Math.imul(k,DA)|0)+Math.imul(t,oA)|0,C=C+Math.imul(t,DA)|0,B=B+Math.imul(U,aA)|0,Q=(Q=Q+Math.imul(U,GA)|0)+Math.imul(J,aA)|0,C=C+Math.imul(J,GA)|0;var dA=(D+(B=B+Math.imul(y,NA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(y,MA)|0)+Math.imul(h,NA)|0))<<13)|0;D=((C=C+Math.imul(h,MA)|0)+(Q>>>13)|0)+(dA>>>26)|0,dA&=67108863,B=Math.imul(L,$),Q=(Q=Math.imul(L,AA))+Math.imul(X,$)|0,C=Math.imul(X,AA),B=B+Math.imul(n,gA)|0,Q=(Q=Q+Math.imul(n,BA)|0)+Math.imul(j,gA)|0,C=C+Math.imul(j,BA)|0,B=B+Math.imul(H,CA)|0,Q=(Q=Q+Math.imul(H,EA)|0)+Math.imul(r,CA)|0,C=C+Math.imul(r,EA)|0,B=B+Math.imul(S,oA)|0,Q=(Q=Q+Math.imul(S,DA)|0)+Math.imul(W,oA)|0,C=C+Math.imul(W,DA)|0,B=B+Math.imul(k,aA)|0,Q=(Q=Q+Math.imul(k,GA)|0)+Math.imul(t,aA)|0,C=C+Math.imul(t,GA)|0;var SA=(D+(B=B+Math.imul(U,NA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(U,MA)|0)+Math.imul(J,NA)|0))<<13)|0;D=((C=C+Math.imul(J,MA)|0)+(Q>>>13)|0)+(SA>>>26)|0,SA&=67108863,B=Math.imul(L,gA),Q=(Q=Math.imul(L,BA))+Math.imul(X,gA)|0,C=Math.imul(X,BA),B=B+Math.imul(n,CA)|0,Q=(Q=Q+Math.imul(n,EA)|0)+Math.imul(j,CA)|0,C=C+Math.imul(j,EA)|0,B=B+Math.imul(H,oA)|0,Q=(Q=Q+Math.imul(H,DA)|0)+Math.imul(r,oA)|0,C=C+Math.imul(r,DA)|0,B=B+Math.imul(S,aA)|0,Q=(Q=Q+Math.imul(S,GA)|0)+Math.imul(W,aA)|0,C=C+Math.imul(W,GA)|0;var WA=(D+(B=B+Math.imul(k,NA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(k,MA)|0)+Math.imul(t,NA)|0))<<13)|0;D=((C=C+Math.imul(t,MA)|0)+(Q>>>13)|0)+(WA>>>26)|0,WA&=67108863,B=Math.imul(L,CA),Q=(Q=Math.imul(L,EA))+Math.imul(X,CA)|0,C=Math.imul(X,EA),B=B+Math.imul(n,oA)|0,Q=(Q=Q+Math.imul(n,DA)|0)+Math.imul(j,oA)|0,C=C+Math.imul(j,DA)|0,B=B+Math.imul(H,aA)|0,Q=(Q=Q+Math.imul(H,GA)|0)+Math.imul(r,aA)|0,C=C+Math.imul(r,GA)|0;var ZA=(D+(B=B+Math.imul(S,NA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(S,MA)|0)+Math.imul(W,NA)|0))<<13)|0;D=((C=C+Math.imul(W,MA)|0)+(Q>>>13)|0)+(ZA>>>26)|0,ZA&=67108863,B=Math.imul(L,oA),Q=(Q=Math.imul(L,DA))+Math.imul(X,oA)|0,C=Math.imul(X,DA),B=B+Math.imul(n,aA)|0,Q=(Q=Q+Math.imul(n,GA)|0)+Math.imul(j,aA)|0,C=C+Math.imul(j,GA)|0;var HA=(D+(B=B+Math.imul(H,NA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(H,MA)|0)+Math.imul(r,NA)|0))<<13)|0;D=((C=C+Math.imul(r,MA)|0)+(Q>>>13)|0)+(HA>>>26)|0,HA&=67108863,B=Math.imul(L,aA),Q=(Q=Math.imul(L,GA))+Math.imul(X,aA)|0,C=Math.imul(X,GA);var rA=(D+(B=B+Math.imul(n,NA)|0)|0)+((8191&(Q=(Q=Q+Math.imul(n,MA)|0)+Math.imul(j,NA)|0))<<13)|0;D=((C=C+Math.imul(j,MA)|0)+(Q>>>13)|0)+(rA>>>26)|0,rA&=67108863;var VA=(D+(B=Math.imul(L,NA))|0)+((8191&(Q=(Q=Math.imul(L,MA))+Math.imul(X,NA)|0))<<13)|0;return D=((C=Math.imul(X,MA))+(Q>>>13)|0)+(VA>>>26)|0,VA&=67108863,o[0]=sA,o[1]=RA,o[2]=cA,o[3]=lA,o[4]=yA,o[5]=hA,o[6]=YA,o[7]=UA,o[8]=JA,o[9]=eA,o[10]=kA,o[11]=tA,o[12]=dA,o[13]=SA,o[14]=WA,o[15]=ZA,o[16]=HA,o[17]=rA,o[18]=VA,0!==D&&(o[19]=D,g.length++),g};function M(A,I,g){return(new s).mulp(A,I,g)}function s(A,I){this.x=A,this.y=I}Math.imul||(N=F),C.prototype.mulTo=function(A,I){var g,B=this.length+A.length;return g=10===this.length&&10===A.length?N(this,A,I):B<63?F(this,A,I):B<1024?function(A,I,g){g.negative=I.negative^A.negative,g.length=A.length+I.length;for(var B=0,Q=0,C=0;C<g.length-1;C++){var E=Q;Q=0;for(var i=67108863&B,o=Math.min(C,I.length-1),D=Math.max(0,C-A.length+1);D<=o;D++){var w=C-D,a=(0|A.words[w])*(0|I.words[D]),G=67108863&a;i=67108863&(G=G+i|0),Q+=(E=(E=E+(a/67108864|0)|0)+(G>>>26)|0)>>>26,E&=67108863}g.words[C]=i,B=E,E=Q}return 0!==B?g.words[C]=B:g.length--,g.strip()}(this,A,I):M(this,A,I),g},s.prototype.makeRBT=function(A){for(var I=new Array(A),g=C.prototype._countBits(A)-1,B=0;B<A;B++)I[B]=this.revBin(B,g,A);return I},s.prototype.revBin=function(A,I,g){if(0===A||A===g-1)return A;for(var B=0,Q=0;Q<I;Q++)B|=(1&A)<<I-Q-1,A>>=1;return B},s.prototype.permute=function(A,I,g,B,Q,C){for(var E=0;E<C;E++)B[E]=I[A[E]],Q[E]=g[A[E]]},s.prototype.transform=function(A,I,g,B,Q,C){this.permute(C,A,I,g,B,Q);for(var E=1;E<Q;E<<=1)for(var i=E<<1,o=Math.cos(2*Math.PI/i),D=Math.sin(2*Math.PI/i),w=0;w<Q;w+=i)for(var a=o,G=D,F=0;F<E;F++){var N=g[w+F],M=B[w+F],s=g[w+F+E],R=B[w+F+E],c=a*s-G*R;R=a*R+G*s,s=c,g[w+F]=N+s,B[w+F]=M+R,g[w+F+E]=N-s,B[w+F+E]=M-R,F!==i&&(c=o*a-D*G,G=o*G+D*a,a=c)}},s.prototype.guessLen13b=function(A,I){var g=1|Math.max(I,A),B=1&g,Q=0;for(g=g/2|0;g;g>>>=1)Q++;return 1<<Q+1+B},s.prototype.conjugate=function(A,I,g){if(!(g<=1))for(var B=0;B<g/2;B++){var Q=A[B];A[B]=A[g-B-1],A[g-B-1]=Q,Q=I[B],I[B]=-I[g-B-1],I[g-B-1]=-Q}},s.prototype.normalize13b=function(A,I){for(var g=0,B=0;B<I/2;B++){var Q=8192*Math.round(A[2*B+1]/I)+Math.round(A[2*B]/I)+g;A[B]=67108863&Q,g=Q<67108864?0:Q/67108864|0}return A},s.prototype.convert13b=function(A,I,g,Q){for(var C=0,E=0;E<I;E++)C+=0|A[E],g[2*E]=8191&C,C>>>=13,g[2*E+1]=8191&C,C>>>=13;for(E=2*I;E<Q;++E)g[E]=0;B(0===C),B(0==(-8192&C))},s.prototype.stub=function(A){for(var I=new Array(A),g=0;g<A;g++)I[g]=0;return I},s.prototype.mulp=function(A,I,g){var B=2*this.guessLen13b(A.length,I.length),Q=this.makeRBT(B),C=this.stub(B),E=new Array(B),i=new Array(B),o=new Array(B),D=new Array(B),w=new Array(B),a=new Array(B),G=g.words;G.length=B,this.convert13b(A.words,A.length,E,B),this.convert13b(I.words,I.length,D,B),this.transform(E,C,i,o,B,Q),this.transform(D,C,w,a,B,Q);for(var F=0;F<B;F++){var N=i[F]*w[F]-o[F]*a[F];o[F]=i[F]*a[F]+o[F]*w[F],i[F]=N}return this.conjugate(i,o,B),this.transform(i,o,G,C,B,Q),this.conjugate(G,C,B),this.normalize13b(G,B),g.negative=A.negative^I.negative,g.length=A.length+I.length,g.strip()},C.prototype.mul=function(A){var I=new C(null);return I.words=new Array(this.length+A.length),this.mulTo(A,I)},C.prototype.mulf=function(A){var I=new C(null);return I.words=new Array(this.length+A.length),M(this,A,I)},C.prototype.imul=function(A){return this.clone().mulTo(A,this)},C.prototype.imuln=function(A){B("number"==typeof A),B(A<67108864);for(var I=0,g=0;g<this.length;g++){var Q=(0|this.words[g])*A,C=(67108863&Q)+(67108863&I);I>>=26,I+=Q/67108864|0,I+=C>>>26,this.words[g]=67108863&C}return 0!==I&&(this.words[g]=I,this.length++),this},C.prototype.muln=function(A){return this.clone().imuln(A)},C.prototype.sqr=function(){return this.mul(this)},C.prototype.isqr=function(){return this.imul(this.clone())},C.prototype.pow=function(A){var I=function(A){for(var I=new Array(A.bitLength()),g=0;g<I.length;g++){var B=g/26|0,Q=g%26;I[g]=(A.words[B]&1<<Q)>>>Q}return I}(A);if(0===I.length)return new C(1);for(var g=this,B=0;B<I.length&&0===I[B]