!function(t,e){for(var r in e)t[r]=e[r]}(exports,function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=23)}([function(t,e,r){var n;t.exports=(n=n||function(t,e){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&"undefined"!=typeof global&&global.crypto&&(n=global.crypto),!n)try{n=r(2)}catch(t){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),a={},s=a.lib={},u=s.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=s.WordArray=u.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var s=0;s>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new c.init(r,e/2)}},h=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new c.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},d=s.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,f=t.min(4*u,o);if(u){for(var l=0;l>>2];t.sigBytes-=e}},o.BlockCipher=h.extend({cfg:h.cfg.extend({mode:y,padding:g}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),v=o.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),_=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?s.create([1398893684,1701076831]).concat(r).concat(e):e).toString(f)},parse:function(t){var e,r=f.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=s.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),v.create({ciphertext:r,salt:e})}},m=o.SerializableCipher=a.extend({cfg:a.extend({format:_}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),a=i.cfg;return v.create({ciphertext:o,key:r,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),b=(i.kdf={}).OpenSSL={execute:function(t,e,r,n){n||(n=s.random(8));var i=l.create({keySize:e+r}).compute(t,n),o=s.create(i.words.slice(e),4*r);return i.sigBytes=4*e,v.create({key:i,iv:o,salt:n})}},w=o.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:b}),encrypt:function(t,e,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);return n.iv=i.iv,m.decrypt.call(this,t,e,i.key,n)}}))))},function(t,e){t.exports=require("crypto")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={FormData:!0,UniCloudError:!0};Object.defineProperty(e,"FormData",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"UniCloudError",{enumerable:!0,get:function(){return o.default}});var i=u(r(26)),o=u(r(27)),a=r(28);Object.keys(a).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in e&&e[t]===a[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}}))}));var s=r(7);function u(t){return t&&t.__esModule?t:{default:t}}Object.keys(s).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in e&&e[t]===s[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}}))}))},function(t,e,r){var n,i,o,a,s,u,c,f;t.exports=(f=r(0),r(11),r(12),i=(n=f).lib,o=i.Base,a=i.WordArray,s=n.algo,u=s.MD5,c=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:u,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,i=n.hasher.create(),o=a.create(),s=o.words,u=n.keySize,c=n.iterations;s.length>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2,c=s|u;n[o>>>2]|=c<<24-o%4*8,o++}return i.create(n,o)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)},function(t,e,r){var n;t.exports=(n=r(0),function(t){var e=n,r=e.lib,i=r.WordArray,o=r.Hasher,a=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=t[e+0],u=t[e+1],p=t[e+2],d=t[e+3],y=t[e+4],g=t[e+5],v=t[e+6],_=t[e+7],m=t[e+8],b=t[e+9],w=t[e+10],S=t[e+11],E=t[e+12],A=t[e+13],I=t[e+14],N=t[e+15],C=o[0],R=o[1],T=o[2],x=o[3];C=c(C,R,T,x,a,7,s[0]),x=c(x,C,R,T,u,12,s[1]),T=c(T,x,C,R,p,17,s[2]),R=c(R,T,x,C,d,22,s[3]),C=c(C,R,T,x,y,7,s[4]),x=c(x,C,R,T,g,12,s[5]),T=c(T,x,C,R,v,17,s[6]),R=c(R,T,x,C,_,22,s[7]),C=c(C,R,T,x,m,7,s[8]),x=c(x,C,R,T,b,12,s[9]),T=c(T,x,C,R,w,17,s[10]),R=c(R,T,x,C,S,22,s[11]),C=c(C,R,T,x,E,7,s[12]),x=c(x,C,R,T,A,12,s[13]),T=c(T,x,C,R,I,17,s[14]),C=f(C,R=c(R,T,x,C,N,22,s[15]),T,x,u,5,s[16]),x=f(x,C,R,T,v,9,s[17]),T=f(T,x,C,R,S,14,s[18]),R=f(R,T,x,C,a,20,s[19]),C=f(C,R,T,x,g,5,s[20]),x=f(x,C,R,T,w,9,s[21]),T=f(T,x,C,R,N,14,s[22]),R=f(R,T,x,C,y,20,s[23]),C=f(C,R,T,x,b,5,s[24]),x=f(x,C,R,T,I,9,s[25]),T=f(T,x,C,R,d,14,s[26]),R=f(R,T,x,C,m,20,s[27]),C=f(C,R,T,x,A,5,s[28]),x=f(x,C,R,T,p,9,s[29]),T=f(T,x,C,R,_,14,s[30]),C=l(C,R=f(R,T,x,C,E,20,s[31]),T,x,g,4,s[32]),x=l(x,C,R,T,m,11,s[33]),T=l(T,x,C,R,S,16,s[34]),R=l(R,T,x,C,I,23,s[35]),C=l(C,R,T,x,u,4,s[36]),x=l(x,C,R,T,y,11,s[37]),T=l(T,x,C,R,_,16,s[38]),R=l(R,T,x,C,w,23,s[39]),C=l(C,R,T,x,A,4,s[40]),x=l(x,C,R,T,a,11,s[41]),T=l(T,x,C,R,d,16,s[42]),R=l(R,T,x,C,v,23,s[43]),C=l(C,R,T,x,b,4,s[44]),x=l(x,C,R,T,E,11,s[45]),T=l(T,x,C,R,N,16,s[46]),C=h(C,R=l(R,T,x,C,p,23,s[47]),T,x,a,6,s[48]),x=h(x,C,R,T,_,10,s[49]),T=h(T,x,C,R,I,15,s[50]),R=h(R,T,x,C,g,21,s[51]),C=h(C,R,T,x,E,6,s[52]),x=h(x,C,R,T,d,10,s[53]),T=h(T,x,C,R,w,15,s[54]),R=h(R,T,x,C,u,21,s[55]),C=h(C,R,T,x,m,6,s[56]),x=h(x,C,R,T,N,10,s[57]),T=h(T,x,C,R,v,15,s[58]),R=h(R,T,x,C,A,21,s[59]),C=h(C,R,T,x,y,6,s[60]),x=h(x,C,R,T,S,10,s[61]),T=h(T,x,C,R,p,15,s[62]),R=h(R,T,x,C,b,21,s[63]),o[0]=o[0]+C|0,o[1]=o[1]+R|0,o[2]=o[2]+T|0,o[3]=o[3]+x|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var f=u[c];u[c]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,r,n,i,o,a){var s=t+(e&r|~e&n)+i+a;return(s<>>32-o)+e}function f(t,e,r,n,i,o,a){var s=t+(e&n|r&~n)+i+a;return(s<>>32-o)+e}function l(t,e,r,n,i,o,a){var s=t+(e^r^n)+i+a;return(s<>>32-o)+e}function h(t,e,r,n,i,o,a){var s=t+(r^(e|~n))+i+a;return(s<>>32-o)+e}e.MD5=o._createHelper(u),e.HmacMD5=o._createHmacHelper(u)}(Math),n.MD5)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.accMul=function(t,e){if(isNaN(t)||isNaN(e))return NaN;const{value:r,power:n}=y(t),{value:i,power:o}=y(e);return r*i/Math.pow(10,n+o)},e.camel2snake=l,e.camel2snakeJson=function(t){return h(t,"camel2snake")},e.deepClone=function(t){return JSON.parse(JSON.stringify(t))},e.deleteObjectKey=function t(e,r){const n=e.shift();if(!n)return;t(e,r[n]),r[n]&&(Object.keys(r[n]).length<=0||"string"==typeof r[n])&&delete r[n]},e.getDateStr=p,e.getExtension=function(t){return s[t]},e.getFullTimeStr=function(t){return p(t=t||new Date)+" "+d(t)},e.getOffsetDate=function(t){return new Date(Date.now()+6e4*((new Date).getTimezoneOffset()+60*(t||0)))},e.getTimeStr=d,e.hasOwn=o,e.isFn=function(t){return"function"==typeof t},e.isPlainObject=a,e.log=function(){0},e.mime2ext=void 0,e.snake2camel=f,e.snake2camelJson=function(t){return h(t,"snake2camel")};const n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;function o(t,e){return i.call(t,e)}function a(t){return"[object Object]"===n.call(t)}const s={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/svg+xml":"svg","image/bmp":"bmp","image/webp":"webp"};e.mime2ext=s;const u=/_(\w)/g,c=/[A-Z]/g;function f(t){return t.replace(u,(t,e)=>e?e.toUpperCase():"")}function l(t){return t.replace(c,t=>"_"+t.toLowerCase())}function h(t,e){let r,n;switch(e){case"snake2camel":n=f,r=u;break;case"camel2snake":n=l,r=c}for(const i in t)if(o(t,i)&&r.test(i)){const r=n(i);t[r]=t[i],delete t[i],a(t[r])?t[r]=h(t[r],e):Array.isArray(t[r])&&(t[r]=t[r].map(t=>h(t,e)))}return t}function p(t,e="-"){t=t||new Date;const r=[];return r.push(t.getFullYear()),r.push(("00"+(t.getMonth()+1)).substr(-2)),r.push(("00"+t.getDate()).substr(-2)),r.join(e)}function d(t,e=":"){t=t||new Date;const r=[];return r.push(("00"+t.getHours()).substr(-2)),r.push(("00"+t.getMinutes()).substr(-2)),r.push(("00"+t.getSeconds()).substr(-2)),r.join(e)}function y(t){const e=t.toString().split("."),r=e[1]?e[1].length:0;return{value:Number(e.join("")),power:r}}},function(t,e,r){var n,i,o,a,s,u;t.exports=(u=r(0),i=(n=u).lib,o=i.Base,a=i.WordArray,(s=n.x64={}).Word=o.extend({init:function(t,e){this.high=t,this.low=e}}),s.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],n=0;n>>31}var l=(n<<5|n>>>27)+s+u[c];l+=c<20?1518500249+(i&o|~i&a):c<40?1859775393+(i^o^a):c<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),n.SHA1=a._createHelper(c),n.HmacSHA1=a._createHmacHelper(c),f.SHA1)},function(t,e,r){var n,i,o,a;t.exports=(n=r(0),o=(i=n).lib.Base,a=i.enc.Utf8,void(i.algo.HMAC=o.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=a.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),o=this._iKey=e.clone(),s=i.words,u=o.words,c=0;cparseInt(t,10)));case 6:const e=t.split(":"),r=Buffer.alloc(16);let n=0;""===e[e.length-1]&&(e[e.length-1]="0");for(let t=0;to&&(o=n,i=r)):(r=-1,n=0),e.push(s.toString(16))}if(o>0){let t="";const r=e.slice(i+o);e.length=i,0===e.length&&(t+=":"),0===r.length&&(t+=":"),e.push(t,...r)}return e.join(":");default:return""}};const i=Object.create(null),o=/^[0-9.]+$/;function a(t,e){i[t]=e,i[e]=t}e.getOID=function(t){return o.test(t)&&""!==i[t]?t:null==i[t]?"":i[t]},e.getOIDName=function(t){return o.test(t)||""===i[t]?null==i[t]?t:i[t]:t},a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRsaEncryption"),a("1.2.840.113549.1.1.5","sha1WithRsaEncryption"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRsaEncryption"),a("1.2.840.113549.1.1.12","sha384WithRsaEncryption"),a("1.2.840.113549.1.1.13","sha512WithRsaEncryption"),a("1.2.840.10045.2.1","ecEncryption"),a("1.2.840.10045.4.1","ecdsaWithSha1"),a("1.2.840.10045.4.3.2","ecdsaWithSha256"),a("1.2.840.10045.4.3.3","ecdsaWithSha384"),a("1.2.840.10045.4.3.4","ecdsaWithSha512"),a("1.2.840.10040.4.3","dsaWithSha1"),a("2.16.840.1.101.3.4.3.2","dsaWithSha256"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("1.2.840.113549.2.5","md5"),a("1.3.101.110","X25519"),a("1.3.101.111","X448"),a("1.3.101.112","Ed25519"),a("1.3.101.113","Ed448"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.2.7","hmacWithSha1"),a("1.2.840.113549.2.9","hmacWithSha256"),a("1.2.840.113549.2.10","hmacWithSha384"),a("1.2.840.113549.2.11","hmacWithSha512"),a("1.2.840.113549.3.7","3desCBC"),a("2.16.840.1.101.3.4.1.2","aesCBC128"),a("2.16.840.1.101.3.4.1.42","aesCBC256"),a("2.5.4.3","commonName"),a("2.5.4.5","serialName"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.15","businessCategory"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.5.29.2","keyAttributes"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.311.60.2.1.2","jurisdictionST"),a("1.3.6.1.4.1.311.60.2.1.3","jurisdictionC"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping"),a("1.3.6.1.5.5.7.48.1","authorityInfoAccessOcsp"),a("1.3.6.1.5.5.7.48.2","authorityInfoAccessIssuers")},function(t,e,r){"use strict";const n=t=>!("object"!=typeof t||null===t||t instanceof RegExp||t instanceof Error||t instanceof Date);t.exports=function t(e,r,i,o){if(i=Object.assign({deep:!1,target:{}},i),(o=o||new WeakMap).has(e))return o.get(e);o.set(e,i.target);const a=i.target;delete i.target;for(const s of Object.keys(e)){const u=e[s],c=r(s,u,e);let f=c[1];i.deep&&n(f)&&(f=Array.isArray(f)?f.map(e=>n(e)?t(e,r,i,o):e):t(f,r,i,o)),a[c[0]]=f}return a}},function(t,e,r){"use strict";var n=r(14),i=r(42);t.exports=function(t,e){return e=Object.assign({deep:!0},e),n(t,(function(t,e){return[i(t),e]}),e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2),i=r(45),o=r(46),a=r(15),s=r(47),u=r(72),c={RSA:"RSA-SHA1",RSA2:"RSA-SHA256"};function f(t){return{iv:s.enc.Hex.parse(u.padEnd("",32,"0")),key:s.enc.Base64.parse(t)}}e.ALIPAY_ALGORITHM_MAPPING=c,e.aesDecrypt=function(t,e){const{iv:r,key:n}=f(e),i=s.AES.decrypt(t,n,{iv:r});return JSON.parse(i.toString(s.enc.Utf8))},e.sign=function(t,e={},r){let l=Object.assign({method:t,appId:r.appId,charset:r.charset,version:r.version,signType:r.signType,timestamp:i().format("YYYY-MM-DD HH:mm:ss")},u.omit(e,["bizContent","needEncrypt"]));r.appCertSn&&r.alipayRootCertSn&&(l=Object.assign({appCertSn:r.appCertSn,alipayRootCertSn:r.alipayRootCertSn},l)),r.wsServiceUrl&&(l.wsServiceUrl=r.wsServiceUrl);const h=e.bizContent;if(h)if(e.needEncrypt){if(!r.encryptKey)throw new Error("请设置encryptKey参数");l.encryptType="AES",l.bizContent=function(t,e){const{iv:r,key:n}=f(e);return s.AES.encrypt(JSON.stringify(t),n,{iv:r}).toString()}(a(h),r.encryptKey)}else l.bizContent=JSON.stringify(a(h));const p=a(l),d=Object.keys(p).sort().map(t=>{let e=p[t];return"[object String]"!==Array.prototype.toString.call(e)&&(e=JSON.stringify(e)),`${t}=${o.encode(e,r.charset)}`}).join("&"),y=n.createSign(c[r.signType]).update(d,"utf8").sign(r.privateKey,"base64");return Object.assign(p,{sign:y})}},function(t,e,r){var n;t.exports=(n=r(0),function(t){var e=n,r=e.lib,i=r.WordArray,o=r.Hasher,a=e.algo,s=[],u=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(s[i]=r(t.pow(n,.5))),u[i]=r(t.pow(n,1/3)),i++),n++}();var c=[],f=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],l=r[6],h=r[7],p=0;p<64;p++){if(p<16)c[p]=0|t[e+p];else{var d=c[p-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=c[p-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[p]=y+c[p-7]+v+c[p-16]}var _=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),b=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&l)+u[p]+c[p];h=l,l=f,f=s,s=a+b|0,a=o,o=i,i=n,n=b+(m+_)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+l|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(f),e.HmacSHA256=o._createHmacHelper(f)}(Math),n.SHA256)},function(t,e,r){var n;t.exports=(n=r(0),r(8),function(){var t=n,e=t.lib.Hasher,r=t.x64,i=r.Word,o=r.WordArray,a=t.algo;function s(){return i.create.apply(i,arguments)}var u=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=s()}();var f=a.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],l=r[6],h=r[7],p=n.high,d=n.low,y=i.high,g=i.low,v=o.high,_=o.low,m=a.high,b=a.low,w=s.high,S=s.low,E=f.high,A=f.low,I=l.high,N=l.low,C=h.high,R=h.low,T=p,x=d,P=y,O=g,B=v,k=_,D=m,U=b,j=w,M=S,L=E,F=A,K=I,z=N,V=C,$=R,H=0;H<80;H++){var W,q,G=c[H];if(H<16)q=G.high=0|t[e+2*H],W=G.low=0|t[e+2*H+1];else{var J=c[H-15],Y=J.high,Z=J.low,X=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,Q=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),tt=c[H-2],et=tt.high,rt=tt.low,nt=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,it=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),ot=c[H-7],at=ot.high,st=ot.low,ut=c[H-16],ct=ut.high,ft=ut.low;q=(q=(q=X+at+((W=Q+st)>>>0>>0?1:0))+nt+((W+=it)>>>0>>0?1:0))+ct+((W+=ft)>>>0>>0?1:0),G.high=q,G.low=W}var lt,ht=j&L^~j&K,pt=M&F^~M&z,dt=T&P^T&B^P&B,yt=x&O^x&k^O&k,gt=(T>>>28|x<<4)^(T<<30|x>>>2)^(T<<25|x>>>7),vt=(x>>>28|T<<4)^(x<<30|T>>>2)^(x<<25|T>>>7),_t=(j>>>14|M<<18)^(j>>>18|M<<14)^(j<<23|M>>>9),mt=(M>>>14|j<<18)^(M>>>18|j<<14)^(M<<23|j>>>9),bt=u[H],wt=bt.high,St=bt.low,Et=V+_t+((lt=$+mt)>>>0<$>>>0?1:0),At=vt+yt;V=K,$=z,K=L,z=F,L=j,F=M,j=D+(Et=(Et=(Et=Et+ht+((lt+=pt)>>>0>>0?1:0))+wt+((lt+=St)>>>0>>0?1:0))+q+((lt+=W)>>>0>>0?1:0))+((M=U+lt|0)>>>0>>0?1:0)|0,D=B,U=k,B=P,k=O,P=T,O=x,T=Et+(gt+dt+(At>>>0>>0?1:0))+((x=lt+At|0)>>>0>>0?1:0)|0}d=n.low=d+x,n.high=p+T+(d>>>0>>0?1:0),g=i.low=g+O,i.high=y+P+(g>>>0>>0?1:0),_=o.low=_+k,o.high=v+B+(_>>>0>>0?1:0),b=a.low=b+U,a.high=m+D+(b>>>0>>0?1:0),S=s.low=S+M,s.high=w+j+(S>>>0>>0?1:0),A=f.low=A+F,f.high=E+L+(A>>>0>>0?1:0),N=l.low=N+z,l.high=I+K+(N>>>0>>0?1:0),R=h.low=R+$,h.high=C+V+(R>>>0<$>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(n+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(f),t.HmacSHA512=e._createHmacHelper(f)}(),n.SHA512)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(13);e.bytesFromIP=n.bytesFromIP,e.bytesToIP=n.bytesToIP,e.getOID=n.getOID,e.getOIDName=n.getOIDName;var i=r(20);e.PublicKey=i.PublicKey,e.PrivateKey=i.PrivateKey,e.RSAPublicKey=i.RSAPublicKey,e.RSAPrivateKey=i.RSAPrivateKey;var o=r(80);e.Certificate=o.Certificate,e.DistinguishedName=o.DistinguishedName},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(9),i=r(2),o=r(77),a=r(21),s=r(13);e.publicKeyValidator={name:"PublicKeyInfo",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,capture:"publicKeyInfo",value:[{name:"PublicKeyInfo.AlgorithmIdentifier",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"PublicKeyAlgorithmIdentifier.algorithm",class:a.Class.UNIVERSAL,tag:a.Tag.OID,capture:"publicKeyOID"}]},{name:"PublicKeyInfo.PublicKey",class:a.Class.UNIVERSAL,tag:a.Tag.BITSTRING,capture:"publicKey"}]},e.privateKeyValidator={name:"PrivateKeyInfo",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,capture:"privateKeyInfo",value:[{name:"PrivateKeyInfo.Version",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.AlgorithmIdentifier",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"PrivateKeyAlgorithmIdentifier.algorithm",class:a.Class.UNIVERSAL,tag:a.Tag.OID,capture:"privateKeyOID"}]},{name:"PrivateKeyInfo.PrivateKey",class:a.Class.UNIVERSAL,tag:a.Tag.OCTETSTRING,capture:"privateKey"}]};const u={name:"RSAPublicKey",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"RSAPublicKey.modulus",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"publicKeyExponent"}]},c={name:"RSAPrivateKey",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"RSAPrivateKey.version",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyCoefficient"}]},f=[s.getOID("X25519"),s.getOID("X448"),s.getOID("Ed25519"),s.getOID("Ed448")];class l{constructor(t){const r={},n=t.validate(e.publicKeyValidator,r);if(null!=n)throw new Error("Cannot read X.509 public key: "+n.message);this.oid=a.ASN1.parseOID(r.publicKeyOID.bytes),this.algo=s.getOIDName(this.oid),this._pkcs8=t,this._keyRaw=a.ASN1.parseBitString(r.publicKey.bytes).buf,this._finalKey=this._keyRaw,this._finalPEM=""}static fromPEM(t){const e=a.PEM.parse(t)[0];if(e.procType.includes("ENCRYPTED"))throw new Error("Could not convert public key from PEM, PEM is encrypted.");const r=a.ASN1.fromDER(e.body,!0);switch(e.type){case"PUBLIC KEY":return new l(r);case"RSA PUBLIC KEY":const t=a.ASN1.Seq([a.ASN1.Seq([a.ASN1.OID(s.getOID("rsaEncryption")),a.ASN1.Null()]),a.ASN1.BitString(r.DER)]);return new l(t);default:throw new Error("Could not convert public key from PEM, recommend PKCS#8 PEM")}}static addVerifier(t,e){if(""===(t=s.getOID(t)))throw new Error("Invalid object identifier: "+t);if(null!=l._verifiers[t])throw new Error(`Verifier ${t} exists`);l._verifiers[t]=e}get keyRaw(){return this._finalKey}verify(t,e,r){const n=l._verifiers[this.oid];if(null!=n){const o=i.createHash(r).update(t).digest();return n.call(this,o,e)}const o=i.createVerify(r);return o.update(t),o.verify(this.toPEM(),e)}getFingerprint(t,e="PublicKey"){let r;switch(e){case"PublicKeyInfo":r=this._pkcs8.DER;break;case"PublicKey":r=this._keyRaw;break;default:throw new Error(`Unknown fingerprint type "${e}".`)}const n=i.createHash(t);return n.update(r),n.digest()}toASN1(){return this._pkcs8}toDER(){return this._pkcs8.DER}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("PUBLIC KEY",this._pkcs8.DER).toString()),this._finalPEM}toJSON(){return{oid:this.oid,algo:this.algo,publicKey:this._keyRaw}}[n.inspect.custom](t,e){return`<${this.constructor.name} ${n.inspect(this.toJSON(),e)}>`}}l._verifiers=Object.create(null),e.PublicKey=l;class h{constructor(t){const r=Object.create(null),n=t.validate(e.privateKeyValidator,r);if(null!=n)throw new Error("Cannot read X.509 private key: "+n.message);if(this.version=a.ASN1.parseIntegerNum(r.privateKeyVersion.bytes)+1,this.oid=a.ASN1.parseOID(r.privateKeyOID.bytes),this.algo=s.getOIDName(this.oid),this._pkcs8=t,this._keyRaw=r.privateKey.bytes,this._publicKeyRaw=null,this._finalKey=this._keyRaw,this._finalPEM="",f.includes(this.oid))if(this._finalKey=this._keyRaw=a.ASN1.parseDER(this._keyRaw,a.Class.UNIVERSAL,a.Tag.OCTETSTRING).bytes,"1.3.101.112"===this.oid){const t=o.sign.keyPair.fromSeed(this._keyRaw);this._publicKeyRaw=Buffer.from(t.publicKey),this._finalKey=Buffer.from(t.secretKey)}else if(2===this.version)for(const e of t.mustCompound())e.class===a.Class.CONTEXT_SPECIFIC&&1===e.tag&&(this._publicKeyRaw=a.ASN1.parseBitString(e.bytes).buf,this._finalKey=Buffer.concat([this._keyRaw,this._publicKeyRaw]))}static fromPEM(t){const e=a.PEM.parse(t)[0];if(e.procType.includes("ENCRYPTED"))throw new Error("Could not convert private key from PEM, PEM is encrypted.");let r=a.ASN1.fromDER(e.body,!0);switch(e.type){case"PRIVATE KEY":return new h(r);case"RSA PRIVATE KEY":return r=a.ASN1.Seq([r.value[0],a.ASN1.Seq([a.ASN1.OID(s.getOID("rsaEncryption")),a.ASN1.Null()]),new a.ASN1(a.Class.UNIVERSAL,a.Tag.OCTETSTRING,r.DER)]),new h(r);default:throw new Error("Could not convert private key from PEM, recommend PKCS#8 PEM")}}static addSigner(t,e){if(""===(t=s.getOID(t)))throw new Error("Invalid object identifier: "+t);if(null!=h._signers[t])throw new Error(`Signer ${t} exists`);h._signers[t]=e}get keyRaw(){return this._finalKey}get publicKeyRaw(){return this._publicKeyRaw}sign(t,e){const r=h._signers[this.oid];if(null!=r){const n=i.createHash(e).update(t).digest();return r.call(this,n)}const n=i.createSign(e);return n.update(t),n.sign(this.toPEM())}toASN1(){return this._pkcs8}toDER(){return this._pkcs8.DER}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("PRIVATE KEY",this._pkcs8.DER).toString()),this._finalPEM}toJSON(){return{version:this.version,oid:this.oid,algo:this.algo,privateKey:this._keyRaw,publicKey:this._publicKeyRaw}}[n.inspect.custom](t,e){return`<${this.constructor.name} ${n.inspect(this.toJSON(),e)}>`}}h._signers=Object.create(null),e.PrivateKey=h;class p extends l{static fromPublicKey(t){return new p(t.toASN1())}constructor(t){if(super(t),s.getOID(this.oid)!==s.getOID("rsaEncryption"))throw new Error("Invalid RSA public key, unknown OID: "+this.oid);const e=Object.create(null);this._pkcs1=a.ASN1.fromDER(this._keyRaw,!0);const r=this._pkcs1.validate(u,e);if(null!=r)throw new Error("Cannot read RSA public key: "+r.message);this.modulus=a.ASN1.parseIntegerStr(e.publicKeyModulus.bytes),this.exponent=a.ASN1.parseIntegerNum(e.publicKeyExponent.bytes)}toASN1(){return this._pkcs1}toDER(){return this._keyRaw}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("RSA PUBLIC KEY",this._keyRaw).toString()),this._finalPEM}toPublicKeyPEM(){return new a.PEM("PUBLIC KEY",this._pkcs8.DER).toString()}toJSON(){return{oid:this.oid,algo:this.algo,modulus:y(this.modulus),exponent:this.exponent}}[n.inspect.custom](t,e){return`<${this.constructor.name} ${n.inspect(this.toJSON(),e)}>`}}e.RSAPublicKey=p;class d extends h{static fromPrivateKey(t){return new d(t.toASN1())}constructor(t){if(super(t),s.getOID(this.oid)!==s.getOID("rsaEncryption"))throw new Error("Invalid RSA private key, unknown OID: "+this.oid);const e=Object.create(null);this._pkcs1=a.ASN1.fromDER(this._keyRaw,!0);const r=this._pkcs1.validate(c,e);if(null!=r)throw new Error("Cannot read RSA private key: "+r.message);this.publicExponent=a.ASN1.parseIntegerNum(e.privateKeyPublicExponent.bytes),this.privateExponent=a.ASN1.parseIntegerStr(e.privateKeyPrivateExponent.bytes),this.modulus=a.ASN1.parseIntegerStr(e.privateKeyModulus.bytes),this.prime1=a.ASN1.parseIntegerStr(e.privateKeyPrime1.bytes),this.prime2=a.ASN1.parseIntegerStr(e.privateKeyPrime2.bytes),this.exponent1=a.ASN1.parseIntegerStr(e.privateKeyExponent1.bytes),this.exponent2=a.ASN1.parseIntegerStr(e.privateKeyExponent2.bytes),this.coefficient=a.ASN1.parseIntegerStr(e.privateKeyCoefficient.bytes)}toASN1(){return this._pkcs1}toDER(){return this._keyRaw}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("RSA PRIVATE KEY",this._keyRaw).toString()),this._finalPEM}toPrivateKeyPEM(){return new a.PEM("PRIVATE KEY",this._pkcs8.DER).toString()}toJSON(){return{version:this.version,oid:this.oid,algo:this.algo,publicExponent:this.publicExponent,privateExponent:y(this.privateExponent),modulus:y(this.modulus),prime1:y(this.prime1),prime2:y(this.prime2),exponent1:y(this.exponent1),exponent2:y(this.exponent2),coefficient:y(this.coefficient)}}[n.inspect.custom](t,e){return`<${this.constructor.name} ${n.inspect(this.toJSON(),e)}>`}}function y(t){return t.length%8!=0&&t.startsWith("00")?t.slice(2):t}e.RSAPrivateKey=d,l.addVerifier(s.getOID("Ed25519"),(function(t,e){return o.sign.detached.verify(t,e,this.keyRaw)})),h.addSigner(s.getOID("Ed25519"),(function(t){const e=this.keyRaw;if(64!==e.length)throw new Error("Invalid signing key.");return Buffer.from(o.sign.detached(t,e))}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(22);e.BufferVisitor=n.BufferVisitor;var i=r(78);e.PEM=i.PEM;var o=r(79);e.ASN1=o.ASN1,e.Class=o.Class,e.Tag=o.Tag,e.BitString=o.BitString},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BufferVisitor=class{constructor(t,e=0,r=0){this.start=e,this.end=r>e?r:e,this.buf=t}get length(){return this.buf.length}reset(t=0,e=0){return this.start=t,e>=this.start?this.end=e:this.endthis.buf.length){const t=new Error(e);throw t.available=this.buf.length,t.requested=r,t}return this.walk(0),this}mustWalk(t,e){return this.mustHas(t,e),this.walk(t),this}}},function(t,e,r){"use strict";var n=u(r(24)),i=u(r(30)),o=u(r(83)),a=u(r(84)),s=r(3);function u(t){return t&&t.__esModule?t:{default:t}}t.exports={initWeixin:(t={})=>(t.clientType=t.clientType||__ctx__.PLATFORM,(0,s.createApi)(n.default,t)),initAlipay:(t={})=>(t.clientType=t.clientType||__ctx__.PLATFORM,(0,s.createApi)(i.default,t)),initAppleIapPayment:(t={})=>(t.clientType=t.clientType||__ctx__.PLATFORM,(0,s.createApi)(o.default,t)),initWeixinV3:(t={})=>(t.clientType=t.clientType||__ctx__.PLATFORM,(0,s.createApi)(a.default,t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(25)),i=a(r(29)),o=r(3);function a(t){return t&&t.__esModule?t:{default:t}}e.default=class{constructor(t={}){if(!t.appId)throw new Error("appId required");if(!t.mchId)throw new Error("mchId required");if(!t.key)throw new Error("key required");t.signType=t.signType||"MD5",this.options=Object.assign({},t),this._protocols=i.default,this.baseUrl="https://api.mch.weixin.qq.com",this.paths={unifiedOrder:"/pay/unifiedorder",orderQuery:"/pay/orderquery",closeOrder:"/pay/closeorder",refund:"/secapi/pay/refund",refundQuery:"/pay/refundquery",downloadBill:"/pay/downloadbill",downloadFundflow:"/pay/downloadfundflow",getsignkey:"/pay/getsignkey"}}_getSign(t,e){const r=n.default.getSignStr(t)+"&key="+this.options.key;switch(e){case"MD5":return n.default.md5(r).toUpperCase();case"HMAC-SHA256":return n.default.sha256(r,this.options.key).toUpperCase();default:throw new Error("signType Error")}}_normalizeResult(t,e){return t.returnMsg=t.returnMsg||("SUCCESS"===t.returnCode?"ok":"fail"),t.errMsg=`payment.${e} ${t.returnMsg.toLowerCase()}`,t}_parse(t,e,r){const i=n.default.parseXML(t);if("FAIL"===i.return_code)throw new Error(""+i.return_msg);if("getSandboxKey"!==e){if(i.appid!==this.options.appId)throw new Error("appId不匹配");if(i.mch_id!==this.options.mchId)throw new Error("mchId不匹配");if(i.sign!==this._getSign(i,r))throw new Error("返回结果签名错误");i.app_id=i.appid,delete i.appid}if("FAIL"===i.result_code)throw new Error(`${i.err_code} ${i.err_code_des}`);return this._normalizeResult((0,o.snake2camelJson)(i),e)}_parseBill(t,e){const r={};if(n.default.isXML(t)){const e=n.default.parseXML(t);if("FAIL"===e.return_code)throw new Error(""+e.return_msg);if("FAIL"===e.result_code)throw new Error(`${e.err_code} ${e.err_code_des}`)}else r.returnCode="SUCCESS",r.content=t;return this._normalizeResult(r,e)}_getPublicParams(){const{appId:t,mchId:e,subAppId:r,subMchId:i}=this.options;return r?{appid:t,mchId:e,nonceStr:n.default.getNonceStr(),subAppid:r,subMchId:i}:{appid:t,mchId:e,nonceStr:n.default.getNonceStr()}}async _requestWxpay(t,e,r=!1){if(r&&!this.options.pfx)throw new Error("此接口需要微信支付证书(请传入pfx字段)");"getSandboxKey"!==e&&await this._initSandbox();const i=t.signType||this.options.signType;(t=(0,o.camel2snakeJson)(t)).sign=this._getSign(t,i);const a={method:"POST",dataType:"text",data:n.default.buildXML(t),timeout:this.options.timeout};r&&(a.pfx=this.options.pfx,a.passphrase=this.options.mchId);const{status:s,data:u}=await uniCloud.httpclient.request(this.options.sandbox?`${this.baseUrl}/sandboxnew${this.paths[e]}`:`${this.baseUrl}${this.paths[e]}`,a);if(200!==s)throw new Error("request fail");return-1!==["downloadBill","downloadFundflow"].indexOf(e)?this._parseBill(u,e):this._parse(u,e,i)}async getSandboxKey(){const t={mchId:this.options.mchId,nonceStr:n.default.getNonceStr()};return await this._requestWxpay(t,"getSandboxKey")}async _initSandbox(){this.options.sandbox&&!this.options.sandboxKey&&(this.options.key=this.options.sandboxKey=await this.getSandboxKey().sandbox_signkey)}async unifiedOrder(t){let e;if(t.tradeType)e=t.tradeType;else switch(this.options.clientType){case"app-plus":case"app":e="APP";break;case"mp-weixin":default:e="JSAPI"}const r=this._getPublicParams();r.subAppid&&(t.sub_openid=t.openid),("JSAPI"!==e||r.subAppid)&&delete t.openid;const n={...t,...r,spbillCreateIp:t.spbillCreateIp||"127.0.0.1",tradeType:e};return await this._requestWxpay(n,"unifiedOrder")}_getPayParamsByPrepayId(t,e){let r;switch(this.options.clientType){case"app-plus":case"app":r={appid:this.options.subAppId?this.options.subAppId:this.options.appId,noncestr:n.default.getNonceStr(),package:"Sign=WXPay",partnerid:this.options.mchId,prepayid:t,timestamp:""+(Date.now()/1e3|0)},r.sign=this._getSign(r,e);break;case"mp-weixin":default:{const i=""+(Date.now()/1e3|0);r={appId:this.options.subAppId?this.options.subAppId:this.options.appId,nonceStr:n.default.getNonceStr(),package:"prepay_id="+t,timeStamp:i},r.signType=e,r.paySign=this._getSign(r,e),r.timestamp=i;break}}return r}async getOrderInfo(t){let e;if(t.tradeType)e=t.tradeType;else switch(this.options.clientType){case"app-plus":case"app":e="APP";break;case"mp-weixin":default:e="JSAPI"}"JSAPI"!==e&&delete t.openid,t.tradeType=e;const r=await this.unifiedOrder(t);if("NATIVE"===e||"MWEB"===e)return r;if(!r.prepayId)throw new Error(r.errMsg||"获取prepayId失败");return this._getPayParamsByPrepayId(r.prepayId,t.signType||this.options.signType)}async orderQuery(t){const e={...t,...this._getPublicParams()};return await this._requestWxpay(e,"orderQuery")}async closeOrder(t){const e={...t,...this._getPublicParams()};return await this._requestWxpay(e,"closeOrder")}async refund(t){const e={...t,...this._getPublicParams()};return await this._requestWxpay(e,"refund",!0)}async refundQuery(t){const e={...t,...this._getPublicParams()};return await this._requestWxpay(e,"refundQuery")}async downloadBill(t){const e={...t,...this._getPublicParams(),billType:t.billType||"ALL"};return await this._requestWxpay(e,"downloadBill")}async downloadFundflow(t){const e={...t,...this._getPublicParams(),signType:t.signType||"HMAC-SHA256",accountType:t.accountType||"Basic"};return await this._requestWxpay(e,"downloadFundflow",!0)}_getNotifyData(t){let e=t.body;return t.isBase64Encoded&&(e=Buffer.from(e,"base64").toString("utf-8")),n.default.parseXML(e)}_verifyNotify(t,e){const r=this._getNotifyData(t);if("FAIL"===r.return_code)throw new Error(`${r.return_code} ${r.return_msg}`);if(r.appid!==this.options.appId)throw new Error("appId不匹配");if(r.mch_id!==this.options.mchId)throw new Error("mchId不匹配");if(e&&r.sign!==this._getSign(r,this.options.signType))throw new Error("通知验签未通过");const n=(0,o.snake2camelJson)(r);return n.appId=n.appid,delete n.appid,n}verifyPaymentNotify(t){return"payment"===this.checkNotifyType(t)&&this._verifyNotify(t,!0)}verifyRefundNotify(t){if("refund"!==this.checkNotifyType(t))return!1;const e=this._verifyNotify(t,!1),r=(0,o.snake2camelJson)(n.default.parseXML(n.default.decryptData(e.reqInfo,n.default.md5(this.options.key))));return Object.assign(e,r),delete e.reqInfo,e}checkNotifyType(t){const e=this._getNotifyData(t);return"total_fee"in e?"payment":"req_info"in e?"refund":"payment"}},t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(2))&&n.__esModule?n:{default:n},o=r(3);var a={decryptData:function(t,e,r=""){const n=i.default.createDecipheriv("aes-256-ecb",e,r);n.setAutoPadding(!0);let o=n.update(t,"base64","utf8");return o+=n.final("utf8"),o},md5:function(t,e="utf8"){return i.default.createHash("md5").update(t,e).digest("hex")},sha256:function(t,e,r="utf8"){return i.default.createHmac("sha256",e).update(t,r).digest("hex")},getSignStr:function(t){return Object.keys(t).filter(e=>"sign"!==e&&void 0!==t[e]&&""!==t[e]).sort().map(e=>e+"="+((0,o.isPlainObject)(t[e])?JSON.stringify(t[e]):t[e])).join("&")},getNonceStr:function(t=16){let e="";for(;e.length${Object.keys(t).map(e=>(0,o.isPlainObject)(t[e])?`<${e}>`:`<${e}>`).join("")}`},parseXML:function(t){const e=/<(?:xml|root).*?>([\s|\S]*)<\/(?:xml|root)>/.exec(t)[1],r={},n=/<(.*?)>(?:){0,1}<\/.*?>/g;let i=null;for(;i=n.exec(e);)r[i[1]]=i[2];return r},isXML:function(t){return/^(<\?xml.*\?>)?(\r?\n)*(.|\r?\n)*<\/xml>$/i.test(t.trim())}};e.default=a,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=class{constructor(){this._boundary="------FormDataBaseBoundary"+Math.random().toString(36).substring(2),this.dataList=[]}_addData(t){const e=this.dataList[this.dataList.length-1];"string"==typeof t&&"string"==typeof e?this.dataList[this.dataList.length-1]=e+"\r\n"+t:this.dataList.push(t)}append(t,e,r){this._addData("--"+this._boundary);let n=`Content-Disposition: form-data; name="${t}"`;switch(Buffer.isBuffer(e)){case!0:if(!r.filename||!r.contentType)throw new Error("filename and contentType required");n+=`; filename="${r.filename}"`,this._addData(n),this._addData("Content-Type: "+r.contentType),this._addData(""),this._addData(e);break;default:this._addData(""),this._addData(e)}}getHeaders(t){const e={"Content-Type":"multipart/form-data; boundary="+this._boundary};return Object.assign(e,t)}getBuffer(){let t=Buffer.alloc(0);return this.dataList.forEach(e=>{t=Buffer.isBuffer(e)?Buffer.concat([t,e]):Buffer.concat([t,Buffer.from(""+e)]),t=Buffer.concat([t,Buffer.from("\r\n")])}),t=Buffer.concat([t,Buffer.from("--"+this._boundary+"--")]),t}},t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;class n extends Error{constructor(t){super(t.message),this.errMsg=t.message||"",this.errCode=t.code||"",Object.defineProperties(this,{message:{get(){return`errCode: ${this.errCode} | errMsg: `+this.errMsg},set(t){this.errMsg=t}}})}}e.default=n,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createApi=function(t,e){const r=new t(e);return new Proxy(r,{get:function(t,e){if("function"==typeof t[e]&&0!==e.indexOf("_")&&t._protocols&&t._protocols[e]){const r=t._protocols[e];return async function(n){n=i(n,r.args);let o=await t[e](n);return o=i(o,r.returnValue),o}}return t[e]}})};var n=r(7);function i(t={},e){if(!e||!t)return t;const r=["_pre","_purify","_post"];e._pre&&(t=e._pre(t));let i={shouldDelete:new Set([])};if(e._purify){const t=e._purify;for(const e in t)t[e]=new Set(t[e]);i=Object.assign(i,t)}if((0,n.isPlainObject)(e))for(const o in e){const a=e[o];if((0,n.isFn)(a)&&-1===r.indexOf(o))t[o]=a(t);else if("string"==typeof a&&/\./g.test(a)){const e=a.split(".");t[o]=e.reduce((t,e)=>t[e],t),i.shouldDelete.add(a)}else if("string"==typeof a&&/\./g.test(o)){const e=o.split(".");let r=t;for(const[n,i]of e.entries())r[i]||(r[i]=n+1>=e.length?t[a]:{}),r=r[i];i.shouldDelete.add(a)}else"string"==typeof a&&-1===r.indexOf(o)&&(t[o]=t[a],i.shouldDelete.add(a))}else(0,n.isFn)(e)&&(t=e(t));if(i.shouldDelete)for(const e of i.shouldDelete)/\./g.test(e)?(0,n.deleteObjectKey)(e.split("."),t):delete t[e];return e._post&&(t=e._post(t)),t}},function(t,e,r){"use strict";function n(t,e){e.forEach(e=>{void 0!==t[e]&&(t[e]=Number(t[e]))})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={unifiedOrder:{args:{_purify:{shouldDelete:["subject"]}}},getOrderInfo:{args:{_purify:{shouldDelete:["subject"]}}},orderQuery:{returnValue:function(t){n(t,["cashFee","totalFee","couponCount"]),t.couponList=[];const e=t.couponCount||0;for(let r=0;rt.billDate.replace(/-/g,"")}},downloadFundflow:{args:{billDate:t=>t.billDate.replace(/-/g,"")}}};e.default=i,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(3),i=c(r(2)),o=c(r(31)),a=c(r(32)),s=c(r(82)),u=r(16);function c(t){return t&&t.__esModule?t:{default:t}}const f={RSA:"RSA-SHA1",RSA2:"RSA-SHA256"};class l extends a.default{constructor(t){t.sandbox&&(t.gateway="https://openapi.alipaydev.com/gateway.do"),super(t=Object.assign({gateway:"https://openapi.alipay.com/gateway.do",timeout:5e3,charset:"utf-8",version:"1.0",signType:"RSA2",timeOffset:8,keyType:"PKCS8"},t)),this.options=t,this._protocols=s.default}async _request(t,e){const r={};e.notifyUrl&&(r.notifyUrl=e.notifyUrl,delete e.notifyUrl),r.bizContent=e;return await this.exec(t,r,{validateSign:!0})}async unifiedOrder(t){return await this._request("alipay.trade.create",Object.assign({sellerId:this.options.mchId},t))}_getSign(t,e){return(0,u.sign)(t,e,this.config)}formatUrl(t,e){let r=t;const n=["app_id","method","format","charset","sign_type","sign","timestamp","version","notify_url","return_url","auth_token","app_auth_token","app_cert_sn","alipay_root_cert_sn","appCertSn","alipayRootCertSn"];for(const t in e)if(n.indexOf(t)>-1){const n=encodeURIComponent(e[t]);r=`${r}${r.includes("?")?"&":"?"}${t}=${n}`,delete e[t]}return{execParams:e,url:r}}async getOrderInfo(t){let e;if(t.tradeType)e=t.tradeType,delete t.tradeType;else switch(this.options.clientType){case"app-plus":case"app":e="APP";break;case"mp-alipay":default:e="JSAPI"}switch(e){case"APP":{delete t.buyerId;const e={};t.notifyUrl&&(e.notifyUrl=t.notifyUrl,delete t.notifyUrl),e.bizContent=t;const r=this._getSign("alipay.trade.app.pay",e),{url:n,execParams:i}=this.formatUrl("",r);return(n+"&biz_content="+encodeURIComponent(i.biz_content)).substr(1)}case"JSAPI":{const e=await this.unifiedOrder(t);if(!e.tradeNo)throw new Error("获取支付宝交易号失败,详细信息为:"+JSON.stringify(e));return e.tradeNo}case"NATIVE":return await this._request("alipay.trade.precreate",Object.assign({sellerId:this.options.mchId},t));default:throw new Error("不支持的支付类型,支付宝支付下单仅支持App、支付宝小程序、网站二维码支付")}}async orderQuery(t){return await this._request("alipay.trade.query",t)}async cancelOrder(t){return await this._request("alipay.trade.cancel",t)}async closeOrder(t){return await this._request("alipay.trade.close",t)}async refund(t){return await this._request("alipay.trade.refund",t)}async refundQuery(t){return await this._request("alipay.trade.fastpay.refund.query",t)}notifyRSACheck(t,e,r){const n=Object.keys(t).sort().filter(t=>t).map(e=>{let r=t[e];return"[object String]"!==Array.prototype.toString.call(r)&&(r=JSON.stringify(r)),`${e}=${r}`}).join("&");return i.default.createVerify(f[r]).update(n,"utf8").verify(this.config.alipayPublicKey,e,"base64")}_getNotifyData(t){if(!t.headers)throw new Error("通知格式不正确");let e;for(const r in t.headers)"content-type"===r.toLowerCase()&&(e=t.headers[r]);if(!1!==t.isBase64Encoded&&-1===e.indexOf("application/x-www-form-urlencoded"))throw new Error("通知格式不正确");return o.default.parse(t.body)}_verifyNotify(t){const e=this._getNotifyData(t);return!!this.checkNotifySign(e)&&(0,n.snake2camelJson)(e)}verifyPaymentNotify(t){return"payment"===this.checkNotifyType(t)&&this._verifyNotify(t)}verifyRefundNotify(t){return"refund"===this.checkNotifyType(t)&&this._verifyNotify(t)}checkNotifyType(t){return"refund_fee"in this._getNotifyData(t)?"refund":"payment"}}e.default=l,t.exports=e.default},function(t,e){t.exports=require("querystring")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(10),i=r(33),o=r(2),a=r(34),s=r(35),u=r(36),c=r(38),f=r(39),l=r(15),h=r(16),p=r(74),d=r(81);e.default=class{constructor(t){if(!t.appId)throw Error("config.appId is required");if(!t.privateKey)throw Error("config.privateKey is required");const e="PKCS8"===t.keyType?"PRIVATE KEY":"RSA PRIVATE KEY";t.privateKey=this.formatKey(t.privateKey,e),t.appCertPath||t.appCertContent?(t.appCertSn=i.empty(t.appCertContent)?p.getSNFromPath(t.appCertPath,!1):p.getSN(t.appCertContent,!1),t.alipayCertSn=i.empty(t.alipayPublicCertContent)?p.getSNFromPath(t.alipayPublicCertPath,!1):p.getSN(t.alipayPublicCertContent,!1),t.alipayRootCertSn=i.empty(t.alipayRootCertContent)?p.getSNFromPath(t.alipayRootCertPath,!0):p.getSN(t.alipayRootCertContent,!0),t.alipayPublicKey=i.empty(t.alipayPublicCertContent)?p.loadPublicKeyFromPath(t.alipayPublicCertPath):p.loadPublicKey(t.alipayPublicCertContent),t.alipayPublicKey=this.formatKey(t.alipayPublicKey,"PUBLIC KEY")):t.alipayPublicKey&&(t.alipayPublicKey=this.formatKey(t.alipayPublicKey,"PUBLIC KEY")),this.config=Object.assign({urllib:a,gateway:"https://openapi.alipay.com/gateway.do",timeout:5e3,camelcase:!0,signType:"RSA2",charset:"utf-8",version:"1.0"},f(t,{deep:!0})),this.sdkVersion="alipay-sdk-nodejs-"+d.version}formatKey(t,e){const r=t.split("\n").map(t=>t.trim());return r[0].includes(e)&&r.shift(),r[r.length-1].includes(e)&&r.pop(),`-----BEGIN ${e}-----\n${r.join("")}\n-----END ${e}-----`}formatUrl(t,e){let r=t;const n=["app_id","method","format","charset","sign_type","sign","timestamp","version","notify_url","return_url","auth_token","app_auth_token","app_cert_sn","alipay_root_cert_sn","ws_service_url"];for(const t in e)if(n.indexOf(t)>-1){const n=encodeURIComponent(e[t]);r=`${r}${r.includes("?")?"&":"?"}${t}=${n}`,delete e[t]}return{execParams:e,url:r}}multipartExec(t,e={}){const r=this.config;let o={},a={};const p=e.log&&i.fn(e.log.info)?e.log.info:null,d=e.log&&i.fn(e.log.error)?e.log.error:null;e.formData.getFields().forEach(t=>{o[t.name]=t.value,a[t.name]=t.value}),o=f(o,{deep:!0}),a=l(a),e.formData.getFiles().forEach(t=>{const e=c(t.fieldName);a[e]=u.isValid(t.path)?s(t.path):n.createReadStream(t.path)});const y=h.sign(t,o,r),{url:g}=this.formatUrl(r.gateway,y);return p&&p("[AlipaySdk]start exec url: %s, method: %s, params: %s",g,t,JSON.stringify(o)),new Promise((n,i)=>{s.post({url:g,formData:a,json:!1,timeout:r.timeout,headers:{"user-agent":this.sdkVersion}},(o,a,s)=>{if(o)return o.message="[AlipaySdk]exec error",d&&d(o),i(o);p&&p("[AlipaySdk]exec response: %s",s);try{let o,a;const u=JSON.parse(s);if(a=t.replace(/\./g,"_")+"_response",o=u[a],o){return!e.validateSign||this.checkResponseSign(s,a)?n(r.camelcase?f(o,{deep:!0}):o):i({serverResult:s,errorMessage:"[AlipaySdk]验签失败"})}}catch(t){return i({serverResult:s,errorMessage:"[AlipaySdk]Response 格式错误"})}return i({serverResult:s,errorMessage:"[AlipaySdk]HTTP 请求错误"})})})}pageExec(t,e={}){let r={alipaySdk:this.sdkVersion};const n=this.config,o=e.log&&i.fn(e.log.info)?e.log.info:null;e.formData.getFields().forEach(t=>{r[t.name]=t.value}),r=f(r,{deep:!0});const a=h.sign(t,r,n),{url:s,execParams:u}=this.formatUrl(n.gateway,a);return o&&o("[AlipaySdk]start exec url: %s, method: %s, params: %s",s,t,JSON.stringify(r)),"get"===e.formData.getMethod()?new Promise(t=>{const e=Object.keys(u).map(t=>`${t}=${encodeURIComponent(u[t])}`);t(`${s}&${e.join("&")}`)}):new Promise(t=>{const e="alipaySDKSubmit"+Date.now();t(`\n
\n ${Object.keys(u).map(t=>``).join("")}\n
\n