// 来自 https://github.com/Yuheng0101/X/blob/main/Utils/ // prettier-ignore function loadJSEncrypt(){var RSA={};return function(exports){function BigInteger(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function nbi(){return new BigInteger(null)}function am1(t,e,i,n,r,s){for(;0<=--s;){var o=e*this[t++]+i[n]+r;r=Math.floor(o/67108864),i[n++]=67108863&o}return r}function am2(t,e,i,n,r,s){for(var o=32767&e,h=e>>15;0<=--s;){var a=32767&this[t],u=this[t++]>>15,p=h*a+u*o;r=((a=o*a+((32767&p)<<15)+i[n]+(1073741823&r))>>>30)+(p>>>15)+h*u+(r>>>30),i[n++]=1073741823&a}return r}function am3(t,e,i,n,r,s){for(var o=16383&e,h=e>>14;0<=--s;){var a=16383&this[t],u=this[t++]>>14,p=h*a+u*o;r=((a=o*a+((16383&p)<<14)+i[n]+r)>>28)+(p>>14)+h*u,i[n++]=268435455&a}return r}function int2char(t){return BI_RM.charAt(t)}function intAt(t,e){return e=BI_RC[t.charCodeAt(e)],null==e?-1:e}function bnpCopyTo(t){for(var e=this.t-1;0<=e;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function bnpFromInt(t){this.t=1,this.s=t<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-s):this[this.t-1]|=o<=this.DB&&(s-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,0>h)&&(r=!0,s=int2char(i));0<=o;)h>(h+=this.DB-e)):(i=this[o]>>(h-=e)&n,h<=0&&(h+=this.DB,--o)),0>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(t,e){for(var i=this.t-1;0<=i;--i)e[i+t]=this[i];for(i=t-1;0<=i;--i)e[i]=0;e.t=this.t+t,e.s=this.s}function bnpDRShiftTo(t,e){for(var i=t;i>n|o,o=(this[h]&r)<=this.t)e.t=0;else{var n=t%this.DB,r=this.DB-n,s=(1<>n;for(var o=i+1;o>n;0>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;i>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:0=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}0>this.F2:0);var p=this.FV/r,c=(1<>15,this.um=(1<>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),0<=t.compareTo(this.m)&&t.subTo(this.m,t)}function montSqrTo(t,e){t.squareTo(e),this.reduce(e)}function montMulTo(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function bnpIsEven(){return 0==(0>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(t){if(null==t&&(t=10),0==this.signum()||t<2||36=i&&(this.dMultiply(n),this.dAddOffset(o,0),o=s=0))}0t&&this.subTo(BigInteger.ONE.shiftLeft(t-1),this);else{var n=new Array;i=7&t;n.length=1+(t>>3),e.nextBytes(n),0>n)!=(this.s&this.DM)>>n&&(e[r++]=i|this.s<>(n+=this.DB-8)):(i=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==r&&(128&this.s)!=(128&i)&&++r,(0>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function bnGetLowestSetBit(){for(var t=0;t=this.t?0!=this.s:0!=(this[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;i>=this.DB;n+=t.s}e.s=n<0?-1:0,0=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function NullExp(){}function nNop(t){return t}function nMulTo(t,e,i){t.multiplyTo(e,i)}function nSqrTo(t,e){t.squareTo(e)}function bnPow(t){return this.exp(t,new NullExp)}function bnpMultiplyLowerTo(t,e,i){var n,r=Math.min(this.t+t.t,e);for(i.s=0,i.t=r;02*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=nbi();return t.copyTo(e),this.reduce(e),e}function barrettRevert(t){return t}function barrettReduce(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);0<=t.compareTo(this.m);)t.subTo(this.m,t)}function barrettSqrTo(t,e){t.squareTo(e),this.reduce(e)}function barrettMulTo(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function bnModPow(t,e){var i,n,r=t.bitLength(),s=nbv(1);if(r<=0)return s;i=r<18?1:r<48?3:r<144?4:r<768?5:6,n=new(r<8?Classic:e.isEven()?Barrett:Montgomery)(e);var o=new Array,h=3,a=i-1,u=(1<>r-a&u:(c=(t[l]&(1<>this.DB+r-a)),h=i;0==(1&c);)c>>=1,--h;if((r-=h)<0&&(r+=this.DB,--l),f)o[c].copyTo(s),f=!1;else{for(;1>1)>lowprimes.length&&(t=lowprimes.length);for(var r=nbi(),s=0;s>6|192):(n[--e]=63&s|128,n[--e]=s>>6&63|128,n[--e]=s>>12|224)}if(n[--e]=0,2==i)for(var o=new SecureRandom,h=new Array;2>3,e),null==e?null:(e=this.doPublic(e),null==e?null:(e=e.toString(16),0==(1&e.length)?e:"0"+e))}function RSAPrivateEncrypt(t,e){return e=pkcs1pad2(t,this.n.bitLength()+7>>3,e),null==e?null:(e=this.doPrivate(e),null==e?null:(e=e.toString(16),0==(1&e.length)?e:"0"+e))}function pkcs1unpad2(t,e,i){var n=t.toByteArray(),r=0;if(0==i)r=-1;else{for(;r=n.length)return null}for(var s="";++r>1;this.e=parseInt(e,16);for(var r=new BigInteger(e,16);;){for(;this.p=new BigInteger(t-n,1,i),0!=this.p.subtract(BigInteger.ONE).gcd(r).compareTo(BigInteger.ONE)||!this.p.isProbablePrime(10););for(;this.q=new BigInteger(n,1,i),0!=this.q.subtract(BigInteger.ONE).gcd(r).compareTo(BigInteger.ONE)||!this.q.isProbablePrime(10););this.p.compareTo(this.q)<=0&&(h=this.p,this.p=this.q,this.q=h);var s=this.p.subtract(BigInteger.ONE),o=this.q.subtract(BigInteger.ONE),h=s.multiply(o);if(0==h.gcd(r).compareTo(BigInteger.ONE)){this.n=this.p.multiply(this.q),this.d=r.modInverse(h),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(o),this.coeff=this.q.modInverse(this.p);break}}}function RSADoPrivate(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(i)<0;)e=e.add(this.p);return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)}function RSAPrivateDecrypt(t,e){return t=parseBigInt(t,16),t=this.doPrivate(t),null==t?null:pkcs1unpad2(t,this.n.bitLength()+7>>3,e)}function RSAPublicDecrypt(t,e){return t=parseBigInt(t,16),t=this.doPublic(t),null==t?null:pkcs1unpad2(t,this.n.bitLength()+7>>3,e)}function hex2b64(t){for(var e,i="",n=0;n+3<=t.length;n+=3)e=parseInt(t.substring(n,n+3),16),i+=b64map.charAt(e>>6)+b64map.charAt(63&e);for(n+1==t.length?(e=parseInt(t.substring(n,n+1),16),i+=b64map.charAt(e<<2)):n+2==t.length&&(e=parseInt(t.substring(n,n+2),16),i+=b64map.charAt(e>>2)+b64map.charAt((3&e)<<4));0<(3&i.length);)i+=b64pad;return i}function b64tohex(t){for(var e,i="",n=0,r=0;r>2),e=3&v,1):1==n?(i+=int2char(e<<2|v>>4),e=15&v,2):2==n?(i+=int2char(e),i+=int2char(v>>2),e=3&v,3):(i+=int2char(e<<2|v>>4),i+=int2char(15&v),0));return 1==n&&(i+=int2char(e<<2)),i}function b64toBA(t){for(var e=b64tohex(t),i=new Array,n=0;2*n>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(1>1;this.e=parseInt(e,16);var s=new BigInteger(e,16),o=this,h=function(){function e(){o.p.compareTo(o.q)<=0&&(n=o.p,o.p=o.q,o.q=n);var t=o.p.subtract(BigInteger.ONE),e=o.q.subtract(BigInteger.ONE),n=t.multiply(e);0==n.gcd(s).compareTo(BigInteger.ONE)?(o.n=o.p.multiply(o.q),o.d=s.modInverse(n),o.dmp1=o.d.mod(t),o.dmq1=o.d.mod(e),o.coeff=o.q.modInverse(o.p),setTimeout(function(){i()},0)):setTimeout(h,0)}var a=function(){o.q=nbi(),o.q.fromNumberAsync(r,1,n,function(){o.q.subtract(BigInteger.ONE).gcda(s,function(t){0==t.compareTo(BigInteger.ONE)&&o.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(a,0)})})},u=function(){o.p=nbi(),o.p.fromNumberAsync(t-r,1,n,function(){o.p.subtract(BigInteger.ONE).gcda(s,function(t){0==t.compareTo(BigInteger.ONE)&&o.p.isProbablePrime(10)?setTimeout(a,0):setTimeout(u,0)})})};setTimeout(u,0)};setTimeout(h,0)},BigInteger.prototype.gcda=function(t,e){var i=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();i.compareTo(n)<0&&(t=i,i=n,n=t);var r,s=i.getLowestSetBit(),o=n.getLowestSetBit();o<0?e(i):(st&&r.subTo(BigInteger.ONE.shiftLeft(t-1),r),r.isProbablePrime(e)?setTimeout(function(){n()},0):setTimeout(s,0)},setTimeout(s,0)):(o=new Array,i=7&t,o.length=1+(t>>3),e.nextBytes(o),0=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setByDateValue=function(t,e,i,n,r,s){s=new Date(Date.UTC(t,e-1,i,n,r,s,0)),this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},JSX.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},JSX.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},JSX.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(t){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){t=new BigInteger(String(t),10),this.setByBigInteger(t)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):void 0!==t.hex&&this.setValueHex(t.hex))},JSX.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(t){KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7>16,n[n.length]=r>>8&255,n[n.length]=255&r,s=r=0):r<<=6}}switch(s){case 1:throw"Base64 encoding incomplete: at least 2 bits missing";case 2:n[n.length]=r>>10;break;case 3:n[n.length]=r>>16,n[n.length]=r>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var i=e.re.exec(t);if(i)if(i[1])t=i[1];else{if(!i[2])throw"RegExp out of sync";t=i[2]}return e.decode(t)}};window.Base64=e}(),function(t){"use strict";function e(t,i){t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=i)}function i(t,e,i,n,r){this.stream=t,this.header=e,this.length=i,this.tag=n,this.sub=r}var n=function(t,e){return t=document.createElement(t),t.className=e,t},r=function(t){return document.createTextNode(t)};e.prototype.get=function(e){if(e===t&&(e=this.pos++),e>=this.enc.length)throw"Requesting byte offset "+e+" on a stream of length "+this.enc.length;return this.enc[e]},e.prototype.hexDigits="0123456789ABCDEF",e.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},e.prototype.hexDump=function(t,e,i){for(var n="",r=t;r>a&1?"1":"0";s=0}}return r},e.prototype.parseOctetString=function(t,e){var i=e-t,n="("+i+" byte) ";100>6,i=(this.tag,31&this.tag);switch(e){case 0:switch(i){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+i.toString(16)}case 1:return"Application_"+i.toString(16);case 2:return"["+i+"]";case 3:return"Private_"+i.toString(16)}},i.prototype.reSeemsASCII=/^[ -~]+$/,i.prototype.content=function(){if(this.tag===t)return null;var e=this.tag>>6,i=31&this.tag,n=this.posContent(),r=Math.abs(this.length);if(0!=e)return null!==this.sub?"("+this.sub.length+" elem)":(e=this.stream.parseStringISO(n,n+Math.min(r,100)),this.reSeemsASCII.test(e)?e.substring(0,200)+(200";i+="Length: "+this.header+"+",0<=this.length?i+=this.length:i+=-this.length+" (undefined)",32&this.tag?i+="
(constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(i+="
(encapsulates)"),null!==s&&(i+="
Value:
"+s+"","object"!=typeof oids||6!=this.tag||(s=oids[s])&&(s.d&&(i+="
"+s.d),s.c&&(i+="
"+s.c),s.w&&(i+="
(warning!)"))),o.innerHTML=i,t.appendChild(o);var h=n("div","sub");if(null!==this.sub)for(var a=0,u=this.sub.length;a>6&1)return!1;try{var o=i.decodeLength(s);return s.pos-r.pos+o==n}catch(t){return!1}},i.decode=function(t){t instanceof e||(t=new e(t,0));var n=new e(t),r=t.get(),s=i.decodeLength(t),o=t.pos-n.pos,h=null;if(i.hasContent(r,s,t)){var a=t.pos;if(3==r&&t.get(),h=[],0<=s){for(var u=a+s;t.pos>3)-11;try{var lt="",ct="";if(string.length>maxLength)return lt=string.match(eval("/.{1,"+maxLength+"}/g")),lt.forEach(function(t){t=k.encrypt_public(t,padding),ct+=t}),output?hex2b64(ct):ct;var t=k.encrypt_public(string,padding),y=output?hex2b64(t):t;return y}catch(t){return!1}},JSEncrypt.prototype.private_decryptLong=function(string,padding,output){var k=this.getKey(),maxLength=(k.n.bitLength()+7>>3)-11,MAX_DECRYPT_BLOCK=parseInt((k.n.bitLength()+1)/4);try{var ct="";if(string=output?b64tohex(string):string,string.length>maxLength){var lt=string.match(eval("/.{1,"+MAX_DECRYPT_BLOCK+"}/g"));return lt.forEach(function(t){t=k.decrypt_private(t,padding),ct+=t}),ct}var y=k.decrypt_private(string,padding);return y}catch(t){return!1}},JSEncrypt.prototype.private_encryptLong=function(string,padding,output){var k=this.getKey(),maxLength=(k.n.bitLength()+7>>3)-11;try{var lt="",ct="";if(string.length>maxLength)return lt=string.match(eval("/.{1,"+maxLength+"}/g")),lt.forEach(function(t){t=k.encrypt_private(t,padding),ct+=t}),output?hex2b64(ct):ct;var t=k.encrypt_private(string,padding),y=output?hex2b64(t):t;return y}catch(t){return!1}},JSEncrypt.prototype.public_decryptLong=function(string,padding,output){var k=this.getKey(),maxLength=(k.n.bitLength()+7>>3)-11,MAX_DECRYPT_BLOCK=parseInt((k.n.bitLength()+1)/4);try{var ct="";if(string=output?b64tohex(string):string,string.length>maxLength){var lt=string.match(eval("/.{1,"+MAX_DECRYPT_BLOCK+"}/g"));return lt.forEach(function(t){t=k.decrypt_public(t,padding),ct+=t}),ct}var y=k.decrypt_public(string,padding);return y}catch(t){return!1}},JSEncrypt.version="2.3.0",exports.JSEncrypt=JSEncrypt}(RSA),RSA}