PageSourceSearch

https://limewire.com/build/chunks/dynamic/lib-BiapEtK1-D4SbyvNE.js

js limewire.com collected 2026-10-01 08:35:16 UTC 285,982 bytes, 25 lines download raw bytes

1import{o as ce}from"./pdf-viewer-suspended-mhf0plZY.js";import"../jsx-runtime-D_zvdyIk.js";import"../index-5zs3RZdd.js";import"../chunk-4N6VE7H7-CYH4PXiQ.js";import"../preload-helper-ckwbz45p.js";import"../tooltip-Dh-GCyoz.js";import"../use-controlled-state-6BKWRsRt.js";import"../use-state-ref-0aYGV7fB.js";import"../use-callback-ref-CJ9SODNh.js";import"../use-const-CyuDI2Jw.js";import"../resolve-to-node-Bl44lgnH.js";import"../content-item-name-BPyEto8O.js";import"../get-file-size-o3gU3tG4.js";import"../file-sharing-provider-BVNTMil-.js";import"../unkown-to-error-DwTVrMc8.js";import"../runtime-a9fv597q.js";import"../get-api-14EM5842.js";import"../runtime-2_b2CLRu.js";import"../result-DontbEtL.js";import"../create-promise-with-resolvers-BRzZ48Tq.js";import"../create-invalidatable-promise-B0Emb-rB.js";import"../VerificationStatusEnum-BMWjV5ER.js";import"../AccountSubscriptionTier-Cz37hh3K.js";import"../UsStateCodeAlpha2-sRkxuwjy.js";import"../form-schema-utils-CKHKKg7G.js";import"../types-CeqL-daw.js";import"../modal-content-window-title-header-B-HF-kNO.js";import"../noop-BjFrJKj1.js";import"../base-button-B5n9l638.js";import"../icon-t8DmuItj.js";import"../focus-visible-outline-C2oCpE2B.js";import"../form-validation-C1EvNSSj.js";import"../alert-BU9hX6Ca.js";import"../assign-ref-CqhwXDR4.js";import"../use-self-cancel-timeout-DCHuMrr-.js";import"../use-self-cancel-interval-BgB7hfvd.js";import"../textarea-CoW_dAHU.js";import"../toggle-group-972dUBye.js";import"../createFormData-6W1bV2BK.js";import"../button-C30r1GJ_.js";import"../link-button-C53tn4Tz.js";import"../file-name-DczNHvHs.js";import"../auth-context-DVtKf2vI.js";import"../mgid-De7Eny4Y.js";import"../use-media-query-BqwX7Gt4.js";import"../client-only-CnbT09nL.js";import"../pause-icon-DOcKbNGI.js";import"../play-icon-DI2J94ng.js";import"../get-ffmpeg-CbUJUDR9.js";import"../arrow-right-icon-CCS3gJ01.js";import"../feedback-tooltip-DnQoTtgx.js";import"../get-sharing-bucket-expiration-label-BoiJAKWj.js";import"../auth-form-BWHNI_kq.js";import"../env-context-DebTkedx.js";import"../use-typed-explicit-fetcher-fhEyK6eX.js";import"../authenticity-token-CFgl6Z4h.js";import"../auth-form-validation-BzAFckMn.js";import"../navigation-link-1xMIfquP.js";import"../app-integration-provider-4-SaOz_c.js";import"../app-integration-loading-D3uWt4C6.js";import"../auth-window-messenger-DvswJzyt.js";import"../use-external-wallet-kwthnZEt.js";import"../create-lazy-singleton-BxTks31n.js";import"../divider-Bx5FVaq5.js";var le=ce(((oe,W)=>{W.exports={options:{usePureJavaScript:!1}}})),ur=ce(((oe,W)=>{var a={};W.exports=a;var e={};a.encode=function(y,k,T){if(typeof k!="string")throw TypeError('"alphabet" must be a string.');if(T!==void 0&&typeof T!="number")throw TypeError('"maxline" must be a number.');var f="";if(!(y instanceof Uint8Array))f=i(y,k);else{var t=0,g=k.length,c=k.charAt(0),S=[0];for(t=0;t<y.length;++t){for(var _=0,E=y[t];_<S.length;++_)E+=S[_]<<8,S[_]=E%g,E=E/g|0;for(;E>0;)S.push(E%g),E=E/g|0}for(t=0;y[t]===0&&t<y.length-1;++t)f+=c;for(t=S.length-1;t>=0;--t)f+=k[S[t]]}if(T){var u=RegExp(".{1,"+T+"}","g");f=f.match(u).join(`\r
2`)}return f},a.decode=function(y,k){if(typeof y!="string")throw TypeError('"input" must be a string.');if(typeof k!="string")throw TypeError('"alphabet" must be a string.');var T=e[k];if(!T){T=e[k]=[];for(var f=0;f<k.length;++f)T[k.charCodeAt(f)]=f}y=y.replace(/\s/g,"");for(var t=k.length,g=k.charAt(0),c=[0],f=0;f<y.length;f++){var S=T[y.charCodeAt(f)];if(S===void 0)return;for(var _=0,E=S;_<c.length;++_)E+=c[_]*t,c[_]=E&255,E>>=8;for(;E>0;)c.push(E&255),E>>=8}for(var u=0;y[u]===g&&u<y.length-1;++u)c.push(0);return typeof Buffer<"u"?Buffer.from(c.reverse()):new Uint8Array(c.reverse())};function i(y,k){var T=0,f=k.length,t=k.charAt(0),g=[0];for(T=0;T<y.length();++T){for(var c=0,S=y.at(T);c<g.length;++c)S+=g[c]<<8,g[c]=S%f,S=S/f|0;for(;S>0;)g.push(S%f),S=S/f|0}var _="";for(T=0;y.at(T)===0&&T<y.length()-1;++T)_+=t;for(T=g.length-1;T>=0;--T)_+=k[g[T]];return _}})),ye=ce(((oe,W)=>{var a=le(),e=ur(),i=W.exports=a.util=a.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){i.nextTick=process.nextTick,typeof setImmediate=="function"?i.setImmediate=setImmediate:i.setImmediate=i.nextTick;return}if(typeof setImmediate=="function"){i.setImmediate=function(){return setImmediate.apply(void 0,arguments)},i.nextTick=function(n){return setImmediate(n)};return}if(i.setImmediate=function(n){setTimeout(n,0)},typeof window<"u"&&typeof window.postMessage=="function"){let n=function(r){if(r.source===window&&r.data===s){r.stopPropagation();var b=p.slice();
2p.length=0,b.forEach(function(w){w()})}};var s="forge.setImmediate",p=[];i.setImmediate=function(r){p.push(r),p.length===1&&window.postMessage(s,"*")},window.addEventListener("message",n,!0)}if(typeof MutationObserver<"u"){var d=Date.now(),A=!0,D=document.createElement("div"),p=[];new MutationObserver(function(){var r=p.slice();p.length=0,r.forEach(function(b){b()})}).observe(D,{attributes:!0});var l=i.setImmediate;i.setImmediate=function(r){Date.now()-d>15?(d=Date.now(),l(r)):(p.push(r),p.length===1&&D.setAttribute("a",A=!A))}}i.nextTick=i.setImmediate})(),i.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,i.globalScope=(function(){return i.isNodejs?global:typeof self>"u"?window:self})(),i.isArray=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"},i.isArrayBuffer=function(s){return typeof ArrayBuffer<"u"&&s instanceof ArrayBuffer},i.isArrayBufferView=function(s){return s&&i.isArrayBuffer(s.buffer)&&s.byteLength!==void 0};function y(s){if(!(s===8||s===16||s===24||s===32))throw Error("Only 8, 16, 24, or 32 bits supported: "+s)}i.ByteBuffer=k;function k(s){if(this.data="",this.read=0,typeof s=="string")this.data=s;else if(i.isArrayBuffer(s)||i.isArrayBufferView(s))if(typeof Buffer<"u"&&s instanceof Buffer)this.data=s.toString("binary");else{var p=new Uint8Array(s);try{this.data=String.fromCharCode.apply(null,p)}catch{for(var d=0;d<p.length;++d)this.putByte(p[d])}}
2else(s instanceof k||typeof s=="object"&&typeof s.data=="string"&&typeof s.read=="number")&&(this.data=s.data,this.read=s.read);this._constructedStringLength=0}i.ByteStringBuffer=k;var T=4096;i.ByteStringBuffer.prototype._optimizeConstructedString=function(s){this._constructedStringLength+=s,this._constructedStringLength>T&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(s){return this.putBytes(String.fromCharCode(s))},i.ByteStringBuffer.prototype.fillWithByte=function(s,p){s=String.fromCharCode(s);for(var d=this.data;p>0;)p&1&&(d+=s),p>>>=1,p>0&&(s+=s);return this.data=d,this._optimizeConstructedString(p),this},i.ByteStringBuffer.prototype.putBytes=function(s){return this.data+=s,this._optimizeConstructedString(s.length),this},i.ByteStringBuffer.prototype.putString=function(s){return this.putBytes(i.encodeUtf8(s))},i.ByteStringBuffer.prototype.putInt16=function(s){return this.putBytes(String.fromCharCode(s>>8&255)+String.fromCharCode(s&255))},i.ByteStringBuffer.prototype.putInt24=function(s){return this.putBytes(String.fromCharCode(s>>16&255)+String.fromCharCode(s>>8&255)+String.fromCharCode(s&255))},i.ByteStringBuffer.prototype.putInt32=function(s){return this.putBytes(String.fromCharCode(s>>24&255)+String.fromCharCode(s>>16&255)+String.fromCharCode(s>>8&255)+String.fromCharCode(s&255))},i.ByteStringBuffer.prototype.putInt16Le=function(s){return this.putBytes(String.fromCharCode(s&255)+String.fromCharCode(s>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(s){return this.putBytes(String.fromCharCode(s&255)+String.fromCharCode(s>>8&255)+String.fromCharCode(s>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(s){return this.putBytes(String.fromCharCode(s&255)+String.fromCharCode(s>>8&255)+String.fromCharCode(s>>16&255)+String.fromCharCode(s>>24&255))},i.ByteStringBuffer.prototype.putInt=function(s,p){y(p);var d="";do p-=8,d+=String.fromCharCode(s>>p&255);while(p>0);return this.putBytes(d)},i.ByteStringBuffer.prototype.putSignedInt=function(s,p){return s<0&&(s+=2<<p-1),this.putInt(s,p)},i.ByteStringBuffer.prototype.putBuffer=function(s){return this.putBytes(s.getBytes())},i.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},i.ByteStringBuffer.prototype.getInt16=function(){var s=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,s},i.ByteStringBuffer.prototype.getInt24=function(){var s=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,s},i.ByteStringBuffer.prototype.getInt32=function(){var s=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,s},i.ByteStringBuffer.prototype.getInt16Le=function(){var s=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,s},i.ByteStringBuffer.prototype.getInt24Le=function(){var s=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,s},i.ByteStringBuffer.prototype.getInt32Le=function(){var s=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,s},i.ByteStringBuffer.prototype.getInt=function(s){y(s);var p=0;do p=(p<<8)+this.data.charCodeAt(this.read++),s-=8;while(s>0);return p},i.ByteStringBuffer.prototype.getSignedInt=function(s){var p=this.getInt(s),d=2<<s-2;return p>=d&&(p-=d<<1),p},i.ByteStringBuffer.prototype.getBytes=function(s){var p;return s?(s=Math.min(this.length(),s),p=this.data.slice(this.read,this.read+s),this.read+=s):s===0?p="":(p=this.read===0?this.data:this.data.slice(this.read),this.clear()),p},i.ByteStringBuffer.prototype.bytes=function(s){return s===void 0?this.data.slice(this.read):this.data.slice(this.read,this.read+s)},i.ByteStringBuffer.prototype.at=function(s){return this.data.charCodeAt(this.read+s)},i.ByteStringBuffer.prototype.setAt=function(s,p){return this.data=this.data.substr(0,this.read+s)+String.fromCharCode(p)+this.data.substr(this.read+s+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var s=i.createBuffer(this.data);return s.read=this.read,s},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(s){var p=Math.max(0,this.length()-s);return this.data=this.data.substr(this.read,p),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var s="",p=this.read;p<this.data.length;++p){var d=this.data.charCodeAt(p);d<16&&(s+="0"),s+=d.toString(16)}return s},i.ByteStringBuffer.prototype.toString=function(){return i.decodeUtf8(this.bytes())};function f(s,p){p||(p={}),this.read=p.readOffset||0,this.growSize=p.growSize||1024;var d=i.isArrayBuffer(s),A=i.isArrayBufferView(s);if(d||A){d?this.data=new DataView(s):this.data=new DataView(s.buffer,s.byteOffset,s.byteLength),this.write="writeOffset"in p?p.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,s!=null&&this.putBytes(s),"writeOffset"in p&&(this.write=p.writeOffset)}i.DataBuffer=f,i.DataBuffer.prototype.length=function(){return this.write-this.read},i.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},i.DataBuffer.prototype.accommodate=function(s,p){if(this.length()>=s)return this;p=Math.max(p||this.growSize,s);var d=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),A=new Uint8Array(this.length()+p);
2return A.set(d),this.data=new DataView(A.buffer),this},i.DataBuffer.prototype.putByte=function(s){return this.accommodate(1),this.data.setUint8(this.write++,s),this},i.DataBuffer.prototype.fillWithByte=function(s,p){this.accommodate(p);for(var d=0;d<p;++d)this.data.setUint8(s);return this},i.DataBuffer.prototype.putBytes=function(s,p){if(i.isArrayBufferView(s)){var d=new Uint8Array(s.buffer,s.byteOffset,s.byteLength),A=d.byteLength-d.byteOffset;this.accommodate(A);var D=new Uint8Array(this.data.buffer,this.write);return D.set(d),this.write+=A,this}if(i.isArrayBuffer(s)){var d=new Uint8Array(s);this.accommodate(d.byteLength);var D=new Uint8Array(this.data.buffer);return D.set(d,this.write),this.write+=d.byteLength,this}if(s instanceof i.DataBuffer||typeof s=="object"&&typeof s.read=="number"&&typeof s.write=="number"&&i.isArrayBufferView(s.data)){var d=new Uint8Array(s.data.byteLength,s.read,s.length());this.accommodate(d.byteLength);var D=new Uint8Array(s.data.byteLength,this.write);return D.set(d),this.write+=d.byteLength,this}if(s instanceof i.ByteStringBuffer&&(s=s.data,p="binary"),p||(p="binary"),typeof s=="string"){var l;if(p==="hex")return this.accommodate(Math.ceil(s.length/2)),l=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.hex.decode(s,l,this.write),this;if(p==="base64")return this.accommodate(Math.ceil(s.length/4)*3),l=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.base64.decode(s,l,this.write),this;if(p==="utf8"&&(s=i.encodeUtf8(s),p="binary"),p==="binary"||p==="raw")return this.accommodate(s.length),l=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.raw.decode(l),this;if(p==="utf16")return this.accommodate(s.length*2),l=new Uint16Array(this.data.buffer,this.write),this.write+=i.text.utf16.encode(l),this;throw Error("Invalid encoding: "+p)}throw Error("Invalid parameter: "+s)},i.DataBuffer.prototype.putBuffer=function(s){return this.putBytes(s),s.clear(),this},i.DataBuffer.prototype.putString=function(s){return this.putBytes(s,"utf16")},i.DataBuffer.prototype.putInt16=function(s){return this.accommodate(2),this.data.setInt16(this.write,s),this.write+=2,this},i.DataBuffer.prototype.putInt24=function(s){return this.accommodate(3),this.data.setInt16(this.write,s>>8&65535),this.data.setInt8(this.write,s>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(s){return this.accommodate(4),this.data.setInt32(this.write,s),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(s){return this.accommodate(2),this.data.setInt16(this.write,s,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(s){return this.accommodate(3),this.data.setInt8(this.write,s>>16&255),this.data.setInt16(this.write,s>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(s){return this.accommodate(4),this.data.setInt32(this.write,s,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(s,p){y(p),this.accommodate(p/8);do p-=8,this.data.setInt8(this.write++,s>>p&255);while(p>0);return this},i.DataBuffer.prototype.putSignedInt=function(s,p){return y(p),this.accommodate(p/8),s<0&&(s+=2<<p-1),this.putInt(s,p)},i.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},i.DataBuffer.prototype.getInt16=function(){var s=this.data.getInt16(this.read);return this.read+=2,s},i.DataBuffer.prototype.getInt24=function(){var s=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,s},i.DataBuffer.prototype.getInt32=function(){var s=this.data.getInt32(this.read);return this.read+=4,s},i.DataBuffer.prototype.getInt16Le=function(){var s=this.data.getInt16(this.read,!0);return this.read+=2,s},i.DataBuffer.prototype.getInt24Le=function(){var s=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,s},i.DataBuffer.prototype.getInt32Le=function(){var s=this.data.getInt32(this.read,!0);return this.read+=4,s},i.DataBuffer.prototype.getInt=function(s){y(s);var p=0;do p=(p<<8)+this.data.getInt8(this.read++),s-=8;while(s>0);return p},i.DataBuffer.prototype.getSignedInt=function(s){var p=this.getInt(s),d=2<<s-2;return p>=d&&(p-=d<<1),p},i.DataBuffer.prototype.getBytes=function(s){var p;return s?(s=Math.min(this.length(),s),p=this.data.slice(this.read,this.read+s),this.read+=s):s===0?p="":(p=this.read===0?this.data:this.data.slice(this.read),this.clear()),p},i.DataBuffer.prototype.bytes=function(s){return s===void 0?this.data.slice(this.read):this.data.slice(this.read,this.read+s)},i.DataBuffer.prototype.at=function(s){return this.data.getUint8(this.read+s)},i.DataBuffer.prototype.setAt=function(s,p){return this.data.setUint8(s,p),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var s=new Uint8Array(this.data.buffer,this.read),p=new Uint8Array(s.byteLength);p.set(s),this.data=new DataView(p),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(s){return this.write=Math.max(0,this.length()-s),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var s="",p=this.read;p<this.data.byteLength;++p){var d=this.data.getUint8(p);d<16&&(s+="0"),s+=d.toString(16)}return s},i.DataBuffer.prototype.toString=function(s){var p=new Uint8Array(this.data,this.read,this.length());if(s||(s="utf8"),s==="binary"||s==="raw")return i.binary.raw.encode(p);if(s==="hex")return i.binary.hex.encode(p);if(s==="base64")return i.binary.base64.encode(p);if(s==="utf8")return i.text.utf8.decode(p);if(s==="utf16")return i.text.utf16.decode(p);throw Error("Invalid encoding: "+s)},i.createBuffer=function(s,p){return p||(p="raw"),s!==void 0&&p==="utf8"&&(s=i.encodeUtf8(s)),new i.ByteBuffer(s)},i.fillString=function(s,p){for(var d="";p>0;)p&1&&(d+=s),p>
2>>=1,p>0&&(s+=s);return d},i.xorBytes=function(s,p,d){for(var A="",D="",l="",n=0,r=0;d>0;--d,++n)D=s.charCodeAt(n)^p.charCodeAt(n),r>=10&&(A+=l,l="",r=0),l+=String.fromCharCode(D),++r;return A+=l,A},i.hexToBytes=function(s){var p="",d=0;for(s.length&!0&&(d=1,p+=String.fromCharCode(parseInt(s[0],16)));d<s.length;d+=2)p+=String.fromCharCode(parseInt(s.substr(d,2),16));return p},i.bytesToHex=function(s){return i.createBuffer(s).toHex()},i.int32ToBytes=function(s){return String.fromCharCode(s>>24&255)+String.fromCharCode(s>>16&255)+String.fromCharCode(s>>8&255)+String.fromCharCode(s&255)};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=[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],c="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(s,p){for(var d="",A="",D,l,n,r=0;r<s.length;)D=s.charCodeAt(r++),l=s.charCodeAt(r++),n=s.charCodeAt(r++),d+=t.charAt(D>>2),d+=t.charAt((D&3)<<4|l>>4),isNaN(l)?d+="==":(d+=t.charAt((l&15)<<2|n>>6),d+=isNaN(n)?"=":t.charAt(n&63)),p&&d.length>p&&(A+=d.substr(0,p)+`\r
3`,d=d.substr(p));return A+=d,A},i.decode64=function(s){s=s.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var p="",d,A,D,l,n=0;n<s.length;)d=g[s.charCodeAt(n++)-43],A=g[s.charCodeAt(n++)-43],D=g[s.charCodeAt(n++)-43],l=g[s.charCodeAt(n++)-43],p+=String.fromCharCode(d<<2|A>>4),D!==64&&(p+=String.fromCharCode((A&15)<<4|D>>2),l!==64&&(p+=String.fromCharCode((D&3)<<6|l)));return p},i.encodeUtf8=function(s){return unescape(encodeURIComponent(s))},i.decodeUtf8=function(s){return decodeURIComponent(escape(s))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:e.encode,decode:e.decode}},i.binary.raw.encode=function(s){return String.fromCharCode.apply(null,s)},i.binary.raw.decode=function(s,p,d){var A=p;A||(A=new Uint8Array(s.length)),d||(d=0);for(var D=d,l=0;l<s.length;++l)A[D++]=s.charCodeAt(l);return p?D-d:A},i.binary.hex.encode=i.bytesToHex,i.binary.hex.decode=function(s,p,d){var A=p;A||(A=new Uint8Array(Math.ceil(s.length/2))),d||(d=0);var D=0,l=d;for(s.length&1&&(D=1,A[l++]=parseInt(s[0],16));D<s.length;D+=2)A[l++]=parseInt(s.substr(D,2),16);return p?l-d:A},i.binary.base64.encode=function(s,p){for(var d="",A="",D,l,n,r=0;r<s.byteLength;)D=s[r++],l=s[r++],n=s[r++],d+=t.charAt(D>>2),d+=t.charAt((D&3)<<4|l>>4),isNaN(l)?d+="==":(d+=t.charAt((l&15)<<2|n>>6),d+=isNaN(n)?"=":t.charAt(n&63)),p&&d.length>p&&(A+=d.substr(0,p)+`\r
4`,d=d.substr(p));return A+=d,A},i.binary.base64.decode=function(s,p,d){var A=p;A||(A=new Uint8Array(Math.ceil(s.length/4)*3)),s=s.replace(/[^A-Za-z0-9\+\/\=]/g,""),d||(d=0);for(var D,l,n,r,b=0,w=d;b<s.length;)D=g[s.charCodeAt(b++)-43],l=g[s.charCodeAt(b++)-43],n=g[s.charCodeAt(b++)-43],r=g[s.charCodeAt(b++)-43],A[w++]=D<<2|l>>4,n!==64&&(A[w++]=(l&15)<<4|n>>2,r!==64&&(A[w++]=(n&3)<<6|r));return p?w-d:A.subarray(0,w)},i.binary.base58.encode=function(s,p){return i.binary.baseN.encode(s,c,p)},i.binary.base58.decode=function(s,p){return i.binary.baseN.decode(s,c,p)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(s,p,d){s=i.encodeUtf8(s);var A=p;A||(A=new Uint8Array(s.length)),d||(d=0);for(var D=d,l=0;l<s.length;++l)A[D++]=s.charCodeAt(l);return p?D-d:A},i.text.utf8.decode=function(s){return i.decodeUtf8(String.fromCharCode.apply(null,s))},i.text.utf16.encode=function(s,p,d){var A=p;A||(A=new Uint8Array(s.length*2));var D=new Uint16Array(A.buffer);d||(d=0);for(var l=d,n=d,r=0;r<s.length;++r)D[n++]=s.charCodeAt(r),l+=2;return p?l-d:A},i.text.utf16.decode=function(s){return String.fromCharCode.apply(null,new Uint16Array(s.buffer))},i.deflate=function(s,p,d){if(p=i.decode64(s.deflate(i.encode64(p)).rval),d){var A=2;p.charCodeAt(1)&32&&(A=6),p=p.substring(A,p.length-4)}return p},i.inflate=function(s,p,d){var A=s.inflate(i.encode64(p)).rval;return A===null?null:i.decode64(A)};var S=function(s,p,d){if(!s)throw Error("WebStorage not available.");var A;if(d===null?A=s.removeItem(p):(d=i.encode64(JSON.stringify(d)),A=s.setItem(p,d)),A!==void 0&&A.rval!==!0){var D=Error(A.error.message);throw D.id=A.error.id,D.name=A.error.name,D}},_=function(s,p){if(!s)throw Error("WebStorage not available.");var d=s.getItem(p);if(s.init)if(d.rval===null){if(d.error){var A=Error(d.error.message);
4throw A.id=d.error.id,A.name=d.error.name,A}d=null}else d=d.rval;return d!==null&&(d=JSON.parse(i.decode64(d))),d},E=function(s,p,d,A){var D=_(s,p);D===null&&(D={}),D[d]=A,S(s,p,D)},u=function(s,p,d){var A=_(s,p);return A!==null&&(A=d in A?A[d]:null),A},h=function(s,p,d){var A=_(s,p);if(A!==null&&d in A){delete A[d];var D=!0;for(var l in A){D=!1;break}D&&(A=null),S(s,p,A)}},C=function(s,p){S(s,p,null)},m=function(s,p,d){var A=null;d===void 0&&(d=["web","flash"]);var D,l=!1,n=null;for(var r in d){D=d[r];try{if(D==="flash"||D==="both"){if(p[0]===null)throw Error("Flash local storage not available.");A=s.apply(this,p),l=D==="flash"}(D==="web"||D==="both")&&(p[0]=localStorage,A=s.apply(this,p),l=!0)}catch(b){n=b}if(l)break}if(!l)throw n;return A};i.setItem=function(s,p,d,A,D){m(E,arguments,D)},i.getItem=function(s,p,d,A){return m(u,arguments,A)},i.removeItem=function(s,p,d,A){m(h,arguments,A)},i.clearItems=function(s,p,d){m(C,arguments,d)},i.isEmpty=function(s){for(var p in s)if(s.hasOwnProperty(p))return!1;return!0},i.format=function(s){for(var p=/%./g,d,A,D=0,l=[],n=0;d=p.exec(s);){A=s.substring(n,p.lastIndex-2),A.length>0&&l.push(A),n=p.lastIndex;var r=d[0][1];switch(r){case"s":case"o":D<arguments.length?l.push(arguments[D+++1]):l.push("<?>");break;case"%":l.push("%");break;default:l.push("<%"+r+"?>")}}return l.push(s.substring(n)),l.join("")},i.formatNumber=function(s,p,d,A){var D=s,l=isNaN(p=Math.abs(p))?2:p,n=d===void 0?",":d,r=A===void 0?".":A,b=D<0?"-":"",w=parseInt(D=Math.abs(+D||0).toFixed(l),10)+"",V=w.length>3?w.length%3:0;return b+(V?w.substr(0,V)+r:"")+w.substr(V).replace(/(\d{3})(?=\d)/g,"$1"+r)+(l?n+Math.abs(D-w).toFixed(l).slice(2):"")},i.formatSize=function(s){return s=s>=1073741824?i.formatNumber(s/1073741824,2,".","")+" GiB":s>=1048576?i.formatNumber(s/1048576,2,".","")+" MiB":s>=1024?i.formatNumber(s/1024,0)+" KiB":i.formatNumber(s,0)+" bytes",s},i.bytesFromIP=function(s){return s.indexOf(".")===-1?s.indexOf(":")===-1?null:i.bytesFromIPv6(s):i.bytesFromIPv4(s)},i.bytesFromIPv4=function(s){if(s=s.split("."),s.length!==4)return null;for(var p=i.createBuffer(),d=0;d<s.length;++d){var A=parseInt(s[d],10);if(isNaN(A))return null;p.putByte(A)}return p.getBytes()},i.bytesFromIPv6=function(s){var p=0;s=s.split(":").filter(function(n){return n.length===0&&++p,!0});for(var d=(8-s.length+p)*2,A=i.createBuffer(),D=0;D<8;++D){if(!s[D]||s[D].length===0){A.fillWithByte(0,d),d=0;continue}var l=i.hexToBytes(s[D]);l.length<2&&A.putByte(0),A.putBytes(l)}return A.getBytes()},i.bytesToIP=function(s){return s.length===4?i.bytesToIPv4(s):s.length===16?i.bytesToIPv6(s):null},i.bytesToIPv4=function(s){if(s.length!==4)return null;for(var p=[],d=0;d<s.length;++d)p.push(s.charCodeAt(d));return p.join(".")},i.bytesToIPv6=function(s){if(s.length!==16)return null;for(var p=[],d=[],A=0,D=0;D<s.length;D+=2){for(var l=i.bytesToHex(s[D]+s[D+1]);l[0]==="0"&&l!=="0";)l=l.substr(1);if(l==="0"){var n=d[d.length-1],r=p.length;!n||r!==n.end+1?d.push({start:r,end:r}):(n.end=r,n.end-n.start>d[A].end-d[A].start&&(A=d.length-1))}p.push(l)}if(d.length>0){var b=d[A];b.end-b.start>0&&(p.splice(b.start,b.end-b.start+1,""),b.start===0&&p.unshift(""),b.end===7&&p.push(""))}return p.join(":")},i.estimateCores=function(s,p){if(typeof s=="function"&&(p=s,s={}),s||(s={}),"cores"in i&&!s.update)return p(null,i.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,p(null,i.cores);if(typeof Worker>"u")return i.cores=1,p(null,i.cores);if(typeof Blob>"u")return i.cores=2,p(null,i.cores);var d=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(n){for(var r=Date.now(),b=r+4;Date.now()<b;);self.postMessage({st:r,et:b})})}).toString(),")()"],{type:"application/javascript"}));A([],5,16);function A(n,r,b){if(r===0){var w=Math.floor(n.reduce(function(V,K){return V+K},0)/n.length);return i.cores=Math.max(1,w),URL.revokeObjectURL(d),p(null,i.cores)}D(b,function(V,K){n.push(l(b,K)),A(n,r-1,b)})}function D(n,r){for(var b=[],w=[],V=0;V<n;++V){var K=new Worker(d);K.addEventListener("message",function(x){if(w.push(x.data),w.length===n){for(var F=0;F<n;++F)b[F].terminate();r(null,w)}}),b.push(K)}for(var V=0;V<n;++V)b[V].postMessage(V)}function l(n,r){for(var b=[],w=0;w<n;++w)for(var V=r[w],K=b[w]=[],x=0;x<n;++x)if(w!==x){var F=r[x];(V.st>F.st&&V.st<F.et||F.st>V.st&&F.st<V.et)&&K.push(x)}return b.reduce(function(G,H){return Math.max(G,H.length)},0)}}})),Nt=ce(((oe,W)=>{var a=le();ye(),W.exports=a.cipher=a.cipher||{},a.cipher.algorithms=a.cipher.algorithms||{},a.cipher.createCipher=function(i,y){var k=i;if(typeof k=="string"&&(k=a.cipher.getAlgorithm(k),k&&(k=k())),!k)throw Error("Unsupported algorithm: "+i);return new a.cipher.BlockCipher({algorithm:k,key:y,decrypt:!1})},a.cipher.createDecipher=function(i,y){var k=i;if(typeof k=="string"&&(k=a.cipher.getAlgorithm(k),k&&(k=k())),!k)throw Error("Unsupported algorithm: "+i);return new a.cipher.BlockCipher({algorithm:k,key:y,decrypt:!0})},a.cipher.registerAlgorithm=function(i,y){i=i.toUpperCase(),a.cipher.algorithms[i]=y},a.cipher.getAlgorithm=function(i){return i=i.toUpperCase(),i in a.cipher.algorithms?a.cipher.algorithms[i]:null};var e=a.cipher.BlockCipher=function(i){this.algorithm=i.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=i.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=i.decrypt,this.algorithm.initialize(i)};e.prototype.start=function(i){i||(i={});var y={};for(var k in i)y[k]=i[k];y.decrypt=this._decrypt,this._finish=!1,this._input=a.util.createBuffer(),this.output=i.output||a.util.createBuffer(),this.mode.start(y)},e.prototype.update=function(i){for(i&&this._input.putBuffer(i);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},e.prototype.finish=function(i){i&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(k){return i(this.blockSize,k,!1)},this.mode.unpad=function(k){return i(this.blockSize,k,!0)});var y={};return y.decrypt=this._decrypt,y.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,y)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,y))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,y))}})),Dt=ce(((oe,W)=>{var a=le();ye(),a.cipher=a.cipher||{};var e=W.exports=a.cipher.modes=a.cipher.modes||{};e.ecb=function(T){T||(T={}),this.name="ECB",this.cipher=T.cipher,this.blockSize=T.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)},e.ecb.prototype.start=function(T){},e.ecb.prototype.encrypt=function(T,f,t){if(T.length()<this.blockSize&&!(t&&T.length()>0))return!0;for(var g=0;g<this._ints;++g)this._inBlock[g]=T.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var g=0;g<this._ints;++g)f.putInt32(this._outBlock[g])},e.ecb.prototype.decrypt=function(T,f,t){if(T.length()<this.blockSize&&!(t&&T.length()>0))return!0;for(var g=0;g<this._ints;++g)this._inBlock[g]=T.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var g=0;g<this._ints;++g)f.putInt32(this._outBlock[g])},e.ecb.prototype.pad=function(T,f){var t=T.length()===this.blockSize?this.blockSize:this.blockSize-T.length();return T.fillWithByte(t,t),!0},e.ecb.prototype.unpad=function(T,f){if(f.overflow>0)return!1;var t=T.length(),g=T.at(t-1);return g>this.blockSize<<2?!1:(T.truncate(g),!0)},e.cbc=function(T){T||(T={}),this.name="CBC",this.cipher=T.cipher,this.blockSize=T.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)},e.cbc.prototype.start=function(T){if(T.iv===null){if(!this._prev)throw Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in T)this._iv=i(T.iv,this.blockSize),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.")},e.cbc.prototype.encrypt=function(T,f,t){if(T.length()<this.blockSize&&!(t&&T.length()>0))return!0;for(var g=0;g<this._ints;++g)this._inBlock[g]=this._prev[g]^T.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var g=0;g<this._ints;++g)f.putInt32(this._outBlock[g]);this._prev=this._outBlock},e.cbc.prototype.decrypt=function(T,f,t){if(T.length()<this.blockSize&&!(t&&T.length()>0))return!0;for(var g=0;g<this._ints;++g)this._inBlock[g]=T.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var g=0;g<this._ints;++g)f.putInt32(this._prev[g]^this._outBlock[g]);this._prev=this._inBlock.slice(0)},e.cbc.prototype.pad=function(T,f){var t=T.length()===this.blockSize?this.blockSize:this.blockSize-T.length();return T.fillWithByte(t,t),!0},e.cbc.prototype.unpad=function(T,f){if(f.overflow>0)return!1;var t=T.length(),g=T.at(t-1);return g>this.blockSize<<2?!1:(T.truncate(g),!0)},e.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=Array(this._ints),this._partialBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},e.cfb.prototype.start=function(T){if(!("iv"in T))throw Error("Invalid IV parameter.");this._iv=i(T.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.cfb.prototype.encrypt=function(T,f,t){var g=T.length();if(g===0)return!0;
4if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&g>=this.blockSize){for(var c=0;c<this._ints;++c)this._inBlock[c]=T.getInt32()^this._outBlock[c],f.putInt32(this._inBlock[c]);return}var S=(this.blockSize-g)%this.blockSize;S>0&&(S=this.blockSize-S),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialBlock[c]=T.getInt32()^this._outBlock[c],this._partialOutput.putInt32(this._partialBlock[c]);if(S>0)T.read-=this.blockSize;else for(var c=0;c<this._ints;++c)this._inBlock[c]=this._partialBlock[c];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),S>0&&!t)return f.putBytes(this._partialOutput.getBytes(S-this._partialBytes)),this._partialBytes=S,!0;f.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=0},e.cfb.prototype.decrypt=function(T,f,t){var g=T.length();if(g===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&g>=this.blockSize){for(var c=0;c<this._ints;++c)this._inBlock[c]=T.getInt32(),f.putInt32(this._inBlock[c]^this._outBlock[c]);return}var S=(this.blockSize-g)%this.blockSize;S>0&&(S=this.blockSize-S),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialBlock[c]=T.getInt32(),this._partialOutput.putInt32(this._partialBlock[c]^this._outBlock[c]);if(S>0)T.read-=this.blockSize;else for(var c=0;c<this._ints;++c)this._inBlock[c]=this._partialBlock[c];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),S>0&&!t)return f.putBytes(this._partialOutput.getBytes(S-this._partialBytes)),this._partialBytes=S,!0;f.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=0},e.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=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},e.ofb.prototype.start=function(T){if(!("iv"in T))throw Error("Invalid IV parameter.");this._iv=i(T.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.ofb.prototype.encrypt=function(T,f,t){var g=T.length();if(T.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&g>=this.blockSize){for(var c=0;c<this._ints;++c)f.putInt32(T.getInt32()^this._outBlock[c]),this._inBlock[c]=this._outBlock[c];return}var S=(this.blockSize-g)%this.blockSize;S>0&&(S=this.blockSize-S),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialOutput.putInt32(T.getInt32()^this._outBlock[c]);if(S>0)T.read-=this.blockSize;else for(var c=0;c<this._ints;++c)this._inBlock[c]=this._outBlock[c];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),S>0&&!t)return f.putBytes(this._partialOutput.getBytes(S-this._partialBytes)),this._partialBytes=S,!0;f.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=0},e.ofb.prototype.decrypt=e.ofb.prototype.encrypt,e.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=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},e.ctr.prototype.start=function(T){if(!("iv"in T))throw Error("Invalid IV parameter.");this._iv=i(T.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.ctr.prototype.encrypt=function(T,f,t){var g=T.length();if(g===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&g>=this.blockSize)for(var c=0;c<this._ints;++c)f.putInt32(T.getInt32()^this._outBlock[c]);else{var S=(this.blockSize-g)%this.blockSize;S>0&&(S=this.blockSize-S),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialOutput.putInt32(T.getInt32()^this._outBlock[c]);if(S>0&&(T.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),S>0&&!t)return f.putBytes(this._partialOutput.getBytes(S-this._partialBytes)),this._partialBytes=S,!0;f.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=0}y(this._inBlock)},e.ctr.prototype.decrypt=e.ctr.prototype.encrypt,e.gcm=function(T){T||(T={}),this.name="GCM",this.cipher=T.cipher,this.blockSize=T.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0,this._R=3774873600},e.gcm.prototype.start=function(T){if(!("iv"in T))throw Error("Invalid IV parameter.");var f=a.util.createBuffer(T.iv);this._cipherLength=0;var t="additionalData"in T?a.util.createBuffer(T.additionalData):a.util.createBuffer();if("tagLength"in T?this._tagLength=T.tagLength:this._tagLength=128,this._tag=null,T.decrypt&&(this._tag=a.util.createBuffer(T.tag).getBytes(),this._tag.length!==this._tagLength/8))throw Error("Authentication tag does not match tag length.");this._hashBlock=Array(this._ints),this.tag=null,this._hashSubkey=Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var g=f.length();if(g===12)this._j0=[f.getInt32(),f.getInt32(),f.getInt32(),1];else{for(this._j0=[0,0,0,0];f.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[f.getInt32(),f.getInt32(),f.getInt32(),f.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(k(g*8)))}this._inBlock=this._j0.slice(0),y(this._inBlock),this._partialBytes=0,t=a.util.createBuffer(t),this._aDataLength=k(t.length()*8);var c=t.length()%this.blockSize;for(c&&t.fillWithByte(0,this.blockSize-c),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},e.gcm.prototype.encrypt=function(T,f,t){var g=T.length();if(g===0)return!0;
4if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&g>=this.blockSize){for(var c=0;c<this._ints;++c)f.putInt32(this._outBlock[c]^=T.getInt32());this._cipherLength+=this.blockSize}else{var S=(this.blockSize-g)%this.blockSize;S>0&&(S=this.blockSize-S),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialOutput.putInt32(T.getInt32()^this._outBlock[c]);if(S<=0||t){if(t){var _=g%this.blockSize;this._cipherLength+=_,this._partialOutput.truncate(this.blockSize-_)}else this._cipherLength+=this.blockSize;for(var c=0;c<this._ints;++c)this._outBlock[c]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),S>0&&!t)return T.read-=this.blockSize,f.putBytes(this._partialOutput.getBytes(S-this._partialBytes)),this._partialBytes=S,!0;f.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),y(this._inBlock)},e.gcm.prototype.decrypt=function(T,f,t){var g=T.length();if(g<this.blockSize&&!(t&&g>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),y(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 c=0;c<this._ints;++c)f.putInt32(this._outBlock[c]^this._hashBlock[c]);g<this.blockSize?this._cipherLength+=g%this.blockSize:this._cipherLength+=this.blockSize},e.gcm.prototype.afterFinish=function(T,f){var t=!0;f.decrypt&&f.overflow&&T.truncate(this.blockSize-f.overflow),this.tag=a.util.createBuffer();var g=this._aDataLength.concat(k(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,g);var c=[];this.cipher.encrypt(this._j0,c);for(var S=0;S<this._ints;++S)this.tag.putInt32(this._s[S]^c[S]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),f.decrypt&&this.tag.bytes()!==this._tag&&(t=!1),t},e.gcm.prototype.multiply=function(T,f){for(var t=[0,0,0,0],g=f.slice(0),c=0;c<128;++c)T[c/32|0]&1<<31-c%32&&(t[0]^=g[0],t[1]^=g[1],t[2]^=g[2],t[3]^=g[3]),this.pow(g,g);return t},e.gcm.prototype.pow=function(T,f){for(var t=T[3]&1,g=3;g>0;--g)f[g]=T[g]>>>1|(T[g-1]&1)<<31;f[0]=T[0]>>>1,t&&(f[0]^=this._R)},e.gcm.prototype.tableMultiply=function(T){for(var f=[0,0,0,0],t=0;t<32;++t){var g=T[t/8|0]>>>(7-t%8)*4&15,c=this._m[t][g];f[0]^=c[0],f[1]^=c[1],f[2]^=c[2],f[3]^=c[3]}return f},e.gcm.prototype.ghash=function(T,f,t){return f[0]^=t[0],f[1]^=t[1],f[2]^=t[2],f[3]^=t[3],this.tableMultiply(f)},e.gcm.prototype.generateHashTable=function(T,f){for(var t=8/f,g=4*t,c=16*t,S=Array(c),_=0;_<c;++_){var E=[0,0,0,0],u=_/g|0,h=(g-1-_%g)*f;E[u]=1<<f-1<<h,S[_]=this.generateSubHashTable(this.multiply(E,T),f)}return S},e.gcm.prototype.generateSubHashTable=function(T,f){var t=1<<f,g=t>>>1,c=Array(t);c[g]=T.slice(0);for(var S=g>>>1;S>0;)this.pow(c[2*S],c[S]=[]),S>>=1;for(S=2;S<g;){for(var _=1;_<S;++_){var E=c[S],u=c[_];c[S+_]=[E[0]^u[0],E[1]^u[1],E[2]^u[2],E[3]^u[3]]}S*=2}for(c[0]=[0,0,0,0],S=g+1;S<t;++S){var h=c[S^g];c[S]=[T[0]^h[0],T[1]^h[1],T[2]^h[2],T[3]^h[3]]}return c};function i(T,f){if(typeof T=="string"&&(T=a.util.createBuffer(T)),a.util.isArray(T)&&T.length>4){var t=T;T=a.util.createBuffer();for(var g=0;g<t.length;++g)T.putByte(t[g])}if(T.length()<f)throw Error("Invalid IV length; got "+T.length()+" bytes and expected "+f+" bytes.");if(!a.util.isArray(T)){for(var c=[],S=f/4,g=0;g<S;++g)c.push(T.getInt32());T=c}return T}function y(T){T[T.length-1]=T[T.length-1]+1&4294967295}function k(T){return[T/4294967296|0,T&4294967295]}})),pt=ce(((oe,W)=>{var a=le();Nt(),Dt(),ye(),W.exports=a.aes=a.aes||{},a.aes.startEncrypting=function(u,h,C,m){var s=E({key:u,decrypt:!1,mode:m});return s.start(h),s},a.aes.createEncryptionCipher=function(u,h){return E({key:u,decrypt:!1,mode:h})},a.aes.startDecrypting=function(u,h,C,m){var s=E({key:u,decrypt:!0,mode:m});return s.start(h),s},a.aes.createDecryptionCipher=function(u,h){return E({key:u,decrypt:!0,mode:h})},a.aes.Algorithm=function(u,h){i||c();
4var C=this;C.name=u,C.mode=new h({blockSize:16,cipher:{encrypt:function(m,s){return _(C._w,m,s,!1)},decrypt:function(m,s){return _(C._w,m,s,!0)}}}),C._init=!1},a.aes.Algorithm.prototype.initialize=function(u){if(!this._init){var h=u.key,C;if(typeof h=="string"&&(h.length===16||h.length===24||h.length===32))h=a.util.createBuffer(h);else if(a.util.isArray(h)&&(h.length===16||h.length===24||h.length===32)){C=h,h=a.util.createBuffer();for(var m=0;m<C.length;++m)h.putByte(C[m])}if(!a.util.isArray(h)){C=h,h=[];var s=C.length();if(s===16||s===24||s===32){s>>>=2;for(var m=0;m<s;++m)h.push(C.getInt32())}}if(!a.util.isArray(h)||!(h.length===4||h.length===6||h.length===8))throw Error("Invalid key parameter.");var p=this.mode.name,d=["CFB","OFB","CTR","GCM"].indexOf(p)!==-1;this._w=S(h,u.decrypt&&!d),this._init=!0}},a.aes._expandKey=function(u,h){return i||c(),S(u,h)},a.aes._updateBlock=_,e("AES-ECB",a.cipher.modes.ecb),e("AES-CBC",a.cipher.modes.cbc),e("AES-CFB",a.cipher.modes.cfb),e("AES-OFB",a.cipher.modes.ofb),e("AES-CTR",a.cipher.modes.ctr),e("AES-GCM",a.cipher.modes.gcm);function e(u,h){a.cipher.registerAlgorithm(u,function(){return new a.aes.Algorithm(u,h)})}var i=!1,y=4,k,T,f,t,g;function c(){i=!0,f=[0,1,2,4,8,16,32,64,128,27,54];for(var u=Array(256),h=0;h<128;++h)u[h]=h<<1,u[h+128]=h+128<<1^283;k=Array(256),T=Array(256),t=[,,,,],g=[,,,,];for(var h=0;h<4;++h)t[h]=Array(256),g[h]=Array(256);for(var C=0,m=0,s,p,d,A,D,l,n,h=0;h<256;++h){A=m^m<<1^m<<2^m<<3^m<<4,A=A>>8^A&255^99,k[C]=A,T[A]=C,D=u[A],s=u[C],p=u[s],d=u[p],l=D<<24^A<<16^A<<8^A^D,n=(s^p^d)<<24^(C^d)<<16^(C^p^d)<<8^C^s^d;for(var r=0;r<4;++r)t[r][C]=l,g[r][A]=n,l=l<<24|l>>>8,n=n<<24|n>>>8;C===0?C=m=1:(C=s^u[u[u[s^d]]],m^=u[u[m]])}}function S(u,h){for(var C=u.slice(0),m,s=1,p=C.length,d=y*(p+6+1),A=p;A<d;++A)m=C[A-1],A%p===0?(m=k[m>>>16&255]<<24^k[m>>>8&255]<<16^k[m&255]<<8^k[m>>>24]^f[s]<<24,s++):p>6&&A%p===4&&(m=k[m>>>24]<<24^k[m>>>16&255]<<16^k[m>>>8&255]<<8^k[m&255]),C[A]=C[A-p]^m;if(h){var D,l=g[0],n=g[1],r=g[2],b=g[3],w=C.slice(0);d=C.length;for(var A=0,V=d-y;A<d;A+=y,V-=y)if(A===0||A===d-y)w[A]=C[V],w[A+1]=C[V+3],w[A+2]=C[V+2],w[A+3]=C[V+1];else for(var K=0;K<y;++K)D=C[V+K],w[A+(3&-K)]=l[k[D>>>24]]^n[k[D>>>16&255]]^r[k[D>>>8&255]]^b[k[D&255]];C=w}return C}function _(u,h,C,m){var s=u.length/4-1,p,d,A,D,l;m?(p=g[0],d=g[1],A=g[2],D=g[3],l=T):(p=t[0],d=t[1],A=t[2],D=t[3],l=k);for(var n=h[0]^u[0],r=h[m?3:1]^u[1],b=h[2]^u[2],w=h[m?1:3]^u[3],V,K,x,F=3,G=1;G<s;++G)V=p[n>>>24]^d[r>>>16&255]^A[b>>>8&255]^D[w&255]^u[++F],K=p[r>>>24]^d[b>>>16&255]^A[w>>>8&255]^D[n&255]^u[++F],x=p[b>>>24]^d[w>>>16&255]^A[n>>>8&255]^D[r&255]^u[++F],w=p[w>>>24]^d[n>>>16&255]^A[r>>>8&255]^D[b&255]^u[++F],n=V,r=K,b=x;C[0]=l[n>>>24]<<24^l[r>>>16&255]<<16^l[b>>>8&255]<<8^l[w&255]^u[++F],C[m?3:1]=l[r>>>24]<<24^l[b>>>16&255]<<16^l[w>>>8&255]<<8^l[n&255]^u[++F],C[2]=l[b>>>24]<<24^l[w>>>16&255]<<16^l[n>>>8&255]<<8^l[r&255]^u[++F],C[m?1:3]=l[w>>>24]<<24^l[n>>>16&255]<<16^l[r>>>8&255]<<8^l[b&255]^u[++F]}function E(u){u||(u={});var h="AES-"+(u.mode||"CBC").toUpperCase(),C=u.decrypt?a.cipher.createDecipher(h,u.key):a.cipher.createCipher(h,u.key),m=C.start;return C.start=function(s,p){var d=null;p instanceof a.util.ByteBuffer&&(d=p,p={}),p||(p={}),p.output=d,p.iv=s,m.call(C,p)},C}})),ht=ce(((oe,W)=>{var a=le();a.pki=a.pki||{};var e=W.exports=a.pki.oids=a.oids=a.oids||{};function i(k,T){e[k]=T,e[T]=k}function y(k,T){e[k]=T}i("1.2.840.113549.1.1.1","rsaEncryption"),i("1.2.840.113549.1.1.4","md5WithRSAEncryption"),i("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),i("1.2.840.113549.1.1.7","RSAES-OAEP"),i("1.2.840.113549.1.1.8","mgf1"),i("1.2.840.113549.1.1.9","pSpecified"),i("1.2.840.113549.1.1.10","RSASSA-PSS"),i("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),i("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),i("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),i("1.3.101.112","EdDSA25519"),i("1.2.840.10040.4.3","dsa-with-sha1"),i("1.3.14.3.2.7","desCBC"),i("1.3.14.3.2.26","sha1"),i("1.3.14.3.2.29","sha1WithRSASignature"),i("2.16.840.1.101.3.4.2.1","sha256"),i("2.16.840.1.101.3.4.2.2","sha384"),i("2.16.840.1.101.3.4.2.3","sha512"),i("2.16.840.1.101.3.4.2.4","sha224"),i("2.16.840.1.101.3.4.2.5","sha512-224"),i("2.16.840.1.101.3.4.2.6","sha512-256"),i("1.2.840.113549.2.2","md2"),i("1.2.840.113549.2.5","md5"),i("1.2.840.113549.1.7.1","data"),i("1.2.840.113549.1.7.2","signedData"),i("1.2.840.113549.1.7.3","envelopedData"),i("1.2.840.113549.1.7.4","signedAndEnvelopedData"),i("1.2.840.113549.1.7.5","digestedData"),i("1.2.840.113549.1.7.6","encryptedData"),i("1.2.840.113549.1.9.1","emailAddress"),i("1.2.840.113549.1.9.2","unstructuredName"),i("1.2.840.113549.1.9.3","contentType"),i("1.2.840.113549.1.9.4","messageDigest"),i("1.2.840.113549.1.9.5","signingTime"),i("1.2.840.113549.1.9.6","counterSignature"),i("1.2.840.113549.1.9.7","challengePassword"),i("1.2.840.113549.1.9.8","unstructuredAddress"),i("1.2.840.113549.1.9.14","extensionRequest"),i("1.2.840.113549.1.9.20","friendlyName"),i("1.2.840.113549.1.9.21","localKeyId"),i("1.2.840.113549.1.9.22.1","x509Certificate"),i("1.2.840.113549.1.12.10.1.1","keyBag"),i("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),i("1.2.840.113549.1.12.10.1.3","certBag"),i("1.2.840.113549.1.12.10.1.4","crlBag"),i("1.2.840.113549.1.12.10.1.5","secretBag"),i("1.2.840.113549.1.12.10.1.6","safeContentsBag"),i("1.2.840.113549.1.5.
413","pkcs5PBES2"),i("1.2.840.113549.1.5.12","pkcs5PBKDF2"),i("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),i("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),i("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),i("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),i("1.2.840.113549.2.7","hmacWithSHA1"),i("1.2.840.113549.2.8","hmacWithSHA224"),i("1.2.840.113549.2.9","hmacWithSHA256"),i("1.2.840.113549.2.10","hmacWithSHA384"),i("1.2.840.113549.2.11","hmacWithSHA512"),i("1.2.840.113549.3.7","des-EDE3-CBC"),i("2.16.840.1.101.3.4.1.2","aes128-CBC"),i("2.16.840.1.101.3.4.1.22","aes192-CBC"),i("2.16.840.1.101.3.4.1.42","aes256-CBC"),i("2.5.4.3","commonName"),i("2.5.4.4","surname"),i("2.5.4.5","serialNumber"),i("2.5.4.6","countryName"),i("2.5.4.7","localityName"),i("2.5.4.8","stateOrProvinceName"),i("2.5.4.9","streetAddress"),i("2.5.4.10","organizationName"),i("2.5.4.11","organizationalUnitName"),i("2.5.4.12","title"),i("2.5.4.13","description"),i("2.5.4.15","businessCategory"),i("2.5.4.17","postalCode"),i("2.5.4.42","givenName"),i("2.5.4.65","pseudonym"),i("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),i("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),i("2.16.840.1.113730.1.1","nsCertType"),i("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"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),y("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("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","invali
4dityDate"),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"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),y("2.5.29.33","policyMappings"),y("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),y("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),y("2.5.29.46","freshestCRL"),y("2.5.29.54","inhibitAnyPolicy"),i("1.3.6.1.4.1.11129.2.4.2","timestampList"),i("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),i("1.3.6.1.5.5.7.3.1","serverAuth"),i("1.3.6.1.5.5.7.3.2","clientAuth"),i("1.3.6.1.5.5.7.3.3","codeSigning"),i("1.3.6.1.5.5.7.3.4","emailProtection"),i("1.3.6.1.5.5.7.3.8","timeStamping")})),st=ce(((oe,W)=>{var a=le();ye(),ht();var e=W.exports=a.asn1=a.asn1||{};e.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},e.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},e.maxDepth=256,e.create=function(f,t,g,c,S){if(a.util.isArray(c)){for(var _=[],E=0;E<c.length;++E)c[E]!==void 0&&_.push(c[E]);c=_}var u={tagClass:f,type:t,constructed:g,composed:g||a.util.isArray(c),value:c};return S&&"bitStringContents"in S&&(u.bitStringContents=S.bitStringContents,u.original=e.copy(u)),u},e.copy=function(f,t){var g;if(a.util.isArray(f)){g=[];for(var c=0;c<f.length;++c)g.push(e.copy(f[c],t));return g}return typeof f=="string"?f:(g={tagClass:f.tagClass,type:f.type,constructed:f.constructed,composed:f.composed,value:e.copy(f.value,t)},t&&!t.excludeBitStringContents&&(g.bitStringContents=f.bitStringContents),g)},e.equals=function(f,t,g){if(a.util.isArray(f)){if(!a.util.isArray(t)||f.length!==t.length)return!1;for(var c=0;c<f.length;++c)if(!e.equals(f[c],t[c]))return!1;return!0}if(typeof f!=typeof t)return!1;if(typeof f=="string")return f===t;var S=f.tagClass===t.tagClass&&f.type===t.type&&f.constructed===t.constructed&&f.composed===t.composed&&e.equals(f.value,t.value);return g&&g.includeBitStringContents&&S&&(S=f.bitStringContents===t.bitStringContents),S},e.getBerValueLength=function(f){var t=f.getByte();if(t!==128)return t&128?f.getInt((t&127)<<3):t};function i(f,t,g){if(g>t){var c=Error("Too few bytes to parse DER.");throw c.available=f.length(),c.remaining=t,c.requested=g,c}}var y=function(f,t){var g=f.getByte();if(t--,g!==128){var c;if(!(g&128))c=g;else{var S=g&127;i(f,t,S),c=f.getInt(S<<3)}if(c<0)throw Error("Negative length: "+c);return c}};e.fromDer=function(f,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"maxDepth"in t||(t.maxDepth=e.maxDepth),typeof f=="string"&&(f=a.util.createBuffer(f));var g=f.length(),c=k(f,f.length(),0,t);if(t.parseAllBytes&&f.length()!==0){var S=Error("Unparsed DER bytes remain after ASN.1 parsing.");throw S.byteCount=g,S.remaining=f.length(),S}return c};function k(f,t,g,c){if(g>=c.maxDepth)throw Error("ASN.1 parsing error: Max depth exceeded.");var S;i(f,t,2);var _=f.getByte();t--;var E=_&192,u=_&31;S=f.length();var h=y(f,t);if(t-=S-f.length(),h!==void 0&&h>t){if(c.strict){var C=Error("Too few bytes to read ASN.1 value.");throw C.available=f.length(),C.remaining=t,C.requested=h,C}h=t}var m,s,p=(_&32)==32;if(p)if(m=[],h===void 0)for(;;){if(i(f,t,2),f.bytes(2)==="\0\0"){f.getBytes(2),t-=2;break}S=f.length(),m.push(k(f,t,g+1,c)),t-=S-f.length()}else for(;h>0;)S=f.length(),m.push(k(f,h,g+1,c)),t-=S-f.length(),h-=S-f.length();if(m===void 0&&E===e.Class.UNIVERSAL&&u===e.Type.BITSTRING&&(s=f.bytes(h)),m===void 0&&c.decodeBitStrings&&E===e.Class.UNIVERSAL&&u===e.Type.BITSTRING&&h>1){var d=f.read,A=t,D=0;if(u===e.Type.BITSTRING&&(i(f,t,1),D=f.getByte(),t--),D===0)try{S=f.length();var l=k(f,t,g+1,{strict:!0,decodeBitStrings:!0}),n=S-f.length();t-=n,u==e.Type.BITSTRING&&n++;var r=l.tagClass;n===h&&(r===e.Class.UNIVERSAL||r===e.Class.CONTEXT_SPECIFIC)&&(m=[l])}catch{}m===void 0&&(f.read=d,t=A)}if(m===void 0){if(h===void 0){if(c.strict)throw Error("Non-constructed ASN.1 object of indefinite length.");h=t}if(u===e.Type.BMPSTRING)for(m="";h>0;h-=2)i(f,t,2),m+=String.fromCharCode(f.getInt16()),t-=2;else m=f.getBytes(h),t-=h}var b=s===void 0?null:{bitStringContents:s};return e.create(E,u,p,m,b)}e.toDer=function(f){var t=a.util.createBuffer(),g=f.tagClass|f.type,c=a.util.createBuffer(),S=!1;
4if("bitStringContents"in f&&(S=!0,f.original&&(S=e.equals(f,f.original))),S)c.putBytes(f.bitStringContents);else if(f.composed){f.constructed?g|=32:c.putByte(0);for(var _=0;_<f.value.length;++_)f.value[_]!==void 0&&c.putBuffer(e.toDer(f.value[_]))}else if(f.type===e.Type.BMPSTRING)for(var _=0;_<f.value.length;++_)c.putInt16(f.value.charCodeAt(_));else f.type===e.Type.INTEGER&&f.value.length>1&&(f.value.charCodeAt(0)===0&&!(f.value.charCodeAt(1)&128)||f.value.charCodeAt(0)===255&&(f.value.charCodeAt(1)&128)==128)?c.putBytes(f.value.substr(1)):c.putBytes(f.value);if(t.putByte(g),c.length()<=127)t.putByte(c.length()&127);else{var E=c.length(),u="";do u+=String.fromCharCode(E&255),E>>>=8;while(E>0);t.putByte(u.length|128);for(var _=u.length-1;_>=0;--_)t.putByte(u.charCodeAt(_))}return t.putBuffer(c),t},e.oidToDer=function(f){var t=f.split("."),g=a.util.createBuffer();g.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var c,S,_,E,u=2;u<t.length;++u){if(c=!0,S=[],_=parseInt(t[u],10),_>4294967295)throw Error("OID value too large; max is 32-bits.");do E=_&127,_>>>=7,c||(E|=128),S.push(E),c=!1;while(_>0);for(var h=S.length-1;h>=0;--h)g.putByte(S[h])}return g},e.derToOid=function(f){var t;typeof f=="string"&&(f=a.util.createBuffer(f));var g=f.getByte();t=Math.floor(g/40)+"."+g%40;for(var c=0;f.length()>0;){if(c>70368744177663)throw Error("OID value too large; max is 53-bits.");g=f.getByte(),c*=128,g&128?c+=g&127:(t+="."+(c+g),c=0)}return t},e.utcTimeToDate=function(f){var t=new Date,g=parseInt(f.substr(0,2),10);g=g>=50?1900+g:2e3+g;var c=parseInt(f.substr(2,2),10)-1,S=parseInt(f.substr(4,2),10),_=parseInt(f.substr(6,2),10),E=parseInt(f.substr(8,2),10),u=0;if(f.length>11){var h=f.charAt(10),C=10;h!=="+"&&h!=="-"&&(u=parseInt(f.substr(10,2),10),C+=2)}if(t.setUTCFullYear(g,c,S),t.setUTCHours(_,E,u,0),C&&(h=f.charAt(C),h==="+"||h==="-")){var m=parseInt(f.substr(C+1,2),10),s=parseInt(f.substr(C+4,2),10),p=m*60+s;p*=6e4,h==="+"?t.setTime(+t-p):t.setTime(+t+p)}return t},e.generalizedTimeToDate=function(f){var t=new Date,g=parseInt(f.substr(0,4),10),c=parseInt(f.substr(4,2),10)-1,S=parseInt(f.substr(6,2),10),_=parseInt(f.substr(8,2),10),E=parseInt(f.substr(10,2),10),u=parseInt(f.substr(12,2),10),h=0,C=0,m=!1;f.charAt(f.length-1)==="Z"&&(m=!0);var s=f.length-5,p=f.charAt(s);if(p==="+"||p==="-"){var d=parseInt(f.substr(s+1,2),10),A=parseInt(f.substr(s+4,2),10);C=d*60+A,C*=6e4,p==="+"&&(C*=-1),m=!0}return f.charAt(14)==="."&&(h=parseFloat(f.substr(14),10)*1e3),m?(t.setUTCFullYear(g,c,S),t.setUTCHours(_,E,u,h),t.setTime(+t+C)):(t.setFullYear(g,c,S),t.setHours(_,E,u,h)),t},e.dateToUtcTime=function(f){if(typeof f=="string")return f;var t="",g=[];g.push((""+f.getUTCFullYear()).substr(2)),g.push(""+(f.getUTCMonth()+1)),g.pu
4sh(""+f.getUTCDate()),g.push(""+f.getUTCHours()),g.push(""+f.getUTCMinutes()),g.push(""+f.getUTCSeconds());for(var c=0;c<g.length;++c)g[c].length<2&&(t+="0"),t+=g[c];return t+="Z",t},e.dateToGeneralizedTime=function(f){if(typeof f=="string")return f;var t="",g=[];g.push(""+f.getUTCFullYear()),g.push(""+(f.getUTCMonth()+1)),g.push(""+f.getUTCDate()),g.push(""+f.getUTCHours()),g.push(""+f.getUTCMinutes()),g.push(""+f.getUTCSeconds());for(var c=0;c<g.length;++c)g[c].length<2&&(t+="0"),t+=g[c];return t+="Z",t},e.integerToDer=function(f){var t=a.util.createBuffer();if(f>=-128&&f<128)return t.putSignedInt(f,8);if(f>=-32768&&f<32768)return t.putSignedInt(f,16);if(f>=-8388608&&f<8388608)return t.putSignedInt(f,24);if(f>=-2147483648&&f<2147483648)return t.putSignedInt(f,32);var g=Error("Integer too large; max is 32-bits.");throw g.integer=f,g},e.derToInteger=function(f){typeof f=="string"&&(f=a.util.createBuffer(f));var t=f.length()*8;if(t>32)throw Error("Integer too large; max is 32-bits.");return f.getSignedInt(t)},e.validate=function(f,t,g,c){var S=!1;if((f.tagClass===t.tagClass||t.tagClass===void 0)&&(f.type===t.type||t.type===void 0))if(f.constructed===t.constructed||t.constructed===void 0){if(S=!0,t.value&&a.util.isArray(t.value))for(var _=0,E=0;S&&E<t.value.length;++E){var u=t.value[E];S=!!u.optional;var h=f.value[_];if(!h){u.optional||(S=!1,c&&c.push("["+t.name+'] Missing required element. Expected tag class "'+u.tagClass+'", type "'+u.type+'"'));continue}if(u.tagClass!==void 0&&u.type!==void 0&&(h.tagClass!==u.tagClass||h.type!==u.type))if(u.optional){S=!0;continue}else{S=!1,c&&c.push("["+t.name+"] Tag mismatch. Expected ("+u.tagClass+","+u.type+"), got ("+h.tagClass+","+h.type+")");break}if(e.validate(h,u,g,c))++_,S=!0;else if(u.optional)S=!0;else{S=!1;break}}if(S&&g&&(t.capture&&(g[t.capture]=f.value),t.captureAsn1&&(g[t.captureAsn1]=f),t.captureBitStringContents&&"bitStringContents"in f&&(g[t.captureBitStringContents]=f.bitStringContents),t.captureBitStringValue&&"bitStringContents"in f))if(f.bitStringContents.length<2)g[t.captureBitStringValue]="";else{if(f.bitStringContents.charCodeAt(0)!==0)throw Error("captureBitStringValue only supported for zero unused bits");g[t.captureBitStringValue]=f.bitStringContents.slice(1)}}else c&&c.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+f.constructed+'"');else c&&(f.tagClass!==t.tagClass&&c.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+f.tagClass+'"'),f.type!==t.type&&c.push("["+t.name+'] Expected type "'+t.type+'", got "'+f.type+'"'));return S};var T=/[^\\u0000-\\u00ff]/;e.prettyPrint=function(f,t,g){var c="";t||(t=0),g||(g=2),t>0&&(c+=`
5`);for(var S="",_=0;_<t*g;++_)S+=" ";switch(c+=S+"Tag: ",f.tagClass){case e.Class.UNIVERSAL:c+="Universal:";break;case e.Class.APPLICATION:c+="Application:";break;case e.Class.CONTEXT_SPECIFIC:c+="Context-Specific:";break;case e.Class.PRIVATE:c+="Private:";break}if(f.tagClass===e.Class.UNIVERSAL)switch(c+=f.type,f.type){case e.Type.NONE:c+=" (None)";break;case e.Type.BOOLEAN:c+=" (Boolean)";break;case e.Type.INTEGER:c+=" (Integer)";break;case e.Type.BITSTRING:c+=" (Bit string)";break;case e.Type.OCTETSTRING:c+=" (Octet string)";break;case e.Type.NULL:c+=" (Null)";break;case e.Type.OID:c+=" (Object Identifier)";break;case e.Type.ODESC:c+=" (Object Descriptor)";break;case e.Type.EXTERNAL:c+=" (External or Instance of)";break;case e.Type.REAL:c+=" (Real)";break;case e.Type.ENUMERATED:c+=" (Enumerated)";break;case e.Type.EMBEDDED:c+=" (Embedded PDV)";break;case e.Type.UTF8:c+=" (UTF8)";break;case e.Type.ROID:c+=" (Relative Object Identifier)";break;case e.Type.SEQUENCE:c+=" (Sequence)";break;case e.Type.SET:c+=" (Set)";break;case e.Type.PRINTABLESTRING:c+=" (Printable String)";break;case e.Type.IA5String:c+=" (IA5String (ASCII))";break;case e.Type.UTCTIME:c+=" (UTC time)";break;case e.Type.GENERALIZEDTIME:c+=" (Generalized time)";break;case e.Type.BMPSTRING:c+=" (BMP String)";break}else c+=f.type;if(c+=`
6`,c+=S+"Constructed: "+f.constructed+`
7`,f.composed){for(var E=0,u="",_=0;_<f.value.length;++_)f.value[_]!==void 0&&(E+=1,u+=e.prettyPrint(f.value[_],t+1,g),_+1<f.value.length&&(u+=","));c+=S+"Sub values: "+E+u}else{if(c+=S+"Value: ",f.type===e.Type.OID){var h=e.derToOid(f.value);
7c+=h,a.pki&&a.pki.oids&&h in a.pki.oids&&(c+=" ("+a.pki.oids[h]+") ")}if(f.type===e.Type.INTEGER)try{c+=e.derToInteger(f.value)}catch{c+="0x"+a.util.bytesToHex(f.value)}else if(f.type===e.Type.BITSTRING){if(f.value.length>1?c+="0x"+a.util.bytesToHex(f.value.slice(1)):c+="(none)",f.value.length>0){var C=f.value.charCodeAt(0);C==1?c+=" (1 unused bit shown)":C>1&&(c+=" ("+C+" unused bits shown)")}}else if(f.type===e.Type.OCTETSTRING)T.test(f.value)||(c+="("+f.value+") "),c+="0x"+a.util.bytesToHex(f.value);else if(f.type===e.Type.UTF8)try{c+=a.util.decodeUtf8(f.value)}catch(m){if(m.message==="URI malformed")c+="0x"+a.util.bytesToHex(f.value)+" (malformed UTF8)";else throw m}else f.type===e.Type.PRINTABLESTRING||f.type===e.Type.IA5String?c+=f.value:T.test(f.value)?c+="0x"+a.util.bytesToHex(f.value):f.value.length===0?c+="[null]":c+=f.value}return c}})),ut=ce(((oe,W)=>{var a=le();W.exports=a.md=a.md||{},a.md.algorithms=a.md.algorithms||{}})),mt=ce(((oe,W)=>{var a=le();ut(),ye();var e=W.exports=a.hmac=a.hmac||{};e.create=function(){var i=null,y=null,k=null,T=null,f={};return f.start=function(t,g){if(t!==null)if(typeof t=="string")if(t=t.toLowerCase(),t in a.md.algorithms)y=a.md.algorithms[t].create();else throw Error('Unknown hash algorithm "'+t+'"');else y=t;if(g===null)g=i;else{if(typeof g=="string")g=a.util.createBuffer(g);else if(a.util.isArray(g)){var c=g;g=a.util.createBuffer();for(var S=0;S<c.length;++S)g.putByte(c[S])}var _=g.length();_>y.blockLength&&(y.start(),y.update(g.bytes()),g=y.digest()),k=a.util.createBuffer(),T=a.util.createBuffer(),_=g.length();for(var S=0;S<_;++S){var c=g.at(S);k.putByte(54^c),T.putByte(92^c)}if(_<y.blockLength)for(var c=y.blockLength-_,S=0;S<c;++S)k.putByte(54),T.putByte(92);i=g,k=k.bytes(),T=T.bytes()}y.start(),y.update(k)},f.update=function(t){y.update(t)},f.getMac=function(){var t=y.digest().bytes();return y.start(),y.update(T),y.update(t),y.digest()},f.digest=f.getMac,f}})),Rt=ce(((oe,W)=>{var a=le();ut(),ye();var e=W.exports=a.md5=a.md5||{};a.md.md5=a.md.algorithms.md5=e,e.create=function(){f||t();var c=null,S=a.util.createBuffer(),_=Array(16),E={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return E.start=function(){E.messageLength=0,E.fullMessageLength=E.messageLength64=[];for(var u=E.messageLengthSize/4,h=0;h<u;++h)E.fullMessageLength.push(0);return S=a.util.createBuffer(),c={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},E},E.start(),E.update=function(u,h){h==="utf8"&&(u=a.util.encodeUtf8(u));var C=u.length;E.messageLength+=C,C=[C/4294967296>>>0,C>>>0];for(var m=E.fullMessageLength.length-1;m>=0;--m)E.fullMessageLength[m]+=C[1],C[1]=C[0]+(E.fullMessageLength[m]/4294967296>>>0),E.fullMessageLength[m]=E.fullMessageLength[m]>>>0,C[0]=C[1]/4294967296>>>0;return S.putBytes(u),g(c,_,S),(S.read>2048||S.length()===0)&&S.compact(),E},E.digest=function(){var u=a.util.createBuffer();u.putBytes(S.bytes());var h=E.fullMessageLength[E.fullMessageLength.length-1]+E.messageLengthSize&E.blockLength-1;u.putBytes(i.substr(0,E.blockLength-h));for(var C,m=0,s=E.fullMessageLength.length-1;s>=0;--s)C=E.fullMessageLength[s]*8+m,m=C/4294967296>>>0,u.putInt32Le(C>>>0);var p={h0:c.h0,h1:c.h1,h2:c.h2,h3:c.h3};g(p,_,u);var d=a.util.createBuffer();return d.putInt32Le(p.h0),d.putInt32Le(p.h1),d.putInt32Le(p.h2),d.putInt32Le(p.h3),d},E};var i=null,y=null,k=null,T=null,f=!1;function t(){i="€",i+=a.util.fillString("\0",64),y=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],k=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],T=Array(64);for(var c=0;c<64;++c)T[c]=Math.floor(Math.abs(Math.sin(c+1))*4294967296);f=!0}function g(c,S,_){for(var E,u,h,C,m,s,p,d,A=_.length();A>=64;){for(u=c.h0,h=c.h1,C=c.h2,m=c.h3,d=0;d<16;++d)S[d]=_.getInt32Le(),s=m^h&(C^m),E=u+s+T[d]+S[d],p=k[d],u=m,m=C,C=h,h+=E<<p|E>>>32-p;for(;d<32;++d)s=C^m&(h^C),E=u+s+T[d]+S[y[d]],p=k[d],u=m,m=C,C=h,h+=E<<p|E>>>32-p;for(;d<48;++d)s=h^C^m,E=u+s+T[d]+S[y[d]],p=k[d],u=m,m=C,C=h,h+=E<<p|E>>>32-p;for(;d<64;++d)s=C^(h|~m),E=u+s+T[d]+S[y[d]],p=k[d],u=m,m=C,C=h,h+=E<<p|E>>>32-p;c.h0=c.h0+u|0,c.h1=c.h1+h|0,c.h2=c.h2+C|0,c.h3=c.h3+m|0,A-=64}}})),gt=ce(((oe,W)=>{var a=le();ye();var e=W.exports=a.pem=a.pem||{};e.encode=function(k,T){T||(T={});var f="-----BEGIN "+k.type+`-----\r
8`,t;if(k.procType&&(t={name:"Proc-Type",values:[String(k.procType.version),k.procType.type]},f+=i(t)),k.contentDomain&&(t={name:"Content-Domain",values:[k.contentDomain]},f+=i(t)),k.dekInfo&&(t={name:"DEK-Info",values:[k.dekInfo.algorithm]},k.dekInfo.parameters&&t.values.push(k.dekInfo.parameters),f+=i(t)),k.headers)for(var g=0;g<k.headers.length;++g)f+=i(k.headers[g]);return k.procType&&(f+=`\r
9`),f+=a.util.encode64(k.body,T.maxline||64)+`\r
10`,f+="-----END "+k.type+`-----\r
11`,f},e.decode=function(k){for(var T=[],f=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,t=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,g=/\r?\n/,c;c=f.exec(k),c;){var S=c[1];S==="NEW CERTIFICATE REQUEST"&&(S="CERTIFICATE REQUEST");var _={type:S,procType:null,contentDomain:null,dekInfo:null,headers:[],body:a.util.decode64(c[3])};if(T.push(_),c[2]){for(var E=c[2].split(g),u=0;c&&u<E.length;){for(var h=E[u].replace(/\s+$/,""),C=u+1;C<E.length;++C){var m=E[C];if(!/\s/.test(m[0]))break;h+=m,u=C}if(c=h.match(t),c){for(var s={name:c[1],values:[]},p=c[2].split(","),d=0;d<p.length;++d)s.values.push(y(p[d]));if(_.procType)if(!_.contentDomain&&s.name==="Content-Domain")_.contentDomain=p[0]||"";else if(!_.dekInfo&&s.name==="DEK-Info"){if(s.values.length===0)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');_.dekInfo={algorithm:p[0],parameters:p[1]||null}}else _.headers.push(s);else{if(s.name!=="Proc-Type")throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(s.values.length!==2)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');_.procType={version:p[0],type:p[1]}}}++u}if(_.procType==="ENCRYPTED"&&!_.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(T.length===0)throw Error("Invalid PEM formatted message.");return T};function i(k){for(var T=k.name+": ",f=[],t=function(E,u){return" "+u},g=0;g<k.values.length;++g)f.push(k.values[g].replace(/^(\S+\r\n)/,t));T+=f.join(",")+`\r
12`;for(var c=0,S=-1,g=0;g<T.length;++g,++c)if(c>65&&S!==-1){var _=T[S];_===","?(++S,T=T.substr(0,S)+`\r
13 `+T.substr(S)):T=T.substr(0,S)+`\r
14`+_+T.substr(S+1),c=g-S-1,S=-1,++g}else(T[g]===" "||T[g]==="	"||T[g]===",")&&(S=g);return T}function y(k){return k.replace(/^\s+/,"")}})),It=ce(((oe,W)=>{var a=le();Nt(),Dt(),ye(),W.exports=a.des=a.des||{},a.des.startEncrypting=function(u,h,C,m){var s=E({key:u,decrypt:!1,mode:m||(h===null?"ECB":"CBC")});return s.start(h),s},a.des.createEncryptionCipher=function(u,h){return E({key:u,decrypt:!1,mode:h})},a.des.startDecrypting=function(u,h,C,m){var s=E({key:u,decrypt:!0,mode:m||(h===null?"ECB":"CBC")});return s.start(h),s},a.des.createDecryptionCipher=function(u,h){return E({key:u,decrypt:!0,mode:h})},a.des.Algorithm=function(u,h){var C=this;C.name=u,C.mode=new h({blockSize:8,cipher:{encrypt:function(m,s){return _(C._keys,m,s,!1)},decrypt:function(m,s){return _(C._keys,m,s,!0)}}}),C._init=!1},a.des.Algorithm.prototype.initialize=function(u){if(!this._init){var h=a.util.createBuffer(u.key);if(this.name.indexOf("3DES")===0&&h.length()!==24)throw Error("Invalid Triple-DES key size: "+h.length()*8);this._keys=S(h),this._init=!0}},e("DES-ECB",a.cipher.modes.ecb),e("DES-CBC",a.cipher.modes.cbc),e("DES-CFB",a.cipher.modes.cfb),e("DES-OFB",a.cipher.modes.ofb),e("DES-CTR",a.cipher.modes.ctr),e("3DES-ECB",a.cipher.modes.ecb),e("3DES-CBC",a.cipher.modes.cbc),e("3DES-CFB",a.cipher.modes.cfb),e("3DES-OFB",a.cipher.modes.ofb),e("3DES-CTR",a.cipher.modes.ctr);function e(u,h){a.cipher.registerAlgorithm(u,function(){return new a.des.Algorithm(u,h)})}var i=[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],y=[-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],k=[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],T=[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],f=[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],t=[536870928,541065216,16384,541081616,54106
145216,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],g=[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],c=[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 S(u){for(var h=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],C=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],m=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],s=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],p=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],d=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],A=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],D=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],n=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],r=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],b=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],w=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],V=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],K=u.length()>8?3:1,x=[],F=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],G=0,H,Z=0;Z<K;Z++){var Y=u.getInt32(),ee=u.getInt32();H=(Y>>>4^ee)&252645135,ee^=H,Y^=H<<4,H=(ee>>>-16^Y)&65535,Y^=H,ee^=H<<-16,H=(Y>>>2^ee)&858993459,ee^=H,Y^=H<<2,H=(ee>>>-16^Y)&65535,Y^=H,ee^=H<<-16,H=(Y>>>1^ee)&1431655765,ee^=H,Y^=H<<1,H=(ee>>>8^Y)&16711935,Y^=H,ee^=H<<8,H=(Y>>>1^ee)&1431655765,ee^=H,Y^=H<<1,H=Y<<8|ee>>>20&240,Y=ee<<24|ee<<8&16711680|ee>>>8&65280|ee>>>24&240,ee=H;for(var ue=0;ue<F.length;++ue){F[ue]?(Y=Y<<2|Y>>>26,ee=ee<<2|ee>>>26):(Y=Y<<1|Y>>>27,ee=ee<<1|ee>>>27),Y&=-15,ee&=-15;var se=h[Y>>>28]|C[Y>>>24&15]|m[Y>>>20&15]|s[Y>>>16&15]|p[Y>>>12&15]|d[Y>>>8&15]|A[Y>>>4&15],de=D[ee>>>28]|l[ee>>>24&15]|n[ee>>>20&15]|r[ee>>>16&15]|b[ee>>>12&15]|w[ee>>>8&15]|V[ee>>>4&15];H=(de>>>16^se)&65535,x[G++]=se^H,x[G++]=de^H<<16}}return x}function _(u,h,C,m){var s=u.length===32?3:9,p=s===3?m?[30,-2,-2]:[0,32,2]:m?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2],d,A=h[0],D=h[1];d=(A>>>4^D)&252645135,D^=d,A^=d<<4,d=(A>>>16^D)&65535,D^=d,A^=d<<16,d=(D>>>2^A)&858993459,A^=d,D^=d<<2,d=(D>>>8^A)&16711935,A^=d,D^=d<<8,d=(A>>>1^D)&1431655765,D^=d,A^=d<<1,A=A<<1|A>>>31,D=D<<1|D>>>31;for(var l=0;l<s;l+=3){for(var n=p[l+1],r=p[l+2],b=p[l];b!=n;b+=r){var w=D^u[b],V=(D>>>4|D<<28)^u[b+1];d=A,A=D,D=d^(y[w>>>24&63]|T[w>>>16&63]|t[w>>>8&63]|c[w&63]|i[V>>>24&63]|k[V>>>16&63]|f[V>>>8&63]|g[V&63])}d=A,A=D,D=d}A=A>>>1|A<<31,D=D>>>1|D<<31,d=(A>>>1^D)&1431655765,D^=d,A^=d<<1,d=(D>>>8^A)&16711935,A^=d,D^=d<<8,d=(D>>>2^A)&858993459,A^=d,D^=d<<2,d=(A>>>16^D)&65535,D^=d,A^=d<<16,d=(A>>>4^D)&252645135,D^=d,A^=d<<4,C[0]=A,C[1]=D}function E(u){u||(u={});var h="DES-"+(u.mode||"CBC").toUpperCase(),C=u.decrypt?a.cipher.createDecipher(h,u.key):a.cipher.createCipher(h,u.key),m=C.start;return C.start=function(s,p){var d=null;p instanceof a.util.ByteBuffer&&(d=p,p={}),p||(p={}),p.output=d,p.iv=s,m.call(C,p)},C}})),kt=ce(((oe,W)=>{W.exports={}})),Lt=ce(((oe,W)=>{var a=le();mt(),ut(),ye();var e=a.pkcs5=a.pkcs5||{},i;a.util.isNodejs&&!a.options.usePureJavaScript&&(i=kt()),W.exports=a.pbkdf2=e.pbk
14df2=function(y,k,T,f,t,g){if(typeof t=="function"&&(g=t,t=null),a.util.isNodejs&&!a.options.usePureJavaScript&&i.pbkdf2&&(typeof t!="object"||!t)&&(i.pbkdf2Sync.length>4||!t||t==="sha1"))return typeof t!="string"&&(t="sha1"),y=Buffer.from(y,"binary"),k=Buffer.from(k,"binary"),g?i.pbkdf2Sync.length===4?i.pbkdf2(y,k,T,f,function(l,n){if(l)return g(l);g(null,n.toString("binary"))}):i.pbkdf2(y,k,T,f,t,function(l,n){if(l)return g(l);g(null,n.toString("binary"))}):i.pbkdf2Sync.length===4?i.pbkdf2Sync(y,k,T,f).toString("binary"):i.pbkdf2Sync(y,k,T,f,t).toString("binary");if(t??(t="sha1"),typeof t=="string"){if(!(t in a.md.algorithms))throw Error("Unknown hash algorithm: "+t);t=a.md[t].create()}var c=t.digestLength;if(f>4294967295*c){var S=Error("Derived key is too long.");if(g)return g(S);throw S}var _=Math.ceil(f/c),E=f-(_-1)*c,u=a.hmac.create();u.start(t,y);var h="",C,m,s;if(!g){for(var p=1;p<=_;++p){u.start(null,null),u.update(k),u.update(a.util.int32ToBytes(p)),C=s=u.digest().getBytes();for(var d=2;d<=T;++d)u.start(null,null),u.update(s),m=u.digest().getBytes(),C=a.util.xorBytes(C,m,c),s=m;h+=p<_?C:C.substr(0,E)}return h}var p=1,d;function A(){if(p>_)return g(null,h);u.start(null,null),u.update(k),u.update(a.util.int32ToBytes(p)),C=s=u.digest().getBytes(),d=2,D()}function D(){if(d<=T)return u.start(null,null),u.update(s),m=u.digest().getBytes(),C=a.util.xorBytes(C,m,c),s=m,++d,a.util.setImmediate(D);h+=p<_?C:C.substr(0,E),++p,A()}A()}})),wt=ce(((oe,W)=>{var a=le();ut(),ye();var e=W.exports=a.sha256=a.sha256||{};a.md.sha256=a.md.algorithms.sha256=e,e.create=function(){y||T();var t=null,g=a.util.createBuffer(),c=Array(64),S={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return S.start=function(){S.messageLength=0,S.fullMessageLength=S.messageLength64=[];for(var _=S.messageLengthSize/4,E=0;E<_;++E)S.fullMessageLength.push(0);return g=a.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},S},S.start(),S.update=function(_,E){E==="utf8"&&(_=a.util.encodeUtf8(_));var u=_.length;S.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var h=S.fullMessageLength.length-1;h>=0;--h)S.fullMessageLength[h]+=u[1],u[1]=u[0]+(S.fullMessageLength[h]/4294967296>>>0),S.fullMessageLength[h]=S.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return g.putBytes(_),f(t,c,g),(g.read>2048||g.length()===0)&&g.compact(),S},S.digest=function(){var _=a.util.createBuffer();_.putBytes(g.bytes());var E=S.fullMessageLength[S.fullMessageLength.length-1]+S.messageLengthSize&S.blockLength-1;_.putBytes(i.substr(0,S.blockLength-E));for(var u,h,C=S.fullMessageLength[0]*8,m=0;m<S.fullMessageLength.length-1;++m)u=S.fullMessageLength[m+1]*8,h=u/4294967296>>>0,C+=h,_.putInt32(C>>>0),C=u>>>0;_.putInt32(C);var s={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};f(s,c,_);var p=a.util.createBuffer();return p.putInt32(s.h0),p.putInt32(s.h1),p.putInt32(s.h2),p.putInt32(s.h3),p.putInt32(s.h4),p.putInt32(s.h5),p.putInt32(s.h6),p.putInt32(s.h7),p},S};var i=null,y=!1,k=null;function T(){i="€",i+=a.util.fillString("\0",64),k=[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],y=!0}function f(t,g,c){for(var S,_,E,u,h,C,m,s,p,d,A,D,l,n,r,b=c.length();b>=64;){for(m=0;m<16;++m)g[m]=c.getInt32();for(;m<64;++m)S=g[m-2],S=(S>>>17|S<<15)^(S>>>19|S<<13)^S>>>10,_=g[m-15],_=(_>>>7|_<<25)^(_>>>18|_<<14)^_>>>3,g[m]=S+g[m-7]+_+g[m-16]|0;for(s=t.h0,p=t.h1,d=t.h2,A=t.h3,D=t.h4,l=t.h5,n=t.h6,r=t.h7,m=0;m<64;++m)u=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),h=n^D&(l^n),E=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>
1422|s<<10),C=s&p|d&(s^p),S=r+u+h+k[m]+g[m],_=E+C,r=n,n=l,l=D,D=A+S>>>0,A=d,d=p,p=s,s=S+_>>>0;t.h0=t.h0+s|0,t.h1=t.h1+p|0,t.h2=t.h2+d|0,t.h3=t.h3+A|0,t.h4=t.h4+D|0,t.h5=t.h5+l|0,t.h6=t.h6+n|0,t.h7=t.h7+r|0,b-=64}}})),Vt=ce(((oe,W)=>{var a=le();ye();var e=null;a.util.isNodejs&&!a.options.usePureJavaScript&&!process.versions["node-webkit"]&&(e=kt());var i=W.exports=a.prng=a.prng||{};i.create=function(y){for(var k={plugin:y,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},T=y.md,f=Array(32),t=0;t<32;++t)f[t]=T.create();k.pools=f,k.pool=0,k.generate=function(E,u){if(!u)return k.generateSync(E);var h=k.plugin.cipher,C=k.plugin.increment,m=k.plugin.formatKey,s=k.plugin.formatSeed,p=a.util.createBuffer();k.key=null,d();function d(A){if(A)return u(A);if(p.length()>=E)return u(null,p.getBytes(E));if(k.generated>1048575&&(k.key=null),k.key===null)return a.util.nextTick(function(){g(d)});var D=h(k.key,k.seed);k.generated+=D.length,p.putBytes(D),k.key=m(h(k.key,C(k.seed))),k.seed=s(h(k.key,k.seed)),a.util.setImmediate(d)}},k.generateSync=function(E){var u=k.plugin.cipher,h=k.plugin.increment,C=k.plugin.formatKey,m=k.plugin.formatSeed;k.key=null;for(var s=a.util.createBuffer();s.length()<E;){k.generated>1048575&&(k.key=null),k.key===null&&c();var p=u(k.key,k.seed);k.generated+=p.length,s.putBytes(p),k.key=C(u(k.key,h(k.seed))),k.seed=m(u(k.key,k.seed))}return s.getBytes(E)};function g(E){if(k.pools[0].messageLength>=32)return S(),E();var u=32-k.pools[0].messageLength<<5;k.seedFile(u,function(h,C){if(h)return E(h);k.collect(C),S(),E()})}function c(){if(k.pools[0].messageLength>=32)return S();var E=32-k.pools[0].messageLength<<5;k.collect(k.seedFileSync(E)),S()}function S(){k.reseeds=k.reseeds===4294967295?0:k.reseeds+1;var E=k.plugin.md.create();E.update(k.keyBytes);for(var u=1,h=0;h<32;++h)k.reseeds%u===0&&(E.update(k.pools[h].digest().getBytes()),k.pools[h].start()),u<<=1;k.keyBytes=E.digest().getBytes(),E.start(),E.update(k.keyBytes);var C=E.digest().getBytes();k.key=k.plugin.formatKey(k.keyBytes),k.seed=k.plugin.formatSeed(C),k.generated=0}function _(E){var u=null,h=a.util.globalScope,C=h.crypto||h.msCrypto;C&&C.getRandomValues&&(u=function(r){return C.getRandomValues(r)});var m=a.util.createBuffer();if(u)for(;m.length()<E;){var s=Math.max(1,Math.min(E-m.length(),65536)/4),p=new Uint32Array(Math.floor(s));try{u(p);for(var d=0;d<p.length;++d)m.putInt32(p[d])}catch(r){if(!(typeof QuotaExceededError<"u"&&r instanceof QuotaExceededError))throw r}}if(m.length()<E)for(var A,D,l,n=Math.floor(Math.random()*65536);m.length()<E;){D=16807*(n&65535),A=16807*(n>>16),D+=(A&32767)<<16,D+=A>>15,D=(D&2147483647)+(D>>31),n=D&4294967295;for(var d=0;d<3;++d)l=n>>>(d<<3),l^=Math.floor(Math.random()*256),m.putByte(l&255)}return m.getBytes(E)}return e?(k.seedFile=function(E,u){e.randomBytes(E,function(h,C){if(h)return u(h);u(null,C.toString())})},k.seedFileSync=function(E){return e.randomBytes(E).toString()}):(k.seedFile=function(E,u){try{u(null,_(E))}catch(h){u(h)}},k.seedFileSync=_),k.collect=function(E){for(var u=E.length,h=0;h<u;++h)k.pools[k.pool].update(E.substr(h,1)),k.pool=k.pool===31?0:k.pool+1},k.collectInt=function(E,u){for(var h="",C=0;C<u;C+=8)h+=String.fromCharCode(E>>C&255);k.collect(h)},k.registerWorker=function(E){E===self?k.seedFile=function(u,h){function C(m){var s=m.data;s.forge&&s.forge.prng&&(self.removeEventListener("message",C),h(s.forge.prng.err,s.forge.prng.bytes))}self.addEventListener("message",C),self.postMessage({forge:{prng:{needed:u}}})}:E.addEventListener("message",function(u){var h=u.data;h.forge&&h.forge.prng&&k.seedFile(h.forge.prng.needed,function(C,m){E.postMessage({forge:{prng:{err:C,bytes:m}}})})})},k}})),at=ce(((oe,W)=>{var a=le();pt(),wt(),Vt(),ye(),(function(){if(a.random&&a.random.getBytes){W.exports=a.random;return}(function(e){var i={},y=[,,,,],k=a.util.createBuffer();i.formatKey=function(E){var u=a.util.createBuffer(E);return E=[,,,,],E[0]=u.getInt32(),E[1]=u.getInt32(),E[2]=u.getInt32(),E[3]=u.getInt32(),a.aes._expandKey(E,!1)},i.formatSeed=function(E){var u=a.util.createBuffer(E);return E=[,,,,],E[0]=u.getInt32(),E[1]=u.getInt32(),E[2]=u.getInt32(),E[3]=u.getInt32(),E}
14,i.cipher=function(E,u){return a.aes._updateBlock(E,u,y,!1),k.putInt32(y[0]),k.putInt32(y[1]),k.putInt32(y[2]),k.putInt32(y[3]),k.getBytes()},i.increment=function(E){return++E[3],E},i.md=a.md.sha256;function T(){var E=a.prng.create(i);return E.getBytes=function(u,h){return E.generate(u,h)},E.getBytesSync=function(u){return E.generate(u)},E}var f=T(),t=null,g=a.util.globalScope,c=g.crypto||g.msCrypto;if(c&&c.getRandomValues&&(t=function(E){return c.getRandomValues(E)}),a.options.usePureJavaScript||!a.util.isNodejs&&!t){if(f.collectInt(+new Date,32),typeof navigator<"u"){var S="";for(var _ in navigator)try{typeof navigator[_]=="string"&&(S+=navigator[_])}catch{}f.collect(S),S=null}e&&(e().mousemove(function(E){f.collectInt(E.clientX,16),f.collectInt(E.clientY,16)}),e().keypress(function(E){f.collectInt(E.charCode,8)}))}if(!a.random)a.random=f;else for(var _ in f)a.random[_]=f[_];a.random.createInstance=T,W.exports=a.random})(typeof jQuery<"u"?jQuery:null)})()})),Pt=ce(((oe,W)=>{var a=le();ye();var e=[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],i=[1,2,3,5],y=function(f,t){return f<<t&65535|(f&65535)>>16-t},k=function(f,t){return(f&65535)>>t|f<<16-t&65535};W.exports=a.rc2=a.rc2||{},a.rc2.expandKey=function(f,t){typeof f=="string"&&(f=a.util.createBuffer(f)),t||(t=128);var g=f,c=f.length(),S=t,_=Math.ceil(S/8),E=255>>(S&7),u;for(u=c;u<128;u++)g.putByte(e[g.at(u-1)+g.at(u-c)&255]);for(g.setAt(128-_,e[g.at(128-_)&E]),u=127-_;u>=0;u--)g.setAt(u,e[g.at(u+1)^g.at(u+_)]);return g};var T=function(f,t,g){var c=!1,S=null,_=null,E=null,u,h,C,m,s=[];for(f=a.rc2.expandKey(f,t),C=0;C<64;C++)s.push(f.getInt16Le());g?(u=function(A){for(C=0;C<4;C++)A[C]+=s[m]+(A[(C+3)%4]&A[(C+2)%4])+(~A[(C+3)%4]&A[(C+1)%4]),A[C]=y(A[C],i[C]),m++},h=function(A){for(C=0;C<4;C++)A[C]+=s[A[(C+3)%4]&63]}):(u=function(A){for(C=3;C>=0;C--)A[C]=k(A[C],i[C]),A[C]-=s[m]+(A[(C+3)%4]&A[(C+2)%4])+(~A[(C+3)%4]&A[(C+1)%4]),m--},h=function(A){for(C=3;C>=0;C--)A[C]-=s[A[(C+3)%4]&63]});var p=function(A){var D=[];for(C=0;C<4;C++){var l=S.getInt16Le();E!==null&&(g?l^=E.getInt16Le():E.putInt16Le(l)),D.push(l&65535)}m=g?0:63;for(var n=0;n<A.length;n++)for(var r=0;r<A[n][0];r++)A[n][1](D);for(C=0;C<4;C++)E!==null&&(g?E.putInt16Le(D[C]):D[C]^=E.getInt16Le()),_.putInt16Le(D[C])},d=null;return d={start:function(A,D){A&&typeof A=="string"&&(A=a.util.createBuffer(A)),c=!1,S=a.util.createBuffer(),_=D||new a.util.createBuffer,E=A,d.output=_},update:function(A){for(c||S.putBuffer(A);S.length()>=8;)p([[5,u],[1,h],[6,u],[1,h],[5,u]])},finish:function(A){var D=!0;if(g)if(A)D=A(8,S,!g);else{var l=S.length()===8?8:8-S.length();S.fillWithByte(l,l)}if(D&&(c=!0,d.update()),!g&&(D=S.length()===0,D))if(A)D=A(8,_,!g);else{var n=_.length(),r=_.at(n-1);r>n?D=!1:_.truncate(r)}return D}},d};a.rc2.startEncrypting=function(f,t,g){var c=a.rc2.createEncryptionCipher(f,128);return c.start(t,g),c},a.rc2.createEncryptionCipher=function(f,t){return T(f,t,!0)},a.rc2.startDecrypting=function(f,t,g){var c=a.rc2.createDecryptionCipher(f,128);return c.start(t,g),c},a.rc2.createDecryptionCipher=function(f,t){return T(f,t,!1)}})),Bt=ce(((oe,W)=>{var a=le();W.exports=a.jsbn=a.jsbn||{};var e;function i(I,B,P){this.data=[],I!=null&&(typeof I=="number"?this.fromNumber(I,B,P):B==null&&typeof I!="string"?this.fromString(I,256):this.fromString(I,B))}a.jsbn.BigInteger=i;function y(){return new i(null)}function k(I,B,P,M,Q,z){for(;--z>=0;){var re=B*this.data[I++]+P.data[M]+Q;Q=Math.floor(re/67108864),P.data[M++]=re&67108863}return Q}function T(I,B,P,M,Q,z){for(var re=B&32767,$=B>>15;--z>=0;){var ge=this.data[I]&32767,He=this.data[I++]>>15,Je=$*ge+He*re;
14ge=re*ge+((Je&32767)<<15)+P.data[M]+(Q&1073741823),Q=(ge>>>30)+(Je>>>15)+$*He+(Q>>>30),P.data[M++]=ge&1073741823}return Q}function f(I,B,P,M,Q,z){for(var re=B&16383,$=B>>14;--z>=0;){var ge=this.data[I]&16383,He=this.data[I++]>>14,Je=$*ge+He*re;ge=re*ge+((Je&16383)<<14)+P.data[M]+Q,Q=(ge>>28)+(Je>>14)+$*He,P.data[M++]=ge&268435455}return Q}typeof navigator>"u"?(i.prototype.am=f,e=28):navigator.appName=="Microsoft Internet Explorer"?(i.prototype.am=T,e=30):navigator.appName!="Netscape"?(i.prototype.am=k,e=26):(i.prototype.am=f,e=28),i.prototype.DB=e,i.prototype.DM=(1<<e)-1,i.prototype.DV=1<<e;var t=52;i.prototype.FV=2**t,i.prototype.F1=t-e,i.prototype.F2=2*e-t;var g="0123456789abcdefghijklmnopqrstuvwxyz",c=[],S=48,_;for(_=0;_<=9;++_)c[S++]=_;for(S=97,_=10;_<36;++_)c[S++]=_;for(S=65,_=10;_<36;++_)c[S++]=_;function E(I){return g.charAt(I)}function u(I,B){return c[I.charCodeAt(B)]??-1}function h(I){for(var B=this.t-1;B>=0;--B)I.data[B]=this.data[B];I.t=this.t,I.s=this.s}function C(I){this.t=1,this.s=I<0?-1:0,I>0?this.data[0]=I:I<-1?this.data[0]=I+this.DV:this.t=0}function m(I){var B=y();return B.fromInt(I),B}function s(I,B){var P;if(B==16)P=4;else if(B==8)P=3;else if(B==256)P=8;else if(B==2)P=1;else if(B==32)P=5;else if(B==4)P=2;else{this.fromRadix(I,B);return}this.t=0,this.s=0;for(var M=I.length,Q=!1,z=0;--M>=0;){var re=P==8?I[M]&255:u(I,M);if(re<0){I.charAt(M)=="-"&&(Q=!0);continue}Q=!1,z==0?this.data[this.t++]=re:z+P>this.DB?(this.data[this.t-1]|=(re&(1<<this.DB-z)-1)<<z,this.data[this.t++]=re>>this.DB-z):this.data[this.t-1]|=re<<z,z+=P,z>=this.DB&&(z-=this.DB)}P==8&&I[0]&128&&(this.s=-1,z>0&&(this.data[this.t-1]|=(1<<this.DB-z)-1<<z)),this.clamp(),Q&&i.ZERO.subTo(this,this)}function p(){for(var I=this.s&this.DM;this.t>0&&this.data[this.t-1]==I;)--this.t}function d(I){if(this.s<0)return"-"+this.negate().toString(I);var B;if(I==16)B=4;else if(I==8)B=3;else if(I==2)B=1;else if(I==32)B=5;else if(I==4)B=2;else return this.toRadix(I);var P=(1<<B)-1,M,Q=!1,z="",re=this.t,$=this.DB-re*this.DB%B;if(re-- >0)for($<this.DB&&(M=this.data[re]>>$)>0&&(Q=!0,z=E(M));re>=0;)$<B?(M=(this.data[re]&(1<<$)-1)<<B-$,M|=this.data[--re]>>($+=this.DB-B)):(M=this.data[re]>>($-=B)&P,$<=0&&($+=this.DB,--re)),M>0&&(Q=!0),Q&&(z+=E(M));return Q?z:"0"}function A(){var I=y();return i.ZERO.subTo(this,I),I}function D(){return this.s<0?this.negate():this}function l(I){var B=this.s-I.s;if(B!=0)return B;var P=this.t;if(B=P-I.t,B!=0)return this.s<0?-B:B;for(;--P>=0;)if((B=this.data[P]-I.data[P])!=0)return B;return 0}function n(I){var B=1,P;return(P=I>>>16)!=0&&(I=P,B+=16),(P=I>>8)!=0&&(I=P,B+=8),(P=I>>4)!=0&&(I=P,B+=4),(P=I>>2)!=0&&(I=P,B+=2),(P=I>>1)!=0&&(I=P,B+=1),B}function r(){return this.t<=0?0:this.DB*(this.t-1)+n(this.data[this.t-1]^this.s&this.DM)}function b(I,B){var P;for(P=this.t-1;P>=0;--P)B.data[P+I]=this.data[P];for(P=I-1;P>=0;--P)B.data[P]=0;B.t=this.t+I,B.s=this.s}function w(I,B){for(var P=I;P<this.t;++P)B.data[P-I]=this.data[P];B.t=Math.max(this.t-I,0),B.s=this.s}function V(I,B){var P=I%this.DB,M=this.DB-P,Q=(1<<M)-1,z=Math.floor(I/this.DB),re=this.s<<P&this.DM,$;for($=this.t-1;$>=0;--$)B.data[$+z+1]=this.data[$]>>M|re,re=(this.data[$]&Q)<<P;for($=z-1;$>=0;--$)B.data[$]=0;B.data[z]=re,B.t=this.t+z+1,B.s=this.s,B.clamp()}function K(I,B){B.s=this.s;var P=Math.floor(I/this.DB);if(P>=this.t){B.t=0;return}var M=I%this.DB,Q=this.DB-M,z=(1<<M)-1;B.data[0]=this.data[P]>>M;for(var re=P+1;re<this.t;++re)B.data[re-P-1]|=(this.data[re]&z)<<Q,B.data[re-P]=this.data[re]>>M;M>0&&(B.data[this.t-P-1]|=(this.s&z)<<Q),B.t=this.t-P,B.clamp()}function x(I,B){for(var P=0,M=0,Q=Math.min(I.t,this.t);P<Q;)M+=this.data[P]-I.data[P],B.data[P++]=M&this.DM,M>>=this.DB;if(I.t<this.t){for(M-=I.s;P<this.t;)M+=this.data[P],B.data[P++]=M&this.DM,M>>=this.DB;M+=this.s}else{for(M+=this.s;P<I.t;)M-=I.data[P],B.data[P++]=M&this.DM,M>>=this.DB;M-=I.s}B.s=M<0?-1:0,M<-1?B.data[P++]=this.DV+M:M>0&&(B.data[P++]=M),B.t=P,B.clamp()}function F(I,B){var P=this.abs(),M=I.abs(),Q=P.t;for(B.t=Q+M.t;--Q>=0;)B.data[Q]=0;for(Q=0;Q<M.t;++Q)B.data[Q+P.t]=P.am(0,M.data[Q],B,Q,0,P.t);B.s=0,B.clamp(),this.s!=I.s&&i.ZERO.subTo(B,B)}function G(I){for(var B=this.abs(),P=I.t=2*B.t;--P>=0;)I.data[P]=0;for(P=0;P<B.t-1;++P){var M=B.am(P,B.data[P],I,2*P,0,1);(I.data[P+B.t]+=B.am(P+1,2*B.data[P],I,2*P+1,M,B.t-P-1))>=B.DV&&(I.data[P+B.t]-=B.DV,I.data[P+B.t+1]=1)}I.t>0&&(I.data[I.t-1]+=B.am(P,B.data[P],I,2*P,0,1)),I.s=0,I.clamp()}function H(I,B,P){var M=I.abs();if(!(M.t<=0)){var Q=this.abs();if(Q.t<M.t){B==null||B.fromInt(0),P!=null&&this.copyTo(P);return}P??(P=y());var z=y(),re=this.s,$=I.s,ge=this.DB-n(M.data[M.t-1]);ge>0?(M.lShiftTo(ge,z),Q.lShiftTo(ge,P)):(M.copyTo(z),Q.copyTo(P));var He=z.t,Je=z.data[He-1];if(Je!=0){var We=Je*(1<<this.F1)+(He>1?z.data[He-2]>>this.F2:0),ot=this.FV/We,St=(1<<this.F1)/We,tt=1<<this.F2,rt=P.t,Tt=rt-He,lt=B??y();for(z.dlShiftTo(Tt,lt),P.compareTo(lt)>=0&&(P.data[P.t++]=1,P.subTo(lt,P)),i.ONE.dlShiftTo(He,lt),lt.subTo(z,z);z.t<He;)z.data[z.t++]=0;for(;--Tt>=0;){var bt=P.data[--rt]==Je?this.DM:Math.floor(P.data[rt]*ot+(P.data[rt-1]+tt)*St);if((P.data[rt]+=z.am(0,bt,P,Tt,0,He))<bt)for(z.dlShiftTo(Tt,lt),P.subTo(lt,P);P.data[rt]<--bt;)P.subTo(lt,P)}B!=null&&(P.drShiftTo(He,B),re!=$&&i.ZERO.subTo(B,B)),P.t=He,P.clamp(),ge>0&&P.rShiftTo(ge,P),re<0&&i.ZERO.subTo(P,P)}}}function Z(I){var B=y();return this.abs().divRemTo(I,null,B),this.s<0&&B.compareTo(i.ZERO)>0&&I.subTo(B,B),B}function Y(I){this.m=I}function ee(I){return I.s<0||I.compareTo(this.m)>=0?I.mod(this.m):I}function ue(I){return I}function se(I){I.divRemTo(this.m,null,I)}function de(I,B,P){I.multiplyTo(B,P),this.reduce(P)}function me(I,B){I.squareTo(B),this.reduce(B)}Y.prototype.convert=ee,Y.prototype.revert=ue,Y.prototype.reduce=se,Y.prototype.mulTo=de,Y.prototype.sqrTo=me;function fe(){if(this.t<1)return 0;var I=this.data[0];if(!(I&1))return 0;var B=I&3;return B=B*(2-(I&15)*B)&15,B=B*(2-(I&255)*B)&255,B=B*(2-((I&65535)
14*B&65535))&65535,B=B*(2-I*B%this.DV)%this.DV,B>0?this.DV-B:-B}function X(I){this.m=I,this.mp=I.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<I.DB-15)-1,this.mt2=2*I.t}function ae(I){var B=y();return I.abs().dlShiftTo(this.m.t,B),B.divRemTo(this.m,null,B),I.s<0&&B.compareTo(i.ZERO)>0&&this.m.subTo(B,B),B}function ze(I){var B=y();return I.copyTo(B),this.reduce(B),B}function qe(I){for(;I.t<=this.mt2;)I.data[I.t++]=0;for(var B=0;B<this.m.t;++B){var P=I.data[B]&32767,M=P*this.mpl+((P*this.mph+(I.data[B]>>15)*this.mpl&this.um)<<15)&I.DM;for(P=B+this.m.t,I.data[P]+=this.m.am(0,M,I,B,0,this.m.t);I.data[P]>=I.DV;)I.data[P]-=I.DV,I.data[++P]++}I.clamp(),I.drShiftTo(this.m.t,I),I.compareTo(this.m)>=0&&I.subTo(this.m,I)}function v(I,B){I.squareTo(B),this.reduce(B)}function U(I,B,P){I.multiplyTo(B,P),this.reduce(P)}X.prototype.convert=ae,X.prototype.revert=ze,X.prototype.reduce=qe,X.prototype.mulTo=U,X.prototype.sqrTo=v;function L(){return(this.t>0?this.data[0]&1:this.s)==0}function N(I,B){if(I>4294967295||I<1)return i.ONE;var P=y(),M=y(),Q=B.convert(this),z=n(I)-1;for(Q.copyTo(P);--z>=0;)if(B.sqrTo(P,M),(I&1<<z)>0)B.mulTo(M,Q,P);else{var re=P;P=M,M=re}return B.revert(P)}function o(I,B){var P=I<256||B.isEven()?new Y(B):new X(B);return this.exp(I,P)}i.prototype.copyTo=h,i.prototype.fromInt=C,i.prototype.fromString=s,i.prototype.clamp=p,i.prototype.dlShiftTo=b,i.prototype.drShiftTo=w,i.prototype.lShiftTo=V,i.prototype.rShiftTo=K,i.prototype.subTo=x,i.prototype.multiplyTo=F,i.prototype.squareTo=G,i.prototype.divRemTo=H,i.prototype.invDigit=fe,i.prototype.isEven=L,i.prototype.exp=N,i.prototype.toString=d,i.prototype.negate=A,i.prototype.abs=D,i.prototype.compareTo=l,i.prototype.bitLength=r,i.prototype.mod=Z,i.prototype.modPowInt=o,i.ZERO=m(0),i.ONE=m(1);function R(){var I=y();return this.copyTo(I),I}function O(){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 q(){return this.t==0?this.s:this.data[0]<<24>>24}function te(){return this.t==0?this.s:this.data[0]<<16>>16}function ie(I){return Math.floor(Math.LN2*this.DB/Math.log(I))}function j(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function J(I){if(I??(I=10),this.signum()==0||I<2||I>36)return"0";var B=this.chunkSize(I),P=I**+B,M=m(P),Q=y(),z=y(),re="";for(this.divRemTo(M,Q,z);Q.signum()>0;)re=(P+z.intValue()).toString(I).substr(1)+re,Q.divRemTo(M,Q,z);return z.intValue().toString(I)+re}function ne(I,B){this.fromInt(0),B??(B=10);for(var P=this.chunkSize(B),M=B**+P,Q=!1,z=0,re=0,$=0;$<I.length;++$){var ge=u(I,$);if(ge<0){I.charAt($)=="-"&&this.signum()==0&&(Q=!0);continue}re=B*re+ge,++z>=P&&(this.dMultiply(M),this.dAddOffset(re,0),z=0,re=0)}z>0&&(this.dMultiply(B**+z),this.dAddOffset(re,0)),Q&&i.ZERO.subTo(this,this)}function he(I,B,P){if(typeof B=="number")if(I<2)this.fromInt(1);else for(this.fromNumber(I,P),this.testBit(I-1)||this.bitwiseTo(i.ONE.shiftLeft(I-1),ve,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(B);)this.dAddOffset(2,0),this.bitLength()>I&&this.subTo(i.ONE.shiftLeft(I-1),this);else{var M=[],Q=I&7;M.length=(I>>3)+1,B.nextBytes(M),Q>0?M[0]&=(1<<Q)-1:M[0]=0,this.fromString(M,256)}}function pe(){var I=this.t,B=[];B[0]=this.s;var P=this.DB-I*this.DB%8,M,Q=0;if(I-- >0)for(P<this.DB&&(M=this.data[I]>>P)!=(this.s&this.DM)>>P&&(B[Q++]=M|this.s<<this.DB-P);I>=0;)P<8?(M=(this.data[I]&(1<<P)-1)<<8-P,M|=this.data[--I]>>(P+=this.DB-8)):(M=this.data[I]>>(P-=8)&255,P<=0&&(P+=this.DB,--I)),M&128&&(M|=-256),Q==0&&(this.s&128)!=(M&128)&&++Q,(Q>0||M!=this.s)&&(B[Q++]=M);return B}function Te(I){return this.compareTo(I)==0}function Ae(I){return this.compareTo(I)<0?this:I}function Be(I){return this.compareTo(I)>0?this:I}function Ie(I,B,P){var M,Q,z=Math.min(I.t,this.t);for(M=0;M<z;++M)P.data[M]=B(this.data[M],I.data[M]);if(I.t<this.t){for(Q=I.s&this.DM,M=z;M<this.t;++M)P.data[M]=B(this.data[M],Q);P.t=this.t}else{for(Q=this.s&this.DM,M=z;M<I.t;++M)P.data[M]=B(Q,I.data[M]);P.t=I.t}P.s=B(this.s,I.s),P.clamp()}function Ee(I,B){return I&B}function Ce(I){var B=y();return this.bitwiseTo(I,Ee,B),B}function ve(I,B){return I|B}function Ne(I){var B=y();return this.bitwiseTo(I,ve,B),B}function Re(I,B){return I^B}function je(I){var B=y();return this.bitwiseTo(I,Re,B),B}function Qe(I,B){return I&~B}function Ye(I){var B=y();return this.bitwiseTo(I,Qe,B),B}function Xe(){for(var I=y(),B=0;B<this.t;++B)I.data[B]=this.DM&~this.data[B];return I.t=this.t,I.s=~this.s,I}function Ze(I){var B=y();return I<0?this.rShiftTo(-I,B):this.lShiftTo(I,B),B}
14function $e(I){var B=y();return I<0?this.lShiftTo(-I,B):this.rShiftTo(I,B),B}function it(I){if(I==0)return-1;var B=0;return I&65535||(I>>=16,B+=16),I&255||(I>>=8,B+=8),I&15||(I>>=4,B+=4),I&3||(I>>=2,B+=2),I&1||++B,B}function nt(){for(var I=0;I<this.t;++I)if(this.data[I]!=0)return I*this.DB+it(this.data[I]);return this.s<0?this.t*this.DB:-1}function ct(I){for(var B=0;I!=0;)I&=I-1,++B;return B}function ft(){for(var I=0,B=this.s&this.DM,P=0;P<this.t;++P)I+=ct(this.data[P]^B);return I}function dt(I){var B=Math.floor(I/this.DB);return B>=this.t?this.s!=0:(this.data[B]&1<<I%this.DB)!=0}function vt(I,B){var P=i.ONE.shiftLeft(I);return this.bitwiseTo(P,B,P),P}function Et(I){return this.changeBit(I,ve)}function ke(I){return this.changeBit(I,Qe)}function Le(I){return this.changeBit(I,Re)}function _e(I,B){for(var P=0,M=0,Q=Math.min(I.t,this.t);P<Q;)M+=this.data[P]+I.data[P],B.data[P++]=M&this.DM,M>>=this.DB;if(I.t<this.t){for(M+=I.s;P<this.t;)M+=this.data[P],B.data[P++]=M&this.DM,M>>=this.DB;M+=this.s}else{for(M+=this.s;P<I.t;)M+=I.data[P],B.data[P++]=M&this.DM,M>>=this.DB;M+=I.s}B.s=M<0?-1:0,M>0?B.data[P++]=M:M<-1&&(B.data[P++]=this.DV+M),B.t=P,B.clamp()}function Ue(I){var B=y();return this.addTo(I,B),B}function De(I){var B=y();return this.subTo(I,B),B}function we(I){var B=y();return this.multiplyTo(I,B),B}function Ve(){var I=y();return this.squareTo(I),I}function Pe(I){var B=y();return this.divRemTo(I,B,null),B}function Oe(I){var B=y();return this.divRemTo(I,null,B),B}function Ke(I){var B=y(),P=y();return this.divRemTo(I,B,P),[B,P]}function xe(I){this.data[this.t]=this.am(0,I-1,this,0,0,this.t),++this.t,this.clamp()}function Me(I,B){if(I!=0){for(;this.t<=B;)this.data[this.t++]=0;for(this.data[B]+=I;this.data[B]>=this.DV;)this.data[B]-=this.DV,++B>=this.t&&(this.data[this.t++]=0),++this.data[B]}}function Se(){}function be(I){return I}function Fe(I,B,P){I.multiplyTo(B,P)}function Ge(I,B){I.squareTo(B)}Se.prototype.convert=be,Se.prototype.revert=be,Se.prototype.mulTo=Fe,Se.prototype.sqrTo=Ge;function Qt(I){return this.exp(I,new Se)}function zt(I,B,P){var M=Math.min(this.t+I.t,B);for(P.s=0,P.t=M;M>0;)P.data[--M]=0;var Q;for(Q=P.t-this.t;M<Q;++M)P.data[M+this.t]=this.am(0,I.data[M],P,M,0,this.t);for(Q=Math.min(I.t,B);M<Q;++M)this.am(0,I.data[M],P,M,0,B-M);P.clamp()}function Yt(I,B,P){--B;var M=P.t=this.t+I.t-B;for(P.s=0;--M>=0;)P.data[M]=0;for(M=Math.max(B-this.t,0);M<I.t;++M)P.data[this.t+M-B]=this.am(B-M,I.data[M],P,0,0,this.t+M-B);P.clamp(),P.drShiftTo(1,P)}function yt(I){this.r2=y(),this.q3=y(),i.ONE.dlShiftTo(2*I.t,this.r2),this.mu=this.r2.divide(I),this.m=I}function Xt(I){if(I.s<0||I.t>2*this.m.t)return I.mod(this.m);if(I.compareTo(this.m)<0)return I;var B=y();return I.copyTo(B),this.reduce(B),B}function Wt(I){return I}function Zt(I){for(I.drShiftTo(this.m.t-1,this.r2),I.t>this.m.t+1&&(I.t=this.m.t+1,I.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);I.compareTo(this.r2)<0;)I.dAddOffset(1,this.m.t+1);for(I.subTo(this.r2,I);I.compareTo(this.m)>=0;)I.subTo(this.m,I)}function Jt(I,B){I.squareTo(B),this.reduce(B)}function $t(I,B,P){I.multiplyTo(B,P),this.reduce(P)}yt.prototype.convert=Xt,yt.prototype.revert=Wt,yt.prototype.reduce=Zt,yt.prototype.mulTo=$t,yt.prototype.sqrTo=Jt;function er(I,B){var P=I.bitLength(),M,Q=m(1),z;if(P<=0)return Q;M=P<18?1:P<48?3:P<144?4:P<768?5:6,z=P<8?new Y(B):B.isEven()?new yt(B):new X(B);var re=[],$=3,ge=M-1,He=(1<<M)-1;if(re[1]=z.convert(this),M>1){var Je=y();for(z.sqrTo(re[1],Je);$<=He;)re[$]=y(),z.mulTo(Je,re[$-2],re[$]),$+=2}var We=I.t-1,ot,St=!0,tt=y(),rt;for(P=n(I.data[We])-1;We>=0;){for(P>=ge?ot=I.data[We]>>P-ge&He:(ot=(I.data[We]&(1<<P+1)-1)<<ge-P,We>0&&(ot|=I.data[We-1]>>this.DB+P-ge)),$=M;!(ot&1);)ot>>=1,--$;if((P-=$)<0&&(P+=this.DB,--We),St)re[ot].copyTo(Q),St=!1;else{for(;$>1;)z.sqrTo(Q,tt),z.sqrTo(tt,Q),$-=2;$>0?z.sqrTo(Q,tt):(rt=Q,Q=tt,tt=rt),z.mulTo(tt,re[ot],Q)}for(;We>=0&&!(I.data[We]&1<<P);)z.sqrTo(Q,tt),rt=Q,Q=tt,tt=rt,--P<0&&(P=this.DB-1,--We)}return z.revert(Q)}function tr(I){var B=this.s<0?this.negate():this.clone(),P=I.s<0?I.negate():I.clone();if(B.compareTo(P)<0){var M=B;B=P,P=M}var Q=B.getLowestSetBit(),z=P.getLowestSetBit();if(z<0)return B;for(Q<z&&(z=Q),z>0&&(B.rShiftTo(z,B),P.rShiftTo(z,P));B.signum()>0;)(Q=B.getLowestSetBit())>0&&B.rShiftTo(Q,B),(Q=P.getLowestSetBit())>0&&P.rShiftTo(Q,P),B.compareTo(P)>=0?(B.subTo(P,B),B.rShiftTo(1,B)):(P.subTo(B,P),P.rShiftTo(1,P));return z>0&&P.lShiftTo(z,P),P}function rr(I){if(I<=0)return 0;var B=this.DV%I,P=this.s<0?I-1:0;if(this.t>0)if(B==0)P=this.data[0]%I;else for(var M=this.t-1;M>=0;--M)P=(B*P+this.data[M])%I;return P}
14function ar(I){if(this.signum()==0)return i.ZERO;var B=I.isEven();if(this.isEven()&&B||I.signum()==0)return i.ZERO;for(var P=I.clone(),M=this.clone(),Q=m(1),z=m(0),re=m(0),$=m(1);P.signum()!=0;){for(;P.isEven();)P.rShiftTo(1,P),B?((!Q.isEven()||!z.isEven())&&(Q.addTo(this,Q),z.subTo(I,z)),Q.rShiftTo(1,Q)):z.isEven()||z.subTo(I,z),z.rShiftTo(1,z);for(;M.isEven();)M.rShiftTo(1,M),B?((!re.isEven()||!$.isEven())&&(re.addTo(this,re),$.subTo(I,$)),re.rShiftTo(1,re)):$.isEven()||$.subTo(I,$),$.rShiftTo(1,$);P.compareTo(M)>=0?(P.subTo(M,P),B&&Q.subTo(re,Q),z.subTo($,z)):(M.subTo(P,M),B&&re.subTo(Q,re),$.subTo(z,$))}if(M.compareTo(i.ONE)!=0)return i.ZERO;if($.compareTo(I)>=0)return $.subtract(I);if($.signum()<0)$.addTo(I,$);else return $;return $.signum()<0?$.add(I):$}var et=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ir=(1<<26)/et[et.length-1];function sr(I){var B,P=this.abs();if(P.t==1&&P.data[0]<=et[et.length-1]){for(B=0;B<et.length;++B)if(P.data[0]==et[B])return!0;return!1}if(P.isEven())return!1;for(B=1;B<et.length;){for(var M=et[B],Q=B+1;Q<et.length&&M<ir;)M*=et[Q++];for(M=P.modInt(M);B<Q;)if(M%et[B++]==0)return!1}return P.millerRabin(I)}function nr(I){var B=this.subtract(i.ONE),P=B.getLowestSetBit();if(P<=0)return!1;for(var M=B.shiftRight(P),Q=or(),z,re=0;re<I;++re){do z=new i(this.bitLength(),Q);while(z.compareTo(i.ONE)<=0||z.compareTo(B)>=0);var $=z.modPow(M,this);if($.compareTo(i.ONE)!=0&&$.compareTo(B)!=0){for(var ge=1;ge++<P&&$.compareTo(B)!=0;)if($=$.modPowInt(2,this),$.compareTo(i.ONE)==0)return!1;if($.compareTo(B)!=0)return!1}}return!0}function or(){return{nextBytes:function(I){for(var B=0;B<I.length;++B)I[B]=Math.floor(Math.random()*256)}}}i.prototype.chunkSize=ie,i.prototype.toRadix=J,i.prototype.fromRadix=ne,i.prototype.fromNumber=he,i.prototype.bitwiseTo=Ie,i.prototype.changeBit=vt,i.prototype.addTo=_e,i.prototype.dMultiply=xe,i.prototype.dAddOffset=Me,i.prototype.multiplyLowerTo=zt,i.prototype.multiplyUpperTo=Yt,i.prototype.modInt=rr,i.prototype.millerRabin=nr,i.prototype.clone=R,i.prototype.intValue=O,i.prototype.byteValue=q,i.prototype.shortValue=te,i.prototype.signum=j,i.prototype.toByteArray=pe,i.prototype.equals=Te,i.prototype.min=Ae,i.prototype.max=Be,i.prototype.and=Ce,i.prototype.or=Ne,i.prototype.xor=je,i.prototype.andNot=Ye,i.prototype.not=Xe,i.prototype.shiftLeft=Ze,i.prototype.shiftRight=$e,i.prototype.getLowestSetBit=nt,i.prototype.bitCount=ft,i.prototype.testBit=dt,i.prototype.setBit=Et,i.prototype.clearBit=ke,i.prototype.flipBit=Le,i.prototype.add=Ue,i.prototype.subtract=De,i.prototype.multiply=we,i.prototype.divide=Pe,i.prototype.remainder=Oe,i.prototype.divideAndRemainder=Ke,i.prototype.modPow=er,i.prototype.modInverse=ar,i.prototype.pow=Qt,i.prototype.gcd=tr,i.prototype.isProbablePrime=sr,i.prototype.square=Ve})),Ct=ce(((oe,W)=>{var a=le();ut(),ye();var e=W.exports=a.sha1=a.sha1||{};a.md.sha1=a.md.algorithms.sha1=e,e.create=function(){y||k();var f=null,t=a.util.createBuffer(),g=Array(80),c={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return c.start=function(){c.messageLength=0,c.fullMessageLength=c.messageLength64=[];for(var S=c.messageLengthSize/4,_=0;_<S;++_)c.fullMessageLength.push(0);return t=a.util.createBuffer(),f={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},c},c.start(),c.update=function(S,_){_==="utf8"&&(S=a.util.encodeUtf8(S));var E=S.length;c.messageLength+=E,E=[E/4294967296>>>0,E>>>0];for(var u=c.fullMessageLength.length-1;u>=0;--u)c.fullMessageLength[u]+=E[1],E[1]=E[0]+(c.fullMessageLength[u]/4294967296>>>0),c.fullMessageLength[u]=c.fullMessageLength[u]>>>0,E[0]=E[1]/4294967296>>>0;return t.putBytes(S),T(f,g,t),(t.read>2048||t.length()===0)&&t.compact(),c},c.digest=function(){var S=a.util.createBuffer();S.putBytes(t.bytes());var _=c.fullMessageLength[c.fullMessageLength.length-1]+c.messageLengthSize&c.blockLength-1;S.putBytes(i.substr(0,c.blockLength-_));for(var E,u,h=c.fullMessageLength[0]*8,C=0;C<c.fullMessageLength.length-1;++C)E=c.fullMessageLength[C+1]*8,u=E/4294967296>>>0,h+=u,S.putInt32(h>>>0),h=E>>>0;S.putInt32(h);var m={h0:f.h0,h1:f.h1,h2:f.h2,h3:f.h3,h4:f.h4};T(m,g,S);var s=a.util.createBuffer();return s.putInt32(m.h0),s.putInt32(m.h1),s.putInt32(m.h2),s.putInt32(m.h3),s.putInt32(m.h4),s},c};var i=null,y=!1;function k(){i="€",i+=a.util.fillString("\0",64),y=!0}function T(f,t,g){for(var c,S,_,E,u,h,C,m,s=g.length();s>=64;){for(S=f.h0,_=f.h1,E=f.h2,u=f.h3,h=f.h4,m=0;m<16;++m)c=g.getInt32(),t[m]=c,C=u^_&(E^u),c=(S<<5|S>>>27)+C+h+1518500249+c,h=u,u=E,E=(_<<30|_>>>2)>>>0,_=S,S=c;for(;m<20;++m)c=t[m-3]^t[m-8]^t[m-14]^t[m-16],c=c<<1|c>>>31,t[m]=c,C=u^_&(E^u),c=(S<<5|S>>>27)+C+h+1518500249+c,h=u,u=E,E=(_<<30|_>>>2)>>>0,_=S,S=c;for(;m<32;++m)c=t[m-3]^t[m-8]^t[m-14]^t[m-16],c=c<<1|c>>>31,t[m]=c,C=_^E^u,c=(S<<5|S>>>27)+C+h+1859775393+c,h=u,u=E,E=(_<<30|_>>>2)>>>0,_=S,S=c;for(;m<40;++m)c=t[m-6]^t[m-16]^t[m-28]^t[m-32],c=c<<2|c>>>30,t[m]=c,C=_^E^u,c=(S<<5|S>>>27)+C+h+1859775393+c,h=u,u=E,E=(_<<30|_>>>2)>>>0,_=S,S=c;for(;m<60;++m)c=t[m-6]^t[m-16]^t[m-28]^t[m-32],c=c<<2|c>>>30,t[m]=c,C=_&E|u&(_^E),c=(S<<5|S>>>27)+C+h+2400959708+c,h=u,u=E,E=(_<<30|_>>>2)>>>0,_=S,S=c;for(;m<80;++m)c=t[m-6]^t[m-16]^t[m-28]^t[m-32],c=c<<2|c>>>30,t[m]=c,C=_^E^u,c=(S<<5|S>>>27)+C+h+3395469782+c,h=u,u=E,E=(_<<30|_>>>2)>>>0,_=S,S=c;f.h0=f.h0+S|0,f.h1=f.h1+_|0,f.h2=f.h2+E|0,f.h3=f.h3+u|0,f.h4=f.h4+h|0,s-=64}}})),Ot=ce(((oe,W)=>{var a=le();ye(),at(),Ct();var e=W.exports=a.pkcs1=a.pkcs1||{};e.encode_rsa_oaep=function(y,k,T){var f,t,g,c;typeof T=="string"?(f=T,t=arguments[3]||void 0,g=arguments[4]||void 0):T&&(f=T.label||void 0,t=T.seed||void 0,g=T.md||void 0,T.mgf1&&T.mgf1.md&&(c=T.mgf1.md)),g?g.start():g=a.md.sha1.create(),c||
14(c=g);var S=Math.ceil(y.n.bitLength()/8),_=S-2*g.digestLength-2;if(k.length>_){var E=Error("RSAES-OAEP input message length is too long.");throw E.length=k.length,E.maxLength=_,E}f||(f=""),g.update(f,"raw");for(var u=g.digest(),h="",C=_-k.length,m=0;m<C;m++)h+="\0";var s=u.getBytes()+h+"�"+k;if(!t)t=a.random.getBytes(g.digestLength);else if(t.length!==g.digestLength){var E=Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw E.seedLength=t.length,E.digestLength=g.digestLength,E}var p=i(t,S-g.digestLength-1,c),d=a.util.xorBytes(s,p,s.length),A=i(d,g.digestLength,c);return"\0"+a.util.xorBytes(t,A,t.length)+d},e.decode_rsa_oaep=function(y,k,T){var f,t,g;typeof T=="string"?(f=T,t=arguments[3]||void 0):T&&(f=T.label||void 0,t=T.md||void 0,T.mgf1&&T.mgf1.md&&(g=T.mgf1.md));var c=Math.ceil(y.n.bitLength()/8);if(k.length!==c){var S=Error("RSAES-OAEP encoded message length is invalid.");throw S.length=k.length,S.expectedLength=c,S}if(t===void 0?t=a.md.sha1.create():t.start(),g||(g=t),c<2*t.digestLength+2)throw Error("RSAES-OAEP key is too short for the hash function.");f||(f=""),t.update(f,"raw");for(var _=t.digest().getBytes(),E=k.charAt(0),u=k.substring(1,t.digestLength+1),h=k.substring(1+t.digestLength),C=i(h,t.digestLength,g),m=i(a.util.xorBytes(u,C,u.length),c-t.digestLength-1,g),s=a.util.xorBytes(h,m,h.length),p=s.substring(0,t.digestLength),S=E!=="\0",d=0;d<t.digestLength;++d)S|=_.charAt(d)!==p.charAt(d);for(var A=1,D=t.digestLength,l=t.digestLength;l<s.length;l++){var n=s.charCodeAt(l),r=n&1^1;S|=n&(A?65534:0),A&=r,D+=A}if(S||s.charCodeAt(D)!==1)throw Error("Invalid RSAES-OAEP padding.");return s.substring(D+1)};function i(y,k,T){T||(T=a.md.sha1.create());for(var f="",t=Math.ceil(k/T.digestLength),g=0;g<t;++g){var c=String.fromCharCode(g>>24&255,g>>16&255,g>>8&255,g&255);T.start(),T.update(y+c),f+=T.digest().getBytes()}return f.substring(0,k)}})),Kt=ce(((oe,W)=>{var a=le();ye(),Bt(),at(),(function(){if(a.prime){W.exports=a.prime;return}var e=W.exports=a.prime=a.prime||{},i=a.jsbn.BigInteger,y=[6,4,2,4,2,4,6,2],k=new i(null);k.fromInt(30);var T=function(E,u){return E|u};e.generateProbablePrime=function(E,u,h){typeof u=="function"&&(h=u,u={}),u||(u={});var C=u.algorithm||"PRIMEINC";typeof C=="string"&&(C={name:C}),C.options=C.options||{};var m=u.prng||a.random,s={nextBytes:function(p){for(var d=m.getBytesSync(p.length),A=0;A<p.length;++A)p[A]=d.charCodeAt(A)}};if(C.name==="PRIMEINC")return f(E,s,C.options,h);throw Error("Invalid prime generation algorithm: "+C.name)};function f(E,u,h,C){return"workers"in h?c(E,u,h,C):t(E,u,h,C)}function t(E,u,h,C){var m=S(E,u),s=0,p=_(m.bitLength());"millerRabinTests"in h&&(p=h.millerRabinTests);var d=10;"maxBlockTime"in h&&(d=h.maxBlockTime),g(m,E,u,s,p,d,C)}function g(E,u,h,C,m,s,p){var d=+new Date;do{if(E.bitLength()>u&&(E=S(u,h)),E.isProbablePrime(m))return p(null,E);E.dAddOffset(y[C++%8],0)}while(s<0||+new Date-d<s);a.util.setImmediate(function(){g(E,u,h,C,m,s,p)})}function c(E,u,h,C){if(typeof Worker>"u")return t(E,u,h,C);var m=S(E,u),s=h.workers,p=h.workLoad||100,d=p*30/8,A=h.workerScript||"forge/prime.worker.js";if(s===-1)return a.util.estimateCores(function(l,n){l&&(n=2),s=n-1,D()});D();function D(){s=Math.max(1,s);for(var l=[],n=0;n<s;++n)l[n]=new Worker(A);for(var r=s,n=0;n<s;++n)l[n].addEventListener("message",w);var b=!1;function w(V){if(!b){--r;var K=V.data;if(K.found){for(var x=0;x<l.length;++x)l[x].terminate();return b=!0,C(null,new i(K.prime,16))}m.bitLength()>E&&(m=S(E,u));var F=m.toString(16);V.target.postMessage({hex:F,workLoad:p}),m.dAddOffset(d,0)}}}}function S(E,u){var h=new i(E,u),C=E-1;return h.testBit(C)||h.bitwiseTo(i.ONE.shiftLeft(C),T,h),h.dAddOffset(31-h.mod(k).byteValue(),0),h}function _(E){return E<=100?27:E<=150?18:E<=200?15:E<=250?12:E<=300?9:E<=350?8:E<=400?7:E<=500?6:E<=600?5:E<=800?4:E<=1250?3:2}})()})),At=ce(((oe,W)=>{var a=le();if(st(),Bt(),ht(),Ot(),Kt(),at(),ye(),e===void 0)var e=a.jsbn.BigInteger;var i=a.util.isNodejs?kt():null,y=a.asn1,k=a.util;a.pki=a.pki||{},W.exports=a.pki.rsa=a.rsa=a.rsa||{};var T=a.pki,f=[6,4,2,4,2,4,6,2],t={name:"PrivateKeyInfo",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,c
14onstructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:y.Class.UNIVERSAL,type:y.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:y.Class.UNIVERSAL,type:y.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},g={name:"RSAPrivateKey",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},c={name:"RSAPublicKey",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},S=a.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:y.Class.UNIVERSAL,type:y.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:y.Class.UNIVERSAL,type:y.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},_={name:"DigestInfo",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:y.Class.UNIVERSAL,type:y.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:y.Class.UNIVERSAL,type:y.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:y.Class.UNIVERSAL,type:y.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},E=function(n){var r;if(n.algorithm in T.oids)r=T.oids[n.algorithm];else{var b=Error("Unknown message digest algorithm.");throw b.algorithm=n.algorithm,b}var w=y.oidToDer(r).getBytes(),V=y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[]),K=y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[]);K.value.push(y.create(y.Class.UNIVERSAL,y.Type.OID,!1,w)),K.value.push(y.create(y.Class.UNIVERSAL,y.Type.NULL,!1,""));var x=y.create(y.Class.UNIVERSAL,y.Type.OCTETSTRING,!1,n.digest().getBytes());return V.value.push(K),V.value.push(x),y.toDer(V).getBytes()},u=function(n,r,b){if(b)return n.modPow(r.e,r.n);if(!r.p||!r.q)return n.modPow(r.d,r.n);r.dP||(r.dP=r.d.mod(r.p.subtract(e.ONE))),r.dQ||(r.dQ=r.d.mod(r.q.subtract(e.ONE))),r.qInv||(r.qInv=r.q.modInverse(r.p));var w;do w=new e(a.util.bytesToHex(a.random.getBytes(r.n.bitLength()/8)),16);while(w.compareTo(r.n)>=0||!w.gcd(r.n).equals(e.ONE));n=n.multiply(w.modPow(r.e,r.n)).mod(r.n);for(var V=n.mod(r.p).modPow(r.dP,r.p),K=n.mod(r.q).modPow(r.dQ,r.q);V.compareTo(K)<0;)V=V.add(r.p);var x=V.subtract(K).multiply(r.qInv).mod(r.p).multiply(r.q).add(K);return x=x.multiply(w.modInverse(r.n)).mod(r.n),x};T.rsa.encrypt=function(n,r,b){var w=b,V,K=Math.ceil(r.n.bitLength()/8);b!==!1&&b!==!0?(w=b===2,V=h(n,r,b)):(V=a.util.createBuffer(),V.putBytes(n));for(var x=u(new e(V.toHex(),16),r,w).toString(16),F=a.util.createBuffer(),G=K-Math.ceil(x.length/2);G>0;)F.putByte(0),--G;return F.putBytes(a.util.hexToBytes(x)),F.getBytes()},T.rsa.decrypt=function(n,r,b,w){var V=Math.ceil(r.n.bitLength()/8);if(n.length!==V){var K=Error("Encrypted message length is invali
14d.");throw K.length=n.length,K.expected=V,K}var x=new e(a.util.createBuffer(n).toHex(),16);if(x.compareTo(r.n)>=0)throw Error("Encrypted message is invalid.");for(var F=u(x,r,b).toString(16),G=a.util.createBuffer(),H=V-Math.ceil(F.length/2);H>0;)G.putByte(0),--H;return G.putBytes(a.util.hexToBytes(F)),w===!1?G.getBytes():C(G.getBytes(),r,b)},T.rsa.createKeyPairGenerationState=function(n,r,b){typeof n=="string"&&(n=parseInt(n,10)),n||(n=2048),b||(b={});var w=b.prng||a.random,V={nextBytes:function(F){for(var G=w.getBytesSync(F.length),H=0;H<F.length;++H)F[H]=G.charCodeAt(H)}},K=b.algorithm||"PRIMEINC",x;if(K==="PRIMEINC")x={algorithm:K,state:0,bits:n,rng:V,eInt:r||65537,e:new e(null),p:null,q:null,qBits:n>>1,pBits:n-(n>>1),pqState:0,num:null,keys:null},x.e.fromInt(x.eInt);else throw Error("Invalid key generation algorithm: "+K);return x},T.rsa.stepKeyPairGenerationState=function(n,r){"algorithm"in n||(n.algorithm="PRIMEINC");var b=new e(null);b.fromInt(30);for(var w=0,V=function(Y,ee){return Y|ee},K=+new Date,x,F=0;n.keys===null&&(r<=0||F<r);){if(n.state===0){var G=n.p===null?n.pBits:n.qBits,H=G-1;n.pqState===0?(n.num=new e(G,n.rng),n.num.testBit(H)||n.num.bitwiseTo(e.ONE.shiftLeft(H),V,n.num),n.num.dAddOffset(31-n.num.mod(b).byteValue(),0),w=0,++n.pqState):n.pqState===1?n.num.bitLength()>G?n.pqState=0:n.num.isProbablePrime(p(n.num.bitLength()))?++n.pqState:n.num.dAddOffset(f[w++%8],0):n.pqState===2?n.pqState=n.num.subtract(e.ONE).gcd(n.e).compareTo(e.ONE)===0?3:0:n.pqState===3&&(n.pqState=0,n.p===null?n.p=n.num:n.q=n.num,n.p!==null&&n.q!==null&&++n.state,n.num=null)}else if(n.state===1)n.p.compareTo(n.q)<0&&(n.num=n.p,n.p=n.q,n.q=n.num),++n.state;else if(n.state===2)n.p1=n.p.subtract(e.ONE),n.q1=n.q.subtract(e.ONE),n.phi=n.p1.multiply(n.q1),++n.state;else if(n.state===3)n.phi.gcd(n.e).compareTo(e.ONE)===0?++n.state:(n.p=null,n.q=null,n.state=0);else if(n.state===4)n.n=n.p.multiply(n.q),n.n.bitLength()===n.bits?++n.state:(n.q=null,n.state=0);else if(n.state===5){var Z=n.e.modInverse(n.phi);n.keys={privateKey:T.rsa.setPrivateKey(n.n,n.e,Z,n.p,n.q,Z.mod(n.p1),Z.mod(n.q1),n.q.modInverse(n.p)),publicKey:T.rsa.setPublicKey(n.n,n.e)}}x=+new Date,F+=x-K,K=x}return n.keys!==null},T.rsa.generateKeyPair=function(n,r,b,w){if(arguments.length===1?typeof n=="object"?(b=n,n=void 0):typeof n=="function"&&(w=n,n=void 0):arguments.length===2?typeof n=="number"?typeof r=="function"?(w=r,r=void 0):typeof r!="number"&&(b=r,r=void 0):(b=n,w=r,n=void 0,r=void 0):arguments.length===3&&(typeof r=="number"?typeof b=="function"&&(w=b,b=void 0):(w=b,b=r,r=void 0)),b||(b={}),n===void 0&&(n=b.bits||2048),r===void 0&&(r=b.e||65537),!a.options.usePureJavaScript&&!b.prng&&n>=256&&n<=16384&&(r===65537||r===3)){if(w){if(d("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:n,publicExponent:r,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(F,G,H){if(F)return w(F);w(null,{privateKey:T.privateKeyFromPem(H),publicKey:T.publicKeyFromPem(G)})});if(A("generateKey")&&A("exportKey"))return k.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:n,publicExponent:l(r),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(F){return k.globalScope.crypto.subtle.exportKey("pkcs8",F.privateKey)}).then(void 0,function(F){w(F)}).then(function(F){if(F){var G=T.privateKeyFromAsn1(y.fromDer(a.util.createBuffer(F)));w(null,{privateKey:G,publicKey:T.setRsaPublicKey(G.n,G.e)})}});if(D("generateKey")&&D("exportKey")){var V=k.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:n,publicExponent:l(r),hash:{name:"SHA-256"}},!0,["sign","verify"]);V.oncomplete=function(F){var G=F.target.result,H=k.globalScope.msCrypto.subtle.exportKey("pkcs8",G.privateKey);H.oncomplete=function(Z){var Y=Z.target.result,ee=T.privateKeyFromAsn1(y.fromDer(a.util.createBuffer(Y)));w(null,{privateKey:ee,publicKey:T.setRsaPublicKey(ee.n,ee.e)})},H.onerror=function(Z){w(Z)}},V.onerror=function(F){w(F)};return}}else if(d("generateKeyPairSync")){var K=i.generateKeyPairSync("rsa",{modulusLength:n,publicExponent:r,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}}
14);return{privateKey:T.privateKeyFromPem(K.privateKey),publicKey:T.publicKeyFromPem(K.publicKey)}}}var x=T.rsa.createKeyPairGenerationState(n,r,b);if(!w)return T.rsa.stepKeyPairGenerationState(x,0),x.keys;m(x,b,w)},T.setRsaPublicKey=T.rsa.setPublicKey=function(n,r){var b={n,e:r};return b.encrypt=function(w,V,K){if(typeof V=="string"?V=V.toUpperCase():V===void 0&&(V="RSAES-PKCS1-V1_5"),V==="RSAES-PKCS1-V1_5")V={encode:function(F,G,H){return h(F,G,2).getBytes()}};else if(V==="RSA-OAEP"||V==="RSAES-OAEP")V={encode:function(F,G){return a.pkcs1.encode_rsa_oaep(G,F,K)}};else if(["RAW","NONE","NULL",null].indexOf(V)!==-1)V={encode:function(F){return F}};else if(typeof V=="string")throw Error('Unsupported encryption scheme: "'+V+'".');var x=V.encode(w,b,!0);return T.rsa.encrypt(x,b,!0)},b.verify=function(w,V,K,x){typeof K=="string"?K=K.toUpperCase():K===void 0&&(K="RSASSA-PKCS1-V1_5"),x===void 0&&(x={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in x||(x._parseAllDigestBytes=!0),"_skipPaddingChecks"in x||(x._skipPaddingChecks=!1),K==="RSASSA-PKCS1-V1_5"?K={verify:function(G,H){H=C(H,b,!0,void 0,x);var Z=y.fromDer(H,{parseAllBytes:x._parseAllDigestBytes}),Y={},ee=[];if(!y.validate(Z,_,Y,ee)||Z.value.length!==2){var ue=Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw ue.errors=ee,ue}var se=y.derToOid(Y.algorithmIdentifier);if(!(se===a.oids.md2||se===a.oids.md5||se===a.oids.sha1||se===a.oids.sha224||se===a.oids.sha256||se===a.oids.sha384||se===a.oids.sha512||se===a.oids["sha512-224"]||se===a.oids["sha512-256"])){var ue=Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw ue.oid=se,ue}if((se===a.oids.md2||se===a.oids.md5)&&!("parameters"in Y))throw Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return G===Y.digest}}:(K==="NONE"||K==="NULL"||K===null)&&(K={verify:function(G,H){return H=C(H,b,!0,void 0,x),G===H}});var F=T.rsa.decrypt(V,b,!0,!1);return K.verify(w,F,b.n.bitLength())},b},T.setRsaPrivateKey=T.rsa.setPrivateKey=function(n,r,b,w,V,K,x,F){var G={n,e:r,d:b,p:w,q:V,dP:K,dQ:x,qInv:F};return G.decrypt=function(H,Z,Y){typeof Z=="string"?Z=Z.toUpperCase():Z===void 0&&(Z="RSAES-PKCS1-V1_5");var ee=T.rsa.decrypt(H,G,!1,!1);if(Z==="RSAES-PKCS1-V1_5")Z={decode:C};else if(Z==="RSA-OAEP"||Z==="RSAES-OAEP")Z={decode:function(ue,se){return a.pkcs1.decode_rsa_oaep(se,ue,Y)}};else if(["RAW","NONE","NULL",null].indexOf(Z)!==-1)Z={decode:function(ue){return ue}};else throw Error('Unsupported encryption scheme: "'+Z+'".');return Z.decode(ee,G,!1)},G.sign=function(H,Z){var Y=!1;typeof Z=="string"&&(Z=Z.toUpperCase()),Z===void 0||Z==="RSASSA-PKCS1-V1_5"?(Z={encode:E},Y=1):(Z==="NONE"||Z==="NULL"||Z===null)&&(Z={encode:function(){return H}},Y=1);var ee=Z.encode(H,G.n.bitLength());return T.rsa.encrypt(ee,G,Y)},G},T.wrapRsaPrivateKey=function(n){return y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,y.integerToDer(0).getBytes()),y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.OID,!1,y.oidToDer(T.oids.rsaEncryption).getBytes()),y.create(y.Class.UNIVERSAL,y.Type.NULL,!1,"")]),y.create(y.Class.UNIVERSAL,y.Type.OCTETSTRING,!1,y.toDer(n).getBytes())])},T.privateKeyFromAsn1=function(n){var r={},b=[];if(y.validate(n,t,r,b)&&(n=y.fromDer(a.util.createBuffer(r.privateKey))),r={},b=[],!y.validate(n,g,r,b)){var w=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw w.errors=b,w}var V=a.util.createBuffer(r.privateKeyModulus).toHex(),K=a.util.createBuffer(r.privateKeyPublicExponent).toHex(),x=a.util.createBuffer(r.privateKeyPrivateExponent).toHex(),F=a.util.createBuffer(r.privateKeyPrime1).toHex(),G=a.util.createBuffer(r.privateKeyPrime2).toHex(),H=a.util.createBuffer(r.privateKeyExponent1).toHex(),Z=a.util.createBuffer(r.privateKeyExponent2).toHex(),Y=a.util.createBuffer(r.privateKeyCoefficient).toHex();return T.setRsaPrivateKey(new e(V,16),new e(K,16),new e(x,16),new e(F,16),new e(G,16),new e(H,16),new e(Z,16),new e(Y,16))},T.privateKeyToAsn1=T.privateKeyToRSAPrivateKey=function(n){return y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,y.integerToDer(0).getBytes()),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.n)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.e)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.d)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.p)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.q)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.dP)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.dQ)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.qInv))])},T.publicKeyFromAsn1=function(n){var r={},b=[];if(y.validate(n,S,r,b)){var w=y.derToOid(r.publicKeyOid);if(w!==T.oids.rsaEncryption){var V=Error("Cannot read public key. Unknown OID.");throw V.oid=w,V}n=r.rsaPublicKey}if(b=[],!y.validate(n,c,r,b)){var V=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw V.errors=b,V}var K=a.util.createBuffer(r.publicKeyModulus).toHex(),x=a.util.createBuffer(r.publicKeyExponent).toHex();
14return T.setRsaPublicKey(new e(K,16),new e(x,16))},T.publicKeyToAsn1=T.publicKeyToSubjectPublicKeyInfo=function(n){return y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.OID,!1,y.oidToDer(T.oids.rsaEncryption).getBytes()),y.create(y.Class.UNIVERSAL,y.Type.NULL,!1,"")]),y.create(y.Class.UNIVERSAL,y.Type.BITSTRING,!1,[T.publicKeyToRSAPublicKey(n)])])},T.publicKeyToRSAPublicKey=function(n){return y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.n)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,s(n.e))])};function h(n,r,b){var w=a.util.createBuffer(),V=Math.ceil(r.n.bitLength()/8);if(n.length>V-11){var K=Error("Message is too long for PKCS#1 v1.5 padding.");throw K.length=n.length,K.max=V-11,K}w.putByte(0),w.putByte(b);var x=V-3-n.length,F;if(b===0||b===1){F=b===0?0:255;for(var G=0;G<x;++G)w.putByte(F)}else for(;x>0;){for(var H=0,Z=a.random.getBytes(x),G=0;G<x;++G)F=Z.charCodeAt(G),F===0?++H:w.putByte(F);x=H}return w.putByte(0),w.putBytes(n),w}function C(n,r,b,w,V){var K=Math.ceil(r.n.bitLength()/8),x=a.util.createBuffer(n),F=x.getByte(),G=x.getByte();if(F!==0||b&&G!==0&&G!==1||!b&&G!==2||b&&G===0&&w===void 0)throw Error("Encryption block is invalid.");var H=0;if(G===0){H=K-3-w;for(var Z=0;Z<H;++Z)if(x.getByte()!==0)throw Error("Encryption block is invalid.")}else if(G===1){for(H=0;x.length()>1;){if(x.getByte()!==255){--x.read;break}++H}if(H<8&&!(V&&V._skipPaddingChecks))throw Error("Encryption block is invalid.")}else if(G===2){for(H=0;x.length()>1;){if(x.getByte()===0){--x.read;break}++H}if(H<8&&!(V&&V._skipPaddingChecks))throw Error("Encryption block is invalid.")}if(x.getByte()!==0||H!==K-3-x.length())throw Error("Encryption block is invalid.");return x.getBytes()}function m(n,r,b){typeof r=="function"&&(b=r,r={}),r||(r={});var w={algorithm:{name:r.algorithm||"PRIMEINC",options:{workers:r.workers||2,workLoad:r.workLoad||100,workerScript:r.workerScript}}};"prng"in r&&(w.prng=r.prng),V();function V(){K(n.pBits,function(F,G){if(F)return b(F);if(n.p=G,n.q!==null)return x(F,n.q);K(n.qBits,x)})}function K(F,G){a.prime.generateProbablePrime(F,w,G)}function x(F,G){if(F)return b(F);if(n.q=G,n.p.compareTo(n.q)<0){var H=n.p;n.p=n.q,n.q=H}if(n.p.subtract(e.ONE).gcd(n.e).compareTo(e.ONE)!==0){n.p=null,V();return}if(n.q.subtract(e.ONE).gcd(n.e).compareTo(e.ONE)!==0){n.q=null,K(n.qBits,x);return}if(n.p1=n.p.subtract(e.ONE),n.q1=n.q.subtract(e.ONE),n.phi=n.p1.multiply(n.q1),n.phi.gcd(n.e).compareTo(e.ONE)!==0){n.p=n.q=null,V();return}if(n.n=n.p.multiply(n.q),n.n.bitLength()!==n.bits){n.q=null,K(n.qBits,x);return}var Z=n.e.modInverse(n.phi);n.keys={privateKey:T.rsa.setPrivateKey(n.n,n.e,Z,n.p,n.q,Z.mod(n.p1),Z.mod(n.q1),n.q.modInverse(n.p)),publicKey:T.rsa.setPublicKey(n.n,n.e)},b(null,n.keys)}}function s(n){var r=n.toString(16);r[0]>="8"&&(r="00"+r);var b=a.util.hexToBytes(r);return b.length>1&&(b.charCodeAt(0)===0&&!(b.charCodeAt(1)&128)||b.charCodeAt(0)===255&&(b.charCodeAt(1)&128)==128)?b.substr(1):b}function p(n){return n<=100?27:n<=150?18:n<=200?15:n<=250?12:n<=300?9:n<=350?8:n<=400?7:n<=500?6:n<=600?5:n<=800?4:n<=1250?3:2}function d(n){return a.util.isNodejs&&typeof i[n]=="function"}function A(n){return k.globalScope!==void 0&&typeof k.globalScope.crypto=="object"&&typeof k.globalScope.crypto.subtle=="object"&&typeof k.globalScope.crypto.subtle[n]=="function"}function D(n){return k.globalScope!==void 0&&typeof k.globalScope.msCrypto=="object"&&typeof k.globalScope.msCrypto.subtle=="object"&&typeof k.globalScope.msCrypto.subtle[n]=="function"}function l(n){for(var r=a.util.hexToBytes(n.toString(16)),b=new Uint8Array(r.length),w=0;w<r.length;++w)b[w]=r.charCodeAt(w);return b}})),xt=ce(((oe,W)=>{var a=le();if(pt(),st(),It(),ut(),ht(),Lt(),gt(),at(),Pt(),At(),ye(),e===void 0)var e=a.jsbn.BigInteger;var i=a.asn1,y=a.pki=a.pki||{};W.exports=y.pbe=a.pbe=a.pbe||{};var k=y.oids,T={name:"EncryptedPrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},f={name:"PBES2Algorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,c
14onstructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},t={name:"pkcs-12PbeParams",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"iterations"}]};y.encryptPrivateKeyInfo=function(E,u,h){h||(h={}),h.saltSize=h.saltSize||8,h.count=h.count||2048,h.algorithm=h.algorithm||"aes128",h.prfAlgorithm=h.prfAlgorithm||"sha1";var C=a.random.getBytesSync(h.saltSize),m=h.count,s=i.integerToDer(m),p,d,A;if(h.algorithm.indexOf("aes")===0||h.algorithm==="des"){var D,l,n;switch(h.algorithm){case"aes128":p=16,D=16,l=k["aes128-CBC"],n=a.aes.createEncryptionCipher;break;case"aes192":p=24,D=16,l=k["aes192-CBC"],n=a.aes.createEncryptionCipher;break;case"aes256":p=32,D=16,l=k["aes256-CBC"],n=a.aes.createEncryptionCipher;break;case"des":p=8,D=8,l=k.desCBC,n=a.des.createEncryptionCipher;break;default:var r=Error("Cannot encrypt private key. Unknown encryption algorithm.");throw r.algorithm=h.algorithm,r}var b="hmacWith"+h.prfAlgorithm.toUpperCase(),w=S(b),V=a.pkcs5.pbkdf2(u,C,m,p,w),K=a.random.getBytesSync(D),x=n(V);x.start(K),x.update(i.toDer(E)),x.finish(),A=x.output.getBytes();var F=_(C,s,p,b);d=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(k.pkcs5PBES2).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(k.pkcs5PBKDF2).getBytes()),F]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(l).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,K)])])])}else if(h.algorithm==="3des"){p=24;var G=new a.util.ByteBuffer(C),V=y.pbe.generatePkcs12Key(u,G,1,m,p),K=y.pbe.generatePkcs12Key(u,G,2,m,p),x=a.des.createEncryptionCipher(V);x.start(K),x.update(i.toDer(E)),x.finish(),A=x.output.getBytes(),d=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(k["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,C),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,s.getBytes())])])}else{var r=Error("Cannot encrypt private key. Unknown encryption algorithm.");throw r.algorithm=h.algorithm,r}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[d,i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,A)])},y.decryptPrivateKeyInfo=function(E,u){var h=null,C={},m=[];if(!i.validate(E,T,C,m)){var s=Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=m,s}var p=i.derToOid(C.encryptionOid),d=y.pbe.getCipher(p,C.encryptionParams,u),A=a.util.createBuffer(C.encryptedData);return d.update(A),d.finish()&&(h=i.fromDer(d.output)),h},y.encryptedPrivateKeyToPem=function(E,u){var h={type:"ENCRYPTED PRIVATE KEY",body:i.toDer(E).getBytes()};return a.pem.encode(h,{maxline:u})},y.encryptedPrivateKeyFromPem=function(E){var u=a.pem.decode(E)[0];if(u.type!=="ENCRYPTED PRIVATE KEY"){var h=Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw h.headerType=u.type,h}if(u.procType&&u.procType.type==="ENCRYPTED")throw Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return i.fromDer(u.body)},y.encryptRsaPrivateKey=function(E,u,h){if(h||(h={}),!h.legacy){var C=y.wrapRsaPrivateKey(y.privateKeyToAsn1(E));return C=y.encryptPrivateKeyInfo(C,u,h),y.encryptedPrivateKeyToPem(C)}var m,s,p,d;switch(h.algorithm){case"aes128":m="AES-128-CBC",p=16,s=a.random.getBytesSync(16),d=a.aes.createEncryptionCipher;break;
14case"aes192":m="AES-192-CBC",p=24,s=a.random.getBytesSync(16),d=a.aes.createEncryptionCipher;break;case"aes256":m="AES-256-CBC",p=32,s=a.random.getBytesSync(16),d=a.aes.createEncryptionCipher;break;case"3des":m="DES-EDE3-CBC",p=24,s=a.random.getBytesSync(8),d=a.des.createEncryptionCipher;break;case"des":m="DES-CBC",p=8,s=a.random.getBytesSync(8),d=a.des.createEncryptionCipher;break;default:var A=Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+h.algorithm+'".');throw A.algorithm=h.algorithm,A}var D=a.pbe.opensslDeriveBytes(u,s.substr(0,8),p),l=d(D);l.start(s),l.update(i.toDer(y.privateKeyToAsn1(E))),l.finish();var n={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:m,parameters:a.util.bytesToHex(s).toUpperCase()},body:l.output.getBytes()};return a.pem.encode(n)},y.decryptRsaPrivateKey=function(E,u){var h=null,C=a.pem.decode(E)[0];if(C.type!=="ENCRYPTED PRIVATE KEY"&&C.type!=="PRIVATE KEY"&&C.type!=="RSA PRIVATE KEY"){var m=Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw m.headerType=m,m}if(C.procType&&C.procType.type==="ENCRYPTED"){var s,p;switch(C.dekInfo.algorithm){case"DES-CBC":s=8,p=a.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,p=a.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,p=a.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,p=a.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,p=a.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,p=function(n){return a.rc2.createDecryptionCipher(n,40)};break;case"RC2-64-CBC":s=8,p=function(n){return a.rc2.createDecryptionCipher(n,64)};break;case"RC2-128-CBC":s=16,p=function(n){return a.rc2.createDecryptionCipher(n,128)};break;default:var m=Error('Could not decrypt private key; unsupported encryption algorithm "'+C.dekInfo.algorithm+'".');throw m.algorithm=C.dekInfo.algorithm,m}var d=a.util.hexToBytes(C.dekInfo.parameters),A=a.pbe.opensslDeriveBytes(u,d.substr(0,8),s),D=p(A);if(D.start(d),D.update(a.util.createBuffer(C.body)),D.finish())h=D.output.getBytes();else return h}else h=C.body;return h=C.type==="ENCRYPTED PRIVATE KEY"?y.decryptPrivateKeyInfo(i.fromDer(h),u):i.fromDer(h),h!==null&&(h=y.privateKeyFromAsn1(h)),h},y.pbe.generatePkcs12Key=function(E,u,h,C,m,s){var p,d;if(s==null){if(!("sha1"in a.md))throw Error('"sha1" hash algorithm unavailable.');s=a.md.sha1.create()}var A=s.digestLength,D=s.blockLength,l=new a.util.ByteBuffer,n=new a.util.ByteBuffer;if(E!=null){for(d=0;d<E.length;d++)n.putInt16(E.charCodeAt(d));n.putInt16(0)}
14var r=n.length(),b=u.length(),w=new a.util.ByteBuffer;w.fillWithByte(h,D);var V=D*Math.ceil(b/D),K=new a.util.ByteBuffer;for(d=0;d<V;d++)K.putByte(u.at(d%b));var x=D*Math.ceil(r/D),F=new a.util.ByteBuffer;for(d=0;d<x;d++)F.putByte(n.at(d%r));var G=K;G.putBuffer(F);for(var H=Math.ceil(m/A),Z=1;Z<=H;Z++){var Y=new a.util.ByteBuffer;Y.putBytes(w.bytes()),Y.putBytes(G.bytes());for(var ee=0;ee<C;ee++)s.start(),s.update(Y.getBytes()),Y=s.digest();var ue=new a.util.ByteBuffer;for(d=0;d<D;d++)ue.putByte(Y.at(d%A));var se=Math.ceil(b/D)+Math.ceil(r/D),de=new a.util.ByteBuffer;for(p=0;p<se;p++){var me=new a.util.ByteBuffer(G.getBytes(D)),fe=511;for(d=ue.length()-1;d>=0;d--)fe>>=8,fe+=ue.at(d)+me.at(d),me.setAt(d,fe&255);de.putBuffer(me)}G=de,l.putBuffer(Y)}return l.truncate(l.length()-m),l},y.pbe.getCipher=function(E,u,h){switch(E){case y.oids.pkcs5PBES2:return y.pbe.getCipherForPBES2(E,u,h);case y.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case y.oids["pbewithSHAAnd40BitRC2-CBC"]:return y.pbe.getCipherForPKCS12PBE(E,u,h);default:var C=Error("Cannot read encrypted PBE data block. Unsupported OID.");throw C.oid=E,C.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],C}},y.pbe.getCipherForPBES2=function(E,u,h){var C={},m=[];if(!i.validate(u,f,C,m)){var s=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=m,s}if(E=i.derToOid(C.kdfOid),E!==y.oids.pkcs5PBKDF2){var s=Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=E,s.supportedOids=["pkcs5PBKDF2"],s}if(E=i.derToOid(C.encOid),E!==y.oids["aes128-CBC"]&&E!==y.oids["aes192-CBC"]&&E!==y.oids["aes256-CBC"]&&E!==y.oids["des-EDE3-CBC"]&&E!==y.oids.desCBC){var s=Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=E,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var p=C.kdfSalt,d=a.util.createBuffer(C.kdfIterationCount);d=d.getInt(d.length()<<3);var A,D;switch(y.oids[E]){case"aes128-CBC":A=16,D=a.aes.createDecryptionCipher;break;case"aes192-CBC":A=24,D=a.aes.createDecryptionCipher;break;case"aes256-CBC":A=32,D=a.aes.createDecryptionCipher;break;case"des-EDE3-CBC":A=24,D=a.des.createDecryptionCipher;break;case"desCBC":A=8,D=a.des.createDecryptionCipher;break}var l=c(C.prfOid),n=a.pkcs5.pbkdf2(h,p,d,A,l),r=C.encIv,b=D(n);return b.start(r),b},y.pbe.getCipherForPKCS12PBE=function(E,u,h){var C={},m=[];if(!i.validate(u,t,C,m)){var s=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=m,s}var p=a.util.createBuffer(C.salt),d=a.util.createBuffer(C.iterations);d=d.getInt(d.length()<<3);var A,D,l;switch(E){case y.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:A=24,D=8,l=a.des.startDecrypting;break;case y.oids["pbewithSHAAnd40BitRC2-CBC"]:A=5,D=8,l=function(V,K){var x=a.rc2.createDecryptionCipher(V,40);return x.start(K,null),x};break;default:var s=Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=E,s}var n=c(C.prfOid),r=y.pbe.generatePkcs12Key(h,p,1,d,A,n);n.start();var b=y.pbe.generatePkcs12Key(h,p,2,d,D,n);return l(r,b)},y.pbe.opensslDeriveBytes=function(E,u,h,C){if(C==null){if(!("md5"in a.md))throw Error('"md5" hash algorithm unavailable.');C=a.md.md5.create()}u===null&&(u="");for(var m=[g(C,E+u)],s=16,p=1;s<h;++p,s+=16)m.push(g(C,m[p-1]+E+u));return m.join("").substr(0,h)};function g(E,u){return E.start().update(u).digest().getBytes()}function c(E){var u;if(!E)u="hmacWithSHA1";else if(u=y.oids[i.derToOid(E)],!u){var h=Error("Unsupported PRF OID.");throw h.oid=E,h.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],h}return S(u)}function S(E){var u=a.md;switch(E){case"hmacWithSHA224":u=a.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":E=E.substr(8).toLowerCase();break;default:var h=Error("Unsupported PRF algorithm.");throw h.algorithm=E,h.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],h}if(!u||!(E in u))throw Error("Unknown hash algorithm: "+E);return u[E].create()}function _(E,u,h,C){var m=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,E),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,u.getBytes())]);return C!=="hmacWithSHA1"&&m.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,a.util.hexToBytes(h.toString(16))),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(y.oids[C]).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),m}})),Mt=ce(((oe,W)=>{var a=le();st(),ye();var e=a.asn1,i=W.exports=a.pkcs7asn1=a.pkcs7asn1||{};a.pkcs7=a.pkcs7||{},a.pkcs7.asn1=i;var y={name:"ContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=y;var k={name:"EncryptedContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:e.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,c
14onstructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(k)},i.encryptedDataValidator={name:"EncryptedData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"}].concat(k)};var T={name:"SignerInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:e.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},y,{name:"SignedData.Certificates",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,capture:"signerInfos",optional:!0,value:[T]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:e.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}})),Ft=ce(((oe,W)=>{var a=le();ye(),a.mgf=a.mgf||{};var e=W.exports=a.mgf.mgf1=a.mgf1=a.mgf1||{};e.create=function(i){return{generate:function(y,k){for(var T=new a.util.ByteBuffer,f=Math.ceil(k/i.digestLength),t=0;t<f;t++){var g=new a.util.ByteBuffer;g.putInt32(t),i.start(),i.update(y+g.getBytes()),T.putBuffer(i.digest())}return T.truncate(T.length()-k),T.getBytes()}}}})),cr=ce(((oe,W)=>{var a=le();Ft(),W.exports=a.mgf=a.mgf||{},a.mgf.mgf1=a.mgf1})),_t=ce(((oe,W)=>{var a=le();at(),ye();var e=W.exports=a.pss=a.pss||{};e.create=function(i){arguments.length===3&&(i={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var y=i.md,k=i.mgf,T=y.digestLength,f=i.salt||null;typeof f=="string"&&(f=a.util.createBuffer(f));var t;if("saltLength"in i)t=i.saltLength;else if(f!==null)t=f.length();else throw Error("Salt length not specified or specific salt not given.");if(f!==null&&f.length()!==t)throw Error("Given salt length does not match length of given salt.");var g=i.prng||a.random,c={};return c.encode=function(S,_){var E,u=_-1,h=Math.ceil(u/8),C=S.digest().getBytes();if(h<T+t+2)throw Error("Message is too long to encrypt.");var m=f===null?g.getBytesSync(t):f.bytes(),s=new a.util.ByteBuffer;s.fillWithByte(0,8),s.putBytes(C),s.putBytes(m),y.start(),y.update(s.getBytes());var p=y.digest().getBytes(),d=new a.util.ByteBuffer;d.fillWithByte(0,h-t-T-2),d.putByte(1),d.putBytes(m);var A=d.getBytes(),D=h-T-1,l=k.generate(p,D),n="";for(E=0;E<D;E++)n+=String.fromCharCode(A.charCodeAt(E)^l.charCodeAt(E));var r=65280>>8*h-u&255;return n=String.fromCharCode(n.charCodeAt(0)&~r)+n.substr(1),n+p+"¼"},c.verify=function(S,_,E){var u,h=E-1,C=Math.ceil(h/8);if(_=_.substr(-C),C<T+t+2)throw Error("Inconsistent parameters to PSS signature verification.");
14if(_.charCodeAt(C-1)!==188)throw Error("Encoded message does not end in 0xBC.");var m=C-T-1,s=_.substr(0,m),p=_.substr(m,T),d=65280>>8*C-h&255;if((s.charCodeAt(0)&d)!==0)throw Error("Bits beyond keysize not zero as expected.");var A=k.generate(p,m),D="";for(u=0;u<m;u++)D+=String.fromCharCode(s.charCodeAt(u)^A.charCodeAt(u));D=String.fromCharCode(D.charCodeAt(0)&~d)+D.substr(1);var l=C-T-t-2;for(u=0;u<l;u++)if(D.charCodeAt(u)!==0)throw Error("Leftmost octets not zero as expected");if(D.charCodeAt(l)!==1)throw Error("Inconsistent PSS signature, 0x01 marker not found");var n=D.substr(-t),r=new a.util.ByteBuffer;return r.fillWithByte(0,8),r.putBytes(S),r.putBytes(n),y.start(),y.update(r.getBytes()),p===y.digest().getBytes()},c}})),Ut=ce(((oe,W)=>{var a=le();pt(),st(),It(),ut(),cr(),ht(),gt(),_t(),At(),ye();var e=a.asn1,i=W.exports=a.pki=a.pki||{},y=i.oids,k={};k.CN=y.commonName,k.commonName="CN",k.C=y.countryName,k.countryName="C",k.L=y.localityName,k.localityName="L",k.ST=y.stateOrProvinceName,k.stateOrProvinceName="ST",k.O=y.organizationName,k.organizationName="O",k.OU=y.organizationalUnitName,k.organizationalUnitName="OU",k.E=y.emailAddress,k.emailAddress="E";var T=a.pki.rsa.publicKeyValidator,f={name:"Certificate",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:e.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:e.Class.UNIVERSAL,type:e.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:e.Class.UNIVERSAL,type:e.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:e.Class.UNIVERSAL,type:e.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:e.Class.UNIVERSAL,type:e.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},T,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:e.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:e.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:e.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParam
14s"}]},{name:"Certificate.signatureValue",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},t={name:"rsapss",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:e.Class.UNIVERSAL,type:e.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:e.Class.UNIVERSAL,type:e.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:e.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:e.Class.UNIVERSAL,type:e.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:e.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:e.Class.UNIVERSAL,type:e.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},g={name:"CertificationRequestInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},T,{name:"CertificationRequestInfo.attributes",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0}]}]}]},c={name:"CertificationRequest",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[g,{name:"CertificationRequest.signatureAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:e.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};i.RDNAttributesAsArray=function(l,n){for(var r=[],b,w,V,K=0;K<l.value.length;++K){b=l.value[K];for(var x=0;x<b.value.length;++x)V={},w=b.value[x],V.type=e.derToOid(w.value[0].value),V.value=w.value[1].value,V.valueTagClass=w.value[1].type,V.type in y&&(V.name=y[V.type],V.name in k&&(V.shortName=k[V.name])),n&&(n.update(V.type),n.update(V.value)),r.push(V)}return r},i.CRIAttributesAsArray=function(l){for(var n=[],r=0;r<l.length;++r)for(var b=l[r],w=e.derToOid(b.value[0].value),V=b.value[1].value,K=0;K<V.length;++K){var x={};if(x.type=w,x.value=V[K].value,x.valueTagClass=V[K].type,x.type in y&&(x.name=y[x.type],x.name in k&&(x.shortName=k[x.name])),x.type===y.extensionRequest){x.extensions=[];for(var F=0;F<x.value.length;++F)x.extensions.push(i.certificateExtensionFromAsn1(x.value[F]))}n.push(x)}return n};function S(l,n){typeof n=="string"&&(n={shortName:n});for(var r=null,b,w=0;r===null&&w<l.attributes.length;++w)b=l.attributes[w],(n.type&&n.type===b.type||n.name&&n.name===b.name||n.shortName&&n.shortName===b.shortName)&&(r=b);return r}var _=function(l,n,r){var b={};if(l!==y["RSASSA-PSS"])return b;r&&(b={hash:{algorithmOid:y.sha1},mgf:{algorithmOid:y.mgf1,hash:{algorithmOid:y.sha1}},saltLength:20});var w={},V=[];if(!e.validate(n,t,w,V)){var K=Error("Cannot read RSASSA-PSS parameter block.");throw K.errors=V,K}return w.hashOid!==void 0&&(b.hash=b.hash||{},b.hash.algorithmOid=e.derToOid(w.hashOid)),w.maskGenOid!==void 0&&(b.mgf=b.mgf||{},b.mgf.algorithmOid=e.derToOid(w.maskGenOid),b.mgf.hash=b.mgf.hash||{},b.mgf.hash.algorithmOid=e.derToOid(w.maskGenHashOid)),w.saltLength!==void 0&&(b.saltLength=w.saltLength.charCodeAt(0)),b},E=function(l){switch(y[l.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return a.md.sha1.create();case"md5WithRSAEncryption":return a.md.md5.create();case"sha256WithRSAEncryption":return a.md.sha256.create();case"sha384WithRSAEncryption":return a.md.sha384.create();case"sha512WithRSAEncryption":return a.md.sha512.create();case"RSASSA-PSS":return a.md.sha256.create();default:var n=Error("Could not compute "+l.type+" digest. Unknown signature OID.");throw n.signatureOid=l.signatureOid,n}},u=function(l){var n=l.certificate,r;switch(n.signatureOid){case y.sha1WithRSAEncryption:case y.sha1WithRSASignature:break;case y["RSASSA-PSS"]:var b=y[n.signatureParameters.mgf.hash.algorithmOid],w;if(b===void 0||a.md[b]===void 0){var V=Error("Unsupported MGF hash function.");throw V.oid=n.signatureParameters.mgf.hash.algorithmOid,V.name=b,V}if(w=y[n.signatureParameters.mgf.algorithmOid],w===void 0||a.mgf[w]===void 0){var V=Error("Unsupported MGF function.");throw V.oid=n.signatureParameters.mgf.algorithmOid,V.name=w,V}if(w=a.mgf[w].create(a.md[b].create()),b=y[n.signatureParameters.hash.algorithmOid],b===void 0||a.md[b]===void 0){var V=Error("Unsupported RSASSA-PSS hash function.");throw V.oid=n.signatureParameters.hash.algorithmOid,V.name=b,V}r=a.pss.create(a.md[b].create(),w,n.signatureParameters.saltLength);break}return n.publicKey.verify(l.md.digest().getBytes(),l.signature,r)};i.certificateFromPem=function(l,n,r){var b=a.pem.decode(l)[0];if(b.type!=="CERTIFICATE"&&b.type!=="X509 CERTIFICATE"&&b.type!=="TRUSTED CERTIFICATE"){var w=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw w.headerType=b.type,w}if(b.procType&&b.procType.type==="ENCRYPTED")throw Error("Could not convert certificate from PEM; PEM is encrypted.");var V=e.fromDer(b.body,r);return i.certificateFromAsn1(V,n)},i.certificateToPem=function(l,n){var r={type:"CERTIFICATE",body:e.toDer(i.certificateToAsn1(l)).getBytes()};return a.pem.encode(r,{maxline:n})},i.publicKeyFromPem=function(l){var n=a.pem.decode(l)[0];if(n.type!=="PUBLIC KEY"&&n.type!=="RSA PUBLIC KEY"){var r=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=n.type,r}if(n.procType&&n.procType.type==="ENCRYPTED")throw Error("Could not convert public key from PEM; PEM is encrypted.");var b=e.fromDer(n.body);return i.publicKeyFromAsn1(b)},i.publicKeyToPem=function(l,n){var r={type:"PUBLIC KEY",body:e.toDer(i.publicKeyToAsn1(l)).getBytes()};return a.pem.encode(r,{maxline:n})},i.publicKeyToRSAPublicKeyPem=function(l,n){var r={type:"RSA PUBLIC KEY",body:e.toDer(i.publicKeyToRSAPublicKey(l)).getBytes()};return a.pem.encode(r,{maxline:n})}
14,i.getPublicKeyFingerprint=function(l,n){n||(n={});var r=n.md||a.md.sha1.create(),b=n.type||"RSAPublicKey",w;switch(b){case"RSAPublicKey":w=e.toDer(i.publicKeyToRSAPublicKey(l)).getBytes();break;case"SubjectPublicKeyInfo":w=e.toDer(i.publicKeyToAsn1(l)).getBytes();break;default:throw Error('Unknown fingerprint type "'+n.type+'".')}r.start(),r.update(w);var V=r.digest();if(n.encoding==="hex"){var K=V.toHex();return n.delimiter?K.match(/.{2}/g).join(n.delimiter):K}else{if(n.encoding==="binary")return V.getBytes();if(n.encoding)throw Error('Unknown encoding "'+n.encoding+'".')}return V},i.certificationRequestFromPem=function(l,n,r){var b=a.pem.decode(l)[0];if(b.type!=="CERTIFICATE REQUEST"){var w=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw w.headerType=b.type,w}if(b.procType&&b.procType.type==="ENCRYPTED")throw Error("Could not convert certification request from PEM; PEM is encrypted.");var V=e.fromDer(b.body,r);return i.certificationRequestFromAsn1(V,n)},i.certificationRequestToPem=function(l,n){var r={type:"CERTIFICATE REQUEST",body:e.toDer(i.certificationRequestToAsn1(l)).getBytes()};return a.pem.encode(r,{maxline:n})},i.createCertificate=function(){var l={};return l.version=2,l.serialNumber="00",l.signatureOid=null,l.signature=null,l.siginfo={},l.siginfo.algorithmOid=null,l.validity={},l.validity.notBefore=new Date,l.validity.notAfter=new Date,l.issuer={},l.issuer.getField=function(n){return S(l.issuer,n)},l.issuer.addField=function(n){C([n]),l.issuer.attributes.push(n)},l.issuer.attributes=[],l.issuer.hash=null,l.subject={},l.subject.getField=function(n){return S(l.subject,n)},l.subject.addField=function(n){C([n]),l.subject.attributes.push(n)},l.subject.attributes=[],l.subject.hash=null,l.extensions=[],l.publicKey=null,l.md=null,l.setSubject=function(n,r){C(n),l.subject.attributes=n,delete l.subject.uniqueId,r&&(l.subject.uniqueId=r),l.subject.hash=null},l.setIssuer=function(n,r){C(n),l.issuer.attributes=n,delete l.issuer.uniqueId,r&&(l.issuer.uniqueId=r),l.issuer.hash=null},l.setExtensions=function(n){for(var r=0;r<n.length;++r)m(n[r],{cert:l});l.extensions=n},l.getExtension=function(n){typeof n=="string"&&(n={name:n});for(var r=null,b,w=0;r===null&&w<l.extensions.length;++w)b=l.extensions[w],(n.id&&b.id===n.id||n.name&&b.name===n.name)&&(r=b);return r},l.sign=function(n,r){l.md=r||a.md.sha1.create();var b=y[l.md.algorithm+"WithRSAEncryption"];if(!b){var w=Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw w.algorithm=l.md.algorithm,w}l.signatureOid=l.siginfo.algorithmOid=b,l.tbsCertificate=i.getTBSCertificate(l);var V=e.toDer(l.tbsCertificate);l.md.update(V.getBytes()),l.signature=n.sign(l.md)},l.verify=function(n){var r=!1;if(!l.issued(n)){var b=n.issuer,w=l.subject,V=Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw V.expectedIssuer=w.attributes,V.actualIssuer=b.attributes,V}var K=n.md;if(K===null){K=E({signatureOid:n.signatureOid,type:"certificate"});var x=n.tbsCertificate||i.getTBSCertificate(n),F=e.toDer(x);K.update(F.getBytes())}return K!==null&&(r=u({certificate:l,md:K,signature:n.signature})),r},l.isIssuer=function(n){var r=!1,b=l.issuer,w=n.subject;if(b.hash&&w.hash)r=b.hash===w.hash;else if(b.attributes.length===w.attributes.length){r=!0;for(var V,K,x=0;r&&x<b.attributes.length;++x)V=b.attributes[x],K=w.attributes[x],(V.type!==K.type||V.value!==K.value)&&(r=!1)}return r},l.issued=function(n){return n.isIssuer(l)},l.generateSubjectKeyIdentifier=function(){return i.getPublicKeyFingerprint(l.publicKey,{type:"RSAPublicKey"})},l.verifySubjectKeyIdentifier=function(){for(var n=y.subjectKeyIdentifier,r=0;r<l.extensions.length;++r){var b=l.extensions[r];if(b.id===n){var w=l.generateSubjectKeyIdentifier().getBytes();return a.util.hexToBytes(b.subjectKeyIdentifier)===w}}return!1},l},i.certificateFromAsn1=function(l,n){var r={},b=[];if(!e.validate(l,f,r,b)){var w=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw w.errors=b,w}if(e.derToOid(r.publicKeyOid)!==i.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var V=i.createCertificate();V.version=r.certVersion?r.certVersion.charCodeAt(0):0,V.serialNumber=a.util.createBuffer(r.certSerialNumber).toHex(),V.signatureOid=a.asn1.derToOid(r.certSignatureOid),V.signatureParameters=_(V.signatureOid,r.certSignatureParam
14s,!0),V.siginfo.algorithmOid=a.asn1.derToOid(r.certinfoSignatureOid),V.siginfo.parameters=_(V.siginfo.algorithmOid,r.certinfoSignatureParams,!1),V.signature=r.certSignature;var K=[];if(r.certValidity1UTCTime!==void 0&&K.push(e.utcTimeToDate(r.certValidity1UTCTime)),r.certValidity2GeneralizedTime!==void 0&&K.push(e.generalizedTimeToDate(r.certValidity2GeneralizedTime)),r.certValidity3UTCTime!==void 0&&K.push(e.utcTimeToDate(r.certValidity3UTCTime)),r.certValidity4GeneralizedTime!==void 0&&K.push(e.generalizedTimeToDate(r.certValidity4GeneralizedTime)),K.length>2)throw Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(K.length<2)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(V.validity.notBefore=K[0],V.validity.notAfter=K[1],V.tbsCertificate=r.tbsCertificate,n){V.md=E({signatureOid:V.signatureOid,type:"certificate"});var x=e.toDer(V.tbsCertificate);V.md.update(x.getBytes())}var F=a.md.sha1.create(),G=e.toDer(r.certIssuer);F.update(G.getBytes()),V.issuer.getField=function(Y){return S(V.issuer,Y)},V.issuer.addField=function(Y){C([Y]),V.issuer.attributes.push(Y)},V.issuer.attributes=i.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(V.issuer.uniqueId=r.certIssuerUniqueId),V.issuer.hash=F.digest().toHex();var H=a.md.sha1.create(),Z=e.toDer(r.certSubject);return H.update(Z.getBytes()),V.subject.getField=function(Y){return S(V.subject,Y)},V.subject.addField=function(Y){C([Y]),V.subject.attributes.push(Y)},V.subject.attributes=i.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(V.subject.uniqueId=r.certSubjectUniqueId),V.subject.hash=H.digest().toHex(),r.certExtensions?V.extensions=i.certificateExtensionsFromAsn1(r.certExtensions):V.extensions=[],V.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),V},i.certificateExtensionsFromAsn1=function(l){for(var n=[],r=0;r<l.value.length;++r)for(var b=l.value[r],w=0;w<b.value.length;++w)n.push(i.certificateExtensionFromAsn1(b.value[w]));return n},i.certificateExtensionFromAsn1=function(l){var n={};if(n.id=e.derToOid(l.value[0].value),n.critical=!1,l.value[1].type===e.Type.BOOLEAN?(n.critical=l.value[1].value.charCodeAt(0)!==0,n.value=l.value[2].value):n.value=l.value[1].value,n.id in y){if(n.name=y[n.id],n.name==="keyUsage"){var r=e.fromDer(n.value),b=0,w=0;r.value.length>1&&(b=r.value.charCodeAt(1),w=r.value.length>2?r.value.charCodeAt(2):0),n.digitalSignature=(b&128)==128,n.nonRepudiation=(b&64)==64,n.keyEncipherment=(b&32)==32,n.dataEncipherment=(b&16)==16,n.keyAgreement=(b&8)==8,n.keyCertSign=(b&4)==4,n.cRLSign=(b&2)==2,n.encipherOnly=(b&1)==1,n.decipherOnly=(w&128)==128}else if(n.name==="basicConstraints"){var r=e.fromDer(n.value);r.value.length>0&&r.value[0].type===e.Type.BOOLEAN?n.cA=r.value[0].value.charCodeAt(0)!==0:n.cA=!1;var V=null;r.value.length>0&&r.value[0].type===e.Type.INTEGER?V=r.value[0].value:r.value.length>1&&(V=r.value[1].value),V!==null&&(n.pathLenConstraint=e.derToInteger(V))}else if(n.name==="extKeyUsage")for(var r=e.fromDer(n.value),K=0;K<r.value.length;++K){var x=e.derToOid(r.value[K].value);x in y?n[y[x]]=!0:n[x]=!0}else if(n.name==="nsCertType"){var r=e.fromDer(n.value),b=0;r.value.length>1&&(b=r.value.charCodeAt(1)),n.client=(b&128)==128,n.server=(b&64)==64,n.email=(b&32)==32,n.objsign=(b&16)==16,n.reserved=(b&8)==8,n.sslCA=(b&4)==4,n.emailCA=(b&2)==2,n.objCA=(b&1)==1}else if(n.name==="subjectAltName"||n.name==="issuerAltName"){n.altNames=[];for(var F,r=e.fromDer(n.value),G=0;G<r.value.length;++G){F=r.value[G];var H={type:F.type,value:F.value};switch(n.altNames.push(H),F.type){case 1:case 2:case 6:break;case 7:H.ip=a.util.bytesToIP(F.value);break;case 8:H.oid=e.derToOid(F.value);break}}}else if(n.name==="subjectKeyIdentifier"){var r=e.fromDer(n.value);n.subjectKeyIdentifier=a.util.bytesToHex(r.value)}}return n},i.certificationRequestFromAsn1=function(l,n){var r={},b=[];if(!e.validate(l,c,r,b)){var w=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw w.errors=b,w}if(e.derToOid(r.publicKeyOid)!==i.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var V=i.createCertificationRequest();if(V.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,V.signatureOid=a.asn1.derToOid(r.csrSignatureOid),V.signatureParameters=_(V.signatureOid,r.csrSignatureParam
14s,!0),V.siginfo.algorithmOid=a.asn1.derToOid(r.csrSignatureOid),V.siginfo.parameters=_(V.siginfo.algorithmOid,r.csrSignatureParams,!1),V.signature=r.csrSignature,V.certificationRequestInfo=r.certificationRequestInfo,n){V.md=E({signatureOid:V.signatureOid,type:"certification request"});var K=e.toDer(V.certificationRequestInfo);V.md.update(K.getBytes())}var x=a.md.sha1.create();return V.subject.getField=function(F){return S(V.subject,F)},V.subject.addField=function(F){C([F]),V.subject.attributes.push(F)},V.subject.attributes=i.RDNAttributesAsArray(r.certificationRequestInfoSubject,x),V.subject.hash=x.digest().toHex(),V.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),V.getAttribute=function(F){return S(V,F)},V.addAttribute=function(F){C([F]),V.attributes.push(F)},V.attributes=i.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),V},i.createCertificationRequest=function(){var l={};return l.version=0,l.signatureOid=null,l.signature=null,l.siginfo={},l.siginfo.algorithmOid=null,l.subject={},l.subject.getField=function(n){return S(l.subject,n)},l.subject.addField=function(n){C([n]),l.subject.attributes.push(n)},l.subject.attributes=[],l.subject.hash=null,l.publicKey=null,l.attributes=[],l.getAttribute=function(n){return S(l,n)},l.addAttribute=function(n){C([n]),l.attributes.push(n)},l.md=null,l.setSubject=function(n){C(n),l.subject.attributes=n,l.subject.hash=null},l.setAttributes=function(n){C(n),l.attributes=n},l.sign=function(n,r){l.md=r||a.md.sha1.create();var b=y[l.md.algorithm+"WithRSAEncryption"];if(!b){var w=Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw w.algorithm=l.md.algorithm,w}l.signatureOid=l.siginfo.algorithmOid=b,l.certificationRequestInfo=i.getCertificationRequestInfo(l);var V=e.toDer(l.certificationRequestInfo);l.md.update(V.getBytes()),l.signature=n.sign(l.md)},l.verify=function(){var n=!1,r=l.md;if(r===null){r=E({signatureOid:l.signatureOid,type:"certification request"});var b=l.certificationRequestInfo||i.getCertificationRequestInfo(l),w=e.toDer(b);r.update(w.getBytes())}return r!==null&&(n=u({certificate:l,md:r,signature:l.signature})),n},l};function h(l){for(var n=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]),r,b,w=l.attributes,V=0;V<w.length;++V){r=w[V];var K=r.value,x=e.Type.PRINTABLESTRING;"valueTagClass"in r&&(x=r.valueTagClass,x===e.Type.UTF8&&(K=a.util.encodeUtf8(K))),b=e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.type).getBytes()),e.create(e.Class.UNIVERSAL,x,!1,K)])]),n.value.push(b)}return n}function C(l){for(var n,r=0;r<l.length;++r){if(n=l[r],n.name===void 0&&(n.type&&n.type in i.oids?n.name=i.oids[n.type]:n.shortName&&n.shortName in k&&(n.name=i.oids[k[n.shortName]])),n.type===void 0)if(n.name&&n.name in i.oids)n.type=i.oids[n.name];else{var b=Error("Attribute type not specified.");throw b.attribute=n,b}if(n.shortName===void 0&&n.name&&n.name in k&&(n.shortName=k[n.name]),n.type===y.extensionRequest&&(n.valueConstructed=!0,n.valueTagClass=e.Type.SEQUENCE,!n.value&&n.extensions)){n.value=[];for(var w=0;w<n.extensions.length;++w)n.value.push(i.certificateExtensionToAsn1(m(n.extensions[w])))}if(n.value===void 0){var b=Error("Attribute value not specified.");throw b.attribute=n,b}}}function m(l,n){if(n||(n={}),l.name===void 0&&l.id&&l.id in i.oids&&(l.name=i.oids[l.id]),l.id===void 0)if(l.name&&l.name in i.oids)l.id=i.oids[l.name];else{var r=Error("Extension ID not specified.");throw r.extension=l,r}if(l.value!==void 0)return l;if(l.name==="keyUsage"){var b=0,w=0,V=0;l.digitalSignature&&(w|=128,b=7),l.nonRepudiation&&(w|=64,b=6),l.keyEncipherment&&(w|=32,b=5),l.dataEncipherment&&(w|=16,b=4),l.keyAgreement&&(w|=8,b=3),l.keyCertSign&&(w|=4,b=2),l.cRLSign&&(w|=2,b=1),l.encipherOnly&&(w|=1,b=0),l.decipherOnly&&(V|=128,b=7);var K=String.fromCharCode(b);V===0?w!==0&&(K+=String.fromCharCode(w)):K+=String.fromCharCode(w)+String.fromCharCode(V),l.value=e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,K)}else if(l.name==="basicConstraints")l.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]),l.cA&&l.value.value.push(e.create(e.Class.UNIVERSAL,e.Type.BOOLEAN,!1,"ÿ")),"pathLenConstraint"in l&&l.value.value.push(e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(l.pathLenConstraint).getBytes()));else if(l.name==="extKeyUsage"){l.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);var x=l.value.value;for(var F in l)l[F]===!0&&(F in y?x.push(e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(y[F]).getBytes())):F.indexOf(".")!==-1&&x.push(e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(F).getBytes())))}else if(l.name==="nsCertType"){var b=0,w=0;l.client&&(w|=128,b=7),l.server&&(w|=64,b=6),l.email&&(w|=32,b=5),l.objsign&&(w|=16,b=4),l.reserved&&(w|=8,b=3),l.sslCA&&(w|=4,b=2),l.emailCA&&(w|=2,b=1),l.objCA&&(w|=1,b=0);var K=String.fromCharCode(b);w!==0&&(K+=String.fromCharCode(w)),l.value=e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,K)}else if(l.name==="subjectAltName"||l.name==="issuerAltName"){l.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);for(var G,H=0;H<l.altNames.length;
14++H){G=l.altNames[H];var K=G.value;if(G.type===7&&G.ip){if(K=a.util.bytesFromIP(G.ip),K===null){var r=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=l,r}}else G.type===8&&(K=G.oid?e.oidToDer(e.oidToDer(G.oid)):e.oidToDer(K));l.value.value.push(e.create(e.Class.CONTEXT_SPECIFIC,G.type,!1,K))}}else if(l.name==="nsComment"&&n.cert){if(!/^[\x00-\x7F]*$/.test(l.comment)||l.comment.length<1||l.comment.length>128)throw Error('Invalid "nsComment" content.');l.value=e.create(e.Class.UNIVERSAL,e.Type.IA5STRING,!1,l.comment)}else if(l.name==="subjectKeyIdentifier"&&n.cert){var Z=n.cert.generateSubjectKeyIdentifier();l.subjectKeyIdentifier=Z.toHex(),l.value=e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,Z.getBytes())}else if(l.name==="authorityKeyIdentifier"&&n.cert){l.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);var x=l.value.value;if(l.keyIdentifier){var Y=l.keyIdentifier===!0?n.cert.generateSubjectKeyIdentifier().getBytes():l.keyIdentifier;x.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!1,Y))}if(l.authorityCertIssuer){var ee=[e.create(e.Class.CONTEXT_SPECIFIC,4,!0,[h(l.authorityCertIssuer===!0?n.cert.issuer:l.authorityCertIssuer)])];x.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,ee))}if(l.serialNumber){var ue=a.util.hexToBytes(l.serialNumber===!0?n.cert.serialNumber:l.serialNumber);x.push(e.create(e.Class.CONTEXT_SPECIFIC,2,!1,ue))}}else if(l.name==="cRLDistributionPoints"){l.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);for(var x=l.value.value,se=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]),de=e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[]),G,H=0;H<l.altNames.length;++H){G=l.altNames[H];var K=G.value;if(G.type===7&&G.ip){if(K=a.util.bytesFromIP(G.ip),K===null){var r=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=l,r}}else G.type===8&&(K=G.oid?e.oidToDer(e.oidToDer(G.oid)):e.oidToDer(K));de.value.push(e.create(e.Class.CONTEXT_SPECIFIC,G.type,!1,K))}se.value.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[de])),x.push(se)}if(l.value===void 0){var r=Error("Extension value not specified.");throw r.extension=l,r}return l}function s(l,n){switch(l){case y["RSASSA-PSS"]:var r=[];return n.hash.algorithmOid!==void 0&&r.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(n.hash.algorithmOid).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")])])),n.mgf.algorithmOid!==void 0&&r.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(n.mgf.algorithmOid).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(n.mgf.hash.algorithmOid).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")])])])),n.saltLength!==void 0&&r.push(e.create(e.Class.CONTEXT_SPECIFIC,2,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(n.saltLength).getBytes())])),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,r);default:return e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")}}function p(l){var n=e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[]);if(l.attributes.length===0)return n;for(var r=l.attributes,b=0;b<r.length;++b){var w=r[b],V=w.value,K=e.Type.UTF8;"valueTagClass"in w&&(K=w.valueTagClass),K===e.Type.UTF8&&(V=a.util.encodeUtf8(V));var x=!1;"valueConstructed"in w&&(x=w.valueConstructed);var F=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(w.type).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,K,x,V)])]);n.value.push(F)}return n}var d=new Date("1950-01-01T00:00:00Z"),A=new Date("2050-01-01T00:00:00Z");function D(l){return l>=d&&l<A?e.create(e.Class.UNIVERSAL,e.Type.UTCTIME,!1,e.dateToUtcTime(l)):e.create(e.Class.UNIVERSAL,e.Type.GENERALIZEDTIME,!1,e.dateToGeneralizedTime(l))}i.getTBSCertificate=function(l){var n=D(l.validity.notBefore),r=D(l.validity.notAfter),b=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(l.version).getBytes())]),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,a.util.hexToBytes(l.serialNumber)),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(l.siginfo.algorithmOid).getBytes()),s(l.siginfo.algorithmOid,l.siginfo.parameters)]),h(l.issuer),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[n,r]),h(l.subject),i.publicKeyToAsn1(l.publicKey)]);return l.issuer.uniqueId&&b.value.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,[e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,"\0"+l.issuer.uniqueId)])),l.subject.uniqueId&&b.value.push(e.create(e.Class.CONTEXT_SPECIFIC,2,!0,[e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,"\0"+l.subject.uniqueId)])),l.extensions.length>0&&b.value.push(i.certificateExtensionsToAsn1(l.extensions)),b},i.getCertificationRequestInfo=function(l){return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(l.version).getBytes()),h(l.subject),i.publicKeyToAsn1(l.publicKey),p(l)])},i.distinguishedNameToAsn1=function(l){return h(l)},i.certificateToAsn1=function(l){var n=l.tbsCertificate||i.getTBSCertificate(l);return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[n,e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(l.signatureOid).getBytes()),s(l.signatureOid,l.signatureParameters)]),e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,"\0"+l.signature)])},i.certificateExtensionsToAsn1=function(l){var n=e.create(e.Class.CONTEXT_SPECIFIC,3,!0,[]),r=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);n.value.push(r);for(var b=0;b<l.length;++b)r.value.push(i.certificateExtensionToAsn1(l[b]));return n},i.certificateExtensionToAsn1=function(l){var n=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);n.value.push(e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(l.id).getBytes())),l.critical&&n.value.push(e.create(e.Class.UNIVERSAL,e.Type.BOOLEAN,!1,"ÿ"));var r=l.value;return typeof l.value!="string"&&(r=e.toDer(r).getBytes()),n.value.push(e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,r)),n},i.certificationRequestToAsn1=function(l){var n=l.certificationRequestInfo||i.getCertificationRequestInfo(l);return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[n,e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(l.signatureOid).getBytes()),s(l.signatureOid,l.signatureParameters)]),e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,"\0"+l.signature)])},i.createCaStore=function(l){var n={certs:{}};n.getIssuer=function(K){return r(K.issuer)},n.addCertificate=function(K){if(typeof K=="string"&&(K=a.pki.certificateFromPem(K)),b(K.subject),!n.hasCertificate(K))if(K.subject.hash in n.certs){var x=n.certs[K.subject.hash];a.util.isArray(x)||(x=[x]),x.push(K),n.certs[K.subject.hash]=x}else n.certs[K.subject.hash]=K},n.hasCertificate=function(K){typeof K=="string"&&(K=a.pki.certificateFromPem(K));var x=r(K.subject);if(!x)return!1;a.util.isArray(x)||(x=[x]);for(var F=e.toDer(i.certificateToAsn1(K)).getBytes(),G=0;G<x.length;++G)if(F===e.toDer(i.certificateToAsn1(x[G])).getBytes())return!0;return!1},n.listAllCertificates=function(){var K=[];for(var x in n.certs)if(n.certs.hasOwnProperty(x)){var F=n.certs[x];if(!a.util.isArray(F))K.push(F);else for(var G=0;G<F.length;++G)K.push(F[G])}return K},n.removeCertificate=function(K){var x;if(typeof K=="string"&&(K=a.pki.certificateFromPem(K)),b(K.subject),!n.hasCertificate(K))return null;var F=r(K.subject);if(!a.util.isArray(F))return x=n.certs[K.subject.hash],delete n.certs[K.subject.hash],x;for(var G=e.toDer(i.certificateToAsn1(K)).getBytes(),H=0;H<F.length;++H)G===e.toDer(i.certificateToAsn1(F[H])).getBytes()&&(x=F[H],F.splice(H,1));return F.length===0&&delete n.certs[K.subject.hash],x};function r(K){return b(K),n.certs[K.hash]||null}function b(K){if(!K.hash){var x=a.md.sha1.create();K.attributes=i.RDNAttributesAsArray(h(K),x),K.hash=x.digest().toHex()}}if(l)for(var w=0;w<l.length;++w){var V=l[w];n.addCertificate(V)}return n},i.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},i.verifyCertificateChain=function(l,n,r){typeof r=="function"&&(r={verify:r}),r||(r={}),n=n.slice(0);var b=n.slice(0),w=r.validityCheckDate;w===void 0&&(w=new Date);var V=!0,K=null,x=0;do{var F=n.shift(),G=null,H=!1;if(w&&(w<F.validity.notBefore||w>
14F.validity.notAfter)&&(K={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:F.validity.notBefore,notAfter:F.validity.notAfter,now:w}),K===null){if(G=n[0]||l.getIssuer(F),G===null&&F.isIssuer(F)&&(H=!0,G=F),G){var Z=G;a.util.isArray(Z)||(Z=[Z]);for(var Y=!1;!Y&&Z.length>0;){G=Z.shift();try{Y=G.verify(F)}catch{}}Y||(K={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}K===null&&(!G||H)&&!l.hasCertificate(F)&&(K={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(K===null&&G&&!F.isIssuer(G)&&(K={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),K===null)for(var ee={keyUsage:!0,basicConstraints:!0},ue=0;K===null&&ue<F.extensions.length;++ue){var se=F.extensions[ue];se.critical&&!(se.name in ee)&&(K={message:"Certificate has an unsupported critical extension.",error:i.certificateError.unsupported_certificate})}if(K===null&&(!V||n.length===0&&(!G||H))){var de=F.getExtension("basicConstraints"),me=F.getExtension("keyUsage");me!==null&&(!me.keyCertSign||de===null)&&(K={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:i.certificateError.bad_certificate}),K===null&&de===null&&(K={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:i.certificateError.bad_certificate}),K===null&&de!==null&&!de.cA&&(K={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:i.certificateError.bad_certificate}),K===null&&me!==null&&"pathLenConstraint"in de&&x-1>de.pathLenConstraint&&(K={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}var fe=K===null?!0:K.error,X=r.verify?r.verify(fe,x,b):fe;if(X===!0)K=null;else throw fe===!0&&(K={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(X||X===0)&&(typeof X=="object"&&!a.util.isArray(X)?(X.message&&(K.message=X.message),X.error&&(K.error=X.error)):typeof X=="string"&&(K.error=X)),K;V=!1,++x}while(n.length>0);return!0}})),Gt=ce(((oe,W)=>{var a=le();st(),mt(),ht(),Mt(),xt(),at(),At(),Ct(),ye(),Ut();var e=a.asn1,i=a.pki,y=W.exports=a.pkcs12=a.pkcs12||{},k={name:"ContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},T={name:"PFX",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},k,{name:"PFX.macData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:e.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},f={name:"SafeBag",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},t={name:"Attribute",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,capture:"values"}]},g={name:"CertBag",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:e.Class.UNIVERSAL,type:e.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function c(C,m,s,p){for(var d=[],A=0;A<C.length;A++)for(var D=0;D<C[A].safeBags.length;D++){var l=C[A].safeBags[D];if(!(p!==void 0&&l.type!==p)){if(m===null){d.push(l);continue}l.attributes[m]!==void 0&&l.attributes[m].indexOf(s)>=0&&d.push(l)}}return d}y.pkcs12FromAsn1=function(C,m,s){typeof m=="string"?(s=m,m=!0):m===void 0&&(m=!0);var p={};if(!e.validate(C,T,p,[])){var d=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw d.errors=d,d}var A={version:p.version.charCodeAt(0),safeContents:[],getBags:function(x){var F={},G;return"localKeyId"in x?G=x.localKeyId:"localKeyIdHex"in x&&(G=a.util.hexToBytes(x.localKeyIdHex)),G===void 0&&!("friendlyName"in x)&&"bagType"in x&&(F[x.bagType]=c(A.safeContents,null,null,x.bagType)),G!==void 0&&(F.localKeyId=c(A.safeContents,"localKeyId",G,x.bagType)),"friendlyName"in x&&(F.friendlyName=c(A.safeContents,"friendlyName",x.friendlyName,x.bagType)),F},getBagsByFriendlyName:function(x,F){return c(A.safeContents,"friendlyName",x,F)},getBagsByLocalKeyId:function(x,F){return c(A.safeContents,"localKeyId",x,F)}};if(p.version.charCodeAt(0)!==3){var d=Error("PKCS#12 PFX of version other than 3 not supported.");throw d.version=p.version.charCodeAt(0),d}if(e.derToOid(p.contentType)!==i.oids.data){var d=Error("Only PKCS#12 PFX in password integrity mode supported.");throw d.oid=e.derToOid(p.contentType),d}var D=p.content.value[0];if(D.tagClass!==e.Class.UNIVERSAL||D.type!==e.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(D=S(D),p.mac){var l=null,n=0,r=e.derToOid(p.macAlgorithm);switch(r){case i.oids.sha1:l=a.md.sha1.create(),n=20;break;case i.oids.sha256:l=a.md.sha256.create(),n=32;break;case i.oids.sha384:l=a.md.sha384.create(),n=48;break;case i.oids.sha512:l=a.md.sha512.create(),n=64;break;case i.oids.md5:l=a.md.md5.create(),n=16;break}if(l===null)throw Error("PKCS#12 uses unsupported MAC algorithm: "+r);var b=new a.util.ByteBuffer(p.macSalt),w="macIterations"in p?parseInt(a.util.bytesToHex(p.macIterations),16):1,V=y.generateKey(s,b,3,w,n,l),K=a.hmac.create();if(K.start(l,V),K.update(D.value),K.getMac().getBytes()!==p.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(C.value)&&C.value.length>2)throw Error("Invalid PKCS#12. macData field present but MAC was not val
14idated.");return _(A,D.value,m,s),A};function S(C){if(C.composed||C.constructed){for(var m=a.util.createBuffer(),s=0;s<C.value.length;++s)m.putBytes(C.value[s].value);C.composed=C.constructed=!1,C.value=m.getBytes()}return C}function _(C,m,s,p){if(m=e.fromDer(m,s),m.tagClass!==e.Class.UNIVERSAL||m.type!==e.Type.SEQUENCE||m.constructed!==!0)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var d=0;d<m.value.length;d++){var A=m.value[d],D={},l=[];if(!e.validate(A,k,D,l)){var n=Error("Cannot read ContentInfo.");throw n.errors=l,n}var r={encrypted:!1},b=null,w=D.content.value[0];switch(e.derToOid(D.contentType)){case i.oids.data:if(w.tagClass!==e.Class.UNIVERSAL||w.type!==e.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");b=S(w).value;break;case i.oids.encryptedData:b=E(w,p),r.encrypted=!0;break;default:var n=Error("Unsupported PKCS#12 contentType.");throw n.contentType=e.derToOid(D.contentType),n}r.safeBags=u(b,s,p),C.safeContents.push(r)}}function E(C,m){var s={},p=[];if(!e.validate(C,a.pkcs7.asn1.encryptedDataValidator,s,p)){var d=Error("Cannot read EncryptedContentInfo.");throw d.errors=p,d}var A=e.derToOid(s.contentType);if(A!==i.oids.data){var d=Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw d.oid=A,d}A=e.derToOid(s.encAlgorithm);var D=i.pbe.getCipher(A,s.encParameter,m),l=S(s.encryptedContentAsn1),n=a.util.createBuffer(l.value);if(D.update(n),!D.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");return D.output.getBytes()}function u(C,m,s){if(!m&&C.length===0)return[];if(C=e.fromDer(C,m),C.tagClass!==e.Class.UNIVERSAL||C.type!==e.Type.SEQUENCE||C.constructed!==!0)throw Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var p=[],d=0;d<C.value.length;d++){var A=C.value[d],D={},l=[];if(!e.validate(A,f,D,l)){var n=Error("Cannot read SafeBag.");throw n.errors=l,n}var r={type:e.derToOid(D.bagId),attributes:h(D.bagAttributes)};p.push(r);var b,w,V=D.bagValue.value[0];switch(r.type){case i.oids.pkcs8ShroudedKeyBag:if(V=i.decryptPrivateKeyInfo(V,s),V===null)throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case i.oids.keyBag:try{r.key=i.privateKeyFromAsn1(V)}catch{r.key=null,r.asn1=V}continue;case i.oids.certBag:b=g,w=function(){if(e.derToOid(D.certId)!==i.oids.x509Certificate){var x=Error("Unsupported certificate type, only X.509 supported.");throw x.oid=e.derToOid(D.certId),x}var F=e.fromDer(D.cert,m);try{r.cert=i.certificateFromAsn1(F,!0)}catch{r.cert=null,r.asn1=F}};break;default:var n=Error("Unsupported PKCS#12 SafeBag type.");throw n.oid=r.type,n}if(b!==void 0&&!e.validate(V,b,D,l)){var n=Error("Cannot read PKCS#12 "+b.name);throw n.errors=l,n}w()}return p}function h(C){var m={};if(C!==void 0)for(var s=0;s<C.length;++s){var p={},d=[];if(!e.validate(C[s],t,p,d)){var A=Error("Cannot read PKCS#12 BagAttribute.");throw A.errors=d,A}var D=e.derToOid(p.oid);if(i.oids[D]!==void 0){m[i.oids[D]]=[];for(var l=0;l<p.values.length;++l)m[i.oids[D]].push(p.values[l].value)}}return m}y.toPkcs12Asn1=function(C,m,s,p){p||(p={}),p.saltSize=p.saltSize||8,p.count=p.count||2048,p.algorithm=p.algorithm||p.encAlgorithm||"aes128","useMac"in p||(p.useMac=!0),"localKeyId"in p||(p.localKeyId=null),"generateLocalKeyId"in p||(p.generateLocalKeyId=!0);var d=p.localKeyId,A;if(d!==null)d=a.util.hexToBytes(d);else if(p.generateLocalKeyId)if(m){var D=a.util.isArray(m)?m[0]:m;
14typeof D=="string"&&(D=i.certificateFromPem(D));var l=a.md.sha1.create();l.update(e.toDer(i.certificateToAsn1(D)).getBytes()),d=l.digest().getBytes()}else d=a.random.getBytes(20);var n=[];d!==null&&n.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.localKeyId).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,d)])])),"friendlyName"in p&&n.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.friendlyName).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.BMPSTRING,!1,p.friendlyName)])])),n.length>0&&(A=e.create(e.Class.UNIVERSAL,e.Type.SET,!0,n));var r=[],b=[];m!==null&&(b=a.util.isArray(m)?m:[m]);for(var w=[],V=0;V<b.length;++V){m=b[V],typeof m=="string"&&(m=i.certificateFromPem(m));var K=V===0?A:void 0,x=i.certificateToAsn1(m),F=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.certBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.x509Certificate).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(x).getBytes())])])]),K]);w.push(F)}if(w.length>0){var G=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,w),H=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(G).getBytes())])]);r.push(H)}var Z=null;if(C!==null){var Y=i.wrapRsaPrivateKey(i.privateKeyToAsn1(C));Z=s===null?e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.keyBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[Y]),A]):e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(Y,s,p)]),A]);var ee=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[Z]),ue=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(ee).getBytes())])]);r.push(ue)}var se=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,r),de;if(p.useMac){var l=a.md.sha1.create(),me=new a.util.ByteBuffer(a.random.getBytes(p.saltSize)),fe=p.count,C=y.generateKey(s,me,3,fe,20),X=a.hmac.create();X.start(l,C),X.update(e.toDer(se).getBytes());var ae=X.getMac();de=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.sha1).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")]),e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,ae.getBytes())]),e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,me.getBytes()),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(fe).getBytes())])}return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(3).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(i.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(se).getBytes())])]),de])},y.generateKey=a.pbe.generatePkcs12Key})),Ht=ce(((oe,W)=>{var a=le();st(),ht(),xt(),gt(),Lt(),Gt(),_t(),At(),ye(),Ut();var e=a.asn1,i=W.exports=a.pki=a.pki||{};i.pemToDer=function(y){var k=a.pem.decode(y)[0];if(k.procType&&k.procType.type==="ENCRYPTED")throw Error("Could not convert PEM to DER; PEM is encrypted.");return a.util.createBuffer(k.body)},i.privateKeyFromPem=function(y){var k=a.pem.decode(y)[0];if(k.type!=="PRIVATE KEY"&&k.type!=="RSA PRIVATE KEY"){var T=Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw T.headerType=k.type,T}if(k.procType&&k.procType.type==="ENCRYPTED")throw Error("Could not convert private key from PEM; PEM is encrypted.");var f=e.fromDer(k.body);return i.privateKeyFromAsn1(f)},i.privateKeyToPem=function(y,k){var T={type:"RSA PRIVATE KEY",body:e.toDer(i.privateKeyToAsn1(y)).getBytes()};return a.pem.encode(T,{maxline:k})},i.privateKeyInfoToPem=function(y,k){var T={type:"PRIVATE KEY",body:e.toDer(y).getBytes()};return a.pem.encode(T,{maxline:k})}})),qt=ce(((oe,W)=>{var a=le();st(),mt(),Rt(),gt(),Ht(),at(),Ct(),ye();var e=function(v,U,L,N){var o=a.util.createBuffer(),R=v.length>>1,O=R+(v.length&1),q=v.substr(0,O),te=v.substr(R,O),ie=a.util.createBuffer(),j=a.hmac.create();L=U+L;var J=Math.ceil(N/16),ne=Math.ceil(N/20);j.start("MD5",q);var he=a.util.createBuffer();ie.putBytes(L);for(var pe=0;pe<J;++pe)j.start(null,null),j.update(ie.getBytes()),ie.putBuffer(j.digest()),j.start(null,null),j.update(ie.bytes()+L),he.putBuffer(j.digest());j.start("SHA1",te);var Te=a.util.createBuffer();ie.clear(),ie.putBytes(L);for(var pe=0;pe<ne;++pe)j.start(null,null),j.update(ie.getBytes()),ie.putBuffer(j.digest()),j.start(null,null),j.update(ie.bytes()+L),Te.putBuffer(j.digest());return o.putBytes(a.util.xorBytes(he.getBytes(),Te.getBytes(),N)),o},i=function(v,U,L){var N=a.hmac.create();N.start("SHA1",v);var o=a.util.createBuffer();return o.putInt32(U[0]),o.putInt32(U[1]),o.putByte(L.type),o.putByte(L.version.major),o.putByte(L.version.minor),o.putInt16(L.length),o.putBytes(L.fragment.bytes()),N.update(o.getBytes()),N.digest().getBytes()},y=function(v,U,L){var N=!1;try{var o=v.deflate(U.fragment.getBytes());U.fragment=a.util.createBuffer(o),U.length=o.length,N=!0}catch{}return N},k=function(v,U,L){var N=!1;try{var o=v.inflate(U.fragment.getBytes());U.fragment=a.util.createBuffer(o),U.length=o.length,N=!0}catch{}return N},T=function(v,U){var L=0;switch(U){case 1:L=v.getByte();break;case 2:L=v.getInt16();break;case 3:L=v.getInt24();break;case 4:L=v.getInt32();break}return a.util.createBuffer(v.getBytes(L))},f=function(v,U,L){v.putInt(L.length(),U<<3),v.putBuffer(L)},t={};t.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},t.SupportedVersions=[t.Versions.TLS_1_1,t.Versions.TLS_1_0],t.Version=t.SupportedVersions[0],t.MaxFragment=15360,t.ConnectionEnd={server:0,client:1},t.PRFAlgorithm={tls_prf_sha256:0},t.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2}
14,t.CipherType={stream:0,block:1,aead:2},t.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},t.CompressionMethod={none:0,deflate:1},t.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},t.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},t.Alert={},t.Alert.Level={warning:1,fatal:2},t.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},t.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},t.CipherSuites={},t.getCipherSuite=function(v){var U=null;for(var L in t.CipherSuites){var N=t.CipherSuites[L];if(N.id[0]===v.charCodeAt(0)&&N.id[1]===v.charCodeAt(1)){U=N;break}}return U},t.handleUnexpected=function(v,U){!v.open&&v.entity===t.ConnectionEnd.client||v.error(v,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.unexpected_message}})},t.handleHelloRequest=function(v,U,L){!v.handshaking&&v.handshakes>0&&(t.queue(v,t.createAlert(v,{level:t.Alert.Level.warning,description:t.Alert.Description.no_renegotiation})),t.flush(v)),v.process()},t.parseHelloMessage=function(v,U,L){var N=null,o=v.entity===t.ConnectionEnd.client;if(L<38)v.error(v,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.illegal_parameter}});else{var R=U.fragment,O=R.length();if(N={version:{major:R.getByte(),minor:R.getByte()},random:a.util.createBuffer(R.getBytes(32)),session_id:T(R,1),extensions:[]},o?(N.cipher_suite=R.getBytes(2),N.compression_method=R.getByte()):(N.cipher_suites=T(R,2),N.compression_methods=T(R,1)),O=L-(O-R.length()),O>0){for(var q=T(R,2);q.length()>0;)N.extensions.push({type:[q.getByte(),q.getByte()],data:T(q,2)});if(!o)for(var te=0;te<N.extensions.length;++te){var ie=N.extensions[te];if(ie.type[0]===0&&ie.type[1]===0)for(var j=T(ie.data,2);j.length()>0&&j.getByte()===0;)v.session.extensions.server_name.serverNameList.push(T(j,2).getBytes())}}if(v.session.version&&(N.version.major!==v.session.version.major||N.version.minor!==v.session.version.minor))return v.error(v,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.protocol_version}});if(o)v.session.cipherSuite=t.getCipherSuite(N.cipher_suite);else for(var J=a.util.createBuffer(N.cipher_suites.bytes());J.length()>0&&(v.session.cipherSuite=t.getCipherSuite(J.getBytes(2)),v.session.cipherSuite===null););if(v.session.cipherSuite===null)return v.error(v,{message:"No cipher suites in common.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.handshake_failure},cipherSuite:a.util.bytesToHex(N.cipher_suite)});o?v.session.compressionMethod=N.compression_method:v.session.compressionMethod=t.CompressionMethod.none}return N},t.createSecurityParameters=function(v,U){var L=v.entity===t.ConnectionEnd.client,N=U.random.bytes(),o=L?v.session.sp.client_random:N,R=L?N:t.createRandom().getBytes();v.session.sp={entity:v.entity,prf_algorithm:t.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:v.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:R}},t.handleServerHello=function(v,U,L){var N=t.parseHelloMessage(v,U,L);if(!v.fail){if(N.version.minor<=v.version.minor)v.version.minor=N.version.minor;else return v.error(v,{message:"Incompatible TLS version.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.protocol_version}});v.session.version=v.version;var o=N.session_id.bytes();o.length>0&&o===v.session.id?(v.expect=u,v.session.resuming=!0,v.session.sp.server_random=N.random.bytes()):(v.expect=c,v.session.resuming=!1,t.createSecurityParameters(v,N)),v.session.id=o,v.process()}},t.handleClientHello=function(v,U,L){var N=t.parseHelloMessage(v,U,L);if(!v.fail){var o=N.session_id.bytes(),R=null;if(v.sessionCache&&(R=v.sessionCache.getSession(o),R===null?o="":(R.version.major!==N.version.major||R.version.minor>N.version.minor)&&(R=null,o="")),o.length===0&&(o=a.random.getBytes(32)),v.session.id=o,v.session.clientHelloVersion=N.version,v.session.sp={},R)v.version=v.session.version=R.version,v.session.sp=R.sp;else{for(var O,q=1;q<t.SupportedVersions.length&&(O=t.SupportedVersions[q],!(O.minor<=N.version.minor));++q);v.version={major:O.major,minor:O.minor},v.session.version=v.version}R===null?(v.expect=v.verifyClient===!1?d:p,v.session.resuming=!1,t.createSecurityParameters(v,N)):(v.expect=D,v.session.resuming=!0,v.session.sp.client_random=N.random.bytes()),v.open=!0,t.queue(v,t.createRecord(v,{type:t.ContentType.handshake,data:t.createServerHello(v)})),v.session.resuming?(t.queue(v,t.createRecord(v,{type:t.ContentType.change_cipher_spec,data:t.createChangeCipherSpec()})),v.state.pending=t.createConnectionState(v),v.state.current.write=v.state.pending.write,t.queue(v,t.createRecord(v,{type:t.ContentType.handshake,data:t.createFinished(v)}))):(t.queue(v,t.createRecord(v,{type:t.ContentType.handshake,data:t.createCertificate(v)}
14)),v.fail||(t.queue(v,t.createRecord(v,{type:t.ContentType.handshake,data:t.createServerKeyExchange(v)})),v.verifyClient!==!1&&t.queue(v,t.createRecord(v,{type:t.ContentType.handshake,data:t.createCertificateRequest(v)})),t.queue(v,t.createRecord(v,{type:t.ContentType.handshake,data:t.createServerHelloDone(v)})))),t.flush(v),v.process()}},t.handleCertificate=function(v,U,L){if(L<3)return v.error(v,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.illegal_parameter}});var N=U.fragment,o={certificate_list:T(N,3)},R,O,q=[];try{for(;o.certificate_list.length()>0;)R=T(o.certificate_list,3),O=a.asn1.fromDer(R),R=a.pki.certificateFromAsn1(O,!0),q.push(R)}catch(ie){return v.error(v,{message:"Could not parse certificate list.",cause:ie,send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.bad_certificate}})}var te=v.entity===t.ConnectionEnd.client;(te||v.verifyClient===!0)&&q.length===0?v.error(v,{message:te?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.illegal_parameter}}):q.length===0?v.expect=te?S:d:(te?v.session.serverCertificate=q[0]:v.session.clientCertificate=q[0],t.verifyCertificateChain(v,q)&&(v.expect=te?S:d)),v.process()},t.handleServerKeyExchange=function(v,U,L){if(L>0)return v.error(v,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.unsupported_certificate}});v.expect=_,v.process()},t.handleClientKeyExchange=function(v,U,L){if(L<48)return v.error(v,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.unsupported_certificate}});var N=U.fragment,o={enc_pre_master_secret:T(N,2).getBytes()},R=null;if(v.getPrivateKey)try{R=v.getPrivateKey(v,v.session.serverCertificate),R=a.pki.privateKeyFromPem(R)}catch(te){v.error(v,{message:"Could not get private key.",cause:te,send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.internal_error}})}if(R===null)return v.error(v,{message:"No private key set.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.internal_error}});try{var O=v.session.sp;O.pre_master_secret=R.decrypt(o.enc_pre_master_secret);var q=v.session.clientHelloVersion;if(q.major!==O.pre_master_secret.charCodeAt(0)||q.minor!==O.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.")}catch{O.pre_master_secret=a.random.getBytes(48)}v.expect=D,v.session.clientCertificate!==null&&(v.expect=A),v.process()},t.handleCertificateRequest=function(v,U,L){if(L<3)return v.error(v,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.illegal_parameter}});var N=U.fragment,o={certificate_types:T(N,1),certificate_authorities:T(N,2)};v.session.certificateRequest=o,v.expect=E,v.process()},t.handleCertificateVerify=function(v,U,L){if(L<2)return v.error(v,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.illegal_parameter}});var N=U.fragment;N.read-=4;var o=N.bytes();N.read+=4;var R={signature:T(N,2).getBytes()},O=a.util.createBuffer();O.putBuffer(v.session.md5.digest()),O.putBuffer(v.session.sha1.digest()),O=O.getBytes();try{if(!v.session.clientCertificate.publicKey.verify(O,R.signature,"NONE"))throw Error("CertificateVerify signature does not match.");v.session.md5.update(o),v.session.sha1.update(o)}catch{return v.error(v,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.handshake_failure}})}v.expect=D,v.process()},t.handleServerHelloDone=function(v,U,L){if(L>0)return v.error(v,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.record_overflow}});if(v.serverCertificate===null){var N={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.insufficient_security}}
14,o=v.verify(v,N.alert.description,0,[]);if(o!==!0)return(o||o===0)&&(typeof o=="object"&&!a.util.isArray(o)?(o.message&&(N.message=o.message),o.alert&&(N.alert.description=o.alert)):typeof o=="number"&&(N.alert.description=o)),v.error(v,N)}v.session.certificateRequest!==null&&(U=t.createRecord(v,{type:t.ContentType.handshake,data:t.createCertificate(v)}),t.queue(v,U)),U=t.createRecord(v,{type:t.ContentType.handshake,data:t.createClientKeyExchange(v)}),t.queue(v,U),v.expect=m;var R=function(O,q){O.session.certificateRequest!==null&&O.session.clientCertificate!==null&&t.queue(O,t.createRecord(O,{type:t.ContentType.handshake,data:t.createCertificateVerify(O,q)})),t.queue(O,t.createRecord(O,{type:t.ContentType.change_cipher_spec,data:t.createChangeCipherSpec()})),O.state.pending=t.createConnectionState(O),O.state.current.write=O.state.pending.write,t.queue(O,t.createRecord(O,{type:t.ContentType.handshake,data:t.createFinished(O)})),O.expect=u,t.flush(O),O.process()};if(v.session.certificateRequest===null||v.session.clientCertificate===null)return R(v,null);t.getClientSignature(v,R)},t.handleChangeCipherSpec=function(v,U){if(U.fragment.getByte()!==1)return v.error(v,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.illegal_parameter}});var L=v.entity===t.ConnectionEnd.client;(v.session.resuming&&L||!v.session.resuming&&!L)&&(v.state.pending=t.createConnectionState(v)),v.state.current.read=v.state.pending.read,(!v.session.resuming&&L||v.session.resuming&&!L)&&(v.state.pending=null),v.expect=L?h:l,v.process()},t.handleFinished=function(v,U,L){var N=U.fragment;N.read-=4;var o=N.bytes();N.read+=4;var R=U.fragment.getBytes();N=a.util.createBuffer(),N.putBuffer(v.session.md5.digest()),N.putBuffer(v.session.sha1.digest());var O=v.entity===t.ConnectionEnd.client,q=O?"server finished":"client finished",te=v.session.sp;if(N=e(te.master_secret,q,N.getBytes(),12),N.getBytes()!==R)return v.error(v,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.decrypt_error}});v.session.md5.update(o),v.session.sha1.update(o),(v.session.resuming&&O||!v.session.resuming&&!O)&&(t.queue(v,t.createRecord(v,{type:t.ContentType.change_cipher_spec,data:t.createChangeCipherSpec()})),v.state.current.write=v.state.pending.write,v.state.pending=null,t.queue(v,t.createRecord(v,{type:t.ContentType.handshake,data:t.createFinished(v)}))),v.expect=O?C:n,v.handshaking=!1,++v.handshakes,v.peerCertificate=O?v.session.serverCertificate:v.session.clientCertificate,t.flush(v),v.isConnected=!0,v.connected(v),v.process()},t.handleAlert=function(v,U){var L=U.fragment,N={level:L.getByte(),description:L.getByte()},o;switch(N.description){case t.Alert.Description.close_notify:o="Connection closed.";break;case t.Alert.Description.unexpected_message:o="Unexpected message.";break;case t.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case t.Alert.Description.decryption_failed:o="Decryption failed.";break;case t.Alert.Description.record_overflow:o="Record overflow.";break;case t.Alert.Description.decompression_failure:o="Decompression failed.";break;case t.Alert.Description.handshake_failure:o="Handshake failure.";break;case t.Alert.Description.bad_certificate:o="Bad certificate.";break;case t.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case t.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case t.Alert.Description.certificate_expired:o="Certificate expired.";break;case t.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case t.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case t.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case t.Alert.Description.access_denied:o="Access denied.";break;case t.Alert.Description.decode_error:o="Decode error.";break;case t.Alert.Description.decrypt_error:o="Decrypt error.";break;case t.Alert.Description.export_restriction:o="Export restriction.";break;case t.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case t.Alert.Description.insufficient_security:o="Insufficient security.";break;case t.Alert.Description.internal_error:o="Internal error.";break;case t.Alert.Description.user_canceled:o="User canceled.";break;case t.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(N.description===t.Alert.Description.close_notify)return v.close();v.error(v,{message:o,send:!1,origin:v.entity===t.ConnectionEnd.client?"server"
vendor: 8,762 bytes, line 14
14:"client",alert:N}),v.process()},t.handleHandshake=function(v,U){var L=U.fragment,N=L.getByte(),o=L.getInt24();if(o>L.length())return v.fragmented=U,U.fragment=a.util.createBuffer(),L.read-=4,v.process();v.fragmented=null,L.read-=4;var R=L.bytes(o+4);L.read+=4,N in de[v.entity][v.expect]?(v.entity===t.ConnectionEnd.server&&!v.open&&!v.fail&&(v.handshaking=!0,v.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),N!==t.HandshakeType.hello_request&&N!==t.HandshakeType.certificate_verify&&N!==t.HandshakeType.finished&&(v.session.md5.update(R),v.session.sha1.update(R)),de[v.entity][v.expect][N](v,U,o)):t.handleUnexpected(v,U)},t.handleApplicationData=function(v,U){v.data.putBuffer(U.fragment),v.dataReady(v),v.process()},t.handleHeartbeat=function(v,U){var L=U.fragment,N=L.getByte(),o=L.getInt16(),R=L.getBytes(o);if(N===t.HeartbeatMessageType.heartbeat_request){if(v.handshaking||o>R.length)return v.process();t.queue(v,t.createRecord(v,{type:t.ContentType.heartbeat,data:t.createHeartbeat(t.HeartbeatMessageType.heartbeat_response,R)})),t.flush(v)}else if(N===t.HeartbeatMessageType.heartbeat_response){if(R!==v.expectedHeartbeatPayload)return v.process();v.heartbeatReceived&&v.heartbeatReceived(v,a.util.createBuffer(R))}v.process()};var g=0,c=1,S=2,_=3,E=4,u=5,h=6,C=7,m=8,s=0,p=1,d=2,A=3,D=4,l=5,n=6,r=t.handleUnexpected,b=t.handleChangeCipherSpec,w=t.handleAlert,V=t.handleHandshake,K=t.handleApplicationData,x=t.handleHeartbeat,F=[];F[t.ConnectionEnd.client]=[[r,w,V,r,x],[r,w,V,r,x],[r,w,V,r,x],[r,w,V,r,x],[r,w,V,r,x],[b,w,r,r,x],[r,w,V,r,x],[r,w,V,K,x],[r,w,V,r,x]],F[t.ConnectionEnd.server]=[[r,w,V,r,x],[r,w,V,r,x],[r,w,V,r,x],[r,w,V,r,x],[b,w,r,r,x],[r,w,V,r,x],[r,w,V,K,x],[r,w,V,r,x]];var G=t.handleHelloRequest,H=t.handleServerHello,Z=t.handleCertificate,Y=t.handleServerKeyExchange,ee=t.handleCertificateRequest,ue=t.handleServerHelloDone,se=t.handleFinished,de=[];de[t.ConnectionEnd.client]=[[r,r,H,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[G,r,r,r,r,r,r,r,r,r,r,Z,Y,ee,ue,r,r,r,r,r,r],[G,r,r,r,r,r,r,r,r,r,r,r,Y,ee,ue,r,r,r,r,r,r],[G,r,r,r,r,r,r,r,r,r,r,r,r,ee,ue,r,r,r,r,r,r],[G,r,r,r,r,r,r,r,r,r,r,r,r,r,ue,r,r,r,r,r,r],[G,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[G,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,se],[G,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[G,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r]];var me=t.handleClientHello,fe=t.handleClientKeyExchange,X=t.handleCertificateVerify;de[t.ConnectionEnd.server]=[[r,me,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,Z,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,fe,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,X,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,se],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r]],t.generateKeys=function(v,U){var L=e,N=U.client_random+U.server_random;v.session.resuming||(U.master_secret=L(U.pre_master_secret,"master secret",N,48).bytes(),U.pre_master_secret=null),N=U.server_random+U.client_random;var o=2*U.mac_key_length+2*U.enc_key_length,R=v.version.major===t.Versions.TLS_1_0.major&&v.version.minor===t.Versions.TLS_1_0.minor;R&&(o+=2*U.fixed_iv_length);var O=L(U.master_secret,"key expansion",N,o),q={client_write_MAC_key:O.getBytes(U.mac_key_length),server_write_MAC_key:O.getBytes(U.mac_key_length),client_write_key:O.getBytes(U.enc_key_length),server_write_key:O.getBytes(U.enc_key_length)};return R&&(q.client_write_IV=O.getBytes(U.fixed_iv_length),q.server_write_IV=O.getBytes(U.fixed_iv_length)),q},t.createConnectionState=function(v){var U=v.entity===t.ConnectionEnd.client,L=function(){var R={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(O){return!0},compressionState:null,compressFunction:function(O){return!0},updateSequenceNumber:function(){R.sequenceNumber[1]===4294967295?(R.sequenceNumber[1]=0,++R.sequenceNumber[0]):++R.sequenceNumber[1]}};return R},N={read:L(),write:L()};if(N.read.update=function(R,O){return N.read.cipherFunction(O,N.read)?N.read.compressFunction(R,O,N.read)||R.error(R,{message:"Could not decompress record.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.decompression_failure}}):R.error(R,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.bad_record_mac}}),!R.fail},N.write.update=function(R,O){return N.write.compressFunction(R,O,N.write)?N.write.cipherFunction(O,N.write)||R.error(R,{message:"Could not encrypt record.",send:!1,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.internal_error}}):R.error(R,{message:"Could not compress record.",send:!1,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.internal_error}}),!R.fail},v.session){var o=v.session.sp;switch(v.session.cipherSuite.initSecurityParameters(o),o.keys=t.generateKeys(v,o),N.read.macKey=U?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,N.write.macKey=U?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,v.session.cipherSuite.initConnectionState(N,v,o),o.compression_algorithm){case t.CompressionMethod.none:break;case t.CompressionMethod.deflate:N.read.compressFunction=k,N.write.compressFunction=y;break;default:throw Error("Unsupported compression algorithm.")}}return N},t.createRandom=function(){var v=new Date,U=+v+v.getTimezoneOffset()*6e4,L=a.util.createBuffer();return L.putInt32(U),L.putBytes(a.random.getBytes(28)),L},t.createRecord=function(v,U){return U.data?{type:U.type,version:{major:v.version.major,minor:v.version.minor},length:U.data.length(),fragment:U.data}:null},t.createAlert=function(v,U){var L=a.util.createBuffer();return L.putByte(U.level),L.putByte(U.description),t.createRecord(v,{type:t.ContentType.alert,data:L})},t.createClientHello=function(v){v.session.clientHelloVersion={major:v.version.major,minor:v.version.minor};for(var U=a.util.createBuffer(),L=0;L<v.cipherSuites.length;++L){var N=v.cipherSuites[L];U.putByte(N.id[0]),U.putByte(N.id[1])}var o=U.length(),R=a.util.createBuffer();R.putByte(t.CompressionMethod.none);var O=R.length(),q=a.util.createBuffer();if(v.virtualHost){var te=a.util.createBuffer();te.putByte(0),te.putByte(0);var ie=a.util.createBuffer();ie.putByte(0),f(ie,2,a.util.createBuffer(v.virtualHost));var j=a.util.createBuffer();f(j,2,ie),f(te,2,j),q.putBuffer(te)}var J=q.length();J>0&&(J+=2);var ne=v.session.id,he=ne.length+1+2+4+28+2+o+1+O+J,pe=a.util.createBuffer();return pe.putByte(t.HandshakeType.client_hello),pe.putInt24(he),pe.putByte(v.version.major),pe.putByte(v.version.minor),pe.putBytes(v.session.sp.client_random),f(pe,1,a.util.createBuffer(ne)),f(pe,2,U),f(pe,1,R),J>0&&f(pe,2,q),pe},t.createServerHello=function(v){var U=v.session.id,L=U.length+1+2+4+28+2+1,N=a.util.createBuffer();return N.putByte(t.HandshakeType.server_hello),N.putInt24(L),N.putByte(v.version.major),N.putByte(v.version.minor),N.putBytes(v.session.sp.server_random),f(N,1,a.util.createBuffer(U)),N.putByte(v.session.cipherSuite.id[0]),N.putByte(v.session.cipherSuite.id[1]),N.putByte(v.session.compressionMethod),N},t.createCertificate=function(v){var U=v.entity===t.ConnectionEnd.client,L=null;if(v.getCertificate){var N=U?v.session.certificateRequest:v.session.extensions.server_name.serverNameList;L=v.getCertificate(v,N)}var o=a.util.createBuffer();if(L!==null)try{a.util.isArray(L)||(L=[L]);for(var R=null,O=0;O<L.length;++O){var q=a.pem.decode(L[O])[0];if(q.type!=="CERTIFICATE"&&q.type!=="X509 CERTIFICATE"&&q.type!=="TRUSTED CERTIFICATE"){var te=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw te.headerType=q.type,te}if(q.procType&&q.procType.type==="ENCRYPTED")throw Error("Could not convert certificate from PEM; PEM is encrypted.");var ie=a.util.createBuffer(q.body);R===null&&(R=a.asn1.fromDer(ie.bytes(),!1));var j=a.util.createBuffer();f(j,3,ie),o.putBuffer(j)}L=a.pki.certificateFromAsn1(R),U?v.session.clientCertificate=L:v.session.serverCertificate=L}catch(he){return v.error(v,{message:"Could not send certificate list.",cause:he,send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.bad_certificate}})}var J=3+o.length(),ne=a.util.createBuffer();return ne.putByte(t.HandshakeType.certificate),ne.putInt24(J),f(ne,3,o),ne},t.createClientKeyExchange=function(v){var U=a.util.createBuffer();U.putByte(v.session.clientHelloVersion.major),U.putByte(v.session.clientHelloVersion.minor),U.putBytes(a.random.getBytes(46));var L=v.session.sp;L.pre_master_secret=U.getBytes(),U=v.session.serverCertificate.publicKey.encrypt
14(L.pre_master_secret);var N=U.length+2,o=a.util.createBuffer();return o.putByte(t.HandshakeType.client_key_exchange),o.putInt24(N),o.putInt16(U.length),o.putBytes(U),o},t.createServerKeyExchange=function(v){var U=a.util.createBuffer();return U},t.getClientSignature=function(v,U){var L=a.util.createBuffer();L.putBuffer(v.session.md5.digest()),L.putBuffer(v.session.sha1.digest()),L=L.getBytes(),v.getSignature=v.getSignature||function(N,o,R){var O=null;if(N.getPrivateKey)try{O=N.getPrivateKey(N,N.session.clientCertificate),O=a.pki.privateKeyFromPem(O)}catch(q){N.error(N,{message:"Could not get private key.",cause:q,send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.internal_error}})}O===null?N.error(N,{message:"No private key set.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.internal_error}}):o=O.sign(o,null),R(N,o)},v.getSignature(v,L,U)},t.createCertificateVerify=function(v,U){var L=U.length+2,N=a.util.createBuffer();return N.putByte(t.HandshakeType.certificate_verify),N.putInt24(L),N.putInt16(U.length),N.putBytes(U),N},t.createCertificateRequest=function(v){var U=a.util.createBuffer();U.putByte(1);var L=a.util.createBuffer();for(var N in v.caStore.certs){var o=v.caStore.certs[N],R=a.pki.distinguishedNameToAsn1(o.subject),O=a.asn1.toDer(R);L.putInt16(O.length()),L.putBuffer(O)}var q=1+U.length()+2+L.length(),te=a.util.createBuffer();return te.putByte(t.HandshakeType.certificate_request),te.putInt24(q),f(te,1,U),f(te,2,L),te},t.createServerHelloDone=function(v){var U=a.util.createBuffer();return U.putByte(t.HandshakeType.server_hello_done),U.putInt24(0),U},t.createChangeCipherSpec=function(){var v=a.util.createBuffer();return v.putByte(1),v},t.createFinished=function(v){var U=a.util.createBuffer();U.putBuffer(v.session.md5.digest()),U.putBuffer(v.session.sha1.digest());var L=v.entity===t.ConnectionEnd.client,N=v.session.sp,o=12,R=e,O=L?"client finished":"server finished";U=R(N.master_secret,O,U.getBytes(),o);var q=a.util.createBuffer();return q.putByte(t.HandshakeType.finished),q.putInt24(U.length()),q.putBuffer(U),q},t.createHeartbeat=function(v,U,L){L===void 0&&(L=U.length);var N=a.util.createBuffer();N.putByte(v),N.putInt16(L),N.putBytes(U);var o=N.length(),R=Math.max(16,o-L-3);return N.putBytes(a.random.getBytes(R)),N},t.queue=function(v,U){if(U&&!(U.fragment.length()===0&&(U.type===t.ContentType.handshake||U.type===t.ContentType.alert||U.type===t.ContentType.change_cipher_spec))){if(U.type===t.ContentType.handshake){var L=U.fragment.bytes();v.session.md5.update(L),v.session.sha1.update(L),L=null}var N;if(U.fragment.length()<=t.MaxFragment)N=[U];else{N=[];for(var o=U.fragment.bytes();o.length>t.MaxFragment;)N.push(t.createRecord(v,{type:U.type,data:a.util.createBuffer(o.slice(0,t.MaxFragment))})),o=o.slice(t.MaxFragment);o.length>0&&N.push(t.createRecord(v,{type:U.type,data:a.util.createBuffer(o)}))}for(var R=0;R<N.length&&!v.fail;++R){var O=N[R];v.state.current.write.update(v,O)&&v.records.push(O)}}},t.flush=function(v){for(var U=0;U<v.records.length;++U){var L=v.records[U];v.tlsData.putByte(L.type),v.tlsData.putByte(L.version.major),v.tlsData.putByte(L.version.minor),v.tlsData.putInt16(L.fragment.length()),v.tlsData.putBuffer(v.records[U].fragment)}return v.records=[],v.tlsDataReady(v)};var ae=function(v){switch(v){case!0:return!0;case a.pki.certificateError.bad_certificate:return t.Alert.Description.bad_certificate;case a.pki.certificateError.unsupported_certificate:return t.Alert.Description.unsupported_certificate;case a.pki.certificateError.certificate_revoked:return t.Alert.Description.certificate_revoked;case a.pki.certificateError.certificate_expired:return t.Alert.Description.certificate_expired;case a.pki.certificateError.certificate_unknown:return t.Alert.Description.certificate_unknown;case a.pki.certificateError.unknown_ca:return t.Alert.Description.unknown_ca;default:return t.Alert.Description.bad_certificate}},ze=function(v){switch(v){case!0:return!0;case t.Alert.Description.bad_certificate:return a.pki.certificateError.bad_certificate;case t.Alert.Description.unsupported_certificate:return a.pki.certificateError.unsupported_certificate;case t.Alert.Description.certificate_revoked:return a.pki.certificateError.certificate_revoked;case t.Alert.Description.certificate_expired:return a.pki.certificateError.certificate_expired;case t.Alert.Description.certificate_unknown:return a.pki.certificateError.certificate_unknown;case t.Alert.Description.unknown_ca:return a.pki.certificateError.unknown_ca;default:return a.pki.certificateError.bad_certificate}};for(var qe in t.verifyCertificateChain=function(v,U){try{var L={};for(var N in v.verifyOptions)L[N]=v.verifyOptions[N];L.verify=function(R,O,q){ae(R);var te=v.verify(v,R,O,q);if(te!==!0){if(typeof te=="object"&&!a.util.isArray(te)){var ie=Error("The application rejected the certificate.");throw ie.send=!0,ie.alert={level:t.Alert.Level.fatal,description:t.Alert.Description.bad_certificate},te.message&&(ie.message=te.message),te.alert&&(ie.alert.description=te.alert),ie}te!==R&&(te=ze(te))}return te},a.pki.verifyCertificateChain(v.caStore,U,L)}catch(R){var o=R;(typeof o!="object"||a.util.isArray(o))&&(o={send:!0,alert:{level:t.Alert.Level.fatal,description:ae(R)}}),"send"in o||(o.send=!0),"alert"in o||(o.alert={level:t.Alert.Level.fatal,description:ae(o.error)}),v.error(v,o)}return!v.fail},t.createSessionCache=function(v,U){var L=null;if(v&&v.getSession&&v.setSession&&v.order)L=v;else{for(var N in L={},L.cache=v||{},L.capacity=Math.max(U||100,1),L.order=[],v)L.order.length<=U?L.order.push(N):delete v[N];L.getSession=function(o){var R=null,O=null;if(o?O=a.util.bytesToHex(o):L.order.length>0&&(O=L.order[0]),O!==null&&O in L.cache){for(var q in R=L.cache[O],delete L.cache[O],L.order)if(L.order[q]===O){L.order.splice(q,1);break}}return R},L.setSession=function(o,R){if(L.order.length===L.capacity){var O=L.order.shift();delete L.cache[O]}var O=a.util.bytesToHex(o);L.order.push(O),L.cache[O]=R}}return L},t.createConnection=function(v){var U=null;U=v.caStore?a.util.isArray(v.caStore)?a.pki.createCaStore(v.caStore):v.caStore:a.pki.createCaStore();var L=v.cipherSuites||null;if(L===null)for(var N in L=[],t.CipherSuites)L.push(t.CipherSuites[N]);var o=v.server?t.ConnectionEnd.server:t.ConnectionEnd.client,R=v.sessionCache?t.createSessionCache(v.sessionCache):null,O={version:{major:t.Version.major,minor:t.Version.minor},entity:o,sessionId:v.sessionId,caStore:U,sessionCache:R,cipherSuites:L,connected:v.connected,virtualHost:v.virtualHost||null,verifyClient:v.verifyClient||!1,verify:v.verify||function(j,J,ne,he){return J},verifyOptions:v.verifyOptions||{},getCertificate:v.getCertificate||null,getPrivateKey:v.getPrivateKey||null,getSignature:v.getSignature||null,input:a.util.createBuffer(),tlsData:a.util.createBuffer(),data:a.util.createBuffer(),tlsDataReady:v.tlsDataReady,dataReady:v.dataReady,heartbeatReceived:v.heartbeatReceived,closed:v.closed,error:function(j,J){J.origin=J.origin||(j.entity===t.ConnectionEnd.client?"client":"server"),J.send&&(t.queue(j,t.createAlert(j,J.alert)),t.flush(j));var ne=J.fatal!==!1;ne&&(j.fail=!0),v.error(j,J),ne&&j.close(!1)},deflate:v.deflate||null,inflate:v.inflate||null};O.reset=function(j){O.version={major:t.Version.major,minor:t.Version.minor},O.record=null,O.session=null,O.peerCertificate=null,O.state={pending:null,current:null},O.expect=O.entity===t.ConnectionEnd.client?g:s,O.fragmented=null,O.records=[],O.open=!1,O.handshakes=0,O.handshaking=!1,O.isConnected=!1,O.fail=!(j||j===void 0),O.input.clear(),O.tlsData.clear(),O.data.clear(),O.state.current=t.createConnectionState(O)},O.reset();var q=function(j,J){var ne=J.type-t.ContentType.change_cipher_spec,he=F[j.entity][j.expect];ne in he?he[ne](j,J):t.handleUnexpected(j,J)},te=function(j){var J=0,ne=j.input,he=ne.length();if(he<5)J=5-he;else{j.record={type:ne.getByte(),version:{major:ne.getByte(),minor:ne.getByte()},length:ne.getInt16(),fragment:a.util.createBuffer(),ready:!1};var pe=j.record.version.major===j.version.major;pe&&j.session&&j.session.version&&(pe=j.record.version.minor===j.version.minor),pe||j.error(j,{message:"Incompatible TLS version.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.protocol_version}})}return J},ie=function(j){var J=0,ne=j.input,he=ne.length();return he<j.record.length?J=j.record.length-he:(j.record.fragment.putBytes(ne.getBytes(j.record.length)),ne.compact(),j.state.current.read.update(j,j.record)&&(j.fragmented!==null&&(j.fragmented.type===j.record.type?(j.fragmented.fragment.putBuffer(j.record.fragment),j.record=j.fragmented):j.error(j,{message:"Invalid fragmented record.",send:!0,alert:{level:t.Alert.Level.fatal,description:t.Alert.Description.unexpected_message}})),j.record.ready=!0)),J};return O.handshake=function(j){if(O.entity!==t.ConnectionEnd.client)O.error(O,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(O.handshaking)O.error(O,{message:"Handshake already in progress.",fatal:!1});else{O.fail&&!O.open&&O.handshakes===0&&(O.fail=!1),O.handshaking=!0,j||(j="");var J=null;j.length>0&&(O.sessionCache&&(J=O.sessionCache.getSession(j)),J===null&&(j="")),j.length===0&&O.sessionCache&&(J=O.sessionCache.getSession(),J!==null&&(j=J.id)),O.session={id:j,version:null,cipherSuite:null,compressionMethod:null,
14serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:a.md.md5.create(),sha1:a.md.sha1.create()},J&&(O.version=J.version,O.session.sp=J.sp),O.session.sp.client_random=t.createRandom().getBytes(),O.open=!0,t.queue(O,t.createRecord(O,{type:t.ContentType.handshake,data:t.createClientHello(O)})),t.flush(O)}},O.process=function(j){var J=0;return j&&O.input.putBytes(j),O.fail||(O.record!==null&&O.record.ready&&O.record.fragment.isEmpty()&&(O.record=null),O.record===null&&(J=te(O)),!O.fail&&O.record!==null&&!O.record.ready&&(J=ie(O)),!O.fail&&O.record!==null&&O.record.ready&&q(O,O.record)),J},O.prepare=function(j){return t.queue(O,t.createRecord(O,{type:t.ContentType.application_data,data:a.util.createBuffer(j)})),t.flush(O)},O.prepareHeartbeatRequest=function(j,J){return j instanceof a.util.ByteBuffer&&(j=j.bytes()),J===void 0&&(J=j.length),O.expectedHeartbeatPayload=j,t.queue(O,t.createRecord(O,{type:t.ContentType.heartbeat,data:t.createHeartbeat(t.HeartbeatMessageType.heartbeat_request,j,J)})),t.flush(O)},O.close=function(j){if(!O.fail&&O.sessionCache&&O.session){var J={id:O.session.id,version:O.session.version,sp:O.session.sp};J.sp.keys=null,O.sessionCache.setSession(J.id,J)}O.open&&(O.open=!1,O.input.clear(),(O.isConnected||O.handshaking)&&(O.isConnected=O.handshaking=!1,t.queue(O,t.createAlert(O,{level:t.Alert.Level.warning,description:t.Alert.Description.close_notify})),t.flush(O)),O.closed(O)),O.reset(j)},O},W.exports=a.tls=a.tls||{},t)typeof t[qe]!="function"&&(a.tls[qe]=t[qe]);a.tls.prf_tls1=e,a.tls.hmac_sha1=i,a.tls.createSessionCache=t.createSessionCache,a.tls.createConnection=t.createConnection})),lr=ce(((oe,W)=>{var a=le();pt(),qt();var e=W.exports=a.tls;e.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(g){g.bulk_cipher_algorithm=e.BulkCipherAlgorithm.aes,g.cipher_type=e.CipherType.block,g.enc_key_length=16,g.block_length=16,g.fixed_iv_length=16,g.record_iv_length=16,g.mac_algorithm=e.MACAlgorithm.hmac_sha1,g.mac_length=20,g.mac_key_length=20},initConnectionState:i},e.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(g){g.bulk_cipher_algorithm=e.BulkCipherAlgorithm.aes,g.cipher_type=e.CipherType.block,g.enc_key_length=32,g.block_length=16,g.fixed_iv_length=16,g.record_iv_length=16,g.mac_algorithm=e.MACAlgorithm.hmac_sha1,g.mac_length=20,g.mac_key_length=20},initConnectionState:i};function i(g,c,S){var _=c.entity===a.tls.ConnectionEnd.client;g.read.cipherState={init:!1,cipher:a.cipher.createDecipher("AES-CBC",_?S.keys.server_write_key:S.keys.client_write_key),iv:_?S.keys.server_write_IV:S.keys.client_write_IV},g.write.cipherState={init:!1,cipher:a.cipher.createCipher("AES-CBC",_?S.keys.client_write_key:S.keys.server_write_key),iv:_?S.keys.client_write_IV:S.keys.server_write_IV},g.read.cipherFunction=f,g.write.cipherFunction=y,g.read.macLength=g.write.macLength=S.mac_length,g.read.macFunction=g.write.macFunction=e.hmac_sha1}function y(g,c){var S=!1,_=c.macFunction(c.macKey,c.sequenceNumber,g);g.fragment.putBytes(_),c.updateSequenceNumber();var E=g.version.minor===e.Versions.TLS_1_0.minor?c.cipherState.init?null:c.cipherState.iv:a.random.getBytesSync(16);c.cipherState.init=!0;var u=c.cipherState.cipher;return u.start({iv:E}),g.version.minor>=e.Versions.TLS_1_1.minor&&u.output.putBytes(E),u.update(g.fragment),u.finish(k)&&(g.fragment=u.output,g.length=g.fragment.length(),S=!0),S}function k(g,c,S){if(!S){var _=g-c.length()%g;c.fillWithByte(_-1,_)}return!0}function T(g,c,S){var _=!0;if(S){for(var E=c.length(),u=c.last(),h=E-1-u;h<E-1;++h)_&&(_=c.at(h)==u);_&&c.truncate(u+1)}return _}function f(g,c){var S=!1,_=g.version.minor===e.Versions.TLS_1_0.minor?c.cipherState.init?null:c.cipherState.iv:g.fragment.getBytes(16);c.cipherState.init=!0;var E=c.cipherState.cipher;E.start({iv:_}),E.update(g.fragment),S=E.finish(T);var u=c.macLength,h=a.random.getBytesSync(u),C=E.output.length();C>=u?(g.fragment=E.output.getBytes(C-u),h=E.output.getBytes(u)):g.fragment=E.output.getBytes(),g.fragment=a.util.createBuffer(g.fragment),g.length=g.fragment.length();var m=c.macFunction(c.macKey,c.sequenceNumber,g);return c.updateSequenceNumber(),S=t(c.macKey,h,m)&&S,S}function t(g,c,S){var _=a.hmac.create();return _.start("SHA1",g),_.update(c),c=_.digest().getBytes(),_.start(null,null),_.update(S),S=_.digest().getBytes(),c===S}})),jt=ce(((oe,W)=>{var a=le();ut(),ye();var e=W.exports=a.sha512=a.sha512||{};a.md.sha512=a.md.algorithms.sha512=e;var i=a.sha384=a.sha512.sha384=a.sha512.sha384||{};i.create=function(){return e.create("SHA-384")},a.md.sha384=a.md.algorithms.sha384=i,a.sha512.sha256=a.sha512.sha256||{create:function(){return e.create("SHA-512/256")}},a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256,a.sha512.sha224=a.sha512.sha224||{create:function(){return e.create("SHA-512/224")}},a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224,e.create=function(c){if(k||t(),c===void 0&&(c="SHA-512"),!(c in f))throw Error("Invalid SHA-512 algorithm: "+c);for(var S=f[c],_=null,E=a.util.createBuffer(),u=Array(80),h=0;h<80;++h)u[h]=[,,];var C=64;switch(c){case"SHA-384":C=48;break;case"SHA-512/256":C=32;break;case"SHA-512/224":C=28;break}var m={algorithm:c.replace("-","").toLowerCase(),blockLength:128,digestLength:C,messageLength:0,fullMessageLength:null,messageLengthSize:16};return m.start=function(){m.messageLength=0,m.fullMessageLength=m.messageLength128=[];for(var s=m.messageLengthSize/4,p=0;p<s;++p)m.fullMessageLength.push(0);E=a.util.createBuffer(),_=Array(S.length);for(var p=0;p<S.length;++p)_[p]=S[p].slice(0);return m},m.start(),m.update=function(s,p){p==="utf8"&&(s=a.util.encodeUtf8(s));var d=s.length;m.messageLength+=d,d=[d/4294967296>>>0,d>>>0];for(var A=m.fullMessageLength.length-1;A>=0;--A)m.fullMessageLength[A]+=d[1],d[1]=d[0]+(m.fullMessageLength[A]/4294967296>>>0),m.fullMessageLength[A]=m.fullMessageLength[A]>>>0,d[0]=d[1]/4294967296>>>0;return E.putBytes(s),g(_,u,E),(E.read>2048||E.length()===0)&&E.compact(),m},m.digest=function(){var s=a.util.createBuffer();s.putBytes(E.bytes());var p=m.fullMessageLength[m.fullMessageLength.length-1]+m.messageLengthSize&m.blockLength-1;s.putBytes(y.substr(0,m.blockLength-p));for(var d,A,D=m.fullMessageLength[0]*8,l=0;l<m.fullMessageLength.length-1;++l)d=m.fullMessageLength[l+1]*8,A=d/4294967296>>>0,D+=A,s.putInt32(D>>>0),D=d>>>0;s.putInt32(D);for(var n=Array(_.length),l=0;l<_.length;++l)n[l]=_[l].slice(0);g(n,u,s);for(var r=a.util.createBuffer(),b=c==="SHA-512"?n.length:c==="SHA-384"?n.length-2:n.length-4,l=0;l<b;++l)r.putInt32(n[l][0]),(l!==b-1||c!=="SHA-512/224")&&r.putInt32(n[l][1]);return r},m};var y=null,k=!1,T=null,f=null;function t(){y="€",y+=a.util.fillString("\0",128),T=[[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]],f={},f["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],f["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],f["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,28279439
1407],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],f["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],k=!0}function g(c,S,_){for(var E,u,h,C,m,s,p,d,A,D,l,n,r,b,w,V,K,x,F,G,H,Z,Y,ee,ue,se,de,me,fe,X,ae,ze,qe,v,U,L=_.length();L>=128;){for(fe=0;fe<16;++fe)S[fe][0]=_.getInt32()>>>0,S[fe][1]=_.getInt32()>>>0;for(;fe<80;++fe)ze=S[fe-2],X=ze[0],ae=ze[1],E=((X>>>19|ae<<13)^(ae>>>29|X<<3)^X>>>6)>>>0,u=((X<<13|ae>>>19)^(ae<<3|X>>>29)^(X<<26|ae>>>6))>>>0,v=S[fe-15],X=v[0],ae=v[1],h=((X>>>1|ae<<31)^(X>>>8|ae<<24)^X>>>7)>>>0,C=((X<<31|ae>>>1)^(X<<24|ae>>>8)^(X<<25|ae>>>7))>>>0,qe=S[fe-7],U=S[fe-16],ae=u+qe[1]+C+U[1],S[fe][0]=E+qe[0]+h+U[0]+(ae/4294967296>>>0)>>>0,S[fe][1]=ae>>>0;for(r=c[0][0],b=c[0][1],w=c[1][0],V=c[1][1],K=c[2][0],x=c[2][1],F=c[3][0],G=c[3][1],H=c[4][0],Z=c[4][1],Y=c[5][0],ee=c[5][1],ue=c[6][0],se=c[6][1],de=c[7][0],me=c[7][1],fe=0;fe<80;++fe)p=((H>>>14|Z<<18)^(H>>>18|Z<<14)^(Z>>>9|H<<23))>>>0,d=((H<<18|Z>>>14)^(H<<14|Z>>>18)^(Z<<23|H>>>9))>>>0,A=(ue^H&(Y^ue))>>>0,D=(se^Z&(ee^se))>>>0,m=((r>>>28|b<<4)^(b>>>2|r<<30)^(b>>>7|r<<25))>>>0,s=((r<<4|b>>>28)^(b<<30|r>>>2)^(b<<25|r>>>7))>>>0,l=(r&w|K&(r^w))>>>0,n=(b&V|x&(b^V))>>>0,ae=me+d+D+T[fe][1]+S[fe][1],E=de+p+A+T[fe][0]+S[fe][0]+(ae/4294967296>>>0)>>>0,u=ae>>>0,ae=s+n,h=m+l+(ae/4294967296>>>0)>>>0,C=ae>>>0,de=ue,me=se,ue=Y,se=ee,Y=H,ee=Z,ae=G+u,H=F+E+(ae/4294967296>>>0)>>>0,Z=ae>>>0,F=K,G=x,K=w,x=V,w=r,V=b,ae=u+C,r=E+h+(ae/4294967296>>>0)>>>0,b=ae>>>0;ae=c[0][1]+b,c[0][0]=c[0][0]+r+(ae/4294967296>>>0)>>>0,c[0][1]=ae>>>0,ae=c[1][1]+V,c[1][0]=c[1][0]+w+(ae/4294967296>>>0)>>>0,c[1][1]=ae>>>0,ae=c[2][1]+x,c[2][0]=c[2][0]+K+(ae/4294967296>>>0)>>>0,c[2][1]=ae>>>0,ae=c[3][1]+G,c[3][0]=c[3][0]+F+(ae/4294967296>>>0)>>>0,c[3][1]=ae>>>0,ae=c[4][1]+Z,c[4][0]=c[4][0]+H+(ae/4294967296>>>0)>>>0,c[4][1]=ae>>>0,ae=c[5][1]+ee,c[5][0]=c[5][0]+Y+(ae/4294967296>>>0)>>>0,c[5][1]=ae>>>0,ae=c[6][1]+se,c[6][0]=c[6][0]+ue+(ae/4294967296>>>0)>>>0,c[6][1]=ae>>>0,ae=c[7][1]+me,c[7][0]=c[7][0]+de+(ae/4294967296>>>0)>>>0,c[7][1]=ae>>>0,L-=128}}})),fr=ce((oe=>{var W=le();st();var a=W.asn1;oe.privateKeyValidator={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",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:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},oe.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",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:"publicKeyOid"}]},{tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}})),pr=ce(((oe,W)=>{var a=le();Bt(),at(),jt(),ye();var e=fr(),i=e.publicKeyValidator,y=e.privateKeyValidator;if(k===void 0)var k=a.jsbn.BigInteger;var T=a.util.ByteBuffer,f=typeof Buffer>"u"?Uint8Array:Buffer;a.pki=a.pki||{},W.exports=a.pki.ed25519=a.ed25519=a.ed25519||{};var t=a.ed25519;t.constants={},t.constants.PUBLIC_KEY_BYTE_LENGTH=32,t.constants.PRIVATE_KEY_BYTE_LENGTH=64,t.constants.SEED_BYTE_LENGTH=32,t.constants.SIGN_BYTE_LENGTH=64,t.constants.HASH_BYTE_LENGTH=64,t.generateKeyPair=function(U){U||(U={});var L=U.seed;if(L===void 0)L=a.random.getBytesSync(t.constants.SEED_BYTE_LENGTH);else if(typeof L=="string"){if(L.length!==t.constants.SEED_BYTE_LENGTH)throw TypeError('"seed" must be '+t.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(L instanceof Uint8Array))throw TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');L=g({message:L,encoding:"binary"});for(var N=new f(t.constants.PUBLIC_KEY_BYTE_LENGTH),o=new f(t.constants.PRIVATE_KEY_BYTE_LENGTH),R=0;R<32;++R)o[R]=L[R];return p(N,o),{publicKey:N,privateKey:o}},t.privateKeyFromAsn1=function(U){var L={},N=[];if(!a.asn1.validate(U,y,L,N)){var o=Error("Invalid Key.");throw o.errors=N,o}var R=a.asn1.derToOid(L.privateKeyOid),O=a.oids.EdDSA25519;if(R!==O)throw Error('Invalid OID "'+R+'"; OID must be "'+O+'".');var q=L.privateKey;return{privateKeyBytes:g({message:a.asn1.fromDer(q).value,encoding:"binary"})}},t.publicKeyFromAsn1=function(U){var L={},N=[];if(!a.asn1.validate(U,i,L,N)){var o=Error("Invalid Key.");throw o.errors=N,o}var R=a.asn1.derToOid(L.publicKeyOid),O=a.oids.EdDSA25519;if(R!==O)throw Error('Invalid OID "'+R+'"; OID must be "'+O+'".');var q=L.ed25519PublicKey;if(q.length!==t.constants.PUBLIC_KEY_BYTE_LENGTH)throw Error("Ke
14y length is invalid.");return g({message:q,encoding:"binary"})},t.publicKeyFromPrivateKey=function(U){U||(U={});var L=g({message:U.privateKey,encoding:"binary"});if(L.length!==t.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError('"options.privateKey" must have a byte length of '+t.constants.PRIVATE_KEY_BYTE_LENGTH);for(var N=new f(t.constants.PUBLIC_KEY_BYTE_LENGTH),o=0;o<N.length;++o)N[o]=L[32+o];return N},t.sign=function(U){U||(U={});var L=g(U),N=g({message:U.privateKey,encoding:"binary"});if(N.length===t.constants.SEED_BYTE_LENGTH)N=t.generateKeyPair({seed:N}).privateKey;else if(N.length!==t.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError('"options.privateKey" must have a byte length of '+t.constants.SEED_BYTE_LENGTH+" or "+t.constants.PRIVATE_KEY_BYTE_LENGTH);var o=new f(t.constants.SIGN_BYTE_LENGTH+L.length);d(o,L,L.length,N);for(var R=new f(t.constants.SIGN_BYTE_LENGTH),O=0;O<R.length;++O)R[O]=o[O];return R},t.verify=function(U){U||(U={});var L=g(U);if(U.signature===void 0)throw TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var N=g({message:U.signature,encoding:"binary"});if(N.length!==t.constants.SIGN_BYTE_LENGTH)throw TypeError('"options.signature" must have a byte length of '+t.constants.SIGN_BYTE_LENGTH);var o=g({message:U.publicKey,encoding:"binary"});if(o.length!==t.constants.PUBLIC_KEY_BYTE_LENGTH)throw TypeError('"options.publicKey" must have a byte length of '+t.constants.PUBLIC_KEY_BYTE_LENGTH);var R=new f(t.constants.SIGN_BYTE_LENGTH+L.length),O=new f(t.constants.SIGN_BYTE_LENGTH+L.length),q;for(q=0;q<t.constants.SIGN_BYTE_LENGTH;++q)R[q]=N[q];for(q=0;q<L.length;++q)R[q+t.constants.SIGN_BYTE_LENGTH]=L[q];return A(O,R,R.length,o)>=0};function g(U){var L=U.message;if(L instanceof Uint8Array||L instanceof f)return L;var N=U.encoding;if(L===void 0)if(U.md)L=U.md.digest().getBytes(),N="binary";else throw TypeError('"options.message" or "options.md" not specified.');if(typeof L=="string"&&!N)throw TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof L=="string"){if(typeof Buffer<"u")return Buffer.from(L,N);L=new T(L,N)}else if(!(L instanceof T))throw TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var o=new f(L.length()),R=0;R<o.length;++R)o[R]=L.at(R);return o}var c=X(),S=X([1]),_=X([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),E=X([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=X([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),h=X([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),C=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),m=X([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function s(U,L){var N=a.md.sha512.create(),o=new T(U);N.update(o.getBytes(L),"binary");var R=N.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(R,"binary");for(var O=new f(t.constants.HASH_BYTE_LENGTH),q=0;q<64;++q)O[q]=R.charCodeAt(q);return O}function p(U,L){var N=[X(),X(),X(),X()],o,R=s(L,32);for(R[0]&=248,R[31]&=127,R[31]|=64,ue(N,R),w(U,N),o=0;o<32;++o)L[o+32]=U[o];return 0}function d(U,L,N,o){var R,O,q=new Float64Array(64),te=[X(),X(),X(),X()],ie=s(o,32);ie[0]&=248,ie[31]&=127,ie[31]|=64;var j=N+64;for(R=0;R<N;++R)U[64+R]=L[R];for(R=0;R<32;++R)U[32+R]=ie[32+R];var J=s(U.subarray(32),N+32);for(n(J),ue(te,J),w(U,te),R=32;R<64;++R)U[R]=o[R];var ne=s(U,N+64);for(n(ne),R=32;R<64;++R)q[R]=0;for(R=0;R<32;++R)q[R]=J[R];for(R=0;R<32;++R)for(O=0;O<32;O++)q[R+O]+=ne[R]*ie[O];return l(U.subarray(32),q),j}function A(U,L,N,o){var R,O,q=new f(32),te=[X(),X(),X(),X()],ie=[X(),X(),X(),X()];if(O=-1,N<64||K(ie,o)||!D(L,32))return-1;for(R=0;R<N;++R)U[R]=L[R];for(R=0;R<32;++R)U[R+32]=o[R];var j=s(U,N);if(n(j),ee(te,ie,j),ue(ie,L.subarray(32)),r(te,ie),w(q,te),N-=64,H(L,0,q,0)
14){for(R=0;R<N;++R)U[R]=0;return-1}for(R=0;R<N;++R)U[R]=L[R+64];return O=N,O}function D(U,L){var N;for(N=31;N>=0;--N){if(U[L+N]<C[N])return!0;if(U[L+N]>C[N])return!1}return!1}function l(U,L){var N,o,R,O;for(o=63;o>=32;--o){for(N=0,R=o-32,O=o-12;R<O;++R)L[R]+=N-16*L[o]*C[R-(o-32)],N=L[R]+128>>8,L[R]-=N*256;L[R]+=N,L[o]=0}for(N=0,R=0;R<32;++R)L[R]+=N-(L[31]>>4)*C[R],N=L[R]>>8,L[R]&=255;for(R=0;R<32;++R)L[R]-=N*C[R];for(o=0;o<32;++o)L[o+1]+=L[o]>>8,U[o]=L[o]&255}function n(U){for(var L=new Float64Array(64),N=0;N<64;++N)L[N]=U[N],U[N]=0;l(U,L)}function r(U,L){var N=X(),o=X(),R=X(),O=X(),q=X(),te=X(),ie=X(),j=X(),J=X();ze(N,U[1],U[0]),ze(J,L[1],L[0]),v(N,N,J),ae(o,U[0],U[1]),ae(J,L[0],L[1]),v(o,o,J),v(R,U[3],L[3]),v(R,R,E),v(O,U[2],L[2]),ae(O,O,O),ze(q,o,N),ze(te,O,R),ae(ie,O,R),ae(j,o,N),v(U[0],q,te),v(U[1],j,ie),v(U[2],ie,te),v(U[3],q,j)}function b(U,L,N){for(var o=0;o<4;++o)fe(U[o],L[o],N)}function w(U,L){var N=X(),o=X(),R=X();de(R,L[2]),v(N,L[0],R),v(o,L[1],R),V(U,o),U[31]^=Y(N)<<7}function V(U,L){var N,o,R,O=X(),q=X();for(N=0;N<16;++N)q[N]=L[N];for(me(q),me(q),me(q),o=0;o<2;++o){for(O[0]=q[0]-65517,N=1;N<15;++N)O[N]=q[N]-65535-(O[N-1]>>16&1),O[N-1]&=65535;O[15]=q[15]-32767-(O[14]>>16&1),R=O[15]>>16&1,O[14]&=65535,fe(q,O,1-R)}for(N=0;N<16;N++)U[2*N]=q[N]&255,U[2*N+1]=q[N]>>8}function K(U,L){var N=X(),o=X(),R=X(),O=X(),q=X(),te=X(),ie=X();return se(U[2],S),x(U[1],L),qe(R,U[1]),v(O,R,_),ze(R,R,U[2]),ae(O,U[2],O),qe(q,O),qe(te,q),v(ie,te,q),v(N,ie,R),v(N,N,O),F(N,N),v(N,N,R),v(N,N,O),v(N,N,O),v(U[0],N,O),qe(o,U[0]),v(o,o,O),G(o,R)&&v(U[0],U[0],m),qe(o,U[0]),v(o,o,O),G(o,R)?-1:(Y(U[0])===L[31]>>7&&ze(U[0],c,U[0]),v(U[3],U[0],U[1]),0)}function x(U,L){var N;for(N=0;N<16;++N)U[N]=L[2*N]+(L[2*N+1]<<8);U[15]&=32767}function F(U,L){var N=X(),o;for(o=0;o<16;++o)N[o]=L[o];for(o=250;o>=0;--o)qe(N,N),o!==1&&v(N,N,L);for(o=0;o<16;++o)U[o]=N[o]}function G(U,L){var N=new f(32),o=new f(32);return V(N,U),V(o,L),H(N,0,o,0)}function H(U,L,N,o){return Z(U,L,N,o,32)}function Z(U,L,N,o,R){var O,q=0;for(O=0;O<R;++O)q|=U[L+O]^N[o+O];return(1&q-1>>>8)-1}function Y(U){var L=new f(32);return V(L,U),L[0]&1}function ee(U,L,N){var o,R;for(se(U[0],c),se(U[1],S),se(U[2],S),se(U[3],c),R=255;R>=0;--R)o=N[R/8|0]>>(R&7)&1,b(U,L,o),r(L,U),r(U,U),b(U,L,o)}function ue(U,L){var N=[X(),X(),X(),X()];se(N[0],u),se(N[1],h),se(N[2],S),v(N[3],u,h),ee(U,N,L)}function se(U,L){var N;for(N=0;N<16;N++)U[N]=L[N]|0}function de(U,L){var N=X(),o;for(o=0;o<16;++o)N[o]=L[o];for(o=253;o>=0;--o)qe(N,N),o!==2&&o!==4&&v(N,N,L);for(o=0;o<16;++o)U[o]=N[o]}function me(U){var L,N,o=1;for(L=0;L<16;++L)N=U[L]+o+65535,o=Math.floor(N/65536),U[L]=N-o*65536;U[0]+=o-1+37*(o-1)}function fe(U,L,N){for(var o,R=~(N-1),O=0;O<16;++O)o=R&(U[O]^L[O]),U[O]^=o,L[O]^=o}function X(U){var L,N=new Float64Array(16);if(U)for(L=0;L<U.length;++L)N[L]=U[L];return N}function ae(U,L,N){for(var o=0;o<16;++o)U[o]=L[o]+N[o]}function ze(U,L,N){for(var o=0;o<16;++o)U[o]=L[o]-N[o]}function qe(U,L){v(U,L,L)}function v(U,L,N){var o,R,O=0,q=0,te=0,ie=0,j=0,J=0,ne=0,he=0,pe=0,Te=0,Ae=0,Be=0,Ie=0,Ee=0,Ce=0,ve=0,Ne=0,Re=0,je=0,Qe=0,Ye=0,Xe=0,Ze=0,$e=0,it=0,nt=0,ct=0,ft=0,dt=0,vt=0,Et=0,ke=N[0],Le=N[1],_e=N[2],Ue=N[3],De=N[4],we=N[5],Ve=N[6],Pe=N[7],Oe=N[8],Ke=N[9],xe=N[10],Me=N[11],Se=N[12],be=N[13],Fe=N[14],Ge=N[15];o=L[0],O+=o*ke,q+=o*Le,te+=o*_e,ie+=o*Ue,j+=o*De,J+=o*we,ne+=o*Ve,he+=o*Pe,pe+=o*Oe,Te+=o*Ke,Ae+=o*xe,Be+=o*Me,Ie+=o*Se,Ee+=o*be,Ce+=o*Fe,ve+=o*Ge,o=L[1],q+=o*ke,te+=o*Le,ie+=o*_e,j+=o*Ue,J+=o*De,ne+=o*we,he+=o*Ve,pe+=o*Pe,Te+=o*Oe,Ae+=o*Ke,Be+=o*xe,Ie+=o*Me,Ee+=o*Se,Ce+=o*be,ve+=o*Fe,Ne+=o*Ge,o=L[2],te+=o*ke,ie+=o*Le,j+=o*_e,J+=o
14*Ue,ne+=o*De,he+=o*we,pe+=o*Ve,Te+=o*Pe,Ae+=o*Oe,Be+=o*Ke,Ie+=o*xe,Ee+=o*Me,Ce+=o*Se,ve+=o*be,Ne+=o*Fe,Re+=o*Ge,o=L[3],ie+=o*ke,j+=o*Le,J+=o*_e,ne+=o*Ue,he+=o*De,pe+=o*we,Te+=o*Ve,Ae+=o*Pe,Be+=o*Oe,Ie+=o*Ke,Ee+=o*xe,Ce+=o*Me,ve+=o*Se,Ne+=o*be,Re+=o*Fe,je+=o*Ge,o=L[4],j+=o*ke,J+=o*Le,ne+=o*_e,he+=o*Ue,pe+=o*De,Te+=o*we,Ae+=o*Ve,Be+=o*Pe,Ie+=o*Oe,Ee+=o*Ke,Ce+=o*xe,ve+=o*Me,Ne+=o*Se,Re+=o*be,je+=o*Fe,Qe+=o*Ge,o=L[5],J+=o*ke,ne+=o*Le,he+=o*_e,pe+=o*Ue,Te+=o*De,Ae+=o*we,Be+=o*Ve,Ie+=o*Pe,Ee+=o*Oe,Ce+=o*Ke,ve+=o*xe,Ne+=o*Me,Re+=o*Se,je+=o*be,Qe+=o*Fe,Ye+=o*Ge,o=L[6],ne+=o*ke,he+=o*Le,pe+=o*_e,Te+=o*Ue,Ae+=o*De,Be+=o*we,Ie+=o*Ve,Ee+=o*Pe,Ce+=o*Oe,ve+=o*Ke,Ne+=o*xe,Re+=o*Me,je+=o*Se,Qe+=o*be,Ye+=o*Fe,Xe+=o*Ge,o=L[7],he+=o*ke,pe+=o*Le,Te+=o*_e,Ae+=o*Ue,Be+=o*De,Ie+=o*we,Ee+=o*Ve,Ce+=o*Pe,ve+=o*Oe,Ne+=o*Ke,Re+=o*xe,je+=o*Me,Qe+=o*Se,Ye+=o*be,Xe+=o*Fe,Ze+=o*Ge,o=L[8],pe+=o*ke,Te+=o*Le,Ae+=o*_e,Be+=o*Ue,Ie+=o*De,Ee+=o*we,Ce+=o*Ve,ve+=o*Pe,Ne+=o*Oe,Re+=o*Ke,je+=o*xe,Qe+=o*Me,Ye+=o*Se,Xe+=o*be,Ze+=o*Fe,$e+=o*Ge,o=L[9],Te+=o*ke,Ae+=o*Le,Be+=o*_e,Ie+=o*Ue,Ee+=o*De,Ce+=o*we,ve+=o*Ve,Ne+=o*Pe,Re+=o*Oe,je+=o*Ke,Qe+=o*xe,Ye+=o*Me,Xe+=o*Se,Ze+=o*be,$e+=o*Fe,it+=o*Ge,o=L[10],Ae+=o*ke,Be+=o*Le,Ie+=o*_e,Ee+=o*Ue,Ce+=o*De,ve+=o*we,Ne+=o*Ve,Re+=o*Pe,je+=o*Oe,Qe+=o*Ke,Ye+=o*xe,Xe+=o*Me,Ze+=o*Se,$e+=o*be,it+=o*Fe,nt+=o*Ge,o=L[11],Be+=o*ke,Ie+=o*Le,Ee+=o*_e,Ce+=o*Ue,ve+=o*De,Ne+=o*we,Re+=o*Ve,je+=o*Pe,Qe+=o*Oe,Ye+=o*Ke,Xe+=o*xe,Ze+=o*Me,$e+=o*Se,it+=o*be,nt+=o*Fe,ct+=o*Ge,o=L[12],Ie+=o*ke,Ee+=o*Le,Ce+=o*_e,ve+=o*Ue,Ne+=o*De,Re+=o*we,je+=o*Ve,Qe+=o*Pe,Ye+=o*Oe,Xe+=o*Ke,Ze+=o*xe,$e+=o*Me,it+=o*Se,nt+=o*be,ct+=o*Fe,ft+=o*Ge,o=L[13],Ee+=o*ke,Ce+=o*Le,ve+=o*_e,Ne+=o*Ue,Re+=o*De,je+=o*we,Qe+=o*Ve,Ye+=o*Pe,Xe+=o*Oe,Ze+=o*Ke,$e+=o*xe,it+=o*Me,nt+=o*Se,ct+=o*be,ft+=o*Fe,dt+=o*Ge,o=L[14],Ce+=o*ke,ve+=o*Le,Ne+=o*_e,Re+=o*Ue,je+=o*De,Qe+=o*we,Ye+=o*Ve,Xe+=o*Pe,Ze+=o*Oe,$e+=o*Ke,it+=o*xe,nt+=o*Me,ct+=o*Se,ft+=o*be,dt+=o*Fe,vt+=o*Ge,o=L[15],ve+=o*ke,Ne+=o*Le,Re+=o*_e,je+=o*Ue,Qe+=o*De,Ye+=o*we,Xe+=o*Ve,Ze+=o*Pe,$e+=o*Oe,it+=o*Ke,nt+=o*xe,ct+=o*Me,ft+=o*Se,dt+=o*be,vt+=o*Fe,Et+=o*Ge,O+=38*Ne,q+=38*Re,te+=38*je,ie+=38*Qe,j+=38*Ye,J+=38*Xe,ne+=38*Ze,he+=38*$e,pe+=38*it,Te+=38*nt,Ae+=38*ct,Be+=38*ft,Ie+=38*dt,Ee+=38*vt,Ce+=38*Et,R=1,o=O+R+65535,R=Math.floor(o/65536),O=o-R*65536,o=q+R+65535,R=Math.floor(o/65536),q=o-R*65536,o=te+R+65535,R=Math.floor(o/65536),te=o-R*65536,o=ie+R+65535,R=Math.floor(o/65536),ie=o-R*65536,o=j+R+65535,R=Math.floor(o/65536),j=o-R*65536,o=J+R+65535,R=Math.floor(o/65536),J=o-R*65536,o=ne+R+65535,R=Math.floor(o/65536),ne=o-R*65536,o=he+R+65535,R=Math.floor(o/65536),he=o-R*65536,o=pe+R+65535,R=Math.floor(o/65536),pe=o-R*65536,o=Te+R+65535,R=Math.floor(o/65536),Te=o-R*65536,o=Ae+R+65535,R=Math.floor(o/65536),Ae=o-R*65536,o=Be+R+65535,R=Math.floor(o/65536),Be=o-R*65536,o=Ie+R+65535,R=Math.floor(o/65536),Ie=o-R*65536,o=Ee+R+65535,R=Math.floor(o/65536),Ee=o-R*65536,o=Ce+R+65535,R=Math.floor(o/65536),Ce=o-R*65536,o=ve+R+65535,R=Math.floor(o/65536),ve=o-R*65536,O+=R-1+37*(R-1),R=1,o=O+R+65535,R=Math.floor(o/65536),O=o-R*65536,o=q+R+65535,R=Math.floor(o/65536),q=o-R*65536,o=te+R+65535,R=Math.floor(o/65536),te=o-R*65536,o=ie+R+65535,R=Math.floor(o/65536),ie=o-R*65536,o=j+R+65535,R=Math.floor(o/65536),j=o-R*65536,o=J+R+65535,R=Math.floor(o/65536),J=o-R*65536,o=ne+R+65535,R=Math.floor(o/65536),ne=o-R*65536,o=he+R+65535,R=Math.floor(o/65536),he=o-R*65536,o=pe+R+65535,R=Math.floor(o/65536),pe=o-R*65536,o=Te+R+65535,R=Math.floor(o/65536),Te=o-R*65536,o=Ae+R+65535,R=Math.floor(o/65536),Ae=o-R*65536,o=Be+R+65535,R=Math.floor(o/65536),Be=o-R*65536,o=Ie+R+65535,R=Math.floor(o/65536),Ie=o-R*65536,o=Ee+R+65535,R=Math.floor(o/65536),Ee=o-R*65536,o=Ce+R+65535,R=Math.floor(o/65536),Ce=o-R*65536,o=ve+R+65535,R=Math.floor(o/65536),ve=o-R*65536,O+=R-1+37*(R-1),U[0]=O,U[1]=q,U[2]=te,U[3]=ie,U[4]=j,U[5]=J,U[6]=ne,U[7]=he,U[8]=pe,U[9]=Te,U[10]=Ae,U[11]=Be,U[12]=Ie,U[13]=Ee,U[14]=Ce,U[15]=ve}})),hr=ce(((oe,W)=>{var a=le();ye(),at(),Bt(),W.exports=a.kem=a.kem||{};var e=a.jsbn.BigInteger;a.kem.rsa={},a.kem.rsa.create=function(y,k){k||(k={});var T=k.prng||a.random,f={};return f.encrypt=function(t,g){var c=Math.ceil(t.n.bitLength()/8),S;do S=new e(a.util.bytesToHex(T.getBytesSync(c)),16).mod(t.n);while(S.compareTo(e.ONE)<=0);S=a.util.hexToBytes(S.toString(16));var _=c-S.length;return _>
140&&(S=a.util.fillString("\0",_)+S),{encapsulation:t.encrypt(S,"NONE"),key:y.generate(S,g)}},f.decrypt=function(t,g,c){var S=t.decrypt(g,"NONE");return y.generate(S,c)},f},a.kem.kdf1=function(y,k){i(this,y,0,k||y.digestLength)},a.kem.kdf2=function(y,k){i(this,y,1,k||y.digestLength)};function i(y,k,T,f){y.generate=function(t,g){for(var c=new a.util.ByteBuffer,S=Math.ceil(g/f)+T,_=new a.util.ByteBuffer,E=T;E<S;++E){_.putInt32(E),k.start(),k.update(t+_.getBytes());var u=k.digest();c.putBytes(u.getBytes(f))}return c.truncate(c.length()-g),c.getBytes()}}})),dr=ce(((oe,W)=>{var a=le();ye(),W.exports=a.log=a.log||{},a.log.levels=["none","error","warning","info","debug","verbose","max"];var e={},i=[],y=null;a.log.LEVEL_LOCKED=2,a.log.NO_LEVEL_CHECK=4,a.log.INTERPOLATE=8;for(var k=0;k<a.log.levels.length;++k){var T=a.log.levels[k];e[T]={index:k,name:T.toUpperCase()}}a.log.logMessage=function(_){for(var E=e[_.level].index,u=0;u<i.length;++u){var h=i[u];h.flags&a.log.NO_LEVEL_CHECK?h.f(_):E<=e[h.level].index&&h.f(h,_)}},a.log.prepareStandard=function(_){"standard"in _||(_.standard=e[_.level].name+" ["+_.category+"] "+_.message)},a.log.prepareFull=function(_){if(!("full"in _)){var E=[_.message];E=E.concat([]),_.full=a.util.format.apply(this,E)}},a.log.prepareStandardFull=function(_){"standardFull"in _||(a.log.prepareStandard(_),_.standardFull=_.standard)};for(var f=["error","warning","info","debug","verbose"],k=0;k<f.length;++k)(function(E){a.log[E]=function(u,h){var C=Array.prototype.slice.call(arguments).slice(2),m={timestamp:new Date,level:E,category:u,message:h,arguments:C};a.log.logMessage(m)}})(f[k]);if(a.log.makeLogger=function(_){var E={flags:0,f:_};return a.log.setLevel(E,"none"),E},a.log.setLevel=function(_,E){var u=!1;if(_&&!(_.flags&a.log.LEVEL_LOCKED)){for(var h=0;h<a.log.levels.length;++h)if(E==a.log.levels[h]){_.level=E,u=!0;break}}return u},a.log.lock=function(_,E){E===void 0||E?_.flags|=a.log.LEVEL_LOCKED:_.flags&=~a.log.LEVEL_LOCKED},a.log.addLogger=function(_){i.push(_)},typeof console<"u"&&"log"in console){var t;if(console.error&&console.warn&&console.info&&console.debug){var g={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},c=function(_,E){a.log.prepareStandard(E);var u=g[E.level],h=[E.standard];h=h.concat(E.arguments.slice()),u.apply(console,h)};t=a.log.makeLogger(c)}else{var c=function(E,u){a.log.prepareStandardFull(u),console.log(u.standardFull)};t=a.log.makeLogger(c)}a.log.setLevel(t,"debug"),a.log.addLogger(t),y=t}else console={log:function(){}};if(y!==null&&typeof window<"u"&&window.location){var S=new URL(window.location.href).searchParams;S.has("console.level")&&a.log.setLevel(y,S.get("console.level").slice(-1)[0]),S.has("console.lock")&&S.get("console.lock").slice(-1)[0]=="true"&&a.log.lock(y)}a.log.consoleLogger=y})),yr=ce(((oe,W)=>{W.exports=ut(),Rt(),Ct(),wt(),jt()})),gr=ce(((oe,W)=>{var a=le();pt(),st(),It(),ht(),gt(),Mt(),at(),ye(),Ut();var e=a.asn1,i=W.exports=a.pkcs7=a.pkcs7||{};i.messageFromPem=function(u){var h=a.pem.decode(u)[0];if(h.type!=="PKCS7"){var C=Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw C.headerType=h.type,C}if(h.procType&&h.procType.type==="ENCRYPTED")throw Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var m=e.fromDer(h.body);return i.messageFromAsn1(m)},i.messageToPem=function(u,h){var C={type:"PKCS7",body:e.toDer(u.toAsn1()).getBytes()};return a.pem.encode(C,{maxline:h})},i.messageFromAsn1=function(u){var h={},C=[];if(!e.validate(u,i.asn1.contentInfoValidator,h,C)){var m=Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw m.errors=C,m}var s=e.derToOid(h.contentType),p;switch(s){case a.pki.oids.envelopedData:p=i.createEnvelopedData();break;case a.pki.oids.encryptedData:p=i.createEncryptedData();break;case a.pki.oids.signedData:p=i.createSignedData();break;default:throw Error("Cannot read PKCS#7 message. ContentType with OID "+s+" is not (yet) supported.")}return p.fromAsn1(h.content.value[0]),p},i.createSignedData=function(){var u=null;
14return u={type:a.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(m){if(_(u,m,i.asn1.signedDataValidator),u.certificates=[],u.crls=[],u.digestAlgorithmIdentifiers=[],u.contentInfo=null,u.signerInfos=[],u.rawCapture.certificates)for(var s=u.rawCapture.certificates.value,p=0;p<s.length;++p)u.certificates.push(a.pki.certificateFromAsn1(s[p]))},toAsn1:function(){u.contentInfo||u.sign();for(var m=[],s=0;s<u.certificates.length;++s)m.push(a.pki.certificateToAsn1(u.certificates[s]));var p=[],d=e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(u.version).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,u.digestAlgorithmIdentifiers),u.contentInfo])]);return m.length>0&&d.value[0].value.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!0,m)),p.length>0&&d.value[0].value.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,p)),d.value[0].value.push(e.create(e.Class.UNIVERSAL,e.Type.SET,!0,u.signerInfos)),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(u.type).getBytes()),d])},addSigner:function(m){var s=m.issuer,p=m.serialNumber;if(m.certificate){var d=m.certificate;typeof d=="string"&&(d=a.pki.certificateFromPem(d)),s=d.issuer.attributes,p=d.serialNumber}var A=m.key;if(!A)throw Error("Could not add PKCS#7 signer; no private key specified.");typeof A=="string"&&(A=a.pki.privateKeyFromPem(A));var D=m.digestAlgorithm||a.pki.oids.sha1;switch(D){case a.pki.oids.sha1:case a.pki.oids.sha256:case a.pki.oids.sha384:case a.pki.oids.sha512:case a.pki.oids.md5:break;default:throw Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+D)}var l=m.authenticatedAttributes||[];if(l.length>0){for(var n=!1,r=!1,b=0;b<l.length;++b){var w=l[b];if(!n&&w.type===a.pki.oids.contentType){if(n=!0,r)break;continue}if(!r&&w.type===a.pki.oids.messageDigest){if(r=!0,n)break;continue}}if(!n||!r)throw Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}u.signers.push({key:A,version:1,issuer:s,serialNumber:p,digestAlgorithm:D,signatureAlgorithm:a.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:l,unauthenticatedAttributes:[]})},sign:function(m){if(m||(m={}),(typeof u.content!="object"||u.contentInfo===null)&&(u.contentInfo=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(a.pki.oids.data).getBytes())]),"content"in u)){var s;u.content instanceof a.util.ByteBuffer?s=u.content.bytes():typeof u.content=="string"&&(s=a.util.encodeUtf8(u.content)),m.detached?u.detachedContent=e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,s):u.contentInfo.value.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,s)]))}u.signers.length!==0&&C(h())},verify:function(){throw Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(m){typeof m=="string"&&(m=a.pki.certificateFromPem(m)),u.certificates.push(m)},addCertificateRevokationList:function(m){throw Error("PKCS#7 CRL support not yet implemented.")}},u;function h(){for(var m={},s=0;s<u.signers.length;++s){var p=u.signers[s],d=p.digestAlgorithm;d in m||(m[d]=a.md[a.pki.oids[d]].create()),p.authenticatedAttributes.length===0?p.md=m[d]:p.md=a.md[a.pki.oids[d]].create()}for(var d in u.digestAlgorithmIdentifiers=[],m)u.digestAlgorithmIdentifiers.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(d).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")]));return m}function C(m){var s;if(u.detachedContent?s=u.detachedContent:(s=u.contentInfo.value[1],s=s.value[0]),!s)throw Error("Could not sign PKCS#7 message; there is no content to sign.");var p=e.derToOid(u.contentInfo.value[0].value),d=e.toDer(s);for(var A in d.getByte(),e.getBerValueLength(d),d=d.getBytes(),m)m[A].start().update(d);for(var D=new Date,l=0;l<u.signers.length;++l){var n=u.signers[l];if(n.authenticatedAttributes.length===0){if(p!==a.pki.oids.data)throw Error("Invalid signer;
14 authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{n.authenticatedAttributesAsn1=e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var r=e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[]),b=0;b<n.authenticatedAttributes.length;++b){var w=n.authenticatedAttributes[b];w.type===a.pki.oids.messageDigest?w.value=m[n.digestAlgorithm].digest():w.type===a.pki.oids.signingTime&&(w.value||(w.value=D)),r.value.push(c(w)),n.authenticatedAttributesAsn1.value.push(c(w))}d=e.toDer(r).getBytes(),n.md.start().update(d)}n.signature=n.key.sign(n.md,"RSASSA-PKCS1-V1_5")}u.signerInfos=g(u.signers)}},i.createEncryptedData=function(){var u=null;return u={type:a.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},fromAsn1:function(h){_(u,h,i.asn1.encryptedDataValidator)},decrypt:function(h){h!==void 0&&(u.encryptedContent.key=h),E(u)}},u},i.createEnvelopedData=function(){var u=null;return u={type:a.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},fromAsn1:function(h){var C=_(u,h,i.asn1.envelopedDataValidator);u.recipients=T(C.recipientInfos.value)},toAsn1:function(){return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(u.type).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(u.version).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,f(u.recipients)),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,S(u.encryptedContent))])])])},findRecipient:function(h){for(var C=h.issuer.attributes,m=0;m<u.recipients.length;++m){var s=u.recipients[m],p=s.issuer;if(s.serialNumber===h.serialNumber&&p.length===C.length){for(var d=!0,A=0;A<C.length;++A)if(p[A].type!==C[A].type||p[A].value!==C[A].value){d=!1;break}if(d)return s}}return null},decrypt:function(h,C){if(u.encryptedContent.key===void 0&&h!==void 0&&C!==void 0)switch(h.encryptedContent.algorithm){case a.pki.oids.rsaEncryption:case a.pki.oids.desCBC:var m=C.decrypt(h.encryptedContent.content);u.encryptedContent.key=a.util.createBuffer(m);break;default:throw Error("Unsupported asymmetric cipher, OID "+h.encryptedContent.algorithm)}E(u)},addRecipient:function(h){u.recipients.push({version:0,issuer:h.issuer.attributes,serialNumber:h.serialNumber,encryptedContent:{algorithm:a.pki.oids.rsaEncryption,key:h.publicKey}})},encrypt:function(h,C){if(u.encryptedContent.content===void 0){C||(C=u.encryptedContent.algorithm),h||(h=u.encryptedContent.key);var m,s,p;switch(C){case a.pki.oids["aes128-CBC"]:m=16,s=16,p=a.aes.createEncryptionCipher;break;case a.pki.oids["aes192-CBC"]:m=24,s=16,p=a.aes.createEncryptionCipher;break;case a.pki.oids["aes256-CBC"]:m=32,s=16,p=a.aes.createEncryptionCipher;break;case a.pki.oids["des-EDE3-CBC"]:m=24,s=8,p=a.des.createEncryptionCipher;break;default:throw Error("Unsupported symmetric cipher, OID "+C)}if(h===void 0)h=a.util.createBuffer(a.random.getBytes(m));else if(h.length()!=m)throw Error("Symmetric key has wrong length; got "+h.length()+" bytes, expected "+m+".");u.encryptedContent.algorithm=C,u.encryptedContent.key=h,u.encryptedContent.parameter=a.util.createBuffer(a.random.getBytes(s));var d=p(h);if(d.start(u.encryptedContent.parameter.copy()),d.update(u.content),!d.finish())throw Error("Symmetric encryption failed.");u.encryptedContent.content=d.output}for(var A=0;A<u.recipients.length;++A){var D=u.recipients[A];if(D.encryptedContent.content===void 0)switch(D.encryptedContent.algorithm){case a.pki.oids.rsaEncryption:D.encryptedContent.content=D.encryptedContent.key.encrypt(u.encryptedContent.key.data);break;default:throw Error("Unsupported asymmetric cipher, OID "+D.encryptedContent.algorithm)}}}},u};function y(u){var h={},C=[];if(!e.validate(u,i.asn1.recipientInfoValidator,h,C)){var m=Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw m.errors=C,m}return{version:h.version.charCodeAt(0),issuer:a.pki.RDNAttributesAsArray(h.issuer),serialNumber:a.util.createBuffer(h.serial).toHex(),encryptedContent:{algorithm:e.derToOid(h.encAlgorithm),parameter:h.encParameter?h.encParameter.value:void 0,content:h.encKey}}}function k(u){return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(u.version).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:u.issuer}),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,a.util.hexToBytes(u.serialNumber))]),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(u.encryptedContent.algorithm).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")]),e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,u.encryptedContent.content)])}function T(u){for(var h=[],C=0;C<u.length;++C)h.push(y(u[C]));return h}function f(u){for(var h=[],C=0;C<u.length;++C)h.push(k(u[C]));return h}function t(u){var h=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(u.version).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:u.issuer}),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,a.util.hexToBytes(u.serialNumber))]),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(u.digestAlgorithm).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")])]);if(u.authenticatedAttributesAsn1&&h.value.push(u.authenticatedAttributesAsn1),h.value.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(u.signatureAlgorithm).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")])),h.value.push(e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,u.signature)),u.unauthenticatedAttributes.length>0){for(var C=e.create(e.Class.CONTEXT_SPECIFIC,1,!0,[]),m=0;m<u.unauthenticatedAttributes.length;++m){var s=u.unauthenticatedAttributes[m];C.values.push(c(s))}h.value.push(C)}return h}function g(u){for(var h=[],C=0;C<u.length;++C)h.push(t(u[C]));return h}function c(u){var h;if(u.type===a.pki.oids.contentType)h=e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(u.value).getBytes());else if(u.type===a.pki.oids.messageDigest)h=e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,u.value.bytes());else if(u.type===a.pki.oids.signingTime){var C=new Date("1950-01-01T00:00:00Z"),m=new Date("2050-01-01T00:00:00Z"),s=u.value;if(typeof s=="string"){var p=Date.parse(s);s=isNaN(p)?s.length===13?e.utcTimeToDate(s):e.generalizedTimeToDate(s):new Date(p)}h=s>=C&&s<m?e.create(e.Class.UNIVERSAL,e.Type.UTCTIME,!1,e.dateToUtcTime(s)):e.create(e.Class.UNIVERSAL,e.Type.GENERALIZEDTIME,!1,e.dateToGeneralizedTime(s))}return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(u.type).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[h])])}function S(u){return[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(a.pki.oids.data).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(u.algorithm).getBytes()),u.parameter?e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,u.parameter.getBytes()):void 0]),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,u.content.getBytes())])]}function _(u,h,C){var m={};if(!e.validate(h,C,m,[])){var s=Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}if(e.derToOid(m.contentType)!==a.pki.oids.data)throw Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");
14if(m.encryptedContent){var p="";if(a.util.isArray(m.encryptedContent))for(var d=0;d<m.encryptedContent.length;++d){if(m.encryptedContent[d].type!==e.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");p+=m.encryptedContent[d].value}else p=m.encryptedContent;u.encryptedContent={algorithm:e.derToOid(m.encAlgorithm),parameter:a.util.createBuffer(m.encParameter.value),content:a.util.createBuffer(p)}}if(m.content){var p="";if(a.util.isArray(m.content))for(var d=0;d<m.content.length;++d){if(m.content[d].type!==e.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");p+=m.content[d].value}else p=m.content;u.content=a.util.createBuffer(p)}return u.version=m.version.charCodeAt(0),u.rawCapture=m,m}function E(u){if(u.encryptedContent.key===void 0)throw Error("Symmetric key not available.");if(u.content===void 0){var h;switch(u.encryptedContent.algorithm){case a.pki.oids["aes128-CBC"]:case a.pki.oids["aes192-CBC"]:case a.pki.oids["aes256-CBC"]:h=a.aes.createDecryptionCipher(u.encryptedContent.key);break;case a.pki.oids.desCBC:case a.pki.oids["des-EDE3-CBC"]:h=a.des.createDecryptionCipher(u.encryptedContent.key);break;default:throw Error("Unsupported symmetric cipher, OID "+u.encryptedContent.algorithm)}if(h.start(u.encryptedContent.parameter),h.update(u.encryptedContent.content),!h.finish())throw Error("Symmetric decryption failed.");u.content=h.output}}})),vr=ce(((oe,W)=>{var a=le();pt(),mt(),Rt(),Ct(),ye();var e=W.exports=a.ssh=a.ssh||{};e.privateKeyToPutty=function(T,f,t){t||(t=""),f||(f="");var g="ssh-rsa",c=f===""?"none":"aes256-cbc",S="PuTTY-User-Key-File-2: "+g+`\r
15`;S+="Encryption: "+c+`\r
16`,S+="Comment: "+t+`\r
17`;var _=a.util.createBuffer();y(_,g),i(_,T.e),i(_,T.n);var E=a.util.encode64(_.bytes(),64),u=Math.floor(E.length/66)+1;S+="Public-Lines: "+u+`\r
18`,S+=E;var h=a.util.createBuffer();i(h,T.d),i(h,T.p),i(h,T.q),i(h,T.qInv);var C;if(!f)C=a.util.encode64(h.bytes(),64);else{var m=h.length()+16-1;m-=m%16;var s=k(h.bytes());s.truncate(s.length()-m+h.length()),h.putBuffer(s);var p=a.util.createBuffer();p.putBuffer(k("\0\0\0\0",f)),p.putBuffer(k("\0\0\0�",f));var d=a.aes.createEncryptionCipher(p.truncate(8),"CBC");d.start(a.util.createBuffer().fillWithByte(0,16)),d.update(h.copy()),d.finish();var A=d.output;A.truncate(16),C=a.util.encode64(A.bytes(),64)}u=Math.floor(C.length/66)+1,S+=`\r
19Private-Lines: `+u+`\r
20`,S+=C;var D=k("putty-private-key-file-mac-key",f),l=a.util.createBuffer();y(l,g),y(l,c),y(l,t),l.putInt32(_.length()),l.putBuffer(_),l.putInt32(h.length()),l.putBuffer(h);var n=a.hmac.create();return n.start("sha1",D),n.update(l.bytes()),S+=`\r
21Private-MAC: `+n.digest().toHex()+`\r
22`,S},e.publicKeyToOpenSSH=function(T,f){var t="ssh-rsa";f||(f="");var g=a.util.createBuffer();return y(g,t),i(g,T.e),i(g,T.n),t+" "+a.util.encode64(g.bytes())+" "+f},e.privateKeyToOpenSSH=function(T,f){return f?a.pki.encryptRsaPrivateKey(T,f,{legacy:!0,algorithm:"aes128"}):a.pki.privateKeyToPem(T)},e.getPublicKeyFingerprint=function(T,f){f||(f={});var t=f.md||a.md.md5.create(),g="ssh-rsa",c=a.util.createBuffer();y(c,g),i(c,T.e),i(c,T.n),t.start(),t.update(c.getBytes());var S=t.digest();if(f.encoding==="hex"){var _=S.toHex();return f.delimiter?_.match(/.{2}/g).join(f.delimiter):_}else{if(f.encoding==="binary")return S.getBytes();if(f.encoding)throw Error('Unknown encoding "'+f.encoding+'".')}return S};function i(T,f){var t=f.toString(16);t[0]>="8"&&(t="00"+t);var g=a.util.hexToBytes(t);T.putInt32(g.length),T.putBytes(g)}function y(T,f){T.putInt32(f.length),T.putString(f)}function k(){for(var T=a.md.sha1.create(),f=arguments.length,t=0;t<f;++t)T.update(arguments[t]);return T.digest()}})),mr=ce(((oe,W)=>{W.exports=le(),pt(),lr(),st(),Nt(),It(),pr(),mt(),hr(),dr(),yr(),Ft(),Lt(),gt(),Ot(),Gt(),gr(),Ht(),Kt(),Vt(),_t(),at(),Pt(),vr(),qt(),ye()}));const ka=mr();export{ka as default};
23!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;
23n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="625036b8-0e58-5dec-be31-6497e47aacdb")}catch(e){}}()
24//# debugId=625036b8-0e58-5dec-be31-6497e47aacdb
25//# sourceMappingURL=lib-BiapEtK1-D4SbyvNE.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.