@libp2p/pnet 1.0.0-28587d24f → 1.0.0-2e464c099

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.min.js +13 -13
  2. package/package.json +9 -8
package/dist/index.min.js CHANGED
@@ -1,20 +1,20 @@
1
1
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PPnet = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
- "use strict";var Libp2PPnet=(()=>{var Ks=Object.create;var $e=Object.defineProperty;var Ms=Object.getOwnPropertyDescriptor;var Fs=Object.getOwnPropertyNames;var Os=Object.getPrototypeOf,Vs=Object.prototype.hasOwnProperty;var X=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),j=(t,e)=>{for(var r in e)$e(t,r,{get:e[r],enumerable:!0})},ki=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Fs(e))!Vs.call(t,i)&&i!==r&&$e(t,i,{get:()=>e[i],enumerable:!(n=Ms(e,i))||n.enumerable});return t};var st=(t,e,r)=>(r=t!=null?Ks(Os(t)):{},ki(e||!t||!t.__esModule?$e(r,"default",{value:t,enumerable:!0}):r,t)),qs=t=>ki($e({},"__esModule",{value:!0}),t);var W=X((yp,Ki)=>{Ki.exports={options:{usePureJavaScript:!1}}});var Oi=X((xp,Fi)=>{var Vr={};Fi.exports=Vr;var Mi={};Vr.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=zs(t,e);else{var i=0,a=e.length,o=e.charAt(0),s=[0];for(i=0;i<t.length;++i){for(var f=0,u=t[i];f<s.length;++f)u+=s[f]<<8,s[f]=u%a,u=u/a|0;for(;u>0;)s.push(u%a),u=u/a|0}for(i=0;t[i]===0&&i<t.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=e[s[i]]}if(r){var c=new RegExp(".{1,"+r+"}","g");n=n.match(c).join(`\r
3
- `)}return n};Vr.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=Mi[e];if(!r){r=Mi[e]=[];for(var n=0;n<e.length;++n)r[e.charCodeAt(n)]=n}t=t.replace(/\s/g,"");for(var i=e.length,a=e.charAt(0),o=[0],n=0;n<t.length;n++){var s=r[t.charCodeAt(n)];if(s===void 0)return;for(var f=0,u=s;f<o.length;++f)u+=o[f]*i,o[f]=u&255,u>>=8;for(;u>0;)o.push(u&255),u>>=8}for(var c=0;t[c]===a&&c<t.length-1;++c)o.push(0);return typeof Buffer<"u"?Buffer.from(o.reverse()):new Uint8Array(o.reverse())};function zs(t,e){var r=0,n=e.length,i=e.charAt(0),a=[0];for(r=0;r<t.length();++r){for(var o=0,s=t.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var f="";for(r=0;t.at(r)===0&&r<t.length()-1;++r)f+=i;for(r=a.length-1;r>=0;--r)f+=e[a[r]];return f}});var ot=X((gp,Qi)=>{var Vi=W(),qi=Oi(),y=Qi.exports=Vi.util=Vi.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){y.nextTick=process.nextTick,typeof setImmediate=="function"?y.setImmediate=setImmediate:y.setImmediate=y.nextTick;return}if(typeof setImmediate=="function"){y.setImmediate=function(){return setImmediate.apply(void 0,arguments)},y.nextTick=function(s){return setImmediate(s)};return}if(y.setImmediate=function(s){setTimeout(s,0)},typeof window<"u"&&typeof window.postMessage=="function"){let s=function(f){if(f.source===window&&f.data===t){f.stopPropagation();var u=e.slice();e.length=0,u.forEach(function(c){c()})}};var o=s,t="forge.setImmediate",e=[];y.setImmediate=function(f){e.push(f),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",s,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var f=e.slice();e.length=0,f.forEach(function(u){u()})}).observe(i,{attributes:!0});var a=y.setImmediate;y.setImmediate=function(f){Date.now()-r>15?(r=Date.now(),a(f)):(e.push(f),e.length===1&&i.setAttribute("a",n=!n))}}y.nextTick=y.setImmediate})();y.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;y.globalScope=function(){return y.isNodejs?globalThis:typeof self>"u"?window:self}();y.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};y.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};y.isArrayBufferView=function(t){return t&&y.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function _e(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}y.ByteBuffer=qr;function qr(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(y.isArrayBuffer(t)||y.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof qr||typeof t=="object"&&typeof t.data=="string"&&typeof t.read=="number")&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}y.ByteStringBuffer=qr;var Qs=4096;y.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>Qs&&(this.data.substr(0,1),this._constructedStringLength=0)};y.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};y.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};y.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};y.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};y.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};y.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(y.encodeUtf8(t))};y.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};y.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};y.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};y.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};y.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};y.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};y.ByteStringBuffer.prototype.putInt=function(t,e){_e(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};y.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)};y.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())};y.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};y.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t};y.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t};y.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t};y.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t};y.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t};y.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t};y.ByteStringBuffer.prototype.getInt=function(t){_e(t);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),t-=8;while(t>0);return e};y.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e};y.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};y.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};y.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};y.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};y.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};y.ByteStringBuffer.prototype.copy=function(){var t=y.createBuffer(this.data);return t.read=this.read,t};y.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};y.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};y.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};y.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var r=this.data.charCodeAt(e);r<16&&(t+="0"),t+=r.toString(16)}return t};y.ByteStringBuffer.prototype.toString=function(){return y.decodeUtf8(this.bytes())};function Gs(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=y.isArrayBuffer(t),n=y.isArrayBufferView(t);if(r||n){r?this.data=new DataView(t):this.data=new DataView(t.buffer,t.byteOffset,t.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,t!=null&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)}y.DataBuffer=Gs;y.DataBuffer.prototype.length=function(){return this.write-this.read};y.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};y.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};y.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};y.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this};y.DataBuffer.prototype.putBytes=function(t,e){if(y.isArrayBufferView(t)){var r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(r),this.write+=n,this}if(y.isArrayBuffer(t)){var r=new Uint8Array(t);this.accommodate(r.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(r,this.write),this.write+=r.byteLength,this}if(t instanceof y.DataBuffer||typeof t=="object"&&typeof t.read=="number"&&typeof t.write=="number"&&y.isArrayBufferView(t.data)){var r=new Uint8Array(t.data.byteLength,t.read,t.length());this.accommodate(r.byteLength);var i=new Uint8Array(t.data.byteLength,this.write);return i.set(r),this.write+=r.byteLength,this}if(t instanceof y.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary",typeof t=="string"){var a;if(e==="hex")return this.accommodate(Math.ceil(t.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=y.binary.hex.decode(t,a,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(t.length/4)*3),a=new Uint8Array(this.data.buffer,this.write),this.write+=y.binary.base64.decode(t,a,this.write),this;if(e==="utf8"&&(t=y.encodeUtf8(t),e="binary"),e==="binary"||e==="raw")return this.accommodate(t.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=y.binary.raw.decode(a),this;if(e==="utf16")return this.accommodate(t.length*2),a=new Uint16Array(this.data.buffer,this.write),this.write+=y.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)};y.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this};y.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")};y.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this};y.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};y.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};y.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};y.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};y.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};y.DataBuffer.prototype.putInt=function(t,e){_e(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};y.DataBuffer.prototype.putSignedInt=function(t,e){return _e(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)};y.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};y.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t};y.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t};y.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t};y.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t};y.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t};y.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t};y.DataBuffer.prototype.getInt=function(t){_e(t);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),t-=8;while(t>0);return e};y.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e};y.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};y.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};y.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};y.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};y.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};y.DataBuffer.prototype.copy=function(){return new y.DataBuffer(this)};y.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};y.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};y.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};y.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var r=this.data.getUint8(e);r<16&&(t+="0"),t+=r.toString(16)}return t};y.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if(t=t||"utf8",t==="binary"||t==="raw")return y.binary.raw.encode(e);if(t==="hex")return y.binary.hex.encode(e);if(t==="base64")return y.binary.base64.encode(e);if(t==="utf8")return y.text.utf8.decode(e);if(t==="utf16")return y.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)};y.createBuffer=function(t,e){return e=e||"raw",t!==void 0&&e==="utf8"&&(t=y.encodeUtf8(t)),new y.ByteBuffer(t)};y.fillString=function(t,e){for(var r="";e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};y.xorBytes=function(t,e,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a,n};y.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e};y.bytesToHex=function(t){return y.createBuffer(t).toHex()};y.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",zt=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],zi="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";y.encode64=function(t,e){for(var r="",n="",i,a,o,s=0;s<t.length;)i=t.charCodeAt(s++),a=t.charCodeAt(s++),o=t.charCodeAt(s++),r+=qt.charAt(i>>2),r+=qt.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=qt.charAt((a&15)<<2|o>>6),r+=isNaN(o)?"=":qt.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r
4
- `,r=r.substr(e));return n+=r,n};y.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,a,o=0;o<t.length;)r=zt[t.charCodeAt(o++)-43],n=zt[t.charCodeAt(o++)-43],i=zt[t.charCodeAt(o++)-43],a=zt[t.charCodeAt(o++)-43],e+=String.fromCharCode(r<<2|n>>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),a!==64&&(e+=String.fromCharCode((i&3)<<6|a)));return e};y.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};y.decodeUtf8=function(t){return decodeURIComponent(escape(t))};y.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:qi.encode,decode:qi.decode}};y.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};y.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,a=0;a<t.length;++a)n[i++]=t.charCodeAt(a);return e?i-r:n};y.binary.hex.encode=y.bytesToHex;y.binary.hex.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/2))),r=r||0;var i=0,a=r;for(t.length&1&&(i=1,n[a++]=parseInt(t[0],16));i<t.length;i+=2)n[a++]=parseInt(t.substr(i,2),16);return e?a-r:n};y.binary.base64.encode=function(t,e){for(var r="",n="",i,a,o,s=0;s<t.byteLength;)i=t[s++],a=t[s++],o=t[s++],r+=qt.charAt(i>>2),r+=qt.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=qt.charAt((a&15)<<2|o>>6),r+=isNaN(o)?"=":qt.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r
5
- `,r=r.substr(e));return n+=r,n};y.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,a,o,s,f=0,u=r;f<t.length;)i=zt[t.charCodeAt(f++)-43],a=zt[t.charCodeAt(f++)-43],o=zt[t.charCodeAt(f++)-43],s=zt[t.charCodeAt(f++)-43],n[u++]=i<<2|a>>4,o!==64&&(n[u++]=(a&15)<<4|o>>2,s!==64&&(n[u++]=(o&3)<<6|s));return e?u-r:n.subarray(0,u)};y.binary.base58.encode=function(t,e){return y.binary.baseN.encode(t,zi,e)};y.binary.base58.decode=function(t,e){return y.binary.baseN.decode(t,zi,e)};y.text={utf8:{},utf16:{}};y.text.utf8.encode=function(t,e,r){t=y.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,a=0;a<t.length;++a)n[i++]=t.charCodeAt(a);return e?i-r:n};y.text.utf8.decode=function(t){return y.decodeUtf8(String.fromCharCode.apply(null,t))};y.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length*2));var i=new Uint16Array(n.buffer);r=r||0;for(var a=r,o=r,s=0;s<t.length;++s)i[o++]=t.charCodeAt(s),a+=2;return e?a-r:n};y.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))};y.deflate=function(t,e,r){if(e=y.decode64(t.deflate(y.encode64(e)).rval),r){var n=2,i=e.charCodeAt(1);i&32&&(n=6),e=e.substring(n,e.length-4)}return e};y.inflate=function(t,e,r){var n=t.inflate(y.encode64(e)).rval;return n===null?null:y.decode64(n)};var zr=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var n;if(r===null?n=t.removeItem(e):(r=y.encode64(JSON.stringify(r)),n=t.setItem(e,r)),typeof n<"u"&&n.rval!==!0){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},Qr=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(r.rval===null){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return r!==null&&(r=JSON.parse(y.decode64(r))),r},Hs=function(t,e,r,n){var i=Qr(t,e);i===null&&(i={}),i[r]=n,zr(t,e,i)},Ys=function(t,e,r){var n=Qr(t,e);return n!==null&&(n=r in n?n[r]:null),n},Ws=function(t,e,r){var n=Qr(t,e);if(n!==null&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),zr(t,e,n)}},Js=function(t,e){zr(t,e,null)},Xe=function(t,e,r){var n=null;typeof r>"u"&&(r=["web","flash"]);var i,a=!1,o=null;for(var s in r){i=r[s];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),a=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),a=!0)}catch(f){o=f}if(a)break}if(!a)throw o;return n};y.setItem=function(t,e,r,n,i){Xe(Hs,arguments,i)};y.getItem=function(t,e,r,n){return Xe(Ys,arguments,n)};y.removeItem=function(t,e,r,n){Xe(Ws,arguments,n)};y.clearItems=function(t,e,r){Xe(Js,arguments,r)};y.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};y.format=function(t){for(var e=/%./g,r,n,i=0,a=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&a.push(n),o=e.lastIndex;var s=r[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[i+++1]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(t.substring(o)),a.join("")};y.formatNumber=function(t,e,r,n){var i=t,a=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,s=n===void 0?".":n,f=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",c=u.length>3?u.length%3:0;return f+(c?u.substr(0,c)+s:"")+u.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-u).toFixed(a).slice(2):"")};y.formatSize=function(t){return t>=1073741824?t=y.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=y.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=y.formatNumber(t/1024,0)+" KiB":t=y.formatNumber(t,0)+" bytes",t};y.bytesFromIP=function(t){return t.indexOf(".")!==-1?y.bytesFromIPv4(t):t.indexOf(":")!==-1?y.bytesFromIPv6(t):null};y.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=y.createBuffer(),r=0;r<t.length;++r){var n=parseInt(t[r],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()};y.bytesFromIPv6=function(t){var e=0;t=t.split(":").filter(function(o){return o.length===0&&++e,!0});for(var r=(8-t.length+e)*2,n=y.createBuffer(),i=0;i<8;++i){if(!t[i]||t[i].length===0){n.fillWithByte(0,r),r=0;continue}var a=y.hexToBytes(t[i]);a.length<2&&n.putByte(0),n.putBytes(a)}return n.getBytes()};y.bytesToIP=function(t){return t.length===4?y.bytesToIPv4(t):t.length===16?y.bytesToIPv6(t):null};y.bytesToIPv4=function(t){if(t.length!==4)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")};y.bytesToIPv6=function(t){if(t.length!==16)return null;for(var e=[],r=[],n=0,i=0;i<t.length;i+=2){for(var a=y.bytesToHex(t[i]+t[i+1]);a[0]==="0"&&a!=="0";)a=a.substr(1);if(a==="0"){var o=r[r.length-1],s=e.length;!o||s!==o.end+1?r.push({start:s,end:s}):(o.end=s,o.end-o.start>r[n].end-r[n].start&&(n=r.length-1))}e.push(a)}if(r.length>0){var f=r[n];f.end-f.start>0&&(e.splice(f.start,f.end-f.start+1,""),f.start===0&&e.unshift(""),f.end===7&&e.push(""))}return e.join(":")};y.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in y&&!t.update)return e(null,y.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return y.cores=navigator.hardwareConcurrency,e(null,y.cores);if(typeof Worker>"u")return y.cores=1,e(null,y.cores);if(typeof Blob>"u")return y.cores=2,e(null,y.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var s=Date.now(),f=s+4;Date.now()<f;);self.postMessage({st:s,et:f})})}.toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(o,s,f){if(s===0){var u=Math.floor(o.reduce(function(c,h){return c+h},0)/o.length);return y.cores=Math.max(1,u),URL.revokeObjectURL(r),e(null,y.cores)}i(f,function(c,h){o.push(a(f,h)),n(o,s-1,f)})}function i(o,s){for(var f=[],u=[],c=0;c<o;++c){var h=new Worker(r);h.addEventListener("message",function(p){if(u.push(p.data),u.length===o){for(var m=0;m<o;++m)f[m].terminate();s(null,u)}}),f.push(h)}for(var c=0;c<o;++c)f[c].postMessage(c)}function a(o,s){for(var f=[],u=0;u<o;++u)for(var c=s[u],h=f[u]=[],p=0;p<o;++p)if(u!==p){var m=s[p];(c.st>m.st&&c.st<m.et||m.st>c.st&&m.st<c.et)&&h.push(p)}return f.reduce(function(l,x){return Math.max(l,x.length)},0)}}});var Hr=X((mp,Gi)=>{var ft=W();ot();Gi.exports=ft.cipher=ft.cipher||{};ft.cipher.algorithms=ft.cipher.algorithms||{};ft.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=ft.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new ft.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};ft.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=ft.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new ft.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};ft.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),ft.cipher.algorithms[t]=e};ft.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in ft.cipher.algorithms?ft.cipher.algorithms[t]:null};var Gr=ft.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Gr.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=ft.util.createBuffer(),this.output=t.output||ft.util.createBuffer(),this.mode.start(e)};Gr.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Gr.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Wr=X((vp,Hi)=>{var ut=W();ot();ut.cipher=ut.cipher||{};var V=Hi.exports=ut.cipher.modes=ut.cipher.modes||{};V.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};V.ecb.prototype.start=function(t){};V.ecb.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};V.ecb.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};V.ecb.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0};V.ecb.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};V.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};V.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=Ze(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};V.cbc.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock};V.cbc.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};V.cbc.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0};V.cbc.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};V.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=ut.util.createBuffer(),this._partialBytes=0};V.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Ze(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};V.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32()^this._outBlock[i],e.putInt32(this._inBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)t.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};V.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32(),e.putInt32(this._inBlock[i]^this._outBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};V.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ut.util.createBuffer(),this._partialBytes=0};V.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Ze(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};V.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};V.ofb.prototype.decrypt=V.ofb.prototype.encrypt;V.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ut.util.createBuffer(),this._partialBytes=0};V.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Ze(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};V.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}je(this._inBlock)};V.ctr.prototype.decrypt=V.ctr.prototype.encrypt;V.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=ut.util.createBuffer(),this._partialBytes=0,this._R=3774873600};V.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=ut.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=ut.util.createBuffer(t.additionalData):r=ut.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=ut.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Yr(n*8)))}this._inBlock=this._j0.slice(0),je(this._inBlock),this._partialBytes=0,r=ut.util.createBuffer(r),this._aDataLength=Yr(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};V.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^=t.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var o=n%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),je(this._inBlock)};V.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),je(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};V.gcm.prototype.afterFinish=function(t,e){var r=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=ut.util.createBuffer();var n=this._aDataLength.concat(Yr(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^i[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r};V.gcm.prototype.multiply=function(t,e){for(var r=[0,0,0,0],n=e.slice(0),i=0;i<128;++i){var a=t[i/32|0]&1<<31-i%32;a&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r};V.gcm.prototype.pow=function(t,e){for(var r=t[3]&1,n=3;n>0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};V.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,a=this._m[r][i];e[0]^=a[0],e[1]^=a[1],e[2]^=a[2],e[3]^=a[3]}return e};V.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};V.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],f=o/n|0,u=(n-1-o%n)*e;s[f]=1<<e-1<<u,a[o]=this.generateSubHashTable(this.multiply(s,t),e)}return a};V.gcm.prototype.generateSubHashTable=function(t,e){var r=1<<e,n=r>>>1,i=new Array(r);i[n]=t.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],f=i[o];i[a+o]=[s[0]^f[0],s[1]^f[1],s[2]^f[2],s[3]^f[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var u=i[a^n];i[a]=[t[0]^u[0],t[1]^u[1],t[2]^u[2],t[3]^u[3]]}return i};function Ze(t,e){if(typeof t=="string"&&(t=ut.util.createBuffer(t)),ut.util.isArray(t)&&t.length>4){var r=t;t=ut.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n])}if(t.length()<e)throw new Error("Invalid IV length; got "+t.length()+" bytes and expected "+e+" bytes.");if(!ut.util.isArray(t)){for(var i=[],a=e/4,n=0;n<a;++n)i.push(t.getInt32());t=i}return t}function je(t){t[t.length-1]=t[t.length-1]+1&4294967295}function Yr(t){return[t/4294967296|0,t&4294967295]}});var er=X((bp,$i)=>{var Z=W();Hr();Wr();ot();$i.exports=Z.aes=Z.aes||{};Z.aes.startEncrypting=function(t,e,r,n){var i=tr({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};Z.aes.createEncryptionCipher=function(t,e){return tr({key:t,output:null,decrypt:!1,mode:e})};Z.aes.startDecrypting=function(t,e,r,n){var i=tr({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};Z.aes.createDecryptionCipher=function(t,e){return tr({key:t,output:null,decrypt:!0,mode:e})};Z.aes.Algorithm=function(t,e){Xr||Wi();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return $r(r._w,n,i,!1)},decrypt:function(n,i){return $r(r._w,n,i,!0)}}}),r._init=!1};Z.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Z.util.createBuffer(e);else if(Z.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Z.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(!Z.util.isArray(e)){r=e,e=[];var i=r.length();if(i===16||i===24||i===32){i=i>>>2;for(var n=0;n<i;++n)e.push(r.getInt32())}}if(!Z.util.isArray(e)||!(e.length===4||e.length===6||e.length===8))throw new Error("Invalid key parameter.");var a=this.mode.name,o=["CFB","OFB","CTR","GCM"].indexOf(a)!==-1;this._w=Ji(e,t.decrypt&&!o),this._init=!0}};Z.aes._expandKey=function(t,e){return Xr||Wi(),Ji(t,e)};Z.aes._updateBlock=$r;fe("AES-ECB",Z.cipher.modes.ecb);fe("AES-CBC",Z.cipher.modes.cbc);fe("AES-CFB",Z.cipher.modes.cfb);fe("AES-OFB",Z.cipher.modes.ofb);fe("AES-CTR",Z.cipher.modes.ctr);fe("AES-GCM",Z.cipher.modes.gcm);function fe(t,e){var r=function(){return new Z.aes.Algorithm(t,e)};Z.cipher.registerAlgorithm(t,r)}var Xr=!1,se=4,pt,Jr,Yi,$t,At;function Wi(){Xr=!0,Yi=[0,1,2,4,8,16,32,64,128,27,54];for(var t=new Array(256),e=0;e<128;++e)t[e]=e<<1,t[e+128]=e+128<<1^283;pt=new Array(256),Jr=new Array(256),$t=new Array(4),At=new Array(4);for(var e=0;e<4;++e)$t[e]=new Array(256),At[e]=new Array(256);for(var r=0,n=0,i,a,o,s,f,u,c,e=0;e<256;++e){s=n^n<<1^n<<2^n<<3^n<<4,s=s>>8^s&255^99,pt[r]=s,Jr[s]=r,f=t[s],i=t[r],a=t[i],o=t[a],u=f<<24^s<<16^s<<8^(s^f),c=(i^a^o)<<24^(r^o)<<16^(r^a^o)<<8^(r^i^o);for(var h=0;h<4;++h)$t[h][r]=u,At[h][s]=c,u=u<<24|u>>>8,c=c<<24|c>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function Ji(t,e){for(var r=t.slice(0),n,i=1,a=r.length,o=a+6+1,s=se*o,f=a;f<s;++f)n=r[f-1],f%a===0?(n=pt[n>>>16&255]<<24^pt[n>>>8&255]<<16^pt[n&255]<<8^pt[n>>>24]^Yi[i]<<24,i++):a>6&&f%a===4&&(n=pt[n>>>24]<<24^pt[n>>>16&255]<<16^pt[n>>>8&255]<<8^pt[n&255]),r[f]=r[f-a]^n;if(e){var u,c=At[0],h=At[1],p=At[2],m=At[3],l=r.slice(0);s=r.length;for(var f=0,x=s-se;f<s;f+=se,x-=se)if(f===0||f===s-se)l[f]=r[x],l[f+1]=r[x+3],l[f+2]=r[x+2],l[f+3]=r[x+1];else for(var v=0;v<se;++v)u=r[x+v],l[f+(3&-v)]=c[pt[u>>>24]]^h[pt[u>>>16&255]]^p[pt[u>>>8&255]]^m[pt[u&255]];r=l}return r}function $r(t,e,r,n){var i=t.length/4-1,a,o,s,f,u;n?(a=At[0],o=At[1],s=At[2],f=At[3],u=Jr):(a=$t[0],o=$t[1],s=$t[2],f=$t[3],u=pt);var c,h,p,m,l,x,v;c=e[0]^t[0],h=e[n?3:1]^t[1],p=e[2]^t[2],m=e[n?1:3]^t[3];for(var b=3,I=1;I<i;++I)l=a[c>>>24]^o[h>>>16&255]^s[p>>>8&255]^f[m&255]^t[++b],x=a[h>>>24]^o[p>>>16&255]^s[m>>>8&255]^f[c&255]^t[++b],v=a[p>>>24]^o[m>>>16&255]^s[c>>>8&255]^f[h&255]^t[++b],m=a[m>>>24]^o[c>>>16&255]^s[h>>>8&255]^f[p&255]^t[++b],c=l,h=x,p=v;r[0]=u[c>>>24]<<24^u[h>>>16&255]<<16^u[p>>>8&255]<<8^u[m&255]^t[++b],r[n?3:1]=u[h>>>24]<<24^u[p>>>16&255]<<16^u[m>>>8&255]<<8^u[c&255]^t[++b],r[2]=u[p>>>24]<<24^u[m>>>16&255]<<16^u[c>>>8&255]<<8^u[h&255]^t[++b],r[n?1:3]=u[m>>>24]<<24^u[c>>>16&255]<<16^u[h>>>8&255]<<8^u[p&255]^t[++b]}function tr(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Z.cipher.createDecipher(r,t.key):n=Z.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof Z.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var ar=X((Rd,ba)=>{var Pe=W();Pe.pki=Pe.pki||{};var wn=ba.exports=Pe.pki.oids=Pe.oids=Pe.oids||{};function B(t,e){wn[t]=e,wn[e]=t}function Y(t,e){wn[t]=e}B("1.2.840.113549.1.1.1","rsaEncryption");B("1.2.840.113549.1.1.4","md5WithRSAEncryption");B("1.2.840.113549.1.1.5","sha1WithRSAEncryption");B("1.2.840.113549.1.1.7","RSAES-OAEP");B("1.2.840.113549.1.1.8","mgf1");B("1.2.840.113549.1.1.9","pSpecified");B("1.2.840.113549.1.1.10","RSASSA-PSS");B("1.2.840.113549.1.1.11","sha256WithRSAEncryption");B("1.2.840.113549.1.1.12","sha384WithRSAEncryption");B("1.2.840.113549.1.1.13","sha512WithRSAEncryption");B("1.3.101.112","EdDSA25519");B("1.2.840.10040.4.3","dsa-with-sha1");B("1.3.14.3.2.7","desCBC");B("1.3.14.3.2.26","sha1");B("1.3.14.3.2.29","sha1WithRSASignature");B("2.16.840.1.101.3.4.2.1","sha256");B("2.16.840.1.101.3.4.2.2","sha384");B("2.16.840.1.101.3.4.2.3","sha512");B("2.16.840.1.101.3.4.2.4","sha224");B("2.16.840.1.101.3.4.2.5","sha512-224");B("2.16.840.1.101.3.4.2.6","sha512-256");B("1.2.840.113549.2.2","md2");B("1.2.840.113549.2.5","md5");B("1.2.840.113549.1.7.1","data");B("1.2.840.113549.1.7.2","signedData");B("1.2.840.113549.1.7.3","envelopedData");B("1.2.840.113549.1.7.4","signedAndEnvelopedData");B("1.2.840.113549.1.7.5","digestedData");B("1.2.840.113549.1.7.6","encryptedData");B("1.2.840.113549.1.9.1","emailAddress");B("1.2.840.113549.1.9.2","unstructuredName");B("1.2.840.113549.1.9.3","contentType");B("1.2.840.113549.1.9.4","messageDigest");B("1.2.840.113549.1.9.5","signingTime");B("1.2.840.113549.1.9.6","counterSignature");B("1.2.840.113549.1.9.7","challengePassword");B("1.2.840.113549.1.9.8","unstructuredAddress");B("1.2.840.113549.1.9.14","extensionRequest");B("1.2.840.113549.1.9.20","friendlyName");B("1.2.840.113549.1.9.21","localKeyId");B("1.2.840.113549.1.9.22.1","x509Certificate");B("1.2.840.113549.1.12.10.1.1","keyBag");B("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");B("1.2.840.113549.1.12.10.1.3","certBag");B("1.2.840.113549.1.12.10.1.4","crlBag");B("1.2.840.113549.1.12.10.1.5","secretBag");B("1.2.840.113549.1.12.10.1.6","safeContentsBag");B("1.2.840.113549.1.5.13","pkcs5PBES2");B("1.2.840.113549.1.5.12","pkcs5PBKDF2");B("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");B("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");B("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");B("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");B("1.2.840.113549.2.7","hmacWithSHA1");B("1.2.840.113549.2.8","hmacWithSHA224");B("1.2.840.113549.2.9","hmacWithSHA256");B("1.2.840.113549.2.10","hmacWithSHA384");B("1.2.840.113549.2.11","hmacWithSHA512");B("1.2.840.113549.3.7","des-EDE3-CBC");B("2.16.840.1.101.3.4.1.2","aes128-CBC");B("2.16.840.1.101.3.4.1.22","aes192-CBC");B("2.16.840.1.101.3.4.1.42","aes256-CBC");B("2.5.4.3","commonName");B("2.5.4.4","surname");B("2.5.4.5","serialNumber");B("2.5.4.6","countryName");B("2.5.4.7","localityName");B("2.5.4.8","stateOrProvinceName");B("2.5.4.9","streetAddress");B("2.5.4.10","organizationName");B("2.5.4.11","organizationalUnitName");B("2.5.4.12","title");B("2.5.4.13","description");B("2.5.4.15","businessCategory");B("2.5.4.17","postalCode");B("2.5.4.42","givenName");B("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");B("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");B("2.16.840.1.113730.1.1","nsCertType");B("2.16.840.1.113730.1.13","nsComment");Y("2.5.29.1","authorityKeyIdentifier");Y("2.5.29.2","keyAttributes");Y("2.5.29.3","certificatePolicies");Y("2.5.29.4","keyUsageRestriction");Y("2.5.29.5","policyMapping");Y("2.5.29.6","subtreesConstraint");Y("2.5.29.7","subjectAltName");Y("2.5.29.8","issuerAltName");Y("2.5.29.9","subjectDirectoryAttributes");Y("2.5.29.10","basicConstraints");Y("2.5.29.11","nameConstraints");Y("2.5.29.12","policyConstraints");Y("2.5.29.13","basicConstraints");B("2.5.29.14","subjectKeyIdentifier");B("2.5.29.15","keyUsage");Y("2.5.29.16","privateKeyUsagePeriod");B("2.5.29.17","subjectAltName");B("2.5.29.18","issuerAltName");B("2.5.29.19","basicConstraints");Y("2.5.29.20","cRLNumber");Y("2.5.29.21","cRLReason");Y("2.5.29.22","expirationDate");Y("2.5.29.23","instructionCode");Y("2.5.29.24","invalidityDate");Y("2.5.29.25","cRLDistributionPoints");Y("2.5.29.26","issuingDistributionPoint");Y("2.5.29.27","deltaCRLIndicator");Y("2.5.29.28","issuingDistributionPoint");Y("2.5.29.29","certificateIssuer");Y("2.5.29.30","nameConstraints");B("2.5.29.31","cRLDistributionPoints");B("2.5.29.32","certificatePolicies");Y("2.5.29.33","policyMappings");Y("2.5.29.34","policyConstraints");B("2.5.29.35","authorityKeyIdentifier");Y("2.5.29.36","policyConstraints");B("2.5.29.37","extKeyUsage");Y("2.5.29.46","freshestCRL");Y("2.5.29.54","inhibitAnyPolicy");B("1.3.6.1.4.1.11129.2.4.2","timestampList");B("1.3.6.1.5.5.7.1.1","authorityInfoAccess");B("1.3.6.1.5.5.7.3.1","serverAuth");B("1.3.6.1.5.5.7.3.2","clientAuth");B("1.3.6.1.5.5.7.3.3","codeSigning");B("1.3.6.1.5.5.7.3.4","emailProtection");B("1.3.6.1.5.5.7.3.8","timeStamping")});var Ke=X((Ld,Ea)=>{var tt=W();ot();ar();var _=Ea.exports=tt.asn1=tt.asn1||{};_.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};_.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};_.create=function(t,e,r,n,i){if(tt.util.isArray(n)){for(var a=[],o=0;o<n.length;++o)n[o]!==void 0&&a.push(n[o]);n=a}var s={tagClass:t,type:e,constructed:r,composed:r||tt.util.isArray(n),value:n};return i&&"bitStringContents"in i&&(s.bitStringContents=i.bitStringContents,s.original=_.copy(s)),s};_.copy=function(t,e){var r;if(tt.util.isArray(t)){r=[];for(var n=0;n<t.length;++n)r.push(_.copy(t[n],e));return r}return typeof t=="string"?t:(r={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:_.copy(t.value,e)},e&&!e.excludeBitStringContents&&(r.bitStringContents=t.bitStringContents),r)};_.equals=function(t,e,r){if(tt.util.isArray(t)){if(!tt.util.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!_.equals(t[n],e[n]))return!1;return!0}if(typeof t!=typeof e)return!1;if(typeof t=="string")return t===e;var i=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&_.equals(t.value,e.value);return r&&r.includeBitStringContents&&(i=i&&t.bitStringContents===e.bitStringContents),i};_.getBerValueLength=function(t){var e=t.getByte();if(e!==128){var r,n=e&128;return n?r=t.getInt((e&127)<<3):r=e,r}};function Ue(t,e,r){if(r>e){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var af=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var a=r&127;Ue(t,e,a),n=t.getInt(a<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};_.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=tt.util.createBuffer(t));var r=t.length(),n=or(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function or(t,e,r,n){var i;Ue(t,e,2);var a=t.getByte();e--;var o=a&192,s=a&31;i=t.length();var f=af(t,e);if(e-=i-t.length(),f!==void 0&&f>e){if(n.strict){var u=new Error("Too few bytes to read ASN.1 value.");throw u.available=t.length(),u.remaining=e,u.requested=f,u}f=e}var c,h,p=(a&32)===32;if(p)if(c=[],f===void 0)for(;;){if(Ue(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),c.push(or(t,e,r+1,n)),e-=i-t.length()}else for(;f>0;)i=t.length(),c.push(or(t,f,r+1,n)),e-=i-t.length(),f-=i-t.length();if(c===void 0&&o===_.Class.UNIVERSAL&&s===_.Type.BITSTRING&&(h=t.bytes(f)),c===void 0&&n.decodeBitStrings&&o===_.Class.UNIVERSAL&&s===_.Type.BITSTRING&&f>1){var m=t.read,l=e,x=0;if(s===_.Type.BITSTRING&&(Ue(t,e,1),x=t.getByte(),e--),x===0)try{i=t.length();var v={strict:!0,decodeBitStrings:!0},b=or(t,e,r+1,v),I=i-t.length();e-=I,s==_.Type.BITSTRING&&I++;var w=b.tagClass;I===f&&(w===_.Class.UNIVERSAL||w===_.Class.CONTEXT_SPECIFIC)&&(c=[b])}catch{}c===void 0&&(t.read=m,e=l)}if(c===void 0){if(f===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");f=e}if(s===_.Type.BMPSTRING)for(c="";f>0;f-=2)Ue(t,e,2),c+=String.fromCharCode(t.getInt16()),e-=2;else c=t.getBytes(f),e-=f}var T=h===void 0?null:{bitStringContents:h};return _.create(o,s,p,c,T)}_.toDer=function(t){var e=tt.util.createBuffer(),r=t.tagClass|t.type,n=tt.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=_.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var a=0;a<t.value.length;++a)t.value[a]!==void 0&&n.putBuffer(_.toDer(t.value[a]))}else if(t.type===_.Type.BMPSTRING)for(var a=0;a<t.value.length;++a)n.putInt16(t.value.charCodeAt(a));else t.type===_.Type.INTEGER&&t.value.length>1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),s="";do s+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(s.length|128);for(var a=s.length-1;a>=0;--a)e.putByte(s.charCodeAt(a))}return e.putBuffer(n),e};_.oidToDer=function(t){var e=t.split("."),r=tt.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,a,o,s=2;s<e.length;++s){n=!0,i=[],a=parseInt(e[s],10);do o=a&127,a=a>>>7,n||(o|=128),i.push(o),n=!1;while(a>0);for(var f=i.length-1;f>=0;--f)r.putByte(i[f])}return r};_.derToOid=function(t){var e;typeof t=="string"&&(t=tt.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};_.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),a=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var f=t.charAt(10),u=10;f!=="+"&&f!=="-"&&(s=parseInt(t.substr(10,2),10),u+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(a,o,s,0),u&&(f=t.charAt(u),f==="+"||f==="-")){var c=parseInt(t.substr(u+1,2),10),h=parseInt(t.substr(u+4,2),10),p=c*60+h;p*=6e4,f==="+"?e.setTime(+e-p):e.setTime(+e+p)}return e};_.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),f=0,u=0,c=!1;t.charAt(t.length-1)==="Z"&&(c=!0);var h=t.length-5,p=t.charAt(h);if(p==="+"||p==="-"){var m=parseInt(t.substr(h+1,2),10),l=parseInt(t.substr(h+4,2),10);u=m*60+l,u*=6e4,p==="+"&&(u*=-1),c=!0}return t.charAt(14)==="."&&(f=parseFloat(t.substr(14),10)*1e3),c?(e.setUTCFullYear(r,n,i),e.setUTCHours(a,o,s,f),e.setTime(+e+u)):(e.setFullYear(r,n,i),e.setHours(a,o,s,f)),e};_.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z",e};_.dateToGeneralizedTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push(""+t.getUTCFullYear()),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z",e};_.integerToDer=function(t){var e=tt.util.createBuffer();if(t>=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};_.derToInteger=function(t){typeof t=="string"&&(t=tt.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};_.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&tt.util.isArray(e.value))for(var a=0,o=0;i&&o<e.value.length;++o)i=e.value[o].optional||!1,t.value[a]&&(i=_.validate(t.value[a],e.value[o],r,n),i?++a:e.value[o].optional&&(i=!0)),!i&&n&&n.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+t.value.length+'"');if(i&&r&&(e.capture&&(r[e.capture]=t.value),e.captureAsn1&&(r[e.captureAsn1]=t),e.captureBitStringContents&&"bitStringContents"in t&&(r[e.captureBitStringContents]=t.bitStringContents),e.captureBitStringValue&&"bitStringContents"in t)){var s;if(t.bitStringContents.length<2)r[e.captureBitStringValue]="";else{var f=t.bitStringContents.charCodeAt(0);if(f!==0)throw new Error("captureBitStringValue only supported for zero unused bits");r[e.captureBitStringValue]=t.bitStringContents.slice(1)}}}else n&&n.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');else n&&(t.tagClass!==e.tagClass&&n.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&n.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));return i};var Aa=/[^\\u0000-\\u00ff]/;_.prettyPrint=function(t,e,r){var n="";e=e||0,r=r||2,e>0&&(n+=`
6
- `);for(var i="",a=0;a<e*r;++a)i+=" ";switch(n+=i+"Tag: ",t.tagClass){case _.Class.UNIVERSAL:n+="Universal:";break;case _.Class.APPLICATION:n+="Application:";break;case _.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case _.Class.PRIVATE:n+="Private:";break}if(t.tagClass===_.Class.UNIVERSAL)switch(n+=t.type,t.type){case _.Type.NONE:n+=" (None)";break;case _.Type.BOOLEAN:n+=" (Boolean)";break;case _.Type.INTEGER:n+=" (Integer)";break;case _.Type.BITSTRING:n+=" (Bit string)";break;case _.Type.OCTETSTRING:n+=" (Octet string)";break;case _.Type.NULL:n+=" (Null)";break;case _.Type.OID:n+=" (Object Identifier)";break;case _.Type.ODESC:n+=" (Object Descriptor)";break;case _.Type.EXTERNAL:n+=" (External or Instance of)";break;case _.Type.REAL:n+=" (Real)";break;case _.Type.ENUMERATED:n+=" (Enumerated)";break;case _.Type.EMBEDDED:n+=" (Embedded PDV)";break;case _.Type.UTF8:n+=" (UTF8)";break;case _.Type.ROID:n+=" (Relative Object Identifier)";break;case _.Type.SEQUENCE:n+=" (Sequence)";break;case _.Type.SET:n+=" (Set)";break;case _.Type.PRINTABLESTRING:n+=" (Printable String)";break;case _.Type.IA5String:n+=" (IA5String (ASCII))";break;case _.Type.UTCTIME:n+=" (UTC time)";break;case _.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case _.Type.BMPSTRING:n+=" (BMP String)";break}else n+=t.type;if(n+=`
2
+ "use strict";var Libp2PPnet=(()=>{var y0=Object.create;var Ue=Object.defineProperty;var x0=Object.getOwnPropertyDescriptor;var g0=Object.getOwnPropertyNames;var m0=Object.getPrototypeOf,v0=Object.prototype.hasOwnProperty;var X=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dt=(t,e)=>{for(var r in e)Ue(t,r,{get:e[r],enumerable:!0})},qn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of g0(e))!v0.call(t,i)&&i!==r&&Ue(t,i,{get:()=>e[i],enumerable:!(n=x0(e,i))||n.enumerable});return t};var at=(t,e,r)=>(r=t!=null?y0(m0(t)):{},qn(e||!t||!t.__esModule?Ue(r,"default",{value:t,enumerable:!0}):r,t)),A0=t=>qn(Ue({},"__esModule",{value:!0}),t);var W=X((Yu,Qn)=>{Qn.exports={options:{usePureJavaScript:!1}}});var Hn=X((Wu,Gn)=>{var br={};Gn.exports=br;var zn={};br.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=b0(t,e);else{var i=0,a=e.length,s=e.charAt(0),o=[0];for(i=0;i<t.length;++i){for(var u=0,f=t[i];u<o.length;++u)f+=o[u]<<8,o[u]=f%a,f=f/a|0;for(;f>0;)o.push(f%a),f=f/a|0}for(i=0;t[i]===0&&i<t.length-1;++i)n+=s;for(i=o.length-1;i>=0;--i)n+=e[o[i]]}if(r){var c=new RegExp(".{1,"+r+"}","g");n=n.match(c).join(`\r
3
+ `)}return n};br.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=zn[e];if(!r){r=zn[e]=[];for(var n=0;n<e.length;++n)r[e.charCodeAt(n)]=n}t=t.replace(/\s/g,"");for(var i=e.length,a=e.charAt(0),s=[0],n=0;n<t.length;n++){var o=r[t.charCodeAt(n)];if(o===void 0)return;for(var u=0,f=o;u<s.length;++u)f+=s[u]*i,s[u]=f&255,f>>=8;for(;f>0;)s.push(f&255),f>>=8}for(var c=0;t[c]===a&&c<t.length-1;++c)s.push(0);return typeof Buffer<"u"?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};function b0(t,e){var r=0,n=e.length,i=e.charAt(0),a=[0];for(r=0;r<t.length();++r){for(var s=0,o=t.at(r);s<a.length;++s)o+=a[s]<<8,a[s]=o%n,o=o/n|0;for(;o>0;)a.push(o%n),o=o/n|0}var u="";for(r=0;t.at(r)===0&&r<t.length()-1;++r)u+=i;for(r=a.length-1;r>=0;--r)u+=e[a[r]];return u}});var it=X((Ju,$n)=>{var Yn=W(),Wn=Hn(),y=$n.exports=Yn.util=Yn.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){y.nextTick=process.nextTick,typeof setImmediate=="function"?y.setImmediate=setImmediate:y.setImmediate=y.nextTick;return}if(typeof setImmediate=="function"){y.setImmediate=function(){return setImmediate.apply(void 0,arguments)},y.nextTick=function(o){return setImmediate(o)};return}if(y.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(u){if(u.source===window&&u.data===t){u.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(c){c()})}};var s=o,t="forge.setImmediate",e=[];y.setImmediate=function(u){e.push(u),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var u=e.slice();e.length=0,u.forEach(function(f){f()})}).observe(i,{attributes:!0});var a=y.setImmediate;y.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),a(u)):(e.push(u),e.length===1&&i.setAttribute("a",n=!n))}}y.nextTick=y.setImmediate})();y.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;y.globalScope=function(){return y.isNodejs?globalThis:typeof self>"u"?window:self}();y.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};y.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};y.isArrayBufferView=function(t){return t&&y.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function Ae(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}y.ByteBuffer=Er;function Er(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(y.isArrayBuffer(t)||y.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof Er||typeof t=="object"&&typeof t.data=="string"&&typeof t.read=="number")&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}y.ByteStringBuffer=Er;var E0=4096;y.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>E0&&(this.data.substr(0,1),this._constructedStringLength=0)};y.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};y.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};y.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};y.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};y.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};y.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(y.encodeUtf8(t))};y.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};y.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};y.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};y.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};y.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};y.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};y.ByteStringBuffer.prototype.putInt=function(t,e){Ae(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};y.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)};y.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())};y.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};y.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t};y.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t};y.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t};y.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t};y.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t};y.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t};y.ByteStringBuffer.prototype.getInt=function(t){Ae(t);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),t-=8;while(t>0);return e};y.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e};y.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};y.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};y.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};y.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};y.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};y.ByteStringBuffer.prototype.copy=function(){var t=y.createBuffer(this.data);return t.read=this.read,t};y.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};y.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};y.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};y.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var r=this.data.charCodeAt(e);r<16&&(t+="0"),t+=r.toString(16)}return t};y.ByteStringBuffer.prototype.toString=function(){return y.decodeUtf8(this.bytes())};function B0(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=y.isArrayBuffer(t),n=y.isArrayBufferView(t);if(r||n){r?this.data=new DataView(t):this.data=new DataView(t.buffer,t.byteOffset,t.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,t!=null&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)}y.DataBuffer=B0;y.DataBuffer.prototype.length=function(){return this.write-this.read};y.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};y.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};y.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};y.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this};y.DataBuffer.prototype.putBytes=function(t,e){if(y.isArrayBufferView(t)){var r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(r),this.write+=n,this}if(y.isArrayBuffer(t)){var r=new Uint8Array(t);this.accommodate(r.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(r,this.write),this.write+=r.byteLength,this}if(t instanceof y.DataBuffer||typeof t=="object"&&typeof t.read=="number"&&typeof t.write=="number"&&y.isArrayBufferView(t.data)){var r=new Uint8Array(t.data.byteLength,t.read,t.length());this.accommodate(r.byteLength);var i=new Uint8Array(t.data.byteLength,this.write);return i.set(r),this.write+=r.byteLength,this}if(t instanceof y.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary",typeof t=="string"){var a;if(e==="hex")return this.accommodate(Math.ceil(t.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=y.binary.hex.decode(t,a,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(t.length/4)*3),a=new Uint8Array(this.data.buffer,this.write),this.write+=y.binary.base64.decode(t,a,this.write),this;if(e==="utf8"&&(t=y.encodeUtf8(t),e="binary"),e==="binary"||e==="raw")return this.accommodate(t.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=y.binary.raw.decode(a),this;if(e==="utf16")return this.accommodate(t.length*2),a=new Uint16Array(this.data.buffer,this.write),this.write+=y.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)};y.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this};y.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")};y.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this};y.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};y.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};y.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};y.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};y.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};y.DataBuffer.prototype.putInt=function(t,e){Ae(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};y.DataBuffer.prototype.putSignedInt=function(t,e){return Ae(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)};y.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};y.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t};y.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t};y.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t};y.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t};y.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t};y.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t};y.DataBuffer.prototype.getInt=function(t){Ae(t);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),t-=8;while(t>0);return e};y.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e};y.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};y.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};y.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};y.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};y.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};y.DataBuffer.prototype.copy=function(){return new y.DataBuffer(this)};y.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};y.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};y.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};y.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var r=this.data.getUint8(e);r<16&&(t+="0"),t+=r.toString(16)}return t};y.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if(t=t||"utf8",t==="binary"||t==="raw")return y.binary.raw.encode(e);if(t==="hex")return y.binary.hex.encode(e);if(t==="base64")return y.binary.base64.encode(e);if(t==="utf8")return y.text.utf8.decode(e);if(t==="utf16")return y.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)};y.createBuffer=function(t,e){return e=e||"raw",t!==void 0&&e==="utf8"&&(t=y.encodeUtf8(t)),new y.ByteBuffer(t)};y.fillString=function(t,e){for(var r="";e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};y.xorBytes=function(t,e,r){for(var n="",i="",a="",s=0,o=0;r>0;--r,++s)i=t.charCodeAt(s)^e.charCodeAt(s),o>=10&&(n+=a,a="",o=0),a+=String.fromCharCode(i),++o;return n+=a,n};y.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e};y.bytesToHex=function(t){return y.createBuffer(t).toHex()};y.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var Ot="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Vt=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Jn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";y.encode64=function(t,e){for(var r="",n="",i,a,s,o=0;o<t.length;)i=t.charCodeAt(o++),a=t.charCodeAt(o++),s=t.charCodeAt(o++),r+=Ot.charAt(i>>2),r+=Ot.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=Ot.charAt((a&15)<<2|s>>6),r+=isNaN(s)?"=":Ot.charAt(s&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r
4
+ `,r=r.substr(e));return n+=r,n};y.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,a,s=0;s<t.length;)r=Vt[t.charCodeAt(s++)-43],n=Vt[t.charCodeAt(s++)-43],i=Vt[t.charCodeAt(s++)-43],a=Vt[t.charCodeAt(s++)-43],e+=String.fromCharCode(r<<2|n>>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),a!==64&&(e+=String.fromCharCode((i&3)<<6|a)));return e};y.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};y.decodeUtf8=function(t){return decodeURIComponent(escape(t))};y.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Wn.encode,decode:Wn.decode}};y.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};y.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,a=0;a<t.length;++a)n[i++]=t.charCodeAt(a);return e?i-r:n};y.binary.hex.encode=y.bytesToHex;y.binary.hex.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/2))),r=r||0;var i=0,a=r;for(t.length&1&&(i=1,n[a++]=parseInt(t[0],16));i<t.length;i+=2)n[a++]=parseInt(t.substr(i,2),16);return e?a-r:n};y.binary.base64.encode=function(t,e){for(var r="",n="",i,a,s,o=0;o<t.byteLength;)i=t[o++],a=t[o++],s=t[o++],r+=Ot.charAt(i>>2),r+=Ot.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=Ot.charAt((a&15)<<2|s>>6),r+=isNaN(s)?"=":Ot.charAt(s&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r
5
+ `,r=r.substr(e));return n+=r,n};y.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,a,s,o,u=0,f=r;u<t.length;)i=Vt[t.charCodeAt(u++)-43],a=Vt[t.charCodeAt(u++)-43],s=Vt[t.charCodeAt(u++)-43],o=Vt[t.charCodeAt(u++)-43],n[f++]=i<<2|a>>4,s!==64&&(n[f++]=(a&15)<<4|s>>2,o!==64&&(n[f++]=(s&3)<<6|o));return e?f-r:n.subarray(0,f)};y.binary.base58.encode=function(t,e){return y.binary.baseN.encode(t,Jn,e)};y.binary.base58.decode=function(t,e){return y.binary.baseN.decode(t,Jn,e)};y.text={utf8:{},utf16:{}};y.text.utf8.encode=function(t,e,r){t=y.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,a=0;a<t.length;++a)n[i++]=t.charCodeAt(a);return e?i-r:n};y.text.utf8.decode=function(t){return y.decodeUtf8(String.fromCharCode.apply(null,t))};y.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length*2));var i=new Uint16Array(n.buffer);r=r||0;for(var a=r,s=r,o=0;o<t.length;++o)i[s++]=t.charCodeAt(o),a+=2;return e?a-r:n};y.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))};y.deflate=function(t,e,r){if(e=y.decode64(t.deflate(y.encode64(e)).rval),r){var n=2,i=e.charCodeAt(1);i&32&&(n=6),e=e.substring(n,e.length-4)}return e};y.inflate=function(t,e,r){var n=t.inflate(y.encode64(e)).rval;return n===null?null:y.decode64(n)};var Br=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var n;if(r===null?n=t.removeItem(e):(r=y.encode64(JSON.stringify(r)),n=t.setItem(e,r)),typeof n<"u"&&n.rval!==!0){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},Sr=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(r.rval===null){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return r!==null&&(r=JSON.parse(y.decode64(r))),r},S0=function(t,e,r,n){var i=Sr(t,e);i===null&&(i={}),i[r]=n,Br(t,e,i)},w0=function(t,e,r){var n=Sr(t,e);return n!==null&&(n=r in n?n[r]:null),n},C0=function(t,e,r){var n=Sr(t,e);if(n!==null&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),Br(t,e,n)}},I0=function(t,e){Br(t,e,null)},Me=function(t,e,r){var n=null;typeof r>"u"&&(r=["web","flash"]);var i,a=!1,s=null;for(var o in r){i=r[o];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),a=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),a=!0)}catch(u){s=u}if(a)break}if(!a)throw s;return n};y.setItem=function(t,e,r,n,i){Me(S0,arguments,i)};y.getItem=function(t,e,r,n){return Me(w0,arguments,n)};y.removeItem=function(t,e,r,n){Me(C0,arguments,n)};y.clearItems=function(t,e,r){Me(I0,arguments,r)};y.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};y.format=function(t){for(var e=/%./g,r,n,i=0,a=[],s=0;r=e.exec(t);){n=t.substring(s,e.lastIndex-2),n.length>0&&a.push(n),s=e.lastIndex;var o=r[0][1];switch(o){case"s":case"o":i<arguments.length?a.push(arguments[i+++1]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+o+"?>")}}return a.push(t.substring(s)),a.join("")};y.formatNumber=function(t,e,r,n){var i=t,a=isNaN(e=Math.abs(e))?2:e,s=r===void 0?",":r,o=n===void 0?".":n,u=i<0?"-":"",f=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",c=f.length>3?f.length%3:0;return u+(c?f.substr(0,c)+o:"")+f.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+o)+(a?s+Math.abs(i-f).toFixed(a).slice(2):"")};y.formatSize=function(t){return t>=1073741824?t=y.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=y.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=y.formatNumber(t/1024,0)+" KiB":t=y.formatNumber(t,0)+" bytes",t};y.bytesFromIP=function(t){return t.indexOf(".")!==-1?y.bytesFromIPv4(t):t.indexOf(":")!==-1?y.bytesFromIPv6(t):null};y.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=y.createBuffer(),r=0;r<t.length;++r){var n=parseInt(t[r],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()};y.bytesFromIPv6=function(t){var e=0;t=t.split(":").filter(function(s){return s.length===0&&++e,!0});for(var r=(8-t.length+e)*2,n=y.createBuffer(),i=0;i<8;++i){if(!t[i]||t[i].length===0){n.fillWithByte(0,r),r=0;continue}var a=y.hexToBytes(t[i]);a.length<2&&n.putByte(0),n.putBytes(a)}return n.getBytes()};y.bytesToIP=function(t){return t.length===4?y.bytesToIPv4(t):t.length===16?y.bytesToIPv6(t):null};y.bytesToIPv4=function(t){if(t.length!==4)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")};y.bytesToIPv6=function(t){if(t.length!==16)return null;for(var e=[],r=[],n=0,i=0;i<t.length;i+=2){for(var a=y.bytesToHex(t[i]+t[i+1]);a[0]==="0"&&a!=="0";)a=a.substr(1);if(a==="0"){var s=r[r.length-1],o=e.length;!s||o!==s.end+1?r.push({start:o,end:o}):(s.end=o,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1))}e.push(a)}if(r.length>0){var u=r[n];u.end-u.start>0&&(e.splice(u.start,u.end-u.start+1,""),u.start===0&&e.unshift(""),u.end===7&&e.push(""))}return e.join(":")};y.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in y&&!t.update)return e(null,y.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return y.cores=navigator.hardwareConcurrency,e(null,y.cores);if(typeof Worker>"u")return y.cores=1,e(null,y.cores);if(typeof Blob>"u")return y.cores=2,e(null,y.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(s){for(var o=Date.now(),u=o+4;Date.now()<u;);self.postMessage({st:o,et:u})})}.toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(s,o,u){if(o===0){var f=Math.floor(s.reduce(function(c,h){return c+h},0)/s.length);return y.cores=Math.max(1,f),URL.revokeObjectURL(r),e(null,y.cores)}i(u,function(c,h){s.push(a(u,h)),n(s,o-1,u)})}function i(s,o){for(var u=[],f=[],c=0;c<s;++c){var h=new Worker(r);h.addEventListener("message",function(p){if(f.push(p.data),f.length===s){for(var g=0;g<s;++g)u[g].terminate();o(null,f)}}),u.push(h)}for(var c=0;c<s;++c)u[c].postMessage(c)}function a(s,o){for(var u=[],f=0;f<s;++f)for(var c=o[f],h=u[f]=[],p=0;p<s;++p)if(f!==p){var g=o[p];(c.st>g.st&&c.st<g.et||g.st>c.st&&g.st<c.et)&&h.push(p)}return u.reduce(function(l,m){return Math.max(l,m.length)},0)}}});var Cr=X(($u,Xn)=>{var st=W();it();Xn.exports=st.cipher=st.cipher||{};st.cipher.algorithms=st.cipher.algorithms||{};st.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=st.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new st.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};st.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=st.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new st.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};st.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),st.cipher.algorithms[t]=e};st.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in st.cipher.algorithms?st.cipher.algorithms[t]:null};var wr=st.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};wr.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=st.util.createBuffer(),this.output=t.output||st.util.createBuffer(),this.mode.start(e)};wr.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};wr.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Tr=X((Xu,Zn)=>{var ot=W();it();ot.cipher=ot.cipher||{};var V=Zn.exports=ot.cipher.modes=ot.cipher.modes||{};V.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};V.ecb.prototype.start=function(t){};V.ecb.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};V.ecb.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};V.ecb.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0};V.ecb.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};V.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};V.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=Fe(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};V.cbc.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock};V.cbc.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};V.cbc.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0};V.cbc.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};V.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=ot.util.createBuffer(),this._partialBytes=0};V.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Fe(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};V.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32()^this._outBlock[i],e.putInt32(this._inBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)t.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};V.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32(),e.putInt32(this._inBlock[i]^this._outBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};V.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ot.util.createBuffer(),this._partialBytes=0};V.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Fe(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};V.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};V.ofb.prototype.decrypt=V.ofb.prototype.encrypt;V.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ot.util.createBuffer(),this._partialBytes=0};V.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Fe(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};V.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}Oe(this._inBlock)};V.ctr.prototype.decrypt=V.ctr.prototype.encrypt;V.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=ot.util.createBuffer(),this._partialBytes=0,this._R=3774873600};V.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=ot.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=ot.util.createBuffer(t.additionalData):r=ot.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=ot.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Ir(n*8)))}this._inBlock=this._j0.slice(0),Oe(this._inBlock),this._partialBytes=0,r=ot.util.createBuffer(r),this._aDataLength=Ir(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};V.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^=t.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Oe(this._inBlock)};V.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Oe(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};V.gcm.prototype.afterFinish=function(t,e){var r=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=ot.util.createBuffer();var n=this._aDataLength.concat(Ir(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^i[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r};V.gcm.prototype.multiply=function(t,e){for(var r=[0,0,0,0],n=e.slice(0),i=0;i<128;++i){var a=t[i/32|0]&1<<31-i%32;a&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r};V.gcm.prototype.pow=function(t,e){for(var r=t[3]&1,n=3;n>0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};V.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,a=this._m[r][i];e[0]^=a[0],e[1]^=a[1],e[2]^=a[2],e[3]^=a[3]}return e};V.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};V.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,a=new Array(i),s=0;s<i;++s){var o=[0,0,0,0],u=s/n|0,f=(n-1-s%n)*e;o[u]=1<<e-1<<f,a[s]=this.generateSubHashTable(this.multiply(o,t),e)}return a};V.gcm.prototype.generateSubHashTable=function(t,e){var r=1<<e,n=r>>>1,i=new Array(r);i[n]=t.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var s=1;s<a;++s){var o=i[a],u=i[s];i[a+s]=[o[0]^u[0],o[1]^u[1],o[2]^u[2],o[3]^u[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var f=i[a^n];i[a]=[t[0]^f[0],t[1]^f[1],t[2]^f[2],t[3]^f[3]]}return i};function Fe(t,e){if(typeof t=="string"&&(t=ot.util.createBuffer(t)),ot.util.isArray(t)&&t.length>4){var r=t;t=ot.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n])}if(t.length()<e)throw new Error("Invalid IV length; got "+t.length()+" bytes and expected "+e+" bytes.");if(!ot.util.isArray(t)){for(var i=[],a=e/4,n=0;n<a;++n)i.push(t.getInt32());t=i}return t}function Oe(t){t[t.length-1]=t[t.length-1]+1&4294967295}function Ir(t){return[t/4294967296|0,t&4294967295]}});var qe=X((Zu,ri)=>{var Z=W();Cr();Tr();it();ri.exports=Z.aes=Z.aes||{};Z.aes.startEncrypting=function(t,e,r,n){var i=Ve({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};Z.aes.createEncryptionCipher=function(t,e){return Ve({key:t,output:null,decrypt:!1,mode:e})};Z.aes.startDecrypting=function(t,e,r,n){var i=Ve({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};Z.aes.createDecryptionCipher=function(t,e){return Ve({key:t,output:null,decrypt:!0,mode:e})};Z.aes.Algorithm=function(t,e){Dr||ti();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return Rr(r._w,n,i,!1)},decrypt:function(n,i){return Rr(r._w,n,i,!0)}}}),r._init=!1};Z.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Z.util.createBuffer(e);else if(Z.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Z.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(!Z.util.isArray(e)){r=e,e=[];var i=r.length();if(i===16||i===24||i===32){i=i>>>2;for(var n=0;n<i;++n)e.push(r.getInt32())}}if(!Z.util.isArray(e)||!(e.length===4||e.length===6||e.length===8))throw new Error("Invalid key parameter.");var a=this.mode.name,s=["CFB","OFB","CTR","GCM"].indexOf(a)!==-1;this._w=ei(e,t.decrypt&&!s),this._init=!0}};Z.aes._expandKey=function(t,e){return Dr||ti(),ei(t,e)};Z.aes._updateBlock=Rr;se("AES-ECB",Z.cipher.modes.ecb);se("AES-CBC",Z.cipher.modes.cbc);se("AES-CFB",Z.cipher.modes.cfb);se("AES-OFB",Z.cipher.modes.ofb);se("AES-CTR",Z.cipher.modes.ctr);se("AES-GCM",Z.cipher.modes.gcm);function se(t,e){var r=function(){return new Z.aes.Algorithm(t,e)};Z.cipher.registerAlgorithm(t,r)}var Dr=!1,ae=4,ct,_r,jn,Wt,At;function ti(){Dr=!0,jn=[0,1,2,4,8,16,32,64,128,27,54];for(var t=new Array(256),e=0;e<128;++e)t[e]=e<<1,t[e+128]=e+128<<1^283;ct=new Array(256),_r=new Array(256),Wt=new Array(4),At=new Array(4);for(var e=0;e<4;++e)Wt[e]=new Array(256),At[e]=new Array(256);for(var r=0,n=0,i,a,s,o,u,f,c,e=0;e<256;++e){o=n^n<<1^n<<2^n<<3^n<<4,o=o>>8^o&255^99,ct[r]=o,_r[o]=r,u=t[o],i=t[r],a=t[i],s=t[a],f=u<<24^o<<16^o<<8^(o^u),c=(i^a^s)<<24^(r^s)<<16^(r^a^s)<<8^(r^i^s);for(var h=0;h<4;++h)Wt[h][r]=f,At[h][o]=c,f=f<<24|f>>>8,c=c<<24|c>>>8;r===0?r=n=1:(r=i^t[t[t[i^s]]],n^=t[t[n]])}}function ei(t,e){for(var r=t.slice(0),n,i=1,a=r.length,s=a+6+1,o=ae*s,u=a;u<o;++u)n=r[u-1],u%a===0?(n=ct[n>>>16&255]<<24^ct[n>>>8&255]<<16^ct[n&255]<<8^ct[n>>>24]^jn[i]<<24,i++):a>6&&u%a===4&&(n=ct[n>>>24]<<24^ct[n>>>16&255]<<16^ct[n>>>8&255]<<8^ct[n&255]),r[u]=r[u-a]^n;if(e){var f,c=At[0],h=At[1],p=At[2],g=At[3],l=r.slice(0);o=r.length;for(var u=0,m=o-ae;u<o;u+=ae,m-=ae)if(u===0||u===o-ae)l[u]=r[m],l[u+1]=r[m+3],l[u+2]=r[m+2],l[u+3]=r[m+1];else for(var v=0;v<ae;++v)f=r[m+v],l[u+(3&-v)]=c[ct[f>>>24]]^h[ct[f>>>16&255]]^p[ct[f>>>8&255]]^g[ct[f&255]];r=l}return r}function Rr(t,e,r,n){var i=t.length/4-1,a,s,o,u,f;n?(a=At[0],s=At[1],o=At[2],u=At[3],f=_r):(a=Wt[0],s=Wt[1],o=Wt[2],u=Wt[3],f=ct);var c,h,p,g,l,m,v;c=e[0]^t[0],h=e[n?3:1]^t[1],p=e[2]^t[2],g=e[n?1:3]^t[3];for(var b=3,I=1;I<i;++I)l=a[c>>>24]^s[h>>>16&255]^o[p>>>8&255]^u[g&255]^t[++b],m=a[h>>>24]^s[p>>>16&255]^o[g>>>8&255]^u[c&255]^t[++b],v=a[p>>>24]^s[g>>>16&255]^o[c>>>8&255]^u[h&255]^t[++b],g=a[g>>>24]^s[c>>>16&255]^o[h>>>8&255]^u[p&255]^t[++b],c=l,h=m,p=v;r[0]=f[c>>>24]<<24^f[h>>>16&255]<<16^f[p>>>8&255]<<8^f[g&255]^t[++b],r[n?3:1]=f[h>>>24]<<24^f[p>>>16&255]<<16^f[g>>>8&255]<<8^f[c&255]^t[++b],r[2]=f[p>>>24]<<24^f[g>>>16&255]<<16^f[c>>>8&255]<<8^f[h&255]^t[++b],r[n?1:3]=f[g>>>24]<<24^f[c>>>16&255]<<16^f[h>>>8&255]<<8^f[p&255]^t[++b]}function Ve(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Z.cipher.createDecipher(r,t.key):n=Z.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(a,s){var o=null;s instanceof Z.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=a,i.call(n,s)},n}});var He=X((fh,Ci)=>{var Ce=W();Ce.pki=Ce.pki||{};var rn=Ci.exports=Ce.pki.oids=Ce.oids=Ce.oids||{};function B(t,e){rn[t]=e,rn[e]=t}function Y(t,e){rn[t]=e}B("1.2.840.113549.1.1.1","rsaEncryption");B("1.2.840.113549.1.1.4","md5WithRSAEncryption");B("1.2.840.113549.1.1.5","sha1WithRSAEncryption");B("1.2.840.113549.1.1.7","RSAES-OAEP");B("1.2.840.113549.1.1.8","mgf1");B("1.2.840.113549.1.1.9","pSpecified");B("1.2.840.113549.1.1.10","RSASSA-PSS");B("1.2.840.113549.1.1.11","sha256WithRSAEncryption");B("1.2.840.113549.1.1.12","sha384WithRSAEncryption");B("1.2.840.113549.1.1.13","sha512WithRSAEncryption");B("1.3.101.112","EdDSA25519");B("1.2.840.10040.4.3","dsa-with-sha1");B("1.3.14.3.2.7","desCBC");B("1.3.14.3.2.26","sha1");B("1.3.14.3.2.29","sha1WithRSASignature");B("2.16.840.1.101.3.4.2.1","sha256");B("2.16.840.1.101.3.4.2.2","sha384");B("2.16.840.1.101.3.4.2.3","sha512");B("2.16.840.1.101.3.4.2.4","sha224");B("2.16.840.1.101.3.4.2.5","sha512-224");B("2.16.840.1.101.3.4.2.6","sha512-256");B("1.2.840.113549.2.2","md2");B("1.2.840.113549.2.5","md5");B("1.2.840.113549.1.7.1","data");B("1.2.840.113549.1.7.2","signedData");B("1.2.840.113549.1.7.3","envelopedData");B("1.2.840.113549.1.7.4","signedAndEnvelopedData");B("1.2.840.113549.1.7.5","digestedData");B("1.2.840.113549.1.7.6","encryptedData");B("1.2.840.113549.1.9.1","emailAddress");B("1.2.840.113549.1.9.2","unstructuredName");B("1.2.840.113549.1.9.3","contentType");B("1.2.840.113549.1.9.4","messageDigest");B("1.2.840.113549.1.9.5","signingTime");B("1.2.840.113549.1.9.6","counterSignature");B("1.2.840.113549.1.9.7","challengePassword");B("1.2.840.113549.1.9.8","unstructuredAddress");B("1.2.840.113549.1.9.14","extensionRequest");B("1.2.840.113549.1.9.20","friendlyName");B("1.2.840.113549.1.9.21","localKeyId");B("1.2.840.113549.1.9.22.1","x509Certificate");B("1.2.840.113549.1.12.10.1.1","keyBag");B("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");B("1.2.840.113549.1.12.10.1.3","certBag");B("1.2.840.113549.1.12.10.1.4","crlBag");B("1.2.840.113549.1.12.10.1.5","secretBag");B("1.2.840.113549.1.12.10.1.6","safeContentsBag");B("1.2.840.113549.1.5.13","pkcs5PBES2");B("1.2.840.113549.1.5.12","pkcs5PBKDF2");B("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");B("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");B("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");B("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");B("1.2.840.113549.2.7","hmacWithSHA1");B("1.2.840.113549.2.8","hmacWithSHA224");B("1.2.840.113549.2.9","hmacWithSHA256");B("1.2.840.113549.2.10","hmacWithSHA384");B("1.2.840.113549.2.11","hmacWithSHA512");B("1.2.840.113549.3.7","des-EDE3-CBC");B("2.16.840.1.101.3.4.1.2","aes128-CBC");B("2.16.840.1.101.3.4.1.22","aes192-CBC");B("2.16.840.1.101.3.4.1.42","aes256-CBC");B("2.5.4.3","commonName");B("2.5.4.4","surname");B("2.5.4.5","serialNumber");B("2.5.4.6","countryName");B("2.5.4.7","localityName");B("2.5.4.8","stateOrProvinceName");B("2.5.4.9","streetAddress");B("2.5.4.10","organizationName");B("2.5.4.11","organizationalUnitName");B("2.5.4.12","title");B("2.5.4.13","description");B("2.5.4.15","businessCategory");B("2.5.4.17","postalCode");B("2.5.4.42","givenName");B("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");B("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");B("2.16.840.1.113730.1.1","nsCertType");B("2.16.840.1.113730.1.13","nsComment");Y("2.5.29.1","authorityKeyIdentifier");Y("2.5.29.2","keyAttributes");Y("2.5.29.3","certificatePolicies");Y("2.5.29.4","keyUsageRestriction");Y("2.5.29.5","policyMapping");Y("2.5.29.6","subtreesConstraint");Y("2.5.29.7","subjectAltName");Y("2.5.29.8","issuerAltName");Y("2.5.29.9","subjectDirectoryAttributes");Y("2.5.29.10","basicConstraints");Y("2.5.29.11","nameConstraints");Y("2.5.29.12","policyConstraints");Y("2.5.29.13","basicConstraints");B("2.5.29.14","subjectKeyIdentifier");B("2.5.29.15","keyUsage");Y("2.5.29.16","privateKeyUsagePeriod");B("2.5.29.17","subjectAltName");B("2.5.29.18","issuerAltName");B("2.5.29.19","basicConstraints");Y("2.5.29.20","cRLNumber");Y("2.5.29.21","cRLReason");Y("2.5.29.22","expirationDate");Y("2.5.29.23","instructionCode");Y("2.5.29.24","invalidityDate");Y("2.5.29.25","cRLDistributionPoints");Y("2.5.29.26","issuingDistributionPoint");Y("2.5.29.27","deltaCRLIndicator");Y("2.5.29.28","issuingDistributionPoint");Y("2.5.29.29","certificateIssuer");Y("2.5.29.30","nameConstraints");B("2.5.29.31","cRLDistributionPoints");B("2.5.29.32","certificatePolicies");Y("2.5.29.33","policyMappings");Y("2.5.29.34","policyConstraints");B("2.5.29.35","authorityKeyIdentifier");Y("2.5.29.36","policyConstraints");B("2.5.29.37","extKeyUsage");Y("2.5.29.46","freshestCRL");Y("2.5.29.54","inhibitAnyPolicy");B("1.3.6.1.4.1.11129.2.4.2","timestampList");B("1.3.6.1.5.5.7.1.1","authorityInfoAccess");B("1.3.6.1.5.5.7.3.1","serverAuth");B("1.3.6.1.5.5.7.3.2","clientAuth");B("1.3.6.1.5.5.7.3.3","codeSigning");B("1.3.6.1.5.5.7.3.4","emailProtection");B("1.3.6.1.5.5.7.3.8","timeStamping")});var Te=X((uh,Ti)=>{var j=W();it();He();var T=Ti.exports=j.asn1=j.asn1||{};T.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};T.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};T.create=function(t,e,r,n,i){if(j.util.isArray(n)){for(var a=[],s=0;s<n.length;++s)n[s]!==void 0&&a.push(n[s]);n=a}var o={tagClass:t,type:e,constructed:r,composed:r||j.util.isArray(n),value:n};return i&&"bitStringContents"in i&&(o.bitStringContents=i.bitStringContents,o.original=T.copy(o)),o};T.copy=function(t,e){var r;if(j.util.isArray(t)){r=[];for(var n=0;n<t.length;++n)r.push(T.copy(t[n],e));return r}return typeof t=="string"?t:(r={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:T.copy(t.value,e)},e&&!e.excludeBitStringContents&&(r.bitStringContents=t.bitStringContents),r)};T.equals=function(t,e,r){if(j.util.isArray(t)){if(!j.util.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!T.equals(t[n],e[n]))return!1;return!0}if(typeof t!=typeof e)return!1;if(typeof t=="string")return t===e;var i=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&T.equals(t.value,e.value);return r&&r.includeBitStringContents&&(i=i&&t.bitStringContents===e.bitStringContents),i};T.getBerValueLength=function(t){var e=t.getByte();if(e!==128){var r,n=e&128;return n?r=t.getInt((e&127)<<3):r=e,r}};function Ie(t,e,r){if(r>e){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var Ks=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var a=r&127;Ie(t,e,a),n=t.getInt(a<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};T.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=j.util.createBuffer(t));var r=t.length(),n=Ye(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function Ye(t,e,r,n){var i;Ie(t,e,2);var a=t.getByte();e--;var s=a&192,o=a&31;i=t.length();var u=Ks(t,e);if(e-=i-t.length(),u!==void 0&&u>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=t.length(),f.remaining=e,f.requested=u,f}u=e}var c,h,p=(a&32)===32;if(p)if(c=[],u===void 0)for(;;){if(Ie(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),c.push(Ye(t,e,r+1,n)),e-=i-t.length()}else for(;u>0;)i=t.length(),c.push(Ye(t,u,r+1,n)),e-=i-t.length(),u-=i-t.length();if(c===void 0&&s===T.Class.UNIVERSAL&&o===T.Type.BITSTRING&&(h=t.bytes(u)),c===void 0&&n.decodeBitStrings&&s===T.Class.UNIVERSAL&&o===T.Type.BITSTRING&&u>1){var g=t.read,l=e,m=0;if(o===T.Type.BITSTRING&&(Ie(t,e,1),m=t.getByte(),e--),m===0)try{i=t.length();var v={strict:!0,decodeBitStrings:!0},b=Ye(t,e,r+1,v),I=i-t.length();e-=I,o==T.Type.BITSTRING&&I++;var w=b.tagClass;I===u&&(w===T.Class.UNIVERSAL||w===T.Class.CONTEXT_SPECIFIC)&&(c=[b])}catch{}c===void 0&&(t.read=g,e=l)}if(c===void 0){if(u===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=e}if(o===T.Type.BMPSTRING)for(c="";u>0;u-=2)Ie(t,e,2),c+=String.fromCharCode(t.getInt16()),e-=2;else c=t.getBytes(u),e-=u}var D=h===void 0?null:{bitStringContents:h};return T.create(s,o,p,c,D)}T.toDer=function(t){var e=j.util.createBuffer(),r=t.tagClass|t.type,n=j.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=T.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var a=0;a<t.value.length;++a)t.value[a]!==void 0&&n.putBuffer(T.toDer(t.value[a]))}else if(t.type===T.Type.BMPSTRING)for(var a=0;a<t.value.length;++a)n.putInt16(t.value.charCodeAt(a));else t.type===T.Type.INTEGER&&t.value.length>1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var s=n.length(),o="";do o+=String.fromCharCode(s&255),s=s>>>8;while(s>0);e.putByte(o.length|128);for(var a=o.length-1;a>=0;--a)e.putByte(o.charCodeAt(a))}return e.putBuffer(n),e};T.oidToDer=function(t){var e=t.split("."),r=j.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,a,s,o=2;o<e.length;++o){n=!0,i=[],a=parseInt(e[o],10);do s=a&127,a=a>>>7,n||(s|=128),i.push(s),n=!1;while(a>0);for(var u=i.length-1;u>=0;--u)r.putByte(i[u])}return r};T.derToOid=function(t){var e;typeof t=="string"&&(t=j.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};T.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),a=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=0;if(t.length>11){var u=t.charAt(10),f=10;u!=="+"&&u!=="-"&&(o=parseInt(t.substr(10,2),10),f+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(a,s,o,0),f&&(u=t.charAt(f),u==="+"||u==="-")){var c=parseInt(t.substr(f+1,2),10),h=parseInt(t.substr(f+4,2),10),p=c*60+h;p*=6e4,u==="+"?e.setTime(+e-p):e.setTime(+e+p)}return e};T.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),u=0,f=0,c=!1;t.charAt(t.length-1)==="Z"&&(c=!0);var h=t.length-5,p=t.charAt(h);if(p==="+"||p==="-"){var g=parseInt(t.substr(h+1,2),10),l=parseInt(t.substr(h+4,2),10);f=g*60+l,f*=6e4,p==="+"&&(f*=-1),c=!0}return t.charAt(14)==="."&&(u=parseFloat(t.substr(14),10)*1e3),c?(e.setUTCFullYear(r,n,i),e.setUTCHours(a,s,o,u),e.setTime(+e+f)):(e.setFullYear(r,n,i),e.setHours(a,s,o,u)),e};T.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z",e};T.dateToGeneralizedTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push(""+t.getUTCFullYear()),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z",e};T.integerToDer=function(t){var e=j.util.createBuffer();if(t>=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};T.derToInteger=function(t){typeof t=="string"&&(t=j.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};T.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&j.util.isArray(e.value))for(var a=0,s=0;i&&s<e.value.length;++s)i=e.value[s].optional||!1,t.value[a]&&(i=T.validate(t.value[a],e.value[s],r,n),i?++a:e.value[s].optional&&(i=!0)),!i&&n&&n.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+t.value.length+'"');if(i&&r&&(e.capture&&(r[e.capture]=t.value),e.captureAsn1&&(r[e.captureAsn1]=t),e.captureBitStringContents&&"bitStringContents"in t&&(r[e.captureBitStringContents]=t.bitStringContents),e.captureBitStringValue&&"bitStringContents"in t)){var o;if(t.bitStringContents.length<2)r[e.captureBitStringValue]="";else{var u=t.bitStringContents.charCodeAt(0);if(u!==0)throw new Error("captureBitStringValue only supported for zero unused bits");r[e.captureBitStringValue]=t.bitStringContents.slice(1)}}}else n&&n.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');else n&&(t.tagClass!==e.tagClass&&n.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&n.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));return i};var Ii=/[^\\u0000-\\u00ff]/;T.prettyPrint=function(t,e,r){var n="";e=e||0,r=r||2,e>0&&(n+=`
6
+ `);for(var i="",a=0;a<e*r;++a)i+=" ";switch(n+=i+"Tag: ",t.tagClass){case T.Class.UNIVERSAL:n+="Universal:";break;case T.Class.APPLICATION:n+="Application:";break;case T.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case T.Class.PRIVATE:n+="Private:";break}if(t.tagClass===T.Class.UNIVERSAL)switch(n+=t.type,t.type){case T.Type.NONE:n+=" (None)";break;case T.Type.BOOLEAN:n+=" (Boolean)";break;case T.Type.INTEGER:n+=" (Integer)";break;case T.Type.BITSTRING:n+=" (Bit string)";break;case T.Type.OCTETSTRING:n+=" (Octet string)";break;case T.Type.NULL:n+=" (Null)";break;case T.Type.OID:n+=" (Object Identifier)";break;case T.Type.ODESC:n+=" (Object Descriptor)";break;case T.Type.EXTERNAL:n+=" (External or Instance of)";break;case T.Type.REAL:n+=" (Real)";break;case T.Type.ENUMERATED:n+=" (Enumerated)";break;case T.Type.EMBEDDED:n+=" (Embedded PDV)";break;case T.Type.UTF8:n+=" (UTF8)";break;case T.Type.ROID:n+=" (Relative Object Identifier)";break;case T.Type.SEQUENCE:n+=" (Sequence)";break;case T.Type.SET:n+=" (Set)";break;case T.Type.PRINTABLESTRING:n+=" (Printable String)";break;case T.Type.IA5String:n+=" (IA5String (ASCII))";break;case T.Type.UTCTIME:n+=" (UTC time)";break;case T.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case T.Type.BMPSTRING:n+=" (BMP String)";break}else n+=t.type;if(n+=`
7
7
  `,n+=i+"Constructed: "+t.constructed+`
8
- `,t.composed){for(var o=0,s="",a=0;a<t.value.length;++a)t.value[a]!==void 0&&(o+=1,s+=_.prettyPrint(t.value[a],e+1,r),a+1<t.value.length&&(s+=","));n+=i+"Sub values: "+o+s}else{if(n+=i+"Value: ",t.type===_.Type.OID){var f=_.derToOid(t.value);n+=f,tt.pki&&tt.pki.oids&&f in tt.pki.oids&&(n+=" ("+tt.pki.oids[f]+") ")}if(t.type===_.Type.INTEGER)try{n+=_.derToInteger(t.value)}catch{n+="0x"+tt.util.bytesToHex(t.value)}else if(t.type===_.Type.BITSTRING){if(t.value.length>1?n+="0x"+tt.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var u=t.value.charCodeAt(0);u==1?n+=" (1 unused bit shown)":u>1&&(n+=" ("+u+" unused bits shown)")}}else if(t.type===_.Type.OCTETSTRING)Aa.test(t.value)||(n+="("+t.value+") "),n+="0x"+tt.util.bytesToHex(t.value);else if(t.type===_.Type.UTF8)try{n+=tt.util.decodeUtf8(t.value)}catch(c){if(c.message==="URI malformed")n+="0x"+tt.util.bytesToHex(t.value)+" (malformed UTF8)";else throw c}else t.type===_.Type.PRINTABLESTRING||t.type===_.Type.IA5String?n+=t.value:Aa.test(t.value)?n+="0x"+tt.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var Ba=X((Nd,Sa)=>{var rt=W();Hr();Wr();ot();Sa.exports=rt.des=rt.des||{};rt.des.startEncrypting=function(t,e,r,n){var i=sr({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};rt.des.createEncryptionCipher=function(t,e){return sr({key:t,output:null,decrypt:!1,mode:e})};rt.des.startDecrypting=function(t,e,r,n){var i=sr({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};rt.des.createDecryptionCipher=function(t,e){return sr({key:t,output:null,decrypt:!0,mode:e})};rt.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return wa(r._keys,n,i,!1)},decrypt:function(n,i){return wa(r._keys,n,i,!0)}}}),r._init=!1};rt.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=rt.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=df(e),this._init=!0}};Ct("DES-ECB",rt.cipher.modes.ecb);Ct("DES-CBC",rt.cipher.modes.cbc);Ct("DES-CFB",rt.cipher.modes.cfb);Ct("DES-OFB",rt.cipher.modes.ofb);Ct("DES-CTR",rt.cipher.modes.ctr);Ct("3DES-ECB",rt.cipher.modes.ecb);Ct("3DES-CBC",rt.cipher.modes.cbc);Ct("3DES-CFB",rt.cipher.modes.cfb);Ct("3DES-OFB",rt.cipher.modes.ofb);Ct("3DES-CTR",rt.cipher.modes.ctr);function Ct(t,e){var r=function(){return new rt.des.Algorithm(t,e)};rt.cipher.registerAlgorithm(t,r)}var of=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],sf=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],ff=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],uf=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],cf=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],hf=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],lf=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],pf=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function df(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],f=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],c=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],m=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],l=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],x=t.length()>8?3:1,v=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],I=0,w,T=0;T<x;T++){var S=t.getInt32(),C=t.getInt32();w=(S>>>4^C)&252645135,C^=w,S^=w<<4,w=(C>>>-16^S)&65535,S^=w,C^=w<<-16,w=(S>>>2^C)&858993459,C^=w,S^=w<<2,w=(C>>>-16^S)&65535,S^=w,C^=w<<-16,w=(S>>>1^C)&1431655765,C^=w,S^=w<<1,w=(C>>>8^S)&16711935,S^=w,C^=w<<8,w=(S>>>1^C)&1431655765,C^=w,S^=w<<1,w=S<<8|C>>>20&240,S=C<<24|C<<8&16711680|C>>>8&65280|C>>>24&240,C=w;for(var L=0;L<b.length;++L){b[L]?(S=S<<2|S>>>26,C=C<<2|C>>>26):(S=S<<1|S>>>27,C=C<<1|C>>>27),S&=-15,C&=-15;var N=e[S>>>28]|r[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|a[S>>>12&15]|o[S>>>8&15]|s[S>>>4&15],P=f[C>>>28]|u[C>>>24&15]|c[C>>>20&15]|h[C>>>16&15]|p[C>>>12&15]|m[C>>>8&15]|l[C>>>4&15];w=(P>>>16^N)&65535,v[I++]=N^w,v[I++]=P^w<<16}}return v}function wa(t,e,r,n){var i=t.length===32?3:9,a;i===3?a=n?[30,-2,-2]:[0,32,2]:a=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,s=e[0],f=e[1];o=(s>>>4^f)&252645135,f^=o,s^=o<<4,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,s=s<<1|s>>>31,f=f<<1|f>>>31;for(var u=0;u<i;u+=3){for(var c=a[u+1],h=a[u+2],p=a[u];p!=c;p+=h){var m=f^t[p],l=(f>>>4|f<<28)^t[p+1];o=s,s=f,f=o^(sf[m>>>24&63]|uf[m>>>16&63]|hf[m>>>8&63]|pf[m&63]|of[l>>>24&63]|ff[l>>>16&63]|cf[l>>>8&63]|lf[l&63])}o=s,s=f,f=o}s=s>>>1|s<<31,f=f>>>1|f<<31,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(s>>>4^f)&252645135,f^=o,s^=o<<4,r[0]=s,r[1]=f}function sr(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=rt.cipher.createDecipher(r,t.key):n=rt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof rt.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var Zt=X((kd,Ca)=>{var fr=W();Ca.exports=fr.md=fr.md||{};fr.md.algorithms=fr.md.algorithms||{}});var Ta=X((Pd,Ia)=>{var Kt=W();Zt();ot();var yf=Ia.exports=Kt.hmac=Kt.hmac||{};yf.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(a,o){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in Kt.md.algorithms)e=Kt.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else e=a;if(o===null)o=t;else{if(typeof o=="string")o=Kt.util.createBuffer(o);else if(Kt.util.isArray(o)){var s=o;o=Kt.util.createBuffer();for(var f=0;f<s.length;++f)o.putByte(s[f])}var u=o.length();u>e.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=Kt.util.createBuffer(),n=Kt.util.createBuffer(),u=o.length();for(var f=0;f<u;++f){var s=o.at(f);r.putByte(54^s),n.putByte(92^s)}if(u<e.blockLength)for(var s=e.blockLength-u,f=0;f<s;++f)r.putByte(54),n.putByte(92);t=o,r=r.bytes(),n=n.bytes()}e.start(),e.update(r)},i.update=function(a){e.update(a)},i.getMac=function(){var a=e.digest().bytes();return e.start(),e.update(n),e.update(a),e.digest()},i.digest=i.getMac,i}});var ur=X(()=>{});var Sn=X((Md,_a)=>{var dt=W();Ta();Zt();ot();var xf=dt.pkcs5=dt.pkcs5||{},Mt;dt.util.isNodejs&&!dt.options.usePureJavaScript&&(Mt=ur());_a.exports=dt.pbkdf2=xf.pbkdf2=function(t,e,r,n,i,a){if(typeof i=="function"&&(a=i,i=null),dt.util.isNodejs&&!dt.options.usePureJavaScript&&Mt.pbkdf2&&(i===null||typeof i!="object")&&(Mt.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),a?Mt.pbkdf2Sync.length===4?Mt.pbkdf2(t,e,r,n,function(w,T){if(w)return a(w);a(null,T.toString("binary"))}):Mt.pbkdf2(t,e,r,n,i,function(w,T){if(w)return a(w);a(null,T.toString("binary"))}):Mt.pbkdf2Sync.length===4?Mt.pbkdf2Sync(t,e,r,n).toString("binary"):Mt.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in dt.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=dt.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var f=Math.ceil(n/o),u=n-(f-1)*o,c=dt.hmac.create();c.start(i,t);var h="",p,m,l;if(!a){for(var x=1;x<=f;++x){c.start(null,null),c.update(e),c.update(dt.util.int32ToBytes(x)),p=l=c.digest().getBytes();for(var v=2;v<=r;++v)c.start(null,null),c.update(l),m=c.digest().getBytes(),p=dt.util.xorBytes(p,m,o),l=m;h+=x<f?p:p.substr(0,u)}return h}var x=1,v;function b(){if(x>f)return a(null,h);c.start(null,null),c.update(e),c.update(dt.util.int32ToBytes(x)),p=l=c.digest().getBytes(),v=2,I()}function I(){if(v<=r)return c.start(null,null),c.update(l),m=c.digest().getBytes(),p=dt.util.xorBytes(p,m,o),l=m,++v,dt.util.setImmediate(I);h+=x<f?p:p.substr(0,u),++x,b()}b()}});var La=X((Fd,Ra)=>{var hr=W();ot();var Da=Ra.exports=hr.pem=hr.pem||{};Da.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r
9
- `,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=cr(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=cr(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=cr(n)),t.headers)for(var i=0;i<t.headers.length;++i)r+=cr(t.headers[i]);return t.procType&&(r+=`\r
10
- `),r+=hr.util.encode64(t.body,e.maxline||64)+`\r
8
+ `,t.composed){for(var s=0,o="",a=0;a<t.value.length;++a)t.value[a]!==void 0&&(s+=1,o+=T.prettyPrint(t.value[a],e+1,r),a+1<t.value.length&&(o+=","));n+=i+"Sub values: "+s+o}else{if(n+=i+"Value: ",t.type===T.Type.OID){var u=T.derToOid(t.value);n+=u,j.pki&&j.pki.oids&&u in j.pki.oids&&(n+=" ("+j.pki.oids[u]+") ")}if(t.type===T.Type.INTEGER)try{n+=T.derToInteger(t.value)}catch{n+="0x"+j.util.bytesToHex(t.value)}else if(t.type===T.Type.BITSTRING){if(t.value.length>1?n+="0x"+j.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(t.type===T.Type.OCTETSTRING)Ii.test(t.value)||(n+="("+t.value+") "),n+="0x"+j.util.bytesToHex(t.value);else if(t.type===T.Type.UTF8)try{n+=j.util.decodeUtf8(t.value)}catch(c){if(c.message==="URI malformed")n+="0x"+j.util.bytesToHex(t.value)+" (malformed UTF8)";else throw c}else t.type===T.Type.PRINTABLESTRING||t.type===T.Type.IA5String?n+=t.value:Ii.test(t.value)?n+="0x"+j.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var Di=X((ch,Ri)=>{var et=W();Cr();Tr();it();Ri.exports=et.des=et.des||{};et.des.startEncrypting=function(t,e,r,n){var i=We({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};et.des.createEncryptionCipher=function(t,e){return We({key:t,output:null,decrypt:!1,mode:e})};et.des.startDecrypting=function(t,e,r,n){var i=We({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};et.des.createDecryptionCipher=function(t,e){return We({key:t,output:null,decrypt:!0,mode:e})};et.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return _i(r._keys,n,i,!1)},decrypt:function(n,i){return _i(r._keys,n,i,!0)}}}),r._init=!1};et.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=et.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=Gs(e),this._init=!0}};Ct("DES-ECB",et.cipher.modes.ecb);Ct("DES-CBC",et.cipher.modes.cbc);Ct("DES-CFB",et.cipher.modes.cfb);Ct("DES-OFB",et.cipher.modes.ofb);Ct("DES-CTR",et.cipher.modes.ctr);Ct("3DES-ECB",et.cipher.modes.ecb);Ct("3DES-CBC",et.cipher.modes.cbc);Ct("3DES-CFB",et.cipher.modes.cfb);Ct("3DES-OFB",et.cipher.modes.ofb);Ct("3DES-CTR",et.cipher.modes.ctr);function Ct(t,e){var r=function(){return new et.des.Algorithm(t,e)};et.cipher.registerAlgorithm(t,r)}var Us=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],Ms=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],Fs=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],Os=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],Vs=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],qs=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],Qs=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],zs=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function Gs(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],c=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],l=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],m=t.length()>8?3:1,v=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],I=0,w,D=0;D<m;D++){var C=t.getInt32(),S=t.getInt32();w=(C>>>4^S)&252645135,S^=w,C^=w<<4,w=(S>>>-16^C)&65535,C^=w,S^=w<<-16,w=(C>>>2^S)&858993459,S^=w,C^=w<<2,w=(S>>>-16^C)&65535,C^=w,S^=w<<-16,w=(C>>>1^S)&1431655765,S^=w,C^=w<<1,w=(S>>>8^C)&16711935,C^=w,S^=w<<8,w=(C>>>1^S)&1431655765,S^=w,C^=w<<1,w=C<<8|S>>>20&240,C=S<<24|S<<8&16711680|S>>>8&65280|S>>>24&240,S=w;for(var N=0;N<b.length;++N){b[N]?(C=C<<2|C>>>26,S=S<<2|S>>>26):(C=C<<1|C>>>27,S=S<<1|S>>>27),C&=-15,S&=-15;var k=e[C>>>28]|r[C>>>24&15]|n[C>>>20&15]|i[C>>>16&15]|a[C>>>12&15]|s[C>>>8&15]|o[C>>>4&15],K=u[S>>>28]|f[S>>>24&15]|c[S>>>20&15]|h[S>>>16&15]|p[S>>>12&15]|g[S>>>8&15]|l[S>>>4&15];w=(K>>>16^k)&65535,v[I++]=k^w,v[I++]=K^w<<16}}return v}function _i(t,e,r,n){var i=t.length===32?3:9,a;i===3?a=n?[30,-2,-2]:[0,32,2]:a=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s,o=e[0],u=e[1];s=(o>>>4^u)&252645135,u^=s,o^=s<<4,s=(o>>>16^u)&65535,u^=s,o^=s<<16,s=(u>>>2^o)&858993459,o^=s,u^=s<<2,s=(u>>>8^o)&16711935,o^=s,u^=s<<8,s=(o>>>1^u)&1431655765,u^=s,o^=s<<1,o=o<<1|o>>>31,u=u<<1|u>>>31;for(var f=0;f<i;f+=3){for(var c=a[f+1],h=a[f+2],p=a[f];p!=c;p+=h){var g=u^t[p],l=(u>>>4|u<<28)^t[p+1];s=o,o=u,u=s^(Ms[g>>>24&63]|Os[g>>>16&63]|qs[g>>>8&63]|zs[g&63]|Us[l>>>24&63]|Fs[l>>>16&63]|Vs[l>>>8&63]|Qs[l&63])}s=o,o=u,u=s}o=o>>>1|o<<31,u=u>>>1|u<<31,s=(o>>>1^u)&1431655765,u^=s,o^=s<<1,s=(u>>>8^o)&16711935,o^=s,u^=s<<8,s=(u>>>2^o)&858993459,o^=s,u^=s<<2,s=(o>>>16^u)&65535,u^=s,o^=s<<16,s=(o>>>4^u)&252645135,u^=s,o^=s<<4,r[0]=o,r[1]=u}function We(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=et.cipher.createDecipher(r,t.key):n=et.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(a,s){var o=null;s instanceof et.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=a,i.call(n,s)},n}});var $t=X((hh,Ni)=>{var Je=W();Ni.exports=Je.md=Je.md||{};Je.md.algorithms=Je.md.algorithms||{}});var ki=X((lh,Li)=>{var Ut=W();$t();it();var Hs=Li.exports=Ut.hmac=Ut.hmac||{};Hs.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(a,s){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in Ut.md.algorithms)e=Ut.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else e=a;if(s===null)s=t;else{if(typeof s=="string")s=Ut.util.createBuffer(s);else if(Ut.util.isArray(s)){var o=s;s=Ut.util.createBuffer();for(var u=0;u<o.length;++u)s.putByte(o[u])}var f=s.length();f>e.blockLength&&(e.start(),e.update(s.bytes()),s=e.digest()),r=Ut.util.createBuffer(),n=Ut.util.createBuffer(),f=s.length();for(var u=0;u<f;++u){var o=s.at(u);r.putByte(54^o),n.putByte(92^o)}if(f<e.blockLength)for(var o=e.blockLength-f,u=0;u<o;++u)r.putByte(54),n.putByte(92);t=s,r=r.bytes(),n=n.bytes()}e.start(),e.update(r)},i.update=function(a){e.update(a)},i.getMac=function(){var a=e.digest().bytes();return e.start(),e.update(n),e.update(a),e.digest()},i.digest=i.getMac,i}});var $e=X(()=>{});var nn=X((yh,Pi)=>{var ht=W();ki();$t();it();var Ys=ht.pkcs5=ht.pkcs5||{},Mt;ht.util.isNodejs&&!ht.options.usePureJavaScript&&(Mt=$e());Pi.exports=ht.pbkdf2=Ys.pbkdf2=function(t,e,r,n,i,a){if(typeof i=="function"&&(a=i,i=null),ht.util.isNodejs&&!ht.options.usePureJavaScript&&Mt.pbkdf2&&(i===null||typeof i!="object")&&(Mt.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),a?Mt.pbkdf2Sync.length===4?Mt.pbkdf2(t,e,r,n,function(w,D){if(w)return a(w);a(null,D.toString("binary"))}):Mt.pbkdf2(t,e,r,n,i,function(w,D){if(w)return a(w);a(null,D.toString("binary"))}):Mt.pbkdf2Sync.length===4?Mt.pbkdf2Sync(t,e,r,n).toString("binary"):Mt.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in ht.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=ht.md[i].create()}var s=i.digestLength;if(n>4294967295*s){var o=new Error("Derived key is too long.");if(a)return a(o);throw o}var u=Math.ceil(n/s),f=n-(u-1)*s,c=ht.hmac.create();c.start(i,t);var h="",p,g,l;if(!a){for(var m=1;m<=u;++m){c.start(null,null),c.update(e),c.update(ht.util.int32ToBytes(m)),p=l=c.digest().getBytes();for(var v=2;v<=r;++v)c.start(null,null),c.update(l),g=c.digest().getBytes(),p=ht.util.xorBytes(p,g,s),l=g;h+=m<u?p:p.substr(0,f)}return h}var m=1,v;function b(){if(m>u)return a(null,h);c.start(null,null),c.update(e),c.update(ht.util.int32ToBytes(m)),p=l=c.digest().getBytes(),v=2,I()}function I(){if(v<=r)return c.start(null,null),c.update(l),g=c.digest().getBytes(),p=ht.util.xorBytes(p,g,s),l=g,++v,ht.util.setImmediate(I);h+=m<u?p:p.substr(0,f),++m,b()}b()}});var Mi=X((xh,Ui)=>{var Ze=W();it();var Ki=Ui.exports=Ze.pem=Ze.pem||{};Ki.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r
9
+ `,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=Xe(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Xe(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Xe(n)),t.headers)for(var i=0;i<t.headers.length;++i)r+=Xe(t.headers[i]);return t.procType&&(r+=`\r
10
+ `),r+=Ze.util.encode64(t.body,e.maxline||64)+`\r
11
11
  `,r+="-----END "+t.type+`-----\r
12
- `,r};Da.decode=function(t){for(var e=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/,a;a=r.exec(t),!!a;){var o=a[1];o==="NEW CERTIFICATE REQUEST"&&(o="CERTIFICATE REQUEST");var s={type:o,procType:null,contentDomain:null,dekInfo:null,headers:[],body:hr.util.decode64(a[3])};if(e.push(s),!!a[2]){for(var f=a[2].split(i),u=0;a&&u<f.length;){for(var c=f[u].replace(/\s+$/,""),h=u+1;h<f.length;++h){var p=f[h];if(!/\s/.test(p[0]))break;c+=p,u=h}if(a=c.match(n),a){for(var m={name:a[1],values:[]},l=a[2].split(","),x=0;x<l.length;++x)m.values.push(gf(l[x]));if(s.procType)if(!s.contentDomain&&m.name==="Content-Domain")s.contentDomain=l[0]||"";else if(!s.dekInfo&&m.name==="DEK-Info"){if(m.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');s.dekInfo={algorithm:l[0],parameters:l[1]||null}}else s.headers.push(m);else{if(m.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(m.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');s.procType={version:l[0],type:l[1]}}}++u}if(s.procType==="ENCRYPTED"&&!s.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(e.length===0)throw new Error("Invalid PEM formatted message.");return e};function cr(t){for(var e=t.name+": ",r=[],n=function(f,u){return" "+u},i=0;i<t.values.length;++i)r.push(t.values[i].replace(/^(\S+\r\n)/,n));e+=r.join(",")+`\r
13
- `;for(var a=0,o=-1,i=0;i<e.length;++i,++a)if(a>65&&o!==-1){var s=e[o];s===","?(++o,e=e.substr(0,o)+`\r
14
- `+e.substr(o)):e=e.substr(0,o)+`\r
15
- `+s+e.substr(o+1),a=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function gf(t){return t.replace(/^\s+/,"")}});var Ma=X((Od,Ka)=>{var It=W();Zt();ot();var ka=Ka.exports=It.sha256=It.sha256||{};It.md.sha256=It.md.algorithms.sha256=ka;ka.create=function(){Pa||mf();var t=null,e=It.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return e=It.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=It.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Na(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=It.util.createBuffer();i.putBytes(e.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(Bn.substr(0,n.blockLength-o));for(var s,f,u=n.fullMessageLength[0]*8,c=0;c<n.fullMessageLength.length-1;++c)s=n.fullMessageLength[c+1]*8,f=s/4294967296>>>0,u+=f,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};Na(h,r,i);var p=It.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},n};var Bn=null,Pa=!1,Ua=null;function mf(){Bn="\x80",Bn+=It.util.fillString("\0",64),Ua=[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],Pa=!0}function Na(t,e,r){for(var n,i,a,o,s,f,u,c,h,p,m,l,x,v,b,I=r.length();I>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=e[u-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(c=t.h0,h=t.h1,p=t.h2,m=t.h3,l=t.h4,x=t.h5,v=t.h6,b=t.h7,u=0;u<64;++u)o=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),s=v^l&(x^v),a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),f=c&h|p&(c^h),n=b+o+s+Ua[u]+e[u],i=a+f,b=v,v=x,x=l,l=m+n>>>0,m=p,p=h,h=c,c=n+i>>>0;t.h0=t.h0+c|0,t.h1=t.h1+h|0,t.h2=t.h2+p|0,t.h3=t.h3+m|0,t.h4=t.h4+l|0,t.h5=t.h5+x|0,t.h6=t.h6+v|0,t.h7=t.h7+b|0,I-=64}}});var Oa=X((Vd,Fa)=>{var Tt=W();ot();var lr=null;Tt.util.isNodejs&&!Tt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(lr=ur());var vf=Fa.exports=Tt.prng=Tt.prng||{};vf.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(u,c){if(!c)return e.generateSync(u);var h=e.plugin.cipher,p=e.plugin.increment,m=e.plugin.formatKey,l=e.plugin.formatSeed,x=Tt.util.createBuffer();e.key=null,v();function v(b){if(b)return c(b);if(x.length()>=u)return c(null,x.getBytes(u));if(e.generated>1048575&&(e.key=null),e.key===null)return Tt.util.nextTick(function(){a(v)});var I=h(e.key,e.seed);e.generated+=I.length,x.putBytes(I),e.key=m(h(e.key,p(e.seed))),e.seed=l(h(e.key,e.seed)),Tt.util.setImmediate(v)}},e.generateSync=function(u){var c=e.plugin.cipher,h=e.plugin.increment,p=e.plugin.formatKey,m=e.plugin.formatSeed;e.key=null;for(var l=Tt.util.createBuffer();l.length()<u;){e.generated>1048575&&(e.key=null),e.key===null&&o();var x=c(e.key,e.seed);e.generated+=x.length,l.putBytes(x),e.key=p(c(e.key,h(e.seed))),e.seed=m(c(e.key,e.seed))}return l.getBytes(u)};function a(u){if(e.pools[0].messageLength>=32)return s(),u();var c=32-e.pools[0].messageLength<<5;e.seedFile(c,function(h,p){if(h)return u(h);e.collect(p),s(),u()})}function o(){if(e.pools[0].messageLength>=32)return s();var u=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(u)),s()}function s(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var u=e.plugin.md.create();u.update(e.keyBytes);for(var c=1,h=0;h<32;++h)e.reseeds%c===0&&(u.update(e.pools[h].digest().getBytes()),e.pools[h].start()),c=c<<1;e.keyBytes=u.digest().getBytes(),u.start(),u.update(e.keyBytes);var p=u.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(p),e.generated=0}function f(u){var c=null,h=Tt.util.globalScope,p=h.crypto||h.msCrypto;p&&p.getRandomValues&&(c=function(S){return p.getRandomValues(S)});var m=Tt.util.createBuffer();if(c)for(;m.length()<u;){var l=Math.max(1,Math.min(u-m.length(),65536)/4),x=new Uint32Array(Math.floor(l));try{c(x);for(var v=0;v<x.length;++v)m.putInt32(x[v])}catch(S){if(!(typeof QuotaExceededError<"u"&&S instanceof QuotaExceededError))throw S}}if(m.length()<u)for(var b,I,w,T=Math.floor(Math.random()*65536);m.length()<u;){I=16807*(T&65535),b=16807*(T>>16),I+=(b&32767)<<16,I+=b>>15,I=(I&2147483647)+(I>>31),T=I&4294967295;for(var v=0;v<3;++v)w=T>>>(v<<3),w^=Math.floor(Math.random()*256),m.putByte(w&255)}return m.getBytes(u)}return lr?(e.seedFile=function(u,c){lr.randomBytes(u,function(h,p){if(h)return c(h);c(null,p.toString())})},e.seedFileSync=function(u){return lr.randomBytes(u).toString()}):(e.seedFile=function(u,c){try{c(null,f(u))}catch(h){c(h)}},e.seedFileSync=f),e.collect=function(u){for(var c=u.length,h=0;h<c;++h)e.pools[e.pool].update(u.substr(h,1)),e.pool=e.pool===31?0:e.pool+1},e.collectInt=function(u,c){for(var h="",p=0;p<c;p+=8)h+=String.fromCharCode(u>>p&255);e.collect(h)},e.registerWorker=function(u){if(u===self)e.seedFile=function(h,p){function m(l){var x=l.data;x.forge&&x.forge.prng&&(self.removeEventListener("message",m),p(x.forge.prng.err,x.forge.prng.bytes))}self.addEventListener("message",m),self.postMessage({forge:{prng:{needed:h}}})};else{var c=function(h){var p=h.data;p.forge&&p.forge.prng&&e.seedFile(p.forge.prng.needed,function(m,l){u.postMessage({forge:{prng:{err:m,bytes:l}}})})};u.addEventListener("message",c)}},e}});var Me=X((qd,Cn)=>{var ct=W();er();Ma();Oa();ot();(function(){if(ct.random&&ct.random.getBytes){Cn.exports=ct.random;return}(function(t){var e={},r=new Array(4),n=ct.util.createBuffer();e.formatKey=function(h){var p=ct.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),ct.aes._expandKey(h,!1)},e.formatSeed=function(h){var p=ct.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),h},e.cipher=function(h,p){return ct.aes._updateBlock(h,p,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=ct.md.sha256;function i(){var h=ct.prng.create(e);return h.getBytes=function(p,m){return h.generate(p,m)},h.getBytesSync=function(p){return h.generate(p)},h}var a=i(),o=null,s=ct.util.globalScope,f=s.crypto||s.msCrypto;if(f&&f.getRandomValues&&(o=function(h){return f.getRandomValues(h)}),ct.options.usePureJavaScript||!ct.util.isNodejs&&!o){if(typeof window>"u"||window.document,a.collectInt(+new Date,32),typeof navigator<"u"){var u="";for(var c in navigator)try{typeof navigator[c]=="string"&&(u+=navigator[c])}catch{}a.collect(u),u=null}t&&(t().mousemove(function(h){a.collectInt(h.clientX,16),a.collectInt(h.clientY,16)}),t().keypress(function(h){a.collectInt(h.charCode,8)}))}if(!ct.random)ct.random=a;else for(var c in a)ct.random[c]=a[c];ct.random.createInstance=i,Cn.exports=ct.random})(typeof jQuery<"u"?jQuery:null)})()});var Qa=X((zd,za)=>{var yt=W();ot();var In=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],Va=[1,2,3,5],bf=function(t,e){return t<<e&65535|(t&65535)>>16-e},Af=function(t,e){return(t&65535)>>e|t<<16-e&65535};za.exports=yt.rc2=yt.rc2||{};yt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=yt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,a=Math.ceil(i/8),o=255>>(i&7),s;for(s=n;s<128;s++)r.putByte(In[r.at(s-1)+r.at(s-n)&255]);for(r.setAt(128-a,In[r.at(128-a)&o]),s=127-a;s>=0;s--)r.setAt(s,In[r.at(s+1)^r.at(s+a)]);return r};var qa=function(t,e,r){var n=!1,i=null,a=null,o=null,s,f,u,c,h=[];for(t=yt.rc2.expandKey(t,e),u=0;u<64;u++)h.push(t.getInt16Le());r?(s=function(l){for(u=0;u<4;u++)l[u]+=h[c]+(l[(u+3)%4]&l[(u+2)%4])+(~l[(u+3)%4]&l[(u+1)%4]),l[u]=bf(l[u],Va[u]),c++},f=function(l){for(u=0;u<4;u++)l[u]+=h[l[(u+3)%4]&63]}):(s=function(l){for(u=3;u>=0;u--)l[u]=Af(l[u],Va[u]),l[u]-=h[c]+(l[(u+3)%4]&l[(u+2)%4])+(~l[(u+3)%4]&l[(u+1)%4]),c--},f=function(l){for(u=3;u>=0;u--)l[u]-=h[l[(u+3)%4]&63]});var p=function(l){var x=[];for(u=0;u<4;u++){var v=i.getInt16Le();o!==null&&(r?v^=o.getInt16Le():o.putInt16Le(v)),x.push(v&65535)}c=r?0:63;for(var b=0;b<l.length;b++)for(var I=0;I<l[b][0];I++)l[b][1](x);for(u=0;u<4;u++)o!==null&&(r?o.putInt16Le(x[u]):x[u]^=o.getInt16Le()),a.putInt16Le(x[u])},m=null;return m={start:function(l,x){l&&typeof l=="string"&&(l=yt.util.createBuffer(l)),n=!1,i=yt.util.createBuffer(),a=x||new yt.util.createBuffer,o=l,m.output=a},update:function(l){for(n||i.putBuffer(l);i.length()>=8;)p([[5,s],[1,f],[6,s],[1,f],[5,s]])},finish:function(l){var x=!0;if(r)if(l)x=l(8,i,!r);else{var v=i.length()===8?8:8-i.length();i.fillWithByte(v,v)}if(x&&(n=!0,m.update()),!r&&(x=i.length()===0,x))if(l)x=l(8,a,!r);else{var b=a.length(),I=a.at(b-1);I>b?x=!1:a.truncate(I)}return x}},m};yt.rc2.startEncrypting=function(t,e,r){var n=yt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};yt.rc2.createEncryptionCipher=function(t,e){return qa(t,e,!0)};yt.rc2.startDecrypting=function(t,e,r){var n=yt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};yt.rc2.createDecryptionCipher=function(t,e){return qa(t,e,!1)}});var yr=X((Qd,Za)=>{var Tn=W();Za.exports=Tn.jsbn=Tn.jsbn||{};var Ft,Ef=0xdeadbeefcafe,Ga=(Ef&16777215)==15715070;function E(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Tn.jsbn.BigInteger=E;function G(){return new E(null)}function wf(t,e,r,n,i,a){for(;--a>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Sf(t,e,r,n,i,a){for(var o=e&32767,s=e>>15;--a>=0;){var f=this.data[t]&32767,u=this.data[t++]>>15,c=s*f+u*o;f=o*f+((c&32767)<<15)+r.data[n]+(i&1073741823),i=(f>>>30)+(c>>>15)+s*u+(i>>>30),r.data[n++]=f&1073741823}return i}function Ha(t,e,r,n,i,a){for(var o=e&16383,s=e>>14;--a>=0;){var f=this.data[t]&16383,u=this.data[t++]>>14,c=s*f+u*o;f=o*f+((c&16383)<<14)+r.data[n]+i,i=(f>>28)+(c>>14)+s*u,r.data[n++]=f&268435455}return i}typeof navigator>"u"?(E.prototype.am=Ha,Ft=28):Ga&&navigator.appName=="Microsoft Internet Explorer"?(E.prototype.am=Sf,Ft=30):Ga&&navigator.appName!="Netscape"?(E.prototype.am=wf,Ft=26):(E.prototype.am=Ha,Ft=28);E.prototype.DB=Ft;E.prototype.DM=(1<<Ft)-1;E.prototype.DV=1<<Ft;var _n=52;E.prototype.FV=Math.pow(2,_n);E.prototype.F1=_n-Ft;E.prototype.F2=2*Ft-_n;var Bf="0123456789abcdefghijklmnopqrstuvwxyz",pr=new Array,ge,gt;ge=48;for(gt=0;gt<=9;++gt)pr[ge++]=gt;ge=97;for(gt=10;gt<36;++gt)pr[ge++]=gt;ge=65;for(gt=10;gt<36;++gt)pr[ge++]=gt;function Ya(t){return Bf.charAt(t)}function Wa(t,e){var r=pr[t.charCodeAt(e)];return r??-1}function Cf(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function If(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Gt(t){var e=G();return e.fromInt(t),e}function Tf(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,a=0;--n>=0;){var o=r==8?t[n]&255:Wa(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=o:a+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,a+=r,a>=this.DB&&(a-=this.DB)}r==8&&t[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&E.ZERO.subTo(this,this)}function _f(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t}function Df(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<<e)-1,n,i=!1,a="",o=this.t,s=this.DB-o*this.DB%e;if(o-- >0)for(s<this.DB&&(n=this.data[o]>>s)>0&&(i=!0,a=Ya(n));o>=0;)s<e?(n=(this.data[o]&(1<<s)-1)<<e-s,n|=this.data[--o]>>(s+=this.DB-e)):(n=this.data[o]>>(s-=e)&r,s<=0&&(s+=this.DB,--o)),n>0&&(i=!0),i&&(a+=Ya(n));return i?a:"0"}function Rf(){var t=G();return E.ZERO.subTo(this,t),t}function Lf(){return this.s<0?this.negate():this}function Nf(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function dr(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function kf(){return this.t<=0?0:this.DB*(this.t-1)+dr(this.data[this.t-1]^this.s&this.DM)}function Pf(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Uf(t,e){for(var r=t;r<this.t;++r)e.data[r-t]=this.data[r];e.t=Math.max(this.t-t,0),e.s=this.s}function Kf(t,e){var r=t%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(t/this.DB),o=this.s<<r&this.DM,s;for(s=this.t-1;s>=0;--s)e.data[s+a+1]=this.data[s]>>n|o,o=(this.data[s]&i)<<r;for(s=a-1;s>=0;--s)e.data[s]=0;e.data[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()}function Mf(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,a=(1<<n)-1;e.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)e.data[o-r-1]|=(this.data[o]&a)<<i,e.data[o-r]=this.data[o]>>n;n>0&&(e.data[this.t-r-1]|=(this.s&a)<<i),e.t=this.t-r,e.clamp()}function Ff(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]-t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function Of(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i<n.t;++i)e.data[i+r.t]=r.am(0,n.data[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&E.ZERO.subTo(e,e)}function Vf(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t.data[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e.data[r],t,2*r,0,1);(t.data[r+e.t]+=e.am(r+1,2*e.data[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function qf(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){e?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=G());var a=G(),o=this.s,s=t.s,f=this.DB-dr(n.data[n.t-1]);f>0?(n.lShiftTo(f,a),i.lShiftTo(f,r)):(n.copyTo(a),i.copyTo(r));var u=a.t,c=a.data[u-1];if(c!=0){var h=c*(1<<this.F1)+(u>1?a.data[u-2]>>this.F2:0),p=this.FV/h,m=(1<<this.F1)/h,l=1<<this.F2,x=r.t,v=x-u,b=e??G();for(a.dlShiftTo(v,b),r.compareTo(b)>=0&&(r.data[r.t++]=1,r.subTo(b,r)),E.ONE.dlShiftTo(u,b),b.subTo(a,a);a.t<u;)a.data[a.t++]=0;for(;--v>=0;){var I=r.data[--x]==c?this.DM:Math.floor(r.data[x]*p+(r.data[x-1]+l)*m);if((r.data[x]+=a.am(0,I,r,v,0,u))<I)for(a.dlShiftTo(v,b),r.subTo(b,r);r.data[x]<--I;)r.subTo(b,r)}e!=null&&(r.drShiftTo(u,e),o!=s&&E.ZERO.subTo(e,e)),r.t=u,r.clamp(),f>0&&r.rShiftTo(f,r),o<0&&E.ZERO.subTo(r,r)}}}function zf(t){var e=G();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(E.ZERO)>0&&t.subTo(e,e),e}function jt(t){this.m=t}function Qf(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Gf(t){return t}function Hf(t){t.divRemTo(this.m,null,t)}function Yf(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function Wf(t,e){t.squareTo(e),this.reduce(e)}jt.prototype.convert=Qf;jt.prototype.revert=Gf;jt.prototype.reduce=Hf;jt.prototype.mulTo=Yf;jt.prototype.sqrTo=Wf;function Jf(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function te(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function $f(t){var e=G();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(E.ZERO)>0&&this.m.subTo(e,e),e}function Xf(t){var e=G();return t.copyTo(e),this.reduce(e),e}function Zf(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=t.data[e]&32767,n=r*this.mpl+((r*this.mph+(t.data[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function jf(t,e){t.squareTo(e),this.reduce(e)}function tu(t,e,r){t.multiplyTo(e,r),this.reduce(r)}te.prototype.convert=$f;te.prototype.revert=Xf;te.prototype.reduce=Zf;te.prototype.mulTo=tu;te.prototype.sqrTo=jf;function eu(){return(this.t>0?this.data[0]&1:this.s)==0}function ru(t,e){if(t>4294967295||t<1)return E.ONE;var r=G(),n=G(),i=e.convert(this),a=dr(t)-1;for(i.copyTo(r);--a>=0;)if(e.sqrTo(r,n),(t&1<<a)>0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function nu(t,e){var r;return t<256||e.isEven()?r=new jt(e):r=new te(e),this.exp(t,r)}E.prototype.copyTo=Cf;E.prototype.fromInt=If;E.prototype.fromString=Tf;E.prototype.clamp=_f;E.prototype.dlShiftTo=Pf;E.prototype.drShiftTo=Uf;E.prototype.lShiftTo=Kf;E.prototype.rShiftTo=Mf;E.prototype.subTo=Ff;E.prototype.multiplyTo=Of;E.prototype.squareTo=Vf;E.prototype.divRemTo=qf;E.prototype.invDigit=Jf;E.prototype.isEven=eu;E.prototype.exp=ru;E.prototype.toString=Df;E.prototype.negate=Rf;E.prototype.abs=Lf;E.prototype.compareTo=Nf;E.prototype.bitLength=kf;E.prototype.mod=zf;E.prototype.modPowInt=nu;E.ZERO=Gt(0);E.ONE=Gt(1);function iu(){var t=G();return this.copyTo(t),t}function au(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function ou(){return this.t==0?this.s:this.data[0]<<24>>24}function su(){return this.t==0?this.s:this.data[0]<<16>>16}function fu(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function uu(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function cu(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Gt(r),i=G(),a=G(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(t)+o}function hu(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,a=0,o=0,s=0;s<t.length;++s){var f=Wa(t,s);if(f<0){t.charAt(s)=="-"&&this.signum()==0&&(i=!0);continue}o=e*o+f,++a>=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0)}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(o,0)),i&&E.ZERO.subTo(this,this)}function lu(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(E.ONE.shiftLeft(t-1),Dn,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(E.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function pu(){var t=this.t,e=new Array;e[0]=this.s;var r=this.DB-t*this.DB%8,n,i=0;if(t-- >0)for(r<this.DB&&(n=this.data[t]>>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<<this.DB-r);t>=0;)r<8?(n=(this.data[t]&(1<<r)-1)<<8-r,n|=this.data[--t]>>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function du(t){return this.compareTo(t)==0}function yu(t){return this.compareTo(t)<0?this:t}function xu(t){return this.compareTo(t)>0?this:t}function gu(t,e,r){var n,i,a=Math.min(t.t,this.t);for(n=0;n<a;++n)r.data[n]=e(this.data[n],t.data[n]);if(t.t<this.t){for(i=t.s&this.DM,n=a;n<this.t;++n)r.data[n]=e(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<t.t;++n)r.data[n]=e(i,t.data[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()}function mu(t,e){return t&e}function vu(t){var e=G();return this.bitwiseTo(t,mu,e),e}function Dn(t,e){return t|e}function bu(t){var e=G();return this.bitwiseTo(t,Dn,e),e}function Ja(t,e){return t^e}function Au(t){var e=G();return this.bitwiseTo(t,Ja,e),e}function $a(t,e){return t&~e}function Eu(t){var e=G();return this.bitwiseTo(t,$a,e),e}function wu(){for(var t=G(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t}function Su(t){var e=G();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function Bu(t){var e=G();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function Cu(t){if(t==0)return-1;var e=0;return t&65535||(t>>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Iu(){for(var t=0;t<this.t;++t)if(this.data[t]!=0)return t*this.DB+Cu(this.data[t]);return this.s<0?this.t*this.DB:-1}function Tu(t){for(var e=0;t!=0;)t&=t-1,++e;return e}function _u(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=Tu(this.data[r]^e);return t}function Du(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<t%this.DB)!=0}function Ru(t,e){var r=E.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r}function Lu(t){return this.changeBit(t,Dn)}function Nu(t){return this.changeBit(t,$a)}function ku(t){return this.changeBit(t,Ja)}function Pu(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]+t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Uu(t){var e=G();return this.addTo(t,e),e}function Ku(t){var e=G();return this.subTo(t,e),e}function Mu(t){var e=G();return this.multiplyTo(t,e),e}function Fu(t){var e=G();return this.divRemTo(t,e,null),e}function Ou(t){var e=G();return this.divRemTo(t,null,e),e}function Vu(t){var e=G(),r=G();return this.divRemTo(t,e,r),new Array(e,r)}function qu(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function zu(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function Fe(){}function Xa(t){return t}function Qu(t,e,r){t.multiplyTo(e,r)}function Gu(t,e){t.squareTo(e)}Fe.prototype.convert=Xa;Fe.prototype.revert=Xa;Fe.prototype.mulTo=Qu;Fe.prototype.sqrTo=Gu;function Hu(t){return this.exp(t,new Fe)}function Yu(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,t.data[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t.data[n],r,n,0,e-n);r.clamp()}function Wu(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r.data[this.t+n-e]=this.am(e-n,t.data[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)}function me(t){this.r2=G(),this.q3=G(),E.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function Ju(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=G();return t.copyTo(e),this.reduce(e),e}function $u(t){return t}function Xu(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function Zu(t,e){t.squareTo(e),this.reduce(e)}function ju(t,e,r){t.multiplyTo(e,r),this.reduce(r)}me.prototype.convert=Ju;me.prototype.revert=$u;me.prototype.reduce=Xu;me.prototype.mulTo=ju;me.prototype.sqrTo=Zu;function tc(t,e){var r=t.bitLength(),n,i=Gt(1),a;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?a=new jt(e):e.isEven()?a=new me(e):a=new te(e);var o=new Array,s=3,f=n-1,u=(1<<n)-1;if(o[1]=a.convert(this),n>1){var c=G();for(a.sqrTo(o[1],c);s<=u;)o[s]=G(),a.mulTo(c,o[s-2],o[s]),s+=2}var h=t.t-1,p,m=!0,l=G(),x;for(r=dr(t.data[h])-1;h>=0;){for(r>=f?p=t.data[h]>>r-f&u:(p=(t.data[h]&(1<<r+1)-1)<<f-r,h>0&&(p|=t.data[h-1]>>this.DB+r-f)),s=n;!(p&1);)p>>=1,--s;if((r-=s)<0&&(r+=this.DB,--h),m)o[p].copyTo(i),m=!1;else{for(;s>1;)a.sqrTo(i,l),a.sqrTo(l,i),s-=2;s>0?a.sqrTo(i,l):(x=i,i=l,l=x),a.mulTo(l,o[p],i)}for(;h>=0&&!(t.data[h]&1<<r);)a.sqrTo(i,l),x=i,i=l,l=x,--r<0&&(r=this.DB-1,--h)}return a.revert(i)}function ec(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return e;for(i<a&&(a=i),a>0&&(e.rShiftTo(a,e),r.rShiftTo(a,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r}function rc(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function nc(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return E.ZERO;for(var r=t.clone(),n=this.clone(),i=Gt(1),a=Gt(0),o=Gt(0),s=Gt(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),a.subTo(s,a)):(n.subTo(r,n),e&&o.subTo(i,o),s.subTo(a,s))}if(n.compareTo(E.ONE)!=0)return E.ZERO;if(s.compareTo(t)>=0)return s.subtract(t);if(s.signum()<0)s.addTo(t,s);else return s;return s.signum()<0?s.add(t):s}var wt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],ic=(1<<26)/wt[wt.length-1];function ac(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=wt[wt.length-1]){for(e=0;e<wt.length;++e)if(r.data[0]==wt[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<wt.length;){for(var n=wt[e],i=e+1;i<wt.length&&n<ic;)n*=wt[i++];for(n=r.modInt(n);e<i;)if(n%wt[e++]==0)return!1}return r.millerRabin(t)}function oc(t){var e=this.subtract(E.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n=e.shiftRight(r),i=sc(),a,o=0;o<t;++o){do a=new E(this.bitLength(),i);while(a.compareTo(E.ONE)<=0||a.compareTo(e)>=0);var s=a.modPow(n,this);if(s.compareTo(E.ONE)!=0&&s.compareTo(e)!=0){for(var f=1;f++<r&&s.compareTo(e)!=0;)if(s=s.modPowInt(2,this),s.compareTo(E.ONE)==0)return!1;if(s.compareTo(e)!=0)return!1}}return!0}function sc(){return{nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(Math.random()*256)}}}E.prototype.chunkSize=fu;E.prototype.toRadix=cu;E.prototype.fromRadix=hu;E.prototype.fromNumber=lu;E.prototype.bitwiseTo=gu;E.prototype.changeBit=Ru;E.prototype.addTo=Pu;E.prototype.dMultiply=qu;E.prototype.dAddOffset=zu;E.prototype.multiplyLowerTo=Yu;E.prototype.multiplyUpperTo=Wu;E.prototype.modInt=rc;E.prototype.millerRabin=oc;E.prototype.clone=iu;E.prototype.intValue=au;E.prototype.byteValue=ou;E.prototype.shortValue=su;E.prototype.signum=uu;E.prototype.toByteArray=pu;E.prototype.equals=du;E.prototype.min=yu;E.prototype.max=xu;E.prototype.and=vu;E.prototype.or=bu;E.prototype.xor=Au;E.prototype.andNot=Eu;E.prototype.not=wu;E.prototype.shiftLeft=Su;E.prototype.shiftRight=Bu;E.prototype.getLowestSetBit=Iu;E.prototype.bitCount=_u;E.prototype.testBit=Du;E.prototype.setBit=Lu;E.prototype.clearBit=Nu;E.prototype.flipBit=ku;E.prototype.add=Uu;E.prototype.subtract=Ku;E.prototype.multiply=Mu;E.prototype.divide=Fu;E.prototype.remainder=Ou;E.prototype.divideAndRemainder=Vu;E.prototype.modPow=tc;E.prototype.modInverse=nc;E.prototype.pow=Hu;E.prototype.gcd=ec;E.prototype.isProbablePrime=ac});var no=X((Gd,ro)=>{var _t=W();Zt();ot();var to=ro.exports=_t.sha1=_t.sha1||{};_t.md.sha1=_t.md.algorithms.sha1=to;to.create=function(){eo||fc();var t=null,e=_t.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return e=_t.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=_t.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),ja(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=_t.util.createBuffer();i.putBytes(e.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(Rn.substr(0,n.blockLength-o));for(var s,f,u=n.fullMessageLength[0]*8,c=0;c<n.fullMessageLength.length-1;++c)s=n.fullMessageLength[c+1]*8,f=s/4294967296>>>0,u+=f,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};ja(h,r,i);var p=_t.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},n};var Rn=null,eo=!1;function fc(){Rn="\x80",Rn+=_t.util.fillString("\0",64),eo=!0}function ja(t,e,r){for(var n,i,a,o,s,f,u,c,h=r.length();h>=64;){for(i=t.h0,a=t.h1,o=t.h2,s=t.h3,f=t.h4,c=0;c<16;++c)n=r.getInt32(),e[c]=n,u=s^a&(o^s),n=(i<<5|i>>>27)+u+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=e[c-3]^e[c-8]^e[c-14]^e[c-16],n=n<<1|n>>>31,e[c]=n,u=s^a&(o^s),n=(i<<5|i>>>27)+u+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=e[c-3]^e[c-8]^e[c-14]^e[c-16],n=n<<1|n>>>31,e[c]=n,u=a^o^s,n=(i<<5|i>>>27)+u+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=e[c-6]^e[c-16]^e[c-28]^e[c-32],n=n<<2|n>>>30,e[c]=n,u=a^o^s,n=(i<<5|i>>>27)+u+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=e[c-6]^e[c-16]^e[c-28]^e[c-32],n=n<<2|n>>>30,e[c]=n,u=a&o|s&(a^o),n=(i<<5|i>>>27)+u+f+2400959708+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=e[c-6]^e[c-16]^e[c-28]^e[c-32],n=n<<2|n>>>30,e[c]=n,u=a^o^s,n=(i<<5|i>>>27)+u+f+3395469782+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+a|0,t.h2=t.h2+o|0,t.h3=t.h3+s|0,t.h4=t.h4+f|0,h-=64}}});var oo=X((Hd,ao)=>{var Dt=W();ot();Me();no();var io=ao.exports=Dt.pkcs1=Dt.pkcs1||{};io.encode_rsa_oaep=function(t,e,r){var n,i,a,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,a=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),a?a.start():a=Dt.md.sha1.create(),o||(o=a);var s=Math.ceil(t.n.bitLength()/8),f=s-2*a.digestLength-2;if(e.length>f){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=e.length,u.maxLength=f,u}n||(n=""),a.update(n,"raw");for(var c=a.digest(),h="",p=f-e.length,m=0;m<p;m++)h+="\0";var l=c.getBytes()+h+""+e;if(!i)i=Dt.random.getBytes(a.digestLength);else if(i.length!==a.digestLength){var u=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw u.seedLength=i.length,u.digestLength=a.digestLength,u}var x=xr(i,s-a.digestLength-1,o),v=Dt.util.xorBytes(l,x,l.length),b=xr(v,a.digestLength,o),I=Dt.util.xorBytes(i,b,i.length);return"\0"+I+v};io.decode_rsa_oaep=function(t,e,r){var n,i,a;typeof r=="string"?(n=r,i=arguments[3]||void 0):r&&(n=r.label||void 0,i=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var v=new Error("RSAES-OAEP encoded message length is invalid.");throw v.length=e.length,v.expectedLength=o,v}if(i===void 0?i=Dt.md.sha1.create():i.start(),a||(a=i),o<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),i.update(n,"raw");for(var s=i.digest().getBytes(),f=e.charAt(0),u=e.substring(1,i.digestLength+1),c=e.substring(1+i.digestLength),h=xr(c,i.digestLength,a),p=Dt.util.xorBytes(u,h,u.length),m=xr(p,o-i.digestLength-1,a),l=Dt.util.xorBytes(c,m,c.length),x=l.substring(0,i.digestLength),v=f!=="\0",b=0;b<i.digestLength;++b)v|=s.charAt(b)!==x.charAt(b);for(var I=1,w=i.digestLength,T=i.digestLength;T<l.length;T++){var S=l.charCodeAt(T),C=S&1^1,L=I?65534:0;v|=S&L,I=I&C,w+=I}if(v||l.charCodeAt(w)!==1)throw new Error("Invalid RSAES-OAEP padding.");return l.substring(w+1)};function xr(t,e,r){r||(r=Dt.md.sha1.create());for(var n="",i=Math.ceil(e/r.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var so=X((Yd,Ln)=>{var Ht=W();ot();yr();Me();(function(){if(Ht.prime){Ln.exports=Ht.prime;return}var t=Ln.exports=Ht.prime=Ht.prime||{},e=Ht.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,p){return h|p};t.generateProbablePrime=function(h,p,m){typeof p=="function"&&(m=p,p={}),p=p||{};var l=p.algorithm||"PRIMEINC";typeof l=="string"&&(l={name:l}),l.options=l.options||{};var x=p.prng||Ht.random,v={nextBytes:function(b){for(var I=x.getBytesSync(b.length),w=0;w<b.length;++w)b[w]=I.charCodeAt(w)}};if(l.name==="PRIMEINC")return a(h,v,l.options,m);throw new Error("Invalid prime generation algorithm: "+l.name)};function a(h,p,m,l){return"workers"in m?f(h,p,m,l):o(h,p,m,l)}function o(h,p,m,l){var x=u(h,p),v=0,b=c(x.bitLength());"millerRabinTests"in m&&(b=m.millerRabinTests);var I=10;"maxBlockTime"in m&&(I=m.maxBlockTime),s(x,h,p,v,b,I,l)}function s(h,p,m,l,x,v,b){var I=+new Date;do{if(h.bitLength()>p&&(h=u(p,m)),h.isProbablePrime(x))return b(null,h);h.dAddOffset(r[l++%8],0)}while(v<0||+new Date-I<v);Ht.util.setImmediate(function(){s(h,p,m,l,x,v,b)})}function f(h,p,m,l){if(typeof Worker>"u")return o(h,p,m,l);var x=u(h,p),v=m.workers,b=m.workLoad||100,I=b*30/8,w=m.workerScript||"forge/prime.worker.js";if(v===-1)return Ht.util.estimateCores(function(S,C){S&&(C=2),v=C-1,T()});T();function T(){v=Math.max(1,v);for(var S=[],C=0;C<v;++C)S[C]=new Worker(w);for(var L=v,C=0;C<v;++C)S[C].addEventListener("message",P);var N=!1;function P(q){if(!N){--L;var O=q.data;if(O.found){for(var F=0;F<S.length;++F)S[F].terminate();return N=!0,l(null,new e(O.prime,16))}x.bitLength()>h&&(x=u(h,p));var H=x.toString(16);q.target.postMessage({hex:H,workLoad:b}),x.dAddOffset(I,0)}}}}function u(h,p){var m=new e(h,p),l=h-1;return m.testBit(l)||m.bitwiseTo(e.ONE.shiftLeft(l),i,m),m.dAddOffset(31-m.mod(n).byteValue(),0),m}function c(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var mr=X((Wd,yo)=>{var k=W();Ke();yr();ar();oo();so();Me();ot();typeof Q>"u"&&(Q=k.jsbn.BigInteger);var Q,Nn=k.util.isNodejs?ur():null,g=k.asn1,mt=k.util;k.pki=k.pki||{};yo.exports=k.pki.rsa=k.rsa=k.rsa||{};var U=k.pki,uc=[6,4,2,4,2,4,6,2],cc={name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},hc={name:"RSAPrivateKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},lc={name:"RSAPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},pc=k.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},dc={name:"DigestInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:g.Class.UNIVERSAL,type:g.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:g.Class.UNIVERSAL,type:g.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},yc=function(t){var e;if(t.algorithm in U.oids)e=U.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=g.oidToDer(e).getBytes(),i=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),a=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);a.value.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,n)),a.value.push(g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,""));var o=g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(a),i.value.push(o),g.toDer(i).getBytes()},lo=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(Q.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Q.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Q(k.util.bytesToHex(k.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Q.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),a=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(a)<0;)i=i.add(e.p);var o=i.subtract(a).multiply(e.qInv).mod(e.p).multiply(e.q).add(a);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};U.rsa.encrypt=function(t,e,r){var n=r,i,a=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=po(t,e,r)):(i=k.util.createBuffer(),i.putBytes(t));for(var o=new Q(i.toHex(),16),s=lo(o,e,n),f=s.toString(16),u=k.util.createBuffer(),c=a-Math.ceil(f.length/2);c>0;)u.putByte(0),--c;return u.putBytes(k.util.hexToBytes(f)),u.getBytes()};U.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=t.length,a.expected=i,a}var o=new Q(k.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=lo(o,e,r),f=s.toString(16),u=k.util.createBuffer(),c=i-Math.ceil(f.length/2);c>0;)u.putByte(0),--c;return u.putBytes(k.util.hexToBytes(f)),n!==!1?gr(u.getBytes(),e,r):u.getBytes()};U.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||k.random,i={nextBytes:function(s){for(var f=n.getBytesSync(s.length),u=0;u<s.length;++u)s[u]=f.charCodeAt(u)}},a=r.algorithm||"PRIMEINC",o;if(a==="PRIMEINC")o={algorithm:a,state:0,bits:t,rng:i,eInt:e||65537,e:new Q(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+a);return o};U.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new Q(null);r.fromInt(30);for(var n=0,i=function(h,p){return h|p},a=+new Date,o,s=0;t.keys===null&&(e<=0||s<e);){if(t.state===0){var f=t.p===null?t.pBits:t.qBits,u=f-1;t.pqState===0?(t.num=new Q(f,t.rng),t.num.testBit(u)||t.num.bitwiseTo(Q.ONE.shiftLeft(u),i,t.num),t.num.dAddOffset(31-t.num.mod(r).byteValue(),0),n=0,++t.pqState):t.pqState===1?t.num.bitLength()>f?t.pqState=0:t.num.isProbablePrime(gc(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(uc[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(Q.ONE).gcd(t.e).compareTo(Q.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(Q.ONE),t.q1=t.q.subtract(Q.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(Q.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var c=t.e.modInverse(t.phi);t.keys={privateKey:U.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:U.rsa.setPublicKey(t.n,t.e)}}o=+new Date,s+=o-a,a=o}return t.keys!==null};U.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!k.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(fo("generateKeyPair"))return Nn.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(s,f,u){if(s)return n(s);n(null,{privateKey:U.privateKeyFromPem(u),publicKey:U.publicKeyFromPem(f)})});if(uo("generateKey")&&uo("exportKey"))return mt.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:ho(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(s){return mt.globalScope.crypto.subtle.exportKey("pkcs8",s.privateKey)}).then(void 0,function(s){n(s)}).then(function(s){if(s){var f=U.privateKeyFromAsn1(g.fromDer(k.util.createBuffer(s)));n(null,{privateKey:f,publicKey:U.setRsaPublicKey(f.n,f.e)})}});if(co("generateKey")&&co("exportKey")){var i=mt.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:ho(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(s){var f=s.target.result,u=mt.globalScope.msCrypto.subtle.exportKey("pkcs8",f.privateKey);u.oncomplete=function(c){var h=c.target.result,p=U.privateKeyFromAsn1(g.fromDer(k.util.createBuffer(h)));n(null,{privateKey:p,publicKey:U.setRsaPublicKey(p.n,p.e)})},u.onerror=function(c){n(c)}},i.onerror=function(s){n(s)};return}}else if(fo("generateKeyPairSync")){var a=Nn.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:U.privateKeyFromPem(a.privateKey),publicKey:U.publicKeyFromPem(a.publicKey)}}}var o=U.rsa.createKeyPairGenerationState(t,e,r);if(!n)return U.rsa.stepKeyPairGenerationState(o,0),o.keys;xc(o,r,n)};U.setRsaPublicKey=U.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(s,f,u){return po(s,f,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(s,f){return k.pkcs1.encode_rsa_oaep(f,s,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(s){return s}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return U.rsa.encrypt(o,r,!0)},r.verify=function(n,i,a,o){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(f,u){u=gr(u,r,!0);var c=g.fromDer(u,{parseAllBytes:o._parseAllDigestBytes}),h={},p=[];if(!g.validate(c,dc,h,p)){var m=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw m.errors=p,m}var l=g.derToOid(h.algorithmIdentifier);if(!(l===k.oids.md2||l===k.oids.md5||l===k.oids.sha1||l===k.oids.sha224||l===k.oids.sha256||l===k.oids.sha384||l===k.oids.sha512||l===k.oids["sha512-224"]||l===k.oids["sha512-256"])){var m=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw m.oid=l,m}if((l===k.oids.md2||l===k.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return f===h.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(f,u){return u=gr(u,r,!0),f===u}});var s=U.rsa.decrypt(i,r,!0,!1);return a.verify(n,s,r.n.bitLength())},r};U.setRsaPrivateKey=U.rsa.setPrivateKey=function(t,e,r,n,i,a,o,s){var f={n:t,e,d:r,p:n,q:i,dP:a,dQ:o,qInv:s};return f.decrypt=function(u,c,h){typeof c=="string"?c=c.toUpperCase():c===void 0&&(c="RSAES-PKCS1-V1_5");var p=U.rsa.decrypt(u,f,!1,!1);if(c==="RSAES-PKCS1-V1_5")c={decode:gr};else if(c==="RSA-OAEP"||c==="RSAES-OAEP")c={decode:function(m,l){return k.pkcs1.decode_rsa_oaep(l,m,h)}};else if(["RAW","NONE","NULL",null].indexOf(c)!==-1)c={decode:function(m){return m}};else throw new Error('Unsupported encryption scheme: "'+c+'".');return c.decode(p,f,!1)},f.sign=function(u,c){var h=!1;typeof c=="string"&&(c=c.toUpperCase()),c===void 0||c==="RSASSA-PKCS1-V1_5"?(c={encode:yc},h=1):(c==="NONE"||c==="NULL"||c===null)&&(c={encode:function(){return u}},h=1);var p=c.encode(u,f.n.bitLength());return U.rsa.encrypt(p,f,h)},f};U.wrapRsaPrivateKey=function(t){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(U.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,g.toDer(t).getBytes())])};U.privateKeyFromAsn1=function(t){var e={},r=[];if(g.validate(t,cc,e,r)&&(t=g.fromDer(k.util.createBuffer(e.privateKey))),e={},r=[],!g.validate(t,hc,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,a,o,s,f,u,c,h;return i=k.util.createBuffer(e.privateKeyModulus).toHex(),a=k.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=k.util.createBuffer(e.privateKeyPrivateExponent).toHex(),s=k.util.createBuffer(e.privateKeyPrime1).toHex(),f=k.util.createBuffer(e.privateKeyPrime2).toHex(),u=k.util.createBuffer(e.privateKeyExponent1).toHex(),c=k.util.createBuffer(e.privateKeyExponent2).toHex(),h=k.util.createBuffer(e.privateKeyCoefficient).toHex(),U.setRsaPrivateKey(new Q(i,16),new Q(a,16),new Q(o,16),new Q(s,16),new Q(f,16),new Q(u,16),new Q(c,16),new Q(h,16))};U.privateKeyToAsn1=U.privateKeyToRSAPrivateKey=function(t){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.e)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.d)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.p)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.q)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.dP)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.dQ)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.qInv))])};U.publicKeyFromAsn1=function(t){var e={},r=[];if(g.validate(t,pc,e,r)){var n=g.derToOid(e.publicKeyOid);if(n!==U.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!g.validate(t,lc,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var a=k.util.createBuffer(e.publicKeyModulus).toHex(),o=k.util.createBuffer(e.publicKeyExponent).toHex();return U.setRsaPublicKey(new Q(a,16),new Q(o,16))};U.publicKeyToAsn1=U.publicKeyToSubjectPublicKeyInfo=function(t){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(U.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,[U.publicKeyToRSAPublicKey(t)])])};U.publicKeyToRSAPublicKey=function(t){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,Rt(t.e))])};function po(t,e,r){var n=k.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var o=i-3-t.length,s;if(r===0||r===1){s=r===0?0:255;for(var f=0;f<o;++f)n.putByte(s)}else for(;o>0;){for(var u=0,c=k.random.getBytes(o),f=0;f<o;++f)s=c.charCodeAt(f),s===0?++u:n.putByte(s);o=u}return n.putByte(0),n.putBytes(t),n}function gr(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8),a=k.util.createBuffer(t),o=a.getByte(),s=a.getByte();if(o!==0||r&&s!==0&&s!==1||!r&&s!=2||r&&s===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var f=0;if(s===0){f=i-3-n;for(var u=0;u<f;++u)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(s===1)for(f=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++f}else if(s===2)for(f=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++f}var c=a.getByte();if(c!==0||f!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function xc(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){a(t.pBits,function(s,f){if(s)return r(s);if(t.p=f,t.q!==null)return o(s,t.q);a(t.qBits,o)})}function a(s,f){k.prime.generateProbablePrime(s,n,f)}function o(s,f){if(s)return r(s);if(t.q=f,t.p.compareTo(t.q)<0){var u=t.p;t.p=t.q,t.q=u}if(t.p.subtract(Q.ONE).gcd(t.e).compareTo(Q.ONE)!==0){t.p=null,i();return}if(t.q.subtract(Q.ONE).gcd(t.e).compareTo(Q.ONE)!==0){t.q=null,a(t.qBits,o);return}if(t.p1=t.p.subtract(Q.ONE),t.q1=t.q.subtract(Q.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(Q.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,a(t.qBits,o);return}var c=t.e.modInverse(t.phi);t.keys={privateKey:U.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:U.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function Rt(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=k.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function gc(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function fo(t){return k.util.isNodejs&&typeof Nn[t]=="function"}function uo(t){return typeof mt.globalScope<"u"&&typeof mt.globalScope.crypto=="object"&&typeof mt.globalScope.crypto.subtle=="object"&&typeof mt.globalScope.crypto.subtle[t]=="function"}function co(t){return typeof mt.globalScope<"u"&&typeof mt.globalScope.msCrypto=="object"&&typeof mt.globalScope.msCrypto.subtle=="object"&&typeof mt.globalScope.msCrypto.subtle[t]=="function"}function ho(t){for(var e=k.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}});var Ao=X((Jd,bo)=>{var R=W();er();Ke();Ba();Zt();ar();Sn();La();Me();Qa();mr();ot();typeof xo>"u"&&(xo=R.jsbn.BigInteger);var xo,A=R.asn1,K=R.pki=R.pki||{};bo.exports=K.pbe=R.pbe=R.pbe||{};var ee=K.oids,mc={name:"EncryptedPrivateKeyInfo",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},vc={name:"PBES2Algorithms",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},bc={name:"pkcs-12PbeParams",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"iterations"}]};K.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=R.random.getBytesSync(r.saltSize),i=r.count,a=A.integerToDer(i),o,s,f;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var u,c,h;switch(r.algorithm){case"aes128":o=16,u=16,c=ee["aes128-CBC"],h=R.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,c=ee["aes192-CBC"],h=R.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,c=ee["aes256-CBC"],h=R.aes.createEncryptionCipher;break;case"des":o=8,u=8,c=ee.desCBC,h=R.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),l=vo(m),x=R.pkcs5.pbkdf2(e,n,i,o,l),v=R.random.getBytesSync(u),b=h(x);b.start(v),b.update(A.toDer(t)),b.finish(),f=b.output.getBytes();var I=Ac(n,a,o,m);s=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(ee.pkcs5PBES2).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(ee.pkcs5PBKDF2).getBytes()),I]),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(c).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,v)])])])}else if(r.algorithm==="3des"){o=24;var w=new R.util.ByteBuffer(n),x=K.pbe.generatePkcs12Key(e,w,1,i,o),v=K.pbe.generatePkcs12Key(e,w,2,i,o),b=R.des.createEncryptionCipher(x);b.start(v),b.update(A.toDer(t)),b.finish(),f=b.output.getBytes(),s=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(ee["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,n),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,a.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var T=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[s,A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,f)]);return T};K.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!A.validate(t,mc,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=A.derToOid(n.encryptionOid),s=K.pbe.getCipher(o,n.encryptionParams,e),f=R.util.createBuffer(n.encryptedData);return s.update(f),s.finish()&&(r=A.fromDer(s.output)),r};K.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:A.toDer(t).getBytes()};return R.pem.encode(r,{maxline:e})};K.encryptedPrivateKeyFromPem=function(t){var e=R.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return A.fromDer(e.body)};K.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=K.wrapRsaPrivateKey(K.privateKeyToAsn1(t));return n=K.encryptPrivateKeyInfo(n,e,r),K.encryptedPrivateKeyToPem(n)}var i,a,o,s;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,a=R.random.getBytesSync(16),s=R.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=R.random.getBytesSync(16),s=R.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=R.random.getBytesSync(16),s=R.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=R.random.getBytesSync(8),s=R.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=R.random.getBytesSync(8),s=R.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var u=R.pbe.opensslDeriveBytes(e,a.substr(0,8),o),c=s(u);c.start(a),c.update(A.toDer(K.privateKeyToAsn1(t))),c.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:R.util.bytesToHex(a).toUpperCase()},body:c.output.getBytes()};return R.pem.encode(h)};K.decryptRsaPrivateKey=function(t,e){var r=null,n=R.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var a,o;switch(n.dekInfo.algorithm){case"DES-CBC":a=8,o=R.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,o=R.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,o=R.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,o=R.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,o=R.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,o=function(h){return R.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":a=8,o=function(h){return R.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":a=16,o=function(h){return R.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var s=R.util.hexToBytes(n.dekInfo.parameters),f=R.pbe.opensslDeriveBytes(e,s.substr(0,8),a),u=o(f);if(u.start(s),u.update(R.util.createBuffer(n.body)),u.finish())r=u.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=K.decryptPrivateKeyInfo(A.fromDer(r),e):r=A.fromDer(r),r!==null&&(r=K.privateKeyFromAsn1(r)),r};K.pbe.generatePkcs12Key=function(t,e,r,n,i,a){var o,s;if(typeof a>"u"||a===null){if(!("sha1"in R.md))throw new Error('"sha1" hash algorithm unavailable.');a=R.md.sha1.create()}var f=a.digestLength,u=a.blockLength,c=new R.util.ByteBuffer,h=new R.util.ByteBuffer;if(t!=null){for(s=0;s<t.length;s++)h.putInt16(t.charCodeAt(s));h.putInt16(0)}var p=h.length(),m=e.length(),l=new R.util.ByteBuffer;l.fillWithByte(r,u);var x=u*Math.ceil(m/u),v=new R.util.ByteBuffer;for(s=0;s<x;s++)v.putByte(e.at(s%m));var b=u*Math.ceil(p/u),I=new R.util.ByteBuffer;for(s=0;s<b;s++)I.putByte(h.at(s%p));var w=v;w.putBuffer(I);for(var T=Math.ceil(i/f),S=1;S<=T;S++){var C=new R.util.ByteBuffer;C.putBytes(l.bytes()),C.putBytes(w.bytes());for(var L=0;L<n;L++)a.start(),a.update(C.getBytes()),C=a.digest();var N=new R.util.ByteBuffer;for(s=0;s<u;s++)N.putByte(C.at(s%f));var P=Math.ceil(m/u)+Math.ceil(p/u),q=new R.util.ByteBuffer;for(o=0;o<P;o++){var O=new R.util.ByteBuffer(w.getBytes(u)),F=511;for(s=N.length()-1;s>=0;s--)F=F>>8,F+=N.at(s)+O.at(s),O.setAt(s,F&255);q.putBuffer(O)}w=q,c.putBuffer(C)}return c.truncate(c.length()-i),c};K.pbe.getCipher=function(t,e,r){switch(t){case K.oids.pkcs5PBES2:return K.pbe.getCipherForPBES2(t,e,r);case K.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case K.oids["pbewithSHAAnd40BitRC2-CBC"]:return K.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};K.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!A.validate(e,vc,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(t=A.derToOid(n.kdfOid),t!==K.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=t,a.supportedOids=["pkcs5PBKDF2"],a}if(t=A.derToOid(n.encOid),t!==K.oids["aes128-CBC"]&&t!==K.oids["aes192-CBC"]&&t!==K.oids["aes256-CBC"]&&t!==K.oids["des-EDE3-CBC"]&&t!==K.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=t,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var o=n.kdfSalt,s=R.util.createBuffer(n.kdfIterationCount);s=s.getInt(s.length()<<3);var f,u;switch(K.oids[t]){case"aes128-CBC":f=16,u=R.aes.createDecryptionCipher;break;case"aes192-CBC":f=24,u=R.aes.createDecryptionCipher;break;case"aes256-CBC":f=32,u=R.aes.createDecryptionCipher;break;case"des-EDE3-CBC":f=24,u=R.des.createDecryptionCipher;break;case"desCBC":f=8,u=R.des.createDecryptionCipher;break}var c=mo(n.prfOid),h=R.pkcs5.pbkdf2(r,o,s,f,c),p=n.encIv,m=u(h);return m.start(p),m};K.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!A.validate(e,bc,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=R.util.createBuffer(n.salt),s=R.util.createBuffer(n.iterations);s=s.getInt(s.length()<<3);var f,u,c;switch(t){case K.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:f=24,u=8,c=R.des.startDecrypting;break;case K.oids["pbewithSHAAnd40BitRC2-CBC"]:f=5,u=8,c=function(x,v){var b=R.rc2.createDecryptionCipher(x,40);return b.start(v,null),b};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=t,a}var h=mo(n.prfOid),p=K.pbe.generatePkcs12Key(r,o,1,s,f,h);h.start();var m=K.pbe.generatePkcs12Key(r,o,2,s,u,h);return c(p,m)};K.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in R.md))throw new Error('"md5" hash algorithm unavailable.');n=R.md.md5.create()}e===null&&(e="");for(var i=[go(n,t+e)],a=16,o=1;a<r;++o,a+=16)i.push(go(n,i[o-1]+t+e));return i.join("").substr(0,r)};function go(t,e){return t.start().update(e).digest().getBytes()}function mo(t){var e;if(!t)e="hmacWithSHA1";else if(e=K.oids[A.derToOid(t)],!e){var r=new Error("Unsupported PRF OID.");throw r.oid=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}return vo(e)}function vo(t){var e=R.md;switch(t){case"hmacWithSHA224":e=R.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":t=t.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!e||!(t in e))throw new Error("Unknown hash algorithm: "+t);return e[t].create()}function Ac(t,e,r,n){var i=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,t),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,e.getBytes())]);return n!=="hmacWithSHA1"&&i.value.push(A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,R.util.hexToBytes(r.toString(16))),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(K.oids[n]).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.NULL,!1,"")])),i}});var os=X((px,as)=>{var et=W();Zt();ot();var Ye=as.exports=et.sha512=et.sha512||{};et.md.sha512=et.md.algorithms.sha512=Ye;var ns=et.sha384=et.sha512.sha384=et.sha512.sha384||{};ns.create=function(){return Ye.create("SHA-384")};et.md.sha384=et.md.algorithms.sha384=ns;et.sha512.sha256=et.sha512.sha256||{create:function(){return Ye.create("SHA-512/256")}};et.md["sha512/256"]=et.md.algorithms["sha512/256"]=et.sha512.sha256;et.sha512.sha224=et.sha512.sha224||{create:function(){return Ye.create("SHA-512/224")}};et.md["sha512/224"]=et.md.algorithms["sha512/224"]=et.sha512.sha224;Ye.create=function(t){if(is||Gh(),typeof t>"u"&&(t="SHA-512"),!(t in oe))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=oe[t],r=null,n=et.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var s={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var f=s.messageLengthSize/4,u=0;u<f;++u)s.fullMessageLength.push(0);n=et.util.createBuffer(),r=new Array(e.length);for(var u=0;u<e.length;++u)r[u]=e[u].slice(0);return s},s.start(),s.update=function(f,u){u==="utf8"&&(f=et.util.encodeUtf8(f));var c=f.length;s.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var h=s.fullMessageLength.length-1;h>=0;--h)s.fullMessageLength[h]+=c[1],c[1]=c[0]+(s.fullMessageLength[h]/4294967296>>>0),s.fullMessageLength[h]=s.fullMessageLength[h]>>>0,c[0]=c[1]/4294967296>>>0;return n.putBytes(f),rs(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),s},s.digest=function(){var f=et.util.createBuffer();f.putBytes(n.bytes());var u=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,c=u&s.blockLength-1;f.putBytes(mi.substr(0,s.blockLength-c));for(var h,p,m=s.fullMessageLength[0]*8,l=0;l<s.fullMessageLength.length-1;++l)h=s.fullMessageLength[l+1]*8,p=h/4294967296>>>0,m+=p,f.putInt32(m>>>0),m=h>>>0;f.putInt32(m);for(var x=new Array(r.length),l=0;l<r.length;++l)x[l]=r[l].slice(0);rs(x,i,f);var v=et.util.createBuffer(),b;t==="SHA-512"?b=x.length:t==="SHA-384"?b=x.length-2:b=x.length-4;for(var l=0;l<b;++l)v.putInt32(x[l][0]),(l!==b-1||t!=="SHA-512/224")&&v.putInt32(x[l][1]);return v},s};var mi=null,is=!1,vi=null,oe=null;function Gh(){mi="\x80",mi+=et.util.fillString("\0",128),vi=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],oe={},oe["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],oe["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],oe["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],oe["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],is=!0}function rs(t,e,r){for(var n,i,a,o,s,f,u,c,h,p,m,l,x,v,b,I,w,T,S,C,L,N,P,q,O,F,H,J,M,z,D,nt,$,d,Pt,Ni=r.length();Ni>=128;){for(M=0;M<16;++M)e[M][0]=r.getInt32()>>>0,e[M][1]=r.getInt32()>>>0;for(;M<80;++M)nt=e[M-2],z=nt[0],D=nt[1],n=((z>>>19|D<<13)^(D>>>29|z<<3)^z>>>6)>>>0,i=((z<<13|D>>>19)^(D<<3|z>>>29)^(z<<26|D>>>6))>>>0,d=e[M-15],z=d[0],D=d[1],a=((z>>>1|D<<31)^(z>>>8|D<<24)^z>>>7)>>>0,o=((z<<31|D>>>1)^(z<<24|D>>>8)^(z<<25|D>>>7))>>>0,$=e[M-7],Pt=e[M-16],D=i+$[1]+o+Pt[1],e[M][0]=n+$[0]+a+Pt[0]+(D/4294967296>>>0)>>>0,e[M][1]=D>>>0;for(x=t[0][0],v=t[0][1],b=t[1][0],I=t[1][1],w=t[2][0],T=t[2][1],S=t[3][0],C=t[3][1],L=t[4][0],N=t[4][1],P=t[5][0],q=t[5][1],O=t[6][0],F=t[6][1],H=t[7][0],J=t[7][1],M=0;M<80;++M)u=((L>>>14|N<<18)^(L>>>18|N<<14)^(N>>>9|L<<23))>>>0,c=((L<<18|N>>>14)^(L<<14|N>>>18)^(N<<23|L>>>9))>>>0,h=(O^L&(P^O))>>>0,p=(F^N&(q^F))>>>0,s=((x>>>28|v<<4)^(v>>>2|x<<30)^(v>>>7|x<<25))>>>0,f=((x<<4|v>>>28)^(v<<30|x>>>2)^(v<<25|x>>>7))>>>0,m=(x&b|w&(x^b))>>>0,l=(v&I|T&(v^I))>>>0,D=J+c+p+vi[M][1]+e[M][1],n=H+u+h+vi[M][0]+e[M][0]+(D/4294967296>>>0)>>>0,i=D>>>0,D=f+l,a=s+m+(D/4294967296>>>0)>>>0,o=D>>>0,H=O,J=F,O=P,F=q,P=L,q=N,D=C+i,L=S+n+(D/4294967296>>>0)>>>0,N=D>>>0,S=w,C=T,w=b,T=I,b=x,I=v,D=i+o,x=n+a+(D/4294967296>>>0)>>>0,v=D>>>0;D=t[0][1]+v,t[0][0]=t[0][0]+x+(D/4294967296>>>0)>>>0,t[0][1]=D>>>0,D=t[1][1]+I,t[1][0]=t[1][0]+b+(D/4294967296>>>0)>>>0,t[1][1]=D>>>0,D=t[2][1]+T,t[2][0]=t[2][0]+w+(D/4294967296>>>0)>>>0,t[2][1]=D>>>0,D=t[3][1]+C,t[3][0]=t[3][0]+S+(D/4294967296>>>0)>>>0,t[3][1]=D>>>0,D=t[4][1]+N,t[4][0]=t[4][0]+L+(D/4294967296>>>0)>>>0,t[4][1]=D>>>0,D=t[5][1]+q,t[5][0]=t[5][0]+P+(D/4294967296>>>0)>>>0,t[5][1]=D>>>0,D=t[6][1]+F,t[6][0]=t[6][0]+O+(D/4294967296>>>0)>>>0,t[6][1]=D>>>0,D=t[7][1]+J,t[7][0]=t[7][0]+H+(D/4294967296>>>0)>>>0,t[7][1]=D>>>0,Ni-=128}}});var Bs=X((m2,Ss)=>{var pl=(t,e)=>function(){return e||(0,t[Object.keys(t)[0]])((e={exports:{}}).exports,e),e.exports},dl=(()=>{for(var t=new Uint8Array(128),e=0;e<64;e++)t[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;return r=>{for(var n=r.length,i=new Uint8Array((n-(r[n-1]=="=")-(r[n-2]=="="))*3/4|0),a=0,o=0;a<n;){var s=t[r.charCodeAt(a++)],f=t[r.charCodeAt(a++)],u=t[r.charCodeAt(a++)],c=t[r.charCodeAt(a++)];i[o++]=s<<2|f>>4,i[o++]=f<<4|u>>2,i[o++]=u<<6|c}return i}})(),yl=pl({"wasm-binary:./xsalsa20.wat"(t,e){e.exports=dl("AGFzbQEAAAABGgNgBn9/f39/fwBgBn9/f39+fwF+YAN/f38AAwcGAAEBAgICBQUBAQroBwcoAwZtZW1vcnkCAAx4c2Fsc2EyMF94b3IAAAxjb3JlX3NhbHNhMjAABArqEQYYACAAIAEgAiADIAQgACkDACAFEAE3AwALPQBB8AAgAyAFEAMgACABIAIgA0EQaiAEQfAAEAJB8ABCADcDAEH4AEIANwMAQYABQgA3AwBBiAFCADcDAAuHBQEBfyACQQBGBEBCAA8LQdAAIAUpAwA3AwBB2AAgBUEIaikDADcDAEHgACAFQRBqKQMANwMAQegAIAVBGGopAwA3AwBBACADKQMANwMAQQggBDcDAAJAA0AgAkHAAEkNAUEQQQBB0AAQBSAAIAEpAwBBECkDAIU3AwAgAEEIaiABQQhqKQMAQRgpAwCFNwMAIABBEGogAUEQaikDAEEgKQMAhTcDACAAQRhqIAFBGGopAwBBKCkDAIU3AwAgAEEgaiABQSBqKQMAQTApAwCFNwMAIABBKGogAUEoaikDAEE4KQMAhTcDACAAQTBqIAFBMGopAwBBwAApAwCFNwMAIABBOGogAUE4aikDAEHIACkDAIU3AwBBCEEIKQMAQgF8NwMAIABBwABqIQAgAUHAAGohASACQcAAayECDAALC0EIKQMAIQQgAkEASwRAQRBBAEHQABAFAkACQAJAAkACQAJAAkACQCACQQhuDgcHBgUEAwIBAAsgAEE4aiABQThqKQMAQcgAKQMAhTcDAAsgAEEwaiABQTBqKQMAQcAAKQMAhTcDAAsgAEEoaiABQShqKQMAQTgpAwCFNwMACyAAQSBqIAFBIGopAwBBMCkDAIU3AwALIABBGGogAUEYaikDAEEoKQMAhTcDAAsgAEEQaiABQRBqKQMAQSApAwCFNwMACyAAQQhqIAFBCGopAwBBGCkDAIU3AwALIAAgASkDAEEQKQMAhTcDAAtBEEIANwMAQRhCADcDAEEgQgA3AwBBKEIANwMAQTBCADcDAEE4QgA3AwBBwABCADcDAEHIAEIANwMAQdAAQgA3AwBB2ABCADcDAEHgAEIANwMAQegAQgA3AwAgBA8LnQUBEX9B5fDBiwYhA0HuyIGZAyEIQbLaiMsHIQ1B9MqB2QYhEiACKAIAIQQgAkEEaigCACEFIAJBCGooAgAhBiACQQxqKAIAIQcgAkEQaigCACEOIAJBFGooAgAhDyACQRhqKAIAIRAgAkEcaigCACERIAEoAgAhCSABQQRqKAIAIQogAUEIaigCACELIAFBDGooAgAhDEEUIRMCQANAIBNBAEYNASAHIAMgD2pBB3dzIQcgCyAHIANqQQl3cyELIA8gCyAHakENd3MhDyADIA8gC2pBEndzIQMgDCAIIARqQQd3cyEMIBAgDCAIakEJd3MhECAEIBAgDGpBDXdzIQQgCCAEIBBqQRJ3cyEIIBEgDSAJakEHd3MhESAFIBEgDWpBCXdzIQUgCSAFIBFqQQ13cyEJIA0gCSAFakESd3MhDSAGIBIgDmpBB3dzIQYgCiAGIBJqQQl3cyEKIA4gCiAGakENd3MhDiASIA4gCmpBEndzIRIgBCADIAZqQQd3cyEEIAUgBCADakEJd3MhBSAGIAUgBGpBDXdzIQYgAyAGIAVqQRJ3cyEDIAkgCCAHakEHd3MhCSAKIAkgCGpBCXdzIQogByAKIAlqQQ13cyEHIAggByAKakESd3MhCCAOIA0gDGpBB3dzIQ4gCyAOIA1qQQl3cyELIAwgCyAOakENd3MhDCANIAwgC2pBEndzIQ0gDyASIBFqQQd3cyEPIBAgDyASakEJd3MhECARIBAgD2pBDXdzIREgEiARIBBqQRJ3cyESIBNBAmshEwwACwsgACADNgIAIABBBGogCDYCACAAQQhqIA02AgAgAEEMaiASNgIAIABBEGogCTYCACAAQRRqIAo2AgAgAEEYaiALNgIAIABBHGogDDYCAAsKACAAIAEgAhAFC90GASF/QeXwwYsGIQNB7siBmQMhCEGy2ojLByENQfTKgdkGIRIgAigCACEEIAJBBGooAgAhBSACQQhqKAIAIQYgAkEMaigCACEHIAJBEGooAgAhDiACQRRqKAIAIQ8gAkEYaigCACEQIAJBHGooAgAhESABKAIAIQkgAUEEaigCACEKIAFBCGooAgAhCyABQQxqKAIAIQwgAyETIAQhFCAFIRUgBiEWIAchFyAIIRggCSEZIAohGiALIRsgDCEcIA0hHSAOIR4gDyEfIBAhICARISEgEiEiQRQhIwJAA0AgI0EARg0BIAcgAyAPakEHd3MhByALIAcgA2pBCXdzIQsgDyALIAdqQQ13cyEPIAMgDyALakESd3MhAyAMIAggBGpBB3dzIQwgECAMIAhqQQl3cyEQIAQgECAMakENd3MhBCAIIAQgEGpBEndzIQggESANIAlqQQd3cyERIAUgESANakEJd3MhBSAJIAUgEWpBDXdzIQkgDSAJIAVqQRJ3cyENIAYgEiAOakEHd3MhBiAKIAYgEmpBCXdzIQogDiAKIAZqQQ13cyEOIBIgDiAKakESd3MhEiAEIAMgBmpBB3dzIQQgBSAEIANqQQl3cyEFIAYgBSAEakENd3MhBiADIAYgBWpBEndzIQMgCSAIIAdqQQd3cyEJIAogCSAIakEJd3MhCiAHIAogCWpBDXdzIQcgCCAHIApqQRJ3cyEIIA4gDSAMakEHd3MhDiALIA4gDWpBCXdzIQsgDCALIA5qQQ13cyEMIA0gDCALakESd3MhDSAPIBIgEWpBB3dzIQ8gECAPIBJqQQl3cyEQIBEgECAPakENd3MhESASIBEgEGpBEndzIRIgI0ECayEjDAALCyAAIAMgE2o2AgAgAEEEaiAEIBRqNgIAIABBCGogBSAVajYCACAAQQxqIAYgFmo2AgAgAEEQaiAHIBdqNgIAIABBFGogCCAYajYCACAAQRhqIAkgGWo2AgAgAEEcaiAKIBpqNgIAIABBIGogCyAbajYCACAAQSRqIAwgHGo2AgAgAEEoaiANIB1qNgIAIABBLGogDiAeajYCACAAQTBqIA8gH2o2AgAgAEE0aiAQICBqNgIAIABBOGogESAhajYCACAAQTxqIBIgImo2AgAL")}}),xl=yl(),gl=new WebAssembly.Module(xl);Ss.exports=t=>new WebAssembly.Instance(gl,t).exports});var _s=X((v2,Ts)=>{var Je=typeof WebAssembly<"u"&&Bs()(),Mr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),Nt=144,Te=Nt,Kr=[];Ts.exports=kt;kt.NONCEBYTES=24;kt.KEYBYTES=32;kt.core_hsalsa20=Is;kt.SIGMA=Mr;function kt(t,e){if(!(this instanceof kt))return new kt(t,e);if(!t||t.length<24)throw new Error("nonce must be at least 24 bytes");if(!e||e.length<32)throw new Error("key must be at least 32 bytes");this._xor=Je?new Fr(t,e):new Ii(t,e)}kt.prototype.update=function(t,e){if(!t)throw new Error("input must be Uint8Array or Buffer");return e||(e=new Uint8Array(t.length)),t.length&&this._xor.update(t,e),e};kt.prototype.final=kt.prototype.finalize=function(){this._xor.finalize(),this._xor=null};function Fr(t,e){Kr.length||(Kr.push(Nt),Nt+=64),this._pointer=Kr.pop(),this._nonce=this._pointer+8,this._key=this._nonce+24,this._overflow=0,this._memory=new Uint8Array(Je.memory.buffer),this._memory.fill(0,this._pointer,this._pointer+8),this._memory.set(t,this._nonce),this._memory.set(e,this._key)}Fr.prototype.realloc=function(t){Je.memory.grow(Math.ceil(Math.abs(t-this._memory.length)/65536)),this._memory=new Uint8Array(Je.memory.buffer)};Fr.prototype.update=function(t,e){var r=this._overflow+t.length,n=Nt+this._overflow;Te=Nt+r,Te>=this._memory.length&&this.realloc(Te),this._memory.set(t,n),Je.xsalsa20_xor(this._pointer,Nt,Nt,r,this._nonce,this._key),e.set(this._memory.subarray(n,Nt+r)),this._overflow=r&63};Fr.prototype.finalize=function(){this._memory.fill(0,this._pointer,this._key+32),Te>Nt&&(this._memory.fill(0,Nt,Te),Te=0),Kr.push(this._pointer)};function Ii(t,e){this._s=new Uint8Array(32),this._z=new Uint8Array(16),this._overflow=0,Is(this._s,t,e,Mr);for(var r=0;r<8;r++)this._z[r]=t[r+16]}Ii.prototype.update=function(t,e){for(var r=new Uint8Array(64),n=0,i=this._overflow,a=t.length+this._overflow,o=this._z,s=-this._overflow,f=-this._overflow;a>=64;){for(Cs(r,o,this._s,Mr);i<64;i++)e[f+i]=t[s+i]^r[i];for(n=1,i=8;i<16;i++)n+=o[i]&255|0,o[i]=n&255,n>>>=8;a-=64,f+=64,s+=64,i=0}if(a>0)for(Cs(r,o,this._s,Mr);i<a;i++)e[f+i]=t[s+i]^r[i];this._overflow=a&63};Ii.prototype.finalize=function(){this._s.fill(0),this._z.fill(0)};function Cs(t,e,r,n){for(var i=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,a=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,o=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,s=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,f=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,u=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,c=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,h=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,p=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,m=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,l=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,x=r[16]&255|(r[17]&255)<<8|(r[18]&255)<<16|(r[19]&255)<<24,v=r[20]&255|(r[21]&255)<<8|(r[22]&255)<<16|(r[23]&255)<<24,b=r[24]&255|(r[25]&255)<<8|(r[26]&255)<<16|(r[27]&255)<<24,I=r[28]&255|(r[29]&255)<<8|(r[30]&255)<<16|(r[31]&255)<<24,w=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,T=i,S=a,C=o,L=s,N=f,P=u,q=c,O=h,F=p,H=m,J=l,M=x,z=v,D=b,nt=I,$=w,d,Pt=0;Pt<20;Pt+=2)d=T+z|0,N^=d<<7|d>>>25,d=N+T|0,F^=d<<9|d>>>23,d=F+N|0,z^=d<<13|d>>>19,d=z+F|0,T^=d<<18|d>>>14,d=P+S|0,H^=d<<7|d>>>25,d=H+P|0,D^=d<<9|d>>>23,d=D+H|0,S^=d<<13|d>>>19,d=S+D|0,P^=d<<18|d>>>14,d=J+q|0,nt^=d<<7|d>>>25,d=nt+J|0,C^=d<<9|d>>>23,d=C+nt|0,q^=d<<13|d>>>19,d=q+C|0,J^=d<<18|d>>>14,d=$+M|0,L^=d<<7|d>>>25,d=L+$|0,O^=d<<9|d>>>23,d=O+L|0,M^=d<<13|d>>>19,d=M+O|0,$^=d<<18|d>>>14,d=T+L|0,S^=d<<7|d>>>25,d=S+T|0,C^=d<<9|d>>>23,d=C+S|0,L^=d<<13|d>>>19,d=L+C|0,T^=d<<18|d>>>14,d=P+N|0,q^=d<<7|d>>>25,d=q+P|0,O^=d<<9|d>>>23,d=O+q|0,N^=d<<13|d>>>19,d=N+O|0,P^=d<<18|d>>>14,d=J+H|0,M^=d<<7|d>>>25,d=M+J|0,F^=d<<9|d>>>23,d=F+M|0,H^=d<<13|d>>>19,d=H+F|0,J^=d<<18|d>>>14,d=$+nt|0,z^=d<<7|d>>>25,d=z+$|0,D^=d<<9|d>>>23,d=D+z|0,nt^=d<<13|d>>>19,d=nt+D|0,$^=d<<18|d>>>14;T=T+i|0,S=S+a|0,C=C+o|0,L=L+s|0,N=N+f|0,P=P+u|0,q=q+c|0,O=O+h|0,F=F+p|0,H=H+m|0,J=J+l|0,M=M+x|0,z=z+v|0,D=D+b|0,nt=nt+I|0,$=$+w|0,t[0]=T>>>0&255,t[1]=T>>>8&255,t[2]=T>>>16&255,t[3]=T>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=C>>>0&255,t[9]=C>>>8&255,t[10]=C>>>16&255,t[11]=C>>>24&255,t[12]=L>>>0&255,t[13]=L>>>8&255,t[14]=L>>>16&255,t[15]=L>>>24&255,t[16]=N>>>0&255,t[17]=N>>>8&255,t[18]=N>>>16&255,t[19]=N>>>24&255,t[20]=P>>>0&255,t[21]=P>>>8&255,t[22]=P>>>16&255,t[23]=P>>>24&255,t[24]=q>>>0&255,t[25]=q>>>8&255,t[26]=q>>>16&255,t[27]=q>>>24&255,t[28]=O>>>0&255,t[29]=O>>>8&255,t[30]=O>>>16&255,t[31]=O>>>24&255,t[32]=F>>>0&255,t[33]=F>>>8&255,t[34]=F>>>16&255,t[35]=F>>>24&255,t[36]=H>>>0&255,t[37]=H>>>8&255,t[38]=H>>>16&255,t[39]=H>>>24&255,t[40]=J>>>0&255,t[41]=J>>>8&255,t[42]=J>>>16&255,t[43]=J>>>24&255,t[44]=M>>>0&255,t[45]=M>>>8&255,t[46]=M>>>16&255,t[47]=M>>>24&255,t[48]=z>>>0&255,t[49]=z>>>8&255,t[50]=z>>>16&255,t[51]=z>>>24&255,t[52]=D>>>0&255,t[53]=D>>>8&255,t[54]=D>>>16&255,t[55]=D>>>24&255,t[56]=nt>>>0&255,t[57]=nt>>>8&255,t[58]=nt>>>16&255,t[59]=nt>>>24&255,t[60]=$>>>0&255,t[61]=$>>>8&255,t[62]=$>>>16&255,t[63]=$>>>24&255}function Is(t,e,r,n){for(var i=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,a=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,o=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,s=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,f=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,u=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,c=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,h=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,p=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,m=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,l=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,x=r[16]&255|(r[17]&255)<<8|(r[18]&255)<<16|(r[19]&255)<<24,v=r[20]&255|(r[21]&255)<<8|(r[22]&255)<<16|(r[23]&255)<<24,b=r[24]&255|(r[25]&255)<<8|(r[26]&255)<<16|(r[27]&255)<<24,I=r[28]&255|(r[29]&255)<<8|(r[30]&255)<<16|(r[31]&255)<<24,w=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,T=i,S=a,C=o,L=s,N=f,P=u,q=c,O=h,F=p,H=m,J=l,M=x,z=v,D=b,nt=I,$=w,d,Pt=0;Pt<20;Pt+=2)d=T+z|0,N^=d<<7|d>>>25,d=N+T|0,F^=d<<9|d>>>23,d=F+N|0,z^=d<<13|d>>>19,d=z+F|0,T^=d<<18|d>>>14,d=P+S|0,H^=d<<7|d>>>25,d=H+P|0,D^=d<<9|d>>>23,d=D+H|0,S^=d<<13|d>>>19,d=S+D|0,P^=d<<18|d>>>14,d=J+q|0,nt^=d<<7|d>>>25,d=nt+J|0,C^=d<<9|d>>>23,d=C+nt|0,q^=d<<13|d>>>19,d=q+C|0,J^=d<<18|d>>>14,d=$+M|0,L^=d<<7|d>>>25,d=L+$|0,O^=d<<9|d>>>23,d=O+L|0,M^=d<<13|d>>>19,d=M+O|0,$^=d<<18|d>>>14,d=T+L|0,S^=d<<7|d>>>25,d=S+T|0,C^=d<<9|d>>>23,d=C+S|0,L^=d<<13|d>>>19,d=L+C|0,T^=d<<18|d>>>14,d=P+N|0,q^=d<<7|d>>>25,d=q+P|0,O^=d<<9|d>>>23,d=O+q|0,N^=d<<13|d>>>19,d=N+O|0,P^=d<<18|d>>>14,d=J+H|0,M^=d<<7|d>>>25,d=M+J|0,F^=d<<9|d>>>23,d=F+M|0,H^=d<<13|d>>>19,d=H+F|0,J^=d<<18|d>>>14,d=$+nt|0,z^=d<<7|d>>>25,d=z+$|0,D^=d<<9|d>>>23,d=D+z|0,nt^=d<<13|d>>>19,d=nt+D|0,$^=d<<18|d>>>14;t[0]=T>>>0&255,t[1]=T>>>8&255,t[2]=T>>>16&255,t[3]=T>>>24&255,t[4]=P>>>0&255,t[5]=P>>>8&255,t[6]=P>>>16&255,t[7]=P>>>24&255,t[8]=J>>>0&255,t[9]=J>>>8&255,t[10]=J>>>16&255,t[11]=J>>>24&255,t[12]=$>>>0&255,t[13]=$>>>8&255,t[14]=$>>>16&255,t[15]=$>>>24&255,t[16]=q>>>0&255,t[17]=q>>>8&255,t[18]=q>>>16&255,t[19]=q>>>24&255,t[20]=O>>>0&255,t[21]=O>>>8&255,t[22]=O>>>16&255,t[23]=O>>>24&255,t[24]=F>>>0&255,t[25]=F>>>8&255,t[26]=F>>>16&255,t[27]=F>>>24&255,t[28]=H>>>0&255,t[29]=H>>>8&255,t[30]=H>>>16&255,t[31]=H>>>24&255}});var vl={};j(vl,{generateKey:()=>Ns,preSharedKey:()=>ml});var Al=Symbol.for("@libp2p/connection");var wl=Symbol.for("@libp2p/content-routing");var Cl=Symbol.for("@libp2p/peer-discovery");var Tl=Symbol.for("@libp2p/peer-id");var Dl=Symbol.for("@libp2p/peer-routing");var Pi;(function(t){t.Accept="accept",t.Ignore="ignore",t.Reject="reject"})(Pi||(Pi={}));var kl=Symbol.for("@libp2p/transport");var Ui;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(Ui||(Ui={}));var ht=class extends Error{code;props;constructor(e,r,n){super(e),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};var Or=class extends Event{detail;constructor(e,r){super(e,r),this.detail=r?.detail}},Kl=globalThis.CustomEvent??Or;var vd=st(er(),1),ef=st(W(),1);function rr(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var rn={};j(rn,{base10:()=>e0});var Ep=new Uint8Array(0);function Xi(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function Ut(t){if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")}function Zi(t){return new TextEncoder().encode(t)}function ji(t){return new TextDecoder().decode(t)}function $s(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=t.length,f=t.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var x=0,v=0,b=0,I=l.length;b!==I&&l[b]===0;)b++,x++;for(var w=(I-b)*c+1>>>0,T=new Uint8Array(w);b!==I;){for(var S=l[b],C=0,L=w-1;(S!==0||C<v)&&L!==-1;L--,C++)S+=256*T[L]>>>0,T[L]=S%s>>>0,S=S/s>>>0;if(S!==0)throw new Error("Non-zero carry");v=C,b++}for(var N=w-v;N!==w&&T[N]===0;)N++;for(var P=f.repeat(x);N<w;++N)P+=t.charAt(T[N]);return P}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var x=0;if(l[x]!==" "){for(var v=0,b=0;l[x]===f;)v++,x++;for(var I=(l.length-x)*u+1>>>0,w=new Uint8Array(I);l[x];){var T=r[l.charCodeAt(x)];if(T===255)return;for(var S=0,C=I-1;(T!==0||S<b)&&C!==-1;C--,S++)T+=s*w[C]>>>0,w[C]=T%256>>>0,T=T/256>>>0;if(T!==0)throw new Error("Non-zero carry");b=S,x++}if(l[x]!==" "){for(var L=I-b;L!==I&&w[L]===0;)L++;for(var N=new Uint8Array(v+(I-L)),P=v;L!==I;)N[P++]=w[L++];return N}}}function m(l){var x=p(l);if(x)return x;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:p,decode:m}}var Xs=$s,Zs=Xs,ea=Zs;var Zr=class{name;prefix;baseEncode;constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},jr=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ra(this,e)}},tn=class{decoders;constructor(e){this.decoders=e}or(e){return ra(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function ra(t,e){return new tn({...t.decoders??{[t.prefix]:t},...e.decoders??{[e.prefix]:e}})}var en=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Zr(e,r,n),this.decoder=new jr(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function ue({name:t,prefix:e,encode:r,decode:n}){return new en(t,e,r,n)}function Qt({name:t,prefix:e,alphabet:r}){let{encode:n,decode:i}=ea(r,t);return ue({prefix:e,name:t,encode:n,decode:a=>Ut(i(a))})}function js(t,e,r,n){let i={};for(let c=0;c<e.length;++c)i[e[c]]=c;let a=t.length;for(;t[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,u=0;for(let c=0;c<a;++c){let h=i[t[c]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[u++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o}function t0(t,e,r){let n=e[e.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<t.length;++f)for(s=s<<8|t[f],o+=8;o>r;)o-=r,a+=e[i&s>>o];if(o!==0&&(a+=e[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a}function it({name:t,prefix:e,bitsPerChar:r,alphabet:n}){return ue({prefix:e,name:t,encode(i){return t0(i,n,r)},decode(i){return js(i,n,r,t)}})}var e0=Qt({prefix:"9",name:"base10",alphabet:"0123456789"});var nn={};j(nn,{base16:()=>r0,base16upper:()=>n0});var r0=it({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),n0=it({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var an={};j(an,{base2:()=>i0});var i0=it({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var on={};j(on,{base256emoji:()=>u0});var na=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),a0=na.reduce((t,e,r)=>(t[r]=e,t),[]),o0=na.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function s0(t){return t.reduce((e,r)=>(e+=a0[r],e),"")}function f0(t){let e=[];for(let r of t){let n=o0[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var u0=ue({prefix:"\u{1F680}",name:"base256emoji",encode:s0,decode:f0});var sn={};j(sn,{base32:()=>ce,base32hex:()=>p0,base32hexpad:()=>y0,base32hexpadupper:()=>x0,base32hexupper:()=>d0,base32pad:()=>h0,base32padupper:()=>l0,base32upper:()=>c0,base32z:()=>g0});var ce=it({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),c0=it({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),h0=it({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),l0=it({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),p0=it({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),d0=it({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),y0=it({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),x0=it({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),g0=it({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var fn={};j(fn,{base36:()=>m0,base36upper:()=>v0});var m0=Qt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),v0=Qt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var un={};j(un,{base58btc:()=>Et,base58flickr:()=>b0});var Et=Qt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),b0=Qt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var hn={};j(hn,{base64:()=>cn,base64pad:()=>A0,base64url:()=>E0,base64urlpad:()=>w0});var cn=it({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),A0=it({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),E0=it({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),w0=it({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ln={};j(ln,{base8:()=>S0});var S0=it({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var pn={};j(pn,{identity:()=>B0});var B0=ue({prefix:"\0",name:"identity",encode:t=>ji(t),decode:t=>Zi(t)});var Mp=new TextEncoder,Fp=new TextDecoder;var yn={};j(yn,{identity:()=>ha});var T0=oa,ia=128,_0=127,D0=~_0,R0=Math.pow(2,31);function oa(t,e,r){e=e||[],r=r||0;for(var n=r;t>=R0;)e[r++]=t&255|ia,t/=128;for(;t&D0;)e[r++]=t&255|ia,t>>>=7;return e[r]=t|0,oa.bytes=r-n+1,e}var L0=dn,N0=128,aa=127;function dn(t,n){var r=0,n=n||0,i=0,a=n,o,s=t.length;do{if(a>=s)throw dn.bytes=0,new RangeError("Could not decode varint");o=t[a++],r+=i<28?(o&aa)<<i:(o&aa)*Math.pow(2,i),i+=7}while(o>=N0);return dn.bytes=a-n,r}var k0=Math.pow(2,7),P0=Math.pow(2,14),U0=Math.pow(2,21),K0=Math.pow(2,28),M0=Math.pow(2,35),F0=Math.pow(2,42),O0=Math.pow(2,49),V0=Math.pow(2,56),q0=Math.pow(2,63),z0=function(t){return t<k0?1:t<P0?2:t<U0?3:t<K0?4:t<M0?5:t<F0?6:t<O0?7:t<V0?8:t<q0?9:10},Q0={encode:T0,decode:L0,encodingLength:z0},G0=Q0,De=G0;function Re(t,e=0){return[De.decode(t,e),De.decode.bytes]}function he(t,e,r=0){return De.encode(t,e,r),e}function le(t){return De.encodingLength(t)}function Xt(t,e){let r=e.byteLength,n=le(t),i=n+le(r),a=new Uint8Array(i+r);return he(t,a,0),he(r,a,n),a.set(e,i),new pe(t,r,e,a)}function sa(t){let e=Ut(t),[r,n]=Re(e),[i,a]=Re(e.subarray(n)),o=e.subarray(n+a);if(o.byteLength!==i)throw new Error("Incorrect length");return new pe(r,i,o,e)}function fa(t,e){if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Xi(t.bytes,r.bytes)}}var pe=class{code;size;digest;bytes;constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var ua=0,H0="identity",ca=Ut;function Y0(t){return Xt(ua,ca(t))}var ha={code:ua,name:H0,encode:ca,digest:Y0};var mn={};j(mn,{sha256:()=>Ne,sha512:()=>W0});function gn({name:t,code:e,encode:r}){return new xn(t,e,r)}var xn=class{name;code;encode;constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Xt(this.code,r):r.then(n=>Xt(this.code,n))}else throw Error("Unknown type, must be binary type")}};function pa(t){return async e=>new Uint8Array(await crypto.subtle.digest(t,e))}var Ne=gn({name:"sha2-256",code:18,encode:pa("SHA-256")}),W0=gn({name:"sha2-512",code:19,encode:pa("SHA-512")});function da(t,e){let{bytes:r,version:n}=t;switch(n){case 0:return $0(r,vn(t),e??Et.encoder);default:return X0(r,vn(t),e??ce.encoder)}}var ya=new WeakMap;function vn(t){let e=ya.get(t);if(e==null){let r=new Map;return ya.set(t,r),r}return e}var ir=class t{code;version;multihash;bytes;"/";constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==ke)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Z0)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Xt(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n!=null&&e.code===n.code&&e.version===n.version&&fa(e.multihash,n.multihash)}toString(e){return da(this,e)}toJSON(){return{"/":da(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:o}=r;return new t(n,i,a,o??xa(n,i,a.bytes))}else if(r[j0]===!0){let{version:n,multihash:i,code:a}=r,o=sa(i);return t.create(n,a,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==ke)throw new Error(`Version 0 CID must use dag-pb (code: ${ke}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=xa(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,ke,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=Ut(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),o=new pe(r.multihashCode,r.digestSize,a,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,p]=Re(e.subarray(r));return r+=p,h},i=n(),a=ke;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,s=n(),f=n(),u=r+f,c=u-o;return{version:i,codec:a,multihashCode:s,digestSize:f,multihashSize:c,size:u}}static parse(e,r){let[n,i]=J0(e,r),a=t.decode(i);if(a.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return vn(a).set(n,e),a}};function J0(t,e){switch(t[0]){case"Q":{let r=e??Et;return[Et.prefix,r.decode(`${Et.prefix}${t}`)]}case Et.prefix:{let r=e??Et;return[Et.prefix,r.decode(t)]}case ce.prefix:{let r=e??ce;return[ce.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}}function $0(t,e,r){let{prefix:n}=r;if(n!==Et.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let a=r.encode(t).slice(1);return e.set(n,a),a}else return i}function X0(t,e,r){let{prefix:n}=r,i=e.get(n);if(i==null){let a=r.encode(t);return e.set(n,a),a}else return i}var ke=112,Z0=18;function xa(t,e,r){let n=le(t),i=n+le(e),a=new Uint8Array(i+r.byteLength);return he(t,a,0),he(e,a,n),a.set(r,i),a}var j0=Symbol.for("@ipld/js-cid/CID");var de={...pn,...an,...ln,...rn,...nn,...sn,...fn,...un,...hn,...on},od={...mn,...yn};function bn(t=0){return globalThis.Buffer?.allocUnsafe!=null?rr(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function ma(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var ga=ma("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),An=ma("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=bn(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),ld={utf8:ga,"utf-8":ga,hex:de.base16,latin1:An,ascii:An,binary:An,...de};var yg=st(Ke(),1),xg=st(Ao(),1);var tl=st(W(),1);var t1=st(ot(),1),e1=st(yr(),1),Ec=st(W(),1);var vr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var wc=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!wc)throw new Error("Non little-endian hardware is not supported");var f1={}.toString;function Eo(t=32){if(vr&&typeof vr.getRandomValues=="function")return vr.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}var Pn=new Float32Array([-0]),Yt=new Uint8Array(Pn.buffer);function So(t,e,r){Pn[0]=t,e[r]=Yt[0],e[r+1]=Yt[1],e[r+2]=Yt[2],e[r+3]=Yt[3]}function Bo(t,e){return Yt[0]=t[e],Yt[1]=t[e+1],Yt[2]=t[e+2],Yt[3]=t[e+3],Pn[0]}var Un=new Float64Array([-0]),lt=new Uint8Array(Un.buffer);function Co(t,e,r){Un[0]=t,e[r]=lt[0],e[r+1]=lt[1],e[r+2]=lt[2],e[r+3]=lt[3],e[r+4]=lt[4],e[r+5]=lt[5],e[r+6]=lt[6],e[r+7]=lt[7]}function Io(t,e){return lt[0]=t[e],lt[1]=t[e+1],lt[2]=t[e+2],lt[3]=t[e+3],lt[4]=t[e+4],lt[5]=t[e+5],lt[6]=t[e+6],lt[7]=t[e+7],Un[0]}var Cc=BigInt(Number.MAX_SAFE_INTEGER),Ic=BigInt(Number.MIN_SAFE_INTEGER),xt=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return re;if(e<Cc&&e>Ic)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>To&&(i=0n,++n>To&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return re;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):re}},re=new xt(0,0);re.toBigInt=function(){return 0n};re.zzEncode=re.zzDecode=function(){return this};re.length=function(){return 1};var To=4294967296n;function _o(t){let e=0,r=0;for(let n=0;n<t.length;++n)r=t.charCodeAt(n),r<128?e+=1:r<2048?e+=2:(r&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function Do(t,e,r){if(r-e<1)return"";let i,a=[],o=0,s;for(;e<r;)s=t[e++],s<128?a[o++]=s:s>191&&s<224?a[o++]=(s&31)<<6|t[e++]&63:s>239&&s<365?(s=((s&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,a[o++]=55296+(s>>10),a[o++]=56320+(s&1023)):a[o++]=(s&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,a)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))}function Kn(t,e,r){let n=r,i,a;for(let o=0;o<t.length;++o)i=t.charCodeAt(o),i<128?e[r++]=i:i<2048?(e[r++]=i>>6|192,e[r++]=i&63|128):(i&64512)===55296&&((a=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(a&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function St(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function br(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var Mn=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,St(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw St(this,4);return br(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw St(this,4);return br(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw St(this,4);let e=Bo(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw St(this,4);let e=Io(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw St(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return Do(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw St(this,e);this.pos+=e}else do if(this.pos>=this.len)throw St(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new xt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw St(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw St(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw St(this,8);let e=br(this.buf,this.pos+=4),r=br(this.buf,this.pos+=4);return new xt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Fn(t){return new Mn(t instanceof Uint8Array?t:t.subarray())}function Ar(t,e){let r=Fn(t);return e.decode(r)}function ne(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Ot(t=0){return globalThis.Buffer?.alloc!=null?ne(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function vt(t=0){return globalThis.Buffer?.allocUnsafe!=null?ne(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var Qn={};j(Qn,{base10:()=>Nc});function Tc(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=t.length,f=t.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var x=0,v=0,b=0,I=l.length;b!==I&&l[b]===0;)b++,x++;for(var w=(I-b)*c+1>>>0,T=new Uint8Array(w);b!==I;){for(var S=l[b],C=0,L=w-1;(S!==0||C<v)&&L!==-1;L--,C++)S+=256*T[L]>>>0,T[L]=S%s>>>0,S=S/s>>>0;if(S!==0)throw new Error("Non-zero carry");v=C,b++}for(var N=w-v;N!==w&&T[N]===0;)N++;for(var P=f.repeat(x);N<w;++N)P+=t.charAt(T[N]);return P}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var x=0;if(l[x]!==" "){for(var v=0,b=0;l[x]===f;)v++,x++;for(var I=(l.length-x)*u+1>>>0,w=new Uint8Array(I);l[x];){var T=r[l.charCodeAt(x)];if(T===255)return;for(var S=0,C=I-1;(T!==0||S<b)&&C!==-1;C--,S++)T+=s*w[C]>>>0,w[C]=T%256>>>0,T=T/256>>>0;if(T!==0)throw new Error("Non-zero carry");b=S,x++}if(l[x]!==" "){for(var L=I-b;L!==I&&w[L]===0;)L++;for(var N=new Uint8Array(v+(I-L)),P=v;L!==I;)N[P++]=w[L++];return N}}}function m(l){var x=p(l);if(x)return x;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:p,decode:m}}var _c=Tc,Dc=_c,Lo=Dc;var C1=new Uint8Array(0);var No=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},Vt=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var ko=t=>new TextEncoder().encode(t),Po=t=>new TextDecoder().decode(t);var On=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Vn=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Ko(this,e)}},qn=class{constructor(e){this.decoders=e}or(e){return Ko(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Ko=(t,e)=>new qn({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),zn=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new On(e,r,n),this.decoder=new Vn(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ve=({name:t,prefix:e,encode:r,decode:n})=>new zn(t,e,r,n),Wt=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=Lo(r,e);return ve({prefix:t,name:e,encode:n,decode:a=>Vt(i(a))})},Rc=(t,e,r,n)=>{let i={};for(let c=0;c<e.length;++c)i[e[c]]=c;let a=t.length;for(;t[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,u=0;for(let c=0;c<a;++c){let h=i[t[c]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[u++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o},Lc=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<t.length;++f)for(s=s<<8|t[f],o+=8;o>r;)o-=r,a+=e[i&s>>o];if(o&&(a+=e[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},at=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ve({prefix:e,name:t,encode(i){return Lc(i,n,r)},decode(i){return Rc(i,n,r,t)}});var Nc=Wt({prefix:"9",name:"base10",alphabet:"0123456789"});var Gn={};j(Gn,{base16:()=>kc,base16upper:()=>Pc});var kc=at({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pc=at({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Hn={};j(Hn,{base2:()=>Uc});var Uc=at({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Yn={};j(Yn,{base256emoji:()=>Vc});var Mo=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Kc=Mo.reduce((t,e,r)=>(t[r]=e,t),[]),Mc=Mo.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Fc(t){return t.reduce((e,r)=>(e+=Kc[r],e),"")}function Oc(t){let e=[];for(let r of t){let n=Mc[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Vc=ve({prefix:"\u{1F680}",name:"base256emoji",encode:Fc,decode:Oc});var Wn={};j(Wn,{base32:()=>be,base32hex:()=>Gc,base32hexpad:()=>Yc,base32hexpadupper:()=>Wc,base32hexupper:()=>Hc,base32pad:()=>zc,base32padupper:()=>Qc,base32upper:()=>qc,base32z:()=>Jc});var be=at({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),qc=at({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),zc=at({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Qc=at({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gc=at({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Hc=at({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Yc=at({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Wc=at({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Jc=at({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Jn={};j(Jn,{base36:()=>$c,base36upper:()=>Xc});var $c=Wt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Xc=Wt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var $n={};j($n,{base58btc:()=>Lt,base58flickr:()=>Zc});var Lt=Wt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Zc=Wt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Xn={};j(Xn,{base64:()=>jc,base64pad:()=>th,base64url:()=>eh,base64urlpad:()=>rh});var jc=at({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),th=at({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),eh=at({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),rh=at({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Zn={};j(Zn,{base8:()=>nh});var nh=at({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var jn={};j(jn,{identity:()=>ih});var ih=ve({prefix:"\0",name:"identity",encode:t=>Po(t),decode:t=>ko(t)});var V1=new TextEncoder,q1=new TextDecoder;var ei={};j(ei,{identity:()=>Ih});var sh=Vo,Fo=128,fh=127,uh=~fh,ch=Math.pow(2,31);function Vo(t,e,r){e=e||[],r=r||0;for(var n=r;t>=ch;)e[r++]=t&255|Fo,t/=128;for(;t&uh;)e[r++]=t&255|Fo,t>>>=7;return e[r]=t|0,Vo.bytes=r-n+1,e}var hh=ti,lh=128,Oo=127;function ti(t,n){var r=0,n=n||0,i=0,a=n,o,s=t.length;do{if(a>=s)throw ti.bytes=0,new RangeError("Could not decode varint");o=t[a++],r+=i<28?(o&Oo)<<i:(o&Oo)*Math.pow(2,i),i+=7}while(o>=lh);return ti.bytes=a-n,r}var ph=Math.pow(2,7),dh=Math.pow(2,14),yh=Math.pow(2,21),xh=Math.pow(2,28),gh=Math.pow(2,35),mh=Math.pow(2,42),vh=Math.pow(2,49),bh=Math.pow(2,56),Ah=Math.pow(2,63),Eh=function(t){return t<ph?1:t<dh?2:t<yh?3:t<xh?4:t<gh?5:t<mh?6:t<vh?7:t<bh?8:t<Ah?9:10},wh={encode:sh,decode:hh,encodingLength:Eh},Sh=wh,Oe=Sh;var Ve=(t,e=0)=>[Oe.decode(t,e),Oe.decode.bytes],Ae=(t,e,r=0)=>(Oe.encode(t,e,r),e),Ee=t=>Oe.encodingLength(t);var ie=(t,e)=>{let r=e.byteLength,n=Ee(t),i=n+Ee(r),a=new Uint8Array(i+r);return Ae(t,a,0),Ae(r,a,n),a.set(e,i),new we(t,r,e,a)},qo=t=>{let e=Vt(t),[r,n]=Ve(e),[i,a]=Ve(e.subarray(n)),o=e.subarray(n+a);if(o.byteLength!==i)throw new Error("Incorrect length");return new we(r,i,o,e)},zo=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&No(t.bytes,r.bytes)}},we=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Qo=0,Bh="identity",Go=Vt,Ch=t=>ie(Qo,Go(t)),Ih={code:Qo,name:Bh,encode:Go,digest:Ch};var ii={};j(ii,{sha256:()=>Th,sha512:()=>_h});var ni=({name:t,code:e,encode:r})=>new ri(t,e,r),ri=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?ie(this.code,r):r.then(n=>ie(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Yo=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Th=ni({name:"sha2-256",code:18,encode:Yo("SHA-256")}),_h=ni({name:"sha2-512",code:19,encode:Yo("SHA-512")});var Wo=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Rh(r,ai(t),e||Lt.encoder);default:return Lh(r,ai(t),e||be.encoder)}};var Jo=new WeakMap,ai=t=>{let e=Jo.get(t);if(e==null){let r=new Map;return Jo.set(t,r),r}return e},wr=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==ze)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Nh)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=ie(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&zo(e.multihash,n.multihash)}toString(e){return Wo(this,e)}toJSON(){return{"/":Wo(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:o}=r;return new t(n,i,a,o||$o(n,i,a.bytes))}else if(r[kh]===!0){let{version:n,multihash:i,code:a}=r,o=qo(i);return t.create(n,a,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==ze)throw new Error(`Version 0 CID must use dag-pb (code: ${ze}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=$o(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,ze,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=Vt(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),o=new we(r.multihashCode,r.digestSize,a,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,p]=Ve(e.subarray(r));return r+=p,h},i=n(),a=ze;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,s=n(),f=n(),u=r+f,c=u-o;return{version:i,codec:a,multihashCode:s,digestSize:f,multihashSize:c,size:u}}static parse(e,r){let[n,i]=Dh(e,r),a=t.decode(i);if(a.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return ai(a).set(n,e),a}},Dh=(t,e)=>{switch(t[0]){case"Q":{let r=e||Lt;return[Lt.prefix,r.decode(`${Lt.prefix}${t}`)]}case Lt.prefix:{let r=e||Lt;return[Lt.prefix,r.decode(t)]}case be.prefix:{let r=e||be;return[be.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Rh=(t,e,r)=>{let{prefix:n}=r;if(n!==Lt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let a=r.encode(t).slice(1);return e.set(n,a),a}else return i},Lh=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let a=r.encode(t);return e.set(n,a),a}else return i},ze=112,Nh=18,$o=(t,e,r)=>{let n=Ee(t),i=n+Ee(e),a=new Uint8Array(i+r.byteLength);return Ae(t,a,0),Ae(e,a,n),a.set(r,i),a},kh=Symbol.for("@ipld/js-cid/CID");var oi={...jn,...Hn,...Zn,...Qn,...Gn,...Wn,...Jn,...$n,...Xn,...Yn},iy={...ii,...ei};function Zo(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Xo=Zo("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),si=Zo("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=vt(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Ph={utf8:Xo,"utf-8":Xo,hex:oi.base16,latin1:si,ascii:si,binary:si,...oi},jo=Ph;function ts(t,e="utf8"){let r=jo[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ne(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function fi(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return vt(o);i+o>e&&(n=vt(e),i=0);let s=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),s}}var ae=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function ui(){}var hi=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uh=fi();function Kh(t){return globalThis.Buffer!=null?vt(t):Uh(t)}var He=class{len;head;tail;states;constructor(){this.len=0,this.head=new ae(ui,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new ae(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new li((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(Qe,10,xt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=xt.fromBigInt(e);return this._push(Qe,r.length(),r)}uint64Number(e){let r=xt.fromNumber(e);return this._push(Qe,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=xt.fromBigInt(e).zzEncode();return this._push(Qe,r.length(),r)}sint64Number(e){let r=xt.fromNumber(e).zzEncode();return this._push(Qe,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(ci,1,e?1:0)}fixed32(e){return this._push(Ge,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=xt.fromBigInt(e);return this._push(Ge,4,r.lo)._push(Ge,4,r.hi)}fixed64Number(e){let r=xt.fromNumber(e);return this._push(Ge,4,r.lo)._push(Ge,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(So,4,e)}double(e){return this._push(Co,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(ci,1,0):this.uint32(r)._push(Fh,r,e)}string(e){let r=_o(e);return r!==0?this.uint32(r)._push(Kn,r,e):this._push(ci,1,0)}fork(){return this.states=new hi(this),this.head=this.tail=new ae(ui,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new ae(ui,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Kh(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function ci(t,e,r){e[r]=t&255}function Mh(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var li=class extends ae{next;constructor(e,r){super(Mh,e,r),this.next=void 0}};function Qe(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Ge(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function Fh(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(He.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Oh,e,t),this},He.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Vh,e,t),this});function Oh(t,e,r){e.set(t,r)}function Vh(t,e,r){t.length<40?Kn(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(ts(t),r)}function pi(){return new He}function Sr(t,e){let r=pi();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Se;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Se||(Se={}));function Br(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function di(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(a,o){let s=e(a);o.int32(s)},n=function(a){let o=a.int32();return e(o)};return Br("enum",Se.VARINT,r,n)}function Cr(t,e){return Br("message",Se.LENGTH_DELIMITED,t,e)}var bt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(bt||(bt={}));var yi;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(yi||(yi={}));(function(t){t.codec=()=>di(yi)})(bt||(bt={}));var Be;(function(t){let e;t.codec=()=>(e==null&&(e=Cr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),bt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let o=r.uint32();switch(o>>>3){case 1:i.Type=bt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Sr(r,t.codec()),t.decode=r=>Ar(r,t.codec())})(Be||(Be={}));var Ce;(function(t){let e;t.codec=()=>(e==null&&(e=Cr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),bt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let o=r.uint32();switch(o>>>3){case 1:i.Type=bt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Sr(r,t.codec()),t.decode=r=>Ar(r,t.codec())})(Ce||(Ce={}));var zh={"P-256":256,"P-384":384,"P-521":521},Qh=Object.keys(zh),ex=Qh.join(" / ");var $h=st(W(),1);var Gx=st(os(),1);function Jt(t){if(isNaN(t)||t<=0)throw new ht("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return Eo(t)}var gx=st(mr(),1),Yh=st(W(),1);var Ax=st(Ke(),1),Ex=st(mr(),1);var Wh=st(W(),1);var rl=st(Sn(),1),nl=st(ot(),1);function bi(t,e){e==null&&(e=t.reduce((i,a)=>i+a.length,0));let r=vt(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return ne(r)}function fs(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}var cs=Symbol.for("@achingbrain/uint8arraylist");function us(t,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let r=0;for(let n of t){let i=r+n.byteLength;if(e<i)return{buf:n,index:e-r};r=i}throw new RangeError("index is out of bounds")}function Tr(t){return!!t?.[cs]}var We=class t{bufs;length;[cs]=!0;constructor(...e){this.bufs=[],this.length=0,e.length>0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Tr(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Tr(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=us(this.bufs,e);return r.buf[r.index]}set(e,r){let n=us(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n<e.length;n++)this.set(r+n,e[n]);else if(Tr(e))for(let n=0;n<e.length;n++)this.set(r+n,e.get(n));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0)){if(e===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return bi(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:bi(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),a=new t;return a.length=i,a.bufs=[...n],a}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:this.bufs,length:this.length};let n=[],i=0;for(let a=0;a<this.bufs.length;a++){let o=this.bufs[a],s=i,f=s+o.byteLength;if(i=f,e>=f)continue;let u=e>=s&&e<f,c=r>s&&r<=f;if(u&&c){if(e===s&&r===f){n.push(o);break}let h=e-s;n.push(o.subarray(h,h+(r-e)));break}if(u){if(e===0){n.push(o);continue}n.push(o.subarray(e-s));continue}if(c){if(r===f){n.push(o);break}n.push(o.subarray(0,r-s));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Tr(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let a=256,o=new Int32Array(a);for(let h=0;h<a;h++)o[h]=-1;for(let h=0;h<i;h++)o[n[h]]=h;let s=o,f=this.byteLength-n.byteLength,u=n.byteLength-1,c;for(let h=r;h<=f;h+=c){c=0;for(let p=u;p>=0;p--){let m=this.get(h+p);if(n[p]!==m){c=Math.max(1,p-s[m]);break}}if(c===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=vt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=Ot(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=Ot(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=Ot(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=vt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=Ot(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=Ot(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=Ot(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=Ot(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=Ot(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;r<this.bufs.length;r++)if(!fs(this.bufs[r],e.bufs[r]))return!1;return!0}static fromUint8Arrays(e,r){let n=new t;return n.bufs=e,r==null&&(r=e.reduce((i,a)=>i+a.byteLength,0)),n.length=r,n}};function Bt(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var _r=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function hs(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new _r(r?.errorMessage,r?.errorCode));let n,i=new _r(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((a,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var Ai=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=Bt(),this.haveNext=Bt()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=Bt(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=Bt(),await hs(this.needNext.promise,r?.signal,r)}};function ls(){return new Ai}var Dr=class extends Error{code;constructor(e,r){super(e),this.code=r}},Ei=class extends Dr{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function ps(t,e){let r=ls();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let s of o)await r.push(s);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new We;return{read:async(o,s)=>{s?.signal?.throwIfAborted();let f,u=new Promise((c,h)=>{f=()=>{h(new Ei("Read aborted"))},s?.signal?.addEventListener("abort",f)});try{if(o==null){let{done:h,value:p}=await Promise.race([n.next(),u]);return h===!0?new We:p}for(;i.byteLength<o;){let{value:h,done:p}=await Promise.race([n.next(),u]);if(p===!0)throw new Dr("unexpected end of input","ERR_UNEXPECTED_EOF");i.append(h)}let c=i.sublist(0,o);return i.consume(o),c}finally{f!=null&&s?.signal?.removeEventListener("abort",f)}},write:async(o,s)=>{s?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,s):await r.push(o.subarray(),s)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t}}}function il(t){let[e,r]=t[Symbol.asyncIterator]!=null?[t[Symbol.asyncIterator](),Symbol.asyncIterator]:[t[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:i=>{n.push(i)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[r](){return this}}}var ds=il;function al(t){return t[Symbol.asyncIterator]!=null}function ol(t,e){if(al(t))return async function*(){for await(let s of t)yield e(s)}();let r=ds(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let a=e(n);if(typeof a.then=="function")return async function*(){yield await a;for await(let s of r)yield e(s)}();let o=e;return function*(){yield a;for(let s of r)yield o(s)}()}var ys=ol;function wi(){let t=Bt(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function xs(){let t=wi(),e=wi();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var Rr=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Ie=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new Rr(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new Rr(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var Si=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Lr(t={}){return sl(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function sl(t,e){e=e??{};let r=e.onEnd,n=new Ie,i,a,o,s=Bt(),f=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((v,b)=>{a=I=>{a=null,n.push(I);try{v(t(n))}catch(w){b(w)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{s.resolve(),s=Bt()})}},u=v=>a!=null?a(v):(n.push(v),i),c=v=>(n=new Ie,a!=null?a({error:v}):(n.push({error:v}),i)),h=v=>{if(o)return i;if(e?.objectMode!==!0&&v?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return u({done:!1,value:v})},p=v=>o?i:(o=!0,v!=null?c(v):u({done:!0})),m=()=>(n=new Ie,p(),{done:!0}),l=v=>(p(v),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:f,return:m,throw:l,push:h,end:p,get readableLength(){return n.size},onEmpty:async v=>{let b=v?.signal;if(b?.throwIfAborted(),n.isEmpty())return;let I,w;b!=null&&(I=new Promise((T,S)=>{w=()=>{S(new Si)},b.addEventListener("abort",w)}));try{await Promise.race([s.promise,I])}finally{w!=null&&b!=null&&b?.removeEventListener("abort",w)}}},r==null)return i;let x=i;return i={[Symbol.asyncIterator](){return this},next(){return x.next()},throw(v){return x.throw(v),r!=null&&(r(v),r=void 0),{done:!0}},return(){return x.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(v){return x.end(v),r!=null&&(r(v),r=void 0),i},get readableLength(){return x.readableLength},onEmpty:v=>x.onEmpty(v)},i}function fl(t){return t[Symbol.asyncIterator]!=null}function ul(...t){let e=[];for(let r of t)fl(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=Lr({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var gs=ul;function ms(t,...e){if(t==null)throw new Error("Empty pipeline");if(Bi(t)){let n=t;t=()=>n.source}else if(bs(t)||vs(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&Bi(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n<r.length-1;n++)Bi(r[n])&&(r[n]=hl(r[n]));return cl(...r)}var cl=(...t)=>{let e;for(;t.length>0;)e=t.shift()(e);return e},vs=t=>t?.[Symbol.asyncIterator]!=null,bs=t=>t?.[Symbol.iterator]!=null,Bi=t=>t==null?!1:t.sink!=null&&t.source!=null,hl=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=Lr({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,a=t.source;if(vs(a))i=async function*(){yield*a,n.end()};else if(bs(a))i=function*(){yield*a,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return gs(n,i())}return t.source};function Nr(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function As(t=0){return globalThis.Buffer?.allocUnsafe!=null?Nr(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function ws(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Es=ws("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Ci=ws("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=As(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),ll={utf8:Es,"utf-8":Es,hex:de.base16,latin1:Ci,ascii:Ci,binary:Ci,...de},kr=ll;function Pr(t,e="utf8"){let r=kr[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Nr(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Ur(t,e="utf8"){let r=kr[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var Ri=st(_s(),1);var Ti="Your private shared key is invalid";var Ds="No connection for the handshake provided";var Rs="ERR_INVALID_PARAMETERS";function Ns(t){let e=Ur(Jt(Di),"base16"),r=Pr(`/key/swarm/psk/1.0.0/
12
+ `,r};Ki.decode=function(t){for(var e=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/,a;a=r.exec(t),!!a;){var s=a[1];s==="NEW CERTIFICATE REQUEST"&&(s="CERTIFICATE REQUEST");var o={type:s,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Ze.util.decode64(a[3])};if(e.push(o),!!a[2]){for(var u=a[2].split(i),f=0;a&&f<u.length;){for(var c=u[f].replace(/\s+$/,""),h=f+1;h<u.length;++h){var p=u[h];if(!/\s/.test(p[0]))break;c+=p,f=h}if(a=c.match(n),a){for(var g={name:a[1],values:[]},l=a[2].split(","),m=0;m<l.length;++m)g.values.push(Ws(l[m]));if(o.procType)if(!o.contentDomain&&g.name==="Content-Domain")o.contentDomain=l[0]||"";else if(!o.dekInfo&&g.name==="DEK-Info"){if(g.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:l[0],parameters:l[1]||null}}else o.headers.push(g);else{if(g.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(g.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:l[0],type:l[1]}}}++f}if(o.procType==="ENCRYPTED"&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(e.length===0)throw new Error("Invalid PEM formatted message.");return e};function Xe(t){for(var e=t.name+": ",r=[],n=function(u,f){return" "+f},i=0;i<t.values.length;++i)r.push(t.values[i].replace(/^(\S+\r\n)/,n));e+=r.join(",")+`\r
13
+ `;for(var a=0,s=-1,i=0;i<e.length;++i,++a)if(a>65&&s!==-1){var o=e[s];o===","?(++s,e=e.substr(0,s)+`\r
14
+ `+e.substr(s)):e=e.substr(0,s)+`\r
15
+ `+o+e.substr(s+1),a=i-s-1,s=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(s=i);return e}function Ws(t){return t.replace(/^\s+/,"")}});var zi=X((gh,Qi)=>{var It=W();$t();it();var Oi=Qi.exports=It.sha256=It.sha256||{};It.md.sha256=It.md.algorithms.sha256=Oi;Oi.create=function(){Vi||Js();var t=null,e=It.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return e=It.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=It.util.encodeUtf8(i));var s=i.length;n.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=s[1],s[1]=s[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(i),Fi(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=It.util.createBuffer();i.putBytes(e.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,s=a&n.blockLength-1;i.putBytes(an.substr(0,n.blockLength-s));for(var o,u,f=n.fullMessageLength[0]*8,c=0;c<n.fullMessageLength.length-1;++c)o=n.fullMessageLength[c+1]*8,u=o/4294967296>>>0,f+=u,i.putInt32(f>>>0),f=o>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};Fi(h,r,i);var p=It.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},n};var an=null,Vi=!1,qi=null;function Js(){an="\x80",an+=It.util.fillString("\0",64),qi=[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],Vi=!0}function Fi(t,e,r){for(var n,i,a,s,o,u,f,c,h,p,g,l,m,v,b,I=r.length();I>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(c=t.h0,h=t.h1,p=t.h2,g=t.h3,l=t.h4,m=t.h5,v=t.h6,b=t.h7,f=0;f<64;++f)s=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),o=v^l&(m^v),a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),u=c&h|p&(c^h),n=b+s+o+qi[f]+e[f],i=a+u,b=v,v=m,m=l,l=g+n>>>0,g=p,p=h,h=c,c=n+i>>>0;t.h0=t.h0+c|0,t.h1=t.h1+h|0,t.h2=t.h2+p|0,t.h3=t.h3+g|0,t.h4=t.h4+l|0,t.h5=t.h5+m|0,t.h6=t.h6+v|0,t.h7=t.h7+b|0,I-=64}}});var Hi=X((mh,Gi)=>{var Tt=W();it();var je=null;Tt.util.isNodejs&&!Tt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(je=$e());var $s=Gi.exports=Tt.prng=Tt.prng||{};$s.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(f,c){if(!c)return e.generateSync(f);var h=e.plugin.cipher,p=e.plugin.increment,g=e.plugin.formatKey,l=e.plugin.formatSeed,m=Tt.util.createBuffer();e.key=null,v();function v(b){if(b)return c(b);if(m.length()>=f)return c(null,m.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return Tt.util.nextTick(function(){a(v)});var I=h(e.key,e.seed);e.generated+=I.length,m.putBytes(I),e.key=g(h(e.key,p(e.seed))),e.seed=l(h(e.key,e.seed)),Tt.util.setImmediate(v)}},e.generateSync=function(f){var c=e.plugin.cipher,h=e.plugin.increment,p=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var l=Tt.util.createBuffer();l.length()<f;){e.generated>1048575&&(e.key=null),e.key===null&&s();var m=c(e.key,e.seed);e.generated+=m.length,l.putBytes(m),e.key=p(c(e.key,h(e.seed))),e.seed=g(c(e.key,e.seed))}return l.getBytes(f)};function a(f){if(e.pools[0].messageLength>=32)return o(),f();var c=32-e.pools[0].messageLength<<5;e.seedFile(c,function(h,p){if(h)return f(h);e.collect(p),o(),f()})}function s(){if(e.pools[0].messageLength>=32)return o();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),o()}function o(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var c=1,h=0;h<32;++h)e.reseeds%c===0&&(f.update(e.pools[h].digest().getBytes()),e.pools[h].start()),c=c<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var p=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(p),e.generated=0}function u(f){var c=null,h=Tt.util.globalScope,p=h.crypto||h.msCrypto;p&&p.getRandomValues&&(c=function(C){return p.getRandomValues(C)});var g=Tt.util.createBuffer();if(c)for(;g.length()<f;){var l=Math.max(1,Math.min(f-g.length(),65536)/4),m=new Uint32Array(Math.floor(l));try{c(m);for(var v=0;v<m.length;++v)g.putInt32(m[v])}catch(C){if(!(typeof QuotaExceededError<"u"&&C instanceof QuotaExceededError))throw C}}if(g.length()<f)for(var b,I,w,D=Math.floor(Math.random()*65536);g.length()<f;){I=16807*(D&65535),b=16807*(D>>16),I+=(b&32767)<<16,I+=b>>15,I=(I&2147483647)+(I>>31),D=I&4294967295;for(var v=0;v<3;++v)w=D>>>(v<<3),w^=Math.floor(Math.random()*256),g.putByte(w&255)}return g.getBytes(f)}return je?(e.seedFile=function(f,c){je.randomBytes(f,function(h,p){if(h)return c(h);c(null,p.toString())})},e.seedFileSync=function(f){return je.randomBytes(f).toString()}):(e.seedFile=function(f,c){try{c(null,u(f))}catch(h){c(h)}},e.seedFileSync=u),e.collect=function(f){for(var c=f.length,h=0;h<c;++h)e.pools[e.pool].update(f.substr(h,1)),e.pool=e.pool===31?0:e.pool+1},e.collectInt=function(f,c){for(var h="",p=0;p<c;p+=8)h+=String.fromCharCode(f>>p&255);e.collect(h)},e.registerWorker=function(f){if(f===self)e.seedFile=function(h,p){function g(l){var m=l.data;m.forge&&m.forge.prng&&(self.removeEventListener("message",g),p(m.forge.prng.err,m.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var c=function(h){var p=h.data;p.forge&&p.forge.prng&&e.seedFile(p.forge.prng.needed,function(g,l){f.postMessage({forge:{prng:{err:g,bytes:l}}})})};f.addEventListener("message",c)}},e}});var _e=X((vh,sn)=>{var ft=W();qe();zi();Hi();it();(function(){if(ft.random&&ft.random.getBytes){sn.exports=ft.random;return}(function(t){var e={},r=new Array(4),n=ft.util.createBuffer();e.formatKey=function(h){var p=ft.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),ft.aes._expandKey(h,!1)},e.formatSeed=function(h){var p=ft.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),h},e.cipher=function(h,p){return ft.aes._updateBlock(h,p,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=ft.md.sha256;function i(){var h=ft.prng.create(e);return h.getBytes=function(p,g){return h.generate(p,g)},h.getBytesSync=function(p){return h.generate(p)},h}var a=i(),s=null,o=ft.util.globalScope,u=o.crypto||o.msCrypto;if(u&&u.getRandomValues&&(s=function(h){return u.getRandomValues(h)}),ft.options.usePureJavaScript||!ft.util.isNodejs&&!s){if(typeof window>"u"||window.document,a.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var c in navigator)try{typeof navigator[c]=="string"&&(f+=navigator[c])}catch{}a.collect(f),f=null}t&&(t().mousemove(function(h){a.collectInt(h.clientX,16),a.collectInt(h.clientY,16)}),t().keypress(function(h){a.collectInt(h.charCode,8)}))}if(!ft.random)ft.random=a;else for(var c in a)ft.random[c]=a[c];ft.random.createInstance=i,sn.exports=ft.random})(typeof jQuery<"u"?jQuery:null)})()});var $i=X((Ah,Ji)=>{var lt=W();it();var on=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],Yi=[1,2,3,5],Xs=function(t,e){return t<<e&65535|(t&65535)>>16-e},Zs=function(t,e){return(t&65535)>>e|t<<16-e&65535};Ji.exports=lt.rc2=lt.rc2||{};lt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=lt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,a=Math.ceil(i/8),s=255>>(i&7),o;for(o=n;o<128;o++)r.putByte(on[r.at(o-1)+r.at(o-n)&255]);for(r.setAt(128-a,on[r.at(128-a)&s]),o=127-a;o>=0;o--)r.setAt(o,on[r.at(o+1)^r.at(o+a)]);return r};var Wi=function(t,e,r){var n=!1,i=null,a=null,s=null,o,u,f,c,h=[];for(t=lt.rc2.expandKey(t,e),f=0;f<64;f++)h.push(t.getInt16Le());r?(o=function(l){for(f=0;f<4;f++)l[f]+=h[c]+(l[(f+3)%4]&l[(f+2)%4])+(~l[(f+3)%4]&l[(f+1)%4]),l[f]=Xs(l[f],Yi[f]),c++},u=function(l){for(f=0;f<4;f++)l[f]+=h[l[(f+3)%4]&63]}):(o=function(l){for(f=3;f>=0;f--)l[f]=Zs(l[f],Yi[f]),l[f]-=h[c]+(l[(f+3)%4]&l[(f+2)%4])+(~l[(f+3)%4]&l[(f+1)%4]),c--},u=function(l){for(f=3;f>=0;f--)l[f]-=h[l[(f+3)%4]&63]});var p=function(l){var m=[];for(f=0;f<4;f++){var v=i.getInt16Le();s!==null&&(r?v^=s.getInt16Le():s.putInt16Le(v)),m.push(v&65535)}c=r?0:63;for(var b=0;b<l.length;b++)for(var I=0;I<l[b][0];I++)l[b][1](m);for(f=0;f<4;f++)s!==null&&(r?s.putInt16Le(m[f]):m[f]^=s.getInt16Le()),a.putInt16Le(m[f])},g=null;return g={start:function(l,m){l&&typeof l=="string"&&(l=lt.util.createBuffer(l)),n=!1,i=lt.util.createBuffer(),a=m||new lt.util.createBuffer,s=l,g.output=a},update:function(l){for(n||i.putBuffer(l);i.length()>=8;)p([[5,o],[1,u],[6,o],[1,u],[5,o]])},finish:function(l){var m=!0;if(r)if(l)m=l(8,i,!r);else{var v=i.length()===8?8:8-i.length();i.fillWithByte(v,v)}if(m&&(n=!0,g.update()),!r&&(m=i.length()===0,m))if(l)m=l(8,a,!r);else{var b=a.length(),I=a.at(b-1);I>b?m=!1:a.truncate(I)}return m}},g};lt.rc2.startEncrypting=function(t,e,r){var n=lt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};lt.rc2.createEncryptionCipher=function(t,e){return Wi(t,e,!0)};lt.rc2.startDecrypting=function(t,e,r){var n=lt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};lt.rc2.createDecryptionCipher=function(t,e){return Wi(t,e,!1)}});var rr=X((bh,ia)=>{var fn=W();ia.exports=fn.jsbn=fn.jsbn||{};var Ft,js=0xdeadbeefcafe,Xi=(js&16777215)==15715070;function E(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}fn.jsbn.BigInteger=E;function G(){return new E(null)}function to(t,e,r,n,i,a){for(;--a>=0;){var s=e*this.data[t++]+r.data[n]+i;i=Math.floor(s/67108864),r.data[n++]=s&67108863}return i}function eo(t,e,r,n,i,a){for(var s=e&32767,o=e>>15;--a>=0;){var u=this.data[t]&32767,f=this.data[t++]>>15,c=o*u+f*s;u=s*u+((c&32767)<<15)+r.data[n]+(i&1073741823),i=(u>>>30)+(c>>>15)+o*f+(i>>>30),r.data[n++]=u&1073741823}return i}function Zi(t,e,r,n,i,a){for(var s=e&16383,o=e>>14;--a>=0;){var u=this.data[t]&16383,f=this.data[t++]>>14,c=o*u+f*s;u=s*u+((c&16383)<<14)+r.data[n]+i,i=(u>>28)+(c>>14)+o*f,r.data[n++]=u&268435455}return i}typeof navigator>"u"?(E.prototype.am=Zi,Ft=28):Xi&&navigator.appName=="Microsoft Internet Explorer"?(E.prototype.am=eo,Ft=30):Xi&&navigator.appName!="Netscape"?(E.prototype.am=to,Ft=26):(E.prototype.am=Zi,Ft=28);E.prototype.DB=Ft;E.prototype.DM=(1<<Ft)-1;E.prototype.DV=1<<Ft;var un=52;E.prototype.FV=Math.pow(2,un);E.prototype.F1=un-Ft;E.prototype.F2=2*Ft-un;var ro="0123456789abcdefghijklmnopqrstuvwxyz",tr=new Array,le,gt;le=48;for(gt=0;gt<=9;++gt)tr[le++]=gt;le=97;for(gt=10;gt<36;++gt)tr[le++]=gt;le=65;for(gt=10;gt<36;++gt)tr[le++]=gt;function ji(t){return ro.charAt(t)}function ta(t,e){var r=tr[t.charCodeAt(e)];return r??-1}function no(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function io(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function zt(t){var e=G();return e.fromInt(t),e}function ao(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,a=0;--n>=0;){var s=r==8?t[n]&255:ta(t,n);if(s<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this.data[this.t++]=s>>this.DB-a):this.data[this.t-1]|=s<<a,a+=r,a>=this.DB&&(a-=this.DB)}r==8&&t[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&E.ZERO.subTo(this,this)}function so(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t}function oo(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<<e)-1,n,i=!1,a="",s=this.t,o=this.DB-s*this.DB%e;if(s-- >0)for(o<this.DB&&(n=this.data[s]>>o)>0&&(i=!0,a=ji(n));s>=0;)o<e?(n=(this.data[s]&(1<<o)-1)<<e-o,n|=this.data[--s]>>(o+=this.DB-e)):(n=this.data[s]>>(o-=e)&r,o<=0&&(o+=this.DB,--s)),n>0&&(i=!0),i&&(a+=ji(n));return i?a:"0"}function fo(){var t=G();return E.ZERO.subTo(this,t),t}function uo(){return this.s<0?this.negate():this}function co(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function er(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function ho(){return this.t<=0?0:this.DB*(this.t-1)+er(this.data[this.t-1]^this.s&this.DM)}function lo(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function po(t,e){for(var r=t;r<this.t;++r)e.data[r-t]=this.data[r];e.t=Math.max(this.t-t,0),e.s=this.s}function yo(t,e){var r=t%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(t/this.DB),s=this.s<<r&this.DM,o;for(o=this.t-1;o>=0;--o)e.data[o+a+1]=this.data[o]>>n|s,s=(this.data[o]&i)<<r;for(o=a-1;o>=0;--o)e.data[o]=0;e.data[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()}function xo(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,a=(1<<n)-1;e.data[0]=this.data[r]>>n;for(var s=r+1;s<this.t;++s)e.data[s-r-1]|=(this.data[s]&a)<<i,e.data[s-r]=this.data[s]>>n;n>0&&(e.data[this.t-r-1]|=(this.s&a)<<i),e.t=this.t-r,e.clamp()}function go(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]-t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function mo(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i<n.t;++i)e.data[i+r.t]=r.am(0,n.data[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&E.ZERO.subTo(e,e)}function vo(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t.data[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e.data[r],t,2*r,0,1);(t.data[r+e.t]+=e.am(r+1,2*e.data[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Ao(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){e?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=G());var a=G(),s=this.s,o=t.s,u=this.DB-er(n.data[n.t-1]);u>0?(n.lShiftTo(u,a),i.lShiftTo(u,r)):(n.copyTo(a),i.copyTo(r));var f=a.t,c=a.data[f-1];if(c!=0){var h=c*(1<<this.F1)+(f>1?a.data[f-2]>>this.F2:0),p=this.FV/h,g=(1<<this.F1)/h,l=1<<this.F2,m=r.t,v=m-f,b=e??G();for(a.dlShiftTo(v,b),r.compareTo(b)>=0&&(r.data[r.t++]=1,r.subTo(b,r)),E.ONE.dlShiftTo(f,b),b.subTo(a,a);a.t<f;)a.data[a.t++]=0;for(;--v>=0;){var I=r.data[--m]==c?this.DM:Math.floor(r.data[m]*p+(r.data[m-1]+l)*g);if((r.data[m]+=a.am(0,I,r,v,0,f))<I)for(a.dlShiftTo(v,b),r.subTo(b,r);r.data[m]<--I;)r.subTo(b,r)}e!=null&&(r.drShiftTo(f,e),s!=o&&E.ZERO.subTo(e,e)),r.t=f,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&E.ZERO.subTo(r,r)}}}function bo(t){var e=G();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(E.ZERO)>0&&t.subTo(e,e),e}function Xt(t){this.m=t}function Eo(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Bo(t){return t}function So(t){t.divRemTo(this.m,null,t)}function wo(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function Co(t,e){t.squareTo(e),this.reduce(e)}Xt.prototype.convert=Eo;Xt.prototype.revert=Bo;Xt.prototype.reduce=So;Xt.prototype.mulTo=wo;Xt.prototype.sqrTo=Co;function Io(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Zt(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function To(t){var e=G();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(E.ZERO)>0&&this.m.subTo(e,e),e}function _o(t){var e=G();return t.copyTo(e),this.reduce(e),e}function Ro(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=t.data[e]&32767,n=r*this.mpl+((r*this.mph+(t.data[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function Do(t,e){t.squareTo(e),this.reduce(e)}function No(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Zt.prototype.convert=To;Zt.prototype.revert=_o;Zt.prototype.reduce=Ro;Zt.prototype.mulTo=No;Zt.prototype.sqrTo=Do;function Lo(){return(this.t>0?this.data[0]&1:this.s)==0}function ko(t,e){if(t>4294967295||t<1)return E.ONE;var r=G(),n=G(),i=e.convert(this),a=er(t)-1;for(i.copyTo(r);--a>=0;)if(e.sqrTo(r,n),(t&1<<a)>0)e.mulTo(n,i,r);else{var s=r;r=n,n=s}return e.revert(r)}function Po(t,e){var r;return t<256||e.isEven()?r=new Xt(e):r=new Zt(e),this.exp(t,r)}E.prototype.copyTo=no;E.prototype.fromInt=io;E.prototype.fromString=ao;E.prototype.clamp=so;E.prototype.dlShiftTo=lo;E.prototype.drShiftTo=po;E.prototype.lShiftTo=yo;E.prototype.rShiftTo=xo;E.prototype.subTo=go;E.prototype.multiplyTo=mo;E.prototype.squareTo=vo;E.prototype.divRemTo=Ao;E.prototype.invDigit=Io;E.prototype.isEven=Lo;E.prototype.exp=ko;E.prototype.toString=oo;E.prototype.negate=fo;E.prototype.abs=uo;E.prototype.compareTo=co;E.prototype.bitLength=ho;E.prototype.mod=bo;E.prototype.modPowInt=Po;E.ZERO=zt(0);E.ONE=zt(1);function Ko(){var t=G();return this.copyTo(t),t}function Uo(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function Mo(){return this.t==0?this.s:this.data[0]<<24>>24}function Fo(){return this.t==0?this.s:this.data[0]<<16>>16}function Oo(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function Vo(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function qo(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=zt(r),i=G(),a=G(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(t)+s}function Qo(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,a=0,s=0,o=0;o<t.length;++o){var u=ta(t,o);if(u<0){t.charAt(o)=="-"&&this.signum()==0&&(i=!0);continue}s=e*s+u,++a>=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0)}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(s,0)),i&&E.ZERO.subTo(this,this)}function zo(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(E.ONE.shiftLeft(t-1),cn,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(E.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function Go(){var t=this.t,e=new Array;e[0]=this.s;var r=this.DB-t*this.DB%8,n,i=0;if(t-- >0)for(r<this.DB&&(n=this.data[t]>>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<<this.DB-r);t>=0;)r<8?(n=(this.data[t]&(1<<r)-1)<<8-r,n|=this.data[--t]>>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function Ho(t){return this.compareTo(t)==0}function Yo(t){return this.compareTo(t)<0?this:t}function Wo(t){return this.compareTo(t)>0?this:t}function Jo(t,e,r){var n,i,a=Math.min(t.t,this.t);for(n=0;n<a;++n)r.data[n]=e(this.data[n],t.data[n]);if(t.t<this.t){for(i=t.s&this.DM,n=a;n<this.t;++n)r.data[n]=e(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<t.t;++n)r.data[n]=e(i,t.data[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()}function $o(t,e){return t&e}function Xo(t){var e=G();return this.bitwiseTo(t,$o,e),e}function cn(t,e){return t|e}function Zo(t){var e=G();return this.bitwiseTo(t,cn,e),e}function ea(t,e){return t^e}function jo(t){var e=G();return this.bitwiseTo(t,ea,e),e}function ra(t,e){return t&~e}function tf(t){var e=G();return this.bitwiseTo(t,ra,e),e}function ef(){for(var t=G(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t}function rf(t){var e=G();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function nf(t){var e=G();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function af(t){if(t==0)return-1;var e=0;return t&65535||(t>>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function sf(){for(var t=0;t<this.t;++t)if(this.data[t]!=0)return t*this.DB+af(this.data[t]);return this.s<0?this.t*this.DB:-1}function of(t){for(var e=0;t!=0;)t&=t-1,++e;return e}function ff(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=of(this.data[r]^e);return t}function uf(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<t%this.DB)!=0}function cf(t,e){var r=E.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r}function hf(t){return this.changeBit(t,cn)}function lf(t){return this.changeBit(t,ra)}function pf(t){return this.changeBit(t,ea)}function df(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]+t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function yf(t){var e=G();return this.addTo(t,e),e}function xf(t){var e=G();return this.subTo(t,e),e}function gf(t){var e=G();return this.multiplyTo(t,e),e}function mf(t){var e=G();return this.divRemTo(t,e,null),e}function vf(t){var e=G();return this.divRemTo(t,null,e),e}function Af(t){var e=G(),r=G();return this.divRemTo(t,e,r),new Array(e,r)}function bf(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Ef(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function Re(){}function na(t){return t}function Bf(t,e,r){t.multiplyTo(e,r)}function Sf(t,e){t.squareTo(e)}Re.prototype.convert=na;Re.prototype.revert=na;Re.prototype.mulTo=Bf;Re.prototype.sqrTo=Sf;function wf(t){return this.exp(t,new Re)}function Cf(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,t.data[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t.data[n],r,n,0,e-n);r.clamp()}function If(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r.data[this.t+n-e]=this.am(e-n,t.data[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)}function pe(t){this.r2=G(),this.q3=G(),E.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function Tf(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=G();return t.copyTo(e),this.reduce(e),e}function _f(t){return t}function Rf(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function Df(t,e){t.squareTo(e),this.reduce(e)}function Nf(t,e,r){t.multiplyTo(e,r),this.reduce(r)}pe.prototype.convert=Tf;pe.prototype.revert=_f;pe.prototype.reduce=Rf;pe.prototype.mulTo=Nf;pe.prototype.sqrTo=Df;function Lf(t,e){var r=t.bitLength(),n,i=zt(1),a;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?a=new Xt(e):e.isEven()?a=new pe(e):a=new Zt(e);var s=new Array,o=3,u=n-1,f=(1<<n)-1;if(s[1]=a.convert(this),n>1){var c=G();for(a.sqrTo(s[1],c);o<=f;)s[o]=G(),a.mulTo(c,s[o-2],s[o]),o+=2}var h=t.t-1,p,g=!0,l=G(),m;for(r=er(t.data[h])-1;h>=0;){for(r>=u?p=t.data[h]>>r-u&f:(p=(t.data[h]&(1<<r+1)-1)<<u-r,h>0&&(p|=t.data[h-1]>>this.DB+r-u)),o=n;!(p&1);)p>>=1,--o;if((r-=o)<0&&(r+=this.DB,--h),g)s[p].copyTo(i),g=!1;else{for(;o>1;)a.sqrTo(i,l),a.sqrTo(l,i),o-=2;o>0?a.sqrTo(i,l):(m=i,i=l,l=m),a.mulTo(l,s[p],i)}for(;h>=0&&!(t.data[h]&1<<r);)a.sqrTo(i,l),m=i,i=l,l=m,--r<0&&(r=this.DB-1,--h)}return a.revert(i)}function kf(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return e;for(i<a&&(a=i),a>0&&(e.rShiftTo(a,e),r.rShiftTo(a,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r}function Pf(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function Kf(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return E.ZERO;for(var r=t.clone(),n=this.clone(),i=zt(1),a=zt(0),s=zt(0),o=zt(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),e?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(t,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(s,i),a.subTo(o,a)):(n.subTo(r,n),e&&s.subTo(i,s),o.subTo(a,o))}if(n.compareTo(E.ONE)!=0)return E.ZERO;if(o.compareTo(t)>=0)return o.subtract(t);if(o.signum()<0)o.addTo(t,o);else return o;return o.signum()<0?o.add(t):o}var Bt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],Uf=(1<<26)/Bt[Bt.length-1];function Mf(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=Bt[Bt.length-1]){for(e=0;e<Bt.length;++e)if(r.data[0]==Bt[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<Bt.length;){for(var n=Bt[e],i=e+1;i<Bt.length&&n<Uf;)n*=Bt[i++];for(n=r.modInt(n);e<i;)if(n%Bt[e++]==0)return!1}return r.millerRabin(t)}function Ff(t){var e=this.subtract(E.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n=e.shiftRight(r),i=Of(),a,s=0;s<t;++s){do a=new E(this.bitLength(),i);while(a.compareTo(E.ONE)<=0||a.compareTo(e)>=0);var o=a.modPow(n,this);if(o.compareTo(E.ONE)!=0&&o.compareTo(e)!=0){for(var u=1;u++<r&&o.compareTo(e)!=0;)if(o=o.modPowInt(2,this),o.compareTo(E.ONE)==0)return!1;if(o.compareTo(e)!=0)return!1}}return!0}function Of(){return{nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(Math.random()*256)}}}E.prototype.chunkSize=Oo;E.prototype.toRadix=qo;E.prototype.fromRadix=Qo;E.prototype.fromNumber=zo;E.prototype.bitwiseTo=Jo;E.prototype.changeBit=cf;E.prototype.addTo=df;E.prototype.dMultiply=bf;E.prototype.dAddOffset=Ef;E.prototype.multiplyLowerTo=Cf;E.prototype.multiplyUpperTo=If;E.prototype.modInt=Pf;E.prototype.millerRabin=Ff;E.prototype.clone=Ko;E.prototype.intValue=Uo;E.prototype.byteValue=Mo;E.prototype.shortValue=Fo;E.prototype.signum=Vo;E.prototype.toByteArray=Go;E.prototype.equals=Ho;E.prototype.min=Yo;E.prototype.max=Wo;E.prototype.and=Xo;E.prototype.or=Zo;E.prototype.xor=jo;E.prototype.andNot=tf;E.prototype.not=ef;E.prototype.shiftLeft=rf;E.prototype.shiftRight=nf;E.prototype.getLowestSetBit=sf;E.prototype.bitCount=ff;E.prototype.testBit=uf;E.prototype.setBit=hf;E.prototype.clearBit=lf;E.prototype.flipBit=pf;E.prototype.add=yf;E.prototype.subtract=xf;E.prototype.multiply=gf;E.prototype.divide=mf;E.prototype.remainder=vf;E.prototype.divideAndRemainder=Af;E.prototype.modPow=Lf;E.prototype.modInverse=Kf;E.prototype.pow=wf;E.prototype.gcd=kf;E.prototype.isProbablePrime=Mf});var ua=X((Eh,fa)=>{var _t=W();$t();it();var sa=fa.exports=_t.sha1=_t.sha1||{};_t.md.sha1=_t.md.algorithms.sha1=sa;sa.create=function(){oa||Vf();var t=null,e=_t.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return e=_t.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=_t.util.encodeUtf8(i));var s=i.length;n.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=s[1],s[1]=s[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(i),aa(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=_t.util.createBuffer();i.putBytes(e.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,s=a&n.blockLength-1;i.putBytes(hn.substr(0,n.blockLength-s));for(var o,u,f=n.fullMessageLength[0]*8,c=0;c<n.fullMessageLength.length-1;++c)o=n.fullMessageLength[c+1]*8,u=o/4294967296>>>0,f+=u,i.putInt32(f>>>0),f=o>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};aa(h,r,i);var p=_t.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},n};var hn=null,oa=!1;function Vf(){hn="\x80",hn+=_t.util.fillString("\0",64),oa=!0}function aa(t,e,r){for(var n,i,a,s,o,u,f,c,h=r.length();h>=64;){for(i=t.h0,a=t.h1,s=t.h2,o=t.h3,u=t.h4,c=0;c<16;++c)n=r.getInt32(),e[c]=n,f=o^a&(s^o),n=(i<<5|i>>>27)+f+u+1518500249+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=e[c-3]^e[c-8]^e[c-14]^e[c-16],n=n<<1|n>>>31,e[c]=n,f=o^a&(s^o),n=(i<<5|i>>>27)+f+u+1518500249+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=e[c-3]^e[c-8]^e[c-14]^e[c-16],n=n<<1|n>>>31,e[c]=n,f=a^s^o,n=(i<<5|i>>>27)+f+u+1859775393+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=e[c-6]^e[c-16]^e[c-28]^e[c-32],n=n<<2|n>>>30,e[c]=n,f=a^s^o,n=(i<<5|i>>>27)+f+u+1859775393+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=e[c-6]^e[c-16]^e[c-28]^e[c-32],n=n<<2|n>>>30,e[c]=n,f=a&s|o&(a^s),n=(i<<5|i>>>27)+f+u+2400959708+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=e[c-6]^e[c-16]^e[c-28]^e[c-32],n=n<<2|n>>>30,e[c]=n,f=a^s^o,n=(i<<5|i>>>27)+f+u+3395469782+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+a|0,t.h2=t.h2+s|0,t.h3=t.h3+o|0,t.h4=t.h4+u|0,h-=64}}});var la=X((Bh,ha)=>{var Rt=W();it();_e();ua();var ca=ha.exports=Rt.pkcs1=Rt.pkcs1||{};ca.encode_rsa_oaep=function(t,e,r){var n,i,a,s;typeof r=="string"?(n=r,i=arguments[3]||void 0,a=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md)),a?a.start():a=Rt.md.sha1.create(),s||(s=a);var o=Math.ceil(t.n.bitLength()/8),u=o-2*a.digestLength-2;if(e.length>u){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=u,f}n||(n=""),a.update(n,"raw");for(var c=a.digest(),h="",p=u-e.length,g=0;g<p;g++)h+="\0";var l=c.getBytes()+h+""+e;if(!i)i=Rt.random.getBytes(a.digestLength);else if(i.length!==a.digestLength){var f=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw f.seedLength=i.length,f.digestLength=a.digestLength,f}var m=nr(i,o-a.digestLength-1,s),v=Rt.util.xorBytes(l,m,l.length),b=nr(v,a.digestLength,s),I=Rt.util.xorBytes(i,b,i.length);return"\0"+I+v};ca.decode_rsa_oaep=function(t,e,r){var n,i,a;typeof r=="string"?(n=r,i=arguments[3]||void 0):r&&(n=r.label||void 0,i=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var v=new Error("RSAES-OAEP encoded message length is invalid.");throw v.length=e.length,v.expectedLength=s,v}if(i===void 0?i=Rt.md.sha1.create():i.start(),a||(a=i),s<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),i.update(n,"raw");for(var o=i.digest().getBytes(),u=e.charAt(0),f=e.substring(1,i.digestLength+1),c=e.substring(1+i.digestLength),h=nr(c,i.digestLength,a),p=Rt.util.xorBytes(f,h,f.length),g=nr(p,s-i.digestLength-1,a),l=Rt.util.xorBytes(c,g,c.length),m=l.substring(0,i.digestLength),v=u!=="\0",b=0;b<i.digestLength;++b)v|=o.charAt(b)!==m.charAt(b);for(var I=1,w=i.digestLength,D=i.digestLength;D<l.length;D++){var C=l.charCodeAt(D),S=C&1^1,N=I?65534:0;v|=C&N,I=I&S,w+=I}if(v||l.charCodeAt(w)!==1)throw new Error("Invalid RSAES-OAEP padding.");return l.substring(w+1)};function nr(t,e,r){r||(r=Rt.md.sha1.create());for(var n="",i=Math.ceil(e/r.digestLength),a=0;a<i;++a){var s=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255);r.start(),r.update(t+s),n+=r.digest().getBytes()}return n.substring(0,e)}});var pa=X((Sh,ln)=>{var Gt=W();it();rr();_e();(function(){if(Gt.prime){ln.exports=Gt.prime;return}var t=ln.exports=Gt.prime=Gt.prime||{},e=Gt.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,p){return h|p};t.generateProbablePrime=function(h,p,g){typeof p=="function"&&(g=p,p={}),p=p||{};var l=p.algorithm||"PRIMEINC";typeof l=="string"&&(l={name:l}),l.options=l.options||{};var m=p.prng||Gt.random,v={nextBytes:function(b){for(var I=m.getBytesSync(b.length),w=0;w<b.length;++w)b[w]=I.charCodeAt(w)}};if(l.name==="PRIMEINC")return a(h,v,l.options,g);throw new Error("Invalid prime generation algorithm: "+l.name)};function a(h,p,g,l){return"workers"in g?u(h,p,g,l):s(h,p,g,l)}function s(h,p,g,l){var m=f(h,p),v=0,b=c(m.bitLength());"millerRabinTests"in g&&(b=g.millerRabinTests);var I=10;"maxBlockTime"in g&&(I=g.maxBlockTime),o(m,h,p,v,b,I,l)}function o(h,p,g,l,m,v,b){var I=+new Date;do{if(h.bitLength()>p&&(h=f(p,g)),h.isProbablePrime(m))return b(null,h);h.dAddOffset(r[l++%8],0)}while(v<0||+new Date-I<v);Gt.util.setImmediate(function(){o(h,p,g,l,m,v,b)})}function u(h,p,g,l){if(typeof Worker>"u")return s(h,p,g,l);var m=f(h,p),v=g.workers,b=g.workLoad||100,I=b*30/8,w=g.workerScript||"forge/prime.worker.js";if(v===-1)return Gt.util.estimateCores(function(C,S){C&&(S=2),v=S-1,D()});D();function D(){v=Math.max(1,v);for(var C=[],S=0;S<v;++S)C[S]=new Worker(w);for(var N=v,S=0;S<v;++S)C[S].addEventListener("message",K);var k=!1;function K(q){if(!k){--N;var O=q.data;if(O.found){for(var F=0;F<C.length;++F)C[F].terminate();return k=!0,l(null,new e(O.prime,16))}m.bitLength()>h&&(m=f(h,p));var H=m.toString(16);q.target.postMessage({hex:H,workLoad:b}),m.dAddOffset(I,0)}}}}function f(h,p){var g=new e(h,p),l=h-1;return g.testBit(l)||g.bitwiseTo(e.ONE.shiftLeft(l),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function c(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var ar=X((wh,Aa)=>{var L=W();Te();rr();He();la();pa();_e();it();typeof z>"u"&&(z=L.jsbn.BigInteger);var z,pn=L.util.isNodejs?$e():null,x=L.asn1,mt=L.util;L.pki=L.pki||{};Aa.exports=L.pki.rsa=L.rsa=L.rsa||{};var P=L.pki,qf=[6,4,2,4,2,4,6,2],Qf={name:"PrivateKeyInfo",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:x.Class.UNIVERSAL,type:x.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},zf={name:"RSAPrivateKey",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},Gf={name:"RSAPublicKey",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},Hf=L.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:x.Class.UNIVERSAL,type:x.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Yf={name:"DigestInfo",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:x.Class.UNIVERSAL,type:x.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:x.Class.UNIVERSAL,type:x.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},Wf=function(t){var e;if(t.algorithm in P.oids)e=P.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=x.oidToDer(e).getBytes(),i=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[]),a=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[]);a.value.push(x.create(x.Class.UNIVERSAL,x.Type.OID,!1,n)),a.value.push(x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,""));var s=x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(a),i.value.push(s),x.toDer(i).getBytes()},ma=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(z.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(z.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new z(L.util.bytesToHex(L.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(z.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),a=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(a)<0;)i=i.add(e.p);var s=i.subtract(a).multiply(e.qInv).mod(e.p).multiply(e.q).add(a);return s=s.multiply(n.modInverse(e.n)).mod(e.n),s};P.rsa.encrypt=function(t,e,r){var n=r,i,a=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=va(t,e,r)):(i=L.util.createBuffer(),i.putBytes(t));for(var s=new z(i.toHex(),16),o=ma(s,e,n),u=o.toString(16),f=L.util.createBuffer(),c=a-Math.ceil(u.length/2);c>0;)f.putByte(0),--c;return f.putBytes(L.util.hexToBytes(u)),f.getBytes()};P.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=t.length,a.expected=i,a}var s=new z(L.util.createBuffer(t).toHex(),16);if(s.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=ma(s,e,r),u=o.toString(16),f=L.util.createBuffer(),c=i-Math.ceil(u.length/2);c>0;)f.putByte(0),--c;return f.putBytes(L.util.hexToBytes(u)),n!==!1?ir(f.getBytes(),e,r):f.getBytes()};P.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||L.random,i={nextBytes:function(o){for(var u=n.getBytesSync(o.length),f=0;f<o.length;++f)o[f]=u.charCodeAt(f)}},a=r.algorithm||"PRIMEINC",s;if(a==="PRIMEINC")s={algorithm:a,state:0,bits:t,rng:i,eInt:e||65537,e:new z(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},s.e.fromInt(s.eInt);else throw new Error("Invalid key generation algorithm: "+a);return s};P.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new z(null);r.fromInt(30);for(var n=0,i=function(h,p){return h|p},a=+new Date,s,o=0;t.keys===null&&(e<=0||o<e);){if(t.state===0){var u=t.p===null?t.pBits:t.qBits,f=u-1;t.pqState===0?(t.num=new z(u,t.rng),t.num.testBit(f)||t.num.bitwiseTo(z.ONE.shiftLeft(f),i,t.num),t.num.dAddOffset(31-t.num.mod(r).byteValue(),0),n=0,++t.pqState):t.pqState===1?t.num.bitLength()>u?t.pqState=0:t.num.isProbablePrime($f(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(qf[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(z.ONE).gcd(t.e).compareTo(z.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(z.ONE),t.q1=t.q.subtract(z.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(z.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var c=t.e.modInverse(t.phi);t.keys={privateKey:P.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:P.rsa.setPublicKey(t.n,t.e)}}s=+new Date,o+=s-a,a=s}return t.keys!==null};P.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!L.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(da("generateKeyPair"))return pn.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,u,f){if(o)return n(o);n(null,{privateKey:P.privateKeyFromPem(f),publicKey:P.publicKeyFromPem(u)})});if(ya("generateKey")&&ya("exportKey"))return mt.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:ga(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return mt.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){n(o)}).then(function(o){if(o){var u=P.privateKeyFromAsn1(x.fromDer(L.util.createBuffer(o)));n(null,{privateKey:u,publicKey:P.setRsaPublicKey(u.n,u.e)})}});if(xa("generateKey")&&xa("exportKey")){var i=mt.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:ga(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(o){var u=o.target.result,f=mt.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);f.oncomplete=function(c){var h=c.target.result,p=P.privateKeyFromAsn1(x.fromDer(L.util.createBuffer(h)));n(null,{privateKey:p,publicKey:P.setRsaPublicKey(p.n,p.e)})},f.onerror=function(c){n(c)}},i.onerror=function(o){n(o)};return}}else if(da("generateKeyPairSync")){var a=pn.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:P.privateKeyFromPem(a.privateKey),publicKey:P.publicKeyFromPem(a.publicKey)}}}var s=P.rsa.createKeyPairGenerationState(t,e,r);if(!n)return P.rsa.stepKeyPairGenerationState(s,0),s.keys;Jf(s,r,n)};P.setRsaPublicKey=P.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(o,u,f){return va(o,u,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(o,u){return L.pkcs1.encode_rsa_oaep(u,o,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(o){return o}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var s=i.encode(n,r,!0);return P.rsa.encrypt(s,r,!0)},r.verify=function(n,i,a,s){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),s===void 0&&(s={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in s||(s._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(u,f){f=ir(f,r,!0);var c=x.fromDer(f,{parseAllBytes:s._parseAllDigestBytes}),h={},p=[];if(!x.validate(c,Yf,h,p)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=p,g}var l=x.derToOid(h.algorithmIdentifier);if(!(l===L.oids.md2||l===L.oids.md5||l===L.oids.sha1||l===L.oids.sha224||l===L.oids.sha256||l===L.oids.sha384||l===L.oids.sha512||l===L.oids["sha512-224"]||l===L.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=l,g}if((l===L.oids.md2||l===L.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return u===h.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(u,f){return f=ir(f,r,!0),u===f}});var o=P.rsa.decrypt(i,r,!0,!1);return a.verify(n,o,r.n.bitLength())},r};P.setRsaPrivateKey=P.rsa.setPrivateKey=function(t,e,r,n,i,a,s,o){var u={n:t,e,d:r,p:n,q:i,dP:a,dQ:s,qInv:o};return u.decrypt=function(f,c,h){typeof c=="string"?c=c.toUpperCase():c===void 0&&(c="RSAES-PKCS1-V1_5");var p=P.rsa.decrypt(f,u,!1,!1);if(c==="RSAES-PKCS1-V1_5")c={decode:ir};else if(c==="RSA-OAEP"||c==="RSAES-OAEP")c={decode:function(g,l){return L.pkcs1.decode_rsa_oaep(l,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(c)!==-1)c={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+c+'".');return c.decode(p,u,!1)},u.sign=function(f,c){var h=!1;typeof c=="string"&&(c=c.toUpperCase()),c===void 0||c==="RSASSA-PKCS1-V1_5"?(c={encode:Wf},h=1):(c==="NONE"||c==="NULL"||c===null)&&(c={encode:function(){return f}},h=1);var p=c.encode(f,u.n.bitLength());return P.rsa.encrypt(p,u,h)},u};P.wrapRsaPrivateKey=function(t){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(0).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(P.oids.rsaEncryption).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")]),x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,x.toDer(t).getBytes())])};P.privateKeyFromAsn1=function(t){var e={},r=[];if(x.validate(t,Qf,e,r)&&(t=x.fromDer(L.util.createBuffer(e.privateKey))),e={},r=[],!x.validate(t,zf,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,a,s,o,u,f,c,h;return i=L.util.createBuffer(e.privateKeyModulus).toHex(),a=L.util.createBuffer(e.privateKeyPublicExponent).toHex(),s=L.util.createBuffer(e.privateKeyPrivateExponent).toHex(),o=L.util.createBuffer(e.privateKeyPrime1).toHex(),u=L.util.createBuffer(e.privateKeyPrime2).toHex(),f=L.util.createBuffer(e.privateKeyExponent1).toHex(),c=L.util.createBuffer(e.privateKeyExponent2).toHex(),h=L.util.createBuffer(e.privateKeyCoefficient).toHex(),P.setRsaPrivateKey(new z(i,16),new z(a,16),new z(s,16),new z(o,16),new z(u,16),new z(f,16),new z(c,16),new z(h,16))};P.privateKeyToAsn1=P.privateKeyToRSAPrivateKey=function(t){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(0).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.n)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.e)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.d)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.p)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.q)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.dP)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.dQ)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.qInv))])};P.publicKeyFromAsn1=function(t){var e={},r=[];if(x.validate(t,Hf,e,r)){var n=x.derToOid(e.publicKeyOid);if(n!==P.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!x.validate(t,Gf,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var a=L.util.createBuffer(e.publicKeyModulus).toHex(),s=L.util.createBuffer(e.publicKeyExponent).toHex();return P.setRsaPublicKey(new z(a,16),new z(s,16))};P.publicKeyToAsn1=P.publicKeyToSubjectPublicKeyInfo=function(t){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(P.oids.rsaEncryption).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")]),x.create(x.Class.UNIVERSAL,x.Type.BITSTRING,!1,[P.publicKeyToRSAPublicKey(t)])])};P.publicKeyToRSAPublicKey=function(t){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.n)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Dt(t.e))])};function va(t,e,r){var n=L.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var s=i-3-t.length,o;if(r===0||r===1){o=r===0?0:255;for(var u=0;u<s;++u)n.putByte(o)}else for(;s>0;){for(var f=0,c=L.random.getBytes(s),u=0;u<s;++u)o=c.charCodeAt(u),o===0?++f:n.putByte(o);s=f}return n.putByte(0),n.putBytes(t),n}function ir(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8),a=L.util.createBuffer(t),s=a.getByte(),o=a.getByte();if(s!==0||r&&o!==0&&o!==1||!r&&o!=2||r&&o===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var u=0;if(o===0){u=i-3-n;for(var f=0;f<u;++f)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(o===1)for(u=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++u}else if(o===2)for(u=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++u}var c=a.getByte();if(c!==0||u!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function Jf(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){a(t.pBits,function(o,u){if(o)return r(o);if(t.p=u,t.q!==null)return s(o,t.q);a(t.qBits,s)})}function a(o,u){L.prime.generateProbablePrime(o,n,u)}function s(o,u){if(o)return r(o);if(t.q=u,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(z.ONE).gcd(t.e).compareTo(z.ONE)!==0){t.p=null,i();return}if(t.q.subtract(z.ONE).gcd(t.e).compareTo(z.ONE)!==0){t.q=null,a(t.qBits,s);return}if(t.p1=t.p.subtract(z.ONE),t.q1=t.q.subtract(z.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(z.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,a(t.qBits,s);return}var c=t.e.modInverse(t.phi);t.keys={privateKey:P.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:P.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function Dt(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=L.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function $f(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function da(t){return L.util.isNodejs&&typeof pn[t]=="function"}function ya(t){return typeof mt.globalScope<"u"&&typeof mt.globalScope.crypto=="object"&&typeof mt.globalScope.crypto.subtle=="object"&&typeof mt.globalScope.crypto.subtle[t]=="function"}function xa(t){return typeof mt.globalScope<"u"&&typeof mt.globalScope.msCrypto=="object"&&typeof mt.globalScope.msCrypto.subtle=="object"&&typeof mt.globalScope.msCrypto.subtle[t]=="function"}function ga(t){for(var e=L.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}});var Ca=X((Ch,wa)=>{var R=W();qe();Te();Di();$t();He();nn();Mi();_e();$i();ar();it();typeof ba>"u"&&(ba=R.jsbn.BigInteger);var ba,A=R.asn1,U=R.pki=R.pki||{};wa.exports=U.pbe=R.pbe=R.pbe||{};var jt=U.oids,Xf={name:"EncryptedPrivateKeyInfo",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Zf={name:"PBES2Algorithms",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},jf={name:"pkcs-12PbeParams",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"iterations"}]};U.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=R.random.getBytesSync(r.saltSize),i=r.count,a=A.integerToDer(i),s,o,u;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var f,c,h;switch(r.algorithm){case"aes128":s=16,f=16,c=jt["aes128-CBC"],h=R.aes.createEncryptionCipher;break;case"aes192":s=24,f=16,c=jt["aes192-CBC"],h=R.aes.createEncryptionCipher;break;case"aes256":s=32,f=16,c=jt["aes256-CBC"],h=R.aes.createEncryptionCipher;break;case"des":s=8,f=8,c=jt.desCBC,h=R.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),l=Sa(g),m=R.pkcs5.pbkdf2(e,n,i,s,l),v=R.random.getBytesSync(f),b=h(m);b.start(v),b.update(A.toDer(t)),b.finish(),u=b.output.getBytes();var I=tu(n,a,s,g);o=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(jt.pkcs5PBES2).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(jt.pkcs5PBKDF2).getBytes()),I]),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(c).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,v)])])])}else if(r.algorithm==="3des"){s=24;var w=new R.util.ByteBuffer(n),m=U.pbe.generatePkcs12Key(e,w,1,i,s),v=U.pbe.generatePkcs12Key(e,w,2,i,s),b=R.des.createEncryptionCipher(m);b.start(v),b.update(A.toDer(t)),b.finish(),u=b.output.getBytes(),o=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(jt["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,n),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,a.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var D=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[o,A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,u)]);return D};U.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!A.validate(t,Xf,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var s=A.derToOid(n.encryptionOid),o=U.pbe.getCipher(s,n.encryptionParams,e),u=R.util.createBuffer(n.encryptedData);return o.update(u),o.finish()&&(r=A.fromDer(o.output)),r};U.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:A.toDer(t).getBytes()};return R.pem.encode(r,{maxline:e})};U.encryptedPrivateKeyFromPem=function(t){var e=R.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return A.fromDer(e.body)};U.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=U.wrapRsaPrivateKey(U.privateKeyToAsn1(t));return n=U.encryptPrivateKeyInfo(n,e,r),U.encryptedPrivateKeyToPem(n)}var i,a,s,o;switch(r.algorithm){case"aes128":i="AES-128-CBC",s=16,a=R.random.getBytesSync(16),o=R.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",s=24,a=R.random.getBytesSync(16),o=R.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",s=32,a=R.random.getBytesSync(16),o=R.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",s=24,a=R.random.getBytesSync(8),o=R.des.createEncryptionCipher;break;case"des":i="DES-CBC",s=8,a=R.random.getBytesSync(8),o=R.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var f=R.pbe.opensslDeriveBytes(e,a.substr(0,8),s),c=o(f);c.start(a),c.update(A.toDer(U.privateKeyToAsn1(t))),c.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:R.util.bytesToHex(a).toUpperCase()},body:c.output.getBytes()};return R.pem.encode(h)};U.decryptRsaPrivateKey=function(t,e){var r=null,n=R.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var a,s;switch(n.dekInfo.algorithm){case"DES-CBC":a=8,s=R.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,s=R.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,s=R.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,s=R.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,s=R.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,s=function(h){return R.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":a=8,s=function(h){return R.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":a=16,s=function(h){return R.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var o=R.util.hexToBytes(n.dekInfo.parameters),u=R.pbe.opensslDeriveBytes(e,o.substr(0,8),a),f=s(u);if(f.start(o),f.update(R.util.createBuffer(n.body)),f.finish())r=f.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=U.decryptPrivateKeyInfo(A.fromDer(r),e):r=A.fromDer(r),r!==null&&(r=U.privateKeyFromAsn1(r)),r};U.pbe.generatePkcs12Key=function(t,e,r,n,i,a){var s,o;if(typeof a>"u"||a===null){if(!("sha1"in R.md))throw new Error('"sha1" hash algorithm unavailable.');a=R.md.sha1.create()}var u=a.digestLength,f=a.blockLength,c=new R.util.ByteBuffer,h=new R.util.ByteBuffer;if(t!=null){for(o=0;o<t.length;o++)h.putInt16(t.charCodeAt(o));h.putInt16(0)}var p=h.length(),g=e.length(),l=new R.util.ByteBuffer;l.fillWithByte(r,f);var m=f*Math.ceil(g/f),v=new R.util.ByteBuffer;for(o=0;o<m;o++)v.putByte(e.at(o%g));var b=f*Math.ceil(p/f),I=new R.util.ByteBuffer;for(o=0;o<b;o++)I.putByte(h.at(o%p));var w=v;w.putBuffer(I);for(var D=Math.ceil(i/u),C=1;C<=D;C++){var S=new R.util.ByteBuffer;S.putBytes(l.bytes()),S.putBytes(w.bytes());for(var N=0;N<n;N++)a.start(),a.update(S.getBytes()),S=a.digest();var k=new R.util.ByteBuffer;for(o=0;o<f;o++)k.putByte(S.at(o%u));var K=Math.ceil(g/f)+Math.ceil(p/f),q=new R.util.ByteBuffer;for(s=0;s<K;s++){var O=new R.util.ByteBuffer(w.getBytes(f)),F=511;for(o=k.length()-1;o>=0;o--)F=F>>8,F+=k.at(o)+O.at(o),O.setAt(o,F&255);q.putBuffer(O)}w=q,c.putBuffer(S)}return c.truncate(c.length()-i),c};U.pbe.getCipher=function(t,e,r){switch(t){case U.oids.pkcs5PBES2:return U.pbe.getCipherForPBES2(t,e,r);case U.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case U.oids["pbewithSHAAnd40BitRC2-CBC"]:return U.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};U.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!A.validate(e,Zf,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(t=A.derToOid(n.kdfOid),t!==U.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=t,a.supportedOids=["pkcs5PBKDF2"],a}if(t=A.derToOid(n.encOid),t!==U.oids["aes128-CBC"]&&t!==U.oids["aes192-CBC"]&&t!==U.oids["aes256-CBC"]&&t!==U.oids["des-EDE3-CBC"]&&t!==U.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=t,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var s=n.kdfSalt,o=R.util.createBuffer(n.kdfIterationCount);o=o.getInt(o.length()<<3);var u,f;switch(U.oids[t]){case"aes128-CBC":u=16,f=R.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,f=R.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,f=R.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,f=R.des.createDecryptionCipher;break;case"desCBC":u=8,f=R.des.createDecryptionCipher;break}var c=Ba(n.prfOid),h=R.pkcs5.pbkdf2(r,s,o,u,c),p=n.encIv,g=f(h);return g.start(p),g};U.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!A.validate(e,jf,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var s=R.util.createBuffer(n.salt),o=R.util.createBuffer(n.iterations);o=o.getInt(o.length()<<3);var u,f,c;switch(t){case U.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,f=8,c=R.des.startDecrypting;break;case U.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,f=8,c=function(m,v){var b=R.rc2.createDecryptionCipher(m,40);return b.start(v,null),b};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=t,a}var h=Ba(n.prfOid),p=U.pbe.generatePkcs12Key(r,s,1,o,u,h);h.start();var g=U.pbe.generatePkcs12Key(r,s,2,o,f,h);return c(p,g)};U.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in R.md))throw new Error('"md5" hash algorithm unavailable.');n=R.md.md5.create()}e===null&&(e="");for(var i=[Ea(n,t+e)],a=16,s=1;a<r;++s,a+=16)i.push(Ea(n,i[s-1]+t+e));return i.join("").substr(0,r)};function Ea(t,e){return t.start().update(e).digest().getBytes()}function Ba(t){var e;if(!t)e="hmacWithSHA1";else if(e=U.oids[A.derToOid(t)],!e){var r=new Error("Unsupported PRF OID.");throw r.oid=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}return Sa(e)}function Sa(t){var e=R.md;switch(t){case"hmacWithSHA224":e=R.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":t=t.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!e||!(t in e))throw new Error("Unknown hash algorithm: "+t);return e[t].create()}function tu(t,e,r,n){var i=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,t),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,e.getBytes())]);return n!=="hmacWithSHA1"&&i.value.push(A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,R.util.hexToBytes(r.toString(16))),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(U.oids[n]).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.NULL,!1,"")])),i}});var qa=X((Xl,Va)=>{var tt=W();$t();it();var ke=Va.exports=tt.sha512=tt.sha512||{};tt.md.sha512=tt.md.algorithms.sha512=ke;var Fa=tt.sha384=tt.sha512.sha384=tt.sha512.sha384||{};Fa.create=function(){return ke.create("SHA-384")};tt.md.sha384=tt.md.algorithms.sha384=Fa;tt.sha512.sha256=tt.sha512.sha256||{create:function(){return ke.create("SHA-512/256")}};tt.md["sha512/256"]=tt.md.algorithms["sha512/256"]=tt.sha512.sha256;tt.sha512.sha224=tt.sha512.sha224||{create:function(){return ke.create("SHA-512/224")}};tt.md["sha512/224"]=tt.md.algorithms["sha512/224"]=tt.sha512.sha224;ke.create=function(t){if(Oa||xu(),typeof t>"u"&&(t="SHA-512"),!(t in ne))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=ne[t],r=null,n=tt.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var s=64;switch(t){case"SHA-384":s=48;break;case"SHA-512/256":s=32;break;case"SHA-512/224":s=28;break}var o={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:s,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var u=o.messageLengthSize/4,f=0;f<u;++f)o.fullMessageLength.push(0);n=tt.util.createBuffer(),r=new Array(e.length);for(var f=0;f<e.length;++f)r[f]=e[f].slice(0);return o},o.start(),o.update=function(u,f){f==="utf8"&&(u=tt.util.encodeUtf8(u));var c=u.length;o.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var h=o.fullMessageLength.length-1;h>=0;--h)o.fullMessageLength[h]+=c[1],c[1]=c[0]+(o.fullMessageLength[h]/4294967296>>>0),o.fullMessageLength[h]=o.fullMessageLength[h]>>>0,c[0]=c[1]/4294967296>>>0;return n.putBytes(u),Ma(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),o},o.digest=function(){var u=tt.util.createBuffer();u.putBytes(n.bytes());var f=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,c=f&o.blockLength-1;u.putBytes(Tn.substr(0,o.blockLength-c));for(var h,p,g=o.fullMessageLength[0]*8,l=0;l<o.fullMessageLength.length-1;++l)h=o.fullMessageLength[l+1]*8,p=h/4294967296>>>0,g+=p,u.putInt32(g>>>0),g=h>>>0;u.putInt32(g);for(var m=new Array(r.length),l=0;l<r.length;++l)m[l]=r[l].slice(0);Ma(m,i,u);var v=tt.util.createBuffer(),b;t==="SHA-512"?b=m.length:t==="SHA-384"?b=m.length-2:b=m.length-4;for(var l=0;l<b;++l)v.putInt32(m[l][0]),(l!==b-1||t!=="SHA-512/224")&&v.putInt32(m[l][1]);return v},o};var Tn=null,Oa=!1,_n=null,ne=null;function xu(){Tn="\x80",Tn+=tt.util.fillString("\0",128),_n=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],ne={},ne["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],ne["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],ne["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],ne["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],Oa=!0}function Ma(t,e,r){for(var n,i,a,s,o,u,f,c,h,p,g,l,m,v,b,I,w,D,C,S,N,k,K,q,O,F,H,J,M,Q,_,rt,$,d,kt,Vn=r.length();Vn>=128;){for(M=0;M<16;++M)e[M][0]=r.getInt32()>>>0,e[M][1]=r.getInt32()>>>0;for(;M<80;++M)rt=e[M-2],Q=rt[0],_=rt[1],n=((Q>>>19|_<<13)^(_>>>29|Q<<3)^Q>>>6)>>>0,i=((Q<<13|_>>>19)^(_<<3|Q>>>29)^(Q<<26|_>>>6))>>>0,d=e[M-15],Q=d[0],_=d[1],a=((Q>>>1|_<<31)^(Q>>>8|_<<24)^Q>>>7)>>>0,s=((Q<<31|_>>>1)^(Q<<24|_>>>8)^(Q<<25|_>>>7))>>>0,$=e[M-7],kt=e[M-16],_=i+$[1]+s+kt[1],e[M][0]=n+$[0]+a+kt[0]+(_/4294967296>>>0)>>>0,e[M][1]=_>>>0;for(m=t[0][0],v=t[0][1],b=t[1][0],I=t[1][1],w=t[2][0],D=t[2][1],C=t[3][0],S=t[3][1],N=t[4][0],k=t[4][1],K=t[5][0],q=t[5][1],O=t[6][0],F=t[6][1],H=t[7][0],J=t[7][1],M=0;M<80;++M)f=((N>>>14|k<<18)^(N>>>18|k<<14)^(k>>>9|N<<23))>>>0,c=((N<<18|k>>>14)^(N<<14|k>>>18)^(k<<23|N>>>9))>>>0,h=(O^N&(K^O))>>>0,p=(F^k&(q^F))>>>0,o=((m>>>28|v<<4)^(v>>>2|m<<30)^(v>>>7|m<<25))>>>0,u=((m<<4|v>>>28)^(v<<30|m>>>2)^(v<<25|m>>>7))>>>0,g=(m&b|w&(m^b))>>>0,l=(v&I|D&(v^I))>>>0,_=J+c+p+_n[M][1]+e[M][1],n=H+f+h+_n[M][0]+e[M][0]+(_/4294967296>>>0)>>>0,i=_>>>0,_=u+l,a=o+g+(_/4294967296>>>0)>>>0,s=_>>>0,H=O,J=F,O=K,F=q,K=N,q=k,_=S+i,N=C+n+(_/4294967296>>>0)>>>0,k=_>>>0,C=w,S=D,w=b,D=I,b=m,I=v,_=i+s,m=n+a+(_/4294967296>>>0)>>>0,v=_>>>0;_=t[0][1]+v,t[0][0]=t[0][0]+m+(_/4294967296>>>0)>>>0,t[0][1]=_>>>0,_=t[1][1]+I,t[1][0]=t[1][0]+b+(_/4294967296>>>0)>>>0,t[1][1]=_>>>0,_=t[2][1]+D,t[2][0]=t[2][0]+w+(_/4294967296>>>0)>>>0,t[2][1]=_>>>0,_=t[3][1]+S,t[3][0]=t[3][0]+C+(_/4294967296>>>0)>>>0,t[3][1]=_>>>0,_=t[4][1]+k,t[4][0]=t[4][0]+N+(_/4294967296>>>0)>>>0,t[4][1]=_>>>0,_=t[5][1]+q,t[5][0]=t[5][0]+K+(_/4294967296>>>0)>>>0,t[5][1]=_>>>0,_=t[6][1]+F,t[6][0]=t[6][0]+O+(_/4294967296>>>0)>>>0,t[6][1]=_>>>0,_=t[7][1]+J,t[7][0]=t[7][0]+H+(_/4294967296>>>0)>>>0,t[7][1]=_>>>0,Vn-=128}}});var n0=X((kd,r0)=>{var Uu=(t,e)=>function(){return e||(0,t[Object.keys(t)[0]])((e={exports:{}}).exports,e),e.exports},Mu=(()=>{for(var t=new Uint8Array(128),e=0;e<64;e++)t[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;return r=>{for(var n=r.length,i=new Uint8Array((n-(r[n-1]=="=")-(r[n-2]=="="))*3/4|0),a=0,s=0;a<n;){var o=t[r.charCodeAt(a++)],u=t[r.charCodeAt(a++)],f=t[r.charCodeAt(a++)],c=t[r.charCodeAt(a++)];i[s++]=o<<2|u>>4,i[s++]=u<<4|f>>2,i[s++]=f<<6|c}return i}})(),Fu=Uu({"wasm-binary:./xsalsa20.wat"(t,e){e.exports=Mu("AGFzbQEAAAABGgNgBn9/f39/fwBgBn9/f39+fwF+YAN/f38AAwcGAAEBAgICBQUBAQroBwcoAwZtZW1vcnkCAAx4c2Fsc2EyMF94b3IAAAxjb3JlX3NhbHNhMjAABArqEQYYACAAIAEgAiADIAQgACkDACAFEAE3AwALPQBB8AAgAyAFEAMgACABIAIgA0EQaiAEQfAAEAJB8ABCADcDAEH4AEIANwMAQYABQgA3AwBBiAFCADcDAAuHBQEBfyACQQBGBEBCAA8LQdAAIAUpAwA3AwBB2AAgBUEIaikDADcDAEHgACAFQRBqKQMANwMAQegAIAVBGGopAwA3AwBBACADKQMANwMAQQggBDcDAAJAA0AgAkHAAEkNAUEQQQBB0AAQBSAAIAEpAwBBECkDAIU3AwAgAEEIaiABQQhqKQMAQRgpAwCFNwMAIABBEGogAUEQaikDAEEgKQMAhTcDACAAQRhqIAFBGGopAwBBKCkDAIU3AwAgAEEgaiABQSBqKQMAQTApAwCFNwMAIABBKGogAUEoaikDAEE4KQMAhTcDACAAQTBqIAFBMGopAwBBwAApAwCFNwMAIABBOGogAUE4aikDAEHIACkDAIU3AwBBCEEIKQMAQgF8NwMAIABBwABqIQAgAUHAAGohASACQcAAayECDAALC0EIKQMAIQQgAkEASwRAQRBBAEHQABAFAkACQAJAAkACQAJAAkACQCACQQhuDgcHBgUEAwIBAAsgAEE4aiABQThqKQMAQcgAKQMAhTcDAAsgAEEwaiABQTBqKQMAQcAAKQMAhTcDAAsgAEEoaiABQShqKQMAQTgpAwCFNwMACyAAQSBqIAFBIGopAwBBMCkDAIU3AwALIABBGGogAUEYaikDAEEoKQMAhTcDAAsgAEEQaiABQRBqKQMAQSApAwCFNwMACyAAQQhqIAFBCGopAwBBGCkDAIU3AwALIAAgASkDAEEQKQMAhTcDAAtBEEIANwMAQRhCADcDAEEgQgA3AwBBKEIANwMAQTBCADcDAEE4QgA3AwBBwABCADcDAEHIAEIANwMAQdAAQgA3AwBB2ABCADcDAEHgAEIANwMAQegAQgA3AwAgBA8LnQUBEX9B5fDBiwYhA0HuyIGZAyEIQbLaiMsHIQ1B9MqB2QYhEiACKAIAIQQgAkEEaigCACEFIAJBCGooAgAhBiACQQxqKAIAIQcgAkEQaigCACEOIAJBFGooAgAhDyACQRhqKAIAIRAgAkEcaigCACERIAEoAgAhCSABQQRqKAIAIQogAUEIaigCACELIAFBDGooAgAhDEEUIRMCQANAIBNBAEYNASAHIAMgD2pBB3dzIQcgCyAHIANqQQl3cyELIA8gCyAHakENd3MhDyADIA8gC2pBEndzIQMgDCAIIARqQQd3cyEMIBAgDCAIakEJd3MhECAEIBAgDGpBDXdzIQQgCCAEIBBqQRJ3cyEIIBEgDSAJakEHd3MhESAFIBEgDWpBCXdzIQUgCSAFIBFqQQ13cyEJIA0gCSAFakESd3MhDSAGIBIgDmpBB3dzIQYgCiAGIBJqQQl3cyEKIA4gCiAGakENd3MhDiASIA4gCmpBEndzIRIgBCADIAZqQQd3cyEEIAUgBCADakEJd3MhBSAGIAUgBGpBDXdzIQYgAyAGIAVqQRJ3cyEDIAkgCCAHakEHd3MhCSAKIAkgCGpBCXdzIQogByAKIAlqQQ13cyEHIAggByAKakESd3MhCCAOIA0gDGpBB3dzIQ4gCyAOIA1qQQl3cyELIAwgCyAOakENd3MhDCANIAwgC2pBEndzIQ0gDyASIBFqQQd3cyEPIBAgDyASakEJd3MhECARIBAgD2pBDXdzIREgEiARIBBqQRJ3cyESIBNBAmshEwwACwsgACADNgIAIABBBGogCDYCACAAQQhqIA02AgAgAEEMaiASNgIAIABBEGogCTYCACAAQRRqIAo2AgAgAEEYaiALNgIAIABBHGogDDYCAAsKACAAIAEgAhAFC90GASF/QeXwwYsGIQNB7siBmQMhCEGy2ojLByENQfTKgdkGIRIgAigCACEEIAJBBGooAgAhBSACQQhqKAIAIQYgAkEMaigCACEHIAJBEGooAgAhDiACQRRqKAIAIQ8gAkEYaigCACEQIAJBHGooAgAhESABKAIAIQkgAUEEaigCACEKIAFBCGooAgAhCyABQQxqKAIAIQwgAyETIAQhFCAFIRUgBiEWIAchFyAIIRggCSEZIAohGiALIRsgDCEcIA0hHSAOIR4gDyEfIBAhICARISEgEiEiQRQhIwJAA0AgI0EARg0BIAcgAyAPakEHd3MhByALIAcgA2pBCXdzIQsgDyALIAdqQQ13cyEPIAMgDyALakESd3MhAyAMIAggBGpBB3dzIQwgECAMIAhqQQl3cyEQIAQgECAMakENd3MhBCAIIAQgEGpBEndzIQggESANIAlqQQd3cyERIAUgESANakEJd3MhBSAJIAUgEWpBDXdzIQkgDSAJIAVqQRJ3cyENIAYgEiAOakEHd3MhBiAKIAYgEmpBCXdzIQogDiAKIAZqQQ13cyEOIBIgDiAKakESd3MhEiAEIAMgBmpBB3dzIQQgBSAEIANqQQl3cyEFIAYgBSAEakENd3MhBiADIAYgBWpBEndzIQMgCSAIIAdqQQd3cyEJIAogCSAIakEJd3MhCiAHIAogCWpBDXdzIQcgCCAHIApqQRJ3cyEIIA4gDSAMakEHd3MhDiALIA4gDWpBCXdzIQsgDCALIA5qQQ13cyEMIA0gDCALakESd3MhDSAPIBIgEWpBB3dzIQ8gECAPIBJqQQl3cyEQIBEgECAPakENd3MhESASIBEgEGpBEndzIRIgI0ECayEjDAALCyAAIAMgE2o2AgAgAEEEaiAEIBRqNgIAIABBCGogBSAVajYCACAAQQxqIAYgFmo2AgAgAEEQaiAHIBdqNgIAIABBFGogCCAYajYCACAAQRhqIAkgGWo2AgAgAEEcaiAKIBpqNgIAIABBIGogCyAbajYCACAAQSRqIAwgHGo2AgAgAEEoaiANIB1qNgIAIABBLGogDiAeajYCACAAQTBqIA8gH2o2AgAgAEE0aiAQICBqNgIAIABBOGogESAhajYCACAAQTxqIBIgImo2AgAL")}}),Ou=Fu(),Vu=new WebAssembly.Module(Ou);r0.exports=t=>new WebAssembly.Instance(Vu,t).exports});var o0=X((Pd,s0)=>{var Ke=typeof WebAssembly<"u"&&n0()(),vr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),Nt=144,ve=Nt,mr=[];s0.exports=Lt;Lt.NONCEBYTES=24;Lt.KEYBYTES=32;Lt.core_hsalsa20=a0;Lt.SIGMA=vr;function Lt(t,e){if(!(this instanceof Lt))return new Lt(t,e);if(!t||t.length<24)throw new Error("nonce must be at least 24 bytes");if(!e||e.length<32)throw new Error("key must be at least 32 bytes");this._xor=Ke?new Ar(t,e):new Pn(t,e)}Lt.prototype.update=function(t,e){if(!t)throw new Error("input must be Uint8Array or Buffer");return e||(e=new Uint8Array(t.length)),t.length&&this._xor.update(t,e),e};Lt.prototype.final=Lt.prototype.finalize=function(){this._xor.finalize(),this._xor=null};function Ar(t,e){mr.length||(mr.push(Nt),Nt+=64),this._pointer=mr.pop(),this._nonce=this._pointer+8,this._key=this._nonce+24,this._overflow=0,this._memory=new Uint8Array(Ke.memory.buffer),this._memory.fill(0,this._pointer,this._pointer+8),this._memory.set(t,this._nonce),this._memory.set(e,this._key)}Ar.prototype.realloc=function(t){Ke.memory.grow(Math.ceil(Math.abs(t-this._memory.length)/65536)),this._memory=new Uint8Array(Ke.memory.buffer)};Ar.prototype.update=function(t,e){var r=this._overflow+t.length,n=Nt+this._overflow;ve=Nt+r,ve>=this._memory.length&&this.realloc(ve),this._memory.set(t,n),Ke.xsalsa20_xor(this._pointer,Nt,Nt,r,this._nonce,this._key),e.set(this._memory.subarray(n,Nt+r)),this._overflow=r&63};Ar.prototype.finalize=function(){this._memory.fill(0,this._pointer,this._key+32),ve>Nt&&(this._memory.fill(0,Nt,ve),ve=0),mr.push(this._pointer)};function Pn(t,e){this._s=new Uint8Array(32),this._z=new Uint8Array(16),this._overflow=0,a0(this._s,t,e,vr);for(var r=0;r<8;r++)this._z[r]=t[r+16]}Pn.prototype.update=function(t,e){for(var r=new Uint8Array(64),n=0,i=this._overflow,a=t.length+this._overflow,s=this._z,o=-this._overflow,u=-this._overflow;a>=64;){for(i0(r,s,this._s,vr);i<64;i++)e[u+i]=t[o+i]^r[i];for(n=1,i=8;i<16;i++)n+=s[i]&255|0,s[i]=n&255,n>>>=8;a-=64,u+=64,o+=64,i=0}if(a>0)for(i0(r,s,this._s,vr);i<a;i++)e[u+i]=t[o+i]^r[i];this._overflow=a&63};Pn.prototype.finalize=function(){this._s.fill(0),this._z.fill(0)};function i0(t,e,r,n){for(var i=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,a=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,s=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,o=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,u=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,f=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,c=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,h=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,p=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,g=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,l=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,m=r[16]&255|(r[17]&255)<<8|(r[18]&255)<<16|(r[19]&255)<<24,v=r[20]&255|(r[21]&255)<<8|(r[22]&255)<<16|(r[23]&255)<<24,b=r[24]&255|(r[25]&255)<<8|(r[26]&255)<<16|(r[27]&255)<<24,I=r[28]&255|(r[29]&255)<<8|(r[30]&255)<<16|(r[31]&255)<<24,w=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,D=i,C=a,S=s,N=o,k=u,K=f,q=c,O=h,F=p,H=g,J=l,M=m,Q=v,_=b,rt=I,$=w,d,kt=0;kt<20;kt+=2)d=D+Q|0,k^=d<<7|d>>>25,d=k+D|0,F^=d<<9|d>>>23,d=F+k|0,Q^=d<<13|d>>>19,d=Q+F|0,D^=d<<18|d>>>14,d=K+C|0,H^=d<<7|d>>>25,d=H+K|0,_^=d<<9|d>>>23,d=_+H|0,C^=d<<13|d>>>19,d=C+_|0,K^=d<<18|d>>>14,d=J+q|0,rt^=d<<7|d>>>25,d=rt+J|0,S^=d<<9|d>>>23,d=S+rt|0,q^=d<<13|d>>>19,d=q+S|0,J^=d<<18|d>>>14,d=$+M|0,N^=d<<7|d>>>25,d=N+$|0,O^=d<<9|d>>>23,d=O+N|0,M^=d<<13|d>>>19,d=M+O|0,$^=d<<18|d>>>14,d=D+N|0,C^=d<<7|d>>>25,d=C+D|0,S^=d<<9|d>>>23,d=S+C|0,N^=d<<13|d>>>19,d=N+S|0,D^=d<<18|d>>>14,d=K+k|0,q^=d<<7|d>>>25,d=q+K|0,O^=d<<9|d>>>23,d=O+q|0,k^=d<<13|d>>>19,d=k+O|0,K^=d<<18|d>>>14,d=J+H|0,M^=d<<7|d>>>25,d=M+J|0,F^=d<<9|d>>>23,d=F+M|0,H^=d<<13|d>>>19,d=H+F|0,J^=d<<18|d>>>14,d=$+rt|0,Q^=d<<7|d>>>25,d=Q+$|0,_^=d<<9|d>>>23,d=_+Q|0,rt^=d<<13|d>>>19,d=rt+_|0,$^=d<<18|d>>>14;D=D+i|0,C=C+a|0,S=S+s|0,N=N+o|0,k=k+u|0,K=K+f|0,q=q+c|0,O=O+h|0,F=F+p|0,H=H+g|0,J=J+l|0,M=M+m|0,Q=Q+v|0,_=_+b|0,rt=rt+I|0,$=$+w|0,t[0]=D>>>0&255,t[1]=D>>>8&255,t[2]=D>>>16&255,t[3]=D>>>24&255,t[4]=C>>>0&255,t[5]=C>>>8&255,t[6]=C>>>16&255,t[7]=C>>>24&255,t[8]=S>>>0&255,t[9]=S>>>8&255,t[10]=S>>>16&255,t[11]=S>>>24&255,t[12]=N>>>0&255,t[13]=N>>>8&255,t[14]=N>>>16&255,t[15]=N>>>24&255,t[16]=k>>>0&255,t[17]=k>>>8&255,t[18]=k>>>16&255,t[19]=k>>>24&255,t[20]=K>>>0&255,t[21]=K>>>8&255,t[22]=K>>>16&255,t[23]=K>>>24&255,t[24]=q>>>0&255,t[25]=q>>>8&255,t[26]=q>>>16&255,t[27]=q>>>24&255,t[28]=O>>>0&255,t[29]=O>>>8&255,t[30]=O>>>16&255,t[31]=O>>>24&255,t[32]=F>>>0&255,t[33]=F>>>8&255,t[34]=F>>>16&255,t[35]=F>>>24&255,t[36]=H>>>0&255,t[37]=H>>>8&255,t[38]=H>>>16&255,t[39]=H>>>24&255,t[40]=J>>>0&255,t[41]=J>>>8&255,t[42]=J>>>16&255,t[43]=J>>>24&255,t[44]=M>>>0&255,t[45]=M>>>8&255,t[46]=M>>>16&255,t[47]=M>>>24&255,t[48]=Q>>>0&255,t[49]=Q>>>8&255,t[50]=Q>>>16&255,t[51]=Q>>>24&255,t[52]=_>>>0&255,t[53]=_>>>8&255,t[54]=_>>>16&255,t[55]=_>>>24&255,t[56]=rt>>>0&255,t[57]=rt>>>8&255,t[58]=rt>>>16&255,t[59]=rt>>>24&255,t[60]=$>>>0&255,t[61]=$>>>8&255,t[62]=$>>>16&255,t[63]=$>>>24&255}function a0(t,e,r,n){for(var i=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,a=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,s=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,o=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,u=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,f=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,c=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,h=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,p=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,g=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,l=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,m=r[16]&255|(r[17]&255)<<8|(r[18]&255)<<16|(r[19]&255)<<24,v=r[20]&255|(r[21]&255)<<8|(r[22]&255)<<16|(r[23]&255)<<24,b=r[24]&255|(r[25]&255)<<8|(r[26]&255)<<16|(r[27]&255)<<24,I=r[28]&255|(r[29]&255)<<8|(r[30]&255)<<16|(r[31]&255)<<24,w=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,D=i,C=a,S=s,N=o,k=u,K=f,q=c,O=h,F=p,H=g,J=l,M=m,Q=v,_=b,rt=I,$=w,d,kt=0;kt<20;kt+=2)d=D+Q|0,k^=d<<7|d>>>25,d=k+D|0,F^=d<<9|d>>>23,d=F+k|0,Q^=d<<13|d>>>19,d=Q+F|0,D^=d<<18|d>>>14,d=K+C|0,H^=d<<7|d>>>25,d=H+K|0,_^=d<<9|d>>>23,d=_+H|0,C^=d<<13|d>>>19,d=C+_|0,K^=d<<18|d>>>14,d=J+q|0,rt^=d<<7|d>>>25,d=rt+J|0,S^=d<<9|d>>>23,d=S+rt|0,q^=d<<13|d>>>19,d=q+S|0,J^=d<<18|d>>>14,d=$+M|0,N^=d<<7|d>>>25,d=N+$|0,O^=d<<9|d>>>23,d=O+N|0,M^=d<<13|d>>>19,d=M+O|0,$^=d<<18|d>>>14,d=D+N|0,C^=d<<7|d>>>25,d=C+D|0,S^=d<<9|d>>>23,d=S+C|0,N^=d<<13|d>>>19,d=N+S|0,D^=d<<18|d>>>14,d=K+k|0,q^=d<<7|d>>>25,d=q+K|0,O^=d<<9|d>>>23,d=O+q|0,k^=d<<13|d>>>19,d=k+O|0,K^=d<<18|d>>>14,d=J+H|0,M^=d<<7|d>>>25,d=M+J|0,F^=d<<9|d>>>23,d=F+M|0,H^=d<<13|d>>>19,d=H+F|0,J^=d<<18|d>>>14,d=$+rt|0,Q^=d<<7|d>>>25,d=Q+$|0,_^=d<<9|d>>>23,d=_+Q|0,rt^=d<<13|d>>>19,d=rt+_|0,$^=d<<18|d>>>14;t[0]=D>>>0&255,t[1]=D>>>8&255,t[2]=D>>>16&255,t[3]=D>>>24&255,t[4]=K>>>0&255,t[5]=K>>>8&255,t[6]=K>>>16&255,t[7]=K>>>24&255,t[8]=J>>>0&255,t[9]=J>>>8&255,t[10]=J>>>16&255,t[11]=J>>>24&255,t[12]=$>>>0&255,t[13]=$>>>8&255,t[14]=$>>>16&255,t[15]=$>>>24&255,t[16]=q>>>0&255,t[17]=q>>>8&255,t[18]=q>>>16&255,t[19]=q>>>24&255,t[20]=O>>>0&255,t[21]=O>>>8&255,t[22]=O>>>16&255,t[23]=O>>>24&255,t[24]=F>>>0&255,t[25]=F>>>8&255,t[26]=F>>>16&255,t[27]=F>>>24&255,t[28]=H>>>0&255,t[29]=H>>>8&255,t[30]=H>>>16&255,t[31]=H>>>24&255}});var Qu={};dt(Qu,{generateKey:()=>h0,preSharedKey:()=>qu});var ie=class extends Error{code;props;constructor(e,r,n){super(e),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};var $c=at(qe(),1),Ls=at(W(),1);function qt(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var Kr={};dt(Kr,{base10:()=>L0});var tc=new Uint8Array(0);function ni(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function Pt(t){if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")}function ii(t){return new TextEncoder().encode(t)}function ai(t){return new TextDecoder().decode(t)}function T0(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),s=a.charCodeAt(0);if(r[s]!==255)throw new TypeError(a+" is ambiguous");r[s]=i}var o=t.length,u=t.charAt(0),f=Math.log(o)/Math.log(256),c=Math.log(256)/Math.log(o);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var m=0,v=0,b=0,I=l.length;b!==I&&l[b]===0;)b++,m++;for(var w=(I-b)*c+1>>>0,D=new Uint8Array(w);b!==I;){for(var C=l[b],S=0,N=w-1;(C!==0||S<v)&&N!==-1;N--,S++)C+=256*D[N]>>>0,D[N]=C%o>>>0,C=C/o>>>0;if(C!==0)throw new Error("Non-zero carry");v=S,b++}for(var k=w-v;k!==w&&D[k]===0;)k++;for(var K=u.repeat(m);k<w;++k)K+=t.charAt(D[k]);return K}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var m=0;if(l[m]!==" "){for(var v=0,b=0;l[m]===u;)v++,m++;for(var I=(l.length-m)*f+1>>>0,w=new Uint8Array(I);l[m];){var D=r[l.charCodeAt(m)];if(D===255)return;for(var C=0,S=I-1;(D!==0||C<b)&&S!==-1;S--,C++)D+=o*w[S]>>>0,w[S]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");b=C,m++}if(l[m]!==" "){for(var N=I-b;N!==I&&w[N]===0;)N++;for(var k=new Uint8Array(v+(I-N)),K=v;N!==I;)k[K++]=w[N++];return k}}}function g(l){var m=p(l);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:p,decode:g}}var _0=T0,R0=_0,oi=R0;var Nr=class{name;prefix;baseEncode;constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Lr=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return fi(this,e)}},kr=class{decoders;constructor(e){this.decoders=e}or(e){return fi(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function fi(t,e){return new kr({...t.decoders??{[t.prefix]:t},...e.decoders??{[e.prefix]:e}})}var Pr=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Nr(e,r,n),this.decoder=new Lr(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function oe({name:t,prefix:e,encode:r,decode:n}){return new Pr(t,e,r,n)}function Qt({name:t,prefix:e,alphabet:r}){let{encode:n,decode:i}=oi(r,t);return oe({prefix:e,name:t,encode:n,decode:a=>Pt(i(a))})}function D0(t,e,r,n){let i={};for(let c=0;c<e.length;++c)i[e[c]]=c;let a=t.length;for(;t[a-1]==="=";)--a;let s=new Uint8Array(a*r/8|0),o=0,u=0,f=0;for(let c=0;c<a;++c){let h=i[t[c]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<r|h,o+=r,o>=8&&(o-=8,s[f++]=255&u>>o)}if(o>=r||255&u<<8-o)throw new SyntaxError("Unexpected end of data");return s}function N0(t,e,r){let n=e[e.length-1]==="=",i=(1<<r)-1,a="",s=0,o=0;for(let u=0;u<t.length;++u)for(o=o<<8|t[u],s+=8;s>r;)s-=r,a+=e[i&o>>s];if(s!==0&&(a+=e[i&o<<r-s]),n)for(;a.length*r&7;)a+="=";return a}function nt({name:t,prefix:e,bitsPerChar:r,alphabet:n}){return oe({prefix:e,name:t,encode(i){return N0(i,n,r)},decode(i){return D0(i,n,r,t)}})}var L0=Qt({prefix:"9",name:"base10",alphabet:"0123456789"});var Ur={};dt(Ur,{base16:()=>k0,base16upper:()=>P0});var k0=nt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),P0=nt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Mr={};dt(Mr,{base2:()=>K0});var K0=nt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Fr={};dt(Fr,{base256emoji:()=>V0});var ui=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),U0=ui.reduce((t,e,r)=>(t[r]=e,t),[]),M0=ui.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function F0(t){return t.reduce((e,r)=>(e+=U0[r],e),"")}function O0(t){let e=[];for(let r of t){let n=M0[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var V0=oe({prefix:"\u{1F680}",name:"base256emoji",encode:F0,decode:O0});var Or={};dt(Or,{base32:()=>fe,base32hex:()=>G0,base32hexpad:()=>Y0,base32hexpadupper:()=>W0,base32hexupper:()=>H0,base32pad:()=>Q0,base32padupper:()=>z0,base32upper:()=>q0,base32z:()=>J0});var fe=nt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),q0=nt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Q0=nt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),z0=nt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),G0=nt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),H0=nt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Y0=nt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),W0=nt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),J0=nt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Vr={};dt(Vr,{base36:()=>$0,base36upper:()=>X0});var $0=Qt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),X0=Qt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var qr={};dt(qr,{base58btc:()=>bt,base58flickr:()=>Z0});var bt=Qt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Z0=Qt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var zr={};dt(zr,{base64:()=>Qr,base64pad:()=>j0,base64url:()=>ts,base64urlpad:()=>es});var Qr=nt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),j0=nt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ts=nt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),es=nt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Gr={};dt(Gr,{base8:()=>rs});var rs=nt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Hr={};dt(Hr,{identity:()=>ns});var ns=oe({prefix:"\0",name:"identity",encode:t=>ai(t),decode:t=>ii(t)});var xc=new TextEncoder,gc=new TextDecoder;var Wr={};dt(Wr,{identity:()=>gi});var ss=li,ci=128,os=127,fs=~os,us=Math.pow(2,31);function li(t,e,r){e=e||[],r=r||0;for(var n=r;t>=us;)e[r++]=t&255|ci,t/=128;for(;t&fs;)e[r++]=t&255|ci,t>>>=7;return e[r]=t|0,li.bytes=r-n+1,e}var cs=Yr,hs=128,hi=127;function Yr(t,n){var r=0,n=n||0,i=0,a=n,s,o=t.length;do{if(a>=o)throw Yr.bytes=0,new RangeError("Could not decode varint");s=t[a++],r+=i<28?(s&hi)<<i:(s&hi)*Math.pow(2,i),i+=7}while(s>=hs);return Yr.bytes=a-n,r}var ls=Math.pow(2,7),ps=Math.pow(2,14),ds=Math.pow(2,21),ys=Math.pow(2,28),xs=Math.pow(2,35),gs=Math.pow(2,42),ms=Math.pow(2,49),vs=Math.pow(2,56),As=Math.pow(2,63),bs=function(t){return t<ls?1:t<ps?2:t<ds?3:t<ys?4:t<xs?5:t<gs?6:t<ms?7:t<vs?8:t<As?9:10},Es={encode:ss,decode:cs,encodingLength:bs},Bs=Es,be=Bs;function Ee(t,e=0){return[be.decode(t,e),be.decode.bytes]}function ue(t,e,r=0){return be.encode(t,e,r),e}function ce(t){return be.encodingLength(t)}function Jt(t,e){let r=e.byteLength,n=ce(t),i=n+ce(r),a=new Uint8Array(i+r);return ue(t,a,0),ue(r,a,n),a.set(e,i),new he(t,r,e,a)}function pi(t){let e=Pt(t),[r,n]=Ee(e),[i,a]=Ee(e.subarray(n)),s=e.subarray(n+a);if(s.byteLength!==i)throw new Error("Incorrect length");return new he(r,i,s,e)}function di(t,e){if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&ni(t.bytes,r.bytes)}}var he=class{code;size;digest;bytes;constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var yi=0,Ss="identity",xi=Pt;function ws(t){return Jt(yi,xi(t))}var gi={code:yi,name:Ss,encode:xi,digest:ws};var Xr={};dt(Xr,{sha256:()=>Se,sha512:()=>Cs});function $r({name:t,code:e,encode:r}){return new Jr(t,e,r)}var Jr=class{name;code;encode;constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Jt(this.code,r):r.then(n=>Jt(this.code,n))}else throw Error("Unknown type, must be binary type")}};function vi(t){return async e=>new Uint8Array(await crypto.subtle.digest(t,e))}var Se=$r({name:"sha2-256",code:18,encode:vi("SHA-256")}),Cs=$r({name:"sha2-512",code:19,encode:vi("SHA-512")});function Ai(t,e){let{bytes:r,version:n}=t;switch(n){case 0:return Ts(r,Zr(t),e??bt.encoder);default:return _s(r,Zr(t),e??fe.encoder)}}var bi=new WeakMap;function Zr(t){let e=bi.get(t);if(e==null){let r=new Map;return bi.set(t,r),r}return e}var ze=class t{code;version;multihash;bytes;"/";constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==we)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Rs)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Jt(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n!=null&&e.code===n.code&&e.version===n.version&&di(e.multihash,n.multihash)}toString(e){return Ai(this,e)}toJSON(){return{"/":Ai(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:s}=r;return new t(n,i,a,s??Ei(n,i,a.bytes))}else if(r[Ds]===!0){let{version:n,multihash:i,code:a}=r,s=pi(i);return t.create(n,a,s)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==we)throw new Error(`Version 0 CID must use dag-pb (code: ${we}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=Ei(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,we,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=Pt(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),s=new he(r.multihashCode,r.digestSize,a,i);return[r.version===0?t.createV0(s):t.createV1(r.codec,s),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,p]=Ee(e.subarray(r));return r+=p,h},i=n(),a=we;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=r,o=n(),u=n(),f=r+u,c=f-s;return{version:i,codec:a,multihashCode:o,digestSize:u,multihashSize:c,size:f}}static parse(e,r){let[n,i]=Is(e,r),a=t.decode(i);if(a.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Zr(a).set(n,e),a}};function Is(t,e){switch(t[0]){case"Q":{let r=e??bt;return[bt.prefix,r.decode(`${bt.prefix}${t}`)]}case bt.prefix:{let r=e??bt;return[bt.prefix,r.decode(t)]}case fe.prefix:{let r=e??fe;return[fe.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}}function Ts(t,e,r){let{prefix:n}=r;if(n!==bt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let a=r.encode(t).slice(1);return e.set(n,a),a}else return i}function _s(t,e,r){let{prefix:n}=r,i=e.get(n);if(i==null){let a=r.encode(t);return e.set(n,a),a}else return i}var we=112,Rs=18;function Ei(t,e,r){let n=ce(t),i=n+ce(e),a=new Uint8Array(i+r.byteLength);return ue(t,a,0),ue(e,a,n),a.set(r,i),a}var Ds=Symbol.for("@ipld/js-cid/CID");var jr={...Hr,...Mr,...Gr,...Kr,...Ur,...Or,...Vr,...qr,...zr,...Fr},Mc={...Xr,...Wr};function Kt(t=0){return globalThis.Buffer?.alloc!=null?qt(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function xt(t=0){return globalThis.Buffer?.allocUnsafe!=null?qt(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Si(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Bi=Si("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),tn=Si("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=xt(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Ns={utf8:Bi,"utf-8":Bi,hex:jr.base16,latin1:tn,ascii:tn,binary:tn,...jr},Ge=Ns;function yt(t,e="utf8"){let r=Ge[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?qt(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Et(t,e="utf8"){let r=Ge[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var Wp=at(Te(),1),Jp=at(Ca(),1);var wu=at(W(),1);function de(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}var Dh=at(it(),1),Nh=at(rr(),1),eu=at(W(),1);function te(t,e){if(globalThis.Buffer!=null)return qt(globalThis.Buffer.concat(t,e));e==null&&(e=t.reduce((i,a)=>i+a.length,0));let r=xt(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return qt(r)}var sr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var ru=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!ru)throw new Error("Non little-endian hardware is not supported");var Fh={}.toString;function Ia(t=32){if(sr&&typeof sr.getRandomValues=="function")return sr.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}var dn=new Float32Array([-0]),Ht=new Uint8Array(dn.buffer);function _a(t,e,r){dn[0]=t,e[r]=Ht[0],e[r+1]=Ht[1],e[r+2]=Ht[2],e[r+3]=Ht[3]}function Ra(t,e){return Ht[0]=t[e],Ht[1]=t[e+1],Ht[2]=t[e+2],Ht[3]=t[e+3],dn[0]}var yn=new Float64Array([-0]),ut=new Uint8Array(yn.buffer);function Da(t,e,r){yn[0]=t,e[r]=ut[0],e[r+1]=ut[1],e[r+2]=ut[2],e[r+3]=ut[3],e[r+4]=ut[4],e[r+5]=ut[5],e[r+6]=ut[6],e[r+7]=ut[7]}function Na(t,e){return ut[0]=t[e],ut[1]=t[e+1],ut[2]=t[e+2],ut[3]=t[e+3],ut[4]=t[e+4],ut[5]=t[e+5],ut[6]=t[e+6],ut[7]=t[e+7],yn[0]}var au=BigInt(Number.MAX_SAFE_INTEGER),su=BigInt(Number.MIN_SAFE_INTEGER),pt=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return ee;if(e<au&&e>su)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>La&&(i=0n,++n>La&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return ee;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):ee}},ee=new pt(0,0);ee.toBigInt=function(){return 0n};ee.zzEncode=ee.zzDecode=function(){return this};ee.length=function(){return 1};var La=4294967296n;function ka(t){let e=0,r=0;for(let n=0;n<t.length;++n)r=t.charCodeAt(n),r<128?e+=1:r<2048?e+=2:(r&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function Pa(t,e,r){if(r-e<1)return"";let i,a=[],s=0,o;for(;e<r;)o=t[e++],o<128?a[s++]=o:o>191&&o<224?a[s++]=(o&31)<<6|t[e++]&63:o>239&&o<365?(o=((o&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,a[s++]=55296+(o>>10),a[s++]=56320+(o&1023)):a[s++]=(o&15)<<12|(t[e++]&63)<<6|t[e++]&63,s>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,a)),s=0);return i!=null?(s>0&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))}function xn(t,e,r){let n=r,i,a;for(let s=0;s<t.length;++s)i=t.charCodeAt(s),i<128?e[r++]=i:i<2048?(e[r++]=i>>6|192,e[r++]=i&63|128):(i&64512)===55296&&((a=t.charCodeAt(s+1))&64512)===56320?(i=65536+((i&1023)<<10)+(a&1023),++s,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function St(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function or(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var gn=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,St(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw St(this,4);return or(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw St(this,4);return or(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw St(this,4);let e=Ra(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw St(this,4);let e=Na(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw St(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return Pa(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw St(this,e);this.pos+=e}else do if(this.pos>=this.len)throw St(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new pt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw St(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw St(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw St(this,8);let e=or(this.buf,this.pos+=4),r=or(this.buf,this.pos+=4);return new pt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function mn(t){return new gn(t instanceof Uint8Array?t:t.subarray())}function fr(t,e){let r=mn(t);return e.decode(r)}function vn(t){let e=t??8192,r=e>>>1,n,i=e;return function(s){if(s<1||s>r)return xt(s);i+s>e&&(n=xt(e),i=0);let o=n.subarray(i,i+=s);return i&7&&(i=(i|7)+1),o}}var re=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function An(){}var En=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},ou=vn();function fu(t){return globalThis.Buffer!=null?xt(t):ou(t)}var Le=class{len;head;tail;states;constructor(){this.len=0,this.head=new re(An,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new re(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Bn((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(De,10,pt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=pt.fromBigInt(e);return this._push(De,r.length(),r)}uint64Number(e){let r=pt.fromNumber(e);return this._push(De,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=pt.fromBigInt(e).zzEncode();return this._push(De,r.length(),r)}sint64Number(e){let r=pt.fromNumber(e).zzEncode();return this._push(De,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(bn,1,e?1:0)}fixed32(e){return this._push(Ne,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=pt.fromBigInt(e);return this._push(Ne,4,r.lo)._push(Ne,4,r.hi)}fixed64Number(e){let r=pt.fromNumber(e);return this._push(Ne,4,r.lo)._push(Ne,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(_a,4,e)}double(e){return this._push(Da,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(bn,1,0):this.uint32(r)._push(cu,r,e)}string(e){let r=ka(e);return r!==0?this.uint32(r)._push(xn,r,e):this._push(bn,1,0)}fork(){return this.states=new En(this),this.head=this.tail=new re(An,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new re(An,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=fu(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function bn(t,e,r){e[r]=t&255}function uu(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Bn=class extends re{next;constructor(e,r){super(uu,e,r),this.next=void 0}};function De(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Ne(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function cu(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(Le.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(hu,e,t),this},Le.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(lu,e,t),this});function hu(t,e,r){e.set(t,r)}function lu(t,e,r){t.length<40?xn(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(yt(t),r)}function Sn(){return new Le}function ur(t,e){let r=Sn();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var ye;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(ye||(ye={}));function cr(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function wn(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(a,s){let o=e(a);s.int32(o)},n=function(a){let s=a.int32();return e(s)};return cr("enum",ye.VARINT,r,n)}function hr(t,e){return cr("message",ye.LENGTH_DELIMITED,t,e)}var vt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(vt||(vt={}));var Cn;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Cn||(Cn={}));(function(t){t.codec=()=>wn(Cn)})(vt||(vt={}));var xe;(function(t){let e;t.codec=()=>(e==null&&(e=hr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),vt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let s=r.uint32();switch(s>>>3){case 1:i.Type=vt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(s&7);break}}return i})),e),t.encode=r=>ur(r,t.codec()),t.decode=r=>fr(r,t.codec())})(xe||(xe={}));var ge;(function(t){let e;t.codec=()=>(e==null&&(e=hr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),vt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let s=r.uint32();switch(s>>>3){case 1:i.Type=vt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(s&7);break}}return i})),e),t.encode=r=>ur(r,t.codec()),t.decode=r=>fr(r,t.codec())})(ge||(ge={}));var du={"P-256":256,"P-384":384,"P-521":521},yu=Object.keys(du),Ol=yu.join(" / ");var bu=at(W(),1);var Cp=at(qa(),1);function Yt(t){if(isNaN(t)||t<=0)throw new ie("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return Ia(t)}var ep=at(ar(),1),mu=at(W(),1);var ap=at(Te(),1),sp=at(ar(),1);var vu=at(W(),1);var Iu=at(nn(),1),Tu=at(it(),1);var Ga=Symbol.for("@achingbrain/uint8arraylist");function za(t,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let r=0;for(let n of t){let i=r+n.byteLength;if(e<i)return{buf:n,index:e-r};r=i}throw new RangeError("index is out of bounds")}function pr(t){return!!t?.[Ga]}var Pe=class t{bufs;length;[Ga]=!0;constructor(...e){this.bufs=[],this.length=0,e.length>0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(pr(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(pr(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=za(this.bufs,e);return r.buf[r.index]}set(e,r){let n=za(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n<e.length;n++)this.set(r+n,e[n]);else if(pr(e))for(let n=0;n<e.length;n++)this.set(r+n,e.get(n));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0)){if(e===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return te(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:te(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),a=new t;return a.length=i,a.bufs=[...n],a}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:this.bufs,length:this.length};let n=[],i=0;for(let a=0;a<this.bufs.length;a++){let s=this.bufs[a],o=i,u=o+s.byteLength;if(i=u,e>=u)continue;let f=e>=o&&e<u,c=r>o&&r<=u;if(f&&c){if(e===o&&r===u){n.push(s);break}let h=e-o;n.push(s.subarray(h,h+(r-e)));break}if(f){if(e===0){n.push(s);continue}n.push(s.subarray(e-o));continue}if(c){if(r===u){n.push(s);break}n.push(s.subarray(0,r-o));break}n.push(s)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!pr(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let a=256,s=new Int32Array(a);for(let h=0;h<a;h++)s[h]=-1;for(let h=0;h<i;h++)s[n[h]]=h;let o=s,u=this.byteLength-n.byteLength,f=n.byteLength-1,c;for(let h=r;h<=u;h+=c){c=0;for(let p=f;p>=0;p--){let g=this.get(h+p);if(n[p]!==g){c=Math.max(1,p-o[g]);break}}if(c===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=xt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=Kt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=Kt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=Kt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=xt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=Kt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=Kt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=Kt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=Kt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=Kt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;r<this.bufs.length;r++)if(!de(this.bufs[r],e.bufs[r]))return!1;return!0}static fromUint8Arrays(e,r){let n=new t;return n.bufs=e,r==null&&(r=e.reduce((i,a)=>i+a.byteLength,0)),n.length=r,n}};function wt(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var dr=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function Ha(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new dr(r?.errorMessage,r?.errorCode));let n,i=new dr(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((a,s)=>{n=()=>{s(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var Rn=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=wt(),this.haveNext=wt()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=wt(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=wt(),await Ha(this.needNext.promise,r?.signal,r)}};function Ya(){return new Rn}var yr=class extends Error{code;constructor(e,r){super(e),this.code=r}},Dn=class extends yr{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function Wa(t,e){let r=Ya();t.sink(r).catch(async s=>{await r.end(s)}),t.sink=async s=>{for await(let o of s)await r.push(o);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new Pe;return{read:async(s,o)=>{o?.signal?.throwIfAborted();let u,f=new Promise((c,h)=>{u=()=>{h(new Dn("Read aborted"))},o?.signal?.addEventListener("abort",u)});try{if(s==null){let{done:h,value:p}=await Promise.race([n.next(),f]);return h===!0?new Pe:p}for(;i.byteLength<s;){let{value:h,done:p}=await Promise.race([n.next(),f]);if(p===!0)throw new yr("unexpected end of input","ERR_UNEXPECTED_EOF");i.append(h)}let c=i.sublist(0,s);return i.consume(s),c}finally{u!=null&&o?.signal?.removeEventListener("abort",u)}},write:async(s,o)=>{o?.signal?.throwIfAborted(),s instanceof Uint8Array?await r.push(s,o):await r.push(s.subarray(),o)},unwrap:()=>{if(i.byteLength>0){let s=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*s}()}return t}}}function _u(t){let[e,r]=t[Symbol.asyncIterator]!=null?[t[Symbol.asyncIterator](),Symbol.asyncIterator]:[t[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:i=>{n.push(i)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[r](){return this}}}var Ja=_u;function Ru(t){return t[Symbol.asyncIterator]!=null}function Du(t,e){if(Ru(t))return async function*(){for await(let o of t)yield e(o)}();let r=Ja(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let a=e(n);if(typeof a.then=="function")return async function*(){yield await a;for await(let o of r)yield e(o)}();let s=e;return function*(){yield a;for(let o of r)yield s(o)}()}var $a=Du;function Nn(){let t=wt(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function Xa(){let t=Nn(),e=Nn();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var xr=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},me=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new xr(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new xr(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var Ln=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function gr(t={}){return Nu(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function Nu(t,e){e=e??{};let r=e.onEnd,n=new me,i,a,s,o=wt(),u=async()=>{try{return n.isEmpty()?s?{done:!0}:await new Promise((v,b)=>{a=I=>{a=null,n.push(I);try{v(t(n))}catch(w){b(w)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{o.resolve(),o=wt()})}},f=v=>a!=null?a(v):(n.push(v),i),c=v=>(n=new me,a!=null?a({error:v}):(n.push({error:v}),i)),h=v=>{if(s)return i;if(e?.objectMode!==!0&&v?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:v})},p=v=>s?i:(s=!0,v!=null?c(v):f({done:!0})),g=()=>(n=new me,p(),{done:!0}),l=v=>(p(v),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:u,return:g,throw:l,push:h,end:p,get readableLength(){return n.size},onEmpty:async v=>{let b=v?.signal;if(b?.throwIfAborted(),n.isEmpty())return;let I,w;b!=null&&(I=new Promise((D,C)=>{w=()=>{C(new Ln)},b.addEventListener("abort",w)}));try{await Promise.race([o.promise,I])}finally{w!=null&&b!=null&&b?.removeEventListener("abort",w)}}},r==null)return i;let m=i;return i={[Symbol.asyncIterator](){return this},next(){return m.next()},throw(v){return m.throw(v),r!=null&&(r(v),r=void 0),{done:!0}},return(){return m.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(v){return m.end(v),r!=null&&(r(v),r=void 0),i},get readableLength(){return m.readableLength},onEmpty:v=>m.onEmpty(v)},i}function Lu(t){return t[Symbol.asyncIterator]!=null}function ku(...t){let e=[];for(let r of t)Lu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=gr({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Za=ku;function ja(t,...e){if(t==null)throw new Error("Empty pipeline");if(kn(t)){let n=t;t=()=>n.source}else if(e0(t)||t0(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&kn(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n<r.length-1;n++)kn(r[n])&&(r[n]=Ku(r[n]));return Pu(...r)}var Pu=(...t)=>{let e;for(;t.length>0;)e=t.shift()(e);return e},t0=t=>t?.[Symbol.asyncIterator]!=null,e0=t=>t?.[Symbol.iterator]!=null,kn=t=>t==null?!1:t.sink!=null&&t.source!=null,Ku=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=gr({objectMode:!0});r.then(()=>{n.end()},s=>{n.end(s)});let i,a=t.source;if(t0(a))i=async function*(){yield*a,n.end()};else if(e0(a))i=function*(){yield*a,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Za(n,i())}return t.source};var Fn=at(o0(),1);var Kn="Your private shared key is invalid";var f0="No connection for the handshake provided";var u0="ERR_INVALID_PARAMETERS";function h0(t){let e=Et(Yt(Mn),"base16"),r=yt(`/key/swarm/psk/1.0.0/
16
16
  /base16/
17
- `+e);t instanceof Uint8Array?t.set(r):t.write(r)}var _i=24,Di=32;function ks(t,e){let r=(0,Ri.default)(t,e);return n=>async function*(){for await(let i of n)yield Uint8Array.from(r.update(i.subarray()))}()}function Ps(t,e){return r=>async function*(){let n=(0,Ri.default)(t,e);for await(let i of r)yield Uint8Array.from(n.update(i.subarray()))}()}function Us(t){try{let e=Ur(t).split(/(?:\r\n|\r|\n)/g),r=e.shift(),n=e.shift(),i=e.shift(),a=Pr(i??"","base16");if(a.byteLength!==Di)throw new Error(Ti);return{tag:r,codecName:n,psk:a}}catch{throw new Error(Ti)}}var Li=class{tag;log;psk;timeout;constructor(e,r){this.log=e.logger.forComponent("libp2p:pnet"),this.timeout=r.timeout??1e3;let n=Us(r.psk);this.psk=n.psk,this.tag=n.tag??""}async protect(e){if(e==null)throw new ht(Ds,Rs);this.log("protecting the connection");let r=Jt(_i),n=AbortSignal.timeout(this.timeout),i=ps(e),[,a]=await Promise.all([i.write(r,{signal:n}),i.read(_i,{signal:n})]),o=a.subarray();this.log("exchanged nonces");let[s,f]=xs();return ms(f,ks(r,this.psk),i.unwrap(),u=>ys(u,c=>c.subarray()),Ps(o,this.psk),f).catch(this.log.error),{...e,...s}}};function ml(t){return e=>new Li(e,t)}return qs(vl);})();
17
+ `+e);t instanceof Uint8Array?t.set(r):t.write(r)}var Un=24,Mn=32;function l0(t,e){let r=(0,Fn.default)(t,e);return n=>async function*(){for await(let i of n)yield Uint8Array.from(r.update(i.subarray()))}()}function p0(t,e){return r=>async function*(){let n=(0,Fn.default)(t,e);for await(let i of r)yield Uint8Array.from(n.update(i.subarray()))}()}function d0(t){try{let e=Et(t).split(/(?:\r\n|\r|\n)/g),r=e.shift(),n=e.shift(),i=e.shift(),a=yt(i??"","base16");if(a.byteLength!==Mn)throw new Error(Kn);return{tag:r,codecName:n,psk:a}}catch{throw new Error(Kn)}}var On=class{tag;log;psk;timeout;constructor(e,r){this.log=e.logger.forComponent("libp2p:pnet"),this.timeout=r.timeout??1e3;let n=d0(r.psk);this.psk=n.psk,this.tag=n.tag??""}async protect(e){if(e==null)throw new ie(f0,u0);this.log("protecting the connection");let r=Yt(Un),n=AbortSignal.timeout(this.timeout),i=Wa(e),[,a]=await Promise.all([i.write(r,{signal:n}),i.read(Un,{signal:n})]),s=a.subarray();this.log("exchanged nonces");let[o,u]=Xa();return ja(u,l0(r,this.psk),i.unwrap(),f=>$a(f,c=>c.subarray()),p0(s,this.psk),u).catch(this.log.error),{...e,...o}}};function qu(t){return e=>new On(e,t)}return A0(Qu);})();
18
18
  /*! Bundled license information:
19
19
 
20
20
  @noble/hashes/esm/utils.js: