diff --git "a/_next/static/chunks/959-f8cc52b8c534cbb1.js" "b/_next/static/chunks/959-f8cc52b8c534cbb1.js" new file mode 100644--- /dev/null +++ "b/_next/static/chunks/959-f8cc52b8c534cbb1.js" @@ -0,0 +1,25 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[959],{26850:function(e,t,r){"use strict";r(44331);let n=e=>{let t;let r=[],n=new Promise((e,n)=>{t={resolve:t=>{r.forEach(e=>{e(t)}),e(t)},reject:n}});return Object.assign(n,{cancel:()=>{t.cancelled=!0,r.splice(0,r.length)},channel:e,prethen:e=>{r.push(e)}}),{order:t,promise:n}},i={},o=function(e=0){let t,r=0,s=!1,a=[],c=[],u=n=>{for(;n.push{for(let n=t.push+r;n{for(;e.shift{for(let e=0;e{let e={push:0,shift:0};u(e),l(e),s&&h(e),a.splice(0,e.push),c.splice(0,e.shift),f()},d=Object.freeze(Object.assign(Object.create(i),{concat:(...e)=>{let t=o();return(async()=>{await d.forEach(t.push);for(let r=0;r{for(;;){let r=await d.shift();if(void 0===r)return!0;if(!e.call(t,r))return!1}},filter:(e,t)=>{let r=o();return(async()=>{await d.forEach(async n=>{await e.call(t,n)&&await r.push(n)}),await r.close()})(),r},forEach:async(e,t)=>{for(;;){let r=await d.shift();if(void 0===r)break;await e.call(t,r)}},join:async e=>(await d.values()).join(e),map:(e,t)=>{let r=o();return(async()=>{await d.forEach(n=>r.push(e.call(t,n))),await r.close()})(),r},readOnly:()=>d,reduce:async(e,...t)=>{let r=t[0],n=t.length>0;if(await d.forEach(t=>{n?r=e(r,t):(r=t,n=!0)}),n)return r;throw TypeError("No values in channel and initialValue wasn't provided.")},shift:function(){let{order:e,promise:t}=n(this);return c.push(e),setImmediate(p),t},slice:(e,t=1/0)=>{let r=o();return(async()=>{for(let t=0;t{for(;;){let r=await d.shift();if(void 0===r)return!1;if(e.call(t,r))return!0}},toString:()=>`Channel(${e})`,value:()=>t,values:async()=>{let e=[];return await d.forEach(t=>{e.push(t)}),e}})),y=Object.freeze(Object.assign(Object.create(i),{close:()=>new Promise((e,t)=>{s?t(Error("Can't close an already-closed channel.")):(s=!0,p(),setImmediate(e))}),length:e,push:function(e){let{order:t,promise:r}=n(this);return t.value=e,Promise.resolve(e).catch(()=>{}),s?t.reject(Error("Can't push to closed channel.")):void 0===e?t.reject(TypeError("Can't push 'undefined' to channel, use close instead.")):arguments.length>1?t.reject(Error("Can't push more than one value at a time.")):(a.push(t),setImmediate(p)),r},writeOnly:()=>y}));return Object.freeze(Object.assign(Object.create(i),d,y))},s=(e,t)=>{t.on("readable",async()=>{for(;;){let r=t.read();if(null===r)break;await e.push(r)}}),t.once("end",e.close)};o.from=(e,t,r)=>{let n=o();return(async()=>{try{for(let t of e)await n.push(t);await n.close()}catch(t){try{for(;;){let t=e();if(void 0===t){await n.close();break}await n.push(t)}}catch(t){s(n,e)}}})(),(t?n.map(t,r):n).readOnly()},o.of=(...e)=>o.from(e),o.isChannel=e=>null!=e&&Object.getPrototypeOf(e)===i,o.select=e=>{if(!Array.isArray(e))throw TypeError("Channel.select: Argument must be an array.");return Object.assign(new Promise((t,r)=>{e.forEach(async n=>{try{n.prethen(()=>{e.forEach(e=>{e!==n&&e.cancel()})});try{await n}catch(e){r(e)}t(n.channel)}catch(e){r(TypeError("Channel.select accepts only promises returned by push & shift."))}})}),{cancel:()=>e.forEach(e=>e.cancel())})},o.selectValue=e=>{if(!Array.isArray(e))throw TypeError("Channel.select: Argument must be an array.");return Object.assign(new Promise((t,r)=>{e.forEach(async n=>{try{n.prethen(()=>{e.forEach(e=>{e!==n&&e.cancel()})});try{t(await n)}catch(e){r(e)}}catch(e){r(TypeError("Channel.select accepts only promises returned by push & shift."))}})}),{cancel:()=>e.forEach(e=>e.cancel())})};let a=o(),c=Object.keys(a).filter(e=>"function"==typeof a[e]),u={reduce:2,slice:2};c.forEach(e=>{let t=function(...r){let n=u[e]||a[e].length;return r.length>n?r[n][e](...r.slice(0,n)):t.bind(this,...r)};o[e]=t}),e.exports=Object.freeze(o)},77708:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=l(r(86543)),i=l(r(26850)),o=u(r(69456)),s=r(64223),a=u(r(70711));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function l(e){return e&&e.__esModule?e:{default:e}}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class f{constructor(e,t,r,o){h(this,"session",void 0),h(this,"localClientID",void 0),h(this,"remoteClientID",void 0),h(this,"windowSize",void 0),h(this,"sendWindowUpdate",void 0),h(this,"timeSentSeq",void 0),h(this,"resentSeq",void 0),h(this,"sendAckQueue",void 0),h(this,"retransmissionTimeout",void 0),this.session=e,this.localClientID=t,this.remoteClientID=r,this.windowSize=o,this.retransmissionTimeout=e.config.initialRetransmissionTimeout,this.sendWindowUpdate=new i.default(1),this.timeSentSeq=new Map,this.resentSeq=new Map,this.sendAckQueue=new n.default}sendWindowUsed(){return this.timeSentSeq.size}sendAck(e){this.sendAckQueue.push(e)}sendAckQueueLen(){return this.sendAckQueue.size()}receiveAck(e,t){if(this.timeSentSeq.has(e)){if(this.resentSeq.has(e)||this.setWindowSize(this.windowSize+1),t){let t=Date.now()-this.timeSentSeq.get(e);this.retransmissionTimeout+=100*Math.tanh((3*t-this.retransmissionTimeout)/1e3),this.retransmissionTimeout>this.session.config.maxRetransmissionTimeout&&(this.retransmissionTimeout=this.session.config.maxRetransmissionTimeout)}this.timeSentSeq.delete(e),this.resentSeq.delete(e),i.default.select([this.sendWindowUpdate.push(null),a.closedChan.shift()])}}async _waitForSendWindow(e){for(;this.sendWindowUsed()>=this.windowSize;){let t=a.timeoutChan(a._maxWait);switch(await i.default.select([this.sendWindowUpdate.shift(),t.shift(),e.done.shift()])){case this.sendWindowUpdate:break;case t:throw a._errMaxWait;case e.done:throw e.err}}}start(){this._tx().catch(()=>{}),this._sendAck().catch(()=>{}),this._checkTimeout().catch(()=>{})}async _tx(){let e=0;for(;;){if(0===e&&(e=await this.session._getResendSeq()),0===e){try{await this._waitForSendWindow(this.session.context)}catch(e){if(e===a._errMaxWait)continue;throw e}e=await this.session._getSendSeq()}let t=this.session.getDataToSend(e);if(!t){this.timeSentSeq.delete(e),this.resentSeq.delete(e),e=0;continue}try{await this.session.sendWith(this.localClientID,this.remoteClientID,t)}catch(t){if(this.session.isClosed)throw new o.SessionClosedError;switch(console.log(t),this.setWindowSize(this.windowSize/2),this.session.updateConnWindowSize(),await i.default.select([this.session.resendChan.push(e),this.session.context.done.shift()])){case this.session.resendChan:e=0;break;case this.session.context.done:throw this.session.context.err}await a.sleep(1e3);continue}this.timeSentSeq.has(e)||this.timeSentSeq.set(e,Date.now()),this.resentSeq.delete(e),e=0}}async _sendAck(){for(;;){let e=a.timeoutChan(this.session.config.sendAckInterval);switch(await i.default.select([e.shift(),this.session.context.done.shift()])){case e:break;case this.session.context.done:throw this.session.context.err}if(0===this.sendAckQueueLen())continue;let t=[],r=[];for(;this.sendAckQueueLen()>0&&t.length0&&this.sendAckQueue.peek()===a.nextSeq(e,n);)this.sendAckQueue.pop(),n++;t.push(e),r.push(n)}let n=!0;for(let e of r)if(1!=e){n=!1;break}n&&(r=null);try{let e=new s.Packet;e.setAckStartSeqList(t),r&&e.setAckSeqCountList(r),e.setBytesRead(this.session.bytesRead);let n=e.serializeBinary();await this.session.sendWith(this.localClientID,this.remoteClientID,n),this.session.bytesReadSentTime=Date.now()}catch(e){console.log(e),await a.sleep(1e3);continue}}}async _checkTimeout(){for(;;){let e=a.timeoutChan(this.session.config.checkTimeoutInterval);switch(await i.default.select([e.shift(),this.session.context.done.shift()])){case e:break;case this.session.context.done:throw this.session.context.err}let t=Date.now()-this.retransmissionTimeout,r=!1;for(let[e,n]of this.timeSentSeq)if(!this.resentSeq.has(e)&&n0&&(u=new n.default,i.push(u.shift()),this.timeoutTimer=setTimeout(u.close,r)),i.length>0&&n.default.select(i).then(t=>{switch(t){case c:return e.err;case this.cancelChan:return new s;case u:return new a}}).then(e=>{this.err=e,this.done.close(),this.cancel(),clearTimeout(this.timeoutTimer)})}async cancel(){try{this.cancelChan&&await this.cancelChan.close()}catch(e){}}static background(){return new c(null,!1,0)}static withCancel(e){return new c(e,!0,0)}static withTimeout(e,t){return new c(e,!0,t)}}t.default=c},69456:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WriteDeadlineExceededError=t.SessionNotEstablishedError=t.SessionEstablishedError=t.SessionClosedError=t.RecvWindowFullError=t.ReadDeadlineExceededError=t.NotHandshakeError=t.InvalidPacketError=t.DialTimeoutError=t.DataSizeTooLargeError=t.ConnNotFoundError=t.BufferSizeTooSmallError=void 0;class r extends Error{constructor(e="session closed",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,r),this.name="SessionClosedError"}}t.SessionClosedError=r;class n extends Error{constructor(e="session is already established",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,n),this.name="SessionEstablishedError"}}t.SessionEstablishedError=n;class i extends Error{constructor(e="session not established yet",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,i),this.name="SessionNotEstablishedError"}}t.SessionNotEstablishedError=i;class o extends Error{constructor(e="read deadline exceeded",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,o),this.name="ReadDeadlineExceededError"}}t.ReadDeadlineExceededError=o;class s extends Error{constructor(e="write deadline exceeded",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,s),this.name="WriteDeadlineExceededError"}}t.WriteDeadlineExceededError=s;class a extends Error{constructor(e="read buffer size is less than data length in non-session mode",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,a),this.name="BufferSizeTooSmallError"}}t.BufferSizeTooSmallError=a;class c extends Error{constructor(e="data size is greater than session mtu in non-session mode",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,c),this.name="DataSizeTooLargeError"}}t.DataSizeTooLargeError=c;class u extends Error{constructor(e="invalid packet",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,u),this.name="InvalidPacketError"}}t.InvalidPacketError=u;class l extends Error{constructor(e="receive window full",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,l),this.name="RecvWindowFullError"}}t.RecvWindowFullError=l;class h extends Error{constructor(e="first packet is not handshake packet",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,h),this.name="NotHandshakeError"}}t.NotHandshakeError=h;class f extends Error{constructor(e="dial timeout",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,f),this.name="DialTimeoutError"}}t.DialTimeoutError=f;class p extends Error{constructor(e="Connection not found",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,p),this.name="ConnNotFoundError"}}t.ConnNotFoundError=p},79499:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"Context",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"Session",{enumerable:!0,get:function(){return o.default}}),t.util=t.errors=t.consts=void 0;var n=h(r(77708)),i=h(r(70944)),o=h(r(35314)),s=l(r(86513));t.consts=s;var a=l(r(69456));t.errors=a;var c=l(r(70711));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function h(e){return e&&e.__esModule?e:{default:e}}t.util=c},64223:function(e,t,r){"use strict";var n=r(24304),i=n,o=Function("return this")();i.exportSymbol("proto.Packet",null,o),proto.Packet=function(e){n.Message.initialize(this,e,0,-1,proto.Packet.repeatedFields_,null)},i.inherits(proto.Packet,n.Message),i.DEBUG&&!COMPILED&&(proto.Packet.displayName="proto.Packet"),proto.Packet.repeatedFields_=[3,4,6],n.Message.GENERATE_TO_OBJECT&&(proto.Packet.prototype.toObject=function(e){return proto.Packet.toObject(e,this)},proto.Packet.toObject=function(e,t){var r={sequenceId:n.Message.getFieldWithDefault(t,1,0),data:t.getData_asB64(),ackStartSeqList:n.Message.getRepeatedField(t,3),ackSeqCountList:n.Message.getRepeatedField(t,4),bytesRead:n.Message.getFieldWithDefault(t,5,0),clientIdsList:n.Message.getRepeatedField(t,6),windowSize:n.Message.getFieldWithDefault(t,7,0),mtu:n.Message.getFieldWithDefault(t,8,0),close:n.Message.getFieldWithDefault(t,9,!1),handshake:n.Message.getFieldWithDefault(t,10,!1)};return e&&(r.$jspbMessageInstance=t),r}),proto.Packet.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.Packet;return proto.Packet.deserializeBinaryFromReader(r,t)},proto.Packet.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readUint32();e.setSequenceId(r);break;case 2:var r=t.readBytes();e.setData(r);break;case 3:var r=t.readPackedUint32();e.setAckStartSeqList(r);break;case 4:var r=t.readPackedUint32();e.setAckSeqCountList(r);break;case 5:var r=t.readUint64();e.setBytesRead(r);break;case 6:var r=t.readString();e.addClientIds(r);break;case 7:var r=t.readUint32();e.setWindowSize(r);break;case 8:var r=t.readUint32();e.setMtu(r);break;case 9:var r=t.readBool();e.setClose(r);break;case 10:var r=t.readBool();e.setHandshake(r);break;default:t.skipField()}return e},proto.Packet.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.Packet.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.Packet.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getSequenceId())&&t.writeUint32(1,r),(r=e.getData_asU8()).length>0&&t.writeBytes(2,r),(r=e.getAckStartSeqList()).length>0&&t.writePackedUint32(3,r),(r=e.getAckSeqCountList()).length>0&&t.writePackedUint32(4,r),0!==(r=e.getBytesRead())&&t.writeUint64(5,r),(r=e.getClientIdsList()).length>0&&t.writeRepeatedString(6,r),0!==(r=e.getWindowSize())&&t.writeUint32(7,r),0!==(r=e.getMtu())&&t.writeUint32(8,r),(r=e.getClose())&&t.writeBool(9,r),(r=e.getHandshake())&&t.writeBool(10,r)},proto.Packet.prototype.getSequenceId=function(){return n.Message.getFieldWithDefault(this,1,0)},proto.Packet.prototype.setSequenceId=function(e){n.Message.setProto3IntField(this,1,e)},proto.Packet.prototype.getData=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.Packet.prototype.getData_asB64=function(){return n.Message.bytesAsB64(this.getData())},proto.Packet.prototype.getData_asU8=function(){return n.Message.bytesAsU8(this.getData())},proto.Packet.prototype.setData=function(e){n.Message.setProto3BytesField(this,2,e)},proto.Packet.prototype.getAckStartSeqList=function(){return n.Message.getRepeatedField(this,3)},proto.Packet.prototype.setAckStartSeqList=function(e){n.Message.setField(this,3,e||[])},proto.Packet.prototype.addAckStartSeq=function(e,t){n.Message.addToRepeatedField(this,3,e,t)},proto.Packet.prototype.clearAckStartSeqList=function(){this.setAckStartSeqList([])},proto.Packet.prototype.getAckSeqCountList=function(){return n.Message.getRepeatedField(this,4)},proto.Packet.prototype.setAckSeqCountList=function(e){n.Message.setField(this,4,e||[])},proto.Packet.prototype.addAckSeqCount=function(e,t){n.Message.addToRepeatedField(this,4,e,t)},proto.Packet.prototype.clearAckSeqCountList=function(){this.setAckSeqCountList([])},proto.Packet.prototype.getBytesRead=function(){return n.Message.getFieldWithDefault(this,5,0)},proto.Packet.prototype.setBytesRead=function(e){n.Message.setProto3IntField(this,5,e)},proto.Packet.prototype.getClientIdsList=function(){return n.Message.getRepeatedField(this,6)},proto.Packet.prototype.setClientIdsList=function(e){n.Message.setField(this,6,e||[])},proto.Packet.prototype.addClientIds=function(e,t){n.Message.addToRepeatedField(this,6,e,t)},proto.Packet.prototype.clearClientIdsList=function(){this.setClientIdsList([])},proto.Packet.prototype.getWindowSize=function(){return n.Message.getFieldWithDefault(this,7,0)},proto.Packet.prototype.setWindowSize=function(e){n.Message.setProto3IntField(this,7,e)},proto.Packet.prototype.getMtu=function(){return n.Message.getFieldWithDefault(this,8,0)},proto.Packet.prototype.setMtu=function(e){n.Message.setProto3IntField(this,8,e)},proto.Packet.prototype.getClose=function(){return n.Message.getFieldWithDefault(this,9,!1)},proto.Packet.prototype.setClose=function(e){n.Message.setProto3BooleanField(this,9,e)},proto.Packet.prototype.getHandshake=function(){return n.Message.getFieldWithDefault(this,10,!1)},proto.Packet.prototype.setHandshake=function(e){n.Message.setProto3BooleanField(this,10,e)},i.object.extend(t,proto)},35314:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=p(r(64569)),i=p(r(26850)),o=p(r(77708)),s=f(r(86513)),a=f(r(70944)),c=f(r(69456)),u=r(64223),l=f(r(70711));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function p(e){return e&&e.__esModule?e:{default:e}}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class y{constructor(e,t,r,n,o,c={}){d(this,"config",void 0),d(this,"localAddr",void 0),d(this,"remoteAddr",void 0),d(this,"localClientIDs",void 0),d(this,"remoteClientIDs",void 0),d(this,"sendWith",void 0),d(this,"sendWindowSize",void 0),d(this,"recvWindowSize",void 0),d(this,"sendMtu",void 0),d(this,"recvMtu",void 0),d(this,"connections",void 0),d(this,"onAccept",void 0),d(this,"sendChan",void 0),d(this,"resendChan",void 0),d(this,"sendWindowUpdate",void 0),d(this,"recvDataUpdate",void 0),d(this,"context",void 0),d(this,"readContext",void 0),d(this,"writeContext",void 0),d(this,"isAccepted",void 0),d(this,"isEstablished",void 0),d(this,"isClosed",void 0),d(this,"sendBuffer",void 0),d(this,"sendWindowStartSeq",void 0),d(this,"sendWindowEndSeq",void 0),d(this,"sendWindowData",void 0),d(this,"recvWindowStartSeq",void 0),d(this,"recvWindowUsed",void 0),d(this,"recvWindowData",void 0),d(this,"bytesWrite",void 0),d(this,"bytesRead",void 0),d(this,"bytesReadSentTime",void 0),d(this,"bytesReadUpdateTime",void 0),d(this,"remoteBytesRead",void 0),d(this,"ReadableStream",void 0),d(this,"_readableStream",void 0),d(this,"WritableStream",void 0),d(this,"_writableStream",void 0),d(this,"sendWindowPacketCount",void 0),this.config=Object.assign({},s.defaultConfig,c),this.localAddr=e,this.remoteAddr=t,this.localClientIDs=r,this.remoteClientIDs=n,this.sendWith=o,this.sendWindowSize=this.config.sessionWindowSize,this.recvWindowSize=this.config.sessionWindowSize,this.sendMtu=this.config.mtu,this.recvMtu=this.config.mtu,this.sendWindowStartSeq=s.minSequenceID,this.sendWindowEndSeq=s.minSequenceID,this.recvWindowStartSeq=s.minSequenceID,this.recvWindowUsed=0,this.bytesWrite=0,this.bytesRead=0,this.bytesReadSentTime=Date.now(),this.bytesReadUpdateTime=Date.now(),this.remoteBytesRead=0,this.onAccept=new i.default(1),this.context=a.default.withCancel(),this.setTimeout(0),this.ReadableStream=null,this._readableStream=null,this.WritableStream=null,this._writableStream=null,this.sendWindowPacketCount=this.sendWindowSize/this.sendMtu}isStream(){return!this.config.nonStream}sendWindowUsed(){return this.bytesWrite>this.remoteBytesRead?this.bytesWrite-this.remoteBytesRead:0}getDataToSend(e){return this.sendWindowData.get(e)}getConnWindowSize(){let e=0;for(let t of this.connections.values())e+=t.windowSize;return e}async _getResendSeq(){let e=await i.default.selectValue([this.resendChan.shift(),this.context.done.shift(),l.closedChan.shift()]);if(void 0===e){if(this.context.err)throw this.context.err;return 0}return e}async _getSendSeq(){let e=await i.default.selectValue([this.resendChan.shift(),this.sendChan.shift(),this.context.done.shift()]);if(void 0===e)throw this.context.err;return e}receiveWith(e,t,r){if(this.isClosed)throw new c.SessionClosedError;let n=u.Packet.deserializeBinary(r);if(n.getClose())return this._handleClosePacket();let o=this.isEstablished;if(!o&&n.getHandshake())return this._handleHandshakePacket(n);if(o&&(n.getAckStartSeqList().length>0||n.getAckSeqCountList().length>0)){if(n.getAckStartSeqList().length>0&&n.getAckSeqCountList().length>0&&n.getAckStartSeqList().length!==n.getAckSeqCountList().length)throw new c.InvalidPacketError("AckStartSeq and AckSeqCount should have the same length if both are non-empty");let r=0;r=n.getAckStartSeqList().length>0?n.getAckStartSeqList().length:n.getAckSeqCountList().length;let i=0,o=0;for(let a=0;a0?n.getAckStartSeqList()[a]:s.minSequenceID,o=n.getAckSeqCountList().length>0?l.nextSeq(i,n.getAckSeqCountList()[a]):l.nextSeq(i,1),l.seqInBetween(this.sendWindowStartSeq,this.sendWindowEndSeq,l.nextSeq(o,-1))){l.seqInBetween(this.sendWindowStartSeq,this.sendWindowEndSeq,i)||(i=this.sendWindowStartSeq);for(let r=i;l.seqInBetween(i,o,r);r=l.nextSeq(r,1)){for(let[n,i]of this.connections)i.receiveAck(r,n===l.connKey(e,t));this.sendWindowData.delete(r)}if(i===this.sendWindowStartSeq)for(;this.sendWindowStartSeq=l.nextSeq(this.sendWindowStartSeq,1),!this.sendWindowData.has(this.sendWindowStartSeq)&&this.sendWindowStartSeq!==this.sendWindowEndSeq;);}this.updateConnWindowSize()}if(o&&n.getBytesRead()>this.remoteBytesRead&&(this.remoteBytesRead=n.getBytesRead(),i.default.select([this.sendWindowUpdate.push(null),l.closedChan.shift()])),o&&n.getSequenceId()>0){if(n.getData().length>this.recvMtu)throw new c.DataSizeTooLargeError;if(l.compareSeq(n.getSequenceId(),this.recvWindowStartSeq)>=0&&!this.recvWindowData.has(n.getSequenceId())){if(this.recvWindowUsed+n.getData().length>this.recvWindowSize)throw new c.RecvWindowFullError;this.recvWindowData.set(n.getSequenceId(),n.getData()),this.recvWindowUsed+=n.getData().length,n.getSequenceId()===this.recvWindowStartSeq&&i.default.select([this.recvDataUpdate.push(null),l.closedChan.shift()])}let r=this.connections.get(l.connKey(e,t));if(r)r.sendAck(n.getSequenceId());else throw new c.ConnNotFoundError("Connection "+l.connKey(e,t)+" not found.")}}_start(){for(let e of(this._startFlush().catch(()=>{}),this._startCheckBytesRead().catch(()=>{}),this.connections.values()))e.start()}async _startFlush(){for(;;){let e=l.timeoutChan(this.config.flushInterval);switch(await i.default.select([e.shift(),this.context.done.shift()])){case e:break;case this.context.done:throw this.context.err}if(this.sendBuffer&&0!==this.sendBuffer.length)try{await this._flushSendBuffer()}catch(e){if(this.context.err)throw e;console.log(e);continue}}}async _startCheckBytesRead(){for(;;){let e=l.timeoutChan(this.config.checkBytesReadInterval);switch(await i.default.select([e.shift(),this.context.done.shift()])){case e:break;case this.context.done:throw this.context.err}if(!(0===this.bytesRead||this.bytesReadSentTime>this.bytesReadUpdateTime||Date.now()-this.bytesReadUpdateTimethis.sendWindowSize;){let t=l.timeoutChan(l._maxWait);switch(await i.default.select([this.sendWindowUpdate.shift(),t.shift(),e.done.shift()])){case this.sendWindowUpdate:case t:break;case e.done:throw e.err}}return this.sendWindowSize-this.sendWindowUsed()}async _flushSendBuffer(){if(!this.sendBuffer||0===this.sendBuffer.length)return;let e=this.sendWindowEndSeq,t=new u.Packet;t.setSequenceId(e),t.setData(this.sendBuffer);let r=t.serializeBinary();switch(this.sendWindowData.set(e,r),this.sendWindowEndSeq=l.nextSeq(e,1),this.sendBuffer=new Uint8Array(0),await i.default.select([this.sendChan.push(e),this.context.done.shift()])){case this.sendChan:break;case this.context.done:throw this.context.err}}async _sendHandshakePacket(e){let t=new u.Packet;t.setHandshake(!0),t.setClientIdsList(this.localClientIDs),t.setWindowSize(this.recvWindowSize),t.setMtu(this.recvMtu);let r=t.serializeBinary(),i=[];if(this.connections&&this.connections.size>0)for(let t of this.connections.values())i.push(l.promiseTimeout(this.sendWith(t.localClientID,t.remoteClientID,r),e,new c.WriteDeadlineExceededError));else i=this.localClientIDs.map((t,n)=>{let i=t;return this.remoteClientIDs&&this.remoteClientIDs.length>0&&(i=this.remoteClientIDs[n%this.remoteClientIDs.length]),l.promiseTimeout(this.sendWith(t,i,r),e,new c.WriteDeadlineExceededError)});try{await n.default.any(i)}catch(e){throw e.errors}}_handleHandshakePacket(e){if(this.isEstablished)return;if(0===e.getWindowSize())throw new c.InvalidPacketError("WindowSize is zero");if(e.getWindowSize()0&&(t=l.timeoutChan(e),r.push(t.shift())),await i.default.select(r)){case this.onAccept:break;case t:throw new c.DialTimeoutError}this._start(),this.isAccepted=!0}async accept(){if(this.isAccepted)throw new c.SessionEstablishedError;if(await i.default.select([this.onAccept.shift(),l.closedChan.shift()])===this.onAccept);else throw new c.NotHandshakeError;this._start(),this.isAccepted=!0,await this._sendHandshakePacket(this.config.maxRetransmissionTimeout)}async read(e=0){try{if(this.isClosed)throw new c.SessionClosedError;if(!this.isEstablished)throw new c.SessionNotEstablishedError;for(;;){if(this.readContext.err)throw this.readContext.err;if(this.recvWindowData.has(this.recvWindowStartSeq))break;let e=l.timeoutChan(l._maxWait);switch(await i.default.select([this.recvDataUpdate.shift(),e.shift(),this.readContext.done.shift()])){case this.recvDataUpdate:case e:break;case this.readContext.done:throw this.readContext.err}}let t=this.recvWindowData.get(this.recvWindowStartSeq);if(!this.isStream()&&e>0&&e0){r=new Uint8Array(e);let i=t.subarray(0,e);r.set(i),n=i.length}if(n===t.length?(this.recvWindowData.delete(this.recvWindowStartSeq),this.recvWindowStartSeq=l.nextSeq(this.recvWindowStartSeq,1)):this.recvWindowData.set(this.recvWindowStartSeq,t.subarray(n)),this.recvWindowUsed-=n,this.bytesRead+=n,this.bytesReadUpdateTime=Date.now(),this.isStream())for(;e<0||n0){let o=t.subarray(0,e-n);r.set(o,n),i=o.length}else r=l.mergeUint8Array(r,t),i=t.length;i===t.length?(this.recvWindowData.delete(this.recvWindowStartSeq),this.recvWindowStartSeq=l.nextSeq(this.recvWindowStartSeq,1)):this.recvWindowData.set(this.recvWindowStartSeq,t.subarray(i)),this.recvWindowUsed-=i,this.bytesRead+=i,this.bytesReadUpdateTime=Date.now(),n+=i}return r.subarray(0,n)}catch(e){if(e instanceof a.ContextDeadlineExceededError)throw new c.ReadDeadlineExceededError;if(e instanceof a.ContextCanceledError)throw new c.SessionClosedError;throw e}}async write(e){try{if(this.isClosed)throw new c.SessionClosedError;if(!this.isEstablished)throw new c.SessionNotEstablishedError;if(!this.isStream()&&(e.length>this.sendMtu||e>this.sendWindowSize))throw new c.DataSizeTooLargeError;if(0===e.length)return;let t=0;if(this.isStream())for(;e.length>0;){let r=await this._waitForSendWindow(this.writeContext,1),n=e.length;n>r&&(n=r);let i=r===this.sendWindowSize,o=this.sendMtu,s=this.sendBuffer.length;n>=o-s&&(n=o-s,i=!0),this.sendBuffer=l.mergeUint8Array(this.sendBuffer,e.subarray(0,n)),this.bytesWrite+=n,t+=n,i&&await this._flushSendBuffer(),e=e.subarray(n)}else await this._waitForSendWindow(this.writeContext,e.length),this.sendBuffer=new Uint8Array(e),this.bytesWrite+=e.length,t+=e.length,await this._flushSendBuffer()}catch(e){if(e instanceof a.ContextDeadlineExceededError)throw new c.WriteDeadlineExceededError;if(e instanceof a.ContextCanceledError)throw new c.SessionClosedError;throw e}}async close(){this.readContext.cancel(),this.writeContext.cancel();let e=new i.default;if(this.config.linger>0&&setTimeout(e.close,this.config.linger),0!==this.config.linger){try{await this._flushSendBuffer()}catch(e){console.log(e)}await (async()=>{for(;;){let t=l.timeoutChan(100);switch(await i.default.select([t.shift(),e.shift()])){case t:if(this.sendWindowStartSeq===this.sendWindowEndSeq)return;break;case e:return}}})()}try{await this._sendClosePacket()}catch(e){console.log(e)}this.context.cancel(),this.isClosed=!0}setTimeout(e){this.setReadTimeout(e),this.setWriteTimeout(e)}setReadTimeout(e){this.readContext=a.default.withTimeout(this.context,e)}setWriteTimeout(e){this.writeContext=a.default.withTimeout(this.context,e)}setLinger(e){this.config.linger=e}getReadableStream(){if(!this._readableStream){let e=this.ReadableStream||ReadableStream;this._readableStream=new e({start:e=>{this.context.done.shift().then(()=>e.close())},pull:e=>this.isClosed?e.close():this.read().then(t=>e.enqueue(t))})}return this._readableStream}getWritableStream(e=!1){if(!this._writableStream){let t=this.WritableStream||WritableStream,r={write:(e,t)=>this.isClosed?t.error(new c.SessionClosedError):this.write(e)};e&&(r.close=e=>this.close(),r.abort=e=>(console.log("Abort stream:",e),this.setLinger(0),this.close())),this._writableStream=new t(r)}return this._writableStream}updateConnWindowSize(){let e=0;for(let t of this.connections.values())e+=t.windowSize;if(!(e<=0))for(let t of this.connections.values()){let r=this.sendWindowPacketCount*(t.windowSize/e);t.setWindowSize(r)}}}t.default=y},70711:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closedChan=t._maxWait=t._errMaxWait=void 0,t.compareSeq=d,t.connKey=y,t.maxUint32=void 0,t.mergeUint8Array=v,t.nextSeq=f,t.promiseTimeout=b,t.seqInBetween=p,t.sleep=_,t.timeoutChan=g;var n=a(r(26850)),i=s(r(86513));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}function a(e){return e&&e.__esModule?e:{default:e}}let c=4294967295;t.maxUint32=c;let u=1e3;t._maxWait=u;let l=Error("max wait time reached");t._errMaxWait=l;let h=new n.default;function f(e,t){let r=c-i.minSequenceID+1,n=(e-i.minSequenceID+t)%r;return n<0&&(n+=r),n+i.minSequenceID}function p(e,t,r){return e<=t?r>=e&&r=e||rsetTimeout(t,e))}function v(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function b(e,t,r){return new Promise((n,i)=>{let o;t>0&&(o=setTimeout(()=>i(r),t)),e.then(()=>{clearTimeout(o),n()}).catch(i)})}t.closedChan=h,h.close()},73360:function(e,t,r){e.exports=r(36451)},81641:function(e,t,r){"use strict";var n=r(59608),i=r(79263),o=r(46710),s=r(16524),a=r(26501),c=r(98993),u=r(32791),l=r(67899),h=r(24947),f=r(35842),p=r(65181),d=r(72964);e.exports=function(e){return new Promise(function(t,r){var y,g=e.data,_=e.headers,v=e.responseType,b=e.withXSRFToken;function m(){e.cancelToken&&e.cancelToken.unsubscribe(y),e.signal&&e.signal.removeEventListener("abort",y)}n.isFormData(g)&&n.isStandardBrowserEnv()&&delete _["Content-Type"];var w=new XMLHttpRequest;if(e.auth){var S=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";_.Authorization="Basic "+btoa(S+":"+E)}var k=a(e.baseURL,e.url);function x(){if(w){var n="getAllResponseHeaders"in w?c(w.getAllResponseHeaders()):null;i(function(e){t(e),m()},function(e){r(e),m()},{data:v&&"text"!==v&&"json"!==v?w.response:w.responseText,status:w.status,statusText:w.statusText,headers:n,config:e,request:w}),w=null}}if(w.open(e.method.toUpperCase(),s(k,e.params,e.paramsSerializer),!0),w.timeout=e.timeout,"onloadend"in w?w.onloadend=x:w.onreadystatechange=function(){w&&4===w.readyState&&(0!==w.status||w.responseURL&&0===w.responseURL.indexOf("file:"))&&setTimeout(x)},w.onabort=function(){w&&(r(new h("Request aborted",h.ECONNABORTED,e,w)),w=null)},w.onerror=function(){r(new h("Network Error",h.ERR_NETWORK,e,w)),w=null},w.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||l;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new h(t,n.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,e,w)),w=null},n.isStandardBrowserEnv()&&(b&&n.isFunction(b)&&(b=b(e)),b||!1!==b&&u(k))){var T=e.xsrfHeaderName&&e.xsrfCookieName&&o.read(e.xsrfCookieName);T&&(_[e.xsrfHeaderName]=T)}"setRequestHeader"in w&&n.forEach(_,function(e,t){void 0===g&&"content-type"===t.toLowerCase()?delete _[t]:w.setRequestHeader(t,e)}),n.isUndefined(e.withCredentials)||(w.withCredentials=!!e.withCredentials),v&&"json"!==v&&(w.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&w.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&w.upload&&w.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(y=function(t){w&&(r(!t||t.type?new f(null,e,w):t),w.abort(),w=null)},e.cancelToken&&e.cancelToken.subscribe(y),e.signal&&(e.signal.aborted?y():e.signal.addEventListener("abort",y))),g||!1===g||0===g||""===g||(g=null);var B=p(k);if(B&&-1===d.protocols.indexOf(B)){r(new h("Unsupported protocol "+B+":",h.ERR_BAD_REQUEST,e));return}w.send(g)})}},36451:function(e,t,r){"use strict";var n=r(59608),i=r(76305),o=r(77622),s=r(7215),a=r(88886),c=r(59829);function u(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r.create=function(t){return u(s(e,t))},r}var l=u(a);l.Axios=o,l.CanceledError=r(35842),l.CancelToken=r(23899),l.isCancel=r(69771),l.VERSION=r(17249).version,l.toFormData=r(64731),l.AxiosError=r(24947),l.Cancel=l.CanceledError,l.all=function(e){return Promise.all(e)},l.spread=r(45220),l.isAxiosError=r(9088),l.formToJSON=function(e){return c(n.isHTMLForm(e)?new FormData(e):e)},e.exports=l,e.exports.default=l},23899:function(e,t,r){"use strict";var n=r(35842);function i(e){if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});var t,r=this;this.promise.then(function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}}),this.promise.then=function(e){var t,n=new Promise(function(e){r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,i,o){r.reason||(r.reason=new n(e,i,o),t(r.reason))})}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i(function(t){e=t}),cancel:e}},e.exports=i},35842:function(e,t,r){"use strict";var n=r(24947);function i(e,t,r){n.call(this,null==e?"canceled":e,n.ERR_CANCELED,t,r),this.name="CanceledError"}r(59608).inherits(i,n,{__CANCEL__:!0}),e.exports=i},69771:function(e){"use strict";e.exports=function(e){return!!(e&&e.__CANCEL__)}},77622:function(e,t,r){"use strict";var n=r(59608),i=r(16524),o=r(86981),s=r(42777),a=r(7215),c=r(26501),u=r(11515),l=u.validators;function h(e){this.defaults=e,this.interceptors={request:new o,response:new o}}h.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r,i=t.transitional;void 0!==i&&u.assertOptions(i,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var o=t.paramsSerializer;void 0!==o&&u.assertOptions(o,{encode:l.function,serialize:l.function},!0),n.isFunction(o)&&(t.paramsSerializer={serialize:o});var c=[],h=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(h=h&&e.synchronous,c.unshift(e.fulfilled,e.rejected))});var f=[];if(this.interceptors.response.forEach(function(e){f.push(e.fulfilled,e.rejected)}),!h){var p=[s,void 0];for(Array.prototype.unshift.apply(p,c),p=p.concat(f),r=Promise.resolve(t);p.length;)r=r.then(p.shift(),p.shift());return r}for(var d=t;c.length;){var y=c.shift(),g=c.shift();try{d=y(d)}catch(e){g(e);break}}try{r=s(d)}catch(e){return Promise.reject(e)}for(;f.length;)r=r.then(f.shift(),f.shift());return r},h.prototype.getUri=function(e){return i(c((e=a(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],function(e){h.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}}),n.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,i){return this.request(a(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}h.prototype[e]=t(),h.prototype[e+"Form"]=t(!0)}),e.exports=h},24947:function(e,t,r){"use strict";var n=r(59608);function i(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(function(e){s[e]={value:e}}),Object.defineProperties(i,s),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(e,t,r,s,a,c){var u=Object.create(o);return n.toFlatObject(e,u,function(e){return e!==Error.prototype}),i.call(u,e.message,t,r,s,a),u.cause=e,u.name=e.name,c&&Object.assign(u,c),u},e.exports=i},86981:function(e,t,r){"use strict";var n=r(59608);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.clear=function(){this.handlers&&(this.handlers=[])},i.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=i},26501:function(e,t,r){"use strict";var n=r(1314),i=r(94110);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},42777:function(e,t,r){"use strict";var n=r(59608),i=r(45406),o=r(69771),s=r(88886),a=r(35842),c=r(22089);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,null,e.transformRequest),c(e.headers,"Accept"),c(e.headers,"Content-Type"),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||s.adapter)(e).then(function(t){return u(e),t.data=i.call(e,t.data,t.headers,t.status,e.transformResponse),t},function(t){return!o(t)&&(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,t.response.status,e.transformResponse))),Promise.reject(t)})}},7215:function(e,t,r){"use strict";var n=r(59608);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isEmptyObject(t)?n.merge({},e):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function s(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function c(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return n.forEach(Object.keys(e).concat(Object.keys(t)),function(e){var t=u[e]||o,i=t(e);n.isUndefined(i)&&t!==c||(r[e]=i)}),r}},79263:function(e,t,r){"use strict";var n=r(24947);e.exports=function(e,t,r){var i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}},45406:function(e,t,r){"use strict";var n=r(59608),i=r(88886);e.exports=function(e,t,r,o){var s=this||i;return n.forEach(o,function(n){e=n.call(s,e,t,r)}),e}},88886:function(e,t,r){"use strict";var n=r(25566),i=r(59608),o=r(22089),s=r(24947),a=r(67899),c=r(64731),u=r(30980),l=r(72964),h=r(59829),f={"Content-Type":"application/x-www-form-urlencoded"};function p(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function d(e,t,r){if(i.isString(e))try{return(t||JSON.parse)(e),i.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}var y={transitional:a,adapter:function(){var e;return"undefined"!=typeof XMLHttpRequest?e=r(81641):void 0!==n&&"[object process]"===Object.prototype.toString.call(n)&&(e=r(81641)),e}(),transformRequest:[function(e,t){o(t,"Accept"),o(t,"Content-Type");var r,n=t&&t["Content-Type"]||"",s=n.indexOf("application/json")>-1,a=i.isObject(e);if(a&&i.isHTMLForm(e)&&(e=new FormData(e)),i.isFormData(e))return s?JSON.stringify(h(e)):e;if(i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e))return e;if(i.isArrayBufferView(e))return e.buffer;if(i.isURLSearchParams(e))return p(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(a){if(-1!==n.indexOf("application/x-www-form-urlencoded"))return u(e,this.formSerializer).toString();if((r=i.isFileList(e))||n.indexOf("multipart/form-data")>-1){var l=this.env&&this.env.FormData;return c(r?{"files[]":e}:e,l&&new l,this.formSerializer)}}return a||s?(p(t,"application/json"),d(e)):e}],transformResponse:[function(e){var t=this.transitional||y.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&i.isString(e)&&(r&&!this.responseType||n)){var o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw s.from(e,s.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:l.classes.FormData,Blob:l.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],function(e){y.headers[e]={}}),i.forEach(["post","put","patch"],function(e){y.headers[e]=i.merge(f)}),e.exports=y},67899:function(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},31588:function(e,t,r){e.exports=r(42558)},17249:function(e){e.exports={version:"0.28.1"}},3168:function(e,t,r){"use strict";var n=r(64731);function i(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,function(e){return t[e]})}function o(e,t){this._pairs=[],e&&n(e,this,t)}var s=o.prototype;s.append=function(e,t){this._pairs.push([e,t])},s.toString=function(e){var t=e?function(t){return e.call(this,t,i)}:i;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")},e.exports=o},76305:function(e){"use strict";e.exports=function(e,t){return function(){return e.apply(t,arguments)}}},16524:function(e,t,r){"use strict";var n=r(59608),i=r(3168);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var s,a=e.indexOf("#");-1!==a&&(e=e.slice(0,a));var c=r&&r.encode||o,u=r&&r.serialize;return(s=u?u(t,r):n.isURLSearchParams(t)?t.toString():new i(t,r).toString(c))&&(e+=(-1===e.indexOf("?")?"?":"&")+s),e}},94110:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},46710:function(e,t,r){"use strict";var n=r(59608);e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},59829:function(e,t,r){"use strict";var n=r(59608);function i(e){return n.matchAll(/\w+|\[(\w*)]/g,e).map(function(e){return"[]"===e[0]?"":e[1]||e[0]})}function o(e){var t,r,n={},i=Object.keys(e),o=i.length;for(t=0;t=e.length;return(a=!a&&n.isArray(i)?i.length:a,u)?n.hasOwnProperty(i,a)?i[a]=[i[a],r]:i[a]=r:(i[a]&&n.isObject(i[a])||(i[a]=[]),t(e,r,i[a],s)&&n.isArray(i[a])&&(i[a]=o(i[a]))),!c}if(n.isFormData(e)&&n.isFunction(e.entries)){var r={};return n.forEachEntry(e,function(e,n){t(i(e),n,r,0)}),r}return null}e.exports=s},1314:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},9088:function(e,t,r){"use strict";var n=r(59608);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},32791:function(e,t,r){"use strict";var n=r(59608);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return function(){return!0}}()},22089:function(e,t,r){"use strict";var n=r(59608);e.exports=function(e,t){n.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},98993:function(e,t,r){"use strict";var n=r(59608),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e&&n.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=n.trim(e.slice(0,o)).toLowerCase(),r=n.trim(e.slice(o+1)),t&&!(s[t]&&i.indexOf(t)>=0)&&("set-cookie"===t?s[t]=(s[t]?s[t]:[]).concat([r]):s[t]=s[t]?s[t]+", "+r:r)}),s}},65181:function(e){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},45220:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},64731:function(e,t,r){"use strict";var n=r(9109).Buffer,i=r(59608),o=r(24947),s=r(31588);function a(e){return i.isPlainObject(e)||i.isArray(e)}function c(e){return i.endsWith(e,"[]")?e.slice(0,-2):e}function u(e,t,r){return e?e.concat(t).map(function(e,t){return e=c(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}function l(e){return i.isArray(e)&&!e.some(a)}var h=i.toFlatObject(i,{},null,function(e){return/^is[A-Z]/.test(e)});function f(e){return e&&i.isFunction(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator]}function p(e,t,r){if(!i.isObject(e))throw TypeError("target must be an object");t=t||new(s||FormData);var p=(r=i.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!i.isUndefined(t[e])})).metaTokens,d=r.visitor||b,y=r.dots,g=r.indexes,_=(r.Blob||"undefined"!=typeof Blob&&Blob)&&f(t);if(!i.isFunction(d))throw TypeError("visitor must be a function");function v(e){if(null===e)return"";if(i.isDate(e))return e.toISOString();if(!_&&i.isBlob(e))throw new o("Blob is not supported. Use a Buffer instead.");return i.isArrayBuffer(e)||i.isTypedArray(e)?_&&"function"==typeof Blob?new Blob([e]):n.from(e):e}function b(e,r,n){var o=e;if(e&&!n&&"object"==typeof e){if(i.endsWith(r,"{}"))r=p?r:r.slice(0,-2),e=JSON.stringify(e);else if(i.isArray(e)&&l(e)||i.isFileList(e)||i.endsWith(r,"[]")&&(o=i.toArray(e)))return r=c(r),o.forEach(function(e,n){i.isUndefined(e)||t.append(!0===g?u([r],n,y):null===g?r:r+"[]",v(e))}),!1}return!!a(e)||(t.append(u(n,r,y),v(e)),!1)}var m=[],w=Object.assign(h,{defaultVisitor:b,convertValue:v,isVisitable:a});function S(e,r){if(!i.isUndefined(e)){if(-1!==m.indexOf(e))throw Error("Circular reference detected in "+r.join("."));m.push(e),i.forEach(e,function(e,n){!0===(!i.isUndefined(e)&&d.call(t,e,i.isString(n)?n.trim():n,r,w))&&S(e,r?r.concat(n):[n])}),m.pop()}}if(!i.isObject(e))throw TypeError("data must be an object");return S(e),t}e.exports=p},30980:function(e,t,r){"use strict";var n=r(59608),i=r(64731),o=r(72964);e.exports=function(e,t){return i(e,new o.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,i){return o.isNode&&n.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}},11515:function(e,t,r){"use strict";var n=r(17249).version,i=r(24947),o={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var s={};function a(e,t,r){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var s=n[o],a=t[s];if(a){var c=e[s],u=void 0===c||a(c,s,e);if(!0!==u)throw new i("option "+s+" must be "+u,i.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new i("Unknown option "+s,i.ERR_BAD_OPTION)}}o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,a){if(!1===e)throw new i(o(n," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,a)}},e.exports={assertOptions:a,validators:o}},86369:function(e){"use strict";e.exports=FormData},61438:function(e,t,r){"use strict";var n=r(3168);e.exports="undefined"!=typeof URLSearchParams?URLSearchParams:n},94472:function(e,t,r){"use strict";e.exports={isBrowser:!0,classes:{URLSearchParams:r(61438),FormData:r(86369),Blob:Blob},protocols:["http","https","file","blob","url","data"]}},72964:function(e,t,r){"use strict";e.exports=r(94472)},59608:function(e,t,r){"use strict";var n=r(76305),i=Object.prototype.toString,o=function(e){return function(t){var r=i.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function s(e){return e=e.toLowerCase(),function(t){return o(t)===e}}function a(e){return Array.isArray(e)}function c(e){return void 0===e}function u(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var l=s("ArrayBuffer");function h(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)}function f(e){return"string"==typeof e}function p(e){return"number"==typeof e}function d(e){return null!==e&&"object"==typeof e}function y(e){if("object"!==o(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function g(e){return e&&0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}var _=s("Date"),v=s("File"),b=s("Blob"),m=s("FileList");function w(e){return"[object Function]"===i.call(e)}function S(e){return d(e)&&w(e.pipe)}function E(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||i.call(e)===t||w(e.toString)&&e.toString()===t)}var k=s("URLSearchParams");function x(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function T(){var e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document}function B(e,t){if(null!=e){if("object"!=typeof e&&(e=[e]),a(e))for(var r=0,n=e.length;r0;)s=i[o],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=!1!==r&&Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t}function C(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return -1!==n&&n===r}function N(e){if(!e)return null;if(a(e))return e;var t=e.length;if(!p(t))return null;for(var r=Array(t);t-- >0;)r[t]=e[t];return r}var I=function(e){return function(t){return e&&t instanceof e}}("undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array));function D(e,t){for(var r,n=(e&&e[Symbol.iterator]).call(e);(r=n.next())&&!r.done;){var i=r.value;t.call(e,i[0],i[1])}}function j(e,t){for(var r,n=[];null!==(r=e.exec(t));)n.push(r);return n}var U=s("HTMLFormElement"),F=function(e){return function(t,r){return e.call(t,r)}}(Object.prototype.hasOwnProperty);e.exports={isArray:a,isArrayBuffer:l,isBuffer:u,isFormData:E,isArrayBufferView:h,isString:f,isNumber:p,isObject:d,isPlainObject:y,isEmptyObject:g,isUndefined:c,isDate:_,isFile:v,isBlob:b,isFunction:w,isStream:S,isURLSearchParams:k,isStandardBrowserEnv:T,forEach:B,merge:A,extend:M,trim:x,stripBOM:O,inherits:P,toFlatObject:R,kindOf:o,kindOfTest:s,endsWith:C,toArray:N,isTypedArray:I,isFileList:m,forEachEntry:D,matchAll:j,isHTMLForm:U,hasOwnProperty:F}},35197:function(e,t,r){"use strict";var n=r(10632).Buffer;function i(e){if(e.length>=255)throw TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,l=new Uint8Array(s);e[r];){var h=t[e.charCodeAt(r)];if(255===h)return;for(var f=0,p=s-1;(0!==h||f>>0,l[p]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");o=f,r++}for(var d=s-o;d!==s&&0===l[d];)d++;var y=n.allocUnsafe(i+(s-d));y.fill(0,0,i);for(var g=i;d!==s;)y[g++]=l[d++];return y}function f(e){var t=h(e);if(t)return t;throw Error("Non-base"+a+" character")}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var u=(s-o)*l+1>>>0,h=new Uint8Array(u);o!==s;){for(var f=t[o],p=0,d=u-1;(0!==f||p>>0,h[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw Error("Non-zero carry");i=p,o++}for(var y=u-i;y!==u&&0===h[y];)y++;for(var g=c.repeat(r);y-1?i(r):r}},11356:function(e,t,r){"use strict";var n=r(71769),i=r(77323),o=r(49813),s=r(31354),a=i("%Function.prototype.apply%"),c=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||n.call(c,a),l=r(7723),h=i("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new s("a function is required");var t=u(n,c,arguments);return o(t,1+h(0,e.length-(arguments.length-1)),!0)};var f=function(){return u(n,a,arguments)};l?l(e.exports,"apply",{value:f}):e.exports.apply=f},42927:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(85925),r(96546),r(87579),r(90576))}(0,function(e){return!function(){var t=e,r=t.lib.BlockCipher,n=t.algo,i=[],o=[],s=[],a=[],c=[],u=[],l=[],h=[],f=[],p=[];!function(){for(var e=[],t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var r=0,n=0,t=0;t<256;t++){var d=n^n<<1^n<<2^n<<3^n<<4;d=d>>>8^255&d^99,i[r]=d,o[d]=r;var y=e[r],g=e[y],_=e[g],v=257*e[d]^16843008*d;s[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,c[r]=v<<8|v>>>24,u[r]=v;var v=16843009*_^65537*g^257*y^16843008*r;l[d]=v<<24|v>>>8,h[d]=v<<16|v>>>16,f[d]=v<<8|v>>>24,p[d]=v,r?(r=y^e[e[e[_^y]]],n^=e[e[n]]):r=n=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],y=n.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e,t=this._keyPriorReset=this._key,r=t.words,n=t.sigBytes/4,o=((this._nRounds=n+6)+1)*4,s=this._keySchedule=[],a=0;a6&&a%n==4&&(e=i[e>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[255&e]):e=(i[(e=e<<8|e>>>24)>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[255&e])^d[a/n|0]<<24,s[a]=s[a-n]^e);for(var c=this._invKeySchedule=[],u=0;u>>24]]^h[i[e>>>16&255]]^f[i[e>>>8&255]]^p[i[255&e]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,c,u,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,h,f,p,o);var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,s,a){for(var c=this._nRounds,u=e[t]^r[0],l=e[t+1]^r[1],h=e[t+2]^r[2],f=e[t+3]^r[3],p=4,d=1;d>>24]^i[l>>>16&255]^o[h>>>8&255]^s[255&f]^r[p++],g=n[l>>>24]^i[h>>>16&255]^o[f>>>8&255]^s[255&u]^r[p++],_=n[h>>>24]^i[f>>>16&255]^o[u>>>8&255]^s[255&l]^r[p++],v=n[f>>>24]^i[u>>>16&255]^o[l>>>8&255]^s[255&h]^r[p++];u=y,l=g,h=_,f=v}var y=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[p++],g=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^r[p++],_=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^r[p++],v=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^r[p++];e[t]=y,e[t+1]=g,e[t+2]=_,e[t+3]=v},keySize:8});t.AES=r._createHelper(y)}(),e.AES})},16405:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(85925),r(96546),r(87579),r(90576))}(0,function(e){return!function(){var t=e,r=t.lib.BlockCipher,n=t.algo;let i=16,o=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var a={pbox:[],sbox:[]};function c(e,t){let r=t>>24&255,n=t>>16&255,i=t>>8&255,o=255&t,s=e.sbox[0][r]+e.sbox[1][n];return s^=e.sbox[2][i],s+=e.sbox[3][o]}function u(e,t,r){let n,o=t,s=r;for(let t=0;t1;--t)o^=e.pbox[t],s=c(e,o)^s,n=o,o=s,s=n;return n=o,o=s,s=n^e.pbox[1],{left:o^=e.pbox[0],right:s}}function h(e,t,r){for(let t=0;t<4;t++){e.sbox[t]=[];for(let r=0;r<256;r++)e.sbox[t][r]=s[t][r]}let n=0;for(let s=0;s=r&&(n=0);let a=0,c=0,l=0;for(let t=0;t>>2];e.sigBytes-=t}};r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:p}),reset:function(){u.reset.call(this);var e,t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var d=r.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(t.format={}).OpenSSL={stringify:function(e){var t,r=e.ciphertext,n=e.salt;return(t=n?i.create([1398893684,1701076831]).concat(n).concat(r):r).toString(a)},parse:function(e){var t,r=a.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=i.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),d.create({ciphertext:r,salt:t})}},g=r.SerializableCipher=n.extend({cfg:n.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),s=i.cfg;return d.create({ciphertext:o,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=(t.kdf={}).OpenSSL={execute:function(e,t,r,n,o){if(n||(n=i.random(8)),o)var s=c.create({keySize:t+r,hasher:o}).compute(e,n);else var s=c.create({keySize:t+r}).compute(e,n);var a=i.create(s.words.slice(t),4*r);return s.sigBytes=4*t,d.create({key:s,iv:a,salt:n})}},v=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:_}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize,n.salt,n.hasher);n.iv=i.iv;var o=g.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt,n.hasher);return n.iv=i.iv,g.decrypt.call(this,e,t,i.key,n)}})}()})},39317:function(e,t,r){!function(r,n){e.exports=t=n()}(0,function(){var e=e||function(e,t){if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(42480)}catch(e){}var n,i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},a=s.lib={},c=a.Base=function(){return{extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=c.extend({init:function(e,r){e=this.words=e||[],t!=r?this.sigBytes=r:this.sigBytes=4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},f=l.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},p=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},d=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,o=n.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,l=e.min(4*c,o);if(c){for(var h=0;h>>6-s%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return r.create(i,o)}t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-s%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return r.create(i,o)}t.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],s=0;s>>2]>>>24-s%4*8&255)<<16|(r[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|r[s+2>>>2]>>>24-(s+2)%4*8&255,c=0;c<4&&s+.75*c>>6*(3-c)&63));var u=i.charAt(64);if(u)for(;o.length%4;)o.push(u);return o.join("")},parse:function(e,t){void 0===t&&(t=!0);var r=e.length,i=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var s=0;s>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return r.create(n,2*t)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return r.create(n,2*t)}}}(),e.enc.Utf16})},87579:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(54724),r(52657))}(0,function(e){return!function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.algo,s=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,o=n.hasher.create(),s=i.create(),a=s.words,c=n.keySize,u=n.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,c=s.words,u=0;u>>2]|=e[i]<<24-i%4*8;r.call(this,n,t)}else r.apply(this,arguments)}).prototype=t}}(),e.lib.WordArray})},96546:function(e,t,r){!function(n,i){e.exports=t=i(r(39317))}(0,function(e){return!function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var o=this._hash.words,s=e[t+0],c=e[t+1],p=e[t+2],d=e[t+3],y=e[t+4],g=e[t+5],_=e[t+6],v=e[t+7],b=e[t+8],m=e[t+9],w=e[t+10],S=e[t+11],E=e[t+12],k=e[t+13],x=e[t+14],T=e[t+15],B=o[0],A=o[1],M=o[2],O=o[3];B=u(B,A,M,O,s,7,a[0]),O=u(O,B,A,M,c,12,a[1]),M=u(M,O,B,A,p,17,a[2]),A=u(A,M,O,B,d,22,a[3]),B=u(B,A,M,O,y,7,a[4]),O=u(O,B,A,M,g,12,a[5]),M=u(M,O,B,A,_,17,a[6]),A=u(A,M,O,B,v,22,a[7]),B=u(B,A,M,O,b,7,a[8]),O=u(O,B,A,M,m,12,a[9]),M=u(M,O,B,A,w,17,a[10]),A=u(A,M,O,B,S,22,a[11]),B=u(B,A,M,O,E,7,a[12]),O=u(O,B,A,M,k,12,a[13]),M=u(M,O,B,A,x,17,a[14]),A=u(A,M,O,B,T,22,a[15]),B=l(B,A,M,O,c,5,a[16]),O=l(O,B,A,M,_,9,a[17]),M=l(M,O,B,A,S,14,a[18]),A=l(A,M,O,B,s,20,a[19]),B=l(B,A,M,O,g,5,a[20]),O=l(O,B,A,M,w,9,a[21]),M=l(M,O,B,A,T,14,a[22]),A=l(A,M,O,B,y,20,a[23]),B=l(B,A,M,O,m,5,a[24]),O=l(O,B,A,M,x,9,a[25]),M=l(M,O,B,A,d,14,a[26]),A=l(A,M,O,B,b,20,a[27]),B=l(B,A,M,O,k,5,a[28]),O=l(O,B,A,M,p,9,a[29]),M=l(M,O,B,A,v,14,a[30]),A=l(A,M,O,B,E,20,a[31]),B=h(B,A,M,O,g,4,a[32]),O=h(O,B,A,M,b,11,a[33]),M=h(M,O,B,A,S,16,a[34]),A=h(A,M,O,B,x,23,a[35]),B=h(B,A,M,O,c,4,a[36]),O=h(O,B,A,M,y,11,a[37]),M=h(M,O,B,A,v,16,a[38]),A=h(A,M,O,B,w,23,a[39]),B=h(B,A,M,O,k,4,a[40]),O=h(O,B,A,M,s,11,a[41]),M=h(M,O,B,A,d,16,a[42]),A=h(A,M,O,B,_,23,a[43]),B=h(B,A,M,O,m,4,a[44]),O=h(O,B,A,M,E,11,a[45]),M=h(M,O,B,A,T,16,a[46]),A=h(A,M,O,B,p,23,a[47]),B=f(B,A,M,O,s,6,a[48]),O=f(O,B,A,M,v,10,a[49]),M=f(M,O,B,A,x,15,a[50]),A=f(A,M,O,B,g,21,a[51]),B=f(B,A,M,O,E,6,a[52]),O=f(O,B,A,M,d,10,a[53]),M=f(M,O,B,A,w,15,a[54]),A=f(A,M,O,B,c,21,a[55]),B=f(B,A,M,O,b,6,a[56]),O=f(O,B,A,M,T,10,a[57]),M=f(M,O,B,A,_,15,a[58]),A=f(A,M,O,B,k,21,a[59]),B=f(B,A,M,O,y,6,a[60]),O=f(O,B,A,M,S,10,a[61]),M=f(M,O,B,A,p,15,a[62]),A=f(A,M,O,B,m,21,a[63]),o[0]=o[0]+B|0,o[1]=o[1]+A|0,o[2]=o[2]+M|0,o[3]=o[3]+O|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),s=n;r[(i+64>>>9<<4)+15]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,r[(i+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,e.sigBytes=(r.length+1)*4,this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var l=c[u];c[u]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,o,s){var a=e+(t&r|~t&n)+i+s;return(a<>>32-o)+t}function l(e,t,r,n,i,o,s){var a=e+(t&n|r&~n)+i+s;return(a<>>32-o)+t}function h(e,t,r,n,i,o,s){var a=e+(t^r^n)+i+s;return(a<>>32-o)+t}function f(e,t,r,n,i,o,s){var a=e+(r^(t|~n))+i+s;return(a<>>32-o)+t}r.MD5=o._createHelper(c),r.HmacMD5=o._createHmacHelper(c)}(Math),e.MD5})},90584:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(90576))}(0,function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function r(e,t,r,n){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(var s=0;s>24&255)==255){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0+(t<<16)+(r<<8)+n}else e+=16777216;return e}function n(e){return 0===(e[0]=r(e[0]))&&(e[1]=r(e[1])),e}var i=t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),n(s);var a=s.slice(0);r.encryptBlock(a,0);for(var c=0;c>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923})},44121:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(90576))}(0,function(e){return e.pad.Iso10126={pad:function(t,r){var n=4*r,i=n-t.sigBytes%n;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126})},57457:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(90576))}(0,function(e){return e.pad.Iso97971={pad:function(t,r){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,r)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})},64394:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(90576))}(0,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})},36490:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(90576))}(0,function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1,r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},e.pad.ZeroPadding})},51795:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(7940),r(52657))}(0,function(e){return!function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.algo,s=o.SHA256,a=o.HMAC,c=o.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:s,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=a.create(r.hasher,e),o=i.create(),s=i.create([1]),c=o.words,u=s.words,l=r.keySize,h=r.iterations;c.length>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(var i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,s=o[0],a=o[1],u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,l=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,h=u>>>16|4294901760&l,f=l<<16|65535&u;n[0]^=u,n[1]^=h,n[2]^=l,n[3]^=f,n[4]^=u,n[5]^=h,n[6]^=l,n[7]^=f;for(var i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=(i[n]<<8|i[n]>>>24)&16711935|(i[n]<<24|i[n]>>>8)&4278255360,e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,c=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.RabbitLegacy=r._createHelper(a)}(),e.RabbitLegacy})},70843:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(85925),r(96546),r(87579),r(90576))}(0,function(e){return!function(){var t=e,r=t.lib.StreamCipher,n=t.algo,i=[],o=[],s=[],a=n.Rabbit=r.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=(e[r]<<8|e[r]>>>24)&16711935|(e[r]<<24|e[r]>>>8)&4278255360;var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var r=0;r<4;r++)c.call(this);for(var r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,s=o[0],a=o[1],u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,l=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,h=u>>>16|4294901760&l,f=l<<16|65535&u;i[0]^=u,i[1]^=h,i[2]^=l,i[3]^=f,i[4]^=u,i[5]^=h,i[6]^=l,i[7]^=f;for(var r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=(i[n]<<8|i[n]>>>24)&16711935|(i[n]<<24|i[n]>>>8)&4278255360,e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,c=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.Rabbit=r._createHelper(a)}(),e.Rabbit})},14848:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(85925),r(96546),r(87579),r(90576))}(0,function(e){return!function(){var t=e,r=t.lib.StreamCipher,n=t.algo,i=n.RC4=r.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;for(var i=0,o=0;i<256;i++){var s=i%r,a=t[s>>>2]>>>24-s%4*8&255;o=(o+n[i]+a)%256;var c=n[i];n[i]=n[o],n[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}t.RC4=r._createHelper(i);var s=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});t.RC4Drop=r._createHelper(s)}(),e.RC4})},75461:function(e,t,r){!function(n,i){e.exports=t=i(r(39317))}(0,function(e){return!/** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r,n,i,o,s,p,m,w,S,E,k,x=0;x<16;x++){var T=t+x,B=e[T];e[T]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360}var A=this._hash.words,M=h.words,O=f.words,P=a.words,R=c.words,C=u.words,N=l.words;p=r=A[0],m=n=A[1],w=i=A[2],S=o=A[3],E=s=A[4];for(var x=0;x<80;x+=1)k=r+e[t+P[x]]|0,x<16?k+=d(n,i,o)+M[0]:x<32?k+=y(n,i,o)+M[1]:x<48?k+=g(n,i,o)+M[2]:x<64?k+=_(n,i,o)+M[3]:k+=v(n,i,o)+M[4],k|=0,k=(k=b(k,C[x]))+s|0,r=s,s=o,o=b(i,10),i=n,n=k,k=p+e[t+R[x]]|0,x<16?k+=v(m,w,S)+O[0]:x<32?k+=_(m,w,S)+O[1]:x<48?k+=g(m,w,S)+O[2]:x<64?k+=y(m,w,S)+O[3]:k+=d(m,w,S)+O[4],k|=0,k=(k=b(k,N[x]))+E|0,p=E,E=S,S=b(w,10),w=m,m=k;k=A[1]+i+S|0,A[1]=A[2]+o+E|0,A[2]=A[3]+s+p|0,A[3]=A[4]+r+m|0,A[4]=A[0]+n+w|0,A[0]=k},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[(n+64>>>9<<4)+14]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,e.sigBytes=(t.length+1)*4,this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r){return e^t^r}function y(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function _(e,t,r){return e&r|t&~r}function v(e,t,r){return e^(t|~r)}function b(e,t){return e<>>32-t}r.RIPEMD160=o._createHelper(p),r.HmacRIPEMD160=o._createHmacHelper(p)}(Math),e.RIPEMD160})},54724:function(e,t,r){!function(n,i){e.exports=t=i(r(39317))}(0,function(e){return!function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,o=t.algo,s=[],a=o.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],c=r[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var h=(n<<5|n>>>27)+c+s[u];u<20?h+=(i&o|~i&a)+1518500249:u<40?h+=(i^o^a)+1859775393:u<60?h+=(i&o|i&a|o&a)-1894007588:h+=(i^o^a)-899497514,c=a,a=o,o=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[(n+64>>>9<<4)+14]=Math.floor(r/4294967296),t[(n+64>>>9<<4)+15]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(a),t.HmacSHA1=i._createHmacHelper(a)}(),e.SHA1})},92020:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(7940))}(0,function(e){return!function(){var t=e,r=t.lib.WordArray,n=t.algo,i=n.SHA256,o=n.SHA224=i.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=i._createHelper(o),t.HmacSHA224=i._createHmacHelper(o)}(),e.SHA224})},7940:function(e,t,r){!function(n,i){e.exports=t=i(r(39317))}(0,function(e){return!function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(e){return(e-(0|e))*4294967296|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(a[i]=r(t.pow(n,.5))),c[i]=r(t.pow(n,1/3)),i++),n++}();var u=[],l=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],h=r[6],f=r[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var d=u[p-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=u[p-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[p]=y+u[p-7]+_+u[p-16]}var v=a&l^~a&h,b=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+v+c[p]+u[p],S=m+b;f=h,h=l,l=a,a=s+w|0,s=o,o=i,i=n,n=w+S|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+l|0,r[6]=r[6]+h|0,r[7]=r[7]+f|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[(i+64>>>9<<4)+14]=t.floor(n/4294967296),r[(i+64>>>9<<4)+15]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(l),r.HmacSHA256=o._createHmacHelper(l)}(Math),e.SHA256})},26552:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(66061))}(0,function(e){return!function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.x64.Word,a=r.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=t%5,i=(2*e+3*t)%5;e=n,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,a=0;a<24;a++){for(var h=0,f=0,p=0;p<7;p++){if(1&o){var d=(1<>>24)&16711935|(o<<24|o>>>8)&4278255360,s=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360;var a=r[i];a.high^=s,a.low^=o}for(var f=0;f<24;f++){for(var p=0;p<5;p++){for(var d=0,y=0,g=0;g<5;g++){var a=r[p+5*g];d^=a.high,y^=a.low}var _=h[p];_.high=d,_.low=y}for(var p=0;p<5;p++)for(var v=h[(p+4)%5],b=h[(p+1)%5],m=b.high,w=b.low,d=v.high^(m<<1|w>>>31),y=v.low^(w<<1|m>>>31),g=0;g<5;g++){var a=r[p+5*g];a.high^=d,a.low^=y}for(var S=1;S<25;S++){var d,y,a=r[S],E=a.high,k=a.low,x=c[S];x<32?(d=E<>>32-x,y=k<>>32-x):(d=k<>>64-x,y=E<>>64-x);var T=h[u[S]];T.high=d,T.low=y}var B=h[0],A=r[0];B.high=A.high,B.low=A.low;for(var p=0;p<5;p++)for(var g=0;g<5;g++){var S=p+5*g,a=r[S],M=h[S],O=h[(p+1)%5+5*g],P=h[(p+2)%5+5*g];a.high=M.high^~O.high&P.high,a.low=M.low^~O.low&P.low}var a=r[0],R=l[f];a.high^=R.high,a.low^=R.low}},_doFinalize:function(){var e=this._data,r=e.words;this._nDataBytes;var n=8*e.sigBytes,o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,u=[],l=0;l>>24)&16711935|(f<<24|f>>>8)&4278255360,p=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,u.push(p),u.push(f)}return new i.init(u,a)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=o._createHelper(f),r.HmacSHA3=o._createHmacHelper(f)}(Math),e.SHA3})},42869:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(66061),r(12427))}(0,function(e){return!function(){var t=e,r=t.x64,n=r.Word,i=r.WordArray,o=t.algo,s=o.SHA512,a=o.SHA384=s.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=s._createHelper(a),t.HmacSHA384=s._createHmacHelper(a)}(),e.SHA384})},12427:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(66061))}(0,function(e){return!function(){var t=e,r=t.lib.Hasher,n=t.x64,i=n.Word,o=n.WordArray,s=t.algo;function a(){return i.create.apply(i,arguments)}var c=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=a()}();var l=s.SHA512=r.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],h=r[6],f=r[7],p=n.high,d=n.low,y=i.high,g=i.low,_=o.high,v=o.low,b=s.high,m=s.low,w=a.high,S=a.low,E=l.high,k=l.low,x=h.high,T=h.low,B=f.high,A=f.low,M=p,O=d,P=y,R=g,C=_,N=v,I=b,D=m,j=w,U=S,F=E,L=k,W=x,z=T,K=B,H=A,q=0;q<80;q++){var Y,G,$=u[q];if(q<16)G=$.high=0|e[t+2*q],Y=$.low=0|e[t+2*q+1];else{var V=u[q-15],Z=V.high,J=V.low,X=(Z>>>1|J<<31)^(Z>>>8|J<<24)^Z>>>7,Q=(J>>>1|Z<<31)^(J>>>8|Z<<24)^(J>>>7|Z<<25),ee=u[q-2],et=ee.high,er=ee.low,en=(et>>>19|er<<13)^(et<<3|er>>>29)^et>>>6,ei=(er>>>19|et<<13)^(er<<3|et>>>29)^(er>>>6|et<<26),eo=u[q-7],es=eo.high,ea=eo.low,ec=u[q-16],eu=ec.high,el=ec.low;G=X+es+((Y=Q+ea)>>>0>>0?1:0),Y+=ei,G=G+en+(Y>>>0>>0?1:0),Y+=el,G=G+eu+(Y>>>0>>0?1:0),$.high=G,$.low=Y}var eh=j&F^~j&W,ef=U&L^~U&z,ep=M&P^M&C^P&C,ed=O&R^O&N^R&N,ey=(M>>>28|O<<4)^(M<<30|O>>>2)^(M<<25|O>>>7),eg=(O>>>28|M<<4)^(O<<30|M>>>2)^(O<<25|M>>>7),e_=(j>>>14|U<<18)^(j>>>18|U<<14)^(j<<23|U>>>9),ev=(U>>>14|j<<18)^(U>>>18|j<<14)^(U<<23|j>>>9),eb=c[q],em=eb.high,ew=eb.low,eS=H+ev,eE=K+e_+(eS>>>0>>0?1:0),eS=eS+ef,eE=eE+eh+(eS>>>0>>0?1:0),eS=eS+ew,eE=eE+em+(eS>>>0>>0?1:0),eS=eS+Y,eE=eE+G+(eS>>>0>>0?1:0),ek=eg+ed,ex=ey+ep+(ek>>>0>>0?1:0);K=W,H=z,W=F,z=L,F=j,L=U,j=I+eE+((U=D+eS|0)>>>0>>0?1:0)|0,I=C,D=N,C=P,N=R,P=M,R=O,M=eE+ex+((O=eS+ek|0)>>>0>>0?1:0)|0}d=n.low=d+O,n.high=p+M+(d>>>0>>0?1:0),g=i.low=g+R,i.high=y+P+(g>>>0>>0?1:0),v=o.low=v+N,o.high=_+C+(v>>>0>>0?1:0),m=s.low=m+D,s.high=b+I+(m>>>0>>0?1:0),S=a.low=S+U,a.high=w+j+(S>>>0>>0?1:0),k=l.low=k+L,l.high=E+F+(k>>>0>>0?1:0),T=h.low=T+z,h.high=x+W+(T>>>0>>0?1:0),A=f.low=A+H,f.high=B+K+(A>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[(n+128>>>10<<5)+30]=Math.floor(r/4294967296),t[(n+128>>>10<<5)+31]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=r._createHelper(l),t.HmacSHA512=r._createHmacHelper(l)}(),e.SHA512})},77850:function(e,t,r){!function(n,i,o){e.exports=t=i(r(39317),r(85925),r(96546),r(87579),r(90576))}(0,function(e){return!function(){var t=e,r=t.lib,n=r.WordArray,i=r.BlockCipher,o=t.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){for(var u=i[o]=[],l=c[o],r=0;r<24;r++)u[r/6|0]|=t[(a[r]-1+l)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(a[r+24]-1+l)%28]<<31-r%6;u[0]=u[0]<<1|u[0]>>>31;for(var r=1;r<7;r++)u[r]=u[r]>>>(r-1)*4+3;u[7]=u[7]<<5|u[7]>>>27}for(var h=this._invSubKeys=[],r=0;r<16;r++)h[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,s=this._rBlock,a=0,c=0;c<8;c++)a|=u[c][((s^i[c])&l[c])>>>0];this._lBlock=s,this._rBlock=o^a}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=h.createEncryptor(n.create(t)),this._des2=h.createEncryptor(n.create(r)),this._des3=h.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(d)}(),e.TripleDES})},66061:function(e,t,r){!function(n,i){e.exports=t=i(r(39317))}(0,function(e){return!function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.x64={};o.Word=n.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=n.extend({init:function(e,t){e=this.words=e||[],void 0!=t?this.sigBytes=t:this.sigBytes=8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n + * MIT Licence + */var o,s,a,c=9e15,u=1e9,l="0123456789abcdef",h="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",f="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",p={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},d=!0,y="[DecimalError] ",g=y+"Invalid argument: ",_=y+"Precision limit exceeded",v=y+"crypto unavailable",b="[object Decimal]",m=Math.floor,w=Math.pow,S=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,E=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,k=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,x=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,T=1e7,B=7,A=9007199254740991,M=h.length-1,O=f.length-1,P={toStringTag:b};function R(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(g+e)}function N(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=B,i=0):(i=Math.ceil((t+1)/B),t%=B),o=w(10,B-t),a=e[i]%o|0,null==n?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),s=r<4&&99999==a||r>3&&49999==a||5e4==a||0==a):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==w(10,t-2)-1||(a==o/2||0==a)&&(e[i+1]/o/100|0)==0:t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),s=(n||r<4)&&9999==a||!n&&r>3&&4999==a):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==w(10,t-3)-1,s}function I(e,t,r){for(var n,i,o=[0],s=0,a=e.length;sr-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function D(e,t){var r,n,i;if(t.isZero())return t;(n=t.d.length)<32?i=(1/et(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ee(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}P.absoluteValue=P.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),U(e)},P.ceil=function(){return U(new this.constructor(this),this.e+1,2)},P.clampedTo=P.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(g+t);return 0>r.cmp(e)?e:r.cmp(t)>0?t:new n(r)},P.comparedTo=P.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,c=o.s,u=e.s;if(!s||!a)return c&&u?c!==u?c:s===a?0:!s^c<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?c:a[0]?-u:0;if(c!==u)return c;if(o.e!==e.e)return o.e>e.e^c<0?1:-1;for(t=0,r=(n=s.length)<(i=a.length)?n:i;ta[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1},P.cosine=P.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+B,n.rounding=1,r=D(n,er(n,r)),n.precision=e,n.rounding=t,U(2==a||3==a?r.neg():r,e,t,!0)):new n(1):new n(NaN)},P.cubeRoot=P.cbrt=function(){var e,t,r,n,i,o,s,a,c,u,l=this,h=l.constructor;if(!l.isFinite()||l.isZero())return new h(l);for(d=!1,(o=l.s*w(l.s*l,1/3))&&Math.abs(o)!=1/0?n=new h(o.toString()):(r=R(l.d),(o=((e=l.e)-r.length+1)%3)&&(r+=1==o||-2==o?"0":"00"),o=w(r,1/3),e=m((e+1)/3)-(e%3==(e<0?-1:2)),(n=new h(r=o==1/0?"5e"+e:(r=o.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=l.s),s=(e=h.precision)+3;;)if(n=j((u=(c=(a=n).times(a).times(a)).plus(l)).plus(l).times(a),u.plus(c),s+2,1),R(a.d).slice(0,s)===(r=R(n.d)).slice(0,s)){if("9999"!=(r=r.slice(s-3,s+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(U(n,e+1,1),t=!n.times(n).times(n).eq(l));break}if(!i&&(U(a,e+1,0),a.times(a).times(a).eq(l))){n=a;break}s+=4,i=1}return d=!0,U(n,e,h.rounding,t)},P.decimalPlaces=P.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-m(this.e/B))*B,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},P.dividedBy=P.div=function(e){return j(this,new this.constructor(e))},P.dividedToIntegerBy=P.divToInt=function(e){var t=this,r=t.constructor;return U(j(t,new r(e),0,1,1),r.precision,r.rounding)},P.equals=P.eq=function(e){return 0===this.cmp(e)},P.floor=function(){return U(new this.constructor(this),this.e+1,3)},P.greaterThan=P.gt=function(e){return this.cmp(e)>0},P.greaterThanOrEqualTo=P.gte=function(e){var t=this.cmp(e);return 1==t||0===t},P.hyperbolicCosine=P.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?t=(1/et(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=ee(s,1,o.times(t),new s(1),!0);for(var c,u=e,l=new s(8);u--;)c=o.times(o),o=a.minus(c.times(l.minus(c.times(l))));return U(o,s.precision=r,s.rounding=n,!0)},P.hyperbolicSine=P.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=ee(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=ee(o,2,i=i.times(1/et(5,e)),i,!0);for(var s,a=new o(5),c=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(c.times(s).plus(u))))}return o.precision=t,o.rounding=r,U(i,t,r,!0)},P.hyperbolicTangent=P.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,j(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},P.inverseCosine=P.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return -1!==n?0===n?t.isNeg()?z(r,i,o):new r(0):new r(NaN):t.isZero()?z(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=z(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))},P.inverseHyperbolicCosine=P.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,d=!1,r=r.times(r).minus(1).sqrt().plus(r),d=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},P.inverseHyperbolicSine=P.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,d=!1,r=r.times(r).plus(1).sqrt().plus(r),d=!0,n.precision=e,n.rounding=t,r.ln())},P.inverseHyperbolicTangent=P.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,Math.max(n=i.sd(),e)<-(2*i.e)-1)?U(new o(i),e,t,!0):(o.precision=r=n-i.e,i=j(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5)):new o(NaN)},P.inverseSine=P.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,-1!==t)?0===t?((e=z(o,r+4,n).times(.5)).s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2))},P.inverseTangent=P.atan=function(){var e,t,r,n,i,o,s,a,c,u=this,l=u.constructor,h=l.precision,f=l.rounding;if(u.isFinite()){if(u.isZero())return new l(u);if(u.abs().eq(1)&&h+4<=O)return(s=z(l,h+4,f).times(.25)).s=u.s,s}else{if(!u.s)return new l(NaN);if(h+4<=O)return(s=z(l,h+4,f).times(.5)).s=u.s,s}for(l.precision=a=h+10,l.rounding=1,e=r=Math.min(28,a/B+2|0);e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(d=!1,t=Math.ceil(a/B),n=1,c=u.times(u),s=new l(u),i=u;-1!==e;)if(i=i.times(c),o=s.minus(i.div(n+=2)),i=i.times(c),void 0!==(s=o.plus(i.div(n+=2))).d[t])for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isPositive=P.isPos=function(){return this.s>0},P.isZero=function(){return!!this.d&&0===this.d[0]},P.lessThan=P.lt=function(e){return 0>this.cmp(e)},P.lessThanOrEqualTo=P.lte=function(e){return 1>this.cmp(e)},P.logarithm=P.log=function(e){var t,r,n,i,o,s,a,c,u=this,l=u.constructor,h=l.precision,f=l.rounding,p=5;if(null==e)e=new l(10),t=!0;else{if(r=(e=new l(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new l(r&&!r[0]?-1/0:1!=u.s?NaN:r?0:1/0);if(t){if(r.length>1)o=!0;else{for(i=r[0];i%10==0;)i/=10;o=1!==i}}if(d=!1,N((c=j(s=V(u,a=h+p),n=t?W(l,a+10):V(e,a),a,1)).d,i=h,f))do if(a+=10,c=j(s=V(u,a),n=t?W(l,a+10):V(e,a),a,1),!o){+R(c.d).slice(i+1,i+15)+1==1e14&&(c=U(c,h+1,0));break}while(N(c.d,i+=10,f));return d=!0,U(c,h,f)},P.minus=P.sub=function(e){var t,r,n,i,o,s,a,c,u,l,h,f,p=this,y=p.constructor;if(e=new y(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new y(e.d||p.s!==e.s?p:NaN):e=new y(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(u=p.d,f=e.d,a=y.precision,c=y.rounding,!u[0]||!f[0]){if(f[0])e.s=-e.s;else{if(!u[0])return new y(3===c?-0:0);e=new y(p)}return d?U(e,a,c):e}if(r=m(e.e/B),l=m(p.e/B),u=u.slice(),o=l-r){for((h=o<0)?(t=u,o=-o,s=f.length):(t=f,r=l,s=u.length),o>(n=Math.max(Math.ceil(a/B),s)+2)&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for((h=(n=u.length)<(s=f.length))&&(s=n),n=0;n0;--n)u[s++]=0;for(n=f.length;n>o;){if(u[--n](s=(o=Math.ceil(a/B))>s?o+1:s+1)&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((s=u.length)-(i=l.length)<0&&(i=s,r=l,l=u,u=r),t=0;i;)t=(u[--i]=u[i]+l[i]+t)/T|0,u[i]%=T;for(t&&(u.unshift(t),++n),s=u.length;0==u[--s];)u.pop();return e.d=u,e.e=L(u,n),d?U(e,a,c):e},P.precision=P.sd=function(e){var t,r=this;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(g+e);return r.d?(t=K(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},P.round=function(){var e=this,t=e.constructor;return U(new t(e),e.e+1,t.rounding)},P.sine=P.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+B,n.rounding=1,r=Q(n,er(n,r)),n.precision=e,n.rounding=t,U(a>2?r.neg():r,e,t,!0)):new n(NaN)},P.squareRoot=P.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,c=s.e,u=s.s,l=s.constructor;if(1!==u||!a||!a[0])return new l(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(d=!1,0==(u=Math.sqrt(+s))||u==1/0?(((t=R(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(t),c=m((c+1)/2)-(c<0||c%2),n=new l(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new l(u.toString()),r=(c=l.precision)+3;;)if(n=(o=n).plus(j(s,o,r+2,1)).times(.5),R(o.d).slice(0,r)===(t=R(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(U(n,c+1,1),e=!n.times(n).eq(s));break}if(!i&&(U(o,c+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}return d=!0,U(n,c,l.rounding,e)},P.tangent=P.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=j(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,U(2==a||4==a?r.neg():r,e,t,!0)):new n(NaN)},P.times=P.mul=function(e){var t,r,n,i,o,s,a,c,u,l=this,h=l.constructor,f=l.d,p=(e=new h(e)).d;if(e.s*=l.s,!f||!f[0]||!p||!p[0])return new h(e.s&&(!f||f[0]||p)&&(!p||p[0]||f)?f&&p?0*e.s:e.s/0:NaN);for(r=m(l.e/B)+m(e.e/B),(c=f.length)<(u=p.length)&&(o=f,f=p,p=o,s=c,c=u,u=s),o=[],n=s=c+u;n--;)o.push(0);for(n=u;--n>=0;){for(t=0,i=c+n;i>n;)a=o[i]+p[n]*f[i-n-1]+t,o[i--]=a%T|0,t=a/T|0;o[i]=(o[i]+t)%T|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=L(o,r),d?U(e,h.precision,h.rounding):e},P.toBinary=function(e,t){return en(this,2,e,t)},P.toDecimalPlaces=P.toDP=function(e,t){var r=this,n=r.constructor;return(r=new n(r),void 0===e)?r:(C(e,0,u),void 0===t?t=n.rounding:C(t,0,8),U(r,e+r.e+1,t))},P.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=F(n,!0):(C(e,0,u),void 0===t?t=i.rounding:C(t,0,8),r=F(n=U(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},P.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return void 0===e?r=F(i):(C(e,0,u),void 0===t?t=o.rounding:C(t,0,8),r=F(n=U(new o(i),e+i.e+1,t),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},P.toFraction=function(e){var t,r,n,i,o,s,a,c,u,l,h,f,p=this,y=p.d,_=p.constructor;if(!y)return new _(p);if(u=r=new _(1),n=c=new _(0),s=(o=(t=new _(n)).e=K(y)-p.e-1)%B,t.d[0]=w(10,s<0?B+s:s),null==e)e=o>0?t:u;else{if(!(a=new _(e)).isInt()||a.lt(u))throw Error(g+a);e=a.gt(t)?o>0?t:u:a}for(d=!1,a=new _(R(y)),l=_.precision,_.precision=o=y.length*B*2;h=j(a,t,0,1,1),1!=(i=r.plus(h.times(n))).cmp(e);)r=n,n=i,i=u,u=c.plus(h.times(i)),c=i,i=t,t=a.minus(h.times(i)),a=i;return i=j(e.minus(r),n,0,1,1),c=c.plus(i.times(u)),r=r.plus(i.times(n)),c.s=u.s=p.s,f=1>j(u,n,o,1).minus(p).abs().cmp(j(c,r,o,1).minus(p).abs())?[u,n]:[c,r],_.precision=l,d=!0,f},P.toHexadecimal=P.toHex=function(e,t){return en(this,16,e,t)},P.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:C(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(d=!1,r=j(r,e,0,t,1).times(e),d=!0,U(r)):(e.s=r.s,r=e),r},P.toNumber=function(){return+this},P.toOctal=function(e,t){return en(this,8,e,t)},P.toPower=P.pow=function(e){var t,r,n,i,o,s,a=this,c=a.constructor,u=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(w(+a,u));if((a=new c(a)).eq(1))return a;if(n=c.precision,o=c.rounding,e.eq(1))return U(a,n,o);if((t=m(e.e/B))>=e.d.length-1&&(r=u<0?-u:u)<=A)return i=q(c,a,r,n),e.s<0?new c(1).div(i):U(i,n,o);if((s=a.s)<0){if(tc.maxE+1||t0?s/0:0):(d=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),(i=$(e.times(V(a,n+r)),n)).d&&N((i=U(i,n+5,1)).d,n,o)&&(t=n+10,+R((i=U($(e.times(V(a,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=U(i,n+1,0))),i.s=s,d=!0,c.rounding=o,U(i,n,o))},P.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=F(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(C(e,1,u),void 0===t?t=i.rounding:C(t,0,8),r=F(n=U(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},P.toSignificantDigits=P.toSD=function(e,t){var r=this,n=r.constructor;return void 0===e?(e=n.precision,t=n.rounding):(C(e,1,u),void 0===t?t=n.rounding:C(t,0,8)),U(new n(r),e,t)},P.toString=function(){var e=this,t=e.constructor,r=F(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},P.truncated=P.trunc=function(){return U(new this.constructor(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var e=this,t=e.constructor,r=F(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var j=function(){function e(e,t,r){var n,i=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+i,e[o]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;)e.shift()}return function(n,i,o,a,c,u){var l,h,f,p,d,y,g,_,v,b,w,S,E,k,x,A,M,O,P,R,C=n.constructor,N=n.s==i.s?1:-1,I=n.d,D=i.d;if(!I||!I[0]||!D||!D[0])return new C(n.s&&i.s&&(I?!D||I[0]!=D[0]:D)?I&&0==I[0]||!D?0*N:N/0:NaN);for(u?(d=1,h=n.e-i.e):(u=T,d=B,h=m(n.e/d)-m(i.e/d)),P=D.length,M=I.length,b=(v=new C(N)).d=[],f=0;D[f]==(I[f]||0);f++);if(D[f]>(I[f]||0)&&h--,null==o?(k=o=C.precision,a=C.rounding):k=c?o+(n.e-i.e)+1:o,k<0)b.push(1),y=!0;else{if(k=k/d+2|0,f=0,1==P){for(p=0,D=D[0],k++;(f1&&(D=e(D,p,u),I=e(I,p,u),P=D.length,M=I.length),A=P,S=(w=I.slice(0,P)).length;S=u/2&&++O;do p=0,(l=t(D,w,P,S))<0?(E=w[0],P!=S&&(E=E*u+(w[1]||0)),(p=E/O|0)>1?(p>=u&&(p=u-1),_=(g=e(D,p,u)).length,S=w.length,1==(l=t(g,w,_,S))&&(p--,r(g,P<_?R:D,_,u))):(0==p&&(l=p=1),g=D.slice()),(_=g.length)=10;p/=10)f++;v.e=f+h*d-1,U(v,c?o+v.e+1:o,a,y)}return v}}();function U(e,t,r,n){var i,o,s,a,c,u,l,h,f,p=e.constructor;e:if(null!=t){if(!(h=e.d))return e;for(i=1,a=h[0];a>=10;a/=10)i++;if((o=t-i)<0)o+=B,s=t,c=(l=h[f=0])/w(10,i-s-1)%10|0;else if((f=Math.ceil((o+1)/B))>=(a=h.length)){if(n){for(;a++<=f;)h.push(0);l=c=0,i=1,o%=B,s=o-B+1}else break e}else{for(i=1,l=a=h[f];a>=10;a/=10)i++;o%=B,c=(s=o-B+i)<0?0:l/w(10,i-s-1)%10|0}if(n=n||t<0||void 0!==h[f+1]||(s<0?l:l%w(10,i-s-1)),u=r<4?(c||n)&&(0==r||r==(e.s<0?3:2)):c>5||5==c&&(4==r||n||6==r&&(o>0?s>0?l/w(10,i-s):0:h[f-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=w(10,(B-t%B)%B),e.e=-t||0):h[0]=e.e=0,e;if(0==o?(h.length=f,a=1,f--):(h.length=f+1,a=w(10,B-o),h[f]=s>0?(l/w(10,i-s)%w(10,s)|0)*a:0),u)for(;;){if(0==f){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==T&&(h[0]=1));break}if(h[f]+=a,h[f]!=T)break;h[f--]=0,a=1}for(o=h.length;0===h[--o];)h.pop()}return d&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+H(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+H(-i-1)+o,r&&(n=r-s)>0&&(o+=H(n))):i>=s?(o+=H(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+H(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=H(n))),o}function L(e,t){var r=e[0];for(t*=B;r>=10;r/=10)t++;return t}function W(e,t,r){if(t>M)throw d=!0,r&&(e.precision=r),Error(_);return U(new e(h),t,1,!0)}function z(e,t,r){if(t>O)throw Error(_);return U(new e(f),t,r,!0)}function K(e){var t=e.length-1,r=t*B+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function H(e){for(var t="";e--;)t+="0";return t}function q(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/B+4);for(d=!1;;){if(r%2&&ei((o=o.times(t)).d,s)&&(i=!0),0===(r=m(r/2))){r=o.d.length-1,i&&0===o.d[r]&&++o.d[r];break}ei((t=t.times(t)).d,s)}return d=!0,o}function Y(e){return 1&e.d[e.d.length-1]}function G(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(null==t?(d=!1,c=y):c=t,a=new f(.03125);e.e>-2;)e=e.times(a),h+=5;for(c+=n=Math.log(w(2,h))/Math.LN10*2+5|0,r=o=s=new f(1),f.precision=c;;){if(o=U(o.times(e),c,1),r=r.times(++l),R((a=s.plus(j(o,r,c,1))).d).slice(0,c)===R(s.d).slice(0,c)){for(i=h;i--;)s=U(s.times(s),c,1);if(null!=t)return f.precision=y,s;if(!(u<3&&N(s.d,c-n,p,u)))return U(s,f.precision=y,p,d=!0);f.precision=c+=10,r=o=a=new f(1),l=0,u++}s=a}}function V(e,t){var r,n,i,o,s,a,c,u,l,h,f,p=1,y=10,g=e,_=g.d,v=g.constructor,b=v.rounding,m=v.precision;if(g.s<0||!_||!_[0]||!g.e&&1==_[0]&&1==_.length)return new v(_&&!_[0]?-1/0:1!=g.s?NaN:_?0:g);if(null==t?(d=!1,l=m):l=t,v.precision=l+=y,n=(r=R(_)).charAt(0),!(15e14>Math.abs(o=g.e)))return u=W(v,l+2,m).times(o+""),g=V(new v(n+"."+r.slice(1)),l-y).plus(u),v.precision=m,null==t?U(g,m,b,d=!0):g;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=R((g=g.times(e)).d)).charAt(0),p++;for(o=g.e,n>1?(g=new v("0."+r),o++):g=new v(n+"."+r.slice(1)),h=g,c=s=g=j(g.minus(1),g.plus(1),l,1),f=U(g.times(g),l,1),i=3;;){if(s=U(s.times(f),l,1),R((u=c.plus(j(s,new v(i),l,1))).d).slice(0,l)===R(c.d).slice(0,l)){if(c=c.times(2),0!==o&&(c=c.plus(W(v,l+2,m).times(o+""))),c=j(c,new v(p),l,1),null!=t)return v.precision=m,c;if(!N(c.d,l-y,b,a))return U(c,v.precision=m,b,d=!0);v.precision=l+=y,u=s=g=j(h.minus(1),h.plus(1),l,1),f=U(g.times(g),l,1),i=a=1}c=u,i+=2}}function Z(e){return String(e.s*e.s/0)}function J(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%B,r<0&&(n+=B),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),x.test(t))return J(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(E.test(t))r=16,t=t.toLowerCase();else if(S.test(t))r=2;else if(k.test(t))r=8;else throw Error(g+t);for((s=t.search(/p/i))>0?(u=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),a=(s=t.indexOf("."))>=0,n=e.constructor,a&&(s=(c=(t=t.replace(".","")).length)-s,i=q(n,new n(r),s,2*s)),s=h=(l=I(t,r,T)).length-1;0===l[s];--s)l.pop();return s<0?new n(0*e.s):(e.e=L(l,h),e.d=l,d=!1,a&&(e=j(e,i,4*c)),u&&(e=e.times(54>Math.abs(u)?w(2,u):o.pow(2,u))),d=!0,e)}function Q(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ee(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=ee(e,2,t=t.times(1/et(5,r)),t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function ee(e,t,r,n,i){var o,s,a,c,u=e.precision,l=Math.ceil(u/B);for(d=!1,c=r.times(r),a=new e(n);;){if(s=j(a.times(c),new e(t++*t++),u,1),a=i?n.plus(s):n.minus(s),n=j(s.times(c),new e(t++*t++),u,1),void 0!==(s=a.plus(n)).d[l]){for(o=l;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=n,n=s,s=o}return d=!0,s.d.length=l+1,s}function et(e,t){for(var r=e;--t;)r*=e;return r}function er(e,t){var r,n=t.s<0,i=z(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return a=n?4:1,t;if((r=t.divToInt(i)).isZero())a=n?3:2;else{if((t=t.minus(r.times(i))).lte(o))return a=Y(r)?n?2:3:n?4:1,t;a=Y(r)?n?1:4:n?3:2}return t.minus(i).abs()}function en(e,t,r,n){var i,o,a,c,h,f,p,d,y,g=e.constructor,_=void 0!==r;if(_?(C(r,1,u),void 0===n?n=g.rounding:C(n,0,8)):(r=g.precision,n=g.rounding),e.isFinite()){for(a=(p=F(e)).indexOf("."),_?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,a>=0&&(p=p.replace(".",""),(y=new g(1)).e=p.length-a,y.d=I(F(y),10,i),y.e=y.d.length),o=h=(d=I(p,10,i)).length;0==d[--h];)d.pop();if(d[0]){if(a<0?o--:((e=new g(e)).d=d,e.e=o,d=(e=j(e,y,r,n,0,i)).d,o=e.e,f=s),a=d[r],c=i/2,f=f||void 0!==d[r+1],f=n<4?(void 0!==a||f)&&(0===n||n===(e.s<0?3:2)):a>c||a===c&&(4===n||f||6===n&&1&d[r-1]||n===(e.s<0?8:7)),d.length=r,f)for(;++d[--r]>i-1;)d[r]=0,r||(++o,d.unshift(1));for(h=d.length;!d[h-1];--h);for(a=0,p="";a1){if(16==t||8==t){for(a=16==t?4:3,--h;h%a;h++)p+="0";for(h=(d=I(p,i,t)).length;!d[h-1];--h);for(a=1,p="1.";ah)for(o-=h;o--;)p+="0";else ot)return e.length=t,!0}function eo(e){return new this(e).abs()}function es(e){return new this(e).acos()}function ea(e){return new this(e).acosh()}function ec(e,t){return new this(e).plus(t)}function eu(e){return new this(e).asin()}function el(e){return new this(e).asinh()}function eh(e){return new this(e).atan()}function ef(e){return new this(e).atanh()}function ep(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?z(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=z(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,r=this.atan(j(e,t,o,1)),t=z(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(j(e,t,o,1)):(r=z(this,o,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function ed(e){return new this(e).cbrt()}function ey(e){return U(e=new this(e),e.e+1,2)}function eg(e,t,r){return new this(e).clamp(t,r)}function e_(e){if(!e||"object"!=typeof e)throw Error(y+"Object expected");var t,r,n,i=!0===e.defaults,o=["precision",1,u,"rounding",0,8,"toExpNeg",-c,0,"toExpPos",0,c,"maxE",0,c,"minE",-c,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(g+r+": "+n)}if(r="crypto",i&&(this[r]=p[r]),void 0!==(n=e[r])){if(!0===n||!1===n||0===n||1===n){if(n){if("undefined"!=typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(v)}else this[r]=!1}else throw Error(g+r+": "+n)}return this}function ev(e){return new this(e).cos()}function eb(e){return new this(e).cosh()}function em(e){var t,r,n;function i(e){var t,r,n,o=this;if(!(o instanceof i))return new i(e);if(o.constructor=i,ex(e)){o.s=e.s,d?!e.d||e.e>i.maxE?(o.e=NaN,o.d=null):e.e=10;r/=10)t++;d?t>i.maxE?(o.e=NaN,o.d=null):t=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(v)}else for(;o=10;i/=10)n++;n3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!s&&s(e,t);if(n)n(e,t,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else e[t]=r}},45230:function(e,t,r){!function(t,n){"use strict";e.exports?e.exports=n(r(77085)):t.ed2curve=n(t.nacl)}(this,function(e){"use strict";if(!e)throw Error("tweetnacl not loaded");var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t=0;n--)f(i,i),2!==n&&4!==n&&h(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function d(e,r){var n,i,o,c=t(),u=t();for(n=0;n<16;n++)u[n]=r[n];for(s(u),s(u),s(u),i=0;i<2;i++){for(n=1,c[0]=u[0]-65517;n<15;n++)c[n]=u[n]-65535-(c[n-1]>>16&1),c[n-1]&=65535;c[15]=u[15]-32767-(c[14]>>16&1),o=c[15]>>16&1,c[14]&=65535,a(u,c,1-o)}for(n=0;n<16;n++)e[2*n]=255&u[n],e[2*n+1]=u[n]>>8}function y(e){var t=new Uint8Array(32);return d(t,e),1&t[0]}function g(e,t,r,n,i){var o,s=0;for(o=0;o>>8)-1}function _(e,t,r,n){return g(e,t,r,n,32)}function v(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return d(r,e),d(n,t),_(r,0,n,0)}function b(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)f(i,i),1!==n&&h(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function m(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function w(e,s){var a=t(),p=t(),d=t(),g=t(),_=t(),w=t(),S=t();return(m(e[2],n),c(e[1],s),f(d,e[1]),h(g,d,i),l(d,d,e[2]),u(g,e[2],g),f(_,g),f(w,_),h(S,w,_),h(a,S,d),h(a,a,g),b(a,a),h(a,a,d),h(a,a,g),h(a,a,g),h(e[0],a,g),f(p,e[0]),h(p,p,g),v(p,d)&&h(e[0],e[0],o),f(p,e[0]),h(p,p,g),v(p,d))?-1:(y(e[0])===s[31]>>7&&l(e[0],r,e[0]),h(e[3],e[0],e[1]),0)}function S(e){var r=new Uint8Array(32),i=[t(),t(),t(),t()],o=t(),s=t();if(w(i,e))return null;var a=i[1];return u(o,n,a),l(s,n,a),p(s,s),h(o,o,s),d(r,o),r}function E(t){var r,n=new Uint8Array(64),i=new Uint8Array(32);for(e.lowlevel.crypto_hash(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,r=0;r<32;r++)i[r]=n[r];for(r=0;r<64;r++)n[r]=0;return i}function k(e){var t=S(e.publicKey);return t?{publicKey:t,secretKey:E(e.secretKey)}:null}return{convertPublicKey:S,convertSecretKey:E,convertKeyPair:k}})},7723:function(e,t,r){"use strict";var n=r(77323)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}e.exports=n},41479:function(e){"use strict";e.exports=EvalError},19509:function(e){"use strict";e.exports=Error},33231:function(e){"use strict";e.exports=RangeError},78531:function(e){"use strict";e.exports=ReferenceError},97422:function(e){"use strict";e.exports=SyntaxError},31354:function(e){"use strict";e.exports=TypeError},88150:function(e){"use strict";e.exports=URIError},68885:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};function i(e){console&&console.warn&&console.warn(e)}t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=v,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){if(c(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),a=s[t]),void 0===a)a=s[t]=r,++e._eventsCount;else if("function"==typeof a?a=s[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var o,s,a,l=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,i(l)}return e}function h(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?_(i):y(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=Array(t),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var s,a=Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else for(var u=c.length,l=y(c,u),r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():g(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},35609:function(e,t,r){"use strict";var n=r(70342),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(e,t,r){for(var n=0,i=e.length;n=3&&(o=r),"[object Array]"===i.call(e)?s(e,t,o):"string"==typeof e?a(e,t,o):c(e,t,o)};e.exports=u},42558:function(e){e.exports="object"==typeof self?self.FormData:window.FormData},78734:function(e){"use strict";var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,n=Math.max,i="[object Function]",o=function(e,t){for(var r=[],n=0;n1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=N(e),n=r.length>0?r[0]:"",i=I("%"+n+"%",t),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],A(r,B([0,1],l)));for(var h=1,f=!0;h=r.length){var _=p(s,d);s=(f=!!_)&&"get"in _&&!("originalValue"in _.get)?_.get:s[d]}else f=T(s,d),s=s[d];f&&!a&&(w[o]=s)}}return s}},55601:function(e,t,r){"use strict";var n=r(77323)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},24364:function(e,t,r){e.exports=r(90014)},90014:function(e,t,r){e=r.nmd(e),function(){function t(e,n){return n?r(3592)(e):e.slice?t[i(e)]:function(r,n){e(r={exports:{}}),t[i(n)]=r.exports};function i(e){return e.split("/").slice(-1).toString().replace(".js","")}}var n=e;t(function(e){String.random=function(e,t){var r="";for(e=e||24,t=t||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz";e-- >0;)r+=t.charAt(Math.floor(Math.random()*t.length));return r},String.match=function(e,t){var r,n;return"string"==typeof e&&("string"==typeof t&&(t={"=":t}),e===(r=(t=t||{})["="]||t["*"]||t[">"]||t["<"])||n===t["="]&&(r=t["*"]||t[">"],e.slice(0,(r||"").length)===r||n===t["*"]&&(n!==t[">"]&&n!==t["<"]?e>=t[">"]&&e<=t["<"]:n!==t[">"]&&e>=t[">"]||n!==t["<"]&&e<=t["<"])))},String.hash=function(e,t){if("string"==typeof e){if(t=t||0,!e.length)return t;for(var r=0,n=e.length;r=o.now()-r&&n++<3333){e();return}i(function(){r=o.now(),e()},n=0)}}(),function(){var e,t=setTimeout,r=t.turn=t.turn||function(e){1==n.push(e)&&i(s)},n=r.s=[],i=t.poll,o=0,s=function(){(e=n[o++])&&e(),(o==n.length||99==o)&&(n=r.s=n.slice(o),o=0),n.length&&i(s)}}(),function(){var e,t=setTimeout,r=t.turn;(t.each=t.each||function(t,n,i,o){o=o||9,function s(a,c,u){if(c=(a=(t||[]).splice(0,o)).length){for(var l=0;l"]||r;if(n)return"number"==typeof(n=n[t])?n:i},r.ify=function(e,t,r,i,o){(e=e||{})._=e._||{},o&&(e._["#"]=o);var s=e._[">"]||(e._[">"]={});return n!==t&&"_"!==t&&("number"==typeof r&&(s[t]=r),n!==i&&(e[t]=i)),e},e.exports=r})(t,"./state"),t(function(e){function r(e){var t={s:{}},r=t.s;e=e||{max:999,age:9e3},t.check=function(e){return!!r[e]&&n(e)};var n=t.track=function(i){var o=r[i]||(r[i]={});return o.was=t.now=+new Date,t.to||(t.to=setTimeout(t.drop,e.age+9)),n.ed&&n.ed(i),o};return t.drop=function(n){t.to=null,t.now=+new Date;var i=Object.keys(r);console.STAT&&console.STAT(t.now,+new Date-t.now,"dup drop keys"),setTimeout.each(i,function(i){var o=r[i];o&&(n||e.age)>t.now-o.was||delete r[i]},0,99)},t}t("./shim"),e.exports=r})(t,"./dup"),t(function(e){t("./onto"),e.exports=function(e,t){if(this.on){var n=(this.opt||{}).lack||9e3;if("function"!=typeof e){if(!e)return;var i=e["#"]||e,o=(this.tag||"")[i];if(!o)return;return t&&(clearTimeout((o=this.on(i,t)).err),o.err=setTimeout(function(){o.off()},n)),!0}var i=t&&t["#"]||r(9);if(!e)return i;var s=this.on(i,e,t);return s.err=s.err||setTimeout(function(){s.off(),s.next({err:"Error: No ACK yet.",lack:!0})},n),i}};var r=String.random||function(){return Math.random().toString(36).slice(2)}})(t,"./ask"),t(function(e){function r(e){return e instanceof r?(this._={$:this}).$:this instanceof r?r.create(this._={$:this,opt:e}):new r(e)}r.is=function(e){return e instanceof r||e&&e._&&e===e._.$||!1},r.version=.202,r.chain=r.prototype,r.chain.toJSON=function(){},t("./shim"),r.valid=t("./valid"),r.state=t("./state"),r.on=t("./onto"),r.dup=t("./dup"),r.ask=t("./ask"),function(){function e(n){if(n){if(n.out===e){this.to.next(n);return}var i,o=this,s=o.as,c=s.at||s,u=c.$,l=c.dup,h=n.DBG;if((i=n["#"])||(i=n["#"]=a(9)),!l.check(i)){if(l.track(i),i=n._,n._="function"==typeof i?i:function(){},n.$&&n.$===(n.$._||"").$||(n.$=u),n["@"]&&!n.put&&p(n),!c.ask(n["@"],n)){if(h&&(h.u=+new Date),n.put){t(n);return}n.get&&r.on.get(n,u)}h&&(h.uc=+new Date),o.to.next(n),h&&(h.ua=+new Date),n.nts||n.NTS||(n.out=e,c.on("out",n),h&&(h.ue=+new Date))}}}function t(t){if(t){var r=t._||"",o=r.root=((r.$=t.$||"")._||"").root;if(t["@"]&&r.faith&&!r.miss){t.out=e,o.on("out",t);return}r.latch=o.hatch,r.match=o.hatch=[];var a=t.put,l=r.DBG=t.DBG,h=+new Date;if(y=y||h,!a["#"]||!a["."]){l&&(l.p=h),r["#"]=t["#"],r.msg=t,r.all=0,r.stun=1;var f=Object.keys(a);console.STAT&&console.STAT(h,((l||r).pk=+new Date)-h,"put sort");var p,d,v,b,m,S,E,k=0;!function e(o){if(p!=k){if(p=k,!(v=f[k])){console.STAT&&console.STAT(h,((l||r).pd=+new Date)-h,"put"),s(r);return}(b=a[v])?(E=b._)?v!==E["#"]?S=g+_(v)+"soul not same.":(m=E[">"])||(S=g+_(v)+"no state."):S=g+_(v)+"no meta.":S=g+_(v)+"no node.",d=Object.keys(b||{})}if(S){t.err=r.err=S,s(r);return}var y,x=0;for(o=o||0;o++<9&&(y=d[x++]);)if("_"!==y){var T=b[y],B=m[y];if(i===B){S=g+_(y)+"on"+_(v)+"no state.";break}if(!u(T)){S=g+_(y)+"on"+_(v)+"bad "+typeof T+_(T);break}n(T,y,v,B,t),++w}if((d=d.slice(x)).length){c(e);return}++k,d=null,e(o)}()}}}function n(e,t,r,i,o){var s,a=o._||"",c=a.root,u=c.graph,h=u[r]||f,p=l(h,t,1),d=h[t],y=a.DBG;(s=console.STAT)&&(!u[r]||!d)&&(s.has=(s.has||0)+1);var g=m();if(i>g){setTimeout(function(){n(e,t,r,i,o)},(s=i-g)>b?b:s),console.STAT&&console.STAT((y||a).Hf=+new Date,s,"future");return}if(!(i":i},ok:o.ok,_:a})}}function o(e){(t=(e._||"").DBG)&&(t.pa=+new Date,t.pm=t.pm||+new Date);var t,r,n=this,i=n.as,o=i.graph,a=e._,c=e.put,u=c["#"],l=c["."],f=c[":"],p=c[">"];e["#"],(r=a.msg)&&(r=r.put)&&(r=r[u])&&h(r,l,p,f,u),o[u]=h(o[u],l,p,f,u),(r=(i.next||"")[u])&&r.on("in",e),s(a),n.to.next(e)}function s(t,r){if(!(t.stop||!t.err&&0<--t.stun)&&(t.stop=1,n=t.root)){var n,i=t.match;i.end=1,i===n.hatch&&((i=t.latch)&&!i.end?n.hatch=i:delete n.hatch),t.hatch&&t.hatch(),setTimeout.each(t.match,function(e){e&&e()}),(r=t.msg)&&!t.err&&!r.err&&(r.out=e,t.root.on("out",r),S())}}function p(e){var t,r=e["@"]||"";if(!(t=r._)){var n=(n=e.$)&&(n=n._)&&(n=n.root)&&(n=n.dup);if(!(n=n.check(r)))return;e["@"]=n["#"]||e["@"];return}t.acks=(t.acks||0)+1,(t.err=e.err)&&(e["@"]=t["#"],s(t)),t.ok=e.ok||t.ok,t.stop||t.crack||(t.crack=t.match&&t.match.push(function(){d(t)})),d(t)}function d(e){e&&e.root&&!e.stun&&e.acks===e.all&&e.root.on("in",{"@":e["#"],err:e.err,ok:e.err?i:e.ok||{"":1}})}r.create=function(t){t.root=t.root||t,t.graph=t.graph||{},t.on=t.on||r.on,t.ask=t.ask||r.ask,t.dup=t.dup||r.dup();var n=t.$.opt(t.opt);return t.once||(t.on("in",e,t),t.on("out",e,t),t.on("put",o,t),r.on("create",t),t.on("create",t)),t.once=1,n},r.on.put=t;var y,g="Error: Invalid graph!",_=function(e){return" '"+(""+e).slice(0,9)+"...' "},v=JSON.stringify,b=2147483647,m=r.state,w=0,S=function(){w>999&&-(w/(y-(y=+new Date)))>1&&(r.window&&console.log("Warning: You're syncing 1K+ records a second, faster than DOM can update - consider limiting query."),S=function(){w=0})}}(),function(){function e(e,t){var r=+new Date,n=e._||{},o=n.DBG=e.DBG,s=e["#"],c=a(9),u=Object.keys(t||"").sort(),f=((t||"")._||"")["#"],p=(u.length,e.$._.root),d=t===p.graph[f];console.STAT&&console.STAT(r,((o||n).gk=+new Date)-r,"got keys"),t&&function e(){r=+new Date;for(var n,y,g,_=0,v={};_<9&&(y=u[_++]);)h(v,y,l(t,y),t[y],f);u=u.slice(_),(g={})[f]=v,v=g,d&&((n=function(){}).ram=n.faith=!0),g=u.length,console.STAT&&console.STAT(r,-(r-(r=+new Date)),"got copied some"),o&&(o.ga=+new Date),p.on("in",{"@":s,"#":c,put:v,"%":g?c=a(9):i,$:p.$,_:n,DBG:o,FOO:1}),console.STAT&&console.STAT(r,+new Date-r,"got in"),g&&setTimeout.turn(e)}(),t||p.on("in",{"@":e["#"]})}r.on.get=function(t,r){var n=r._,o=t.get,s=o["#"],a=n.graph[s],c=o["."],u=(n.next||(n.next={}))[s],f=(t._||{}).DBG=t.DBG;if(f&&(f.g=+new Date),!a)return n.on("get",t);if(c){if(("string"!=typeof c||i===a[c])&&!((u||"").next||"")[c]){n.on("get",t);return}a=h({},c,l(a,c),a[c],s)}a&&e(t,a),n.on("get",t)},r.on.get.ack=e}(),function(){r.chain.opt=function(e){e=e||{};var t=this,n=t._,i=e.peers||e;return Object.plain(e)||(e={}),Object.plain(n.opt)||(n.opt=e),"string"==typeof i&&(i=[i]),Object.plain(n.opt.peers)||(n.opt.peers={}),i instanceof Array&&(e.peers={},i.forEach(function(t){var r={};r.id=r.url=t,e.peers[t]=n.opt.peers[t]=n.opt.peers[t]||r})),s(e,function e(t){var r=this[t];if(this&&this.hasOwnProperty(t)||"string"==typeof r||Object.empty(r)){this[t]=r;return}(!r||r.constructor===Object||r instanceof Array)&&s(r,e)}),n.opt.from=e,r.on("opt",n),n.opt.uuid=n.opt.uuid||function(e){return r.state().toString(36).replace(".","")+String.random(e||12)},t}}();var i,o,s=function(e,t){Object.keys(e).forEach(t,e)},a=String.random,c=setTimeout.turn,u=r.valid,l=r.state.is,h=r.state.ify,f={};r.log=function(){return r.log.off||o.log.apply(o,arguments),[].slice.call(arguments).join(" ")},r.log.once=function(e,t,n){return(n=r.log.once)[e]=n[e]||0,n[e]++||r.log(t)},"undefined"!=typeof window&&((window.GUN=window.Gun=r).window=window);try{void 0!==n&&(n.exports=r)}catch(e){}e.exports=r,(r.window||{}).console=(r.window||{}).console||{log:function(){}},(o=console).only=function(e,t){return o.only.i&&e===o.only.i&&o.only.i++&&(o.log.apply(o,arguments)||t)},r.log.once("welcome","Hello wonderful person! :) Thanks for using GUN, please ask for help on http://chat.gun.eco if anything takes you longer than 5min to figure out!")})(t,"./root"),t(function(e){t("./root").chain.back=function(e,t){if(-1===(e=e||1)||1/0===e)return this._.root.$;if(1===e)return(this._.back||this._).$;var i=this,o=i._;if("string"==typeof e&&(e=e.split(".")),e instanceof Array){for(var s=0,a=e.length,c=o;s":d(o.graph[i.soul],t)}}),r))return}else{if(r=i.ask&&i.ask[""],(i.ask||(i.ask={}))[""]=i,c!==i.put&&(i.on("in",i),r))return;e.$=i.$}return o.ask(a,e),o.on("in",e)}if(t["."])return n.get?(e={get:{".":n.get},$:n.$},(i.ask||(i.ask={}))[n.get]=e.$._):e={get:n.lex?e.get:{},$:n.$},i.on("out",e);(n.ask||(n.ask={}))[""]=n,n.get&&(t["."]=n.get,(i.ask||(i.ask={}))[n.get]=e.$._)}return i.on("out",e)}function i(e,t){var r,n=(t=t||this.as).root,i=e.$||(e.$=t.$),a=(i||"")._||u,l=e.put||"",f=l["#"],p=l["."],g=c!==l["="]?l["="]:l[":"],_=l[">"]||-1/0;if(c!==e.put&&(c===l["#"]||c===l["."]||c===l[":"]&&c===l["="]||c===l[">"])){if(!h(l)){if(!(f=((l||"")._||"")["#"])){console.log("chain not yet supported for",l,"...",e,t);return}return i=t.root.$.get(f),setTimeout.each(Object.keys(l).sort(),function(r){"_"!=r&&c!==(_=d(l,r))&&t.on("in",{$:i,put:{"#":f,".":r,"=":l[r],">":_},VIA:e})})}return void t.on("in",{$:a.back.$,put:{"#":f=a.back.soul,".":p=a.has||a.get,"=":l,">":d(a.back.put,p)},via:e})}(e.seen||"")[t.id]||((e.seen||(e.seen=function(){}))[t.id]=t,t!==a&&(Object.keys(e).forEach(function(t){l[t]=e[t]},l={}),l.get=t.get||l.get,t.soul||t.has?a.soul&&(l.$=t.$,l.$$=l.$$||a.$):l.$$$=l.$$$||t.$,e=l),s(e,t),(t.soul||e.$$)&&_>=d(n.graph[f],p)&&((l=n.$.get(f)._).put=y(l.put,p,_,g,f)),!a.soul&&_>=d(n.graph[f],p)&&(r=(n.$.get(f)._.next||"")[p])&&(r.put=g,"string"==typeof(l=h(g))&&(r.put=n.$.get(l)._.put||g)),this.to&&this.to.next(e),t.any&&setTimeout.each(Object.keys(t.any),function(r){(r=t.any[r])&&r(e)},0,99),t.echo&&setTimeout.each(Object.keys(t.echo),function(r){(r=t.echo[r])&&r.on("in",e)},0,99),((e.$$||"")._||a).soul&&(r=t.next)&&(r=r[p])&&(l={},Object.keys(e).forEach(function(t){l[t]=e[t]}),l.$=(e.$$||e.$).get(l.get=p),delete l.$$,delete l.$$$,r.on("in",l)),o(e,t))}function o(e,t){if(t=t||this.as||e.$._,(!e.$$||this===r.on)&&e.put&&!t.soul){var n,i=e.put||"",o=i["="]||i[":"],s=t.root,a=s.$.get(i["#"]).get(i["."])._;if("string"!=typeof(o=h(o))){this===r.on&&((a.echo||(a.echo={}))[t.id]=t);return}if(!(a.echo||(a.echo={}))[t.id]||(s.pass||"")[t.id]){if(n=s.pass){if(n[o+t.id])return;n[o+t.id]=1}(a.echo||(a.echo={}))[t.id]=t,t.has&&(t.link=o);var c=s.$.get(a.link=o)._;(c.echo||(c.echo={}))[a.id]=a;var n=t.ask||"";(n[""]||t.lex)&&c.on("out",{get:{"#":o}}),setTimeout.each(Object.keys(n),function(e,t){e&&(t=n[e])&&t.on("out",{get:{"#":o,".":e}})},0,99)}}}function s(e,t){var r,n,i=e.put||"",o=c!==i["="]?i["="]:i[":"],a=t.root;if(c===o){if(t.soul&&c!==t.put||(n=(e.$$||e.$||"")._||"",e["@"]&&(c!==n.put||c!==t.put)))return;(r=t.link||e.linked)&&delete(a.$.get(r)._.echo||"")[t.id],t.has&&(t.link=null),t.put=c,setTimeout.each(Object.keys(t.next||""),function(e,n){(n=t.next[e])&&(r&&delete(a.$.get(r).get(e)._.echo||"")[n.id],n.on("in",{get:e,put:c,$:n.$}))},0,99);return}!t.soul&&!e.$$&&(r=h(o),n=e.$._||"",(r!==n.link&&(!t.has||n.link)||(a.pass||"")[t.id]&&"string"!=typeof r)&&(delete(n.echo||"")[t.id],s({get:t.get,put:c,$:e.$,linked:e.linked=e.linked||n.link},t)))}function a(e,t){var n=this.as,i=n.$._,o=(i.root,n.get||""),s=(e.put||"")[o["#"]]||"";if(!e.put||"string"==typeof o["."]&&c===s[o["."]]){if(c!==i.put||!i.soul&&!i.has)return;i.ack=(i.ack||0)+1,i.on("in",{get:i.get,put:i.put=c,$:i.$,"@":e["@"]});return}(e._||{}).miss=1,r.on.put(e)}r.chain.chain=function(e){var t,n=this,i=n._,o=new(e||n).constructor(n),s=o._;return s.root=t=i.root,s.id=++t.once,s.back=n._,s.on=r.on,s.on("in",r.on.in,s),s.on("out",r.on.out,s),o},r.on.out=n,r.on.in=i,r.on.link=o,r.on.unlink=s;var c,u={},l=String.random,h=r.valid,f=function(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)},p=r.state,d=p.is,y=p.ify})(t,"./chain"),t(function(e){var r=t("./root");function n(e,t){var r=t._,n=r.next,i=t.chain()._;return n||(n=r.next={}),n[i.get=e]=i,t===r.root.$?i.soul=e:(r.soul||r.has)&&(i.has=e),i}function i(e,t,n,i){var o,a=e._,c=0;return(o=a.soul||a.link)?t(o,i,a):a.jam?a.jam.push([t,i]):(a.jam=[[t,i]],e.get(function(e,t){if(!(s===e.put&&!a.root.opt.super&&(o=Object.keys(a.root.opt.peers).length)&&++c<=o)){t.rid(e);var n,i=(i=e.$)&&i._||{},u=0;for(o=a.jam,delete a.jam;n=o[u++];){var l,h=n[0];n=n[1],h&&h(l=i.link||i.soul||r.valid(e.put)||((e.put||{})._||{})["#"],n,e,t)}}},{out:{get:{".":!0}}}),e)}function o(e){var t,r,n=this.at||this.on;if(!e||n.soul||n.has)return this.off();if(e=(e=(e=e.$||e)._||e).id){if(n.map,t=(r=this.seen||(this.seen={}))[e])return!0;r[e]=!0}}r.chain.get=function(e,t,u){var l,h;if("string"==typeof e){if(0==e.length)return(l=this.chain())._.err={err:r.log("0 length key!",e)},t&&t.call(l,l._.err),l;var f=this,p=f._;(l=(p.next||a)[e])||(l=e&&n(e,f)),l=l&&l.$}else if("function"==typeof e){if(!0===t)return i(this,e,t,u),this;l=this;var d,p=l._,y=t||{},g=p.root;y.at=p,y.ok=e;var _={};function v(e,t,n){if(!v.stun&&(!(o=g.pass)||o[d])){var i,o,a=e.$._,c=(e.$$||"")._,u=(c||a).put,l=!a.has&&!a.soul,h={};if((l||s===u)&&(u=s===((o=e.put)||"")["="]?s===(o||"")[":"]?o:o[":"]:o["="]),(i="string"==typeof(o=r.valid(u)))&&(u=s===(o=g.$.get(o)._.put)?y.not?s:u:o),!y.not||s!==u){if(s===y.stun){if((o=g.stun)&&o.on&&(p.$.back(function(e){if(o.on(""+e.id,h={}),(h.run||0)h.run&&((!h.stun||h.stun.end)&&(h.stun=o.on("stun"),h.stun=h.stun&&h.stun.last),h.stun&&!h.stun.end))){(h.stun.add||(h.stun.add={}))[d]=function(){v(e,t,1)};return}if(s===u&&(n=0),(o=g.hatch)&&!o.end&&s===y.hatch&&!n){if(_[a.$._.id])return;_[a.$._.id]=1,o.push(function(){v(e,t,1)});return}_={}}if(g.pass){if(g.pass[d+a.id])return;g.pass[d+a.id]=1}if(y.on){y.ok.call(a.$,u,a.get,e,t||v);return}if(y.v2020){y.ok(e,t||v);return}Object.keys(e).forEach(function(t){o[t]=e[t]},o={}),(e=o).put=u,y.ok.call(y.as,e,t||v)}}}return v.at=p,(p.any||(p.any={}))[d=String.random(7)]=v,v.off=function(){v.stun=1,p.any&&delete p.any[d]},v.rid=o,v.id=y.run||++g.once,h=g.pass,(g.pass={})[d]=1,y.out=y.out||{get:{}},p.on("out",y.out),g.pass=h,l}else{if("number"==typeof e)return this.get(""+e,t,u);if("string"==typeof(h=c(e)))return this.get(h,t,u);(h=this.get.next)&&(l=h(this,e))}return l?t&&"function"==typeof t&&l.get(t,u):((l=this.chain())._.err={err:r.log("Invalid get request!",e)},t&&t.call(l,l._.err)),l};var s,a={},c=r.valid})(t,"./get"),t(function(e){var r=t("./root");function n(e,t){if(t){t=(t._||"").id||t;var n,i=e.root.stun||(e.root.stun={on:r.on}),o={};e.stun||(e.stun=i.on("stun",function(){})),(n=i.on(""+t))&&n.the.last.next(o),o.run>=e.run||i.on(""+t,function(t){if(e.stun.end){this.off(),this.to.next(t);return}t.run=t.run||e.run,t.stun=t.stun||e.stun})}}function i(e){if(e.err){i.end(e.stun,e.root);return}if(!e.todo.length&&!e.end&&Object.empty(e.wait)){e.end=1;var t,n=e.$.back(-1)._,o=n.root,s=n.ask(function(t){o.on("ack",t),t.err&&!t.lack&&r.log(t),++a>(e.acks||0)&&this.off(),e.ack&&e.ack(t,this)},e.opt),a=0,c=e.stun;(t=function(){c&&(i.end(c,o),setTimeout.each(Object.keys(c=c.add||""),function(e){(e=c[e])&&e()}))}).hatch=t,e.ack&&!e.ok&&(e.ok=e.acks||9),e.via._.on("out",{put:e.out=e.graph,ok:e.ok&&{"@":e.ok+1},opt:e.opt,"#":s,_:t})}}function o(e){var t,r=e.via._;e.via=e.via.back(function(r){if(r.soul||!r.get)return r.$;t=e.data,(e.data={})[r.get]=t}),e.via&&e.via._.soul||(e.via=r.root.$.get(((e.data||"")._||"")["#"]||r.$.back("opt.uuid")())),e.via.put(e.data,e.ack,e)}function s(e,t){return e&&(t=e.constructor)&&t.name||typeof e}r.chain.put=function(e,t,c){var f=this,p=f._,d=p.root;(c=c||{}).root=p.root,c.run||(c.run=d.once),n(c,p.id),c.ack=c.ack||t,c.via=c.via||f,c.data=c.data||e,c.soul||(c.soul=p.soul||"string"==typeof t&&t);var y=c.state=c.state||r.state();return"function"==typeof e?e(function(e){c.data=e,f.put(a,a,c)}):c.soul?(c.$=d.$.get(c.soul),c.todo=[{it:c.data,ref:c.$}],c.turn=c.turn||u,c.ran=c.ran||i,function e(){var t,o,a,u,f,p=c.todo,d=p.pop(),g=d.it;if(d.ref&&d.ref._.id,n(c,d.ref),(u=d.todo)&&(g=g[o=u.pop()],u.length&&p.push(d)),o&&(p.path||(p.path=[])).push(o),!(t=l(g))&&!(f=r.is(g))){if(!Object.plain(g)){i.err(c,"Invalid data: "+s(g)+" at "+(c.via.back(function(e){e.get&&u.push(e.get)},u=[])||u.join("."))+"."+(p.path||[]).join("."));return}for(var _=c.seen||(c.seen=[]),v=_.length;v--;)if(g===(u=_[v]).it){t=g=u.link;break}}if(o&&t)d.node=h(d.node,o,y,g);else{if(!c.seen){i.err(c,"Data at root of graph must be a node (an object).");return}c.seen.push(a={it:g,link:{},todo:f?[]:Object.keys(g).sort().reverse(),path:(p.path||[]).slice(),up:d}),d.node=h(d.node,o,y,a.link),!f&&a.todo.length&&p.push(a);var b=c.seen.length;function m(e,t){var r=a.link["#"];t&&(t.off(),t.rid(e));var i=r||e.soul||(u=(e.$$||e.$)._||"").soul||u.link||((u=u.put||"")._||"")["#"]||u["#"]||((u=e.put||"")&&e.$$?u["#"]:(u["="]||u[":"]||"")["#"]);if(r||n(c,e.$),!i&&!d.link["#"]){(d.wait||(d.wait=[])).push(function(){m(e,t)});return}i||(i=[],(e.$$||e.$).back(function(e){if(u=e.soul||e.link)return i.push(u);i.push(e.get)}),i=i.reverse().join("/")),a.link["#"]=i,f||(((c.graph||(c.graph={}))[i]=a.node||(a.node={_:{}}))._["#"]=i),delete c.wait[b],a.wait&&setTimeout.each(a.wait,function(e){e&&e()}),c.ran(c)}(c.wait||(c.wait={}))[b]="",u=(a.ref=f?g:o?d.ref.get(o):d.ref)._,(u=g&&(g._||"")["#"]||u.soul||u.link)?m({soul:u}):a.ref.get(m,{run:c.run,v2020:1,out:{get:{".":" "}}})}if(!p.length)return c.ran(c);c.turn(e)}()):o(c),f},i.end=function(e,t){e.end=c,e.the.to===e&&e===e.the.last&&delete t.stun,e.off()},i.err=function(e,t){(e.ack||c).call(e,e.out={err:e.err=r.log(t)}),e.ran(e)};var a,c=function(){},u=setTimeout.turn,l=r.valid,h=r.state.ify})(t,"./put"),t(function(e){var r=t("./root");t("./chain"),t("./back"),t("./put"),t("./get"),e.exports=r})(t,"./index"),t(function(e){var r,n=t("./index");function i(e,t,r){return n.log.once("valonce","Chainable val is experimental, its behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it."),(r=e.chain())._.nix=e.once(function(e,t){r._.on("in",this._)}),r._.lex=e._.lex,r}n.chain.on=function(e,t,r,n){var i,o=this,s=o._;if(s.root,"string"==typeof e)return t?(i=s.on(e,t,r||s,n),r&&r.$&&(r.subs||(r.subs=[])).push(i),o):s.on(e);var a=t;return(a=!0===a?{change:!0}:a||{}).not=1,a.on=1,o.get(e,a),o},n.chain.once=function(e,t){if(t=t||{},!e)return i(this,t);var o,s=this,a=s._,c=a.root,u=(a.put,String.random(7));return s.get(function(i,s,l,h){var f=this,p=f._,d=p.one||(p.one={});if(!h.stun&&""!==d[u]){if(!0===(o=n.valid(i))){y();return}"string"!=typeof o&&(clearTimeout((a.one||"")[u]),clearTimeout(d[u]),d[u]=setTimeout(y,t.wait||99))}function y(g){if(p.has||p.soul||(p={put:i,get:s}),r===(o=p.put)&&(o=((l.$$||"")._||"").put),"string"==typeof n.valid(o)&&(o=c.$.get(o)._.put)===r&&!g){d[u]=setTimeout(function(){y(1)},t.wait||99);return}h.stun||""===d[u]||(d[u]="",(a.soul||a.has)&&h.off(),e.call(f,o,p.get),clearTimeout(d[u]))}},{on:1}),s},n.chain.off=function(){var e,t=this,r=t._,n=r.back;if(n)return r.ack=0,(e=n.next)&&e[r.get]&&delete e[r.get],(e=n.any)&&(delete n.any,n.any={}),(e=n.ask)&&delete e[r.get],(e=n.put)&&delete e[r.get],(e=r.soul)&&delete n.root.graph[e],(e=r.map)&&Object.keys(e).forEach(function(t,r){(r=e[t]).link&&n.root.$.get(r.link).off()}),(e=r.next)&&Object.keys(e).forEach(function(t,r){(r=e[t]).$.off()}),r.on("off",{}),t}})(t,"./on"),t(function(e){var r=t("./index"),n=r.chain.get.next;function i(e){this.to.next(e);var t,n=this.as,i=e.$._,o=e.put;(i.soul||e.$$)&&(!(t=n.lex)||String.match(e.get||(o||"")["."],t["."]||t["#"]||t))&&r.on.link(e,n)}r.chain.get.next=function(e,t){var r;return Object.plain(t)?(r=((r=t["#"])||"")["="]||r)?e.get(r):((r=e.chain()._).lex=t,e.on("in",function(e){String.match(e.get||(e.put||"")["."],t["."]||t["#"]||t)&&r.on("in",e),this.to.next(e)}),r.$):(n||s)(e,t)},r.chain.map=function(e,t,n){var a,c,u=this,l=u._;return(Object.plain(e)&&(a=e["."]?e:{".":e},e=o),e)?(r.log.once("mapfn","Map functions are experimental, their behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it."),c=u.chain(),u.map().on(function(t,n,i,a){var u=(e||s).call(this,t,n,i,a);if(o!==u){if(t===u)return c._.on("in",i);if(r.is(u))return c._.on("in",u._);var l={};Object.keys(i.put).forEach(function(e){l[e]=i.put[e]},l),l["="]=u,c._.on("in",{get:n,put:l})}})):(c=l.each)||((l.each=c=u.chain())._.lex=a||c._.lex||l.lex,c._.nix=u.back("nix"),u.on("in",i,c._)),c};var o,s=function(){}})(t,"./map"),t(function(e){var r=t("./index");r.chain.set=function(e,t,n){var i,o,s=this,a=s.back(-1);return(t=t||function(){},(n=n||{}).item=n.item||e,(i=((e||"")._||"")["#"])&&((e={})["#"]=i),"string"==typeof(o=r.valid(e)))?s.get(i=o).put(e,t,n):r.is(e)?(s.put(function(n){e.get(function(e,i,a){if(!e)return t.call(s,{err:r.log('Only a node can be linked! Not "'+a.put+'"!')});(o={})[e]={"#":e},n(o)},!0)}),e):(Object.plain(e)&&(e=a.get(i=s.back("opt.uuid")()).put(e)),s.get(i||a.back("opt.uuid")(7)).put(e,t,n))}})(t,"./set"),t(function(e){t("./shim");var r,n=function(){},i=JSON.parseAsync||function(e,t,r){var n,i=+new Date;try{t(n,JSON.parse(e,r),o.sucks(+new Date-i))}catch(e){t(e)}},o=JSON.stringifyAsync||function(e,t,r,n){var i,s=+new Date;try{t(i,JSON.stringify(e,r,n),o.sucks(+new Date-s))}catch(e){t(e)}};function s(e){var t=function(){},n=e.opt||{};n.log=n.log||console.log,n.gap=n.gap||n.wait||0,n.max=n.max||(n.memory?998001*n.memory:3e8)*.3,n.pack=n.pack||1e-4*n.max,n.puff=n.puff||9;var s=setTimeout.turn||setTimeout,a=e.dup,c=a.check,u=a.track,l=t.hear=function(e,r){if(e){if(n.max<=e.length)return t.say({dam:"!",err:"Message too big!"},r);t===this&&(l.d+=e.length||0,++l.c);var o,a=r.SH=+new Date,c=e[0];if("["===c){i(e,function(e,i){if(e||!i)return t.say({dam:"!",err:"DAM JSON parse error."},r);console.STAT&&console.STAT(+new Date,i.length,"# on hear batch");var o=n.puff;!function e(){for(var n,a=+new Date,c=0;ct.length):!!t.length)){if(!r)try{t=1===t.length?t[0]:JSON.stringify(t)}catch(e){return n.log("DAM JSON stringify error",e)}t&&f(t,e)}}function f(e,r){try{var n=r.wire;r.say?r.say(e):n.send&&n.send(e),t.say.d+=e.length||0,++t.say.c}catch(t){(r.queue=r.queue||[]).push(e)}}l.one=function(r,n,i){if(r.DBG&&(r.DBG=f={DBG:r.DBG}),f&&(f.h=i),f&&(f.hp=+new Date),(o=r["#"])||(o=r["#"]=String.random(9)),!((l=c(o))||(s=r["##"])&&(l=r["@"]||r.get&&o)&&a.check(h=l+s))){if((r._=function(){}).via=t.leap=n,(l=r["><"])&&"string"==typeof l&&l.slice(0,99).split(",").forEach(function(e){this[e]=1},r._.yo={}),l=r.dam){(l=t.hear[l])&&l(r,n,e),u(o);return}(l=r.ok)&&(r._.near=l["/"]);var o,s,l,h,f,i=+new Date;f&&(f.is=i),n.SI=o,u.ed=function(e){o===e&&(u.ed=0,(e=a.s[o])&&(e.via=n,r.get&&(e.it=r)))},e.on("in",t.last=r),f&&(f.hd=+new Date),console.STAT&&console.STAT(i,+new Date-i,r.get?"msg get":r.put?"msg put":"msg"),u(o),h&&u(h),t.leap=t.last=null}},l.c=l.d=0,function(){var e,i=0;function l(e,t){var r;return t instanceof Object?(Object.keys(t).sort().forEach(p,{to:r={},on:t}),r):t}function p(e){this.to[e]=this.on[e]}t.hash=function(e,r){var n,i,a,c=+new Date;o(e.put,function o(u,l){if(n=String.hash((i||(i=a=l||"")).slice(0,32768),n),i=i.slice(32768)){s(o,0);return}console.STAT&&console.STAT(c,+new Date-c,"say json+hash"),e._.$put=a,e["##"]=n,t.say(e,r),delete e._.$put},l)},t.say=function(o,c){if((l=this)&&(l=l.to)&&l.next&&l.next(o),!o)return!1;var l,p,d,y,g=o["@"],_=o._||(o._=function(){}),v=o.DBG,b=+new Date;if(_.y=_.y||b,!c&&v&&(v.y=b),(p=o["#"])||(p=o["#"]=String.random(9)),e||u(p),!(d=o["##"])&&r!==o.put&&!_.via&&g){t.hash(o,c);return}if(!c&&g&&(c=(l=a.s[g])&&(l.via||(l=l.it)&&(l=l._)&&l.via)||(l=t.last)&&g===l["#"]&&t.leap),!c&&g){if(a.s[g])return;return console.STAT&&console.STAT(+new Date,++i,"total no peer to ack to"),!1}if(g&&!o.put&&!d&&((a.s[g]||"").it||"")["##"])return!1;if(!c&&t.way)return t.way(o);if(v&&(v.yh=+new Date),!(y=_.raw)){t.raw(o,c);return}if(v&&(v.yr=+new Date),!c||!c.id){if(!Object.plain(c||n.peers))return!1;var b=+new Date;n.puff;var m=n.peers,w=Object.keys(c||n.peers||{});return console.STAT&&console.STAT(b,+new Date-b,"peer keys"),void function r(){var n=+new Date;e=1;var i=_.raw;_.raw=y;for(var a,l=0;l<9&&(a=(w||"")[l++]);)(a=m[a]||(c||"")[a])&&t.say(o,a);_.raw=i,e=0,w=w.slice(l),console.STAT&&console.STAT(n,+new Date-n,"say loop"),w.length&&(s(r,0),g&&u(g))}()}if(!c.wire&&t.wire&&t.wire(c),p!==c.last){if(c.last=p,c===_.via||(l=_.yo)&&(l[c.url]||l[c.pid]||l[c.id]))return!1;if(console.STAT&&console.STAT(b,((v||_).yp=+new Date)-(_.y||b),"say prep"),!e&&g&&u(g),c.batch){if(c.tail=(l=c.tail||0)+y.length,c.tail<=n.pack){c.batch+=(l?",":"")+y;return}h(c)}c.batch="[";var S=+new Date;setTimeout(function(){console.STAT&&console.STAT(S,+new Date-S,"0ms TO"),h(c)},n.gap),f(y,c),console.STAT&&g===c.SI&&console.STAT(b,+new Date-c.SH,"say ack")}},t.say.c=t.say.d=0,t.raw=function(e,i){if(!e)return"";var s,u,l=e._||{};if(u=l.raw)return u;if("string"==typeof e)return e;var h=e["##"],f=e["@"];if(h&&f){if(!l.via&&c(f+h))return!1;if(u=(a.s[f]||"").it){if(h===u["##"])return!1;u["##"]||(u["##"]=h)}}if(!e.dam&&!e["@"]){var p=0,d=[];for(var y in u=n.peers){var g=u[y];if(d.push(g.url||g.pid||g.id),++p>6)break}p>1&&(e["><"]=d.join())}if(e.put&&(u=e.ok)&&(e.ok={"@":(u["@"]||1)-1,"/":u["/"]==e._.near?t.near:u["/"]}),s=l.$put){u={},Object.keys(e).forEach(function(t){u[t]=e[t]}),u.put=":])([:",o(u,function(e,t){if(!e){var n=+new Date;u=t.indexOf('"put":":])([:"'),_(r,t=t.slice(0,u+6)+s+t.slice(u+14)),console.STAT&&console.STAT(n,+new Date-n,"say slice")}});return}function _(r,n){r||(l.raw=n,t.say(e,i))}o(e,_)}}(),t.near=0,t.hi=function(r){var i;if(!r.wire){t.wire(r.length&&{url:r,id:r}||r);return}r.id?n.peers[r.url||r.id]=r:(i=r.id=r.id||r.url||String.random(9),t.say({dam:"?",pid:e.opt.pid},n.peers[i]=r),delete a.s[r.last]),r.met||(t.near++,r.met=+new Date,e.on("hi",r)),i=r.queue,r.queue=[],setTimeout.each(i||[],function(e){f(e,r)},0,9)},t.bye=function(r){r.met&&--t.near,delete r.met,e.on("bye",r);var n=+new Date;n-=r.met||n,t.bye.time=((t.bye.time||n)+n)/2},t.hear["!"]=function(e,t){n.log("Error:",e.err)},t.hear["?"]=function(e,r){e.pid&&(r.pid||(r.pid=e.pid),e["@"])||(t.say({dam:"?",pid:n.pid,"@":e["#"]},r),delete a.s[r.last])},t.hear.mob=function(e,r){if(e.peers){var n=Object.keys(e.peers),i=n[Math.random()*n.length>>0];i&&(t.bye(r),t.hi(i))}},e.on("create",function(e){e.opt.pid=e.opt.pid||String.random(9),this.to.next(e),e.on("out",t.say)}),e.on("bye",function(e,t){e=n.peers[e.id||e]||e,this.to.next(e),e.bye?e.bye():(t=e.wire)&&t.close&&t.close(),delete n.peers[e.id],e.wire=null});var p={};return e.on("bye",function(e,r){this.to.next(e),(r=console.STAT)&&(r.peers=t.near),(r=e.url)&&(p[r]=!0,setTimeout(function(){delete p[r]},n.lack||9e3))}),e.on("hi",function(r,i){if(this.to.next(r),(i=console.STAT)&&(i.peers=t.near),!n.super){var o=Object.keys(e.next||"");o.length>9999&&!console.SUBS&&console.log(console.SUBS="Warning: You have more than 10K live GETs, which might use more bandwidth than your screen can show - consider `.off()`."),setTimeout.each(o,function(i){var o=e.next[i];if(n.super||(o.ask||"")[""]){t.say({get:{"#":i}},r);return}setTimeout.each(Object.keys(o.ask||""),function(n){n&&t.say({"##":String.hash((e.graph[i]||"")[n]),get:{"#":i,".":n}},r)})})}}),t}o.sucks=function(e){e>99&&(console.log("Warning: JSON blocking CPU detected. Add `gun/lib/yson.js` to fix."),o.sucks=n)};try{e.exports=s}catch(e){}})(t,"./mesh"),t(function(e){var r,n=t("./index");n.Mesh=t("./mesh"),n.on("opt",function(e){if(this.to.next(e),!e.once){var t=e.opt;if(!1!==t.WebSocket){var i=n.window||{},o=t.WebSocket||i.WebSocket||i.webkitWebSocket||i.mozWebSocket;if(o){t.WebSocket=o;var s=t.mesh=t.mesh||n.Mesh(e);s.wire||t.wire,s.wire=t.wire=u,setTimeout(function(){t.super||e.on("out",{dam:"hi"})},1);var a=1998,c=""+r!=typeof document&&document}}}function u(e){try{if(!e||!e.url)return n&&n(e);var r=e.url.replace(/^http/,"ws"),n=e.wire=new t.WebSocket(r);return n.onclose=function(){l(e),t.mesh.bye(e)},n.onerror=function(t){l(e)},n.onopen=function(){t.mesh.hi(e)},n.onmessage=function(r){r&&t.mesh.hear(r.data||r,e)},n}catch(r){t.mesh.bye(e)}}function l(e){clearTimeout(e.defer),!t.peers[e.url]||c&&e.retry<=0||(e.retry=(e.retry||t.retry+1||60)-(-e.tried+(e.tried=+new Date)<4*a?1:0),e.defer=setTimeout(function t(){if(c&&c.hidden)return setTimeout(t,a);u(e)},a))}})})(t,"./websocket"),t(function(e){if("undefined"!=typeof Gun){var t,r=function(){};try{t=(Gun.window||r).localStorage}catch(e){}t||(Gun.log("Warning: No localStorage exists to persist data to!"),t={setItem:function(e,t){this[e]=t},removeItem:function(e){delete this[e]},getItem:function(e){return this[e]}});var n=JSON.stringifyAsync||function(e,t,r,n){var i;try{t(i,JSON.stringify(e,r,n))}catch(e){t(e)}};Gun.on("create",function e(r){this.to.next(r);var i,o,s,a,c=r.opt,u=(r.graph,[]);if(!1!==c.localStorage){c.prefix=c.file||"gun/";try{i=e[c.prefix]=e[c.prefix]||JSON.parse(s=t.getItem(c.prefix))||{}}catch(t){i=e[c.prefix]={}}s=(s||"").length,r.on("get",function(e){this.to.next(e);var t,r,n,o,s=e.get;s&&(t=s["#"])&&((r=i[t]||o)&&(n=s["."])&&!Object.plain(n)&&(r=Gun.state.ify({},n,Gun.state.is(r,n),r[n],t)),Gun.on.get.ack(e,r))}),r.on("put",function(e){this.to.next(e);var t=e.put,n=t["#"],c=t["."],h=e["#"],f=e.ok||"";if(i[n]=Gun.state.ify(i[n],c,t[">"],t[":"],n),a&&s>4999880){r.on("in",{"@":h,err:"localStorage max!"});return}!e["@"]&&(!e._.via||Math.random()=0||1/0===e||-1/0===e)}},r.text=r.text||{is:function(e){return t("text"),"string"==typeof e}},r.text.ify=r.text.ify||function(e){return(t("text.ify"),r.text.is(e))?e:"undefined"!=typeof JSON?JSON.stringify(e):e&&e.toString?e.toString():e},r.text.random=r.text.random||function(e,r){t("text.random");var n="";for(e=e||24,r=r||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz";e>0;)n+=r.charAt(Math.floor(Math.random()*r.length)),e--;return n},r.text.match=r.text.match||function(e,r){var n,i;return t("text.match"),"string"==typeof e&&("string"==typeof r&&(r={"=":r}),e===(n=(r=r||{})["="]||r["*"]||r[">"]||r["<"])||i===r["="]&&(n=r["*"]||r[">"]||r["<"],e.slice(0,(n||"").length)===n||i===r["*"]&&(i!==r[">"]&&i!==r["<"]?e>=r[">"]&&e<=r["<"]:i!==r[">"]&&e>=r[">"]||i!==r["<"]&&e<=r["<"])))},r.text.hash=r.text.hash||function(e,r){if(t("text.hash"),"string"==typeof e){if(r=r||0,!e.length)return r;for(var n=0,i=e.length;nr?1:0:0}},r.list.map=r.list.map||function(e,r,n){return t("list.map"),c(e,r,n)},r.list.index=1,r.obj=r.boj||{is:function(e){return t("obj"),!!e&&(e instanceof Object&&e.constructor===Object||"Object"===Object.prototype.toString.call(e).match(/^\[object (\w+)\]$/)[1])}},r.obj.put=r.obj.put||function(e,r,n){return t("obj.put"),(e||{})[r]=n,e},r.obj.has=r.obj.has||function(e,r){return t("obj.has"),e&&Object.prototype.hasOwnProperty.call(e,r)},r.obj.del=r.obj.del||function(e,r){if(t("obj.del"),e)return e[r]=null,delete e[r],e},r.obj.as=r.obj.as||function(e,r,n,i){return t("obj.as"),e[r]=e[r]||(i===n?{}:n)},r.obj.ify=r.obj.ify||function(e){if(t("obj.ify"),s(e))return e;try{e=JSON.parse(e)}catch(t){e={}}return e},function(){var e;function n(t,r){a(this,r)&&e!==this[r]||(this[r]=t)}r.obj.to=r.obj.to||function(e,r){return t("obj.to"),c(e,n,r=r||{}),r}}(),r.obj.copy=r.obj.copy||function(e){return t("obj.copy"),e?JSON.parse(JSON.stringify(e)):e},function(){function e(e,t){var r,n=this.n;if(!(n&&(t===n||s(n)&&a(n,t)))&&r!==t)return!0}r.obj.empty=r.obj.empty||function(r,n){return t("obj.empty"),!r||!c(r,e,{n:n})}}(),function(){function e(t,r){if(2==arguments.length){e.r=e.r||{},e.r[t]=r;return}e.r=e.r||[],e.r.push(t)}var n,o=Object.keys;Object.keys=Object.keys||function(e){return n(e,function(e,t,r){r(t)})},r.obj.map=n=r.obj.map||function(n,c,u){t("obj.map");var l,h,f,p,d,y=0,g="function"==typeof c;if(e.r=l,o&&s(n)&&(p=o(n),d=!0),u=u||{},i(n)||p)for(h=(p||n).length;yt?1:0},p=function(e,t,r,n,i){var o;if(null==r&&(r=0),null==i&&(i=s),r<0)throw Error("lo must be non-negative");for(null==n&&(n=e.length);ri(t,e[o=a((r+n)/2)])?n=o:r=o+1;return[].splice.apply(e,[r,r-r].concat(t)),t},l=function(e,t,r){return null==r&&(r=s),e.push(t),v(e,0,e.length-1,r)},u=function(e,t){var r,n;return null==t&&(t=s),r=e.pop(),e.length?(n=e[0],e[0]=r,b(e,0,t)):n=r,n},f=function(e,t,r){var n;return null==r&&(r=s),n=e[0],e[0]=t,b(e,0,r),n},h=function(e,t,r){var n;return null==r&&(r=s),e.length&&0>r(e[0],t)&&(t=(n=[e[0],t])[0],e[0]=n[1],b(e,0,r)),t},c=function(e,t){var r,n,i,o,c,u;for(null==t&&(t=s),o=(function(){u=[];for(var t=0,r=a(e.length/2);0<=r?tr;0<=r?t++:t--)u.push(t);return u}).apply(this).reverse(),c=[],n=0,i=o.length;nr(n=y[l],o)&&(p(a,n,0,null,r),a.pop(),o=a[a.length-1]);return a}for(c(e,r),_=[],i=h=0,g=d(t,e.length);0<=g?hg;i=0<=g?++h:--h)_.push(u(e,r));return _},v=function(e,t,r,n){var i,o,a;for(null==n&&(n=s),i=e[r];r>t;){if(0>n(i,o=e[a=r-1>>1])){e[r]=o,r=a;continue}break}return e[r]=i},b=function(e,t,r){var n,i,o,a,c;for(null==r&&(r=s),i=e.length,c=t,o=e[t],n=2*t+1;nr(e[n],e[a]))&&(n=a),e[t]=e[n],n=2*(t=n)+1;return e[t]=o,v(e,c,t,r)},o=function(){function e(e){this.cmp=null!=e?e:s,this.nodes=[]}return e.push=l,e.pop=u,e.replace=f,e.pushpop=h,e.heapify=c,e.updateItem=_,e.nlargest=y,e.nsmallest=g,e.prototype.push=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pop=function(){return u(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return -1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return f(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return h(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return c(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return _(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),function(o,s){n=[],void 0!==(i="function"==typeof(r=s)?r.apply(t,n):r)&&(e.exports=i)}(0,function(){return o})}).call(this)},87398:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},52984:function(e,t,r){"use strict";var n=r(71118)(),i=r(50084)("Object.prototype.toString"),o=function(e){return(!n||!e||"object"!=typeof e||!(Symbol.toStringTag in e))&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},70342:function(e){"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i(function(){throw 42},null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{if(s(e))return!1;return n.call(e),!0}catch(e){return!1}},c=Object.prototype.toString,u="[object Object]",l="[object Function]",h="[object GeneratorFunction]",f="[object HTMLAllCollection]",p="[object HTML document.all class]",d="[object HTMLCollection]",y="function"==typeof Symbol&&!!Symbol.toStringTag,g=!(0 in[,]),_=function(){return!1};if("object"==typeof document){var v=document.all;c.call(v)===c.call(document.all)&&(_=function(e){if((g||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return(t===f||t===p||t===d||t===u)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(_(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(_(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;if(y)return a(e);if(s(e))return!1;var t=c.call(e);return!!(t===l||t===h||/^\[object HTML/.test(t))&&a(e)}},36528:function(e,t,r){"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(71118)(),c=Object.getPrototypeOf,u=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}};e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!c)return!1;if(void 0===n){var t=u();n=!!t&&c(t)}return c(e)===n}},31661:function(e,t,r){"use strict";var n=r(92590);e.exports=function(e){return!!n(e)}},74811:function(e,t,r){var n=null;"undefined"!=typeof WebSocket?n=WebSocket:"undefined"!=typeof MozWebSocket?n=MozWebSocket:void 0!==r.g?n=r.g.WebSocket||r.g.MozWebSocket:"undefined"!=typeof window?n=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(n=self.WebSocket||self.MozWebSocket),e.exports=n},73551:function(e,t,r){var n,i,o;!function(s){function a(e,t){"use strict";var r,n="uint8array",i=t.ready.then(function(){function n(){if(0!==r._sodium_init())throw Error("libsodium was not correctly initialized.");for(var t,n=["crypto_aead_aegis128l_decrypt","crypto_aead_aegis128l_decrypt_detached","crypto_aead_aegis128l_encrypt","crypto_aead_aegis128l_encrypt_detached","crypto_aead_aegis128l_keygen","crypto_aead_aegis256_decrypt","crypto_aead_aegis256_decrypt_detached","crypto_aead_aegis256_encrypt","crypto_aead_aegis256_encrypt_detached","crypto_aead_aegis256_keygen","crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_final","crypto_auth_hmacsha256_init","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_update","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_final","crypto_auth_hmacsha512_init","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_update","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_beforenm","crypto_box_curve25519xchacha20poly1305_detached","crypto_box_curve25519xchacha20poly1305_detached_afternm","crypto_box_curve25519xchacha20poly1305_easy","crypto_box_curve25519xchacha20poly1305_easy_afternm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_open_detached","crypto_box_curve25519xchacha20poly1305_open_detached_afternm","crypto_box_curve25519xchacha20poly1305_open_easy","crypto_box_curve25519xchacha20poly1305_open_easy_afternm","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_curve25519xchacha20poly1305_seed_keypair","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_core_ed25519_add","crypto_core_ed25519_from_hash","crypto_core_ed25519_from_uniform","crypto_core_ed25519_is_valid_point","crypto_core_ed25519_random","crypto_core_ed25519_scalar_add","crypto_core_ed25519_scalar_complement","crypto_core_ed25519_scalar_invert","crypto_core_ed25519_scalar_mul","crypto_core_ed25519_scalar_negate","crypto_core_ed25519_scalar_random","crypto_core_ed25519_scalar_reduce","crypto_core_ed25519_scalar_sub","crypto_core_ed25519_sub","crypto_core_hchacha20","crypto_core_hsalsa20","crypto_core_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ed25519","crypto_scalarmult_ed25519_base","crypto_scalarmult_ed25519_base_noclamp","crypto_scalarmult_ed25519_noclamp","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],i=[S,E,k,x,T,B,A,M,O,P,R,C,N,I,D,j,U,F,L,W,z,K,H,q,Y,G,$,V,Z,J,X,Q,ee,et,er,en,ei,eo,es,ea,ec,eu,el,eh,ef,ep,ed,ey,eg,e_,ev,eb,em,ew,eS,eE,ek,ex,eT,eB,eA,eM,eO,eP,eR,eC,eN,eI,eD,ej,eU,eF,eL,eW,ez,eK,eH,eq,eY,eG,e$,eV,eZ,eJ,eX,eQ,e0,e1,e2,e5,e3,e6,e4,e8,e7,e9,te,tt,tr,tn,ti,to,ts,ta,tc,tu,tl,th,tf,tp,td,ty,tg,t_,tv,tb,tm,tw,tS,tE,tk,tx,tT,tB,tA,tM,tO,tP,tR,tC,tN,tI,tD,tj,tU,tF,tL,tW,tz,tK,tH,tq,tY,tG,t$,tV,tZ,tJ,tX,tQ,t0,t1,t2,t5,t3,t6,t4,t8,t7,t9,re,rt,rr,rn,ri,ro,rs,ra,rc,ru,rl,rh,rf,rp,rd,ry,rg,r_,rv,rb,rm,rw],o=0;o=240?(l=4,c=!0):h>=224?(l=3,c=!0):h>=192?(l=2,c=!0):h<128&&(l=1,c=!0)}while(!c);for(var f=l-(a.length-u),p=0;p>8&-39)<<8|87+(t=e[o]>>>4)+(t-10>>8&-39)))+String.fromCharCode(n>>>8);return i}var c={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function u(e){if(null==e)return c.URLSAFE_NO_PADDING;if(e!==c.ORIGINAL&&e!==c.ORIGINAL_NO_PADDING&&e!==c.URLSAFE&&e!=c.URLSAFE_NO_PADDING)throw Error("unsupported base64 variant");return e}function l(e,t){t=u(t);var n,i=[],o=0|Math.floor((e=w(i,e,"input")).length/3),a=e.length-3*o,c=4*o+(0!==a?0==(2&t)?4:2+(a>>>1):0),l=new d(c+1),h=y(e);return i.push(h),i.push(l.address),0===r._sodium_bin2base64(l.address,l.length,h,e.length,t)&&v(i,"conversion failed"),l.length=c,n=s(l.to_Uint8Array()),_(i),n}function h(e,t){var r=t||n;if(!f(r))throw Error(r+" output format is not available");if(e instanceof d){if("uint8array"===r)return e.to_Uint8Array();if("text"===r)return s(e.to_Uint8Array());if("hex"===r)return a(e.to_Uint8Array());if("base64"===r)return l(e.to_Uint8Array(),c.URLSAFE_NO_PADDING);throw Error('What is output format "'+r+'"?')}if("object"==typeof e){for(var i=Object.keys(e),o={},u=0;u>>24>>>8,c,l);var S=h(g,s);return _(a),S}function tp(e){var t=[];p(e);var n=new d(0|r._crypto_kdf_keybytes()),i=n.address;t.push(i),r._crypto_kdf_keygen(i);var o=h(n,e);return _(t),o}function td(e,t,n,i){var o=[];p(i),e=w(o,e,"clientPublicKey");var s,a=0|r._crypto_kx_publickeybytes();e.length!==a&&b(o,"invalid clientPublicKey length"),s=y(e),o.push(s),t=w(o,t,"clientSecretKey");var c,u=0|r._crypto_kx_secretkeybytes();t.length!==u&&b(o,"invalid clientSecretKey length"),c=y(t),o.push(c),n=w(o,n,"serverPublicKey");var l,f=0|r._crypto_kx_publickeybytes();n.length!==f&&b(o,"invalid serverPublicKey length"),l=y(n),o.push(l);var g=new d(0|r._crypto_kx_sessionkeybytes()),m=g.address;o.push(m);var S=new d(0|r._crypto_kx_sessionkeybytes()),E=S.address;if(o.push(E),0==(0|r._crypto_kx_client_session_keys(m,E,s,c,l))){var k=h({sharedRx:g,sharedTx:S},i);return _(o),k}v(o,"invalid usage")}function ty(e){var t=[];p(e);var n=new d(0|r._crypto_kx_publickeybytes()),i=n.address;t.push(i);var o=new d(0|r._crypto_kx_secretkeybytes()),s=o.address;if(t.push(s),0==(0|r._crypto_kx_keypair(i,s))){var a={publicKey:h(n,e),privateKey:h(o,e),keyType:"x25519"};return _(t),a}v(t,"internal error")}function tg(e,t){var n=[];p(t),e=w(n,e,"seed");var i,o=0|r._crypto_kx_seedbytes();e.length!==o&&b(n,"invalid seed length"),i=y(e),n.push(i);var s=new d(0|r._crypto_kx_publickeybytes()),a=s.address;n.push(a);var c=new d(0|r._crypto_kx_secretkeybytes()),u=c.address;if(n.push(u),0==(0|r._crypto_kx_seed_keypair(a,u,i))){var l={publicKey:h(s,t),privateKey:h(c,t),keyType:"x25519"};return _(n),l}v(n,"internal error")}function t_(e,t,n,i){var o=[];p(i),e=w(o,e,"serverPublicKey");var s,a=0|r._crypto_kx_publickeybytes();e.length!==a&&b(o,"invalid serverPublicKey length"),s=y(e),o.push(s),t=w(o,t,"serverSecretKey");var c,u=0|r._crypto_kx_secretkeybytes();t.length!==u&&b(o,"invalid serverSecretKey length"),c=y(t),o.push(c),n=w(o,n,"clientPublicKey");var l,f=0|r._crypto_kx_publickeybytes();n.length!==f&&b(o,"invalid clientPublicKey length"),l=y(n),o.push(l);var g=new d(0|r._crypto_kx_sessionkeybytes()),m=g.address;o.push(m);var S=new d(0|r._crypto_kx_sessionkeybytes()),E=S.address;if(o.push(E),0==(0|r._crypto_kx_server_session_keys(m,E,s,c,l))){var k=h({sharedRx:g,sharedTx:S},i);return _(o),k}v(o,"invalid usage")}function tv(e,t,n){var i=[];p(n);var o=y(e=w(i,e,"message")),s=e.length;i.push(o),t=w(i,t,"key");var a,c=0|r._crypto_onetimeauth_keybytes();t.length!==c&&b(i,"invalid key length"),a=y(t),i.push(a);var u=new d(0|r._crypto_onetimeauth_bytes()),l=u.address;if(i.push(l),0==(0|r._crypto_onetimeauth(l,o,s,0,a))){var f=h(u,n);return _(i),f}v(i,"invalid usage")}function tb(e,t){var n=[];p(t),m(n,e,"state_address");var i=new d(0|r._crypto_onetimeauth_bytes()),o=i.address;if(n.push(o),0==(0|r._crypto_onetimeauth_final(e,o))){var s=(r._free(e),h(i,t));return _(n),s}v(n,"invalid usage")}function tm(e,t){var n=[];p(t);var i=null;null!=e&&(i=y(e=w(n,e,"key")),e.length,n.push(i));var o=new d(144).address;if(0==(0|r._crypto_onetimeauth_init(o,i))){var s=o;return _(n),s}v(n,"invalid usage")}function tw(e){var t=[];p(e);var n=new d(0|r._crypto_onetimeauth_keybytes()),i=n.address;t.push(i),r._crypto_onetimeauth_keygen(i);var o=h(n,e);return _(t),o}function tS(e,t,n){var i=[];p(n),m(i,e,"state_address");var o=y(t=w(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|r._crypto_onetimeauth_update(e,o,s))&&v(i,"invalid usage"),_(i)}function tE(e,t,n){var i=[];e=w(i,e,"hash");var o,s=0|r._crypto_onetimeauth_bytes();e.length!==s&&b(i,"invalid hash length"),o=y(e),i.push(o);var a=y(t=w(i,t,"message")),c=t.length;i.push(a),n=w(i,n,"key");var u,l=0|r._crypto_onetimeauth_keybytes();n.length!==l&&b(i,"invalid key length"),u=y(n),i.push(u);var h=0==(0|r._crypto_onetimeauth_verify(o,a,c,0,u));return _(i),h}function tk(e,t,n,i,o,s,a){var c=[];p(a),m(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(c,"keyLength must be an unsigned integer");var u=y(t=w(c,t,"password")),l=t.length;c.push(u),n=w(c,n,"salt");var f,g=0|r._crypto_pwhash_saltbytes();n.length!==g&&b(c,"invalid salt length"),f=y(n),c.push(f),m(c,i,"opsLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&b(c,"opsLimit must be an unsigned integer"),m(c,o,"memLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&b(c,"memLimit must be an unsigned integer"),m(c,s,"algorithm"),("number"!=typeof s||(0|s)!==s||s<0)&&b(c,"algorithm must be an unsigned integer");var S=new d(0|e),E=S.address;if(c.push(E),0==(0|r._crypto_pwhash(E,e,0,u,l,0,f,i,0,o,s))){var k=h(S,a);return _(c),k}v(c,"invalid usage")}function tx(e,t,n,i,o,s){var a=[];p(s),m(a,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(a,"keyLength must be an unsigned integer");var c=y(t=w(a,t,"password")),u=t.length;a.push(c),n=w(a,n,"salt");var l,f=0|r._crypto_pwhash_scryptsalsa208sha256_saltbytes();n.length!==f&&b(a,"invalid salt length"),l=y(n),a.push(l),m(a,i,"opsLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&b(a,"opsLimit must be an unsigned integer"),m(a,o,"memLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&b(a,"memLimit must be an unsigned integer");var g=new d(0|e),S=g.address;if(a.push(S),0==(0|r._crypto_pwhash_scryptsalsa208sha256(S,e,0,c,u,0,l,i,0,o))){var E=h(g,s);return _(a),E}v(a,"invalid usage")}function tT(e,t,n,i,o,s,a){var c=[];p(a);var u=y(e=w(c,e,"password")),l=e.length;c.push(u);var f=y(t=w(c,t,"salt")),g=t.length;c.push(f),m(c,n,"opsLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&b(c,"opsLimit must be an unsigned integer"),m(c,i,"r"),("number"!=typeof i||(0|i)!==i||i<0)&&b(c,"r must be an unsigned integer"),m(c,o,"p"),("number"!=typeof o||(0|o)!==o||o<0)&&b(c,"p must be an unsigned integer"),m(c,s,"keyLength"),("number"!=typeof s||(0|s)!==s||s<0)&&b(c,"keyLength must be an unsigned integer");var S=new d(0|s),E=S.address;if(c.push(E),0==(0|r._crypto_pwhash_scryptsalsa208sha256_ll(u,l,f,g,n,0,i,o,E,s))){var k=h(S,a);return _(c),k}v(c,"invalid usage")}function tB(e,t,n,i){var o=[];p(i);var s=y(e=w(o,e,"password")),a=e.length;o.push(s),m(o,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&b(o,"opsLimit must be an unsigned integer"),m(o,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&b(o,"memLimit must be an unsigned integer");var c=new d(0|r._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(o.push(c),0==(0|r._crypto_pwhash_scryptsalsa208sha256_str(c,s,a,0,t,0,n))){var u=r.UTF8ToString(c);return _(o),u}v(o,"invalid usage")}function tA(e,t,n){var i=[];p(n),"string"!=typeof e&&b(i,"hashed_password must be a string"),e=o(e+"\0"),null!=a&&e.length-1!==a&&b(i,"invalid hashed_password length");var s=y(e),a=e.length-1;i.push(s);var c=y(t=w(i,t,"password")),u=t.length;i.push(c);var l=0==(0|r._crypto_pwhash_scryptsalsa208sha256_str_verify(s,c,u,0));return _(i),l}function tM(e,t,n,i){var o=[];p(i);var s=y(e=w(o,e,"password")),a=e.length;o.push(s),m(o,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&b(o,"opsLimit must be an unsigned integer"),m(o,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&b(o,"memLimit must be an unsigned integer");var c=new d(0|r._crypto_pwhash_strbytes()).address;if(o.push(c),0==(0|r._crypto_pwhash_str(c,s,a,0,t,0,n))){var u=r.UTF8ToString(c);return _(o),u}v(o,"invalid usage")}function tO(e,t,n,i){var s=[];p(i),"string"!=typeof e&&b(s,"hashed_password must be a string"),e=o(e+"\0"),null!=c&&e.length-1!==c&&b(s,"invalid hashed_password length");var a=y(e),c=e.length-1;s.push(a),m(s,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&b(s,"opsLimit must be an unsigned integer"),m(s,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&b(s,"memLimit must be an unsigned integer");var u=0!=(0|r._crypto_pwhash_str_needs_rehash(a,t,0,n));return _(s),u}function tP(e,t,n){var i=[];p(n),"string"!=typeof e&&b(i,"hashed_password must be a string"),e=o(e+"\0"),null!=a&&e.length-1!==a&&b(i,"invalid hashed_password length");var s=y(e),a=e.length-1;i.push(s);var c=y(t=w(i,t,"password")),u=t.length;i.push(c);var l=0==(0|r._crypto_pwhash_str_verify(s,c,u,0));return _(i),l}function tR(e,t,n){var i=[];p(n),e=w(i,e,"privateKey");var o,s=0|r._crypto_scalarmult_scalarbytes();e.length!==s&&b(i,"invalid privateKey length"),o=y(e),i.push(o),t=w(i,t,"publicKey");var a,c=0|r._crypto_scalarmult_bytes();t.length!==c&&b(i,"invalid publicKey length"),a=y(t),i.push(a);var u=new d(0|r._crypto_scalarmult_bytes()),l=u.address;if(i.push(l),0==(0|r._crypto_scalarmult(l,o,a))){var f=h(u,n);return _(i),f}v(i,"weak public key")}function tC(e,t){var n=[];p(t),e=w(n,e,"privateKey");var i,o=0|r._crypto_scalarmult_scalarbytes();e.length!==o&&b(n,"invalid privateKey length"),i=y(e),n.push(i);var s=new d(0|r._crypto_scalarmult_bytes()),a=s.address;if(n.push(a),0==(0|r._crypto_scalarmult_base(a,i))){var c=h(s,t);return _(n),c}v(n,"unknown error")}function tN(e,t,n){var i=[];p(n),e=w(i,e,"n");var o,s=0|r._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&b(i,"invalid n length"),o=y(e),i.push(o),t=w(i,t,"p");var a,c=0|r._crypto_scalarmult_ed25519_bytes();t.length!==c&&b(i,"invalid p length"),a=y(t),i.push(a);var u=new d(0|r._crypto_scalarmult_ed25519_bytes()),l=u.address;if(i.push(l),0==(0|r._crypto_scalarmult_ed25519(l,o,a))){var f=h(u,n);return _(i),f}v(i,"invalid point or scalar is 0")}function tI(e,t){var n=[];p(t),e=w(n,e,"scalar");var i,o=0|r._crypto_scalarmult_ed25519_scalarbytes();e.length!==o&&b(n,"invalid scalar length"),i=y(e),n.push(i);var s=new d(0|r._crypto_scalarmult_ed25519_bytes()),a=s.address;if(n.push(a),0==(0|r._crypto_scalarmult_ed25519_base(a,i))){var c=h(s,t);return _(n),c}v(n,"scalar is 0")}function tD(e,t){var n=[];p(t),e=w(n,e,"scalar");var i,o=0|r._crypto_scalarmult_ed25519_scalarbytes();e.length!==o&&b(n,"invalid scalar length"),i=y(e),n.push(i);var s=new d(0|r._crypto_scalarmult_ed25519_bytes()),a=s.address;if(n.push(a),0==(0|r._crypto_scalarmult_ed25519_base_noclamp(a,i))){var c=h(s,t);return _(n),c}v(n,"scalar is 0")}function tj(e,t,n){var i=[];p(n),e=w(i,e,"n");var o,s=0|r._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&b(i,"invalid n length"),o=y(e),i.push(o),t=w(i,t,"p");var a,c=0|r._crypto_scalarmult_ed25519_bytes();t.length!==c&&b(i,"invalid p length"),a=y(t),i.push(a);var u=new d(0|r._crypto_scalarmult_ed25519_bytes()),l=u.address;if(i.push(l),0==(0|r._crypto_scalarmult_ed25519_noclamp(l,o,a))){var f=h(u,n);return _(i),f}v(i,"invalid point or scalar is 0")}function tU(e,t,n){var i=[];p(n),e=w(i,e,"scalar");var o,s=0|r._crypto_scalarmult_ristretto255_scalarbytes();e.length!==s&&b(i,"invalid scalar length"),o=y(e),i.push(o),t=w(i,t,"element");var a,c=0|r._crypto_scalarmult_ristretto255_bytes();t.length!==c&&b(i,"invalid element length"),a=y(t),i.push(a);var u=new d(0|r._crypto_scalarmult_ristretto255_bytes()),l=u.address;if(i.push(l),0==(0|r._crypto_scalarmult_ristretto255(l,o,a))){var f=h(u,n);return _(i),f}v(i,"result is identity element")}function tF(e,t){var n=[];p(t),e=w(n,e,"scalar");var i,o=0|r._crypto_core_ristretto255_scalarbytes();e.length!==o&&b(n,"invalid scalar length"),i=y(e),n.push(i);var s=new d(0|r._crypto_core_ristretto255_bytes()),a=s.address;if(n.push(a),0==(0|r._crypto_scalarmult_ristretto255_base(a,i))){var c=h(s,t);return _(n),c}v(n,"scalar is 0")}function tL(e,t,n,i){var o=[];p(i);var s=y(e=w(o,e,"message")),a=e.length;o.push(s),t=w(o,t,"nonce");var c,u=0|r._crypto_secretbox_noncebytes();t.length!==u&&b(o,"invalid nonce length"),c=y(t),o.push(c),n=w(o,n,"key");var l,f=0|r._crypto_secretbox_keybytes();n.length!==f&&b(o,"invalid key length"),l=y(n),o.push(l);var g=new d(0|a),m=g.address;o.push(m);var S=new d(0|r._crypto_secretbox_macbytes()),E=S.address;if(o.push(E),0==(0|r._crypto_secretbox_detached(m,E,s,a,0,c,l))){var k=h({mac:S,cipher:g},i);return _(o),k}v(o,"invalid usage")}function tW(e,t,n,i){var o=[];p(i);var s=y(e=w(o,e,"message")),a=e.length;o.push(s),t=w(o,t,"nonce");var c,u=0|r._crypto_secretbox_noncebytes();t.length!==u&&b(o,"invalid nonce length"),c=y(t),o.push(c),n=w(o,n,"key");var l,f=0|r._crypto_secretbox_keybytes();n.length!==f&&b(o,"invalid key length"),l=y(n),o.push(l);var g=new d(a+r._crypto_secretbox_macbytes()|0),m=g.address;if(o.push(m),0==(0|r._crypto_secretbox_easy(m,s,a,0,c,l))){var S=h(g,i);return _(o),S}v(o,"invalid usage")}function tz(e){var t=[];p(e);var n=new d(0|r._crypto_secretbox_keybytes()),i=n.address;t.push(i),r._crypto_secretbox_keygen(i);var o=h(n,e);return _(t),o}function tK(e,t,n,i,o){var s=[];p(o);var a=y(e=w(s,e,"ciphertext")),c=e.length;s.push(a),t=w(s,t,"mac");var u,l=0|r._crypto_secretbox_macbytes();t.length!==l&&b(s,"invalid mac length"),u=y(t),s.push(u),n=w(s,n,"nonce");var f,g=0|r._crypto_secretbox_noncebytes();n.length!==g&&b(s,"invalid nonce length"),f=y(n),s.push(f),i=w(s,i,"key");var m,S=0|r._crypto_secretbox_keybytes();i.length!==S&&b(s,"invalid key length"),m=y(i),s.push(m);var E=new d(0|c),k=E.address;if(s.push(k),0==(0|r._crypto_secretbox_open_detached(k,a,u,c,0,f,m))){var x=h(E,o);return _(s),x}v(s,"wrong secret key for the given ciphertext")}function tH(e,t,n,i){var o=[];p(i),e=w(o,e,"ciphertext");var s,a=r._crypto_secretbox_macbytes(),c=e.length;c>>0;return _([]),t}function rv(e,t){var n=[];p(t);for(var i=r._malloc(24),o=0;o<6;o++)r.setValue(i+4*o,r.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][o]]),"i32");0!=(0|r._randombytes_set_implementation(i))&&v(n,"unsupported implementation"),_(n)}function rb(e){p(e),r._randombytes_stir()}function rm(e,t){var n=[];p(t),m(n,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&b(n,"upper_bound must be an unsigned integer");var i=r._randombytes_uniform(e)>>>0;return _(n),i}function rw(){var e=r._sodium_version_string(),t=r.UTF8ToString(e);return _([]),t}return d.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(r.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw TypeError("Only Uint8Array instances can added");var r=e.length,n=0,i=0;if(t.length!=e.length)throw TypeError("Arguments must have the same length");for(i=0;i>=8,n+=e[i]+t[i],e[i]=255&n},e.base64_variants=c,e.compare=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw TypeError("Only instances of identical length can be compared");for(var r=0,n=1,i=e.length;i-- >0;)r|=t[i]-e[i]>>8&n,n&=(t[i]^e[i])-1>>8;return r+r+n-1},e.from_base64=function(e,t){t=u(t);var n,i=[],o=new d(3*(e=w(i,e,"input")).length/4),s=y(e),a=g(4),c=g(4);return i.push(s),i.push(o.address),i.push(o.result_bin_len_p),i.push(o.b64_end_p),0!==r._sodium_base642bin(o.address,o.length,s,e.length,0,a,c,t)&&v(i,"invalid input"),r.getValue(c,"i32")-s!==e.length&&v(i,"incomplete input"),o.length=r.getValue(a,"i32"),n=o.to_Uint8Array(),_(i),n},e.from_hex=function(e){var t,n=[],i=new d((e=w(n,e,"input")).length/2),o=y(e),s=g(4);return n.push(o),n.push(i.address),n.push(i.hex_end_p),0!==r._sodium_hex2bin(i.address,i.length,o,e.length,0,0,s)&&v(n,"invalid input"),r.getValue(s,"i32")-o!==e.length&&v(n,"incomplete input"),t=i.to_Uint8Array(),_(n),t},e.from_string=o,e.increment=function(e){if(!(e instanceof Uint8Array))throw TypeError("Only Uint8Array instances can be incremented");for(var t=256,r=0,n=e.length;r>=8,t+=e[r],e[r]=255&t},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw TypeError("Only Uint8Array instances can be checked");for(var t=0,r=0,n=e.length;r 0");var n,i=[],o=g(4),s=1,a=0,c=0|e.length,u=new d(c+t);i.push(o),i.push(u.address);for(var l=u.address,h=u.address+c+t;l>>48|c>>>32|c>>>16|c))-1>>16);return 0!==r._sodium_pad(o,u.address,e.length,t,u.length)&&v(i,"internal error"),u.length=r.getValue(o,"i32"),n=u.to_Uint8Array(),_(i),n},e.unpad=function(e,t){if(!(e instanceof Uint8Array))throw TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw Error("block size must be > 0");var n=[],i=y(e),o=g(4);return n.push(i),n.push(o),0!==r._sodium_unpad(o,i,e.length,t)&&v(n,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,r.getValue(o,"i32")),_(n),e},e.ready=i,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=l,e.to_hex=a,e.to_string=s,e}var c="object"==typeof s.sodium&&"function"==typeof s.sodium.onload?s.sodium.onload:null;i=[t,r(92930)],void 0!==(o="function"==typeof(n=a)?n.apply(t,i):n)&&(e.exports=o),c&&s.sodium.ready.then(function(){c(s.sodium)})}(this)},86253:function(e){"use strict";function t(){var e=Object.create(null),t=0,r=0,n=0,i=!1;function o(t){n--,delete e[t]}this.put=function(t,r,s,a){if(i&&console.log("caching: %s = %j (@%s)",t,r,s),void 0!==s&&("number"!=typeof s||isNaN(s)||s<=0))throw Error("Cache timeout must be a positive number");if(void 0!==a&&"function"!=typeof a)throw Error("Cache timeout callback must be a function");var c=e[t];c?clearTimeout(c.timeout):n++;var u={value:r,expire:s+Date.now()};return isNaN(u.expire)||(u.timeout=setTimeout((function(){o(t),a&&a(t,r)}).bind(this),s)),e[t]=u,r},this.del=function(t){var r=!0,n=e[t];return n?(clearTimeout(n.timeout),!isNaN(n.expire)&&n.expire=Date.now())return i&&t++,s.value;i&&r++,n--,delete e[o]}else i&&r++;return null},this.size=function(){return n},this.memsize=function(){var t,r=0;for(t in e)r++;return r},this.debug=function(e){i=e},this.hits=function(){return t},this.misses=function(){return r},this.keys=function(){return Object.keys(e)},this.exportJson=function(){var t={};for(var r in e){var n=e[r];t[r]={value:n.value,expire:n.expire||"NaN"}}return JSON.stringify(t)},this.importJson=function(t,r){var n=JSON.parse(t),o=Date.now(),s=r&&r.skipDuplicates;for(var a in n)if(n.hasOwnProperty(a)){if(s&&e[a]){i&&console.log("Skipping duplicate imported key '%s'",a);continue}var c=n[a],u=c.expire-o;if(u<=0){this.del(a);continue}u=u>0?u:void 0,this.put(a,c.value,u)}return this.size()}}e.exports=new t,e.exports.Cache=t},44331:function(e,t,r){var n="/",i=r(25566);!function(){var t={189:function(){!function(e,t){"use strict";if(!e.setImmediate){var r,n=1,o={},s=!1,a=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,"[object process]"===({}).toString.call(e.process)?p():d()?y():e.MessageChannel?g():a&&"onreadystatechange"in a.createElement("script")?_():v(),c.setImmediate=u,c.clearImmediate=l}function u(e){"function"!=typeof e&&(e=Function(""+e));for(var t=Array(arguments.length-1),i=0;iString(e)),r>2)?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}}function i(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function o(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function s(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){let a,c;if("string"==typeof t&&i(t,"not ")?(a="must not be",t=t.replace(/^not /,"")):a="must be",o(e," argument"))c=`The ${e} ${a} ${n(t,"type")}`;else{let r=s(e,".")?"property":"argument";c=`The "${e}" ${r} ${a} ${n(t,"type")}`}return c+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},403:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(709),s=r(337);r(782)(l,o);for(var a=n(s.prototype),c=0;c0){if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=d(t)),n)a.endEmitted?x(e,new k):P(e,a,t,!0);else if(a.ended)x(e,new S);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?P(e,a,t,!1):F(e,a)):P(e,a,t,!1)}}else n||(a.reading=!1,F(e,a));return!a.ended&&(a.length=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function I(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=N(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function D(e,t){if(s("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?j(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function j(e){var t=e._readableState;s("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(s("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(U,e))}function U(e){var t=e._readableState;s("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Y(e)}function F(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function K(e){s("readable nexttick read 0"),e.read(0)}function H(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(q,e,t))}function q(e,t){s("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Y(e),t.flowing&&!t.reading&&e.read(0)}function Y(e){var t=e._readableState;for(s("flow",t.flowing);t.flowing&&null!==e.read(););}function G(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function $(e){var t=e._readableState;s("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(V,t,e))}function V(e,t){if(s("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Z(e,t){for(var r=0,n=e.length;r=r.highWaterMark:r.length>0)||r.ended))return s("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?$(this):j(this),null;if(0===(e=I(e,r))&&r.ended)return 0===r.length&&$(this),null;var i=r.needReadable;return s("need readable",i),(0===r.length||r.length-e0?G(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&$(this)),null!==t&&this.emit("data",t),t},M.prototype._read=function(e){x(this,new E("_read()"))},M.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,s("pipe count=%d opts=%j",n.pipesCount,t);var o=t&&!1===t.end||e===i.stdout||e===i.stderr?_:c;function a(e,t){s("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,f())}function c(){s("onend"),e.end()}n.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",a);var u=W(r);e.on("drain",u);var h=!1;function f(){s("cleanup"),e.removeListener("close",y),e.removeListener("finish",g),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",_),r.removeListener("data",p),h=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}function p(t){s("ondata");var i=e.write(t);s("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Z(n.pipes,e))&&!h&&(s("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){s("onerror",t),_(),e.removeListener("error",d),0===l(e,"error")&&x(e,t)}function y(){e.removeListener("finish",g),_()}function g(){s("onfinish"),e.removeListener("close",y),_()}function _(){s("unpipe"),r.unpipe(e)}return r.on("data",p),B(e,"error",d),e.once("close",y),e.once("finish",g),e.emit("pipe",r),n.flowing||(s("pipe resume"),r.resume()),e},M.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,s("on readable",n.length,n.reading),n.length?j(this):n.reading||i.nextTick(K,this)),r},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(e,t){var r=h.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(z,this),r},M.prototype.removeAllListeners=function(e){var t=h.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&i.nextTick(z,this),t},M.prototype.resume=function(){var e=this._readableState;return e.flowing||(s("resume"),e.flowing=!e.readableListening,H(this,e)),e.paused=!1,this},M.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(s("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){s("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!=i)&&(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new k(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new v("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||H(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=d.destroy,A.prototype._undestroy=d.undestroy,A.prototype._destroy=function(e,t){t(e)}},871:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,s=r(698),a=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function y(e){var t=e[a];if(null!==t){var r=e[p].read();null!==r&&(e[h]=null,e[a]=null,e[c]=null,t(d(r,!1)))}}function g(e){i.nextTick(y,e)}function _(e,t){return function(r,n){e.then(function(){if(t[l]){r(d(void 0,!0));return}t[f](r,n)},n)}}var v=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((n(o={get stream(){return this[p]},next:function(){var e,t=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[l])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(e,r){i.nextTick(function(){t[u]?r(t[u]):e(d(void 0,!0))})});var n=this[h];if(n)e=new Promise(_(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));e=new Promise(this[f])}return this[h]=e,e}},Symbol.asyncIterator,function(){return this}),n(o,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){if(e){r(e);return}t(d(void 0,!0))})})}),o),v),m=function(e){var t,r=Object.create(b,(n(t={},p,{value:e,writable:!0}),n(t,a,{value:null,writable:!0}),n(t,c,{value:null,writable:!0}),n(t,u,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,f,{value:function(e,t){var n=r[p].read();n?(r[h]=null,r[a]=null,r[c]=null,e(d(n,!1))):(r[a]=e,r[c]=t)},writable:!0}),t));return r[h]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];null!==t&&(r[h]=null,r[a]=null,r[c]=null,t(e)),r[u]=e;return}var n=r[a];null!==n&&(r[h]=null,r[a]=null,r[c]=null,n(d(void 0,!0))),r[l]=!0}),e.on("readable",g.bind(null,r)),r};e.exports=m},379:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:h,value:function(e,t){return l(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},25:function(e){"use strict";function t(e,t){var o=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.nextTick(s,this,e)):i.nextTick(s,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?o._writableState?o._writableState.errorEmitted?i.nextTick(n,o):(o._writableState.errorEmitted=!0,i.nextTick(r,o,e)):i.nextTick(r,o,e):t?(i.nextTick(n,o),t(e)):i.nextTick(n,o)})),this}function r(e,t){s(e,t),n(e)}function n(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(e,t){e.emit("error",t)}function a(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}e.exports={destroy:t,undestroy:o,errorOrDestroy:a}},698:function(e,t,r){"use strict";var n=r(646).q.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=Array(r),i=0;i0,function(t){e||(e=t),t&&o.forEach(h),s||(o.forEach(h),i(e))})});return r.reduce(f)}e.exports=d},776:function(e,t,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;function i(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}function o(e,t,r,o){var s=i(t,o,r);if(null!=s){if(!(isFinite(s)&&Math.floor(s)===s)||s<0)throw new n(o?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}e.exports={getHighWaterMark:o}},678:function(e,t,r){e.exports=r(781)},55:function(e,t,r){var n=r(300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},173:function(e,t,r){e.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(782)(i,n),i.Readable=r(709),i.Writable=r(337),i.Duplex=r(403),i.Transform=r(170),i.PassThrough=r(889),i.finished=r(698),i.pipeline=r(442),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",c));var s=!1;function a(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",u),e.on("error",u),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},704:function(e,t,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function s(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function a(e){var t;switch(this.encoding=s(e),this.encoding){case"utf16le":this.text=d,this.end=y,t=4;break;case"utf8":this.fillLast=h,t=4;break;case"base64":this.text=g,this.end=_,t=3;break;default:this.write=v,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function h(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function f(e,t){var r=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function d(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function _(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function b(e){return e&&e.length?this.write(e):""}t.s=a,a.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return rthis._connect(),this.reconnectInterval),this.reconnectInterval*=2,this.reconnectInterval>this.options.reconnectIntervalMax&&(this.reconnectInterval=this.options.reconnectIntervalMax)}_connectFailed(){this.isFailed||(this.isFailed=!0,this.eventListeners.connectFailed.length>0?this.eventListeners.connectFailed.forEach(async e=>{try{await e()}catch(e){console.log("Connect failed handler error:",e)}}):console.log("Client connect failed"))}on(e,t){this.eventListeners[e]||(this.eventListeners[e]=[]),this.eventListeners[e].push(t)}onConnect(e){this.eventListeners.connect.push(e)}onConnectFailed(e){this.eventListeners.connectFailed.push(e)}onWsError(e){this.eventListeners.wsError.push(e)}onMessage(e){this.eventListeners.message.push(e)}_wsSend(e){if(!this.ws)throw new o.errors.ClientNotReadyError;this.ws.send(e)}async _processDest(e){if(0===e.length)throw new o.errors.InvalidDestinationError("destination is empty");let t=e.split(".");if(t[t.length-1].length<2*o.crypto.publicKeyLength){let r=await this.getRegistrant(t[t.length-1]);if(r.registrant&&r.registrant.length>0)t[t.length-1]=r.registrant;else throw new o.errors.InvalidDestinationError(e+" is neither a valid public key nor a registered name")}return t.join(".")}async _processDests(e){if(Array.isArray(e)){if(0===e.length)throw new o.errors.InvalidDestinationError("no destinations");if(0===(e=(e=await Promise.all(e.map(async e=>{try{return await this._processDest(e)}catch(e){return console.warn(e.message),""}}))).filter(e=>e.length>0)).length)throw new o.errors.InvalidDestinationError("all destinations are invalid")}else e=await this._processDest(e);return e}async _send(e,t,r=!0,n=0){if(Array.isArray(e)){if(0===e.length)return null;if(1===e.length)return await this._send(e[0],t,r,n)}e=await this._processDests(e);let i=await this._messageFromPayload(t,r,e);i=i.map(e=>e.serializeBinary());let s=[],c=[],u=[];if(i.length>1){let t=0,r=0;for(let l=0;la.maxClientMessageSize)throw new o.errors.DataSizeTooLargeError("encoded message is greater than "+a.maxClientMessageSize+" bytes");t+r>a.maxClientMessageSize&&(s.push(await a.newOutboundMessage(this,c,u,n)),c=[],u=[],t=0),c.push(e[l]),u.push(i[l]),t+=r}}else{let t=i[0].length;if(Array.isArray(e))for(let r=0;ra.maxClientMessageSize)throw new o.errors.DataSizeTooLargeError("encoded message is greater than "+a.maxClientMessageSize+" bytes");c=e,u=i}return s.push(await a.newOutboundMessage(this,c,u,n)),s.length>1&&console.log(`Client message size is greater than ${a.maxClientMessageSize} bytes, split into ${s.length} batches.`),s.forEach(e=>{this._wsSend(e.serializeBinary())}),t.getMessageId()||null}async send(e,t,r={}){let n;r=o.util.assignDefined({},this.options,r),n="string"==typeof t?a.newTextPayload(t,r.replyToId,r.messageId):a.newBinaryPayload(t,r.replyToId,r.messageId);let i=await this._send(e,n,r.encrypt,r.msgHoldingSeconds);return null===i||r.noReply?null:await new Promise((e,t)=>{this.responseManager.add(new g(i,r.responseTimeout,e,t))})}async _sendACK(e,t,r){if(Array.isArray(e)){if(0===e.length)return;if(1===e.length)return await this._sendACK(e[0],t,r);if(e.length>1&&r){console.warn("Encrypted ACK with multicast is not supported, fallback to unicast.");for(let n=0;n=r.limit;){if(n+=r.limit,!((i=await this.getSubscribers(e,{offset:n,limit:r.limit})).subscribers instanceof Array))throw new o.errors.InvalidResponseError("subscribers should be an array");a=a.concat(i.subscribers)}return r.txPool&&c&&(a=a.concat(c)),await this.send(a,t,r),null}close(){this.responseManager.stop(),this.shouldReconnect=!1;try{this.ws&&this.ws.close()}catch(e){}this.isClosed=!0}async _messageFromPayload(e,t,r){return t?await this._encryptPayload(e.serializeBinary(),r):[a.newMessage(e.serializeBinary(),!1)]}async _handleMsg(e){let t=o.pb.messages.ClientMessage.deserializeBinary(e);return t.getMessageType()===o.pb.messages.ClientMessageType.INBOUND_MESSAGE&&await this._handleInboundMsg(t.getMessage())}async _handleInboundMsg(e){let t,r=o.pb.messages.InboundMessage.deserializeBinary(e),n=r.getPrevSignature();if(n.length>0){n=o.util.bytesToHex(n);let e=await a.newReceipt(this,n);this._wsSend(e.serializeBinary())}let i=o.pb.payloads.Message.deserializeBinary(r.getPayload());t=i.getEncrypted()?await this._decryptPayload(i,r.getSrc()):i.getPayload();let s=o.pb.payloads.Payload.deserializeBinary(t),c=s.getData();switch(s.getType()){case o.pb.payloads.PayloadType.TEXT:c=o.pb.payloads.TextData.deserializeBinary(c).getText();break;case o.pb.payloads.PayloadType.ACK:return this.responseManager.respond(s.getReplyToId(),null,s.getType()),!0}if(s.getReplyToId().length)return this.responseManager.respond(s.getReplyToId(),c,s.getType()),!0;switch(s.getType()){case o.pb.payloads.PayloadType.TEXT:case o.pb.payloads.PayloadType.BINARY:case o.pb.payloads.PayloadType.SESSION:if(this.eventListeners.message.length>0){let e=await Promise.all(this.eventListeners.message.map(async e=>{try{return await e({src:r.getSrc(),payload:c,payloadType:s.getType(),isEncrypted:i.getEncrypted(),messageId:s.getMessageId(),noReply:s.getNoReply()})}catch(e){return console.log("Message handler error:",e),null}}));if(!s.getNoReply()){let t=!1;for(let n of e){if(!1===n)return!0;if(null!=n){this.send(r.getSrc(),n,{encrypt:i.getEncrypted(),msgHoldingSeconds:0,replyToId:s.getMessageId()}).catch(e=>{console.log("Send response error:",e)}),t=!0;break}}t||await this._sendACK(r.getSrc(),s.getMessageId(),i.getEncrypted())}}return!0;default:return!1}}_shouldUseTls(){return void 0!==this.options.tls?!!this.options.tls:"undefined"!=typeof window&&!!window.location&&"https:"===window.location.protocol}async _newWsAddr(e){let t,r,i,a;if(!e.addr){console.log("No address in node info",e),this.shouldReconnect?this._reconnect():this.isClosed||this._connectFailed();return}let c=this._shouldUseTls();try{this.options.webrtc?(t=this.peer,this.peer.setRemoteDescription(e.sdp)):(t=new n.default((c?"wss":"ws")+"://"+e.addr)).binaryType="arraybuffer"}catch(e){console.log("Create WebSocket or WebRTC failed,",e),this.shouldReconnect?this._reconnect():this.isClosed||this._connectFailed();return}if(this.ws){this.ws.onclose=()=>{};try{this.ws.close()}catch(e){}}if(this.isClosed){try{t.close()}catch(e){}return}if(this.ws=t,this.node=e,this.wallet.options.rpcServerAddr="",!c&&e.rpcAddr){let t="http://"+e.rpcAddr;o.rpc.getNodeState({rpcServerAddr:t}).then(e=>{"PERSIST_FINISHED"===e.syncState&&(this.wallet.options.rpcServerAddr=t)}).catch(e=>{console.log(e)})}new Promise((e,n)=>{r=e,i=setTimeout(()=>{this.ws===t?n(new o.errors.ConnectToNodeTimeoutError):e()},this.options.connectTimeout)}).then(()=>{clearTimeout(i)}).catch(e=>{this.isClosed||console.log("WebSocket or WebRTC connect timeout,",e),this.shouldReconnect?this._reconnect():this.isClosed||this._connectFailed()});let l=new Promise((e,r)=>{a=e,setTimeout(()=>{this.ws===t&&e(new o.errors.ChallengeTimeoutError)},s.waitForChallengeTimeout)});t.onopen=async()=>{r();let e={Action:d.setClient,Addr:this.addr},n=await l;!n||n instanceof o.errors.ChallengeTimeoutError||(e.ClientSalt=o.util.bytesToHex(n.ClientSalt),e.Signature=o.util.bytesToHex(n.Signature)),t.send(JSON.stringify(e)),this.shouldReconnect=!0,this.reconnectInterval=this.options.reconnectIntervalMin},t.onmessage=async e=>{let t=e.data;if(t instanceof ArrayBuffer||t instanceof Blob){try{t instanceof Blob&&(t=new Uint8Array(await t.arrayBuffer())),await this._handleMsg(t)||console.warn("Unhandled msg.")}catch(e){console.log(e)}return}let r=JSON.parse(t);if(void 0!==r.Error&&r.Error!==o.errors.rpcRespErrCodes.success){if(console.log(r),r.Error===o.errors.rpcRespErrCodes.wrongNode)this._newWsAddr(r.Result);else if(r.Action===d.setClient)try{this.ws&&this.ws.close()}catch(e){}return}switch(r.Action){case d.setClient:this.sigChainBlockHash=r.Result.sigChainBlockHash,!this.isReady&&(this.isReady=!0,this.eventListeners.connect.length>0&&this.eventListeners.connect.forEach(async e=>{try{await e(r.Result)}catch(e){console.log("Connect handler error:",e)}}));break;case d.updateSigChainBlockHash:this.sigChainBlockHash=r.Result;break;case d.authChallenge:let n=r.Challenge,i=o.util.hexToBytes(n),s=o.util.randomBytes(32);i=o.util.mergeTypedArrays(i,s);let c=o.hash.sha256Hex(o.util.bytesToHex(i)),l=await u.sign(this.key.privateKey,c);a({ClientSalt:s,Signature:o.util.hexToBytes(l)});break;default:console.warn("Unknown msg type:",r.Action)}},t.onclose=()=>{this.shouldReconnect?(console.warn("WebSocket unexpectedly closed."),this._reconnect()):this.isClosed||this._connectFailed()},t.onerror=e=>{this.eventListeners.wsError.length>0?this.eventListeners.wsError.forEach(async t=>{try{await t(e)}catch(e){console.log("WsError handler error:",e)}}):console.log(e.message)}}async _encryptPayload(e,t){if(Array.isArray(t)){let r=o.util.randomBytes(o.crypto.nonceLength),n=o.util.randomBytes(o.crypto.keyLength),i=await o.crypto.encryptSymmetric(e,r,n),s=[];for(let e=0;e0){if(s.length!=2*o.crypto.nonceLength)throw new o.errors.DecryptionError("invalid nonce length");let e=await this.key.decrypt(c,s.slice(0,o.crypto.nonceLength),i);if(null===e)throw new o.errors.DecryptionError("decrypt shared key failed");if(null===(r=await o.crypto.decryptSymmetric(n,s.slice(o.crypto.nonceLength),e)))throw new o.errors.DecryptionError("decrypt message failed")}else{if(s.length!=o.crypto.nonceLength)throw new o.errors.DecryptionError("invalid nonce length");if(null===(r=await this.key.decrypt(n,s,i)))throw new o.errors.DecryptionError("decrypt message failed")}return r}async getLatestBlock(){if(this.wallet.options.rpcServerAddr)try{return await i.default.getLatestBlock(this.options)}catch(e){}return await i.default.getLatestBlock(this.options)}async getRegistrant(e){if(this.wallet.options.rpcServerAddr)try{return await i.default.getRegistrant(e,this.wallet.options)}catch(e){}return await i.default.getRegistrant(e,this.options)}async getSubscribers(e,t={}){if(this.wallet.options.rpcServerAddr)try{return await i.default.getSubscribers(e,Object.assign({},this.wallet.options,t))}catch(e){}return await i.default.getSubscribers(e,Object.assign({},this.options,t))}async getSubscribersCount(e){if(this.wallet.options.rpcServerAddr)try{return await i.default.getSubscribersCount(e,this.wallet.options)}catch(e){}return await i.default.getSubscribersCount(e,this.options)}async getSubscription(e,t){if(this.wallet.options.rpcServerAddr)try{return await i.default.getSubscription(e,t,this.wallet.options)}catch(e){}return await i.default.getSubscription(e,t,this.options)}async getBalance(e){if(this.wallet.options.rpcServerAddr)try{return await i.default.getBalance(e||this.wallet.address,this.wallet.options)}catch(e){}return await i.default.getBalance(e||this.wallet.address,this.options)}async getNonce(e,t={}){if(this.wallet.options.rpcServerAddr)try{return await i.default.getNonce(e||this.wallet.address,Object.assign({},this.wallet.options,t))}catch(e){}return await i.default.getNonce(e||this.wallet.address,Object.assign({},this.options,t))}async sendTransaction(e){if(this.wallet.options.rpcServerAddr)try{return await i.default.sendTransaction(e,this.wallet.options)}catch(e){}return await i.default.sendTransaction(e,this.options)}transferTo(e,t,r={}){return o.rpc.transferTo.call(this,e,t,r)}registerName(e,t={}){return o.rpc.registerName.call(this,e,t)}transferName(e,t,r={}){return o.rpc.transferName.call(this,e,t,r)}deleteName(e,t={}){return o.rpc.deleteName.call(this,e,t)}subscribe(e,t,r="",n="",i={}){return o.rpc.subscribe.call(this,e,t,r,n,i)}unsubscribe(e,t="",r={}){return o.rpc.unsubscribe.call(this,e,t,r)}createTransaction(e,t,r={}){return this.wallet.createTransaction(e,t,r)}}t.default=y;class g{constructor(e,t,r,n){p(this,"messageId",void 0),p(this,"deadline",void 0),p(this,"responseHandler",void 0),p(this,"timeoutHandler",void 0),e instanceof Uint8Array&&(e=o.util.bytesToHex(e)),this.messageId=e,t&&(this.deadline=Date.now()+t),this.responseHandler=r,this.timeoutHandler=n}checkTimeout(e){return!!this.deadline&&(e||(e=Date.now()),e>this.deadline)}handleResponse(e){this.responseHandler&&this.responseHandler(e)}handleTimeout(){this.timeoutHandler&&this.timeoutHandler(Error("Message timeout"))}}class _{constructor(){p(this,"responseProcessors",void 0),p(this,"timer",void 0),this.responseProcessors=new Map,this.timer=null,this.checkTimeout()}add(e){this.responseProcessors.set(e.messageId,e)}clear(){for(let e of this.responseProcessors.values())e.handleTimeout();this.responseProcessors=new Map}stop(){clearTimeout(this.timer),this.clear()}respond(e,t,r){e instanceof Uint8Array&&(e=o.util.bytesToHex(e));let n=this.responseProcessors.get(e);n&&(n.handleResponse(t),this.responseProcessors.delete(e))}checkTimeout(){let e=[],t=Date.now();for(let r of this.responseProcessors.values())r.checkTimeout(t)&&e.push(r);e.forEach(e=>{e.handleTimeout(),this.responseProcessors.delete(e.messageId)}),this.timer=setTimeout(this.checkTimeout.bind(this),s.checkTimeoutInterval)}}},26816:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.waitForChallengeTimeout=t.defaultPublishOptions=t.defaultOptions=t.checkTimeoutInterval=void 0;let r={reconnectIntervalMin:1e3,reconnectIntervalMax:64e3,responseTimeout:5e3,connectTimeout:1e4,msgHoldingSeconds:0,encrypt:!0,rpcServerAddr:"https://mainnet-rpc-node-0001.nkn.org/mainnet/api/wallet",stunServerAddr:["stun:stun.l.google.com:19302","stun:stun.cloudflare.com:3478","stun:stunserver.stunprotocol.org:3478"],worker:!1};t.defaultOptions=r;let n={txPool:!1,offset:0,limit:1e3};t.defaultPublishOptions=n;let i=250;t.checkTimeoutInterval=i;let o=5e3;t.waitForChallengeTimeout=o},85349:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.default}});var n=i(r(3890));function i(e){return e&&e.__esModule?e:{default:e}}},12681:function(e,t,r){"use strict";var n=r(11530).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.addrToID=S,t.addrToPubkey=E,t.messageIdSize=t.maxClientMessageSize=void 0,t.newAckPayload=d,t.newBinaryPayload=f,t.newClientMessage=_,t.newMessage=g,t.newOutboundMessage=v,t.newPayload=h,t.newReceipt=b,t.newSessionPayload=y,t.newTextPayload=p,t.serializeSigChainElem=w,t.serializeSigChainMetadata=m;var i=c(r(25090)),o=a(r(21913));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function c(e){return e&&e.__esModule?e:{default:e}}let u=8;t.messageIdSize=u;let l=4e6;function h(e,t,r,n){let i=new o.pb.payloads.Payload;return i.setType(e),t?i.setReplyToId(t):n?i.setMessageId(n):i.setMessageId(o.util.randomBytes(u)),i.setData(r),i}function f(e,t,r){return h(o.pb.payloads.PayloadType.BINARY,t,e,r)}function p(e,t,r){let n=new o.pb.payloads.TextData;return n.setText(e),h(o.pb.payloads.PayloadType.TEXT,t,n.serializeBinary(),r)}function d(e,t){return h(o.pb.payloads.PayloadType.ACK,e,null,t)}function y(e,t){return h(o.pb.payloads.PayloadType.SESSION,null,e,t)}function g(e,t,r,n){let i=new o.pb.payloads.Message;return i.setPayload(e),i.setEncrypted(t),r&&i.setNonce(r),n&&i.setEncryptedKey(n),i}function _(e,t,r){let n=new o.pb.messages.ClientMessage;switch(n.setMessageType(e),n.setCompressionType(r),r){case o.pb.messages.CompressionType.COMPRESSION_NONE:break;case o.pb.messages.CompressionType.COMPRESSION_ZLIB:t=i.default.deflate(t);break;default:throw new o.errors.InvalidArgumentError("unknown compression type "+r)}return n.setMessage(t),n}async function v(e,t,r,i){let s,a,c,u;if(Array.isArray(t)||(t=[t]),0===t.length)throw new o.errors.InvalidArgumentError("no destination");if(Array.isArray(r)||(r=[r]),0===r.length)throw new o.errors.InvalidArgumentError("no payloads");if(r.length>1&&r.length!==t.length)throw new o.errors.InvalidArgumentError("invalid payload array length");let l=new o.pb.sigchain.SigChainElem;l.setNextPubkey(n.from(e.node.pubkey,"hex"));let h=w(l),f=new o.pb.sigchain.SigChain;f.setNonce(o.util.randomInt32()),e.sigChainBlockHash&&f.setBlockHash(n.from(e.sigChainBlockHash,"hex")),f.setSrcId(n.from(S(e.addr),"hex")),f.setSrcPubkey(n.from(e.key.publicKey,"hex"));let p=[];for(let i=0;i1?f.setDataSize(r[i].length):f.setDataSize(r[0].length),s=m(f),a=o.hash.sha256Hex(s),a=o.hash.sha256Hex(a+h),c=await e.key.sign(a),p.push(n.from(c,"hex"));let d=new o.pb.messages.OutboundMessage;return d.setDestsList(t),d.setPayloadsList(r),d.setMaxHoldingSeconds(i),d.setNonce(f.getNonce()),d.setBlockHash(f.getBlockHash()),d.setSignaturesList(p),u=r.length>1?o.pb.messages.CompressionType.COMPRESSION_ZLIB:o.pb.messages.CompressionType.COMPRESSION_NONE,_(o.pb.messages.ClientMessageType.OUTBOUND_MESSAGE,d.serializeBinary(),u)}async function b(e,t){let r=w(new o.pb.sigchain.SigChainElem),i=o.hash.sha256Hex(t);i=o.hash.sha256Hex(i+r);let s=await e.key.sign(i),a=new o.pb.messages.Receipt;return a.setPrevSignature(n.from(t,"hex")),a.setSignature(n.from(s,"hex")),_(o.pb.messages.ClientMessageType.RECEIPT,a.serializeBinary(),o.pb.messages.CompressionType.COMPRESSION_NONE)}function m(e){return""+(o.serialize.encodeUint32(e.getNonce())+o.serialize.encodeUint32(e.getDataSize())+o.serialize.encodeBytes(e.getBlockHash())+o.serialize.encodeBytes(e.getSrcId())+o.serialize.encodeBytes(e.getSrcPubkey())+o.serialize.encodeBytes(e.getDestId())+o.serialize.encodeBytes(e.getDestPubkey()))}function w(e){return""+(o.serialize.encodeBytes(e.getId())+o.serialize.encodeBytes(e.getNextPubkey())+o.serialize.encodeBool(e.getMining()))}function S(e){return o.hash.sha256(e)}function E(e){let t=e.split(".");return t[t.length-1]}t.maxClientMessageSize=l},5316:function(e,t){"use strict";function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;let n="ping",i="pong";class o{send(e){this.dc.send(e)}constructor(e){r(this,"config",void 0),r(this,"pc",void 0),r(this,"dc",void 0),r(this,"sdp",void 0),r(this,"isConnected",void 0),r(this,"onopen",void 0),r(this,"onmessage",void 0),r(this,"onclose",void 0),r(this,"onerror",void 0);let t={iceServers:[{urls:e}]};this.config=t,this.isConnected=!1}async offer(e){return new Promise(async(t,r)=>{try{this.pc&&"closed"!==this.pc.signalingState||(this.pc=new RTCPeerConnection(this.config)),this.pc.oniceconnectionstatechange=()=>{"failed"===this.pc.iceConnectionState&&this.pc.restartIce()},this.dc=this.pc.createDataChannel(e),this.dc.addEventListener("open",()=>{this.isConnected=!0,this.onopen&&this.onopen()}),this.dc.addEventListener("message",e=>{if(e.data==i){null!=this.pongHandler?this.pongHandler(i):console.log("Pong handler not set");return}if(e.data==n){this.dc.send(i);return}this.onmessage&&this.onmessage(e)}),this.dc.addEventListener("close",e=>{this.isConnected=!1,this.onclose&&this.onclose()}),this.dc.addEventListener("error",e=>{this.onerror&&this.onerror(e)}),await this.pc.createOffer(),await this.pc.setLocalDescription(),this.sdp=btoa(JSON.stringify(this.pc.localDescription)),t(this.sdp)}catch(e){r(e)}})}setRemoteDescription(e){let t=JSON.parse(atob(e));return this.pc.setRemoteDescription(t)}close(){this.dc.close(),this.pc.close()}}t.default=o},16835:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=s,t.encrypt=o;var n=i(r(58110));function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){return n.default.AES.encrypt(n.default.enc.Hex.parse(e),n.default.enc.Hex.parse(t),{iv:n.default.enc.Hex.parse(r),mode:n.default.mode.CBC,padding:n.default.pad.NoPadding}).ciphertext.toString(n.default.enc.Hex)}function s(e,t,r){return n.default.AES.decrypt(n.default.enc.Hex.parse(e).toString(n.default.enc.Base64),n.default.enc.Hex.parse(t),{iv:n.default.enc.Hex.parse(r),mode:n.default.mode.CBC,padding:n.default.pad.NoPadding}).toString()}},69073:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(6615);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}n.Decimal.set({minE:-8});class o extends n.Decimal{value(){return this.times(o.unit).floor()}}t.default=o,i(o,"unit",new n.Decimal("100000000"))},35033:function(e,t,r){"use strict";var n=r(11530).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.computeSharedKey=m,t.decryptSymmetric=S,t.ed25519PkToCurve25519=b,t.ed25519SkToCurve25519=v,t.encryptSymmetric=w,t.keyLength=void 0,t.keyPair=_,t.seedLength=t.publicKeyLength=t.nonceLength=void 0,t.sign=E,t.signatureLength=void 0;var i=l(r(45230)),o=l(r(73551)),s=l(r(77085)),a=u(r(41015));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function l(e){return e&&e.__esModule?e:{default:e}}let h=32;t.keyLength=h;let f=24;t.nonceLength=f;let p=32;t.publicKeyLength=p;let d=32;t.seedLength=d;let y=64;t.signatureLength=y;let g=!1;function _(e){let t=a.hexToBytes(e);try{let r=o.default.crypto_sign_seed_keypair(t);return{seed:e,publicKey:r.publicKey,privateKey:r.privateKey,curvePrivateKey:v(r.privateKey)}}catch(n){let r=s.default.sign.keyPair.fromSeed(t);return{seed:e,publicKey:r.publicKey,privateKey:r.secretKey,curvePrivateKey:i.default.convertSecretKey(r.secretKey)}}}function v(e){try{return o.default.crypto_sign_ed25519_sk_to_curve25519(e)}catch(t){return i.default.convertSecretKey(e)}}async function b(e){try{return g||(await o.default.ready,g=!0),o.default.crypto_sign_ed25519_pk_to_curve25519(e)}catch(t){return console.warn(t),i.default.convertPublicKey(e)}}async function m(e,t){let r,i=await b(n.from(t,"hex"));try{r=o.default.crypto_box_beforenm(i,e)}catch(t){console.warn(t),r=s.default.box.before(i,e)}return a.bytesToHex(r)}async function w(e,t,r){try{return g||(await o.default.ready,g=!0),o.default.crypto_box_easy_afternm(e,t,r)}catch(n){return console.warn(n),s.default.secretbox(e,t,r)}}async function S(e,t,r){try{return g||(await o.default.ready,g=!0),o.default.crypto_box_open_easy_afternm(e,t,r)}catch(n){return console.warn(n),s.default.secretbox.open(e,t,r)}}async function E(e,t){let r;try{g||(await o.default.ready,g=!0),r=o.default.crypto_sign_detached(n.from(t,"hex"),e)}catch(i){console.warn(i),r=s.default.sign.detached(n.from(t,"hex"),e)}return a.bytesToHex(r)}},4453:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rpcRespErrCodes=t.WrongPasswordError=t.UnknownError=t.ServerError=t.RpcTimeoutError=t.RpcError=t.NotEnoughBalanceError=t.InvalidWalletVersionError=t.InvalidWalletFormatError=t.InvalidResponseError=t.InvalidDestinationError=t.InvalidArgumentError=t.InvalidAddressError=t.DecryptionError=t.DataSizeTooLargeError=t.ConnectToNodeTimeoutError=t.ClientNotReadyError=t.ChallengeTimeoutError=t.AddrNotAllowedError=void 0;let r={success:0,wrongNode:48001,appendTxnPool:45021,invalidMethod:42001};t.rpcRespErrCodes=r;class n extends Error{constructor(e="address not allowed",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,n),this.name="AddrNotAllowedError"}}t.AddrNotAllowedError=n;class i extends Error{constructor(e="client not ready",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,i),this.name="ClientNotReadyError"}}t.ClientNotReadyError=i;class o extends Error{constructor(e="data size too large",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,o),this.name="DataSizeTooLargeError"}}t.DataSizeTooLargeError=o;class s extends Error{constructor(e="decrypt message error",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,s),this.name="DecryptionError"}}t.DecryptionError=s;class a extends Error{constructor(e="unknown error",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,a),this.name="UnknownError"}}t.UnknownError=a;class c extends Error{constructor(e="not enough balance",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,c),this.name="NotEnoughBalanceError"}}t.NotEnoughBalanceError=c;class u extends Error{constructor(e="wrong password",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,u),this.name="WrongPasswordError"}}t.WrongPasswordError=u;class l extends Error{constructor(e="invalid wallet address",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,l),this.name="InvalidAddressError"}}t.InvalidAddressError=l;class h extends Error{constructor(e="invalid wallet format",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,h),this.name="InvalidWalletFormatError"}}t.InvalidWalletFormatError=h;class f extends Error{constructor(e="invalid wallet version",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,f),this.name="InvalidWalletVersionError"}}t.InvalidWalletVersionError=f;class p extends Error{constructor(e="invalid argument",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,p),this.name="InvalidArgumentError"}}t.InvalidArgumentError=p;class d extends Error{constructor(e="invalid response from RPC server",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,d),this.name="InvalidResponseError"}}t.InvalidResponseError=d;class y extends Error{constructor(e="error from RPC server",...t){let r;super(r="object"==typeof e?e.message+": "+e.data:e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,y),this.name="ServerError",e.code&&(this.code=-e.code)}}t.ServerError=y;class g extends Error{constructor(e="invalid destination",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,g),this.name="InvalidDestinationError"}}t.InvalidDestinationError=g;class _ extends Error{constructor(e="rpc timeout",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,_),this.name="RpcTimeoutError"}}t.RpcTimeoutError=_;class v extends Error{constructor(e="rpc error",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,v),this.name="RpcError"}}t.RpcError=v;class b extends Error{constructor(e="challenge timeout",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,b),this.name="ChallengeTimeoutError"}}t.ChallengeTimeoutError=b;class m extends Error{constructor(e="connect to node timeout",...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,m),this.name="ConnectToNodeTimeoutError"}}t.ConnectToNodeTimeoutError=m},58373:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cryptoHexStringParse=o,t.doubleSha256=c,t.doubleSha256Hex=u,t.ripemd160=l,t.ripemd160Hex=h,t.sha256=s,t.sha256Hex=a;var n=i(r(58110));function i(e){return e&&e.__esModule?e:{default:e}}function o(e){return n.default.enc.Hex.parse(e)}function s(e){return n.default.SHA256(e).toString()}function a(e){return s(o(e))}function c(e){return n.default.SHA256(n.default.SHA256(e)).toString()}function u(e){return c(o(e))}function l(e){return n.default.RIPEMD160(e).toString()}function h(e){return l(o(e))}},21913:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Amount",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"Key",{enumerable:!0,get:function(){return i.default}}),t.util=t.serialize=t.rpc=t.pb=t.key=t.hash=t.errors=t.crypto=t.aes=void 0;var n=y(r(69073)),i=d(r(27645));t.key=i;var o=d(r(16835));t.aes=o;var s=d(r(35033));t.crypto=s;var a=d(r(4453));t.errors=a;var c=d(r(58373));t.hash=c;var u=d(r(63339));t.pb=u;var l=d(r(92110));t.rpc=l;var h=d(r(57308));t.serialize=h;var f=d(r(41015));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function y(e){return e&&e.__esModule?e:{default:e}}t.util=f},27645:function(e,t,r){"use strict";var n=r(11530).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=u(r(74975)),o=c(r(35033));c(r(4453));var s=c(r(41015));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class h{constructor(e,t={}){l(this,"seed",void 0),l(this,"publicKey",void 0),l(this,"privateKey",void 0),l(this,"curvePrivateKey",void 0),l(this,"sharedKeyCache",void 0),l(this,"useWorker",void 0),l(this,"worker",void 0),l(this,"workerMsgID",void 0),l(this,"workerMsgCache",void 0),e||(e=s.randomBytesHex(o.seedLength));let n=o.keyPair(e);this.seed=e,this.publicKey=s.bytesToHex(n.publicKey),this.privateKey=n.privateKey,this.curvePrivateKey=n.curvePrivateKey,this.sharedKeyCache=new Map,this.useWorker=this._shouldUseWorker(t.worker),this.worker=null,this.workerMsgID=0,this.workerMsgCache=new Map,this.useWorker&&(async()=>{try{if("function"==typeof t.worker)this.worker=await t.worker();else try{this.worker=(0,i.default)(r(8953))}catch(e){try{let e=r(25735);this.worker=new e}catch(e){throw"neither browserify nor webpack worker-loader is detected"}}this.worker.onmessage=e=>{if(void 0!==e.data.id&&this.workerMsgCache.has(e.data.id)){let t=this.workerMsgCache.get(e.data.id);e.data.error?t.reject(e.data.error):t.resolve(e.data.result),this.workerMsgCache.delete(e.data.id)}},await this._sendToWorker({action:"setSeed",seed:this.seed})}catch(e){console.warn("Launch web worker failed:",e),this.useWorker=!1}})()}_shouldUseWorker(e){return!!e&&"undefined"!=typeof window&&!!window.Worker}_sendToWorker(e){return new Promise((t,r)=>{let n=this.workerMsgID;this.workerMsgID++,this.workerMsgCache.set(n,{resolve:t,reject:r}),this.worker.postMessage(Object.assign({id:n},e))})}async computeSharedKey(e){if(this.useWorker)try{return await this._sendToWorker({action:"computeSharedKey",otherPubkey:e})}catch(e){console.warn("worker computeSharedKey failed, fallback to main thread:",e)}return await o.computeSharedKey(this.curvePrivateKey,e)}async getOrComputeSharedKey(e){let t=this.sharedKeyCache.get(e);return t||(t=await this.computeSharedKey(e),this.sharedKeyCache.set(e,t)),t}async encrypt(e,t,r={}){let i=await this.getOrComputeSharedKey(t);i=n.from(i,"hex");let a=r.nonce||s.randomBytes(o.nonceLength);return{message:await o.encryptSymmetric(e,a,i),nonce:a}}async decrypt(e,t,r,i={}){let s=await this.getOrComputeSharedKey(r);return s=n.from(s,"hex"),await o.decryptSymmetric(e,t,s)}async sign(e){if(this.useWorker)try{return await this._sendToWorker({action:"sign",message:e})}catch(e){console.warn("worker sign failed, fallback to main thread:",e)}return await o.sign(this.privateKey,e)}}t.default=h},63339:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transaction=t.sigchain=t.payloads=t.messages=void 0;var n=c(r(90647));t.messages=n;var i=c(r(260));t.payloads=i;var o=c(r(50817));t.sigchain=o;var s=c(r(96946));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}t.transaction=s},90647:function(e,t,r){"use strict";var n=r(24304),i=n,o=Function("return this")();i.exportSymbol("proto.messages.ClientMessage",null,o),i.exportSymbol("proto.messages.ClientMessageType",null,o),i.exportSymbol("proto.messages.CompressionType",null,o),i.exportSymbol("proto.messages.InboundMessage",null,o),i.exportSymbol("proto.messages.OutboundMessage",null,o),i.exportSymbol("proto.messages.Receipt",null,o),proto.messages.ClientMessage=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.messages.ClientMessage,n.Message),i.DEBUG&&!COMPILED&&(proto.messages.ClientMessage.displayName="proto.messages.ClientMessage"),proto.messages.OutboundMessage=function(e){n.Message.initialize(this,e,0,-1,proto.messages.OutboundMessage.repeatedFields_,null)},i.inherits(proto.messages.OutboundMessage,n.Message),i.DEBUG&&!COMPILED&&(proto.messages.OutboundMessage.displayName="proto.messages.OutboundMessage"),proto.messages.InboundMessage=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.messages.InboundMessage,n.Message),i.DEBUG&&!COMPILED&&(proto.messages.InboundMessage.displayName="proto.messages.InboundMessage"),proto.messages.Receipt=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.messages.Receipt,n.Message),i.DEBUG&&!COMPILED&&(proto.messages.Receipt.displayName="proto.messages.Receipt"),n.Message.GENERATE_TO_OBJECT&&(proto.messages.ClientMessage.prototype.toObject=function(e){return proto.messages.ClientMessage.toObject(e,this)},proto.messages.ClientMessage.toObject=function(e,t){var r={messageType:n.Message.getFieldWithDefault(t,1,0),message:t.getMessage_asB64(),compressionType:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),proto.messages.ClientMessage.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.messages.ClientMessage;return proto.messages.ClientMessage.deserializeBinaryFromReader(r,t)},proto.messages.ClientMessage.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readEnum();e.setMessageType(r);break;case 2:var r=t.readBytes();e.setMessage(r);break;case 3:var r=t.readEnum();e.setCompressionType(r);break;default:t.skipField()}return e},proto.messages.ClientMessage.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.messages.ClientMessage.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.messages.ClientMessage.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getMessageType())&&t.writeEnum(1,r),(r=e.getMessage_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getCompressionType())&&t.writeEnum(3,r)},proto.messages.ClientMessage.prototype.getMessageType=function(){return n.Message.getFieldWithDefault(this,1,0)},proto.messages.ClientMessage.prototype.setMessageType=function(e){n.Message.setProto3EnumField(this,1,e)},proto.messages.ClientMessage.prototype.getMessage=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.messages.ClientMessage.prototype.getMessage_asB64=function(){return n.Message.bytesAsB64(this.getMessage())},proto.messages.ClientMessage.prototype.getMessage_asU8=function(){return n.Message.bytesAsU8(this.getMessage())},proto.messages.ClientMessage.prototype.setMessage=function(e){n.Message.setProto3BytesField(this,2,e)},proto.messages.ClientMessage.prototype.getCompressionType=function(){return n.Message.getFieldWithDefault(this,3,0)},proto.messages.ClientMessage.prototype.setCompressionType=function(e){n.Message.setProto3EnumField(this,3,e)},proto.messages.OutboundMessage.repeatedFields_=[3,7,8],n.Message.GENERATE_TO_OBJECT&&(proto.messages.OutboundMessage.prototype.toObject=function(e){return proto.messages.OutboundMessage.toObject(e,this)},proto.messages.OutboundMessage.toObject=function(e,t){var r={dest:n.Message.getFieldWithDefault(t,1,""),payload:t.getPayload_asB64(),destsList:n.Message.getRepeatedField(t,3),maxHoldingSeconds:n.Message.getFieldWithDefault(t,4,0),nonce:n.Message.getFieldWithDefault(t,5,0),blockHash:t.getBlockHash_asB64(),signaturesList:t.getSignaturesList_asB64(),payloadsList:t.getPayloadsList_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.messages.OutboundMessage.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.messages.OutboundMessage;return proto.messages.OutboundMessage.deserializeBinaryFromReader(r,t)},proto.messages.OutboundMessage.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readString();e.setDest(r);break;case 2:var r=t.readBytes();e.setPayload(r);break;case 3:var r=t.readString();e.addDests(r);break;case 4:var r=t.readUint32();e.setMaxHoldingSeconds(r);break;case 5:var r=t.readUint32();e.setNonce(r);break;case 6:var r=t.readBytes();e.setBlockHash(r);break;case 7:var r=t.readBytes();e.addSignatures(r);break;case 8:var r=t.readBytes();e.addPayloads(r);break;default:t.skipField()}return e},proto.messages.OutboundMessage.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.messages.OutboundMessage.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.messages.OutboundMessage.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getDest()).length>0&&t.writeString(1,r),(r=e.getPayload_asU8()).length>0&&t.writeBytes(2,r),(r=e.getDestsList()).length>0&&t.writeRepeatedString(3,r),0!==(r=e.getMaxHoldingSeconds())&&t.writeUint32(4,r),0!==(r=e.getNonce())&&t.writeUint32(5,r),(r=e.getBlockHash_asU8()).length>0&&t.writeBytes(6,r),(r=e.getSignaturesList_asU8()).length>0&&t.writeRepeatedBytes(7,r),(r=e.getPayloadsList_asU8()).length>0&&t.writeRepeatedBytes(8,r)},proto.messages.OutboundMessage.prototype.getDest=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.messages.OutboundMessage.prototype.setDest=function(e){n.Message.setProto3StringField(this,1,e)},proto.messages.OutboundMessage.prototype.getPayload=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.messages.OutboundMessage.prototype.getPayload_asB64=function(){return n.Message.bytesAsB64(this.getPayload())},proto.messages.OutboundMessage.prototype.getPayload_asU8=function(){return n.Message.bytesAsU8(this.getPayload())},proto.messages.OutboundMessage.prototype.setPayload=function(e){n.Message.setProto3BytesField(this,2,e)},proto.messages.OutboundMessage.prototype.getDestsList=function(){return n.Message.getRepeatedField(this,3)},proto.messages.OutboundMessage.prototype.setDestsList=function(e){n.Message.setField(this,3,e||[])},proto.messages.OutboundMessage.prototype.addDests=function(e,t){n.Message.addToRepeatedField(this,3,e,t)},proto.messages.OutboundMessage.prototype.clearDestsList=function(){this.setDestsList([])},proto.messages.OutboundMessage.prototype.getMaxHoldingSeconds=function(){return n.Message.getFieldWithDefault(this,4,0)},proto.messages.OutboundMessage.prototype.setMaxHoldingSeconds=function(e){n.Message.setProto3IntField(this,4,e)},proto.messages.OutboundMessage.prototype.getNonce=function(){return n.Message.getFieldWithDefault(this,5,0)},proto.messages.OutboundMessage.prototype.setNonce=function(e){n.Message.setProto3IntField(this,5,e)},proto.messages.OutboundMessage.prototype.getBlockHash=function(){return n.Message.getFieldWithDefault(this,6,"")},proto.messages.OutboundMessage.prototype.getBlockHash_asB64=function(){return n.Message.bytesAsB64(this.getBlockHash())},proto.messages.OutboundMessage.prototype.getBlockHash_asU8=function(){return n.Message.bytesAsU8(this.getBlockHash())},proto.messages.OutboundMessage.prototype.setBlockHash=function(e){n.Message.setProto3BytesField(this,6,e)},proto.messages.OutboundMessage.prototype.getSignaturesList=function(){return n.Message.getRepeatedField(this,7)},proto.messages.OutboundMessage.prototype.getSignaturesList_asB64=function(){return n.Message.bytesListAsB64(this.getSignaturesList())},proto.messages.OutboundMessage.prototype.getSignaturesList_asU8=function(){return n.Message.bytesListAsU8(this.getSignaturesList())},proto.messages.OutboundMessage.prototype.setSignaturesList=function(e){n.Message.setField(this,7,e||[])},proto.messages.OutboundMessage.prototype.addSignatures=function(e,t){n.Message.addToRepeatedField(this,7,e,t)},proto.messages.OutboundMessage.prototype.clearSignaturesList=function(){this.setSignaturesList([])},proto.messages.OutboundMessage.prototype.getPayloadsList=function(){return n.Message.getRepeatedField(this,8)},proto.messages.OutboundMessage.prototype.getPayloadsList_asB64=function(){return n.Message.bytesListAsB64(this.getPayloadsList())},proto.messages.OutboundMessage.prototype.getPayloadsList_asU8=function(){return n.Message.bytesListAsU8(this.getPayloadsList())},proto.messages.OutboundMessage.prototype.setPayloadsList=function(e){n.Message.setField(this,8,e||[])},proto.messages.OutboundMessage.prototype.addPayloads=function(e,t){n.Message.addToRepeatedField(this,8,e,t)},proto.messages.OutboundMessage.prototype.clearPayloadsList=function(){this.setPayloadsList([])},n.Message.GENERATE_TO_OBJECT&&(proto.messages.InboundMessage.prototype.toObject=function(e){return proto.messages.InboundMessage.toObject(e,this)},proto.messages.InboundMessage.toObject=function(e,t){var r={src:n.Message.getFieldWithDefault(t,1,""),payload:t.getPayload_asB64(),prevSignature:t.getPrevSignature_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.messages.InboundMessage.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.messages.InboundMessage;return proto.messages.InboundMessage.deserializeBinaryFromReader(r,t)},proto.messages.InboundMessage.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readString();e.setSrc(r);break;case 2:var r=t.readBytes();e.setPayload(r);break;case 3:var r=t.readBytes();e.setPrevSignature(r);break;default:t.skipField()}return e},proto.messages.InboundMessage.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.messages.InboundMessage.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.messages.InboundMessage.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getSrc()).length>0&&t.writeString(1,r),(r=e.getPayload_asU8()).length>0&&t.writeBytes(2,r),(r=e.getPrevSignature_asU8()).length>0&&t.writeBytes(3,r)},proto.messages.InboundMessage.prototype.getSrc=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.messages.InboundMessage.prototype.setSrc=function(e){n.Message.setProto3StringField(this,1,e)},proto.messages.InboundMessage.prototype.getPayload=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.messages.InboundMessage.prototype.getPayload_asB64=function(){return n.Message.bytesAsB64(this.getPayload())},proto.messages.InboundMessage.prototype.getPayload_asU8=function(){return n.Message.bytesAsU8(this.getPayload())},proto.messages.InboundMessage.prototype.setPayload=function(e){n.Message.setProto3BytesField(this,2,e)},proto.messages.InboundMessage.prototype.getPrevSignature=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.messages.InboundMessage.prototype.getPrevSignature_asB64=function(){return n.Message.bytesAsB64(this.getPrevSignature())},proto.messages.InboundMessage.prototype.getPrevSignature_asU8=function(){return n.Message.bytesAsU8(this.getPrevSignature())},proto.messages.InboundMessage.prototype.setPrevSignature=function(e){n.Message.setProto3BytesField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(proto.messages.Receipt.prototype.toObject=function(e){return proto.messages.Receipt.toObject(e,this)},proto.messages.Receipt.toObject=function(e,t){var r={prevSignature:t.getPrevSignature_asB64(),signature:t.getSignature_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.messages.Receipt.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.messages.Receipt;return proto.messages.Receipt.deserializeBinaryFromReader(r,t)},proto.messages.Receipt.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setPrevSignature(r);break;case 2:var r=t.readBytes();e.setSignature(r);break;default:t.skipField()}return e},proto.messages.Receipt.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.messages.Receipt.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.messages.Receipt.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getPrevSignature_asU8()).length>0&&t.writeBytes(1,r),(r=e.getSignature_asU8()).length>0&&t.writeBytes(2,r)},proto.messages.Receipt.prototype.getPrevSignature=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.messages.Receipt.prototype.getPrevSignature_asB64=function(){return n.Message.bytesAsB64(this.getPrevSignature())},proto.messages.Receipt.prototype.getPrevSignature_asU8=function(){return n.Message.bytesAsU8(this.getPrevSignature())},proto.messages.Receipt.prototype.setPrevSignature=function(e){n.Message.setProto3BytesField(this,1,e)},proto.messages.Receipt.prototype.getSignature=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.messages.Receipt.prototype.getSignature_asB64=function(){return n.Message.bytesAsB64(this.getSignature())},proto.messages.Receipt.prototype.getSignature_asU8=function(){return n.Message.bytesAsU8(this.getSignature())},proto.messages.Receipt.prototype.setSignature=function(e){n.Message.setProto3BytesField(this,2,e)},proto.messages.ClientMessageType={OUTBOUND_MESSAGE:0,INBOUND_MESSAGE:1,RECEIPT:2},proto.messages.CompressionType={COMPRESSION_NONE:0,COMPRESSION_ZLIB:1},i.object.extend(t,proto.messages)},260:function(e,t,r){"use strict";var n=r(24304),i=n,o=Function("return this")();i.exportSymbol("proto.payloads.Message",null,o),i.exportSymbol("proto.payloads.Payload",null,o),i.exportSymbol("proto.payloads.PayloadType",null,o),i.exportSymbol("proto.payloads.TextData",null,o),proto.payloads.Message=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.payloads.Message,n.Message),i.DEBUG&&!COMPILED&&(proto.payloads.Message.displayName="proto.payloads.Message"),proto.payloads.Payload=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.payloads.Payload,n.Message),i.DEBUG&&!COMPILED&&(proto.payloads.Payload.displayName="proto.payloads.Payload"),proto.payloads.TextData=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.payloads.TextData,n.Message),i.DEBUG&&!COMPILED&&(proto.payloads.TextData.displayName="proto.payloads.TextData"),n.Message.GENERATE_TO_OBJECT&&(proto.payloads.Message.prototype.toObject=function(e){return proto.payloads.Message.toObject(e,this)},proto.payloads.Message.toObject=function(e,t){var r={payload:t.getPayload_asB64(),encrypted:n.Message.getFieldWithDefault(t,2,!1),nonce:t.getNonce_asB64(),encryptedKey:t.getEncryptedKey_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.payloads.Message.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.payloads.Message;return proto.payloads.Message.deserializeBinaryFromReader(r,t)},proto.payloads.Message.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setPayload(r);break;case 2:var r=t.readBool();e.setEncrypted(r);break;case 3:var r=t.readBytes();e.setNonce(r);break;case 4:var r=t.readBytes();e.setEncryptedKey(r);break;default:t.skipField()}return e},proto.payloads.Message.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.payloads.Message.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.payloads.Message.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getPayload_asU8()).length>0&&t.writeBytes(1,r),(r=e.getEncrypted())&&t.writeBool(2,r),(r=e.getNonce_asU8()).length>0&&t.writeBytes(3,r),(r=e.getEncryptedKey_asU8()).length>0&&t.writeBytes(4,r)},proto.payloads.Message.prototype.getPayload=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.payloads.Message.prototype.getPayload_asB64=function(){return n.Message.bytesAsB64(this.getPayload())},proto.payloads.Message.prototype.getPayload_asU8=function(){return n.Message.bytesAsU8(this.getPayload())},proto.payloads.Message.prototype.setPayload=function(e){n.Message.setProto3BytesField(this,1,e)},proto.payloads.Message.prototype.getEncrypted=function(){return n.Message.getFieldWithDefault(this,2,!1)},proto.payloads.Message.prototype.setEncrypted=function(e){n.Message.setProto3BooleanField(this,2,e)},proto.payloads.Message.prototype.getNonce=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.payloads.Message.prototype.getNonce_asB64=function(){return n.Message.bytesAsB64(this.getNonce())},proto.payloads.Message.prototype.getNonce_asU8=function(){return n.Message.bytesAsU8(this.getNonce())},proto.payloads.Message.prototype.setNonce=function(e){n.Message.setProto3BytesField(this,3,e)},proto.payloads.Message.prototype.getEncryptedKey=function(){return n.Message.getFieldWithDefault(this,4,"")},proto.payloads.Message.prototype.getEncryptedKey_asB64=function(){return n.Message.bytesAsB64(this.getEncryptedKey())},proto.payloads.Message.prototype.getEncryptedKey_asU8=function(){return n.Message.bytesAsU8(this.getEncryptedKey())},proto.payloads.Message.prototype.setEncryptedKey=function(e){n.Message.setProto3BytesField(this,4,e)},n.Message.GENERATE_TO_OBJECT&&(proto.payloads.Payload.prototype.toObject=function(e){return proto.payloads.Payload.toObject(e,this)},proto.payloads.Payload.toObject=function(e,t){var r={type:n.Message.getFieldWithDefault(t,1,0),messageId:t.getMessageId_asB64(),data:t.getData_asB64(),replyToId:t.getReplyToId_asB64(),noReply:n.Message.getFieldWithDefault(t,5,!1)};return e&&(r.$jspbMessageInstance=t),r}),proto.payloads.Payload.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.payloads.Payload;return proto.payloads.Payload.deserializeBinaryFromReader(r,t)},proto.payloads.Payload.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readEnum();e.setType(r);break;case 2:var r=t.readBytes();e.setMessageId(r);break;case 3:var r=t.readBytes();e.setData(r);break;case 4:var r=t.readBytes();e.setReplyToId(r);break;case 5:var r=t.readBool();e.setNoReply(r);break;default:t.skipField()}return e},proto.payloads.Payload.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.payloads.Payload.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.payloads.Payload.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getType())&&t.writeEnum(1,r),(r=e.getMessageId_asU8()).length>0&&t.writeBytes(2,r),(r=e.getData_asU8()).length>0&&t.writeBytes(3,r),(r=e.getReplyToId_asU8()).length>0&&t.writeBytes(4,r),(r=e.getNoReply())&&t.writeBool(5,r)},proto.payloads.Payload.prototype.getType=function(){return n.Message.getFieldWithDefault(this,1,0)},proto.payloads.Payload.prototype.setType=function(e){n.Message.setProto3EnumField(this,1,e)},proto.payloads.Payload.prototype.getMessageId=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.payloads.Payload.prototype.getMessageId_asB64=function(){return n.Message.bytesAsB64(this.getMessageId())},proto.payloads.Payload.prototype.getMessageId_asU8=function(){return n.Message.bytesAsU8(this.getMessageId())},proto.payloads.Payload.prototype.setMessageId=function(e){n.Message.setProto3BytesField(this,2,e)},proto.payloads.Payload.prototype.getData=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.payloads.Payload.prototype.getData_asB64=function(){return n.Message.bytesAsB64(this.getData())},proto.payloads.Payload.prototype.getData_asU8=function(){return n.Message.bytesAsU8(this.getData())},proto.payloads.Payload.prototype.setData=function(e){n.Message.setProto3BytesField(this,3,e)},proto.payloads.Payload.prototype.getReplyToId=function(){return n.Message.getFieldWithDefault(this,4,"")},proto.payloads.Payload.prototype.getReplyToId_asB64=function(){return n.Message.bytesAsB64(this.getReplyToId())},proto.payloads.Payload.prototype.getReplyToId_asU8=function(){return n.Message.bytesAsU8(this.getReplyToId())},proto.payloads.Payload.prototype.setReplyToId=function(e){n.Message.setProto3BytesField(this,4,e)},proto.payloads.Payload.prototype.getNoReply=function(){return n.Message.getFieldWithDefault(this,5,!1)},proto.payloads.Payload.prototype.setNoReply=function(e){n.Message.setProto3BooleanField(this,5,e)},n.Message.GENERATE_TO_OBJECT&&(proto.payloads.TextData.prototype.toObject=function(e){return proto.payloads.TextData.toObject(e,this)},proto.payloads.TextData.toObject=function(e,t){var r={text:n.Message.getFieldWithDefault(t,1,"")};return e&&(r.$jspbMessageInstance=t),r}),proto.payloads.TextData.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.payloads.TextData;return proto.payloads.TextData.deserializeBinaryFromReader(r,t)},proto.payloads.TextData.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)if(1===t.getFieldNumber()){var r=t.readString();e.setText(r)}else t.skipField();return e},proto.payloads.TextData.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.payloads.TextData.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.payloads.TextData.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getText()).length>0&&t.writeString(1,r)},proto.payloads.TextData.prototype.getText=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.payloads.TextData.prototype.setText=function(e){n.Message.setProto3StringField(this,1,e)},proto.payloads.PayloadType={BINARY:0,TEXT:1,ACK:2,SESSION:3},i.object.extend(t,proto.payloads)},50817:function(e,t,r){"use strict";var n=r(24304),i=n,o=Function("return this")();i.exportSymbol("proto.sigchain.SigAlgo",null,o),i.exportSymbol("proto.sigchain.SigChain",null,o),i.exportSymbol("proto.sigchain.SigChainElem",null,o),proto.sigchain.SigChainElem=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.sigchain.SigChainElem,n.Message),i.DEBUG&&!COMPILED&&(proto.sigchain.SigChainElem.displayName="proto.sigchain.SigChainElem"),proto.sigchain.SigChain=function(e){n.Message.initialize(this,e,0,-1,proto.sigchain.SigChain.repeatedFields_,null)},i.inherits(proto.sigchain.SigChain,n.Message),i.DEBUG&&!COMPILED&&(proto.sigchain.SigChain.displayName="proto.sigchain.SigChain"),n.Message.GENERATE_TO_OBJECT&&(proto.sigchain.SigChainElem.prototype.toObject=function(e){return proto.sigchain.SigChainElem.toObject(e,this)},proto.sigchain.SigChainElem.toObject=function(e,t){var r={id:t.getId_asB64(),nextPubkey:t.getNextPubkey_asB64(),mining:n.Message.getFieldWithDefault(t,3,!1),signature:t.getSignature_asB64(),sigAlgo:n.Message.getFieldWithDefault(t,5,0),vrf:t.getVrf_asB64(),proof:t.getProof_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.sigchain.SigChainElem.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.sigchain.SigChainElem;return proto.sigchain.SigChainElem.deserializeBinaryFromReader(r,t)},proto.sigchain.SigChainElem.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setId(r);break;case 2:var r=t.readBytes();e.setNextPubkey(r);break;case 3:var r=t.readBool();e.setMining(r);break;case 4:var r=t.readBytes();e.setSignature(r);break;case 5:var r=t.readEnum();e.setSigAlgo(r);break;case 6:var r=t.readBytes();e.setVrf(r);break;case 7:var r=t.readBytes();e.setProof(r);break;default:t.skipField()}return e},proto.sigchain.SigChainElem.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.sigchain.SigChainElem.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.sigchain.SigChainElem.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getId_asU8()).length>0&&t.writeBytes(1,r),(r=e.getNextPubkey_asU8()).length>0&&t.writeBytes(2,r),(r=e.getMining())&&t.writeBool(3,r),(r=e.getSignature_asU8()).length>0&&t.writeBytes(4,r),0!==(r=e.getSigAlgo())&&t.writeEnum(5,r),(r=e.getVrf_asU8()).length>0&&t.writeBytes(6,r),(r=e.getProof_asU8()).length>0&&t.writeBytes(7,r)},proto.sigchain.SigChainElem.prototype.getId=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.sigchain.SigChainElem.prototype.getId_asB64=function(){return n.Message.bytesAsB64(this.getId())},proto.sigchain.SigChainElem.prototype.getId_asU8=function(){return n.Message.bytesAsU8(this.getId())},proto.sigchain.SigChainElem.prototype.setId=function(e){n.Message.setProto3BytesField(this,1,e)},proto.sigchain.SigChainElem.prototype.getNextPubkey=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.sigchain.SigChainElem.prototype.getNextPubkey_asB64=function(){return n.Message.bytesAsB64(this.getNextPubkey())},proto.sigchain.SigChainElem.prototype.getNextPubkey_asU8=function(){return n.Message.bytesAsU8(this.getNextPubkey())},proto.sigchain.SigChainElem.prototype.setNextPubkey=function(e){n.Message.setProto3BytesField(this,2,e)},proto.sigchain.SigChainElem.prototype.getMining=function(){return n.Message.getFieldWithDefault(this,3,!1)},proto.sigchain.SigChainElem.prototype.setMining=function(e){n.Message.setProto3BooleanField(this,3,e)},proto.sigchain.SigChainElem.prototype.getSignature=function(){return n.Message.getFieldWithDefault(this,4,"")},proto.sigchain.SigChainElem.prototype.getSignature_asB64=function(){return n.Message.bytesAsB64(this.getSignature())},proto.sigchain.SigChainElem.prototype.getSignature_asU8=function(){return n.Message.bytesAsU8(this.getSignature())},proto.sigchain.SigChainElem.prototype.setSignature=function(e){n.Message.setProto3BytesField(this,4,e)},proto.sigchain.SigChainElem.prototype.getSigAlgo=function(){return n.Message.getFieldWithDefault(this,5,0)},proto.sigchain.SigChainElem.prototype.setSigAlgo=function(e){n.Message.setProto3EnumField(this,5,e)},proto.sigchain.SigChainElem.prototype.getVrf=function(){return n.Message.getFieldWithDefault(this,6,"")},proto.sigchain.SigChainElem.prototype.getVrf_asB64=function(){return n.Message.bytesAsB64(this.getVrf())},proto.sigchain.SigChainElem.prototype.getVrf_asU8=function(){return n.Message.bytesAsU8(this.getVrf())},proto.sigchain.SigChainElem.prototype.setVrf=function(e){n.Message.setProto3BytesField(this,6,e)},proto.sigchain.SigChainElem.prototype.getProof=function(){return n.Message.getFieldWithDefault(this,7,"")},proto.sigchain.SigChainElem.prototype.getProof_asB64=function(){return n.Message.bytesAsB64(this.getProof())},proto.sigchain.SigChainElem.prototype.getProof_asU8=function(){return n.Message.bytesAsU8(this.getProof())},proto.sigchain.SigChainElem.prototype.setProof=function(e){n.Message.setProto3BytesField(this,7,e)},proto.sigchain.SigChain.repeatedFields_=[8],n.Message.GENERATE_TO_OBJECT&&(proto.sigchain.SigChain.prototype.toObject=function(e){return proto.sigchain.SigChain.toObject(e,this)},proto.sigchain.SigChain.toObject=function(e,t){var r={nonce:n.Message.getFieldWithDefault(t,1,0),dataSize:n.Message.getFieldWithDefault(t,2,0),blockHash:t.getBlockHash_asB64(),srcId:t.getSrcId_asB64(),srcPubkey:t.getSrcPubkey_asB64(),destId:t.getDestId_asB64(),destPubkey:t.getDestPubkey_asB64(),elemsList:n.Message.toObjectList(t.getElemsList(),proto.sigchain.SigChainElem.toObject,e)};return e&&(r.$jspbMessageInstance=t),r}),proto.sigchain.SigChain.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.sigchain.SigChain;return proto.sigchain.SigChain.deserializeBinaryFromReader(r,t)},proto.sigchain.SigChain.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readUint32();e.setNonce(r);break;case 2:var r=t.readUint32();e.setDataSize(r);break;case 3:var r=t.readBytes();e.setBlockHash(r);break;case 4:var r=t.readBytes();e.setSrcId(r);break;case 5:var r=t.readBytes();e.setSrcPubkey(r);break;case 6:var r=t.readBytes();e.setDestId(r);break;case 7:var r=t.readBytes();e.setDestPubkey(r);break;case 8:var r=new proto.sigchain.SigChainElem;t.readMessage(r,proto.sigchain.SigChainElem.deserializeBinaryFromReader),e.addElems(r);break;default:t.skipField()}return e},proto.sigchain.SigChain.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.sigchain.SigChain.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.sigchain.SigChain.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getNonce())&&t.writeUint32(1,r),0!==(r=e.getDataSize())&&t.writeUint32(2,r),(r=e.getBlockHash_asU8()).length>0&&t.writeBytes(3,r),(r=e.getSrcId_asU8()).length>0&&t.writeBytes(4,r),(r=e.getSrcPubkey_asU8()).length>0&&t.writeBytes(5,r),(r=e.getDestId_asU8()).length>0&&t.writeBytes(6,r),(r=e.getDestPubkey_asU8()).length>0&&t.writeBytes(7,r),(r=e.getElemsList()).length>0&&t.writeRepeatedMessage(8,r,proto.sigchain.SigChainElem.serializeBinaryToWriter)},proto.sigchain.SigChain.prototype.getNonce=function(){return n.Message.getFieldWithDefault(this,1,0)},proto.sigchain.SigChain.prototype.setNonce=function(e){n.Message.setProto3IntField(this,1,e)},proto.sigchain.SigChain.prototype.getDataSize=function(){return n.Message.getFieldWithDefault(this,2,0)},proto.sigchain.SigChain.prototype.setDataSize=function(e){n.Message.setProto3IntField(this,2,e)},proto.sigchain.SigChain.prototype.getBlockHash=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.sigchain.SigChain.prototype.getBlockHash_asB64=function(){return n.Message.bytesAsB64(this.getBlockHash())},proto.sigchain.SigChain.prototype.getBlockHash_asU8=function(){return n.Message.bytesAsU8(this.getBlockHash())},proto.sigchain.SigChain.prototype.setBlockHash=function(e){n.Message.setProto3BytesField(this,3,e)},proto.sigchain.SigChain.prototype.getSrcId=function(){return n.Message.getFieldWithDefault(this,4,"")},proto.sigchain.SigChain.prototype.getSrcId_asB64=function(){return n.Message.bytesAsB64(this.getSrcId())},proto.sigchain.SigChain.prototype.getSrcId_asU8=function(){return n.Message.bytesAsU8(this.getSrcId())},proto.sigchain.SigChain.prototype.setSrcId=function(e){n.Message.setProto3BytesField(this,4,e)},proto.sigchain.SigChain.prototype.getSrcPubkey=function(){return n.Message.getFieldWithDefault(this,5,"")},proto.sigchain.SigChain.prototype.getSrcPubkey_asB64=function(){return n.Message.bytesAsB64(this.getSrcPubkey())},proto.sigchain.SigChain.prototype.getSrcPubkey_asU8=function(){return n.Message.bytesAsU8(this.getSrcPubkey())},proto.sigchain.SigChain.prototype.setSrcPubkey=function(e){n.Message.setProto3BytesField(this,5,e)},proto.sigchain.SigChain.prototype.getDestId=function(){return n.Message.getFieldWithDefault(this,6,"")},proto.sigchain.SigChain.prototype.getDestId_asB64=function(){return n.Message.bytesAsB64(this.getDestId())},proto.sigchain.SigChain.prototype.getDestId_asU8=function(){return n.Message.bytesAsU8(this.getDestId())},proto.sigchain.SigChain.prototype.setDestId=function(e){n.Message.setProto3BytesField(this,6,e)},proto.sigchain.SigChain.prototype.getDestPubkey=function(){return n.Message.getFieldWithDefault(this,7,"")},proto.sigchain.SigChain.prototype.getDestPubkey_asB64=function(){return n.Message.bytesAsB64(this.getDestPubkey())},proto.sigchain.SigChain.prototype.getDestPubkey_asU8=function(){return n.Message.bytesAsU8(this.getDestPubkey())},proto.sigchain.SigChain.prototype.setDestPubkey=function(e){n.Message.setProto3BytesField(this,7,e)},proto.sigchain.SigChain.prototype.getElemsList=function(){return n.Message.getRepeatedWrapperField(this,proto.sigchain.SigChainElem,8)},proto.sigchain.SigChain.prototype.setElemsList=function(e){n.Message.setRepeatedWrapperField(this,8,e)},proto.sigchain.SigChain.prototype.addElems=function(e,t){return n.Message.addToRepeatedWrapperField(this,8,e,proto.sigchain.SigChainElem,t)},proto.sigchain.SigChain.prototype.clearElemsList=function(){this.setElemsList([])},proto.sigchain.SigAlgo={SIGNATURE:0,VRF:1},i.object.extend(t,proto.sigchain)},96946:function(e,t,r){"use strict";var n=r(24304),i=n,o=Function("return this")();i.exportSymbol("proto.transaction.Coinbase",null,o),i.exportSymbol("proto.transaction.DeleteName",null,o),i.exportSymbol("proto.transaction.GenerateID",null,o),i.exportSymbol("proto.transaction.IssueAsset",null,o),i.exportSymbol("proto.transaction.NanoPay",null,o),i.exportSymbol("proto.transaction.Payload",null,o),i.exportSymbol("proto.transaction.PayloadType",null,o),i.exportSymbol("proto.transaction.Program",null,o),i.exportSymbol("proto.transaction.RegisterName",null,o),i.exportSymbol("proto.transaction.SigChainTxn",null,o),i.exportSymbol("proto.transaction.Subscribe",null,o),i.exportSymbol("proto.transaction.Transaction",null,o),i.exportSymbol("proto.transaction.TransferAsset",null,o),i.exportSymbol("proto.transaction.TransferName",null,o),i.exportSymbol("proto.transaction.UnsignedTx",null,o),i.exportSymbol("proto.transaction.Unsubscribe",null,o),proto.transaction.UnsignedTx=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.UnsignedTx,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.UnsignedTx.displayName="proto.transaction.UnsignedTx"),proto.transaction.Transaction=function(e){n.Message.initialize(this,e,0,-1,proto.transaction.Transaction.repeatedFields_,null)},i.inherits(proto.transaction.Transaction,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.Transaction.displayName="proto.transaction.Transaction"),proto.transaction.Program=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.Program,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.Program.displayName="proto.transaction.Program"),proto.transaction.Payload=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.Payload,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.Payload.displayName="proto.transaction.Payload"),proto.transaction.Coinbase=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.Coinbase,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.Coinbase.displayName="proto.transaction.Coinbase"),proto.transaction.SigChainTxn=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.SigChainTxn,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.SigChainTxn.displayName="proto.transaction.SigChainTxn"),proto.transaction.RegisterName=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.RegisterName,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.RegisterName.displayName="proto.transaction.RegisterName"),proto.transaction.TransferName=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.TransferName,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.TransferName.displayName="proto.transaction.TransferName"),proto.transaction.DeleteName=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.DeleteName,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.DeleteName.displayName="proto.transaction.DeleteName"),proto.transaction.Subscribe=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.Subscribe,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.Subscribe.displayName="proto.transaction.Subscribe"),proto.transaction.Unsubscribe=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.Unsubscribe,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.Unsubscribe.displayName="proto.transaction.Unsubscribe"),proto.transaction.TransferAsset=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.TransferAsset,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.TransferAsset.displayName="proto.transaction.TransferAsset"),proto.transaction.GenerateID=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.GenerateID,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.GenerateID.displayName="proto.transaction.GenerateID"),proto.transaction.NanoPay=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.NanoPay,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.NanoPay.displayName="proto.transaction.NanoPay"),proto.transaction.IssueAsset=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.transaction.IssueAsset,n.Message),i.DEBUG&&!COMPILED&&(proto.transaction.IssueAsset.displayName="proto.transaction.IssueAsset"),n.Message.GENERATE_TO_OBJECT&&(proto.transaction.UnsignedTx.prototype.toObject=function(e){return proto.transaction.UnsignedTx.toObject(e,this)},proto.transaction.UnsignedTx.toObject=function(e,t){var r,i={payload:(r=t.getPayload())&&proto.transaction.Payload.toObject(e,r),nonce:n.Message.getFieldWithDefault(t,2,0),fee:n.Message.getFieldWithDefault(t,3,0),attributes:t.getAttributes_asB64()};return e&&(i.$jspbMessageInstance=t),i}),proto.transaction.UnsignedTx.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.UnsignedTx;return proto.transaction.UnsignedTx.deserializeBinaryFromReader(r,t)},proto.transaction.UnsignedTx.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=new proto.transaction.Payload;t.readMessage(r,proto.transaction.Payload.deserializeBinaryFromReader),e.setPayload(r);break;case 2:var r=t.readUint64();e.setNonce(r);break;case 3:var r=t.readInt64();e.setFee(r);break;case 4:var r=t.readBytes();e.setAttributes(r);break;default:t.skipField()}return e},proto.transaction.UnsignedTx.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.UnsignedTx.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.UnsignedTx.serializeBinaryToWriter=function(e,t){var r=void 0;null!=(r=e.getPayload())&&t.writeMessage(1,r,proto.transaction.Payload.serializeBinaryToWriter),0!==(r=e.getNonce())&&t.writeUint64(2,r),0!==(r=e.getFee())&&t.writeInt64(3,r),(r=e.getAttributes_asU8()).length>0&&t.writeBytes(4,r)},proto.transaction.UnsignedTx.prototype.getPayload=function(){return n.Message.getWrapperField(this,proto.transaction.Payload,1)},proto.transaction.UnsignedTx.prototype.setPayload=function(e){n.Message.setWrapperField(this,1,e)},proto.transaction.UnsignedTx.prototype.clearPayload=function(){this.setPayload(void 0)},proto.transaction.UnsignedTx.prototype.hasPayload=function(){return null!=n.Message.getField(this,1)},proto.transaction.UnsignedTx.prototype.getNonce=function(){return n.Message.getFieldWithDefault(this,2,0)},proto.transaction.UnsignedTx.prototype.setNonce=function(e){n.Message.setProto3IntField(this,2,e)},proto.transaction.UnsignedTx.prototype.getFee=function(){return n.Message.getFieldWithDefault(this,3,0)},proto.transaction.UnsignedTx.prototype.setFee=function(e){n.Message.setProto3IntField(this,3,e)},proto.transaction.UnsignedTx.prototype.getAttributes=function(){return n.Message.getFieldWithDefault(this,4,"")},proto.transaction.UnsignedTx.prototype.getAttributes_asB64=function(){return n.Message.bytesAsB64(this.getAttributes())},proto.transaction.UnsignedTx.prototype.getAttributes_asU8=function(){return n.Message.bytesAsU8(this.getAttributes())},proto.transaction.UnsignedTx.prototype.setAttributes=function(e){n.Message.setProto3BytesField(this,4,e)},proto.transaction.Transaction.repeatedFields_=[2],n.Message.GENERATE_TO_OBJECT&&(proto.transaction.Transaction.prototype.toObject=function(e){return proto.transaction.Transaction.toObject(e,this)},proto.transaction.Transaction.toObject=function(e,t){var r,i={unsignedTx:(r=t.getUnsignedTx())&&proto.transaction.UnsignedTx.toObject(e,r),programsList:n.Message.toObjectList(t.getProgramsList(),proto.transaction.Program.toObject,e)};return e&&(i.$jspbMessageInstance=t),i}),proto.transaction.Transaction.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.Transaction;return proto.transaction.Transaction.deserializeBinaryFromReader(r,t)},proto.transaction.Transaction.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=new proto.transaction.UnsignedTx;t.readMessage(r,proto.transaction.UnsignedTx.deserializeBinaryFromReader),e.setUnsignedTx(r);break;case 2:var r=new proto.transaction.Program;t.readMessage(r,proto.transaction.Program.deserializeBinaryFromReader),e.addPrograms(r);break;default:t.skipField()}return e},proto.transaction.Transaction.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.Transaction.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.Transaction.serializeBinaryToWriter=function(e,t){var r=void 0;null!=(r=e.getUnsignedTx())&&t.writeMessage(1,r,proto.transaction.UnsignedTx.serializeBinaryToWriter),(r=e.getProgramsList()).length>0&&t.writeRepeatedMessage(2,r,proto.transaction.Program.serializeBinaryToWriter)},proto.transaction.Transaction.prototype.getUnsignedTx=function(){return n.Message.getWrapperField(this,proto.transaction.UnsignedTx,1)},proto.transaction.Transaction.prototype.setUnsignedTx=function(e){n.Message.setWrapperField(this,1,e)},proto.transaction.Transaction.prototype.clearUnsignedTx=function(){this.setUnsignedTx(void 0)},proto.transaction.Transaction.prototype.hasUnsignedTx=function(){return null!=n.Message.getField(this,1)},proto.transaction.Transaction.prototype.getProgramsList=function(){return n.Message.getRepeatedWrapperField(this,proto.transaction.Program,2)},proto.transaction.Transaction.prototype.setProgramsList=function(e){n.Message.setRepeatedWrapperField(this,2,e)},proto.transaction.Transaction.prototype.addPrograms=function(e,t){return n.Message.addToRepeatedWrapperField(this,2,e,proto.transaction.Program,t)},proto.transaction.Transaction.prototype.clearProgramsList=function(){this.setProgramsList([])},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.Program.prototype.toObject=function(e){return proto.transaction.Program.toObject(e,this)},proto.transaction.Program.toObject=function(e,t){var r={code:t.getCode_asB64(),parameter:t.getParameter_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.Program.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.Program;return proto.transaction.Program.deserializeBinaryFromReader(r,t)},proto.transaction.Program.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setCode(r);break;case 2:var r=t.readBytes();e.setParameter(r);break;default:t.skipField()}return e},proto.transaction.Program.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.Program.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.Program.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getCode_asU8()).length>0&&t.writeBytes(1,r),(r=e.getParameter_asU8()).length>0&&t.writeBytes(2,r)},proto.transaction.Program.prototype.getCode=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.Program.prototype.getCode_asB64=function(){return n.Message.bytesAsB64(this.getCode())},proto.transaction.Program.prototype.getCode_asU8=function(){return n.Message.bytesAsU8(this.getCode())},proto.transaction.Program.prototype.setCode=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.Program.prototype.getParameter=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.Program.prototype.getParameter_asB64=function(){return n.Message.bytesAsB64(this.getParameter())},proto.transaction.Program.prototype.getParameter_asU8=function(){return n.Message.bytesAsU8(this.getParameter())},proto.transaction.Program.prototype.setParameter=function(e){n.Message.setProto3BytesField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.Payload.prototype.toObject=function(e){return proto.transaction.Payload.toObject(e,this)},proto.transaction.Payload.toObject=function(e,t){var r={type:n.Message.getFieldWithDefault(t,1,0),data:t.getData_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.Payload.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.Payload;return proto.transaction.Payload.deserializeBinaryFromReader(r,t)},proto.transaction.Payload.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readEnum();e.setType(r);break;case 2:var r=t.readBytes();e.setData(r);break;default:t.skipField()}return e},proto.transaction.Payload.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.Payload.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.Payload.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getType())&&t.writeEnum(1,r),(r=e.getData_asU8()).length>0&&t.writeBytes(2,r)},proto.transaction.Payload.prototype.getType=function(){return n.Message.getFieldWithDefault(this,1,0)},proto.transaction.Payload.prototype.setType=function(e){n.Message.setProto3EnumField(this,1,e)},proto.transaction.Payload.prototype.getData=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.Payload.prototype.getData_asB64=function(){return n.Message.bytesAsB64(this.getData())},proto.transaction.Payload.prototype.getData_asU8=function(){return n.Message.bytesAsU8(this.getData())},proto.transaction.Payload.prototype.setData=function(e){n.Message.setProto3BytesField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.Coinbase.prototype.toObject=function(e){return proto.transaction.Coinbase.toObject(e,this)},proto.transaction.Coinbase.toObject=function(e,t){var r={sender:t.getSender_asB64(),recipient:t.getRecipient_asB64(),amount:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.Coinbase.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.Coinbase;return proto.transaction.Coinbase.deserializeBinaryFromReader(r,t)},proto.transaction.Coinbase.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setSender(r);break;case 2:var r=t.readBytes();e.setRecipient(r);break;case 3:var r=t.readInt64();e.setAmount(r);break;default:t.skipField()}return e},proto.transaction.Coinbase.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.Coinbase.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.Coinbase.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getSender_asU8()).length>0&&t.writeBytes(1,r),(r=e.getRecipient_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getAmount())&&t.writeInt64(3,r)},proto.transaction.Coinbase.prototype.getSender=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.Coinbase.prototype.getSender_asB64=function(){return n.Message.bytesAsB64(this.getSender())},proto.transaction.Coinbase.prototype.getSender_asU8=function(){return n.Message.bytesAsU8(this.getSender())},proto.transaction.Coinbase.prototype.setSender=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.Coinbase.prototype.getRecipient=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.Coinbase.prototype.getRecipient_asB64=function(){return n.Message.bytesAsB64(this.getRecipient())},proto.transaction.Coinbase.prototype.getRecipient_asU8=function(){return n.Message.bytesAsU8(this.getRecipient())},proto.transaction.Coinbase.prototype.setRecipient=function(e){n.Message.setProto3BytesField(this,2,e)},proto.transaction.Coinbase.prototype.getAmount=function(){return n.Message.getFieldWithDefault(this,3,0)},proto.transaction.Coinbase.prototype.setAmount=function(e){n.Message.setProto3IntField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.SigChainTxn.prototype.toObject=function(e){return proto.transaction.SigChainTxn.toObject(e,this)},proto.transaction.SigChainTxn.toObject=function(e,t){var r={sigChain:t.getSigChain_asB64(),submitter:t.getSubmitter_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.SigChainTxn.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.SigChainTxn;return proto.transaction.SigChainTxn.deserializeBinaryFromReader(r,t)},proto.transaction.SigChainTxn.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setSigChain(r);break;case 2:var r=t.readBytes();e.setSubmitter(r);break;default:t.skipField()}return e},proto.transaction.SigChainTxn.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.SigChainTxn.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.SigChainTxn.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getSigChain_asU8()).length>0&&t.writeBytes(1,r),(r=e.getSubmitter_asU8()).length>0&&t.writeBytes(2,r)},proto.transaction.SigChainTxn.prototype.getSigChain=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.SigChainTxn.prototype.getSigChain_asB64=function(){return n.Message.bytesAsB64(this.getSigChain())},proto.transaction.SigChainTxn.prototype.getSigChain_asU8=function(){return n.Message.bytesAsU8(this.getSigChain())},proto.transaction.SigChainTxn.prototype.setSigChain=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.SigChainTxn.prototype.getSubmitter=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.SigChainTxn.prototype.getSubmitter_asB64=function(){return n.Message.bytesAsB64(this.getSubmitter())},proto.transaction.SigChainTxn.prototype.getSubmitter_asU8=function(){return n.Message.bytesAsU8(this.getSubmitter())},proto.transaction.SigChainTxn.prototype.setSubmitter=function(e){n.Message.setProto3BytesField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.RegisterName.prototype.toObject=function(e){return proto.transaction.RegisterName.toObject(e,this)},proto.transaction.RegisterName.toObject=function(e,t){var r={registrant:t.getRegistrant_asB64(),name:n.Message.getFieldWithDefault(t,2,""),registrationFee:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.RegisterName.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.RegisterName;return proto.transaction.RegisterName.deserializeBinaryFromReader(r,t)},proto.transaction.RegisterName.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setRegistrant(r);break;case 2:var r=t.readString();e.setName(r);break;case 3:var r=t.readInt64();e.setRegistrationFee(r);break;default:t.skipField()}return e},proto.transaction.RegisterName.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.RegisterName.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.RegisterName.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getRegistrant_asU8()).length>0&&t.writeBytes(1,r),(r=e.getName()).length>0&&t.writeString(2,r),0!==(r=e.getRegistrationFee())&&t.writeInt64(3,r)},proto.transaction.RegisterName.prototype.getRegistrant=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.RegisterName.prototype.getRegistrant_asB64=function(){return n.Message.bytesAsB64(this.getRegistrant())},proto.transaction.RegisterName.prototype.getRegistrant_asU8=function(){return n.Message.bytesAsU8(this.getRegistrant())},proto.transaction.RegisterName.prototype.setRegistrant=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.RegisterName.prototype.getName=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.RegisterName.prototype.setName=function(e){n.Message.setProto3StringField(this,2,e)},proto.transaction.RegisterName.prototype.getRegistrationFee=function(){return n.Message.getFieldWithDefault(this,3,0)},proto.transaction.RegisterName.prototype.setRegistrationFee=function(e){n.Message.setProto3IntField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.TransferName.prototype.toObject=function(e){return proto.transaction.TransferName.toObject(e,this)},proto.transaction.TransferName.toObject=function(e,t){var r={name:n.Message.getFieldWithDefault(t,1,""),registrant:t.getRegistrant_asB64(),recipient:t.getRecipient_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.TransferName.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.TransferName;return proto.transaction.TransferName.deserializeBinaryFromReader(r,t)},proto.transaction.TransferName.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readString();e.setName(r);break;case 2:var r=t.readBytes();e.setRegistrant(r);break;case 3:var r=t.readBytes();e.setRecipient(r);break;default:t.skipField()}return e},proto.transaction.TransferName.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.TransferName.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.TransferName.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getName()).length>0&&t.writeString(1,r),(r=e.getRegistrant_asU8()).length>0&&t.writeBytes(2,r),(r=e.getRecipient_asU8()).length>0&&t.writeBytes(3,r)},proto.transaction.TransferName.prototype.getName=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.TransferName.prototype.setName=function(e){n.Message.setProto3StringField(this,1,e)},proto.transaction.TransferName.prototype.getRegistrant=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.TransferName.prototype.getRegistrant_asB64=function(){return n.Message.bytesAsB64(this.getRegistrant())},proto.transaction.TransferName.prototype.getRegistrant_asU8=function(){return n.Message.bytesAsU8(this.getRegistrant())},proto.transaction.TransferName.prototype.setRegistrant=function(e){n.Message.setProto3BytesField(this,2,e)},proto.transaction.TransferName.prototype.getRecipient=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.transaction.TransferName.prototype.getRecipient_asB64=function(){return n.Message.bytesAsB64(this.getRecipient())},proto.transaction.TransferName.prototype.getRecipient_asU8=function(){return n.Message.bytesAsU8(this.getRecipient())},proto.transaction.TransferName.prototype.setRecipient=function(e){n.Message.setProto3BytesField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.DeleteName.prototype.toObject=function(e){return proto.transaction.DeleteName.toObject(e,this)},proto.transaction.DeleteName.toObject=function(e,t){var r={registrant:t.getRegistrant_asB64(),name:n.Message.getFieldWithDefault(t,2,"")};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.DeleteName.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.DeleteName;return proto.transaction.DeleteName.deserializeBinaryFromReader(r,t)},proto.transaction.DeleteName.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setRegistrant(r);break;case 2:var r=t.readString();e.setName(r);break;default:t.skipField()}return e},proto.transaction.DeleteName.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.DeleteName.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.DeleteName.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getRegistrant_asU8()).length>0&&t.writeBytes(1,r),(r=e.getName()).length>0&&t.writeString(2,r)},proto.transaction.DeleteName.prototype.getRegistrant=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.DeleteName.prototype.getRegistrant_asB64=function(){return n.Message.bytesAsB64(this.getRegistrant())},proto.transaction.DeleteName.prototype.getRegistrant_asU8=function(){return n.Message.bytesAsU8(this.getRegistrant())},proto.transaction.DeleteName.prototype.setRegistrant=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.DeleteName.prototype.getName=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.DeleteName.prototype.setName=function(e){n.Message.setProto3StringField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.Subscribe.prototype.toObject=function(e){return proto.transaction.Subscribe.toObject(e,this)},proto.transaction.Subscribe.toObject=function(e,t){var r={subscriber:t.getSubscriber_asB64(),identifier:n.Message.getFieldWithDefault(t,2,""),topic:n.Message.getFieldWithDefault(t,3,""),bucket:n.Message.getFieldWithDefault(t,4,0),duration:n.Message.getFieldWithDefault(t,5,0),meta:n.Message.getFieldWithDefault(t,6,"")};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.Subscribe.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.Subscribe;return proto.transaction.Subscribe.deserializeBinaryFromReader(r,t)},proto.transaction.Subscribe.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setSubscriber(r);break;case 2:var r=t.readString();e.setIdentifier(r);break;case 3:var r=t.readString();e.setTopic(r);break;case 4:var r=t.readUint32();e.setBucket(r);break;case 5:var r=t.readUint32();e.setDuration(r);break;case 6:var r=t.readString();e.setMeta(r);break;default:t.skipField()}return e},proto.transaction.Subscribe.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.Subscribe.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.Subscribe.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getSubscriber_asU8()).length>0&&t.writeBytes(1,r),(r=e.getIdentifier()).length>0&&t.writeString(2,r),(r=e.getTopic()).length>0&&t.writeString(3,r),0!==(r=e.getBucket())&&t.writeUint32(4,r),0!==(r=e.getDuration())&&t.writeUint32(5,r),(r=e.getMeta()).length>0&&t.writeString(6,r)},proto.transaction.Subscribe.prototype.getSubscriber=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.Subscribe.prototype.getSubscriber_asB64=function(){return n.Message.bytesAsB64(this.getSubscriber())},proto.transaction.Subscribe.prototype.getSubscriber_asU8=function(){return n.Message.bytesAsU8(this.getSubscriber())},proto.transaction.Subscribe.prototype.setSubscriber=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.Subscribe.prototype.getIdentifier=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.Subscribe.prototype.setIdentifier=function(e){n.Message.setProto3StringField(this,2,e)},proto.transaction.Subscribe.prototype.getTopic=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.transaction.Subscribe.prototype.setTopic=function(e){n.Message.setProto3StringField(this,3,e)},proto.transaction.Subscribe.prototype.getBucket=function(){return n.Message.getFieldWithDefault(this,4,0)},proto.transaction.Subscribe.prototype.setBucket=function(e){n.Message.setProto3IntField(this,4,e)},proto.transaction.Subscribe.prototype.getDuration=function(){return n.Message.getFieldWithDefault(this,5,0)},proto.transaction.Subscribe.prototype.setDuration=function(e){n.Message.setProto3IntField(this,5,e)},proto.transaction.Subscribe.prototype.getMeta=function(){return n.Message.getFieldWithDefault(this,6,"")},proto.transaction.Subscribe.prototype.setMeta=function(e){n.Message.setProto3StringField(this,6,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.Unsubscribe.prototype.toObject=function(e){return proto.transaction.Unsubscribe.toObject(e,this)},proto.transaction.Unsubscribe.toObject=function(e,t){var r={subscriber:t.getSubscriber_asB64(),identifier:n.Message.getFieldWithDefault(t,2,""),topic:n.Message.getFieldWithDefault(t,3,"")};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.Unsubscribe.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.Unsubscribe;return proto.transaction.Unsubscribe.deserializeBinaryFromReader(r,t)},proto.transaction.Unsubscribe.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setSubscriber(r);break;case 2:var r=t.readString();e.setIdentifier(r);break;case 3:var r=t.readString();e.setTopic(r);break;default:t.skipField()}return e},proto.transaction.Unsubscribe.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.Unsubscribe.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.Unsubscribe.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getSubscriber_asU8()).length>0&&t.writeBytes(1,r),(r=e.getIdentifier()).length>0&&t.writeString(2,r),(r=e.getTopic()).length>0&&t.writeString(3,r)},proto.transaction.Unsubscribe.prototype.getSubscriber=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.Unsubscribe.prototype.getSubscriber_asB64=function(){return n.Message.bytesAsB64(this.getSubscriber())},proto.transaction.Unsubscribe.prototype.getSubscriber_asU8=function(){return n.Message.bytesAsU8(this.getSubscriber())},proto.transaction.Unsubscribe.prototype.setSubscriber=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.Unsubscribe.prototype.getIdentifier=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.Unsubscribe.prototype.setIdentifier=function(e){n.Message.setProto3StringField(this,2,e)},proto.transaction.Unsubscribe.prototype.getTopic=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.transaction.Unsubscribe.prototype.setTopic=function(e){n.Message.setProto3StringField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.TransferAsset.prototype.toObject=function(e){return proto.transaction.TransferAsset.toObject(e,this)},proto.transaction.TransferAsset.toObject=function(e,t){var r={sender:t.getSender_asB64(),recipient:t.getRecipient_asB64(),amount:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.TransferAsset.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.TransferAsset;return proto.transaction.TransferAsset.deserializeBinaryFromReader(r,t)},proto.transaction.TransferAsset.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setSender(r);break;case 2:var r=t.readBytes();e.setRecipient(r);break;case 3:var r=t.readInt64();e.setAmount(r);break;default:t.skipField()}return e},proto.transaction.TransferAsset.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.TransferAsset.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.TransferAsset.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getSender_asU8()).length>0&&t.writeBytes(1,r),(r=e.getRecipient_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getAmount())&&t.writeInt64(3,r)},proto.transaction.TransferAsset.prototype.getSender=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.TransferAsset.prototype.getSender_asB64=function(){return n.Message.bytesAsB64(this.getSender())},proto.transaction.TransferAsset.prototype.getSender_asU8=function(){return n.Message.bytesAsU8(this.getSender())},proto.transaction.TransferAsset.prototype.setSender=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.TransferAsset.prototype.getRecipient=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.TransferAsset.prototype.getRecipient_asB64=function(){return n.Message.bytesAsB64(this.getRecipient())},proto.transaction.TransferAsset.prototype.getRecipient_asU8=function(){return n.Message.bytesAsU8(this.getRecipient())},proto.transaction.TransferAsset.prototype.setRecipient=function(e){n.Message.setProto3BytesField(this,2,e)},proto.transaction.TransferAsset.prototype.getAmount=function(){return n.Message.getFieldWithDefault(this,3,0)},proto.transaction.TransferAsset.prototype.setAmount=function(e){n.Message.setProto3IntField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.GenerateID.prototype.toObject=function(e){return proto.transaction.GenerateID.toObject(e,this)},proto.transaction.GenerateID.toObject=function(e,t){var r={publicKey:t.getPublicKey_asB64(),registrationFee:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.GenerateID.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.GenerateID;return proto.transaction.GenerateID.deserializeBinaryFromReader(r,t)},proto.transaction.GenerateID.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setPublicKey(r);break;case 2:var r=t.readInt64();e.setRegistrationFee(r);break;default:t.skipField()}return e},proto.transaction.GenerateID.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.GenerateID.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.GenerateID.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getPublicKey_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getRegistrationFee())&&t.writeInt64(2,r)},proto.transaction.GenerateID.prototype.getPublicKey=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.GenerateID.prototype.getPublicKey_asB64=function(){return n.Message.bytesAsB64(this.getPublicKey())},proto.transaction.GenerateID.prototype.getPublicKey_asU8=function(){return n.Message.bytesAsU8(this.getPublicKey())},proto.transaction.GenerateID.prototype.setPublicKey=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.GenerateID.prototype.getRegistrationFee=function(){return n.Message.getFieldWithDefault(this,2,0)},proto.transaction.GenerateID.prototype.setRegistrationFee=function(e){n.Message.setProto3IntField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.NanoPay.prototype.toObject=function(e){return proto.transaction.NanoPay.toObject(e,this)},proto.transaction.NanoPay.toObject=function(e,t){var r={sender:t.getSender_asB64(),recipient:t.getRecipient_asB64(),id:n.Message.getFieldWithDefault(t,3,0),amount:n.Message.getFieldWithDefault(t,4,0),txnExpiration:n.Message.getFieldWithDefault(t,5,0),nanoPayExpiration:n.Message.getFieldWithDefault(t,6,0)};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.NanoPay.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.NanoPay;return proto.transaction.NanoPay.deserializeBinaryFromReader(r,t)},proto.transaction.NanoPay.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setSender(r);break;case 2:var r=t.readBytes();e.setRecipient(r);break;case 3:var r=t.readUint64();e.setId(r);break;case 4:var r=t.readInt64();e.setAmount(r);break;case 5:var r=t.readUint32();e.setTxnExpiration(r);break;case 6:var r=t.readUint32();e.setNanoPayExpiration(r);break;default:t.skipField()}return e},proto.transaction.NanoPay.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.NanoPay.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.NanoPay.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getSender_asU8()).length>0&&t.writeBytes(1,r),(r=e.getRecipient_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getId())&&t.writeUint64(3,r),0!==(r=e.getAmount())&&t.writeInt64(4,r),0!==(r=e.getTxnExpiration())&&t.writeUint32(5,r),0!==(r=e.getNanoPayExpiration())&&t.writeUint32(6,r)},proto.transaction.NanoPay.prototype.getSender=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.NanoPay.prototype.getSender_asB64=function(){return n.Message.bytesAsB64(this.getSender())},proto.transaction.NanoPay.prototype.getSender_asU8=function(){return n.Message.bytesAsU8(this.getSender())},proto.transaction.NanoPay.prototype.setSender=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.NanoPay.prototype.getRecipient=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.NanoPay.prototype.getRecipient_asB64=function(){return n.Message.bytesAsB64(this.getRecipient())},proto.transaction.NanoPay.prototype.getRecipient_asU8=function(){return n.Message.bytesAsU8(this.getRecipient())},proto.transaction.NanoPay.prototype.setRecipient=function(e){n.Message.setProto3BytesField(this,2,e)},proto.transaction.NanoPay.prototype.getId=function(){return n.Message.getFieldWithDefault(this,3,0)},proto.transaction.NanoPay.prototype.setId=function(e){n.Message.setProto3IntField(this,3,e)},proto.transaction.NanoPay.prototype.getAmount=function(){return n.Message.getFieldWithDefault(this,4,0)},proto.transaction.NanoPay.prototype.setAmount=function(e){n.Message.setProto3IntField(this,4,e)},proto.transaction.NanoPay.prototype.getTxnExpiration=function(){return n.Message.getFieldWithDefault(this,5,0)},proto.transaction.NanoPay.prototype.setTxnExpiration=function(e){n.Message.setProto3IntField(this,5,e)},proto.transaction.NanoPay.prototype.getNanoPayExpiration=function(){return n.Message.getFieldWithDefault(this,6,0)},proto.transaction.NanoPay.prototype.setNanoPayExpiration=function(e){n.Message.setProto3IntField(this,6,e)},n.Message.GENERATE_TO_OBJECT&&(proto.transaction.IssueAsset.prototype.toObject=function(e){return proto.transaction.IssueAsset.toObject(e,this)},proto.transaction.IssueAsset.toObject=function(e,t){var r={sender:t.getSender_asB64(),name:n.Message.getFieldWithDefault(t,2,""),symbol:n.Message.getFieldWithDefault(t,3,""),totalSupply:n.Message.getFieldWithDefault(t,4,0),precision:n.Message.getFieldWithDefault(t,5,0)};return e&&(r.$jspbMessageInstance=t),r}),proto.transaction.IssueAsset.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.transaction.IssueAsset;return proto.transaction.IssueAsset.deserializeBinaryFromReader(r,t)},proto.transaction.IssueAsset.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setSender(r);break;case 2:var r=t.readString();e.setName(r);break;case 3:var r=t.readString();e.setSymbol(r);break;case 4:var r=t.readInt64();e.setTotalSupply(r);break;case 5:var r=t.readUint32();e.setPrecision(r);break;default:t.skipField()}return e},proto.transaction.IssueAsset.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.transaction.IssueAsset.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.transaction.IssueAsset.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getSender_asU8()).length>0&&t.writeBytes(1,r),(r=e.getName()).length>0&&t.writeString(2,r),(r=e.getSymbol()).length>0&&t.writeString(3,r),0!==(r=e.getTotalSupply())&&t.writeInt64(4,r),0!==(r=e.getPrecision())&&t.writeUint32(5,r)},proto.transaction.IssueAsset.prototype.getSender=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.transaction.IssueAsset.prototype.getSender_asB64=function(){return n.Message.bytesAsB64(this.getSender())},proto.transaction.IssueAsset.prototype.getSender_asU8=function(){return n.Message.bytesAsU8(this.getSender())},proto.transaction.IssueAsset.prototype.setSender=function(e){n.Message.setProto3BytesField(this,1,e)},proto.transaction.IssueAsset.prototype.getName=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.transaction.IssueAsset.prototype.setName=function(e){n.Message.setProto3StringField(this,2,e)},proto.transaction.IssueAsset.prototype.getSymbol=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.transaction.IssueAsset.prototype.setSymbol=function(e){n.Message.setProto3StringField(this,3,e)},proto.transaction.IssueAsset.prototype.getTotalSupply=function(){return n.Message.getFieldWithDefault(this,4,0)},proto.transaction.IssueAsset.prototype.setTotalSupply=function(e){n.Message.setProto3IntField(this,4,e)},proto.transaction.IssueAsset.prototype.getPrecision=function(){return n.Message.getFieldWithDefault(this,5,0)},proto.transaction.IssueAsset.prototype.setPrecision=function(e){n.Message.setProto3IntField(this,5,e)},proto.transaction.PayloadType={COINBASE_TYPE:0,TRANSFER_ASSET_TYPE:1,SIG_CHAIN_TXN_TYPE:2,REGISTER_NAME_TYPE:3,TRANSFER_NAME_TYPE:4,DELETE_NAME_TYPE:5,SUBSCRIBE_TYPE:6,UNSUBSCRIBE_TYPE:7,GENERATE_ID_TYPE:8,NANO_PAY_TYPE:9,ISSUE_ASSET_TYPE:10},i.object.extend(t,proto.transaction)},92110:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteName=M,t.getBalance=E,t.getLatestBlock=v,t.getNodeState=R,t.getNonce=k,t.getPeerAddr=C,t.getRegistrant=b,t.getSubscribers=m,t.getSubscribersCount=w,t.getSubscription=S,t.getWsAddr=g,t.getWssAddr=_,t.registerName=B,t.rpcCall=y,t.sendTransaction=x,t.subscribe=O,t.transferName=A,t.transferTo=T,t.unsubscribe=P;var n=h(r(73360)),i=h(r(69073)),o=l(r(22737)),s=l(r(4453)),a=l(r(78121)),c=l(r(41015));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function h(e){return e&&e.__esModule?e:{default:e}}let f=1e4,p={getWsAddr:{method:"getwsaddr"},getWssAddr:{method:"getwssaddr"},getSubscribers:{method:"getsubscribers",defaultParams:{offset:0,limit:1e3,meta:!1,txPool:!1}},getSubscribersCount:{method:"getsubscriberscount"},getSubscription:{method:"getsubscription"},getBalanceByAddr:{method:"getbalancebyaddr"},getNonceByAddr:{method:"getnoncebyaddr"},getRegistrant:{method:"getregistrant"},getLatestBlockHash:{method:"getlatestblockhash"},sendRawTransaction:{method:"sendrawtransaction"},getNodeState:{method:"getnodestate"},getPeerAddr:{method:"getpeeraddr"}};var d={};for(let e in p)p.hasOwnProperty(e)&&(d[e]=(t,r)=>(r=c.assignDefined({},p[e].defaultParams,r),y(t,p[e].method,r)));async function y(e,t,r={}){let i=n.default.CancelToken.source(),o=null;setTimeout(()=>{null===o&&i.cancel("rpc timeout")},f);try{o=await (0,n.default)({url:e,method:"POST",timeout:f,cancelToken:i.token,data:{id:"nkn-sdk-js",jsonrpc:"2.0",method:t,params:r}})}catch(e){if(n.default.isCancel(e))throw new s.RpcTimeoutError(e.message);throw new s.RpcError(e.message)}let a=o.data;if(a.error)throw new s.ServerError(a.error);if(void 0!==a.result)return a.result;throw new s.InvalidResponseError("rpc response contains no result or error field")}async function g(e,t={}){return d.getWsAddr(t.rpcServerAddr,{address:e})}async function _(e,t={}){return d.getWssAddr(t.rpcServerAddr,{address:e})}async function v(e={}){return d.getLatestBlockHash(e.rpcServerAddr)}async function b(e,t={}){return d.getRegistrant(t.rpcServerAddr,{name:e})}async function m(e,t={}){return d.getSubscribers(t.rpcServerAddr,{topic:e,offset:t.offset,limit:t.limit,meta:t.meta,txPool:t.txPool})}async function w(e,t={}){return d.getSubscribersCount(t.rpcServerAddr,{topic:e})}async function S(e,t,r={}){return d.getSubscription(r.rpcServerAddr,{topic:e,subscriber:t})}async function E(e,t={}){if(!e)throw new s.InvalidArgumentError("address is empty");let r=await d.getBalanceByAddr(t.rpcServerAddr,{address:e});if(!r.amount)throw new s.InvalidResponseError("amount is empty");return new i.default(r.amount)}async function k(e,t={}){if(!e)throw new s.InvalidArgumentError("address is empty");t=c.assignDefined({txPool:!0},t);let r=await d.getNonceByAddr(t.rpcServerAddr,{address:e});if("number"!=typeof r.nonce)throw new s.InvalidResponseError("nonce is not a number");let n=r.nonce;return t.txPool&&r.nonceInTxPool&&r.nonceInTxPool>n&&(n=r.nonceInTxPool),n}async function x(e,t={}){return d.sendRawTransaction(t.rpcServerAddr,{tx:c.bytesToHex(e.serializeBinary())})}async function T(e,t,r={}){if(!o.verifyAddress(e))throw new s.InvalidAddressError("invalid recipient address");let n=r.nonce;null==n&&(n=await this.getNonce());let i=o.publicKeyToSignatureRedeem(this.getPublicKey()),c=o.hexStringToProgramHash(i),u=a.newTransferPayload(c,o.addressStringToProgramHash(e),t),l=await this.createTransaction(u,n,r);return r.buildOnly?l:await this.sendTransaction(l)}async function B(e,t={}){let r=t.nonce;null==r&&(r=await this.getNonce());let n=a.newRegisterNamePayload(this.getPublicKey(),e),i=await this.createTransaction(n,r,t);return t.buildOnly?i:await this.sendTransaction(i)}async function A(e,t,r={}){let n=r.nonce;null==n&&(n=await this.getNonce());let i=a.newTransferNamePayload(e,this.getPublicKey(),t),o=await this.createTransaction(i,n,r);return r.buildOnly?o:await this.sendTransaction(o)}async function M(e,t={}){let r=t.nonce;null==r&&(r=await this.getNonce());let n=a.newDeleteNamePayload(this.getPublicKey(),e),i=await this.createTransaction(n,r,t);return t.buildOnly?i:await this.sendTransaction(i)}async function O(e,t,r,n,i={}){let o=i.nonce;null==o&&(o=await this.getNonce());let s=a.newSubscribePayload(this.getPublicKey(),r,e,t,n),c=await this.createTransaction(s,o,i);return i.buildOnly?c:await this.sendTransaction(c)}async function P(e,t,r={}){let n=r.nonce;null==n&&(n=await this.getNonce());let i=a.newUnsubscribePayload(this.getPublicKey(),t,e),o=await this.createTransaction(i,n,r);return r.buildOnly?o:await this.sendTransaction(o)}async function R(e={}){return d.getNodeState(e.rpcServerAddr)}async function C(e,t={}){return d.getPeerAddr(t.rpcServerAddr,{address:e,offer:t.offer})}},57308:function(e,t,r){"use strict";var n=r(11530).lW;function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBool=d,t.encodeBytes=f,t.encodeString=p,t.encodeUint=h,t.encodeUint16=c,t.encodeUint32=u,t.encodeUint64=l,t.encodeUint8=a,t.maxUintBits=t.maxUint=void 0,i(r(4453));let o=48;t.maxUintBits=o;let s=2**o;function a(e){let t=n.alloc(1,0);return t.writeUInt8(e),t.toString("hex")}function c(e){let t=n.alloc(2,0);return t.writeUInt16LE(e),t.toString("hex")}function u(e){let t=n.alloc(4,0);return t.writeUInt32LE(e),t.toString("hex")}function l(e){if(e>s)throw RangeError("full 64 bit integer is not supported in JavaScript");let t=n.alloc(8,0);return t.writeUIntLE(e,0,6),t.toString("hex")}function h(e){return e<253?a(e):e<=65535?"fd"+c(e):e<=4294967295?"fe"+u(e):"ff"+l(e)}function f(e){let t=n.from(e);return h(t.length)+t.toString("hex")}function p(e){let t=n.from(e,"utf8");return h(t.length)+t.toString("hex")}function d(e){return a(e?1:0)}t.maxUint=s},41015:function(e,t,r){"use strict";var n=r(11530).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefined=g,t.bytesToHex=u,t.hexToBytes=c,t.isBrowser=m,t.mergeTypedArrays=y,t.randomBytes=void 0,t.randomBytesHex=f,t.randomInt32=p,t.randomUint64=d,t.setPRNG=h,t.sleep=b,t.toLowerKeys=v,t.utf8ToBytes=_;var i=s(r(77085)),o=r(57308);function s(e){return e&&e.__esModule?e:{default:e}}let a=/^[0-9a-f]+$/i;function c(e){if(e.length%2==1)throw RangeError("invalid hex string length "+e.length);if(!a.test(e))throw RangeError("invalid hex string");let t=[];for(let r=0;r{if(e<0||e>255)throw RangeError("invalid byte "+e);return("0"+(255&e).toString(16)).slice(-2)}).join("")}var l=i.default.randomBytes;function h(e){i.default.setPRNG(e)}function f(e){return u(l(e))}function p(){let e=l(4);return e[0]&=127,(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3]}function d(){return parseInt(f(o.maxUintBits/8),16)}function y(e,t){let r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}function g(e,...t){for(let r of t)if(r)for(let t of Object.keys(r))void 0!==r[t]&&(e[t]=r[t]);return e}function _(e){return e?new Uint8Array(n.from(e,"utf8")):new Uint8Array}function v(e){return Object.keys(e).reduce((t,r)=>Object.assign(t,{[r.toLowerCase()]:"object"==typeof e[r]?v(e[r]):e[r]}),{})}function b(e){return new Promise(t=>setTimeout(t,e))}function m(){return![typeof window,typeof document].includes("undefined")}t.randomBytes=l},2105:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={setPRNG:!0,ready:!0,Client:!0,MultiClient:!0,Wallet:!0};Object.defineProperty(t,"Client",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"MultiClient",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Wallet",{enumerable:!0,get:function(){return c.default}}),t.default=void 0,Object.defineProperty(t,"ready",{enumerable:!0,get:function(){return i.ready}}),t.setPRNG=void 0;var i=r(73551),o=h(r(21913));Object.keys(o).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(n,e))&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s=u(r(85349)),a=u(r(746)),c=u(r(35293));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}var f=o.util.setPRNG;t.setPRNG=f,o.ready=i.ready,o.Client=s.default,o.MultiClient=a.default,o.Wallet=c.default,o.setPRNG=f;var p=o;t.default=p},14228:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sessionIDSize=t.multiclientIdentifierRe=t.defaultSessionAllowAddr=t.defaultOptions=t.acceptSessionBufSize=void 0;let r={numSubClients:4,originalClient:!1,msgCacheExpiration:3e5,sessionConfig:{}};t.defaultOptions=r;let n=128;t.acceptSessionBufSize=n;let i=/.*/;t.defaultSessionAllowAddr=i;let o=/^__\d+__$/;t.multiclientIdentifierRe=o;let s=8;t.sessionIDSize=s},746:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.default}});var n=i(r(100));function i(e){return e&&e.__esModule?e:{default:e}}},100:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=y(r(79499)),i=r(86253),o=p(r(64569)),s=p(r(85349)),a=p(r(35293)),c=r(26816),u=y(r(21913)),l=y(r(14228)),h=y(r(12681)),f=y(r(63922));function p(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class _{constructor(e={}){g(this,"options",void 0),g(this,"key",void 0),g(this,"identifier",void 0),g(this,"addr",void 0),g(this,"eventListeners",void 0),g(this,"clients",void 0),g(this,"defaultClient",void 0),g(this,"msgCache",void 0),g(this,"acceptAddrs",void 0),g(this,"sessions",void 0),g(this,"isReady",void 0),g(this,"isFailed",void 0),g(this,"isClosed",void 0);let t=(e=u.util.assignDefined({},l.defaultOptions,e)).identifier||"",r={};if(e.originalClient){let t=f.addIdentifier("","");r[t]=new s.default(e),e.seed||(e=u.util.assignDefined({},e,{seed:r[t].key.seed}))}for(let n=0;n{if(this.isClosed)return!1;if(a===u.pb.payloads.PayloadType.SESSION){if(!c)return!1;try{await this._handleSessionMsg(s,t,l,i)}catch(e){if(!(e instanceof n.errors.SessionClosedError||e instanceof u.errors.AddrNotAllowedError))throw e}return!1}let p=u.util.bytesToHex(l);if(null!==this.msgCache.get(p))return!1;if(this.msgCache.put(p,s,e.msgCacheExpiration),t=f.removeIdentifier(t).addr,this.eventListeners.message.length>0){let e=await o.default.all(this.eventListeners.message.map(async e=>{try{return await e({src:t,payload:i,payloadType:a,isEncrypted:c,messageId:l,noReply:h})}catch(e){return console.log("Message handler error:",e),null}}));if(!h){let n=!1;for(let r of e){if(!1===r)return!1;if(null!=r){this.send(t,r,{encrypt:c,msgHoldingSeconds:0,replyToId:l}).catch(e=>{console.log("Send response error:",e)}),n=!0;break}}if(!n)for(let e of Object.keys(r))r[e].isReady&&r[e]._sendACK(f.addIdentifierPrefixAll(t,e),l,c).catch(e=>{console.log("Send ack error:",e)})}}return!1});let c=Object.keys(this.clients).map(e=>new o.default((t,r)=>{this.clients[e].onConnect(t)}));o.default.any(c).then(e=>{this.isReady=!0,this.eventListeners.connect.length>0&&this.eventListeners.connect.forEach(async t=>{try{await t(e)}catch(e){console.log("Connect handler error:",e)}})});let h=Object.keys(this.clients).map(e=>new o.default((t,r)=>{this.clients[e].onConnectFailed(t)}));o.default.all(h).then(()=>{this.isFailed=!0,this.eventListeners.connectFailed.length>0?this.eventListeners.connectFailed.forEach(async e=>{try{await e()}catch(e){console.log("Connect failed handler error:",e)}}):console.log("All clients connect failed")}),Object.keys(this.clients).map(e=>{this.clients[e].onWsError(e=>{this.eventListeners.wsError.length>0?this.eventListeners.wsError.forEach(async t=>{try{await t(e)}catch(e){console.log("WsError handler error:",e)}}):console.log(e.message)})})}getSeed(){return this.key.seed}getPublicKey(){return this.key.publicKey}_shouldAcceptAddr(e){for(let t of this.acceptAddrs)if(t.test(e))return!0;return!1}async _handleSessionMsg(e,t,r,n){let i,s=f.removeIdentifier(t),a=s.addr,c=s.clientID,l=f.sessionKey(a,r),h=this.sessions.has(l);if(h)i=this.sessions.get(l);else{if(!this._shouldAcceptAddr(a))throw new u.errors.AddrNotAllowedError;i=this._newSession(a,r,this.options.sessionConfig),this.sessions.set(l,i)}i.receiveWith(e,c,n),!h&&(await i.accept(),this.eventListeners.session.length>0&&await o.default.all(this.eventListeners.session.map(async e=>{try{return await e(i)}catch(e){console.log("Session handler error:",e);return}})))}_newSession(e,t,r={}){let i=this.readyClientIDs().sort();return new n.Session(this.addr,e,i,null,async(r,n,i)=>{let o=this.clients[r];if(!o.isReady)throw new u.errors.ClientNotReadyError;let s=h.newSessionPayload(i,t);await o._send(f.addIdentifierPrefix(e,n),s)},r)}async sendWithClient(e,t,r,n={}){let i=this.clients[e];if(!i)throw new u.errors.InvalidArgumentError("no such clientID");if(!i.isReady)throw new u.errors.ClientNotReadyError;return await i.send(f.addIdentifierPrefixAll(t,e),r,n)}readyClientIDs(){return Object.keys(this.clients).filter(e=>this.clients[e]&&this.clients[e].isReady)}async send(e,t,r={}){r=u.util.assignDefined({},r,{messageId:u.util.randomBytes(h.messageIdSize)});let n=this.readyClientIDs();if(0===n.length)throw new u.errors.ClientNotReadyError;e=await this.defaultClient._processDests(e);try{return await o.default.any(n.map(n=>this.sendWithClient(n,e,t,r)))}catch(e){throw Error("failed to send with any client: "+e.errors)}}async publish(e,t,r={}){let n=(r=u.util.assignDefined({},c.defaultPublishOptions,r,{noReply:!0})).offset,i=await this.getSubscribers(e,{offset:n,limit:r.limit,txPool:r.txPool}),o=i.subscribers,s=i.subscribersInTxPool;for(;i.subscribers&&i.subscribers.length>=r.limit;)n+=r.limit,i=await this.getSubscribers(e,{offset:n,limit:r.limit}),o=o.concat(i.subscribers);return r.txPool&&(o=o.concat(s)),await this.send(o,t,r)}on(e,t){this.eventListeners[e]||(this.eventListeners[e]=[]),this.eventListeners[e].push(t)}onConnect(e){this.eventListeners.connect.push(e)}onConnectFailed(e){this.eventListeners.connectFailed.push(e)}onWsError(e){this.eventListeners.wsError.push(e)}onMessage(e){this.eventListeners.message.push(e)}onSession(e){this.eventListeners.session.push(e)}async close(){let e=[];for(let t of this.sessions.values())e.push(t.close());try{await o.default.all(e)}catch(e){console.log(e)}Object.keys(this.clients).forEach(e=>{try{this.clients[e].close()}catch(e){console.log(e)}}),this.msgCache.clear(),this.isClosed=!0}listen(e){null==e?e=[l.defaultSessionAllowAddr]:Array.isArray(e)||(e=[e]),this.acceptAddrs=[];for(let t=0;te.wallet.options.rpcServerAddr);if(t.length>0)try{return await o.default.any(t.map(t=>a.default.sendTransaction(e,t.wallet.options)))}catch(e){}return await a.default.sendTransaction(e,this.options)}transferTo(e,t,r={}){return u.rpc.transferTo.call(this,e,t,r)}registerName(e,t={}){return u.rpc.registerName.call(this,e,t)}transferName(e,t,r={}){return u.rpc.transferName.call(this,e,t,r)}deleteName(e,t={}){return u.rpc.deleteName.call(this,e,t)}subscribe(e,t,r="",n="",i={}){return u.rpc.subscribe.call(this,e,t,r,n,i)}unsubscribe(e,t="",r={}){return u.rpc.unsubscribe.call(this,e,t,r)}createTransaction(e,t,r={}){return this.defaultClient.wallet.createTransaction(e,t,r)}}t.default=_},63922:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addIdentifier=a,t.addIdentifierPrefix=s,t.addIdentifierPrefixAll=u,t.removeIdentifier=c,t.sessionKey=l;var n=o(r(14228));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=o?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}function s(e,t){return""===e?""+t:""===t?""+e:t+"."+e}function a(e,t){return""===t?e:s(e,"__"+t+"__")}function c(e){let t=e.split(".");return n.multiclientIdentifierRe.test(t[0])?{addr:t.slice(1).join("."),clientID:t[0]}:{addr:e,clientID:""}}function u(e,t){return Array.isArray(e)?e.map(e=>s(e,t)):s(e,t)}function l(e,t){return e+t}},42569:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(r(22737)),i=s(r(21913));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c{constructor(e,t={}){a(this,"key",void 0),a(this,"signatureRedeem",void 0),a(this,"programHash",void 0),a(this,"address",void 0),a(this,"contract",void 0),this.key=new i.Key(e,{worker:t.worker}),this.signatureRedeem=n.publicKeyToSignatureRedeem(this.key.publicKey),this.programHash=n.hexStringToProgramHash(this.signatureRedeem),this.address=n.programHashStringToAddress(this.programHash),this.contract=u(this.signatureRedeem,this.programHash)}getPublicKey(){return this.key.publicKey}getSeed(){return this.key.seed}}function u(e,t){return n.prefixByteCountToHexString(e)+(n.prefixByteCountToHexString("00")+t)}t.default=c},22737:function(e,t,r){"use strict";var n=r(11530).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.UINT160_LEN=t.CHECKSUM_LEN=t.BITCOIN_BASE58=t.ADDRESS_LEN=t.ADDRESS_GEN_PREFIX_LEN=t.ADDRESS_GEN_PREFIX=void 0,t.addressStringToProgramHash=v,t.genAddressVerifyBytesFromProgramHash=b,t.genAddressVerifyCodeFromProgramHash=m,t.getAddressStringVerifyCode=w,t.hexStringToProgramHash=g,t.prefixByteCountToHexString=E,t.programHashStringToAddress=_,t.publicKeyToSignatureRedeem=y,t.signatureToParameter=S,t.verifyAddress=d;var i=s(r(21913));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}let a="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";t.BITCOIN_BASE58=a;let c=r(35197)(a),u="02b825";t.ADDRESS_GEN_PREFIX=u;let l=u.length/2;t.ADDRESS_GEN_PREFIX_LEN=l;let h=20;t.UINT160_LEN=h;let f=4;t.CHECKSUM_LEN=f;let p=l+h+f;function d(e){try{let t=c.decode(e);if(t.length!==p)return!1;let r=t.slice(0,l);if(i.util.bytesToHex(r)!==u)return!1;let n=v(e),o=w(e),s=m(n);return o===s}catch(e){return!1}}function y(e){return"20"+e+"ac"}function g(e){return i.hash.ripemd160Hex(i.hash.sha256Hex(e))}function _(e){let t=b(e),r=i.util.hexToBytes(u+e);return c.encode(n.from(i.util.mergeTypedArrays(r,t)))}function v(e){let t=c.decode(e),r=t.slice(l,t.length-f);return i.util.bytesToHex(r)}function b(e){return e=u+e,i.util.hexToBytes(i.hash.doubleSha256Hex(e)).slice(0,f)}function m(e){let t=b(e);return i.util.bytesToHex(t)}function w(e){let t=c.decode(e).slice(-f);return i.util.bytesToHex(t)}function S(e){return"40"+e}function E(e){let t=e.length;if(0===t)return"00";1==t%2&&(e="0"+e,t+=1);let r=t/2;return 1==(r=r.toString(16)).length%2&&(r="0"+r),r+e}t.ADDRESS_LEN=p},48477:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scryptParams=t.defaultOptions=void 0;let r={rpcServerAddr:"https://mainnet-rpc-node-0001.nkn.org/mainnet/api/wallet",worker:!1};t.defaultOptions=r;let n={saltLen:8,N:32768,r:8,p:1};t.scryptParams=n},35293:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.default}});var n=i(r(24634));function i(e){return e&&e.__esModule?e:{default:e}}},78121:function(e,t,r){"use strict";var n=r(11530).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.nameRegistrationFee=void 0,t.newDeleteNamePayload=f,t.newNanoPayPayload=y,t.newRegisterNamePayload=l,t.newSubscribePayload=p,t.newTransaction=_,t.newTransferNamePayload=h,t.newTransferPayload=u,t.newUnsubscribePayload=d,t.serializePayload=g,t.serializeUnsignedTx=v,t.signTx=b;var i=a(r(22737)),o=a(r(21913));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}let c="10";function u(e,t,r){let i=new o.pb.transaction.TransferAsset;i.setSender(n.from(e,"hex")),i.setRecipient(n.from(t,"hex")),i.setAmount(new o.Amount(r).value());let s=new o.pb.transaction.Payload;return s.setType(o.pb.transaction.PayloadType.TRANSFER_ASSET_TYPE),s.setData(i.serializeBinary()),s}function l(e,t,r=c){let i=new o.pb.transaction.RegisterName;i.setRegistrant(n.from(e,"hex")),i.setName(t),i.setRegistrationFee(new o.Amount(r).value());let s=new o.pb.transaction.Payload;return s.setType(o.pb.transaction.PayloadType.REGISTER_NAME_TYPE),s.setData(i.serializeBinary()),s}function h(e,t,r){let i=new o.pb.transaction.TransferName;i.setName(e),i.setRegistrant(n.from(t,"hex")),i.setRecipient(n.from(r,"hex"));let s=new o.pb.transaction.Payload;return s.setType(o.pb.transaction.PayloadType.TRANSFER_NAME_TYPE),s.setData(i.serializeBinary()),s}function f(e,t){let r=new o.pb.transaction.DeleteName;r.setRegistrant(n.from(e,"hex")),r.setName(t);let i=new o.pb.transaction.Payload;return i.setType(o.pb.transaction.PayloadType.DELETE_NAME_TYPE),i.setData(r.serializeBinary()),i}function p(e,t,r,i,s){let a=new o.pb.transaction.Subscribe;a.setSubscriber(n.from(e,"hex")),a.setIdentifier(t),a.setTopic(r),a.setDuration(i),a.setMeta(s);let c=new o.pb.transaction.Payload;return c.setType(o.pb.transaction.PayloadType.SUBSCRIBE_TYPE),c.setData(a.serializeBinary()),c}function d(e,t,r){let i=new o.pb.transaction.Unsubscribe;i.setSubscriber(n.from(e,"hex")),i.setIdentifier(t),i.setTopic(r);let s=new o.pb.transaction.Payload;return s.setType(o.pb.transaction.PayloadType.UNSUBSCRIBE_TYPE),s.setData(i.serializeBinary()),s}function y(e,t,r,i,s,a){let c=new o.pb.transaction.NanoPay;c.setSender(n.from(e,"hex")),c.setRecipient(n.from(t,"hex")),c.setId(r),c.setAmount(new o.Amount(i).value()),c.setTxnExpiration(s),c.setNanoPayExpiration(a);let u=new o.pb.transaction.Payload;return u.setType(o.pb.transaction.PayloadType.NANO_PAY_TYPE),u.setData(c.serializeBinary()),u}function g(e){return""+(o.serialize.encodeUint32(e.getType())+o.serialize.encodeBytes(e.getData()))}async function _(e,t,r,i="0",s=""){let a=new o.pb.transaction.UnsignedTx;a.setPayload(t),a.setNonce(r),a.setFee(new o.Amount(i).value()),a.setAttributes(n.from(s,"hex"));let c=new o.pb.transaction.Transaction;return c.setUnsignedTx(a),await b(e,c),c}function v(e){return""+(g(e.getPayload())+o.serialize.encodeUint64(e.getNonce())+o.serialize.encodeUint64(e.getFee())+o.serialize.encodeBytes(e.getAttributes()))}async function b(e,t){let r=v(t.getUnsignedTx()),s=o.hash.sha256Hex(r),a=await e.key.sign(s);t.hash=o.hash.doubleSha256Hex(r);let c=new o.pb.transaction.Program;c.setCode(n.from(e.signatureRedeem,"hex")),c.setParameter(n.from(i.signatureToParameter(a),"hex")),t.setProgramsList([c])}t.nameRegistrationFee=c},24634:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=h(r(43670)),i=h(r(42569)),o=l(r(22737)),s=l(r(21913)),a=l(r(48477)),c=l(r(78121));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function h(e){return e&&e.__esModule?e:{default:e}}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class p{constructor(e={}){f(this,"options",void 0),f(this,"account",void 0),f(this,"iv",void 0),f(this,"masterKey",void 0),f(this,"address",void 0),f(this,"programHash",void 0),f(this,"seedEncrypted",void 0),f(this,"scryptParams",void 0),f(this,"version",void 0),e=s.util.assignDefined({},a.defaultOptions,e),this.version=e.version||p.version,2===this.version&&(this.scryptParams=s.util.assignDefined({},a.scryptParams,e.scrypt),this.scryptParams.salt=this.scryptParams.salt||s.util.randomBytesHex(this.scryptParams.saltLen)),this.options=e,this.account=new i.default(e.seed,{worker:e.worker}),this.address=this.account.address,this.programHash=this.account.programHash,(e.iv||e.masterKey||e.password||e.passwordKey)&&this._completeWallet(Object.assign({},e,{async:!1})),delete e.seed,delete e.iv,delete e.masterKey,delete e.password,delete e.passwordKey}static _computePasswordKey(e){if(!(e=s.util.toLowerKeys(e)).version)throw new s.errors.InvalidArgumentError("missing version field");switch(e.version){case 1:if(e.async)return Promise.resolve(s.hash.doubleSha256(e.password));return s.hash.doubleSha256(e.password);case 2:if(!e.scrypt)throw new s.errors.InvalidArgumentError("missing scrypt field");if(!e.scrypt.salt||!e.scrypt.n||!e.scrypt.r||!e.scrypt.p)throw new s.errors.InvalidArgumentError("incomplete scrypt parameters");if(e.async)return n.default.scrypt(s.util.utf8ToBytes(e.password),s.util.hexToBytes(e.scrypt.salt),e.scrypt.n,e.scrypt.r,e.scrypt.p,32).then(s.util.bytesToHex);return s.util.bytesToHex(n.default.syncScrypt(s.util.utf8ToBytes(e.password),s.util.hexToBytes(e.scrypt.salt),e.scrypt.n,e.scrypt.r,e.scrypt.p,32));default:throw new s.errors.InvalidWalletFormatError("unsupported wallet verison "+e.version)}}static _decryptWallet(e,t){if(t.iv=e.iv,t.masterKey=s.aes.decrypt(e.masterkey,t.passwordKey,t.iv),t.seed=s.aes.decrypt(e.seedencrypted,t.masterKey,t.iv),t.passwordKey={[e.version]:t.passwordKey},2===e.version&&(t.scrypt={salt:e.scrypt.salt,N:e.scrypt.n,r:e.scrypt.r,p:e.scrypt.p}),new i.default(t.seed,{worker:!1}).address!==e.address)throw new s.errors.WrongPasswordError;return new p(t)}_completeWallet(e={}){let t;if(this.seedEncrypted)return e.async?Promise.resolve():void 0;let r=t=>{let r=e.iv||s.util.randomBytesHex(16),n=e.masterKey||s.util.randomBytesHex(32);this.iv=r,this.masterKey=s.aes.encrypt(n,t,r),this.seedEncrypted=s.aes.encrypt(this.account.getSeed(),n,r)};if(e.passwordKey&&e.passwordKey[""+this.version])t=e.passwordKey[""+this.version];else{if(e.async)return p._computePasswordKey({version:this.version,password:e.password||"",scrypt:this.scryptParams,async:!0}).then(r);t=p._computePasswordKey({version:this.version,password:e.password||"",scrypt:this.scryptParams,async:!1})}return(r(t),e.async)?Promise.resolve():void 0}static fromJSON(e,t={}){let r;if(r="string"==typeof e?JSON.parse(e):e,"number"!=typeof(r=s.util.toLowerKeys(r)).version||r.versionp.maxCompatibleVersion)throw new s.errors.InvalidWalletVersionError("invalid wallet version "+r.version+", should be between "+p.minCompatibleVersion+" and "+p.maxCompatibleVersion);if(!r.masterkey)throw new s.errors.InvalidWalletFormatError("missing masterKey field");if(!r.iv)throw new s.errors.InvalidWalletFormatError("missing iv field");if(!r.seedencrypted)throw new s.errors.InvalidWalletFormatError("missing seedEncrypted field");if(!r.address)throw new s.errors.InvalidWalletFormatError("missing address field");if(t.async)return p._computePasswordKey(Object.assign({},r,{password:t.password,async:!0})).then(e=>p._decryptWallet(r,Object.assign({},t,{passwordKey:e})));{let e=p._computePasswordKey(Object.assign({},r,{password:t.password,async:!1}));return p._decryptWallet(r,Object.assign({},t,{passwordKey:e}))}}toJSON(){this._completeWallet({async:!1});let e={Version:this.version,MasterKey:this.masterKey,IV:this.iv,SeedEncrypted:this.seedEncrypted,Address:this.address};return this.scryptParams&&(e.Scrypt={Salt:this.scryptParams.salt,N:this.scryptParams.N,R:this.scryptParams.r,P:this.scryptParams.p}),e}getSeed(){return this.account.getSeed()}getPublicKey(){return this.account.getPublicKey()}static verifyAddress(e){return o.verifyAddress(e)}_verifyPassword(e){this._completeWallet({async:!1});let t=s.aes.decrypt(this.masterKey,e,this.iv),r=s.aes.decrypt(this.seedEncrypted,t,this.iv);return new i.default(r,{worker:!1}).address===this.address}verifyPassword(e,t={}){let r={version:this.version,password:e,scrypt:this.scryptParams,async:t.async};if(t.async)return(async()=>{await this._completeWallet({async:!0});let e=await p._computePasswordKey(r);return this._verifyPassword(e)})();{this._completeWallet({async:!1});let e=p._computePasswordKey(r);return this._verifyPassword(e)}}static getLatestBlock(e={}){return e=s.util.assignDefined({},a.defaultOptions,e),s.rpc.getLatestBlock(e)}getLatestBlock(){return p.getLatestBlock(this.options)}static getRegistrant(e,t={}){return t=s.util.assignDefined({},a.defaultOptions,t),s.rpc.getRegistrant(e,t)}getRegistrant(e){return p.getRegistrant(e,this.options)}static getSubscribers(e,t={}){return t=s.util.assignDefined({},a.defaultOptions,t),s.rpc.getSubscribers(e,t)}getSubscribers(e,t={}){return p.getSubscribers(e,Object.assign({},this.options,t))}static getSubscribersCount(e,t={}){return t=s.util.assignDefined({},a.defaultOptions,t),s.rpc.getSubscribersCount(e,t)}getSubscribersCount(e){return p.getSubscribersCount(e,this.options)}static getSubscription(e,t,r={}){return r=s.util.assignDefined({},a.defaultOptions,r),s.rpc.getSubscription(e,t,r)}getSubscription(e,t){return p.getSubscription(e,t,this.options)}static getBalance(e,t={}){return t=s.util.assignDefined({},a.defaultOptions,t),s.rpc.getBalance(e,t)}getBalance(e){return p.getBalance(e||this.address,this.options)}static getNonce(e,t={}){return t=s.util.assignDefined({},a.defaultOptions,t),s.rpc.getNonce(e,t)}getNonce(e,t={}){return t=s.util.assignDefined({},this.options,t),p.getNonce(e||this.address,t)}static sendTransaction(e,t={}){return t=s.util.assignDefined({},a.defaultOptions,t),s.rpc.sendTransaction(e,t)}sendTransaction(e){return p.sendTransaction(e,this.options)}transferTo(e,t,r={}){return s.rpc.transferTo.call(this,e,t,r)}registerName(e,t={}){return s.rpc.registerName.call(this,e,t)}transferName(e,t,r={}){return s.rpc.transferName.call(this,e,t,r)}deleteName(e,t={}){return s.rpc.deleteName.call(this,e,t)}subscribe(e,t,r="",n="",i={}){return s.rpc.subscribe.call(this,e,t,r,n,i)}unsubscribe(e,t="",r={}){return s.rpc.unsubscribe.call(this,e,t,r)}async createOrUpdateNanoPay(e,t,r,n,i={}){if(!o.verifyAddress(e))throw new s.errors.InvalidAddressError("invalid recipient address");n||(n=s.util.randomUint64());let a=c.newNanoPayPayload(this.programHash,o.addressStringToProgramHash(e),n,t,r,r);return await this.createTransaction(a,0,i)}createTransaction(e,t,r={}){return c.newTransaction(this.account,e,t,r.fee,r.attrs)}static publicKeyToAddress(e){let t=o.publicKeyToSignatureRedeem(e),r=o.hexStringToProgramHash(t);return o.programHashStringToAddress(r)}}t.default=p,f(p,"version",2),f(p,"minCompatibleVersion",1),f(p,"maxCompatibleVersion",2)},25735:function(e,t,r){"use strict";var n=i(r(8953));function i(e){return e&&e.__esModule?e:{default:e}}"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&(0,n.default)(self)},8953:function(e,t,r){"use strict";var n=o(r(35033));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=o?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}o(r(41015)),e.exports=function(e){let t;e.onmessage=async function(r){try{let i=null;switch(r.data.action){case"setSeed":if(t){if(r.data.seed!==t.seed)throw"cannot set to different seed"}else t=n.keyPair(r.data.seed);break;case"computeSharedKey":if(t)i=await n.computeSharedKey(t.curvePrivateKey,r.data.otherPubkey);else throw"worker key not created";break;case"sign":if(t)i=await n.sign(t.privateKey,r.data.message);else throw"worker key not created";break;default:throw"unknown action: "+r.data.action}e.postMessage({id:r.data.id,result:i})}catch(t){e.postMessage({id:r.data.id,error:t})}}}},11530:function(e,t,r){"use strict";/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */var n,i=r(48738),o=r(6868),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=l,n=w,t.h2=50;var a=2147483647;function c(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}function u(e){if(e>a)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return d(e)}return h(e,t,r)}function h(e,t,r){if("string"==typeof e)return y(e,t);if(ArrayBuffer.isView(e))return _(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return v(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);var i=b(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function p(e,t,r){return(f(e),e<=0)?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}function d(e){return f(e),u(e<0?0:0|m(e))}function y(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!l.isEncoding(t))throw TypeError("Unknown encoding: "+t);var r=0|S(e,t),n=u(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function g(e){for(var t=e.length<0?0:0|m(e.length),r=u(t),n=0;n=a)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function w(e){return+e!=e&&(e=0),l.alloc(+e)}function S(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function E(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return U(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return j(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function k(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function x(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:T(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):T(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function T(e,t,r,n,i){var o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){for(var h=!0,f=0;fi&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(l=u);break;case 2:(192&(o=e[i+1]))==128&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],s=e[i+2],(192&o)==128&&(192&s)==128&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}return I(n)}n=2147483647,l.TYPED_ARRAY_SUPPORT=c(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return h(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return p(e,t,r)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(X(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);in.length?l.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(l.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},l.byteLength=S,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(X(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,a=Math.min(o,s),c=this.slice(n,i),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return B(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return M(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,r);default:if(o)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function I(e){var t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",o=t;or)throw RangeError("Trying to access beyond buffer length")}function W(e,t,r,n,i,o){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw RangeError("Index out of range")}function z(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function K(e,t,r,n,i){return t=+t,r>>>=0,i||z(e,t,r,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,r,n,23,4),r+4}function H(e,t,r,n,i){return t=+t,r>>>=0,i||z(e,t,r,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||L(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return(e>>>=0,t||L(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;W(this,e,t,r,i,0)}var o=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;W(this,e,t,r,i,0)}var o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);W(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);W(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||W(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return K(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return K(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function $(e){for(var t=[],r=0;r>8,i.push(r%256),i.push(n);return i}function Z(e){return i.toByteArray(Y(e))}function J(e,t,r,n){for(var i=0;i=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}var ee=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},25090:function(e,t,r){"use strict";var n=r(92402).assign,i=r(47949),o=r(5167),s=r(39946),a={};n(a,i,o,s),e.exports=a},47949:function(e,t,r){"use strict";var n=r(72269),i=r(92402),o=r(66578),s=r(496),a=r(45274),c=Object.prototype.toString,u=0,l=4,h=0,f=1,p=2,d=-1,y=0,g=8;function _(e){if(!(this instanceof _))return new _(e);this.options=i.assign({level:d,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:y,to:""},e||{});var t,r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var u=n.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(u!==h)throw Error(s[u]);if(r.header&&n.deflateSetHeader(this.strm,r.header),r.dictionary){if(t="string"==typeof r.dictionary?o.string2buf(r.dictionary):"[object ArrayBuffer]"===c.call(r.dictionary)?new Uint8Array(r.dictionary):r.dictionary,(u=n.deflateSetDictionary(this.strm,t))!==h)throw Error(s[u]);this._dict_set=!0}}function v(e,t){var r=new _(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}function b(e,t){return(t=t||{}).raw=!0,v(e,t)}function m(e,t){return(t=t||{}).gzip=!0,v(e,t)}_.prototype.push=function(e,t){var r,s,a=this.strm,d=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?l:u,"string"==typeof e?a.input=o.string2buf(e):"[object ArrayBuffer]"===c.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new i.Buf8(d),a.next_out=0,a.avail_out=d),(r=n.deflate(a,s))!==f&&r!==h)return this.onEnd(r),this.ended=!0,!1;(0===a.avail_out||0===a.avail_in&&(s===l||s===p))&&("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(a.output,a.next_out))):this.onData(i.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&r!==f);return s===l?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===h):(s===p&&(this.onEnd(h),a.avail_out=0),!0)},_.prototype.onData=function(e){this.chunks.push(e)},_.prototype.onEnd=function(e){e===h&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=_,t.deflate=v,t.deflateRaw=b,t.gzip=m},5167:function(e,t,r){"use strict";var n=r(63400),i=r(92402),o=r(66578),s=r(39946),a=r(496),c=r(45274),u=r(67891),l=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits)==0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==s.Z_OK||(this.header=new u,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK)))throw Error(a[r])}function f(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}function p(e,t){return(t=t||{}).raw=!0,f(e,t)}h.prototype.push=function(e,t){var r,a,c,u,h,f=this.strm,p=this.options.chunkSize,d=this.options.dictionary,y=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?f.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(p),f.next_out=0,f.avail_out=p),(r=n.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&d&&(r=n.inflateSetDictionary(this.strm,d)),r===s.Z_BUF_ERROR&&!0===y&&(r=s.Z_OK,y=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;f.next_out&&(0===f.avail_out||r===s.Z_STREAM_END||0===f.avail_in&&(a===s.Z_FINISH||a===s.Z_SYNC_FLUSH))&&("string"===this.options.to?(c=o.utf8border(f.output,f.next_out),u=f.next_out-c,h=o.buf2string(f.output,c),f.next_out=u,f.avail_out=p-u,u&&i.arraySet(f.output,f.output,c,u,0),this.onData(h)):this.onData(i.shrinkBuf(f.output,f.next_out))),0===f.avail_in&&0===f.avail_out&&(y=!0)}while((f.avail_in>0||0===f.avail_out)&&r!==s.Z_STREAM_END);return(r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH)?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):(a===s.Z_SYNC_FLUSH&&(this.onEnd(s.Z_OK),f.avail_out=0),!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=h,t.inflate=f,t.inflateRaw=p,t.ungzip=f},92402:function(e,t){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var o=0;o=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function c(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",s=0;s>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},t.buf2binstring=function(e){return c(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r4){u[n++]=65533,r+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&r1){u[n++]=65533;continue}i<65536?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return c(u,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&(192&e[r])==128;)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},43213:function(e){"use strict";function t(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==r;){s=r>2e3?2e3:r,r-=s;do o=o+(i=i+t[n++]|0)|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}e.exports=t},39946:function(e){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},15193:function(e){"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function r(e,r,n,i){var o=t,s=i+n;e^=-1;for(var a=i;a>>8^o[(e^r[a])&255];return -1^e}e.exports=r},72269:function(e,t,r){"use strict";var n,i=r(92402),o=r(78898),s=r(43213),a=r(15193),c=r(496),u=0,l=1,h=3,f=4,p=5,d=0,y=1,g=-2,_=-3,v=-5,b=-1,m=1,w=2,S=3,E=4,k=0,x=2,T=8,B=9,A=15,M=8,O=286,P=30,R=19,C=573,N=15,I=3,D=258,j=262,U=32,F=42,L=69,W=73,z=91,K=103,H=113,q=666,Y=1,G=2,$=3,V=4,Z=3;function J(e,t){return e.msg=c[t],t}function X(e){return(e<<1)-(e>4?9:0)}function Q(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function et(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function er(e,t){e.pending_buf[e.pending++]=t}function en(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ei(e,t,r,n){var o=e.avail_in;return(o>n&&(o=n),0===o)?0:(e.avail_in-=o,i.arraySet(t,e.input,e.next_in,o,r),1===e.state.wrap?e.adler=s(e.adler,t,o,r):2===e.state.wrap&&(e.adler=a(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function eo(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,l=e.w_mask,h=e.prev,f=e.strstart+D,p=u[o+s-1],d=u[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(r=t)+s]!==d||u[r+s-1]!==p||u[r]!==u[o]||u[++r]!==u[o+1])continue;o+=2,r++;do;while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&os){if(e.match_start=t,s=n,n>=a)break;p=u[o+s-1],d=u[o+s]}}while((t=h[t&l])>c&&0!=--i);return s<=e.lookahead?s:e.lookahead}function es(e){var t,r,n,o,s,a=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=a+(a-j)){i.arraySet(e.window,e.window,a,a,0),e.match_start-=a,e.strstart-=a,e.block_start-=a,t=r=e.hash_size;do n=e.head[--t],e.head[t]=n>=a?n-a:0;while(--r);t=r=a;do n=e.prev[--t],e.prev[t]=n>=a?n-a:0;while(--r);o+=a}if(0===e.strm.avail_in)break;if(r=ei(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=r,e.lookahead+e.insert>=I)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I){if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-I,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<=I&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+D;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=o._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(et(e,!1),0===e.strm.avail_out))return Y}return(e.insert=0,t===f)?(et(e,!0),0===e.strm.avail_out)?$:V:e.last_lit&&(et(e,!1),0===e.strm.avail_out)?Y:G}function el(e,t){for(var r;;){if(0===e.lookahead&&(es(e),0===e.lookahead)){if(t===u)return Y;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(et(e,!1),0===e.strm.avail_out))return Y}return(e.insert=0,t===f)?(et(e,!0),0===e.strm.avail_out)?$:V:e.last_lit&&(et(e,!1),0===e.strm.avail_out)?Y:G}function eh(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function ef(e){e.window_size=2*e.w_size,Q(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=I-1,e.match_available=0,e.ins_h=0}function ep(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=T,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*C),this.dyn_dtree=new i.Buf16((2*P+1)*2),this.bl_tree=new i.Buf16((2*R+1)*2),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(N+1),this.heap=new i.Buf16(2*O+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*O+1),Q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ed(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=x,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?F:H,e.adler=2===t.wrap?0:1,t.last_flush=u,o._tr_init(t),d):J(e,g)}function ey(e){var t=ed(e);return t===d&&ef(e.state),t}function eg(e,t){return e&&e.state&&2===e.state.wrap?(e.state.gzhead=t,d):g}function e_(e,t,r,n,o,s){if(!e)return g;var a=1;if(t===b&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>B||r!==T||n<8||n>15||t<0||t>9||s<0||s>E)return J(e,g);8===n&&(n=9);var c=new ep;return e.state=c,c.strm=e,c.wrap=a,c.gzhead=null,c.w_bits=n,c.w_size=1<p||t<0)return e?J(e,g):g;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===q&&t!==f)return J(e,0===e.avail_out?v:g);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===F){if(2===i.wrap)e.adler=0,er(i,31),er(i,139),er(i,8),i.gzhead?(er(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),er(i,255&i.gzhead.time),er(i,i.gzhead.time>>8&255),er(i,i.gzhead.time>>16&255),er(i,i.gzhead.time>>24&255),er(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),er(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(er(i,255&i.gzhead.extra.length),er(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=L):(er(i,0),er(i,0),er(i,0),er(i,0),er(i,0),er(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),er(i,Z),i.status=H);else{var r,i,s,c,_=T+(i.w_bits-8<<4)<<8,b=-1;_|=(b=i.strategy>=w||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(_|=U),_+=31-_%31,i.status=H,en(i,_),0!==i.strstart&&(en(i,e.adler>>>16),en(i,65535&e.adler)),e.adler=1}}if(i.status===L){if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),ee(e),s=i.pending,i.pending!==i.pending_buf_size));)er(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=W)}else i.status=W}if(i.status===W){if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),ee(e),s=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===c&&(i.gzindex=0,i.status=z)}else i.status=z}if(i.status===z){if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),ee(e),s=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===c&&(i.status=K)}else i.status=K}if(i.status===K&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ee(e),i.pending+2<=i.pending_buf_size&&(er(i,255&e.adler),er(i,e.adler>>8&255),e.adler=0,i.status=H)):i.status=H),0!==i.pending){if(ee(e),0===e.avail_out)return i.last_flush=-1,d}else if(0===e.avail_in&&X(t)<=X(r)&&t!==f)return J(e,v);if(i.status===q&&0!==e.avail_in)return J(e,v);if(0!==e.avail_in||0!==i.lookahead||t!==u&&i.status!==q){var m=i.strategy===w?el(i,t):i.strategy===S?eu(i,t):n[i.level].func(i,t);if((m===$||m===V)&&(i.status=q),m===Y||m===$)return 0===e.avail_out&&(i.last_flush=-1),d;if(m===G&&(t===l?o._tr_align(i):t!==p&&(o._tr_stored_block(i,0,0,!1),t===h&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ee(e),0===e.avail_out))return i.last_flush=-1,d}return t!==f?d:i.wrap<=0?y:(2===i.wrap?(er(i,255&e.adler),er(i,e.adler>>8&255),er(i,e.adler>>16&255),er(i,e.adler>>24&255),er(i,255&e.total_in),er(i,e.total_in>>8&255),er(i,e.total_in>>16&255),er(i,e.total_in>>24&255)):(en(i,e.adler>>>16),en(i,65535&e.adler)),ee(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?d:y)}function em(e){var t;return e&&e.state?(t=e.state.status)!==F&&t!==L&&t!==W&&t!==z&&t!==K&&t!==H&&t!==q?J(e,g):(e.state=null,t===H?J(e,_):d):g}function ew(e,t){var r,n,o,a,c,u,l,h,f=t.length;if(!e||!e.state||2===(a=(r=e.state).wrap)||1===a&&r.status!==F||r.lookahead)return g;for(1===a&&(e.adler=s(e.adler,t,f,0)),r.wrap=0,f>=r.w_size&&(0===a&&(Q(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,f-r.w_size,r.w_size,0),t=h,f=r.w_size),c=e.avail_in,u=e.next_in,l=e.input,e.avail_in=f,e.next_in=0,e.input=t,es(r);r.lookahead>=I;){n=r.strstart,o=r.lookahead-(I-1);do r.ins_h=(r.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(es(e),0===e.lookahead&&t===u)return Y;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,et(e,!1),0===e.strm.avail_out)||e.strstart-e.block_start>=e.w_size-j&&(et(e,!1),0===e.strm.avail_out))return Y}return(e.insert=0,t===f)?(et(e,!0),0===e.strm.avail_out)?$:V:(e.strstart>e.block_start&&(et(e,!1),e.strm.avail_out),Y)}),new eh(4,4,8,4,ea),new eh(4,5,16,8,ea),new eh(4,6,32,32,ea),new eh(4,4,16,16,ec),new eh(8,16,32,32,ec),new eh(8,16,128,128,ec),new eh(8,32,128,256,ec),new eh(32,128,258,1024,ec),new eh(32,258,258,4096,ec)],t.deflateInit=ev,t.deflateInit2=e_,t.deflateReset=ey,t.deflateResetKeep=ed,t.deflateSetHeader=eg,t.deflate=eb,t.deflateEnd=em,t.deflateSetDictionary=ew,t.deflateInfo="pako deflate (from Nodeca project)"},67891:function(e){"use strict";function t(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e.exports=t},61974:function(e){"use strict";var t=30,r=12;e.exports=function(e,n){var i,o,s,a,c,u,l,h,f,p,d,y,g,_,v,b,m,w,S,E,k,x,T,B,A;i=e.state,o=e.next_in,B=e.input,s=o+(e.avail_in-5),a=e.next_out,A=e.output,c=a-(n-e.avail_out),u=a+(e.avail_out-257),l=i.dmax,h=i.wsize,f=i.whave,p=i.wnext,d=i.window,y=i.hold,g=i.bits,_=i.lencode,v=i.distcode,b=(1<>>=S=w>>>24,g-=S,0==(S=w>>>16&255))A[a++]=65535&w;else if(16&S)for(E=65535&w,(S&=15)&&(g>>=S,g-=S),g<15&&(y+=B[o++]<>>=S=w>>>24,g-=S,16&(S=w>>>16&255)){if(k=65535&w,g<(S&=15)&&(y+=B[o++]<l){e.msg="invalid distance too far back",i.mode=t;break t}if(y>>>=S,g-=S,k>(S=a-c)){if((S=k-S)>f&&i.sane){e.msg="invalid distance too far back",i.mode=t;break t}if(x=0,T=d,0===p){if(x+=h-S,S2;)A[a++]=T[x++],A[a++]=T[x++],A[a++]=T[x++],E-=3;E&&(A[a++]=T[x++],E>1&&(A[a++]=T[x++]))}else{x=a-k;do A[a++]=A[x++],A[a++]=A[x++],A[a++]=A[x++],E-=3;while(E>2);E&&(A[a++]=A[x++],E>1&&(A[a++]=A[x++]))}}else if((64&S)==0){w=v[(65535&w)+(y&(1<>3,g-=E<<3,y&=(1<>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function eo(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function es(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=k,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new o.Buf32(et),t.distcode=t.distdyn=new o.Buf32(er),t.sane=1,t.back=-1,g):b}function ea(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,es(e)):b}function ec(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?b:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ea(e)):b}function eu(e,t){var r,n;return e?(n=new eo,e.state=n,n.window=null,(r=ec(e,t))!==g&&(e.state=null),r):b}function el(e){return eu(e,en)}var eh=!0;function ef(e){if(eh){var t;for(n=new o.Buf32(512),i=new o.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(u(h,e.lens,0,288,n,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;u(f,e.lens,0,32,i,0,e.work,{bits:5}),eh=!1}e.lencode=n,e.lenbits=9,e.distcode=i,e.distbits=5}function ep(e,t,r,n){var i,s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(o.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((i=s.wsize-s.wnext)>n&&(i=n),o.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(o.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=a(r.check,eT,2,0),es=0,ea=0,r.mode=x;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&es)<<8)+(es>>8))%31){e.msg="incorrect header check",r.mode=Q;break}if((15&es)!==E){e.msg="unknown compression method",r.mode=Q;break}if(es>>>=4,ea-=4,ew=(15&es)+8,0===r.wbits)r.wbits=ew;else if(ew>r.wbits){e.msg="invalid window size",r.mode=Q;break}r.dmax=1<>8&1),512&r.flags&&(eT[0]=255&es,eT[1]=es>>>8&255,r.check=a(r.check,eT,2,0)),es=0,ea=0,r.mode=T;case T:for(;ea<32;){if(0===en)break r;en--,es+=n[et++]<>>8&255,eT[2]=es>>>16&255,eT[3]=es>>>24&255,r.check=a(r.check,eT,4,0)),es=0,ea=0,r.mode=B;case B:for(;ea<16;){if(0===en)break r;en--,es+=n[et++]<>8),512&r.flags&&(eT[0]=255&es,eT[1]=es>>>8&255,r.check=a(r.check,eT,2,0)),es=0,ea=0,r.mode=A;case A:if(1024&r.flags){for(;ea<16;){if(0===en)break r;en--,es+=n[et++]<>>8&255,r.check=a(r.check,eT,2,0)),es=0,ea=0}else r.head&&(r.head.extra=null);r.mode=M;case M:if(1024&r.flags&&((el=r.length)>en&&(el=en),el&&(r.head&&(ew=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),o.arraySet(r.head.extra,n,et,el,ew)),512&r.flags&&(r.check=a(r.check,n,el,et)),en-=el,et+=el,r.length-=el),r.length))break r;r.length=0,r.mode=O;case O:if(2048&r.flags){if(0===en)break r;el=0;do ew=n[et+el++],r.head&&ew&&r.length<65536&&(r.head.name+=String.fromCharCode(ew));while(ew&&el>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=I;break;case C:for(;ea<32;){if(0===en)break r;en--,es+=n[et++]<>>=7&ea,ea-=7&ea,r.mode=Z;break}for(;ea<3;){if(0===en)break r;en--,es+=n[et++]<>>=1)){case 0:r.mode=j;break;case 1:if(ef(r),r.mode=K,t===y){es>>>=2,ea-=2;break r}break;case 2:r.mode=L;break;case 3:e.msg="invalid block type",r.mode=Q}es>>>=2,ea-=2;break;case j:for(es>>>=7&ea,ea-=7&ea;ea<32;){if(0===en)break r;en--,es+=n[et++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=Q;break}if(r.length=65535&es,es=0,ea=0,r.mode=U,t===y)break r;case U:r.mode=F;case F:if(el=r.length){if(el>en&&(el=en),el>eo&&(el=eo),0===el)break r;o.arraySet(i,n,et,el,er),en-=el,et+=el,eo-=el,er+=el,r.length-=el;break}r.mode=I;break;case L:for(;ea<14;){if(0===en)break r;en--,es+=n[et++]<>>=5,ea-=5,r.ndist=(31&es)+1,es>>>=5,ea-=5,r.ncode=(15&es)+4,es>>>=4,ea-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Q;break}r.have=0,r.mode=W;case W:for(;r.have>>=3,ea-=3}for(;r.have<19;)r.lens[eB[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,eE={bits:r.lenbits},eS=u(l,r.lens,0,19,r.lencode,0,r.work,eE),r.lenbits=eE.bits,eS){e.msg="invalid code lengths set",r.mode=Q;break}r.have=0,r.mode=z;case z:for(;r.have>>24,eg=ex>>>16&255,e_=65535&ex,!(ey<=ea);){if(0===en)break r;en--,es+=n[et++]<>>=ey,ea-=ey,r.lens[r.have++]=e_;else{if(16===e_){for(ek=ey+2;ea>>=ey,ea-=ey,0===r.have){e.msg="invalid bit length repeat",r.mode=Q;break}ew=r.lens[r.have-1],el=3+(3&es),es>>>=2,ea-=2}else if(17===e_){for(ek=ey+3;ea>>=ey,ea-=ey,ew=0,el=3+(7&es),es>>>=3,ea-=3}else{for(ek=ey+7;ea>>=ey,ea-=ey,ew=0,el=11+(127&es),es>>>=7,ea-=7}if(r.have+el>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Q;break}for(;el--;)r.lens[r.have++]=ew}}if(r.mode===Q)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Q;break}if(r.lenbits=9,eE={bits:r.lenbits},eS=u(h,r.lens,0,r.nlen,r.lencode,0,r.work,eE),r.lenbits=eE.bits,eS){e.msg="invalid literal/lengths set",r.mode=Q;break}if(r.distbits=6,r.distcode=r.distdyn,eE={bits:r.distbits},eS=u(f,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,eE),r.distbits=eE.bits,eS){e.msg="invalid distances set",r.mode=Q;break}if(r.mode=K,t===y)break r;case K:r.mode=H;case H:if(en>=6&&eo>=258){e.next_out=er,e.avail_out=eo,e.next_in=et,e.avail_in=en,r.hold=es,r.bits=ea,c(e,eu),er=e.next_out,i=e.output,eo=e.avail_out,et=e.next_in,n=e.input,en=e.avail_in,es=r.hold,ea=r.bits,r.mode===I&&(r.back=-1);break}for(r.back=0;ey=(ex=r.lencode[es&(1<>>24,eg=ex>>>16&255,e_=65535&ex,!(ey<=ea);){if(0===en)break r;en--,es+=n[et++]<>ev)])>>>24,eg=ex>>>16&255,e_=65535&ex,!(ev+ey<=ea);){if(0===en)break r;en--,es+=n[et++]<>>=ev,ea-=ev,r.back+=ev}if(es>>>=ey,ea-=ey,r.back+=ey,r.length=e_,0===eg){r.mode=V;break}if(32&eg){r.back=-1,r.mode=I;break}if(64&eg){e.msg="invalid literal/length code",r.mode=Q;break}r.extra=15&eg,r.mode=q;case q:if(r.extra){for(ek=r.extra;ea>>=r.extra,ea-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Y;case Y:for(;ey=(ex=r.distcode[es&(1<>>24,eg=ex>>>16&255,e_=65535&ex,!(ey<=ea);){if(0===en)break r;en--,es+=n[et++]<>ev)])>>>24,eg=ex>>>16&255,e_=65535&ex,!(ev+ey<=ea);){if(0===en)break r;en--,es+=n[et++]<>>=ev,ea-=ev,r.back+=ev}if(es>>>=ey,ea-=ey,r.back+=ey,64&eg){e.msg="invalid distance code",r.mode=Q;break}r.offset=e_,r.extra=15&eg,r.mode=G;case G:if(r.extra){for(ek=r.extra;ea>>=r.extra,ea-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Q;break}r.mode=$;case $:if(0===eo)break r;if(el=eu-eo,r.offset>el){if((el=r.offset-el)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Q;break}el>r.wnext?(el-=r.wnext,eh=r.wsize-el):eh=r.wnext-el,el>r.length&&(el=r.length),ed=r.window}else ed=i,eh=er-r.offset,el=r.length;el>eo&&(el=eo),eo-=el,r.length-=el;do i[er++]=ed[eh++];while(--el);0===r.length&&(r.mode=H);break;case V:if(0===eo)break r;i[er++]=r.length,eo--,r.mode=H;break;case Z:if(r.wrap){for(;ea<32;){if(0===en)break r;en--,es|=n[et++]<=1&&0===W[R];R--);if(C>R&&(C=R),0===R)return y[g++]=20971520,y[g++]=20971520,v.bits=1,0;for(P=1;P0&&(e===a||1!==R))return -1;for(M=1,z[1]=0;Mo||e===u&&j>s)return 1;for(;;){x=M-I,_[O]k?(T=K[H+_[O]],B=F[L+_[O]]):(T=96,B=0),b=1<>I)+(m-=b)]=x<<24|T<<16|B|0;while(0!==m);for(b=1<>=1;if(0!==b?(U&=b-1,U+=b):U=0,O++,0==--W[M]){if(M===R)break;M=t[r+_[O]]}if(M>C&&(U&S)!==w){for(0===I&&(I=C),E+=P,D=1<<(N=M-I);N+Io||e===u&&j>s)return 1;y[w=U&S]=C<<24|N<<16|E-g|0}}return 0!==U&&(y[E+U]=M-I<<24|4194304),v.bits=C,0}},496:function(e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},78898:function(e,t,r){"use strict";var n,i,o,s=r(92402),a=4,c=0,u=1,l=2;function h(e){for(var t=e.length;--t>=0;)e[t]=0}var f=0,p=1,d=2,y=3,g=258,_=29,v=256,b=286,m=30,w=19,S=573,E=15,k=16,x=7,T=256,B=16,A=17,M=18,O=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],N=512,I=Array(576);h(I);var D=Array(2*m);h(D);var j=Array(N);h(j);var U=Array(g-y+1);h(U);var F=Array(_);h(F);var L=Array(m);function W(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function z(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function K(e){return e<256?j[e]:j[256+(e>>>7)]}function H(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function q(e,t,r){e.bi_valid>k-r?(e.bi_buf|=t<>k-e.bi_valid,e.bi_valid+=r-k):(e.bi_buf|=t<>>=1,r<<=1;while(--t>0);return r>>>1}function $(e){16===e.bi_valid?(H(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function V(e,t){var r,n,i,o,s,a,c=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,h=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,d=t.stat_desc.max_length,y=0;for(o=0;o<=E;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rd&&(o=d,y++),c[2*n+1]=o,!(n>u)&&(e.bl_count[o]++,s=0,n>=p&&(s=f[n-p]),a=c[2*n],e.opt_len+=a*(o+s),h&&(e.static_len+=a*(l[2*n+1]+s)));if(0!==y){do{for(o=d-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[d]--,y-=2}while(y>0);for(o=d;0!==o;o--)for(n=e.bl_count[o];0!==n;)!((i=e.heap[--r])>u)&&(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}function Z(e,t,r){var n,i,o=Array(E+1),s=0;for(n=1;n<=E;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=G(o[a]++,a))}}function J(){var e,t,r,s,a,c=Array(E+1);for(s=0,r=0;s<_-1;s++)for(e=0,F[s]=r;e<1<>=7;s8?H(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function ee(e,t,r,n){Q(e),n&&(H(e,r),H(e,~r)),s.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function et(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)er(e,o,r);i=c;do r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],er(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,er(e,o,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],V(e,t),Z(o,u,e.bl_count)}function eo(e,t,r){var n,i,o=-1,s=t[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)i=s,s=t[(n+1)*2+1],++a=3&&0===e.bl_tree[2*C[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}function ec(e,t,r,n){var i;for(q(e,t-257,5),q(e,r-1,5),q(e,n-4,4),i=0;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return c;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t0?(e.strm.data_type===l&&(e.strm.data_type=eu(e)),ei(e,e.l_desc),ei(e,e.d_desc),s=ea(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?ef(e,t,r,n):e.strategy===a||o===i?(q(e,(p<<1)+(n?1:0),3),en(e,I,D)):(q(e,(d<<1)+(n?1:0),3),ec(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),en(e,e.dyn_ltree,e.dyn_dtree)),X(e),n&&Q(e)}function ey(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[(U[r]+v+1)*2]++,e.dyn_dtree[2*K(t)]++),e.last_lit===e.lit_bufsize-1}t._tr_init=eh,t._tr_stored_block=ef,t._tr_flush_block=ed,t._tr_tally=ey,t._tr_align=ep},45274:function(e){"use strict";function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=t},76269:function(e){"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},10632:function(e,t,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh */var n=r(9109),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},43670:function(e){"use strict";!function(t){let r=2147483647;function n(e){let t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),r=1779033703,n=3144134277,i=1013904242,o=2773480762,s=1359893119,a=2600822924,c=528734635,u=1541459225,l=new Uint32Array(64);function h(e){let h=0,f=e.length;for(;f>=64;){let p=r,d=n,y=i,g=o,_=s,v=a,b=c,m=u,w,S,E,k,x;for(S=0;S<16;S++)E=h+4*S,l[S]=(255&e[E])<<24|(255&e[E+1])<<16|(255&e[E+2])<<8|255&e[E+3];for(S=16;S<64;S++)k=((w=l[S-2])>>>17|w<<15)^(w>>>19|w<<13)^w>>>10,x=((w=l[S-15])>>>7|w<<25)^(w>>>18|w<<14)^w>>>3,l[S]=(k+l[S-7]|0)+(x+l[S-16]|0)|0;for(S=0;S<64;S++)k=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&v^~_&b)|0)+(m+(t[S]+l[S]|0)|0)|0,x=((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+(p&d^p&y^d&y)|0,m=b,b=v,v=_,_=g+k|0,g=y,y=d,d=p,p=k+x|0;r=r+p|0,n=n+d|0,i=i+y|0,o=o+g|0,s=s+_|0,a=a+v|0,c=c+b|0,u=u+m|0,h+=64,f-=64}}h(e);let f,p=e.length%64,d=e.length/536870912|0,y=e.length<<3,g=p<56?56:120,_=e.slice(e.length-p,e.length);for(_.push(128),f=p+1;f>>24&255),_.push(d>>>16&255),_.push(d>>>8&255),_.push(d>>>0&255),_.push(y>>>24&255),_.push(y>>>16&255),_.push(y>>>8&255),_.push(y>>>0&255),h(_),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,r){let i;e=e.length<=64?e:n(e);let o=64+t.length+4,s=Array(o),a=Array(64),c=[];for(i=0;i<64;i++)s[i]=54;for(i=0;i=o-4;e--){if(s[e]++,s[e]<=255)return;s[e]=0}}for(;r>=32;)u(),c=c.concat(n(a.concat(n(s)))),r-=32;return r>0&&(u(),c=c.concat(n(a.concat(n(s))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(u(e,(2*r-1)*16,i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),a(i,n),u(i,0,e,t+16*o,16);for(o=0;o>>32-t}function a(e,t){u(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=s(t[0]+t[12],7),t[8]^=s(t[4]+t[0],9),t[12]^=s(t[8]+t[4],13),t[0]^=s(t[12]+t[8],18),t[9]^=s(t[5]+t[1],7),t[13]^=s(t[9]+t[5],9),t[1]^=s(t[13]+t[9],13),t[5]^=s(t[1]+t[13],18),t[14]^=s(t[10]+t[6],7),t[2]^=s(t[14]+t[10],9),t[6]^=s(t[2]+t[14],13),t[10]^=s(t[6]+t[2],18),t[3]^=s(t[15]+t[11],7),t[7]^=s(t[3]+t[15],9),t[11]^=s(t[7]+t[3],13),t[15]^=s(t[11]+t[7],18),t[1]^=s(t[0]+t[3],7),t[2]^=s(t[1]+t[0],9),t[3]^=s(t[2]+t[1],13),t[0]^=s(t[3]+t[2],18),t[6]^=s(t[5]+t[4],7),t[7]^=s(t[6]+t[5],9),t[4]^=s(t[7]+t[6],13),t[5]^=s(t[4]+t[7],18),t[11]^=s(t[10]+t[9],7),t[8]^=s(t[11]+t[10],9),t[9]^=s(t[8]+t[11],13),t[10]^=s(t[9]+t[8],18),t[12]^=s(t[15]+t[14],7),t[13]^=s(t[12]+t[15],9),t[14]^=s(t[13]+t[12],13),t[15]^=s(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i=256)return!1}return!0}function h(e,t){if("number"!=typeof e||e%1)throw Error("invalid "+t);return e}function f(e,t,n,s,a,f,p){let d;if(n=h(n,"N"),s=h(s,"r"),a=h(a,"p"),f=h(f,"dkLen"),0===n||(n&n-1)!=0)throw Error("N must be power of 2");if(n>r/128/s)throw Error("N too large");if(s>r/128/a)throw Error("r too large");if(!l(e))throw Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!l(t))throw Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let y=i(e,t,128*a*s),g=new Uint32Array(32*a*s);for(let e=0;eM&&(t=M);for(let e=0;eM&&(t=M);for(let e=0;e>0&255),y.push(g[e]>>8&255),y.push(g[e]>>16&255),y.push(g[e]>>24&255);let r=i(e,y,f);return p&&p(null,1,r),r}p&&O(P)};if(!p)for(;;){let e=P();if(void 0!=e)return e}P()}let p={scrypt:function(e,t,r,n,i,o,s){return new Promise(function(a,c){let u=0;s&&s(0),f(e,t,r,n,i,o,function(e,t,r){if(e)c(e);else if(r)s&&1!==u&&s(1),a(new Uint8Array(r));else if(s&&t!==u)return u=t,s(t)})})},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(f(e,t,r,n,i,o))}};e.exports=p}(0)},49813:function(e,t,r){"use strict";var n=r(77323),i=r(30602),o=r(66626)(),s=r(55601),a=r(31354),c=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||c(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in e&&s){var l=s(e,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(o?i(e,"length",t,!0,!0):i(e,"length",t)),e}},56123:function(e,t,r){"use strict";var n=r(10632).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function s(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function a(e){var t;switch(this.encoding=s(e),this.encoding){case"utf16le":this.text=d,this.end=y,t=4;break;case"utf8":this.fillLast=h,t=4;break;case"base64":this.text=g,this.end=_,t=3;break;default:this.write=v,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function h(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function f(e,t){var r=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function d(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function _(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function b(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function y(e,t,r,n,i){var o,s=0;for(o=0;o>>8)-1}function g(e,t,r,n){return y(e,t,r,n,16)}function _(e,t,r,n){return y(e,t,r,n,32)}function v(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,_=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,m=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,w=o,S=s,E=a,k=c,x=u,T=l,B=h,A=f,M=p,O=d,P=y,R=g,C=_,N=v,I=b,D=m,j=0;j<20;j+=2)x^=(i=w+C|0)<<7|i>>>25,M^=(i=x+w|0)<<9|i>>>23,C^=(i=M+x|0)<<13|i>>>19,w^=(i=C+M|0)<<18|i>>>14,O^=(i=T+S|0)<<7|i>>>25,N^=(i=O+T|0)<<9|i>>>23,S^=(i=N+O|0)<<13|i>>>19,T^=(i=S+N|0)<<18|i>>>14,I^=(i=P+B|0)<<7|i>>>25,E^=(i=I+P|0)<<9|i>>>23,B^=(i=E+I|0)<<13|i>>>19,P^=(i=B+E|0)<<18|i>>>14,k^=(i=D+R|0)<<7|i>>>25,A^=(i=k+D|0)<<9|i>>>23,R^=(i=A+k|0)<<13|i>>>19,D^=(i=R+A|0)<<18|i>>>14,S^=(i=w+k|0)<<7|i>>>25,E^=(i=S+w|0)<<9|i>>>23,k^=(i=E+S|0)<<13|i>>>19,w^=(i=k+E|0)<<18|i>>>14,B^=(i=T+x|0)<<7|i>>>25,A^=(i=B+T|0)<<9|i>>>23,x^=(i=A+B|0)<<13|i>>>19,T^=(i=x+A|0)<<18|i>>>14,R^=(i=P+O|0)<<7|i>>>25,M^=(i=R+P|0)<<9|i>>>23,O^=(i=M+R|0)<<13|i>>>19,P^=(i=O+M|0)<<18|i>>>14,C^=(i=D+I|0)<<7|i>>>25,N^=(i=C+D|0)<<9|i>>>23,I^=(i=N+C|0)<<13|i>>>19,D^=(i=I+N|0)<<18|i>>>14;w=w+o|0,S=S+s|0,E=E+a|0,k=k+c|0,x=x+u|0,T=T+l|0,B=B+h|0,A=A+f|0,M=M+p|0,O=O+d|0,P=P+y|0,R=R+g|0,C=C+_|0,N=N+v|0,I=I+b|0,D=D+m|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=S>>>0&255,e[5]=S>>>8&255,e[6]=S>>>16&255,e[7]=S>>>24&255,e[8]=E>>>0&255,e[9]=E>>>8&255,e[10]=E>>>16&255,e[11]=E>>>24&255,e[12]=k>>>0&255,e[13]=k>>>8&255,e[14]=k>>>16&255,e[15]=k>>>24&255,e[16]=x>>>0&255,e[17]=x>>>8&255,e[18]=x>>>16&255,e[19]=x>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=B>>>0&255,e[25]=B>>>8&255,e[26]=B>>>16&255,e[27]=B>>>24&255,e[28]=A>>>0&255,e[29]=A>>>8&255,e[30]=A>>>16&255,e[31]=A>>>24&255,e[32]=M>>>0&255,e[33]=M>>>8&255,e[34]=M>>>16&255,e[35]=M>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=P>>>0&255,e[41]=P>>>8&255,e[42]=P>>>16&255,e[43]=P>>>24&255,e[44]=R>>>0&255,e[45]=R>>>8&255,e[46]=R>>>16&255,e[47]=R>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=I>>>0&255,e[57]=I>>>8&255,e[58]=I>>>16&255,e[59]=I>>>24&255,e[60]=D>>>0&255,e[61]=D>>>8&255,e[62]=D>>>16&255,e[63]=D>>>24&255}function b(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,_=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,m=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,w=o,S=s,E=a,k=c,x=u,T=l,B=h,A=f,M=p,O=d,P=y,R=g,C=_,N=v,I=b,D=m,j=0;j<20;j+=2)x^=(i=w+C|0)<<7|i>>>25,M^=(i=x+w|0)<<9|i>>>23,C^=(i=M+x|0)<<13|i>>>19,w^=(i=C+M|0)<<18|i>>>14,O^=(i=T+S|0)<<7|i>>>25,N^=(i=O+T|0)<<9|i>>>23,S^=(i=N+O|0)<<13|i>>>19,T^=(i=S+N|0)<<18|i>>>14,I^=(i=P+B|0)<<7|i>>>25,E^=(i=I+P|0)<<9|i>>>23,B^=(i=E+I|0)<<13|i>>>19,P^=(i=B+E|0)<<18|i>>>14,k^=(i=D+R|0)<<7|i>>>25,A^=(i=k+D|0)<<9|i>>>23,R^=(i=A+k|0)<<13|i>>>19,D^=(i=R+A|0)<<18|i>>>14,S^=(i=w+k|0)<<7|i>>>25,E^=(i=S+w|0)<<9|i>>>23,k^=(i=E+S|0)<<13|i>>>19,w^=(i=k+E|0)<<18|i>>>14,B^=(i=T+x|0)<<7|i>>>25,A^=(i=B+T|0)<<9|i>>>23,x^=(i=A+B|0)<<13|i>>>19,T^=(i=x+A|0)<<18|i>>>14,R^=(i=P+O|0)<<7|i>>>25,M^=(i=R+P|0)<<9|i>>>23,O^=(i=M+R|0)<<13|i>>>19,P^=(i=O+M|0)<<18|i>>>14,C^=(i=D+I|0)<<7|i>>>25,N^=(i=C+D|0)<<9|i>>>23,I^=(i=N+C|0)<<13|i>>>19,D^=(i=I+N|0)<<18|i>>>14;e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=P>>>0&255,e[9]=P>>>8&255,e[10]=P>>>16&255,e[11]=P>>>24&255,e[12]=D>>>0&255,e[13]=D>>>8&255,e[14]=D>>>16&255,e[15]=D>>>24&255,e[16]=B>>>0&255,e[17]=B>>>8&255,e[18]=B>>>16&255,e[19]=B>>>24&255,e[20]=A>>>0&255,e[21]=A>>>8&255,e[22]=A>>>16&255,e[23]=A>>>24&255,e[24]=M>>>0&255,e[25]=M>>>8&255,e[26]=M>>>16&255,e[27]=M>>>24&255,e[28]=O>>>0&255,e[29]=O>>>8&255,e[30]=O>>>16&255,e[31]=O>>>24&255}function m(e,t,r,n){v(e,t,r,n)}function w(e,t,r,n){b(e,t,r,n)}var S=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function E(e,t,r,n,i,o,s){var a,c,u=new Uint8Array(16),l=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=o[c];for(;i>=64;){for(m(l,u,s,S),c=0;c<64;c++)e[t+c]=r[n+c]^l[c];for(c=8,a=1;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;i-=64,t+=64,n+=64}if(i>0)for(m(l,u,s,S),c=0;c=64;){for(m(c,a,i,S),s=0;s<64;s++)e[t+s]=c[s];for(s=8,o=1;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,t+=64}if(r>0)for(m(c,a,i,S),s=0;s>>13|r<<3)&8191,n=255&e[4]|(255&e[5])<<8,this.r[2]=(r>>>10|n<<6)&7939,i=255&e[6]|(255&e[7])<<8,this.r[3]=(n>>>7|i<<9)&8191,o=255&e[8]|(255&e[9])<<8,this.r[4]=(i>>>4|o<<12)&255,this.r[5]=o>>>1&8190,s=255&e[10]|(255&e[11])<<8,this.r[6]=(o>>>14|s<<2)&8191,a=255&e[12]|(255&e[13])<<8,this.r[7]=(s>>>11|a<<5)&8065,c=255&e[14]|(255&e[15])<<8,this.r[8]=(a>>>8|c<<8)&8191,this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,n,i,o){var s=new B(o);return s.update(r,n,i),s.finish(e,t),0}function M(e,t,r,n,i,o){var s=new Uint8Array(16);return A(s,0,r,n,i,o),g(e,t,s,0)}function O(e,t,r,n,i){var o;if(r<32)return -1;for(T(e,0,t,0,r,n,i),A(e,16,e,32,r-32,e),o=0;o<16;o++)e[o]=0;return 0}function P(e,t,r,n,i){var o,s=new Uint8Array(32);if(r<32||(x(s,0,32,n,i),0!==M(t,16,t,32,r-32,s)))return -1;for(T(e,0,t,0,r,n,i),o=0;o<32;o++)e[o]=0;return 0}function R(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function C(e){var t,r,n=1;for(t=0;t<16;t++)n=Math.floor((r=e[t]+n+65535)/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function N(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function I(e,r){var n,i,o,s=t(),a=t();for(n=0;n<16;n++)a[n]=r[n];for(C(a),C(a),C(a),i=0;i<2;i++){for(n=1,s[0]=a[0]-65517;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,N(a,s,1-o)}for(n=0;n<16;n++)e[2*n]=255&a[n],e[2*n+1]=a[n]>>8}function D(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return I(r,e),I(n,t),_(r,0,n,0)}function j(e){var t=new Uint8Array(32);return I(t,e),1&t[0]}function U(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function F(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function L(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function W(e,t,r){var n,i,o=0,s=0,a=0,c=0,u=0,l=0,h=0,f=0,p=0,d=0,y=0,g=0,_=0,v=0,b=0,m=0,w=0,S=0,E=0,k=0,x=0,T=0,B=0,A=0,M=0,O=0,P=0,R=0,C=0,N=0,I=0,D=r[0],j=r[1],U=r[2],F=r[3],L=r[4],W=r[5],z=r[6],K=r[7],H=r[8],q=r[9],Y=r[10],G=r[11],$=r[12],V=r[13],Z=r[14],J=r[15];o+=(n=t[0])*D,s+=n*j,a+=n*U,c+=n*F,u+=n*L,l+=n*W,h+=n*z,f+=n*K,p+=n*H,d+=n*q,y+=n*Y,g+=n*G,_+=n*$,v+=n*V,b+=n*Z,m+=n*J,s+=(n=t[1])*D,a+=n*j,c+=n*U,u+=n*F,l+=n*L,h+=n*W,f+=n*z,p+=n*K,d+=n*H,y+=n*q,g+=n*Y,_+=n*G,v+=n*$,b+=n*V,m+=n*Z,w+=n*J,a+=(n=t[2])*D,c+=n*j,u+=n*U,l+=n*F,h+=n*L,f+=n*W,p+=n*z,d+=n*K,y+=n*H,g+=n*q,_+=n*Y,v+=n*G,b+=n*$,m+=n*V,w+=n*Z,S+=n*J,c+=(n=t[3])*D,u+=n*j,l+=n*U,h+=n*F,f+=n*L,p+=n*W,d+=n*z,y+=n*K,g+=n*H,_+=n*q,v+=n*Y,b+=n*G,m+=n*$,w+=n*V,S+=n*Z,E+=n*J,u+=(n=t[4])*D,l+=n*j,h+=n*U,f+=n*F,p+=n*L,d+=n*W,y+=n*z,g+=n*K,_+=n*H,v+=n*q,b+=n*Y,m+=n*G,w+=n*$,S+=n*V,E+=n*Z,k+=n*J,l+=(n=t[5])*D,h+=n*j,f+=n*U,p+=n*F,d+=n*L,y+=n*W,g+=n*z,_+=n*K,v+=n*H,b+=n*q,m+=n*Y,w+=n*G,S+=n*$,E+=n*V,k+=n*Z,x+=n*J,h+=(n=t[6])*D,f+=n*j,p+=n*U,d+=n*F,y+=n*L,g+=n*W,_+=n*z,v+=n*K,b+=n*H,m+=n*q,w+=n*Y,S+=n*G,E+=n*$,k+=n*V,x+=n*Z,T+=n*J,f+=(n=t[7])*D,p+=n*j,d+=n*U,y+=n*F,g+=n*L,_+=n*W,v+=n*z,b+=n*K,m+=n*H,w+=n*q,S+=n*Y,E+=n*G,k+=n*$,x+=n*V,T+=n*Z,B+=n*J,p+=(n=t[8])*D,d+=n*j,y+=n*U,g+=n*F,_+=n*L,v+=n*W,b+=n*z,m+=n*K,w+=n*H,S+=n*q,E+=n*Y,k+=n*G,x+=n*$,T+=n*V,B+=n*Z,A+=n*J,d+=(n=t[9])*D,y+=n*j,g+=n*U,_+=n*F,v+=n*L,b+=n*W,m+=n*z,w+=n*K,S+=n*H,E+=n*q,k+=n*Y,x+=n*G,T+=n*$,B+=n*V,A+=n*Z,M+=n*J,y+=(n=t[10])*D,g+=n*j,_+=n*U,v+=n*F,b+=n*L,m+=n*W,w+=n*z,S+=n*K,E+=n*H,k+=n*q,x+=n*Y,T+=n*G,B+=n*$,A+=n*V,M+=n*Z,O+=n*J,g+=(n=t[11])*D,_+=n*j,v+=n*U,b+=n*F,m+=n*L,w+=n*W,S+=n*z,E+=n*K,k+=n*H,x+=n*q,T+=n*Y,B+=n*G,A+=n*$,M+=n*V,O+=n*Z,P+=n*J,_+=(n=t[12])*D,v+=n*j,b+=n*U,m+=n*F,w+=n*L,S+=n*W,E+=n*z,k+=n*K,x+=n*H,T+=n*q,B+=n*Y,A+=n*G,M+=n*$,O+=n*V,P+=n*Z,R+=n*J,v+=(n=t[13])*D,b+=n*j,m+=n*U,w+=n*F,S+=n*L,E+=n*W,k+=n*z,x+=n*K,T+=n*H,B+=n*q,A+=n*Y,M+=n*G,O+=n*$,P+=n*V,R+=n*Z,C+=n*J,b+=(n=t[14])*D,m+=n*j,w+=n*U,S+=n*F,E+=n*L,k+=n*W,x+=n*z,T+=n*K,B+=n*H,A+=n*q,M+=n*Y,O+=n*G,P+=n*$,R+=n*V,C+=n*Z,N+=n*J,m+=(n=t[15])*D,w+=n*j,S+=n*U,E+=n*F,k+=n*L,x+=n*W,T+=n*z,B+=n*K,A+=n*H,M+=n*q,O+=n*Y,P+=n*G,R+=n*$,C+=n*V,N+=n*Z,I+=n*J,o+=38*w,s+=38*S,a+=38*E,c+=38*k,u+=38*x,l+=38*T,h+=38*B,f+=38*A,p+=38*M,d+=38*O,y+=38*P,g+=38*R,_+=38*C,v+=38*N,b+=38*I,i=Math.floor((n=o+(i=1)+65535)/65536),o=n-65536*i,i=Math.floor((n=s+i+65535)/65536),s=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=_+i+65535)/65536),_=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,o+=i-1+37*(i-1),i=Math.floor((n=o+(i=1)+65535)/65536),o=n-65536*i,i=Math.floor((n=s+i+65535)/65536),s=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=_+i+65535)/65536),_=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=h,e[7]=f,e[8]=p,e[9]=d,e[10]=y,e[11]=g,e[12]=_,e[13]=v,e[14]=b,e[15]=m}function z(e,t){W(e,t,t)}function K(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)z(i,i),2!==n&&4!==n&&W(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function H(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)z(i,i),1!==n&&W(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function q(e,r,n){var i,o,s=new Uint8Array(32),a=new Float64Array(80),u=t(),l=t(),h=t(),f=t(),p=t(),d=t();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,U(a,n),o=0;o<16;o++)l[o]=a[o],f[o]=u[o]=h[o]=0;for(o=254,u[0]=f[0]=1;o>=0;--o)N(u,l,i=s[o>>>3]>>>(7&o)&1),N(h,f,i),F(p,u,h),L(u,u,h),F(h,l,f),L(l,l,f),z(f,p),z(d,u),W(u,h,u),W(h,l,p),F(p,u,h),L(u,u,h),z(l,u),L(h,f,d),W(u,h,c),F(u,u,f),W(h,h,u),W(u,f,d),W(f,l,a),z(l,p),N(u,l,i),N(h,f,i);for(o=0;o<16;o++)a[o+16]=u[o],a[o+32]=h[o],a[o+48]=l[o],a[o+64]=f[o];var y=a.subarray(32),g=a.subarray(16);return K(y,y),W(g,g,y),I(e,g),0}function Y(e,t){return q(e,t,o)}function G(e,t){return n(t,32),Y(e,t)}function $(e,t,r){var n=new Uint8Array(32);return q(n,r,t),w(e,i,n,S)}B.prototype.blocks=function(e,t,r){for(var n,i,o,s,a,c,u,l,h,f,p,d,y,g,_,v,b,m,w,S=this.fin?0:2048,E=this.h[0],k=this.h[1],x=this.h[2],T=this.h[3],B=this.h[4],A=this.h[5],M=this.h[6],O=this.h[7],P=this.h[8],R=this.h[9],C=this.r[0],N=this.r[1],I=this.r[2],D=this.r[3],j=this.r[4],U=this.r[5],F=this.r[6],L=this.r[7],W=this.r[8],z=this.r[9];r>=16;)E+=8191&(n=255&e[t+0]|(255&e[t+1])<<8),k+=(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3)&8191,x+=(i>>>10|(o=255&e[t+4]|(255&e[t+5])<<8)<<6)&8191,T+=(o>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9)&8191,B+=(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12)&8191,A+=a>>>1&8191,M+=(a>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2)&8191,O+=(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5)&8191,P+=(u>>>8|(l=255&e[t+14]|(255&e[t+15])<<8)<<8)&8191,R+=l>>>5|S,h=(f=(h=0)+E*C+5*z*k+5*W*x+5*L*T+5*F*B)>>>13,f&=8191,f+=5*U*A+5*j*M+5*D*O+5*I*P+5*N*R,h+=f>>>13,f&=8191,h=(p=h+E*N+k*C+5*z*x+5*W*T+5*L*B)>>>13,p&=8191,p+=5*F*A+5*U*M+5*j*O+5*D*P+5*I*R,h+=p>>>13,p&=8191,h=(d=h+E*I+k*N+x*C+5*z*T+5*W*B)>>>13,d&=8191,d+=5*L*A+5*F*M+5*U*O+5*j*P+5*D*R,h+=d>>>13,d&=8191,h=(y=h+E*D+k*I+x*N+T*C+5*z*B)>>>13,y&=8191,y+=5*W*A+5*L*M+5*F*O+5*U*P+5*j*R,h+=y>>>13,y&=8191,h=(g=h+E*j+k*D+x*I+T*N+B*C)>>>13,g&=8191,g+=5*z*A+5*W*M+5*L*O+5*F*P+5*U*R,h+=g>>>13,g&=8191,h=(_=h+E*U+k*j+x*D+T*I+B*N)>>>13,_&=8191,_+=A*C+5*z*M+5*W*O+5*L*P+5*F*R,h+=_>>>13,_&=8191,h=(v=h+E*F+k*U+x*j+T*D+B*I)>>>13,v&=8191,v+=A*N+M*C+5*z*O+5*W*P+5*L*R,h+=v>>>13,v&=8191,h=(b=h+E*L+k*F+x*U+T*j+B*D)>>>13,b&=8191,b+=A*I+M*N+O*C+5*z*P+5*W*R,h+=b>>>13,b&=8191,h=(m=h+E*W+k*L+x*F+T*U+B*j)>>>13,m&=8191,m+=A*D+M*I+O*N+P*C+5*z*R,h+=m>>>13,m&=8191,h=(w=h+E*z+k*W+x*L+T*F+B*U)>>>13,w&=8191,w+=A*j+M*D+O*I+P*N+R*C,h+=w>>>13,w&=8191,f=8191&(h=(h=(h<<2)+h|0)+f|0),h>>>=13,p+=h,E=f,k=p,x=d,T=y,B=g,A=_,M=v,O=b,P=m,R=w,t+=16,r-=16;this.h[0]=E,this.h[1]=k,this.h[2]=x,this.h[3]=T,this.h[4]=B,this.h[5]=A,this.h[6]=M,this.h[7]=O,this.h[8]=P,this.h[9]=R},B.prototype.finish=function(e,t){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(o=0,n=~n;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(o=1,this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,i=this.h[0]+this.pad[0],this.h[0]=65535&i;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},B.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n=128;){for(S=0;S<16;S++)E=8*S+$,O[S]=r[E+0]<<24|r[E+1]<<16|r[E+2]<<8|r[E+3],P[S]=r[E+4]<<24|r[E+5]<<16|r[E+6]<<8|r[E+7];for(S=0;S<80;S++)if(i=R,o=C,s=N,a=I,c=D,u=j,l=U,h=F,f=L,p=W,d=z,y=K,g=H,_=q,v=Y,b=G,k=F,T=65535&(x=G),B=x>>>16,A=65535&k,M=k>>>16,k=(D>>>14|H<<18)^(D>>>18|H<<14)^(H>>>9|D<<23),T+=65535&(x=(H>>>14|D<<18)^(H>>>18|D<<14)^(D>>>9|H<<23)),B+=x>>>16,A+=65535&k,M+=k>>>16,k=D&j^~D&U,T+=65535&(x=H&q^~H&Y),B+=x>>>16,A+=65535&k,M+=k>>>16,k=Q[2*S],T+=65535&(x=Q[2*S+1]),B+=x>>>16,A+=65535&k,M+=k>>>16,k=O[S%16],T+=65535&(x=P[S%16]),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,m=65535&A|M<<16,w=65535&T|B<<16,k=m,T=65535&(x=w),B=x>>>16,A=65535&k,M=k>>>16,k=(R>>>28|L<<4)^(L>>>2|R<<30)^(L>>>7|R<<25),T+=65535&(x=(L>>>28|R<<4)^(R>>>2|L<<30)^(R>>>7|L<<25)),B+=x>>>16,A+=65535&k,M+=k>>>16,k=R&C^R&N^C&N,T+=65535&(x=L&W^L&z^W&z),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,h=65535&A|M<<16,b=65535&T|B<<16,k=a,T=65535&(x=y),B=x>>>16,A=65535&k,M=k>>>16,k=m,T+=65535&(x=w),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,a=65535&A|M<<16,y=65535&T|B<<16,C=i,N=o,I=s,D=a,j=c,U=u,F=l,R=h,W=f,z=p,K=d,H=y,q=g,Y=_,G=v,L=b,S%16==15)for(E=0;E<16;E++)k=O[E],T=65535&(x=P[E]),B=x>>>16,A=65535&k,M=k>>>16,k=O[(E+9)%16],T+=65535&(x=P[(E+9)%16]),B+=x>>>16,A+=65535&k,M+=k>>>16,k=((m=O[(E+1)%16])>>>1|(w=P[(E+1)%16])<<31)^(m>>>8|w<<24)^m>>>7,T+=65535&(x=(w>>>1|m<<31)^(w>>>8|m<<24)^(w>>>7|m<<25)),B+=x>>>16,A+=65535&k,M+=k>>>16,k=((m=O[(E+14)%16])>>>19|(w=P[(E+14)%16])<<13)^(w>>>29|m<<3)^m>>>6,T+=65535&(x=(w>>>19|m<<13)^(m>>>29|w<<3)^(w>>>6|m<<26)),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,O[E]=65535&A|M<<16,P[E]=65535&T|B<<16;k=R,T=65535&(x=L),B=x>>>16,A=65535&k,M=k>>>16,k=e[0],T+=65535&(x=t[0]),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,e[0]=R=65535&A|M<<16,t[0]=L=65535&T|B<<16,k=C,T=65535&(x=W),B=x>>>16,A=65535&k,M=k>>>16,k=e[1],T+=65535&(x=t[1]),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,e[1]=C=65535&A|M<<16,t[1]=W=65535&T|B<<16,k=N,T=65535&(x=z),B=x>>>16,A=65535&k,M=k>>>16,k=e[2],T+=65535&(x=t[2]),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,e[2]=N=65535&A|M<<16,t[2]=z=65535&T|B<<16,k=I,T=65535&(x=K),B=x>>>16,A=65535&k,M=k>>>16,k=e[3],T+=65535&(x=t[3]),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,e[3]=I=65535&A|M<<16,t[3]=K=65535&T|B<<16,k=D,T=65535&(x=H),B=x>>>16,A=65535&k,M=k>>>16,k=e[4],T+=65535&(x=t[4]),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,e[4]=D=65535&A|M<<16,t[4]=H=65535&T|B<<16,k=j,T=65535&(x=q),B=x>>>16,A=65535&k,M=k>>>16,k=e[5],T+=65535&(x=t[5]),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,e[5]=j=65535&A|M<<16,t[5]=q=65535&T|B<<16,k=U,T=65535&(x=Y),B=x>>>16,A=65535&k,M=k>>>16,k=e[6],T+=65535&(x=t[6]),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,e[6]=U=65535&A|M<<16,t[6]=Y=65535&T|B<<16,k=F,T=65535&(x=G),B=x>>>16,A=65535&k,M=k>>>16,k=e[7],T+=65535&(x=t[7]),B+=x>>>16,A+=65535&k,M+=k>>>16,B+=T>>>16,A+=B>>>16,M+=A>>>16,e[7]=F=65535&A|M<<16,t[7]=G=65535&T|B<<16,$+=128,n-=128}return n}function et(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,ee(i,o,t,r),r%=128,n=0;n=0;--i)en(e,t,n=r[i/8|0]>>(7&i)&1),er(t,e),er(e,e),en(e,t,n)}function es(e,r){var n=[t(),t(),t(),t()];R(n[0],h),R(n[1],f),R(n[2],a),W(n[3],h,f),eo(e,n,r)}function ea(e,r,i){var o,s=new Uint8Array(64),a=[t(),t(),t(),t()];for(i||n(r,32),et(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,es(a,s),ei(e,a),o=0;o<32;o++)r[o+32]=e[o];return 0}var ec=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function eu(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>4)*ec[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ec[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function el(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;eu(e,r)}function eh(e,r,n,i){var o,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),l=new Float64Array(64),h=[t(),t(),t(),t()];et(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var f=n+64;for(o=0;o>7&&L(e[0],s,e[0]),W(e[3],e[0],e[1]),0)}function ep(e,r,n,i){var o,s=new Uint8Array(32),a=new Uint8Array(64),c=[t(),t(),t(),t()],u=[t(),t(),t(),t()];if(n<64||ef(u,i))return -1;for(o=0;o=0},e.sign.keyPair=function(){var e=new Uint8Array(eB),t=new Uint8Array(eA);return ea(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(eC(e),e.length!==eA)throw Error("bad secret key size");for(var t=new Uint8Array(eB),r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),T(n.showHidden)&&(n.showHidden=!1),T(n.depth)&&(n.depth=2),T(n.colors)&&(n.colors=!1),T(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),p(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?"\x1b["+u.colors[r][0]+"m"+e+"\x1b["+u.colors[r][1]+"m":e}function h(e,t){return e}function f(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function p(e,r,n){if(e.customInspect&&r&&P(r.inspect)&&r.inspect!==t.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o=r.inspect(n,e);return k(o)||(o=p(e,o,n)),o}var s=d(e,r);if(s)return s;var a=Object.keys(r),c=f(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),O(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return y(r);if(0===a.length){if(P(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(B(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return e.stylize(Date.prototype.toString.call(r),"date");if(O(r))return y(r)}var l="",h=!1,m=["{","}"];return(b(r)&&(h=!0,m=["[","]"]),P(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),B(r)&&(l=" "+RegExp.prototype.toString.call(r)),M(r)&&(l=" "+Date.prototype.toUTCString.call(r)),O(r)&&(l=" "+y(r)),0!==a.length||h&&0!=r.length)?n<0?B(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),i=h?g(e,r,n,c,a):a.map(function(t){return _(e,r,n,c,t,h)}),e.seen.pop(),v(i,l,m)):m[0]+l+m[1]}function d(e,t){if(T(t))return e.stylize("undefined","undefined");if(k(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return E(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):w(t)?e.stylize("null","null"):void 0}function y(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,i){for(var o=[],s=0,a=t.length;se.seen.indexOf(c.value)?(a=w(r)?p(e,c.value,null):p(e,c.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),T(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function v(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function b(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function w(e){return null===e}function S(e){return null==e}function E(e){return"number"==typeof e}function k(e){return"string"==typeof e}function x(e){return"symbol"==typeof e}function T(e){return void 0===e}function B(e){return A(e)&&"[object RegExp]"===C(e)}function A(e){return"object"==typeof e&&null!==e}function M(e){return A(e)&&"[object Date]"===C(e)}function O(e){return A(e)&&("[object Error]"===C(e)||e instanceof Error)}function P(e){return"function"==typeof e}function R(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function C(e){return Object.prototype.toString.call(e)}function N(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(!s[e=e.toUpperCase()]){if(a.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){}}return s[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(42613),t.isArray=b,t.isBoolean=m,t.isNull=w,t.isNullOrUndefined=S,t.isNumber=E,t.isString=k,t.isSymbol=x,t.isUndefined=T,t.isRegExp=B,t.types.isRegExp=B,t.isObject=A,t.isDate=M,t.types.isDate=M,t.isError=O,t.types.isNativeError=O,t.isFunction=P,t.isPrimitive=R,t.isBuffer=r(4330);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function D(){var e=new Date,t=[N(e.getHours()),N(e.getMinutes()),N(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",D(),t.format.apply(t,arguments))},t.inherits=r(87398),t._extend=function(e,t){if(!t||!A(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var U="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function F(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function L(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r-1?t:"Object"===t&&_(e)}return a?g(e):null}},59436:function(e,t,r){"use strict";var n=r(76269),i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;tl;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},19713:function(e,t,r){"use strict";var n=r(905);e.exports=n([].slice)},66749:function(e,t,r){"use strict";var n=r(4235)("iterator"),i=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){i=!0}};s[n]=function(){return this},Array.from(s,function(){throw 2})}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},90651:function(e,t,r){"use strict";var n=r(905),i=n({}.toString),o=n("".slice);e.exports=function(e){return o(i(e),8,-1)}},74457:function(e,t,r){"use strict";var n=r(77448),i=r(19415),o=r(90651),s=r(4235)("toStringTag"),a=Object,c="Arguments"===o(function(){return arguments}()),u=function(e,t){try{return e[t]}catch(e){}};e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=u(t=a(e),s))?r:c?o(t):"Object"===(n=o(t))&&i(t.callee)?"Arguments":n}},76828:function(e,t,r){"use strict";var n=r(95945),i=r(25573),o=r(38562),s=r(79606);e.exports=function(e,t,r){for(var a=i(t),c=s.f,u=o.f,l=0;l0&&n[0]<4?1:+(n[0]+n[1])),!i&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},2738:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},90685:function(e,t,r){"use strict";var n=r(905),i=Error,o=n("".replace),s=function(e){return String(new i(e).stack)}("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,c=a.test(s);e.exports=function(e,t){if(c&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=o(e,a,"");return e}},11729:function(e,t,r){"use strict";var n=r(57780),i=r(90685),o=r(43338),s=Error.captureStackTrace;e.exports=function(e,t,r,a){o&&(s?s(e,t):n(e,"stack",i(r,a)))}},43338:function(e,t,r){"use strict";var n=r(78877),i=r(27737);e.exports=!n(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)})},67441:function(e,t,r){"use strict";var n=r(21936),i=r(535),o=r(92708),s=r(19415),a=r(38562).f,c=r(25086),u=r(39862),l=r(26508),h=r(57780),f=r(95945);r(74327);var p=function(e){var t=function(r,n,o){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,o)}return i(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,i,d,y,g,_,v,b,m,w=e.target,S=e.global,E=e.stat,k=e.proto,x=S?n:E?n[w]:n[w]&&n[w].prototype,T=S?u:u[w]||h(u,w,{})[w],B=T.prototype;for(y in t)i=!(r=c(S?y:w+(E?".":"#")+y,e.forced))&&x&&f(x,y),_=T[y],i&&(v=e.dontCallGetSet?(m=a(x,y))&&m.value:x[y]),g=i&&v?v:t[y],(r||k||typeof _!=typeof g)&&(b=e.bind&&i?l(g,n):e.wrap&&i?p(g):k&&s(g)?o(g):g,(e.sham||g&&g.sham||_&&_.sham)&&h(b,"sham",!0),h(T,y,b),k&&(f(u,d=w+"Prototype")||h(u,d,{}),h(u[d],y,g),e.real&&B&&(r||!B[y])&&h(B,y,g)))}},78877:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},535:function(e,t,r){"use strict";var n=r(69544),i=Function.prototype,o=i.apply,s=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},26508:function(e,t,r){"use strict";var n=r(92708),i=r(39135),o=r(69544),s=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?s(e,t):function(){return e.apply(t,arguments)}}},69544:function(e,t,r){"use strict";var n=r(78877);e.exports=!n(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},10131:function(e,t,r){"use strict";var n=r(69544),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},2140:function(e,t,r){"use strict";var n=r(83594),i=r(95945),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=i(o,"name"),c=a&&"something"===(function(){}).name,u=a&&(!n||n&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},36222:function(e,t,r){"use strict";var n=r(905),i=r(39135);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},92708:function(e,t,r){"use strict";var n=r(90651),i=r(905);e.exports=function(e){if("Function"===n(e))return i(e)}},905:function(e,t,r){"use strict";var n=r(69544),i=Function.prototype,o=i.call,s=n&&i.bind.bind(o,o);e.exports=n?s:function(e){return function(){return o.apply(e,arguments)}}},54714:function(e,t,r){"use strict";var n=r(39862),i=r(21936),o=r(19415),s=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?s(n[e])||s(i[e]):n[e]&&n[e][t]||i[e]&&i[e][t]}},58289:function(e,t,r){"use strict";var n=r(74457),i=r(22927),o=r(55654),s=r(39078),a=r(4235)("iterator");e.exports=function(e){if(!o(e))return i(e,a)||i(e,"@@iterator")||s[n(e)]}},57806:function(e,t,r){"use strict";var n=r(10131),i=r(39135),o=r(21926),s=r(1734),a=r(58289),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(i(r))return o(n(r,e));throw new c(s(e)+" is not iterable")}},22927:function(e,t,r){"use strict";var n=r(39135),i=r(55654);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},21936:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},95945:function(e,t,r){"use strict";var n=r(905),i=r(15554),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},34716:function(e){"use strict";e.exports={}},41783:function(e){"use strict";e.exports=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}}},53566:function(e,t,r){"use strict";var n=r(54714);e.exports=n("document","documentElement")},48376:function(e,t,r){"use strict";var n=r(83594),i=r(78877),o=r(8789);e.exports=!n&&!i(function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},68206:function(e,t,r){"use strict";var n=r(905),i=r(78877),o=r(90651),s=Object,a=n("".split);e.exports=i(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===o(e)?a(e,""):s(e)}:s},24040:function(e,t,r){"use strict";var n=r(905),i=r(19415),o=r(74327),s=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},79885:function(e,t,r){"use strict";var n=r(27894),i=r(57780);e.exports=function(e,t){n(t)&&"cause"in t&&i(e,"cause",t.cause)}},6308:function(e,t,r){"use strict";var n,i,o,s=r(31629),a=r(21936),c=r(27894),u=r(57780),l=r(95945),h=r(74327),f=r(46859),p=r(34716),d="Object already initialized",y=a.TypeError,g=a.WeakMap,_=function(e){return o(e)?i(e):n(e,{})},v=function(e){return function(t){var r;if(!c(t)||(r=i(t)).type!==e)throw new y("Incompatible receiver, "+e+" required");return r}};if(s||h.state){var b=h.state||(h.state=new g);b.get=b.get,b.has=b.has,b.set=b.set,n=function(e,t){if(b.has(e))throw new y(d);return t.facade=e,b.set(e,t),t},i=function(e){return b.get(e)||{}},o=function(e){return b.has(e)}}else{var m=f("state");p[m]=!0,n=function(e,t){if(l(e,m))throw new y(d);return t.facade=e,u(e,m,t),t},i=function(e){return l(e,m)?e[m]:{}},o=function(e){return l(e,m)}}e.exports={set:n,get:i,has:o,enforce:_,getterFor:v}},11071:function(e,t,r){"use strict";var n=r(4235),i=r(39078),o=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||s[o]===e)}},19415:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},69439:function(e,t,r){"use strict";var n=r(905),i=r(78877),o=r(19415),s=r(74457),a=r(54714),c=r(24040),u=function(){},l=a("Reflect","construct"),h=/^\s*(?:class|function)\b/,f=n(h.exec),p=!h.test(u),d=function(e){if(!o(e))return!1;try{return l(u,[],e),!0}catch(e){return!1}},y=function(e){if(!o(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(h,c(e))}catch(e){return!0}};y.sham=!0,e.exports=!l||i(function(){var e;return d(d.call)||!d(Object)||!d(function(){e=!0})||e})?y:d},25086:function(e,t,r){"use strict";var n=r(78877),i=r(19415),o=/#|\.prototype\./,s=function(e,t){var r=c[a(e)];return r===l||r!==u&&(i(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";e.exports=s},55654:function(e){"use strict";e.exports=function(e){return null==e}},27894:function(e,t,r){"use strict";var n=r(19415);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},18168:function(e,t,r){"use strict";var n=r(27894);e.exports=function(e){return n(e)||null===e}},84446:function(e){"use strict";e.exports=!0},28610:function(e,t,r){"use strict";var n=r(54714),i=r(19415),o=r(86466),s=r(59624),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&o(t.prototype,a(e))}},53924:function(e,t,r){"use strict";var n=r(26508),i=r(10131),o=r(21926),s=r(1734),a=r(11071),c=r(80210),u=r(86466),l=r(57806),h=r(58289),f=r(79031),p=TypeError,d=function(e,t){this.stopped=e,this.result=t},y=d.prototype;e.exports=function(e,t,r){var g,_,v,b,m,w,S,E=r&&r.that,k=!!(r&&r.AS_ENTRIES),x=!!(r&&r.IS_RECORD),T=!!(r&&r.IS_ITERATOR),B=!!(r&&r.INTERRUPTED),A=n(t,E),M=function(e){return g&&f(g,"normal",e),new d(!0,e)},O=function(e){return k?(o(e),B?A(e[0],e[1],M):A(e[0],e[1])):B?A(e,M):A(e)};if(x)g=e.iterator;else if(T)g=e;else{if(!(_=h(e)))throw new p(s(e)+" is not iterable");if(a(_)){for(v=0,b=c(e);b>v;v++)if((m=O(e[v]))&&u(y,m))return m;return new d(!1)}g=l(e,_)}for(w=x?e.next:g.next;!(S=i(w,g)).done;){try{m=O(S.value)}catch(e){f(g,"throw",e)}if("object"==typeof m&&m&&u(y,m))return m}return new d(!1)}},79031:function(e,t,r){"use strict";var n=r(10131),i=r(21926),o=r(22927);e.exports=function(e,t,r){var s,a;i(e);try{if(!(s=o(e,"return"))){if("throw"===t)throw r;return r}s=n(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw r;if(a)throw s;return i(s),r}},87278:function(e,t,r){"use strict";var n=r(55795).IteratorPrototype,i=r(50994),o=r(27737),s=r(20215),a=r(39078),c=function(){return this};e.exports=function(e,t,r,u){var l=t+" Iterator";return e.prototype=i(n,{next:o(+!u,r)}),s(e,l,!1,!0),a[l]=c,e}},9383:function(e,t,r){"use strict";var n=r(67441),i=r(10131),o=r(84446),s=r(2140),a=r(19415),c=r(87278),u=r(33634),l=r(57086),h=r(20215),f=r(57780),p=r(33849),d=r(4235),y=r(39078),g=r(55795),_=s.PROPER,v=s.CONFIGURABLE,b=g.IteratorPrototype,m=g.BUGGY_SAFARI_ITERATORS,w=d("iterator"),S="keys",E="values",k="entries",x=function(){return this};e.exports=function(e,t,r,s,d,g,T){c(r,t,s);var B,A,M,O=function(e){if(e===d&&I)return I;if(!m&&e&&e in C)return C[e];switch(e){case S:case E:case k:return function(){return new r(this,e)}}return function(){return new r(this)}},P=t+" Iterator",R=!1,C=e.prototype,N=C[w]||C["@@iterator"]||d&&C[d],I=!m&&N||O(d),D="Array"===t&&C.entries||N;if(D&&(B=u(D.call(new e)))!==Object.prototype&&B.next&&(o||u(B)===b||(l?l(B,b):a(B[w])||p(B,w,x)),h(B,P,!0,!0),o&&(y[P]=x)),_&&d===E&&N&&N.name!==E&&(!o&&v?f(C,"name",E):(R=!0,I=function(){return i(N,this)})),d){if(A={values:O(E),keys:g?I:O(S),entries:O(k)},T)for(M in A)!m&&!R&&M in C||p(C,M,A[M]);else n({target:t,proto:!0,forced:m||R},A)}return(!o||T)&&C[w]!==I&&p(C,w,I,{name:d}),y[t]=I,A}},55795:function(e,t,r){"use strict";var n,i,o,s=r(78877),a=r(19415),c=r(27894),u=r(50994),l=r(33634),h=r(33849),f=r(4235),p=r(84446),d=f("iterator"),y=!1;[].keys&&("next"in(o=[].keys())?(i=l(l(o)))!==Object.prototype&&(n=i):y=!0),!c(n)||s(function(){var e={};return n[d].call(e)!==e})?n={}:p&&(n=u(n)),a(n[d])||h(n,d,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:y}},39078:function(e){"use strict";e.exports={}},80210:function(e,t,r){"use strict";var n=r(83221);e.exports=function(e){return n(e.length)}},92903:function(e){"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},31794:function(e,t,r){"use strict";var n,i,o,s,a,c=r(21936),u=r(67761),l=r(26508),h=r(56482).set,f=r(16582),p=r(41777),d=r(95971),y=r(70129),g=r(8704),_=c.MutationObserver||c.WebKitMutationObserver,v=c.document,b=c.process,m=c.Promise,w=u("queueMicrotask");if(!w){var S=new f,E=function(){var e,t;for(g&&(e=b.domain)&&e.exit();t=S.get();)try{t()}catch(e){throw S.head&&n(),e}e&&e.enter()};p||g||y||!_||!v?!d&&m&&m.resolve?((s=m.resolve(void 0)).constructor=m,a=l(s.then,s),n=function(){a(E)}):g?n=function(){b.nextTick(E)}:(h=l(h,c),n=function(){h(E)}):(i=!0,o=v.createTextNode(""),new _(E).observe(o,{characterData:!0}),n=function(){o.data=i=!i}),w=function(e){S.head||n(),S.add(e)}}e.exports=w},41355:function(e,t,r){"use strict";var n=r(39135),i=TypeError,o=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw new i("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new o(e)}},20736:function(e,t,r){"use strict";var n=r(10182);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},50994:function(e,t,r){"use strict";var n,i=r(21926),o=r(41889),s=r(2738),a=r(34716),c=r(53566),u=r(8789),l=r(46859),h=">",f="<",p="prototype",d="script",y=l("IE_PROTO"),g=function(){},_=function(e){return f+d+h+e+f+"/"+d+h},v=function(e){e.write(_("")),e.close();var t=e.parentWindow.Object;return e=null,t},b=function(){var e,t=u("iframe"),r="java"+d+":";return t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(_("document.F=Object")),e.close(),e.F},m=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}m="undefined"!=typeof document?document.domain&&n?v(n):b():v(n);for(var e=s.length;e--;)delete m[p][s[e]];return m()};a[y]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(g[p]=i(e),r=new g,g[p]=null,r[y]=e):r=m(),void 0===t?r:o.f(r,t)}},41889:function(e,t,r){"use strict";var n=r(83594),i=r(60125),o=r(79606),s=r(21926),a=r(95777),c=r(33273);t.f=n&&!i?Object.defineProperties:function(e,t){s(e);for(var r,n=a(t),i=c(t),u=i.length,l=0;u>l;)o.f(e,r=i[l++],n[r]);return e}},79606:function(e,t,r){"use strict";var n=r(83594),i=r(48376),o=r(60125),s=r(21926),a=r(28591),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",f="configurable",p="writable";t.f=n?o?function(e,t,r){if(s(e),t=a(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=l(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:f in r?r[f]:n[f],enumerable:h in r?r[h]:n[h],writable:!1})}return u(e,t,r)}:u:function(e,t,r){if(s(e),t=a(t),s(r),i)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},38562:function(e,t,r){"use strict";var n=r(83594),i=r(10131),o=r(95855),s=r(27737),a=r(95777),c=r(28591),u=r(95945),l=r(48376),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=a(e),t=c(t),l)try{return h(e,t)}catch(e){}if(u(e,t))return s(!i(o.f,e,t),e[t])}},50640:function(e,t,r){"use strict";var n=r(19025),i=r(2738).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},19894:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},33634:function(e,t,r){"use strict";var n=r(95945),i=r(19415),o=r(15554),s=r(46859),a=r(46675),c=s("IE_PROTO"),u=Object,l=u.prototype;e.exports=a?u.getPrototypeOf:function(e){var t=o(e);if(n(t,c))return t[c];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof u?l:null}},86466:function(e,t,r){"use strict";var n=r(905);e.exports=n({}.isPrototypeOf)},19025:function(e,t,r){"use strict";var n=r(905),i=r(95945),o=r(95777),s=r(1056).indexOf,a=r(34716),c=n([].push);e.exports=function(e,t){var r,n=o(e),u=0,l=[];for(r in n)!i(a,r)&&i(n,r)&&c(l,r);for(;t.length>u;)i(n,r=t[u++])&&(~s(l,r)||c(l,r));return l}},33273:function(e,t,r){"use strict";var n=r(19025),i=r(2738);e.exports=Object.keys||function(e){return n(e,i)}},95855:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},57086:function(e,t,r){"use strict";var n=r(36222),i=r(27894),o=r(99995),s=r(93911);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return o(r),s(n),i(r)&&(t?e(r,n):r.__proto__=n),r}}():void 0)},66238:function(e,t,r){"use strict";var n=r(77448),i=r(74457);e.exports=n?({}).toString:function(){return"[object "+i(this)+"]"}},57202:function(e,t,r){"use strict";var n=r(10131),i=r(19415),o=r(27894),s=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&i(r=e.toString)&&!o(a=n(r,e))||i(r=e.valueOf)&&!o(a=n(r,e))||"string"!==t&&i(r=e.toString)&&!o(a=n(r,e)))return a;throw new s("Can't convert object to primitive value")}},25573:function(e,t,r){"use strict";var n=r(54714),i=r(905),o=r(50640),s=r(19894),a=r(21926),c=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),r=s.f;return r?c(t,r(e)):t}},39862:function(e){"use strict";e.exports={}},96636:function(e){"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},41991:function(e,t,r){"use strict";var n=r(21936),i=r(82788),o=r(19415),s=r(25086),a=r(24040),c=r(4235),u=r(6850),l=r(30900),h=r(84446),f=r(86838),p=i&&i.prototype,d=c("species"),y=!1,g=o(n.PromiseRejectionEvent),_=s("Promise",function(){var e=a(i),t=e!==String(i);if(!t&&66===f||h&&!(p.catch&&p.finally))return!0;if(!f||f<51||!/native code/.test(e)){var r=new i(function(e){e(1)}),n=function(e){e(function(){},function(){})};if((r.constructor={})[d]=n,!(y=r.then(function(){}) instanceof n))return!0}return!t&&(u||l)&&!g});e.exports={CONSTRUCTOR:_,REJECTION_EVENT:g,SUBCLASSING:y}},82788:function(e,t,r){"use strict";var n=r(21936);e.exports=n.Promise},41496:function(e,t,r){"use strict";var n=r(21926),i=r(27894),o=r(41355);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},52672:function(e,t,r){"use strict";var n=r(82788),i=r(66749),o=r(41991).CONSTRUCTOR;e.exports=o||!i(function(e){n.all(e).then(void 0,function(){})})},16582:function(e){"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},99995:function(e,t,r){"use strict";var n=r(55654),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},67761:function(e,t,r){"use strict";var n=r(21936),i=r(83594),o=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return n[e];var t=o(n,e);return t&&t.value}},26638:function(e,t,r){"use strict";var n=r(54714),i=r(53669),o=r(4235),s=r(83594),a=o("species");e.exports=function(e){var t=n(e);s&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},20215:function(e,t,r){"use strict";var n=r(77448),i=r(79606).f,o=r(57780),s=r(95945),a=r(66238),c=r(4235)("toStringTag");e.exports=function(e,t,r,u){var l=r?e:e&&e.prototype;l&&(s(l,c)||i(l,c,{configurable:!0,value:t}),u&&!n&&o(l,"toString",a))}},46859:function(e,t,r){"use strict";var n=r(91474),i=r(50168),o=n("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},74327:function(e,t,r){"use strict";var n=r(84446),i=r(21936),o=r(87359),s="__core-js_shared__",a=e.exports=i[s]||o(s,{});(a.versions||(a.versions=[])).push({version:"3.37.1",mode:n?"pure":"global",copyright:"\xa9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"})},91474:function(e,t,r){"use strict";var n=r(74327);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},87199:function(e,t,r){"use strict";var n=r(21926),i=r(20404),o=r(55654),s=r(4235)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||o(r=n(a)[s])?t:i(r)}},52856:function(e,t,r){"use strict";var n=r(905),i=r(1164),o=r(10182),s=r(99995),a=n("".charAt),c=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,r){var n,l,h=o(s(t)),f=i(r),p=h.length;return f<0||f>=p?e?"":void 0:(n=c(h,f))<55296||n>56319||f+1===p||(l=c(h,f+1))<56320||l>57343?e?a(h,f):n:e?u(h,f,f+2):(n-55296<<10)+(l-56320)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},25892:function(e,t,r){"use strict";var n=r(86838),i=r(78877),o=r(21936).String;e.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e) instanceof Symbol)||!Symbol.sham&&n&&n<41})},56482:function(e,t,r){"use strict";var n,i,o,s,a=r(21936),c=r(535),u=r(26508),l=r(19415),h=r(95945),f=r(78877),p=r(53566),d=r(19713),y=r(8789),g=r(19368),_=r(41777),v=r(8704),b=a.setImmediate,m=a.clearImmediate,w=a.process,S=a.Dispatch,E=a.Function,k=a.MessageChannel,x=a.String,T=0,B={},A="onreadystatechange";f(function(){n=a.location});var M=function(e){if(h(B,e)){var t=B[e];delete B[e],t()}},O=function(e){return function(){M(e)}},P=function(e){M(e.data)},R=function(e){a.postMessage(x(e),n.protocol+"//"+n.host)};b&&m||(b=function(e){g(arguments.length,1);var t=l(e)?e:E(e),r=d(arguments,1);return B[++T]=function(){c(t,void 0,r)},i(T),T},m=function(e){delete B[e]},v?i=function(e){w.nextTick(O(e))}:S&&S.now?i=function(e){S.now(O(e))}:k&&!_?(s=(o=new k).port2,o.port1.onmessage=P,i=u(s.postMessage,s)):a.addEventListener&&l(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!f(R)?(i=R,a.addEventListener("message",P,!1)):i=A in y("script")?function(e){p.appendChild(y("script"))[A]=function(){p.removeChild(this),M(e)}}:function(e){setTimeout(O(e),0)}),e.exports={set:b,clear:m}},10628:function(e,t,r){"use strict";var n=r(1164),i=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):o(r,t)}},95777:function(e,t,r){"use strict";var n=r(68206),i=r(99995);e.exports=function(e){return n(i(e))}},1164:function(e,t,r){"use strict";var n=r(92903);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},83221:function(e,t,r){"use strict";var n=r(1164),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},15554:function(e,t,r){"use strict";var n=r(99995),i=Object;e.exports=function(e){return i(n(e))}},38293:function(e,t,r){"use strict";var n=r(10131),i=r(27894),o=r(28610),s=r(22927),a=r(57202),c=r(4235),u=TypeError,l=c("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var r,c=s(e,l);if(c){if(void 0===t&&(t="default"),!i(r=n(c,e,t))||o(r))return r;throw new u("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},28591:function(e,t,r){"use strict";var n=r(38293),i=r(28610);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},77448:function(e,t,r){"use strict";var n=r(4235)("toStringTag"),i={};i[n]="z",e.exports="[object z]"===String(i)},10182:function(e,t,r){"use strict";var n=r(74457),i=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},1734:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},50168:function(e,t,r){"use strict";var n=r(905),i=0,o=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++i+o,36)}},59624:function(e,t,r){"use strict";var n=r(25892);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},60125:function(e,t,r){"use strict";var n=r(83594),i=r(78877);e.exports=n&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},19368:function(e){"use strict";var t=TypeError;e.exports=function(e,r){if(e2&&h(r,arguments[2]);var a=[];return p(e,_,{that:a}),u(r,"errors",a),r};s?s(v,g):a(v,g,{name:!0});var b=v.prototype=c(g.prototype,{constructor:l(1,v),message:l(1,""),name:l(1,"AggregateError")});n({global:!0,constructor:!0,arity:2},{AggregateError:v})},43284:function(e,t,r){"use strict";r(96726)},71809:function(e,t,r){"use strict";var n=r(95777),i=r(42834),o=r(39078),s=r(6308),a=r(79606).f,c=r(9383),u=r(57011),l=r(84446),h=r(83594),f="Array Iterator",p=s.set,d=s.getterFor(f);e.exports=c(Array,"Array",function(e,t){p(this,{type:f,target:n(e),index:0,kind:t})},function(){var e=d(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,u(void 0,!0);switch(e.kind){case"keys":return u(r,!1);case"values":return u(t[r],!1)}return u([r,t[r]],!1)},"values");var y=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!l&&h&&"values"!==y.name)try{a(y,"name",{value:"values"})}catch(e){}},8573:function(){},66382:function(e,t,r){"use strict";var n=r(67441),i=r(10131),o=r(39135),s=r(41355),a=r(96636),c=r(53924);n({target:"Promise",stat:!0,forced:r(52672)},{allSettled:function(e){var t=this,r=s.f(t),n=r.resolve,u=r.reject,l=a(function(){var r=o(t.resolve),s=[],a=0,u=1;c(e,function(e){var o=a++,c=!1;u++,i(r,t,e).then(function(e){!c&&(c=!0,s[o]={status:"fulfilled",value:e},--u||n(s))},function(e){!c&&(c=!0,s[o]={status:"rejected",reason:e},--u||n(s))})}),--u||n(s)});return l.error&&u(l.value),r.promise}})},29842:function(e,t,r){"use strict";var n=r(67441),i=r(10131),o=r(39135),s=r(41355),a=r(96636),c=r(53924);n({target:"Promise",stat:!0,forced:r(52672)},{all:function(e){var t=this,r=s.f(t),n=r.resolve,u=r.reject,l=a(function(){var r=o(t.resolve),s=[],a=0,l=1;c(e,function(e){var o=a++,c=!1;l++,i(r,t,e).then(function(e){!c&&(c=!0,s[o]=e,--l||n(s))},u)}),--l||n(s)});return l.error&&u(l.value),r.promise}})},52544:function(e,t,r){"use strict";var n=r(67441),i=r(10131),o=r(39135),s=r(54714),a=r(41355),c=r(96636),u=r(53924),l=r(52672),h="No one promise resolved";n({target:"Promise",stat:!0,forced:l},{any:function(e){var t=this,r=s("AggregateError"),n=a.f(t),l=n.resolve,f=n.reject,p=c(function(){var n=o(t.resolve),s=[],a=0,c=1,p=!1;u(e,function(e){var o=a++,u=!1;c++,i(n,t,e).then(function(e){u||p||(p=!0,l(e))},function(e){!u&&!p&&(u=!0,s[o]=e,--c||f(new r(s,h)))})}),--c||f(new r(s,h))});return p.error&&f(p.value),n.promise}})},31524:function(e,t,r){"use strict";var n=r(67441),i=r(84446),o=r(41991).CONSTRUCTOR,s=r(82788),a=r(54714),c=r(19415),u=r(33849),l=s&&s.prototype;if(n({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&c(s)){var h=a("Promise").prototype.catch;l.catch!==h&&u(l,"catch",h,{unsafe:!0})}},81572:function(e,t,r){"use strict";var n,i,o,s,a=r(67441),c=r(84446),u=r(8704),l=r(21936),h=r(10131),f=r(33849),p=r(57086),d=r(20215),y=r(26638),g=r(39135),_=r(19415),v=r(27894),b=r(85135),m=r(87199),w=r(56482).set,S=r(31794),E=r(41783),k=r(96636),x=r(16582),T=r(6308),B=r(82788),A=r(41991),M=r(41355),O="Promise",P=A.CONSTRUCTOR,R=A.REJECTION_EVENT,C=A.SUBCLASSING,N=T.getterFor(O),I=T.set,D=B&&B.prototype,j=B,U=D,F=l.TypeError,L=l.document,W=l.process,z=M.f,K=z,H=!!(L&&L.createEvent&&l.dispatchEvent),q="unhandledrejection",Y="rejectionhandled",G=0,$=1,V=2,Z=1,J=2,X=function(e){var t;return!!(v(e)&&_(t=e.then))&&t},Q=function(e,t){var r,n,i,o=t.value,s=t.state===$,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(t.rejection===J&&ei(t),t.rejection=Z),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),i=!0)),r===e.promise?u(new F("Promise-chain cycle")):(n=X(r))?h(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},ee=function(e,t){e.notified||(e.notified=!0,S(function(){for(var r,n=e.reactions;r=n.get();)Q(r,e);e.notified=!1,t&&!e.rejection&&er(e)}))},et=function(e,t,r){var n,i;H?((n=L.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),l.dispatchEvent(n)):n={promise:t,reason:r},!R&&(i=l["on"+e])?i(n):e===q&&E("Unhandled promise rejection",r)},er=function(e){h(w,l,function(){var t,r=e.facade,n=e.value;if(en(e)&&(t=k(function(){u?W.emit("unhandledRejection",n,r):et(q,r,n)}),e.rejection=u||en(e)?J:Z,t.error))throw t.value})},en=function(e){return e.rejection!==Z&&!e.parent},ei=function(e){h(w,l,function(){var t=e.facade;u?W.emit("rejectionHandled",t):et(Y,t,e.value)})},eo=function(e,t,r){return function(n){e(t,n,r)}},es=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=V,ee(e,!0))},ea=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new F("Promise can't be resolved itself");var n=X(t);n?S(function(){var r={done:!1};try{h(n,t,eo(ea,r,e),eo(es,r,e))}catch(t){es(r,t,e)}}):(e.value=t,e.state=$,ee(e,!1))}catch(t){es({done:!1},t,e)}}};if(P&&(U=(j=function(e){b(this,U),g(e),h(n,this);var t=N(this);try{e(eo(ea,t),eo(es,t))}catch(e){es(t,e)}}).prototype,(n=function(e){I(this,{type:O,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:G,value:void 0})}).prototype=f(U,"then",function(e,t){var r=N(this),n=z(m(this,j));return r.parent=!0,n.ok=!_(e)||e,n.fail=_(t)&&t,n.domain=u?W.domain:void 0,r.state===G?r.reactions.add(n):S(function(){Q(n,r)}),n.promise}),i=function(){var e=new n,t=N(e);this.promise=e,this.resolve=eo(ea,t),this.reject=eo(es,t)},M.f=z=function(e){return e===j||e===o?new i(e):K(e)},!c&&_(B)&&D!==Object.prototype)){s=D.then,C||f(D,"then",function(e,t){var r=this;return new j(function(e,t){h(s,r,e,t)}).then(e,t)},{unsafe:!0});try{delete D.constructor}catch(e){}p&&p(D,U)}a({global:!0,constructor:!0,wrap:!0,forced:P},{Promise:j}),d(j,O,!1,!0),y(O)},17872:function(e,t,r){"use strict";var n=r(67441),i=r(84446),o=r(82788),s=r(78877),a=r(54714),c=r(19415),u=r(87199),l=r(41496),h=r(33849),f=o&&o.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!o&&s(function(){f.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=u(this,a("Promise")),r=c(e);return this.then(r?function(r){return l(t,e()).then(function(){return r})}:e,r?function(r){return l(t,e()).then(function(){throw r})}:e)}}),!i&&c(o)){var p=a("Promise").prototype.finally;f.finally!==p&&h(f,"finally",p,{unsafe:!0})}},83415:function(e,t,r){"use strict";r(81572),r(29842),r(31524),r(91661),r(58977),r(76184)},91661:function(e,t,r){"use strict";var n=r(67441),i=r(10131),o=r(39135),s=r(41355),a=r(96636),c=r(53924);n({target:"Promise",stat:!0,forced:r(52672)},{race:function(e){var t=this,r=s.f(t),n=r.reject,u=a(function(){var s=o(t.resolve);c(e,function(e){i(s,t,e).then(r.resolve,n)})});return u.error&&n(u.value),r.promise}})},58977:function(e,t,r){"use strict";var n=r(67441),i=r(41355);n({target:"Promise",stat:!0,forced:r(41991).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},76184:function(e,t,r){"use strict";var n=r(67441),i=r(54714),o=r(84446),s=r(82788),a=r(41991).CONSTRUCTOR,c=r(41496),u=i("Promise"),l=o&&!a;n({target:"Promise",stat:!0,forced:o||a},{resolve:function(e){return c(l&&this===u?s:this,e)}})},67769:function(e,t,r){"use strict";var n=r(67441),i=r(41355);n({target:"Promise",stat:!0},{withResolvers:function(){var e=i.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}})},18411:function(e,t,r){"use strict";var n=r(52856).charAt,i=r(10182),o=r(6308),s=r(9383),a=r(57011),c="String Iterator",u=o.set,l=o.getterFor(c);s(String,"String",function(e){u(this,{type:c,string:i(e),index:0})},function(){var e,t=l(this),r=t.string,i=t.index;return i>=r.length?a(void 0,!0):(e=n(r,i),t.index+=e.length,a(e,!1))})},64851:function(e,t,r){"use strict";r(43284)},91205:function(e,t,r){"use strict";r(66382)},67833:function(e,t,r){"use strict";r(52544)},62719:function(e,t,r){"use strict";var n=r(67441),i=r(535),o=r(19713),s=r(41355),a=r(39135),c=r(96636);n({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=o(arguments,1),r=s.f(this),n=c(function(){return i(a(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}})},8757:function(e,t,r){"use strict";r(67769)},18004:function(e,t,r){"use strict";r(71809);var n=r(67023),i=r(21936),o=r(20215),s=r(39078);for(var a in n)o(i[a],a),s[a]=s.Array},66921:function(e,t,r){"use strict";var n=r(6878);r(18004),e.exports=n},65332:function(e,t,r){"use strict";r.d(t,{K:function(){return c},M:function(){return a}});var n=r(53554),i=r(91678);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let o=BigInt(0),s=BigInt(1);function a(e,t){let r=(e,t)=>{let r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>o;)r&s&&(n=n.add(i)),i=i.double(),r>>=s;return n},precomputeWindow(e,t){let{windows:r,windowSize:i}=n(t),o=[],s=e,a=s;for(let e=0;e>=p,n>c&&(n-=f,o+=s);let a=t,d=t+Math.abs(n)-1,y=e%2!=0,g=n<0;0===n?l=l.add(r(y,i[a])):u=u.add(r(g,i[d]))}return{p:u,f:l}},wNAFCached(e,t,r,n){let i=e._WINDOW_SIZE||1,o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,n(o))),this.wNAF(i,o,r)}}}function c(e){return(0,n.OP)(e.Fp),(0,i.FF)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.kK)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}},53554:function(e,t,r){"use strict";r.d(t,{DV:function(){return k},OP:function(){return b},PS:function(){return T},Tu:function(){return _},U_:function(){return d},Us:function(){return B},gN:function(){return E},kK:function(){return S},oA:function(){return p},sQ:function(){return f},wQ:function(){return h}});var n=r(91678);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let i=BigInt(0),o=BigInt(1),s=BigInt(2),a=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);function h(e,t){let r=e%t;return r>=i?r:t+r}function f(e,t,r){if(r<=i||t 0");if(r===o)return i;let n=o;for(;t>i;)t&o&&(n=n*e%r),e=e*e%r,t>>=o;return n}function p(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n}function d(e,t){if(e===i||t<=i)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=h(e,t),n=t,s=i,a=o,c=o,u=i;for(;r!==i;){let e=n/r,t=n%r,i=s-c*e,o=a-u*e;n=r,r=t,s=c,a=u,c=i,u=o}if(n!==o)throw Error("invert: does not exist");return h(s,t)}function y(e){let t,r,n;let a=(e-o)/s;for(t=e-o,r=0;t%s===i;t/=s,r++);for(n=s;n(h(e,t)&o)===o,v=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function b(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=v.reduce((e,t)=>(e[t]="function",e),t);return(0,n.FF)(e,r)}function m(e,t,r){if(r 0");if(r===i)return e.ONE;if(r===o)return t;let n=e.ONE,s=t;for(;r>i;)r&o&&(n=e.mul(n,s)),s=e.sqr(s),r>>=o;return n}function w(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}function S(e,t){let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function E(e,t,r=!1,s={}){if(e<=i)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:a,nByteLength:c}=S(e,t);if(c>2048)throw Error("Field lengths over 2048 bytes are not supported");let u=g(e),l=Object.freeze({ORDER:e,BITS:a,BYTES:c,MASK:(0,n.dQ)(a),ZERO:i,ONE:o,create:t=>h(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return i<=t&&te===i,isOdd:e=>(e&o)===o,neg:t=>h(-t,e),eql:(e,t)=>e===t,sqr:t=>h(t*t,e),add:(t,r)=>h(t+r,e),sub:(t,r)=>h(t-r,e),mul:(t,r)=>h(t*r,e),pow:(e,t)=>m(l,e,t),div:(t,r)=>h(t*d(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>d(t,e),sqrt:s.sqrt||(e=>u(l,e)),invertBatch:e=>w(l,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.S5)(e,c):(0,n.tL)(e,c),fromBytes:e=>{if(e.length!==c)throw Error(`Fp.fromBytes: expected ${c}, got ${e.length}`);return r?(0,n.ty)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(l)}function k(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function x(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function T(e){let t=x(e);return t+Math.ceil(t/2)}function B(e,t,r=!1){let i=e.length,s=x(t),a=T(t);if(i<16||i1024)throw Error(`expected ${a}-1024 bytes of input, got ${i}`);let c=h(r?(0,n.bytesToNumberBE)(e):(0,n.ty)(e),t-o)+o;return r?(0,n.S5)(c,s):(0,n.tL)(c,s)}},91678:function(e,t,r){"use strict";r.d(t,{FF:function(){return k},S5:function(){return g},_t:function(){return o},bytesToNumberBE:function(){return p},ci:function(){return c},dQ:function(){return b},eV:function(){return v},gk:function(){return s},hexToBytes:function(){return f},n$:function(){return S},ql:function(){return _},tL:function(){return y},ty:function(){return d}}),BigInt(0);let n=BigInt(1),i=BigInt(2);function o(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function s(e){if(!o(e))throw Error("Uint8Array expected")}let a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function c(e){s(e);let t="";for(let r=0;r=l._0&&e<=l._9?e-l._0:e>=l._A&&e<=l._F?e-(l._A-10):e>=l._a&&e<=l._f?e-(l._a-10):void 0}function f(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t(i<new Uint8Array(e),w=e=>Uint8Array.from(e);function S(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=m(e),i=m(e),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=m())=>{i=a(w([0]),e),n=a(),0!==e.length&&(i=a(w([1]),e),n=a())},u=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e{let r;for(s(),c(e);!(r=t(u()));)c();return s(),r}}let E={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||o(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function k(e,t,r={}){let n=(t,r,n)=>{let i=E[r];if("function"!=typeof i)throw Error(`Invalid validator "${r}", expected function`);let o=e[t];if((!n||void 0!==o)&&!i(o,e))throw Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${r}`)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}},14374:function(e,t,r){"use strict";r.d(t,{xW:function(){return H},kA:function(){return A}});var n=r(65530),i=r(68104),o=r(53554),s=r(91678),a=r(93557),c=r(65332);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function u(e){let t=(0,c.K)(e);s.FF(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}let{bytesToNumberBE:l,hexToBytes:h}=s,f={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){let{Err:t}=f;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");let r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(128&n[0])throw new t("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:l(n),l:e.subarray(r+2)}},toSig(e){let{Err:t}=f,r="string"==typeof e?h(e):e;s.gk(r);let n=r.length;if(n<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:i,l:o}=f._parseInt(r.subarray(2)),{d:a,l:c}=f._parseInt(o);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(e){let t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{let t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),o=n.length/2,s=i.length/2,a=r(o),c=r(s);return`30${r(s+o+4)}02${c}${i}02${a}${n}`}},p=BigInt(0),d=BigInt(1),y=(BigInt(2),BigInt(3));function g(e){let t=u(e),{Fp:r}=t,n=t.toBytes||((e,t,n)=>{let i=t.toAffine();return s.eV(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),i=t.fromBytes||(e=>{let t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function a(e){let{a:n,b:i}=t,o=r.sqr(e),s=r.mul(o,e);return r.add(r.add(s,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),a(t.Gx)))throw Error("bad generator point: equation left != right");function l(e){return"bigint"==typeof e&&pr.eql(e,r.ZERO);return i(t)&&i(n)?v.ZERO:new v(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(v.fromAffine)}static fromHex(e){let t=v.fromAffine(i((0,s.ql)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return v.BASE.multiply(f(e))}_setWindowSize(e){this._WINDOW_SIZE=e,g.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw Error("bad point: ZERO")}let{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw Error("bad point: x or y not FE");let i=r.sqr(n),o=a(e);if(!r.eql(i,o))throw Error("bad point: equation left != right");if(!this.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){_(e);let{px:t,py:n,pz:i}=this,{px:o,py:s,pz:a}=e,c=r.eql(r.mul(t,a),r.mul(o,i)),u=r.eql(r.mul(n,a),r.mul(s,i));return c&&u}negate(){return new v(this.px,r.neg(this.py),this.pz)}double(){let{a:e,b:n}=t,i=r.mul(n,y),{px:o,py:s,pz:a}=this,c=r.ZERO,u=r.ZERO,l=r.ZERO,h=r.mul(o,o),f=r.mul(s,s),p=r.mul(a,a),d=r.mul(o,s);return d=r.add(d,d),l=r.mul(o,a),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,p),u=r.add(c,u),c=r.sub(f,u),u=r.add(f,u),u=r.mul(c,u),c=r.mul(d,c),l=r.mul(i,l),p=r.mul(e,p),d=r.sub(h,p),d=r.mul(e,d),d=r.add(d,l),l=r.add(h,h),h=r.add(l,h),h=r.add(h,p),h=r.mul(h,d),u=r.add(u,h),p=r.mul(s,a),p=r.add(p,p),h=r.mul(p,d),c=r.sub(c,h),l=r.mul(p,f),l=r.add(l,l),new v(c,u,l=r.add(l,l))}add(e){_(e);let{px:n,py:i,pz:o}=this,{px:s,py:a,pz:c}=e,u=r.ZERO,l=r.ZERO,h=r.ZERO,f=t.a,p=r.mul(t.b,y),d=r.mul(n,s),g=r.mul(i,a),b=r.mul(o,c),m=r.add(n,i),w=r.add(s,a);m=r.mul(m,w),w=r.add(d,g),m=r.sub(m,w),w=r.add(n,o);let S=r.add(s,c);return w=r.mul(w,S),S=r.add(d,b),w=r.sub(w,S),S=r.add(i,o),u=r.add(a,c),S=r.mul(S,u),u=r.add(g,b),S=r.sub(S,u),h=r.mul(f,w),u=r.mul(p,b),h=r.add(u,h),u=r.sub(g,h),h=r.add(g,h),l=r.mul(u,h),g=r.add(d,d),g=r.add(g,d),b=r.mul(f,b),w=r.mul(p,w),g=r.add(g,b),b=r.sub(d,b),b=r.mul(f,b),w=r.add(w,b),d=r.mul(g,w),l=r.add(l,d),d=r.mul(S,w),u=r.mul(m,u),u=r.sub(u,d),d=r.mul(m,g),h=r.mul(S,h),new v(u,l,h=r.add(h,d))}subtract(e){return this.add(e.negate())}is0(){return this.equals(v.ZERO)}wNAF(e){return m.wNAFCached(this,g,e,e=>{let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(v.fromAffine)})}multiplyUnsafe(e){let n=v.ZERO;if(e===p)return n;if(h(e),e===d)return this;let{endo:i}=t;if(!i)return m.unsafeLadder(this,e);let{k1neg:o,k1:s,k2neg:a,k2:c}=i.splitScalar(e),u=n,l=n,f=this;for(;s>p||c>p;)s&d&&(u=u.add(f)),c&d&&(l=l.add(f)),f=f.double(),s>>=d,c>>=d;return o&&(u=u.negate()),a&&(l=l.negate()),l=new v(r.mul(l.px,i.beta),l.py,l.pz),u.add(l)}multiply(e){let n,i;h(e);let o=e,{endo:s}=t;if(s){let{k1neg:e,k1:t,k2neg:a,k2:c}=s.splitScalar(o),{p:u,f:l}=this.wNAF(t),{p:h,f:f}=this.wNAF(c);u=m.constTimeNegate(e,u),h=m.constTimeNegate(a,h),h=new v(r.mul(h.px,s.beta),h.py,h.pz),n=u.add(h),i=l.add(f)}else{let{p:e,f:t}=this.wNAF(o);n=e,i=t}return v.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=v.BASE,i=(e,t)=>t!==p&&t!==d&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){let{px:t,py:n,pz:i}=this,o=this.is0();null==e&&(e=o?r.ONE:r.inv(i));let s=r.mul(t,e),a=r.mul(n,e),c=r.mul(i,e);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw Error("invZ was invalid");return{x:s,y:a}}isTorsionFree(){let{h:e,isTorsionFree:r}=t;if(e===d)return!0;if(r)return r(v,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:r}=t;return e===d?this:r?r(v,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),n(v,this,e)}toHex(e=!0){return s.ci(this.toRawBytes(e))}}v.BASE=new v(t.Gx,t.Gy,r.ONE),v.ZERO=new v(r.ZERO,r.ONE,r.ZERO);let b=t.nBitLength,m=(0,c.M)(v,t.endo?Math.ceil(b/2):b);return{CURVE:t,ProjectivePoint:v,normPrivateKeyToScalar:f,weierstrassEquation:a,isWithinCurveOrder:l}}function _(e){let t=(0,c.K)(e);return s.FF(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function v(e){let t=_(e),{Fp:r,n:n}=t,i=r.BYTES+1,a=2*r.BYTES+1;function c(e){return ps.ci(s.tL(e,t.nByteLength));function w(e){return e>n>>d}function S(e){return w(e)?u(-e):e}let E=(e,t,r)=>s.bytesToNumberBE(e.slice(t,r));class k{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){let r=t.nByteLength;return new k(E(e=(0,s.ql)("compactSignature",e,2*r),0,r),E(e,r,2*r))}static fromDER(e){let{r:t,s:r}=f.toSig((0,s.ql)("DER",e));return new k(t,r)}assertValidity(){if(!b(this.r))throw Error("r must be 0 < r < CURVE.n");if(!b(this.s))throw Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new k(this.r,this.s,e)}recoverPublicKey(e){let{r:n,s:i,recovery:o}=this,a=O((0,s.ql)("msgHash",e));if(null==o||![0,1,2,3].includes(o))throw Error("recovery id invalid");let c=2===o||3===o?n+t.n:n;if(c>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let f=(1&o)==0?"02":"03",p=h.fromHex(f+m(c)),d=l(c),y=u(-a*d),g=u(i*d),_=h.BASE.multiplyAndAddUnsafe(p,y,g);if(!_)throw Error("point at infinify");return _.assertValidity(),_}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new k(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return s.hexToBytes(this.toDERHex())}toDERHex(){return f.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return s.hexToBytes(this.toCompactHex())}toCompactHex(){return m(this.r)+m(this.s)}}let x={isValidPrivateKey(e){try{return y(e),!0}catch(e){return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{let e=o.PS(t.n);return o.Us(t.randomBytes(e),t.n)},precompute:(e=8,t=h.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function T(e,t=!0){return h.fromPrivateKey(e).toRawBytes(t)}function B(e){let t=s._t(e),r="string"==typeof e,n=(t||r)&&e.length;return t?n===i||n===a:r?n===2*i||n===2*a:e instanceof h}function A(e,t,r=!0){if(B(e))throw Error("first arg must be private key");if(!B(t))throw Error("second arg must be public key");return h.fromHex(t).multiply(y(e)).toRawBytes(r)}let M=t.bits2int||function(e){let r=s.bytesToNumberBE(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},O=t.bits2int_modN||function(e){return u(M(e))},P=s.dQ(t.nBitLength);function R(e){if("bigint"!=typeof e)throw Error("bigint expected");if(!(p<=e&&ee in i))throw Error("sign() legacy options not supported");let{hash:o,randomBytes:a}=t,{lowS:c,prehash:f,extraEntropy:g}=i;null==c&&(c=!0),e=(0,s.ql)("msgHash",e),f&&(e=(0,s.ql)("prehashed msgHash",o(e)));let _=O(e),v=y(n),m=[R(v),R(_)];if(null!=g&&!1!==g){let e=!0===g?a(r.BYTES):g;m.push((0,s.ql)("extraEntropy",e))}let E=s.eV(...m),x=_;return{seed:E,k2sig:function(e){let t=M(e);if(!b(t))return;let r=l(t),n=h.BASE.multiply(t).toAffine(),i=u(n.x);if(i===p)return;let o=u(r*u(x+i*v));if(o===p)return;let s=(n.x===i?0:2)|Number(n.y&d),a=o;return c&&w(o)&&(a=S(o),s^=1),new k(i,a,s)}}}let N={lowS:t.lowS,prehash:!1},I={lowS:t.lowS,prehash:!1};function D(e,r,n=N){let{seed:i,k2sig:o}=C(e,r,n),a=t;return s.n$(a.hash.outputLen,a.nByteLength,a.hmac)(i,o)}function j(e,r,n,i=I){let o,a;let c=e;if(r=(0,s.ql)("msgHash",r),n=(0,s.ql)("publicKey",n),"strict"in i)throw Error("options.strict was renamed to lowS");let{lowS:p,prehash:d}=i;try{if("string"==typeof c||s._t(c))try{a=k.fromDER(c)}catch(e){if(!(e instanceof f.Err))throw e;a=k.fromCompact(c)}else if("object"==typeof c&&"bigint"==typeof c.r&&"bigint"==typeof c.s){let{r:e,s:t}=c;a=new k(e,t)}else throw Error("PARSE");o=h.fromHex(n)}catch(e){if("PARSE"===e.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(p&&a.hasHighS())return!1;d&&(r=t.hash(r));let{r:y,s:g}=a,_=O(r),v=l(g),b=u(_*v),m=u(y*v),w=h.BASE.multiplyAndAddUnsafe(o,b,m)?.toAffine();return!!w&&u(w.x)===y}return h.BASE._setWindowSize(8),{CURVE:t,getPublicKey:T,getSharedSecret:A,sign:D,verify:j,ProjectivePoint:h,Signature:k,utils:x}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function b(e){return{hash:e,hmac:(t,...r)=>(0,a.b)(e,t,(0,i.eV)(...r)),randomBytes:i.O6}}function m(e,t){let r=t=>v({...e,...b(t)});return Object.freeze({...r(t),create:r})}BigInt(4);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let w=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),S=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),E=BigInt(1),k=BigInt(2),x=(e,t)=>(e+t/k)/t;function T(e){let t=w,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),c=BigInt(44),u=BigInt(88),l=e*e*e%t,h=l*l*e%t,f=(0,o.oA)(h,r,t)*h%t,p=(0,o.oA)(f,r,t)*h%t,d=(0,o.oA)(p,k,t)*l%t,y=(0,o.oA)(d,i,t)*d%t,g=(0,o.oA)(y,s,t)*y%t,_=(0,o.oA)(g,c,t)*g%t,v=(0,o.oA)(_,u,t)*_%t,b=(0,o.oA)(v,c,t)*g%t,m=(0,o.oA)(b,r,t)*h%t,S=(0,o.oA)(m,a,t)*y%t,E=(0,o.oA)(S,n,t)*l%t,x=(0,o.oA)(E,k,t);if(!B.eql(B.sqr(x),e))throw Error("Cannot find square root");return x}let B=(0,o.gN)(w,void 0,void 0,{sqrt:T}),A=m({a:BigInt(0),b:BigInt(7),Fp:B,n:S,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=S,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-E*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),c=x(s*e,t),u=x(-n*e,t),l=(0,o.wQ)(e-c*r-u*i,t),h=(0,o.wQ)(-c*n-u*s,t),f=l>a,p=h>a;if(f&&(l=t-l),p&&(h=t-h),l>a||h>a)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:l,k2neg:p,k2:h}}}},n.J),M=BigInt(0),O=e=>"bigint"==typeof e&&M"bigint"==typeof e&&Me.charCodeAt(0)));r=(0,s.eV)(t,t),R[e]=r}return(0,n.J)((0,s.eV)(r,...t))}let N=e=>e.toRawBytes(!0).slice(1),I=e=>(0,s.tL)(e,32),D=e=>(0,o.wQ)(e,w),j=e=>(0,o.wQ)(e,S),U=A.ProjectivePoint,F=(e,t,r)=>U.BASE.multiplyAndAddUnsafe(e,t,r);function L(e){let t=A.utils.normPrivateKeyToScalar(e),r=U.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:j(-t),bytes:N(r)}}function W(e){if(!O(e))throw Error("bad x: need 0 < x < p");let t=D(e*e),r=T(D(t*e+BigInt(7)));r%k!==M&&(r=D(-r));let n=new U(e,r,E);return n.assertValidity(),n}function z(...e){return j((0,s.bytesToNumberBE)(C("BIP0340/challenge",...e)))}function K(e,t,r){let n=(0,s.ql)("signature",e,64),i=(0,s.ql)("message",t),o=(0,s.ql)("publicKey",r,32);try{let e=W((0,s.bytesToNumberBE)(o)),t=(0,s.bytesToNumberBE)(n.subarray(0,32));if(!O(t))return!1;let r=(0,s.bytesToNumberBE)(n.subarray(32,64));if(!P(r))return!1;let a=z(I(t),N(e),i),c=F(e,r,j(-a));if(!c||!c.hasEvenY()||c.toAffine().x!==t)return!1;return!0}catch(e){return!1}}let H={getPublicKey:function(e){return L(e).bytes},sign:function(e,t,r=(0,i.O6)(32)){let n=(0,s.ql)("message",e),{bytes:o,scalar:a}=L(t),c=(0,s.ql)("auxRand",r,32),u=I(a^(0,s.bytesToNumberBE)(C("BIP0340/aux",c))),l=C("BIP0340/nonce",u,o,n),h=j((0,s.bytesToNumberBE)(l));if(h===M)throw Error("sign failed: k is zero");let{bytes:f,scalar:p}=L(h),d=z(f,o,n),y=new Uint8Array(64);if(y.set(f,0),y.set(I(j(p+d*a)),32),!K(y,n,o))throw Error("sign: Invalid signature produced");return y},verify:K,utils:{randomPrivateKey:A.utils.randomPrivateKey,lift_x:W,pointToBytes:N,numberToBytesBE:s.tL,bytesToNumberBE:s.bytesToNumberBE,taggedHash:C,mod:o.wQ}}},93557:function(e,t,r){"use strict";r.d(t,{b:function(){return s}});var n=r(65376),i=r(68104);class o extends i.kb{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.vp)(e);let r=(0,i.O0)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?e.create().update(r).digest():r);for(let e=0;enew o(e,t).update(r).digest();s.create=(e,t)=>new o(e,t)},65530:function(e,t,r){"use strict";r.d(t,{J:function(){return u}});var n=r(44815),i=r(68104);let o=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);class c extends n.VR{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)a[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=a[e-15],r=a[e-2],n=(0,i.np)(t,7)^(0,i.np)(t,18)^t>>>3,o=(0,i.np)(r,17)^(0,i.np)(r,19)^r>>>10;a[e]=o+a[e-7]+n+a[e-16]|0}let{A:r,B:s,C:c,D:u,E:l,F:h,G:f,H:p}=this;for(let e=0;e<64;e++){let t=p+((0,i.np)(l,6)^(0,i.np)(l,11)^(0,i.np)(l,25))+(0,n.bc)(l,h,f)+o[e]+a[e]|0,d=((0,i.np)(r,2)^(0,i.np)(r,13)^(0,i.np)(r,22))+(0,n.l3)(r,s,c)|0;p=f,f=h,h=l,l=u+t|0,u=c,c=s,s=r,r=t+d|0}r=r+this.A|0,s=s+this.B|0,c=c+this.C|0,u=u+this.D|0,l=l+this.E|0,h=h+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(r,s,c,u,l,h,f,p)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let u=(0,i.hE)(()=>new c)},28820:function(e,t,r){"use strict";r.d(t,{HI:function(){return c},_j:function(){return a},pe:function(){return u}});var n=r(38357);let i="AES-CBC",o=e=>btoa(String.fromCharCode.apply(null,new Uint8Array(e))),s=e=>{let t=atob(e);return new Uint8Array(t.length).map((e,r)=>t.charCodeAt(r)).buffer},a=async(e,t)=>crypto.subtle.importKey("raw",await crypto.subtle.digest({name:"SHA-256"},(0,n.hg)(`${e}:${t}`)),{name:i},!1,["encrypt","decrypt"]),c=async(e,t)=>{let r=crypto.getRandomValues(new Uint8Array(16));return JSON.stringify({c:o(await crypto.subtle.encrypt({name:i,iv:r},await e,(0,n.hg)(t))),iv:[...r]})},u=async(e,t)=>{let{c:r,iv:o}=JSON.parse(t);return(0,n.X9)(await crypto.subtle.decrypt({name:i,iv:new Uint8Array(o)},await e,s(r)))}},97481:function(e,t,r){"use strict";r.d(t,{Ls:function(){return g}});var n=r(14374),i=r(75442),o=r(38357),s=r(28820);let a={},c=4,u=29333,l="x",h=(0,o.NC)(crypto.getRandomValues(new Uint8Array(32))),f=(0,o.NC)(n.xW.getPublicKey(h)),p={},d=()=>Math.floor(Date.now()/1e3),y=["wss://relay.nostr.net","wss://relay.blackbyte.nl","wss://relay.piazza.today","wss://relay.exit.pub","wss://relay.nostr.band","wss://relay.damus.io","wss://nostr.mom","wss://relay.snort.social","wss://nostr.lu.ke","wss://relay.plebstr.com","wss://nostr.sathoarder.com","wss://nsrelay.assilvestrar.club","wss://nostrasia.casa","wss://relay.nostr.bg","wss://relay.nostrr.de","wss://relay.nostrss.re"],g=(0,o.kv)(a,(e,t)=>{let r=e.password&&(0,s._j)(e.password,t),g=`${o.FR.toLowerCase()}/${e.appId}/${t}`,_=`${g}/${o._0}`,v=(0,o.Bu)(64),b=(0,o.Bu)(64),m={},w={},S={},E=(0,o.dQ)(e,y,c),k=(e,t)=>{M(e,t),S[t]=e},x=e=>{delete m[e],delete w[e],delete S[e]},T=(e,t)=>JSON.stringify(["REQ",e,{kinds:[u],since:d(),["#"+l]:[t]}]),B=e=>JSON.stringify(["CLOSE",e]),A=async(e,t)=>{let r={kind:u,content:JSON.stringify(t),pubkey:f,created_at:d(),tags:[[l,e]]},i=(0,o.NC)(new Uint8Array(await crypto.subtle.digest("SHA-256",(0,o.hg)(JSON.stringify([0,r.pubkey,r.created_at,r.kind,r.tags,r.content])))));return JSON.stringify(["EVENT",{...r,id:i,sig:(0,o.NC)(await n.xW.sign(i,h))}])},M=o.EI;return E.forEach(t=>{let n=new WebSocket(t);p[t]=n,n.addEventListener("open",async()=>{n.send(T(v,g)),n.send(T(b,_)),n.send(await A(g,o._0))}),n.addEventListener("message",async t=>{let[i,a,c,u]=JSON.parse(t.data);if("EVENT"!==i){"OK"!==i||c||console.warn(`${o.FR}: relay failure from ${n.url} - ${u}`);return}let l=JSON.parse(c.content);if(a===v){let t=l;if(t!==o._0&&!S[t]&&!w[t]){w[t]=!0;let i=m[t]=(0,o.kL)(!0,!1,e.rtcConfig);i.once(o.U3.signal,async e=>{n.send(await A(`${g}/${t}`,{peerId:o._0,offer:r?{...e,sdp:await (0,s.HI)(r,e.sdp)}:e}))}),i.once(o.U3.connect,()=>k(i,t)),i.once(o.U3.close,()=>x(t))}}else if(a===b){let{peerId:t,offer:i,answer:a}=l;if(m[t]&&a){m[t].signal(r?{...a,sdp:await (0,s.pe)(r,a.sdp)}:a);return}if(!i)return;let c=(0,o.kL)(!1,!1,e.rtcConfig);c.once(o.U3.signal,async e=>n.send(await A(`${g}/${t}`,{peerId:o._0,answer:r?{...e,sdp:await (0,s.HI)(r,e.sdp)}:e}))),c.once(o.U3.connect,()=>k(c,t)),c.once(o.U3.close,()=>x(t)),c.signal(i)}})}),(0,i.Z)(e=>M=e,()=>{delete a[t],(0,o.VO)(p).forEach(e=>{e.send(B(v)),e.send(B(b))})})})},75442:function(e,t,r){"use strict";var n=r(38357);let i=Object.getPrototypeOf(Uint8Array),o=12,s=0,a=12,c=13,u=14,l=15,h=16369,f=255,p="bufferedamountlow";t.Z=(e,t)=>{let r={},d={},y={},g={},_={},v={},b=(e,t)=>(e?Array.isArray(e)?e:[e]:(0,n.XP)(r)).flatMap(e=>{let i=r[e];return i?t(e,i):(console.warn(`${n.FR}: no peer with id ${e} found`),[])}),m=e=>{r[e]&&(delete r[e],delete y[e],delete g[e],N(e))},w=e=>{if(d[e])return[d[e].send,d[e].setOnComplete,d[e].setOnProgress];if(!e)throw(0,n.QK)("action type argument is required");let t=(0,n.hg)(e);if(t.byteLength>o)throw(0,n.QK)(`action type string "${e}" (${t.byteLength}b) exceeds byte limit (${o}). Hint: choose a shorter name.`);let s=new Uint8Array(o);s.set(t);let y=0;return d[e]={onComplete:n.EI,onProgress:n.EI,setOnComplete:t=>d[e]={...d[e],onComplete:t},setOnProgress:t=>d[e]={...d[e],onProgress:t},send:async(e,t,o,d)=>{if(o&&"object"!=typeof o)throw(0,n.QK)("action meta argument must be an object");if(void 0===e)throw(0,n.QK)("action data cannot be undefined");let g="string"!=typeof e,_=e instanceof Blob,v=_||e instanceof ArrayBuffer||e instanceof i;if(o&&!v)throw(0,n.QK)("action meta argument can only be used with binary data");let m=v?new Uint8Array(_?await e.arrayBuffer():e):(0,n.hg)(g?JSON.stringify(e):e),w=o?(0,n.hg)(JSON.stringify(o)):null,S=Math.ceil(m.byteLength/h)+(o?1:0)||1,E=Array(S).fill().map((e,t)=>{let r=t===S-1,n=o&&0===t,i=new Uint8Array(l+(n?w.byteLength:r?m.byteLength-h*(S-(o?2:1)):h));return i.set(s),i.set([y],a),i.set([r|n<<1|v<<2|g<<3],c),i.set([Math.round((t+1)/S*f)],u),i.set(o?n?w:m.subarray((t-1)*h,t*h):m.subarray(t*h,(t+1)*h),l),i});return y=y+1&f,Promise.all(b(t,async(e,t)=>{let n=t._channel,i=0;for(;in.bufferedAmountLowThreshold&&await new Promise(e=>{let t=()=>{n.removeEventListener(p,t),e()};n.addEventListener(p,t)}),!r[e])break;t.send(s),i++,d&&d(s[u]/f,e,o)}}))}},[d[e].send,d[e].setOnComplete,d[e].setOnProgress]},S=(e,t)=>{let r=new Uint8Array(t),i=(0,n.X9)(r.subarray(s,a)).replaceAll("\0",""),[o]=r.subarray(a,c),[h]=r.subarray(c,u),[p]=r.subarray(u,l),g=r.subarray(l),_=!!(1&h),v=!!(2&h),b=!!(4&h),m=!!(8&h);if(!d[i])throw(0,n.QK)(`received message with unregistered type (${i})`);y[e]||(y[e]={}),y[e][i]||(y[e][i]={});let w=y[e][i][o];if(w||(w=y[e][i][o]={chunks:[]}),v?w.meta=JSON.parse((0,n.X9)(g)):w.chunks.push(g),d[i].onProgress(p/f,e,w.meta),!_)return;let S=new Uint8Array(w.chunks.reduce((e,t)=>e+t.byteLength,0));if(w.chunks.reduce((e,t)=>(S.set(t,e),e+t.byteLength),0),b)d[i].onComplete(S,e,w.meta);else{let t=(0,n.X9)(S);d[i].onComplete(m?JSON.parse(t):t,e)}delete y[e][i][o]},[E,k]=w("__91n6__"),[x,T]=w("__90n6__"),[B,A]=w("__516n4L__"),[M,O]=w("__57r34m__"),[P,R]=w("__7r4ck__"),C=n.EI,N=n.EI,I=n.EI,D=n.EI;return e((e,t)=>{if(r[t])return;let i=S.bind(null,t);r[t]=e,e.on(n.U3.signal,e=>B(e,t)),e.on(n.U3.close,()=>m(t)),e.on(n.U3.data,i),e.on(n.U3.stream,e=>{I(e,t,_[t]),delete _[t]}),e.on(n.U3.track,(e,r)=>{D(e,r,t,v[t]),delete v[t]}),e.on(n.U3.error,e=>{"ERR_DATA_CHANNEL"!==e.code&&console.error(e)}),C(t),e.__drainEarlyData(i)}),k((e,t)=>x("",t)),T((e,t)=>{g[t]&&(g[t](),delete g[t])}),A((e,t)=>{r[t]&&r[t].signal(e)}),O((e,t)=>_[t]=e),R((e,t)=>v[t]=e),{makeAction:w,ping:async e=>{if(!e)throw(0,n.QK)("ping() must be called with target peer ID");let t=Date.now();return E("",e),await new Promise(t=>g[e]=t),Date.now()-t},leave:()=>{(0,n.qh)(r).forEach(([e,t])=>{t.destroy(),delete r[e]}),t()},getPeers:()=>(0,n.sq)((0,n.qh)(r).map(([e,t])=>[e,t._pc])),addStream:(e,t,r)=>b(t,async(t,n)=>{r&&await M(r,t),n.addStream(e)}),removeStream:(e,t)=>b(t,(t,r)=>r.removeStream(e)),addTrack:(e,t,r,n)=>b(r,async(r,i)=>{n&&await P(n,r),i.addTrack(e,t)}),removeTrack:(e,t,r)=>b(r,(r,n)=>n.removeTrack(e,t)),replaceTrack:(e,t,r,n,i)=>b(n,async(n,o)=>{i&&await P(i,n),o.replaceTrack(e,t,r)}),onPeerJoin:e=>C=e,onPeerLeave:e=>N=e,onPeerStream:e=>I=e,onPeerTrack:e=>D=e}}},18210:function(e,t,r){"use strict";r.d(t,{Ls:function(){return b}});var n=r(75442),i=r(38357),o=r(28820);let s={},a={},c={},u={},l={},h=20,f=10,p=3,d=33,y=120,g=4,_="announce",v=["wss://tracker.webtorrent.dev","wss://tracker.openwebtorrent.com","wss://tracker.files.fm:7073/announce","wss://tracker.btorrent.xyz"],b=(0,i.kv)(s,(e,t)=>{let r;if(e.trackerUrls||e.trackerRedundancy)throw(0,i.QK)("trackerUrls/trackerRedundancy have been replaced by relayUrls/relayRedundancy");let b={},m=e.password&&(0,o._j)(e.password,t),w=(0,i.dQ)(e,v,p),S=crypto.subtle.digest("SHA-1",(0,i.hg)(`${i.FR}:${e.appId}:${t}`)).then(e=>Array.from(new Uint8Array(e)).map(e=>e.toString(36)).join("").slice(0,h)),E=t=>(0,i.sq)(Array(t).fill().map(()=>{let t=(0,i.kL)(!0,!1,e.rtcConfig);return[(0,i.Bu)(h),{peer:t,offerP:new Promise(e=>t.once(i.U3.signal,e))}]})),k=async(t,n)=>{let s;let a=await S;try{s=JSON.parse(n.data)}catch(e){console.error(`${i.FR}: received malformed SDP JSON`);return}if(s.info_hash!==a||s.peer_id&&s.peer_id===i._0)return;let c=s["failure reason"];if(c){console.warn(`${i.FR}: torrent tracker failure from ${t.url} - ${c}`);return}if(s.interval&&s.interval>P&&s.interval<=y&&(clearInterval(R),R=setInterval(B,1e3*(P=s.interval))),s.offer&&s.offer_id){if(b[s.peer_id]||N[s.offer_id])return;N[s.offer_id]=!0;let r=(0,i.kL)(!1,!1,e.rtcConfig);r.once(i.U3.signal,async e=>t.send(JSON.stringify({answer:m?{...e,sdp:await (0,o.HI)(m,e.sdp)}:e,action:_,info_hash:a,peer_id:i._0,to_peer_id:s.peer_id,offer_id:s.offer_id}))),r.on(i.U3.connect,()=>M(r,s.peer_id)),r.on(i.U3.close,()=>O(r,s.peer_id,s.offer_id)),r.signal(m?{...s.offer,sdp:await (0,o.pe)(m,s.offer.sdp)}:s.offer);return}if(s.answer){if(b[s.peer_id]||N[s.offer_id])return;let e=r[s.offer_id];if(e){let{peer:t}=e;if(t.destroyed)return;N[s.offer_id]=!0,t.on(i.U3.connect,()=>M(t,s.peer_id,s.offer_id)),t.on(i.U3.close,()=>O(t,s.peer_id,s.offer_id)),t.signal(m?{...s.answer,sdp:await (0,o.pe)(m,s.answer.sdp)}:s.answer)}}},x=async(e,t)=>e.send(JSON.stringify({action:_,info_hash:t,numwant:f,peer_id:i._0,offers:await Promise.all((0,i.qh)(r).map(async([e,{offerP:t}])=>{let r=await t;return{offer_id:e,offer:m?{...r,sdp:await (0,o.HI)(m,r.sdp)}:r}}))})),T=(e,t,r)=>(r||!a[e]?(l[e]={...l[e],[t]:k},a[e]=new Promise(r=>{let n=new WebSocket(e);c[e]=n,n.addEventListener("open",()=>{u[e]=1e3*g,r(n)}),n.addEventListener("message",t=>(0,i.VO)(l[e]).forEach(e=>e(n,t))),n.addEventListener("close",async()=>{u[e]=u[e]??1e3*g,await (0,i._v)(u[e]),u[e]*=2,T(e,t,!0)})})):l[e][t]=k,a[e]),B=async()=>{let e=await S;r&&A(),r=E(f),w.forEach(async t=>{let r=await T(t,e);r.readyState===WebSocket.OPEN?x(r,e):r.readyState!==WebSocket.CONNECTING&&x(await T(t,e,!0),e)})},A=()=>{(0,i.qh)(r).forEach(([e,{peer:t}])=>{N[e]||b[e]||t.destroy()}),N={}},M=(e,t,r)=>{C(e,t),b[t]=!0,r&&(b[r]=!0)},O=(e,t,n)=>{delete b[t],e.destroy(),n in r&&(delete r[n],r={...r,...E(1)})},P=d,R=setInterval(B,1e3*P),C=i.EI,N={};return B(),(0,n.Z)(e=>C=e,async()=>{let e=await S;w.forEach(t=>delete l[t][e]),delete s[t],clearInterval(R),A()})})},38357:function(e,t,r){"use strict";r.d(t,{X9:function(){return T},hg:function(){return x},qh:function(){return w},U3:function(){return A},sq:function(){return S},Bu:function(){return y},dQ:function(){return M},kv:function(){return g},kL:function(){return d},XP:function(){return b},FR:function(){return _},QK:function(){return k},EI:function(){return E},_0:function(){return v},_v:function(){return O},NC:function(){return B},VO:function(){return m}});/*! simple-peer. MIT License. Feross Aboukhadijeh */let n=65536,i=5e3,o=5e3;function s(e){let t=new Uint8Array(e);for(let r=0;re),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||i,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:a(),!this._wrtc){if("undefined"==typeof window)throw c(Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT");throw c(Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT")}this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){this.destroy(c(e,"ERR_PC_CONSTRUCTOR"));return}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch(e=>{this.destroy(c(e,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach(e=>{this.addStream(e)}),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation()}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw c(Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(e=>{this._addIceCandidate(e)}),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())}).catch(e=>{this.destroy(c(e,"ERR_SET_REMOTE_DESCRIPTION"))}),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(c(Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){let t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch(e=>{!t.address||t.address.endsWith(".local")?l("Ignoring unsupported ICE candidate."):this.destroy(c(e,"ERR_ADD_ICE_CANDIDATE"))})}send(e){if(!this.destroying){if(this.destroyed)throw c(Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw c(Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(c(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw c(Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach(t=>{this.addTrack(t,e)})}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw c(Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");let r=this._senderMap.get(e)||new Map,n=r.get(t);if(n){if(n.removed)throw c(Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED");throw c(Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED")}n=this._pc.addTrack(e,t),r.set(t,n),this._senderMap.set(e,r),this._needsNegotiation()}replaceTrack(e,t,r){if(this.destroying)return;if(this.destroyed)throw c(Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");let n=this._senderMap.get(e),i=n?n.get(r):null;if(!i)throw c(Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,n),null!=i.replaceTrack?i.replaceTrack(t):this.destroy(c(Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw c(Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");let r=this._senderMap.get(e),n=r?r.get(t):null;if(!n)throw c(Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{n.removed=!0,this._pc.removeTrack(n)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(n):this.destroy(c(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw c(Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach(t=>{this.removeTrack(t,e)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,queueMicrotask(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw c(Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),queueMicrotask(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close")}))}_setupData(e){if(!e.channel)return this.destroy(c(Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=n),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{this.destroy(c(e,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval(()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1},o)}_startIceCompleteTimeout(){!this.destroyed&&(this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout)))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=u(e.sdp)),e.sdp=this.sdpTransform(e.sdp);let t=()=>{if(this.destroyed)return;let t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})},r=()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))},n=e=>{this.destroy(c(e,"ERR_SET_LOCAL_DESCRIPTION"))};this._pc.setLocalDescription(e).then(r).catch(n)}).catch(e=>{this.destroy(c(e,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=u(e.sdp)),e.sdp=this.sdpTransform(e.sdp);let t=()=>{if(this.destroyed)return;let t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()},r=()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))},n=e=>{this.destroy(c(e,"ERR_SET_LOCAL_DESCRIPTION"))};this._pc.setLocalDescription(e).then(r).catch(n)}).catch(e=>{this.destroy(c(e,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||"failed"!==this._pc.connectionState||this.destroy(c(Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;let e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),("connected"===e||"completed"===e)&&(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(c(Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(c(Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){let t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach(t=>{Object.assign(e,t)}),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then(r=>{let n=[];r.forEach(e=>{n.push(t(e))}),e(null,n)},t=>e(t)):this._pc.getStats.length>0?this._pc.getStats(r=>{if(this.destroyed)return;let n=[];r.result().forEach(e=>{let r={};e.names().forEach(t=>{r[t]=e.stat(t)}),r.id=e.id,r.type=e.type,r.timestamp=e.timestamp,n.push(t(r))}),e(null,n)},t=>e(t)):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;let e=()=>{this.destroyed||this.getStats((t,r)=>{if(this.destroyed)return;t&&(r=[]);let n={},i={},o={},s=!1;r.forEach(e=>{("remotecandidate"===e.type||"remote-candidate"===e.type)&&(n[e.id]=e),("localcandidate"===e.type||"local-candidate"===e.type)&&(i[e.id]=e),("candidatepair"===e.type||"candidate-pair"===e.type)&&(o[e.id]=e)});let a=e=>{s=!0;let t=i[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=Number(t.port)):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=Number(t.portNumber)):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=Number(t[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let r=n[e.remoteCandidateId];r&&(r.ip||r.address)?(this.remoteAddress=r.ip||r.address,this.remotePort=Number(r.port)):r&&r.ipAddress?(this.remoteAddress=r.ipAddress,this.remotePort=Number(r.portNumber)):"string"==typeof e.googRemoteAddress&&(r=e.googRemoteAddress.split(":"),this.remoteAddress=r[0],this.remotePort=Number(r[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(r.forEach(e=>{"transport"===e.type&&e.selectedCandidatePairId&&a(o[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&a(e)}),s||Object.keys(o).length&&!Object.keys(i).length)this._connecting=!1,this._connected=!0;else{setTimeout(e,100);return}if(this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(c(e,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');let e=this._cb;this._cb=null,e(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")})};e()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>n)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){!this.destroyed&&(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=new Uint8Array(t)),this.emit("data",t)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);let e=this._cb;this._cb=null,e(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach(t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some(e=>e.id===t.id)||(this._remoteStreams.push(t),queueMicrotask(()=>{this._debug("on stream"),this.emit("stream",t)}))})}_debug(...e){this._doDebug&&(e[0]="["+this._id+"] "+e[0],console.log(...e))}on(e,t){let r=this._map;r.has(e)||r.set(e,new Set),r.get(e).add(t)}off(e,t){let r=this._map,n=r.get(e);n&&(n.delete(t),0===n.size&&r.delete(e))}once(e,t){let r=(...n)=>{this.off(e,r),t(...n)};this.on(e,r)}emit(e,...t){let r=this._map;if(r.has(e))for(let n of r.get(e))try{n(...t)}catch(e){console.error(e)}}}h.WEBRTC_SUPPORT=!!a(),h.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},h.channelConfig={};var f=h;let p="0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz",d=(e,t,r)=>{let n=new f({initiator:e,trickle:t,config:r}),i=e=>n.__earlyDataBuffer.push(e);return n.on(A.data,i),n.__earlyDataBuffer=[],n.__drainEarlyData=e=>{n.off(A.data,i),n.__earlyDataBuffer.forEach(e),delete n.__earlyDataBuffer,delete n.__drainEarlyData},n},y=e=>Array(e).fill().map(()=>p[Math.floor(Math.random()*p.length)]).join(""),g=(e,t)=>(r,n)=>{if(e[n])return e[n];if(!r)throw k("requires a config map as the first argument");if(!r.appId&&!r.firebaseApp)throw k("config map is missing appId field");if(!n)throw k("namespace argument required");return e[n]=t(r,n)},_="Trystero",v=y(20),{keys:b,values:m,entries:w,fromEntries:S}=Object,E=()=>{},k=e=>Error(`${_}: ${e}`),x=e=>new TextEncoder().encode(e),T=e=>new TextDecoder().decode(e),B=e=>e.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),A=S(["close","connect","data","error","signal","stream","track"].map(e=>[e,e])),M=(e,t,r)=>(e.relayUrls||t).slice(0,e.relayUrls?e.relayUrls.length:e.relayRedundancy||r),O=e=>new Promise(t=>setTimeout(t,e))}}]); \ No newline at end of file