index-b7571be7-1763717014417.js 210 KB

123456789
  1. import{br as mn,bs as Cn,ab as kn,d as Xi,e as $i,r as kt,f as Le,aO as xn,aP as wi,x as Ai,j as xt,k as yt,ak as Sn,b as bn,a5 as Oi,ah as Tn,l as Rn,m as Bn}from"./index-8ca08701-1763717014417.js";var Yi={exports:{}};(function(x,a){(function(r,g){x.exports=g()})(mn,function(){return function(n){var r={};function g(d){if(r[d])return r[d].exports;var h=r[d]={i:d,l:!1,exports:{}};return n[d].call(h.exports,h,h.exports,g),h.l=!0,h.exports}return g.m=n,g.c=r,g.d=function(d,h,S){g.o(d,h)||Object.defineProperty(d,h,{enumerable:!0,get:S})},g.r=function(d){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},g.t=function(d,h){if(h&1&&(d=g(d)),h&8||h&4&&typeof d=="object"&&d&&d.__esModule)return d;var S=Object.create(null);if(g.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:d}),h&2&&typeof d!="string")for(var O in d)g.d(S,O,(function(w){return d[w]}).bind(null,O));return S},g.n=function(d){var h=d&&d.__esModule?function(){return d.default}:function(){return d};return g.d(h,"a",h),h},g.o=function(d,h){return Object.prototype.hasOwnProperty.call(d,h)},g.p="/dist/",g(g.s="./index.js")}({"./index.js":function(n,r,g){var d=g("./src/cos.js");n.exports=d},"./lib/base64.js":function(n,r){var g=function(d){d=d||{};var h=d.Base64,S="2.1.9",O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=function(u){for(var v={},B=0,D=u.length;B<D;B++)v[u.charAt(B)]=B;return v}(O),t=String.fromCharCode,p=function(v){if(v.length<2){var B=v.charCodeAt(0);return B<128?v:B<2048?t(192|B>>>6)+t(128|B&63):t(224|B>>>12&15)+t(128|B>>>6&63)+t(128|B&63)}else{var B=65536+(v.charCodeAt(0)-55296)*1024+(v.charCodeAt(1)-56320);return t(240|B>>>18&7)+t(128|B>>>12&63)+t(128|B>>>6&63)+t(128|B&63)}},l=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,b=function(v){return v.replace(l,p)},k=function(v){var B=[0,2,1][v.length%3],D=v.charCodeAt(0)<<16|(v.length>1?v.charCodeAt(1):0)<<8|(v.length>2?v.charCodeAt(2):0),N=[O.charAt(D>>>18),O.charAt(D>>>12&63),B>=2?"=":O.charAt(D>>>6&63),B>=1?"=":O.charAt(D&63)];return N.join("")},R=d.btoa?function(u){return d.btoa(u)}:function(u){return u.replace(/[\s\S]{1,3}/g,k)},P=function(u){return R(b(u))},M=function(v,B){return B?P(String(v)).replace(/[+\/]/g,function(D){return D=="+"?"-":"_"}).replace(/=/g,""):P(String(v))},F=function(v){return M(v,!0)},U=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),K=function(v){switch(v.length){case 4:var B=(7&v.charCodeAt(0))<<18|(63&v.charCodeAt(1))<<12|(63&v.charCodeAt(2))<<6|63&v.charCodeAt(3),D=B-65536;return t((D>>>10)+55296)+t((D&1023)+56320);case 3:return t((15&v.charCodeAt(0))<<12|(63&v.charCodeAt(1))<<6|63&v.charCodeAt(2));default:return t((31&v.charCodeAt(0))<<6|63&v.charCodeAt(1))}},q=function(v){return v.replace(U,K)},f=function(v){var B=v.length,D=B%4,N=(B>0?w[v.charAt(0)]<<18:0)|(B>1?w[v.charAt(1)]<<12:0)|(B>2?w[v.charAt(2)]<<6:0)|(B>3?w[v.charAt(3)]:0),z=[t(N>>>16),t(N>>>8&255),t(N&255)];return z.length-=[0,0,2,1][D],z.join("")},y=d.atob?function(u){return d.atob(u)}:function(u){return u.replace(/[\s\S]{1,4}/g,f)},A=function(u){return q(y(u))},c=function(v){return A(String(v).replace(/[-_]/g,function(B){return B=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},o=function(){var v=d.Base64;return d.Base64=h,v},i={VERSION:S,atob:y,btoa:R,fromBase64:c,toBase64:M,utob:b,encode:M,encodeURI:F,btou:q,decode:c,noConflict:o};return i}();n.exports=g},"./lib/crypto.js":function(n,r,g){(function(d){var h=g("./node_modules/@babel/runtime/helpers/typeof.js"),S=S||function(O,w){var t={},p=t.lib={},l=function(){},b=p.Base={extend:function(f){l.prototype=this;var y=new l;return f&&y.mixIn(f),y.hasOwnProperty("init")||(y.init=function(){y.$super.init.apply(this,arguments)}),y.init.prototype=y,y.$super=this,y},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var y in f)f.hasOwnProperty(y)&&(this[y]=f[y]);f.hasOwnProperty("toString")&&(this.toString=f.toString)},clone:function(){return this.init.prototype.extend(this)}},k=p.WordArray=b.extend({init:function(f,y){f=this.words=f||[],this.sigBytes=y!=w?y:4*f.length},toString:function(f){return(f||P).stringify(this)},concat:function(f){var y=this.words,A=f.words,c=this.sigBytes;if(f=f.sigBytes,this.clamp(),c%4)for(var o=0;o<f;o++)y[c+o>>>2]|=(A[o>>>2]>>>24-8*(o%4)&255)<<24-8*((c+o)%4);else if(65535<A.length)for(o=0;o<f;o+=4)y[c+o>>>2]=A[o>>>2];else y.push.apply(y,A);return this.sigBytes+=f,this},clamp:function(){var f=this.words,y=this.sigBytes;f[y>>>2]&=4294967295<<32-8*(y%4),f.length=O.ceil(y/4)},clone:function(){var f=b.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var y=[],A=0;A<f;A+=4)y.push(4294967296*O.random()|0);return new k.init(y,f)}}),R=t.enc={},P=R.Hex={stringify:function(f){var y=f.words;f=f.sigBytes;for(var A=[],c=0;c<f;c++){var o=y[c>>>2]>>>24-8*(c%4)&255;A.push((o>>>4).toString(16)),A.push((o&15).toString(16))}return A.join("")},parse:function(f){for(var y=f.length,A=[],c=0;c<y;c+=2)A[c>>>3]|=parseInt(f.substr(c,2),16)<<24-4*(c%8);return new k.init(A,y/2)}},M=R.Latin1={stringify:function(f){var y=f.words;f=f.sigBytes;for(var A=[],c=0;c<f;c++)A.push(String.fromCharCode(y[c>>>2]>>>24-8*(c%4)&255));return A.join("")},parse:function(f){for(var y=f.length,A=[],c=0;c<y;c++)A[c>>>2]|=(f.charCodeAt(c)&255)<<24-8*(c%4);return new k.init(A,y)}},F=R.Utf8={stringify:function(f){try{return decodeURIComponent(escape(M.stringify(f)))}catch(y){throw Error("Malformed UTF-8 data")}},parse:function(f){return M.parse(unescape(encodeURIComponent(f)))}},U=p.BufferedBlockAlgorithm=b.extend({reset:function(){this._data=new k.init,this._nDataBytes=0},_append:function(f){typeof f=="string"&&(f=F.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes},_process:function(f){var y=this._data,A=y.words,c=y.sigBytes,o=this.blockSize,i=c/(4*o),i=f?O.ceil(i):O.max((i|0)-this._minBufferSize,0);if(f=i*o,c=O.min(4*f,c),f){for(var u=0;u<f;u+=o)this._doProcessBlock(A,u);u=A.splice(0,f),y.sigBytes-=c}return new k.init(u,c)},clone:function(){var f=b.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0});p.Hasher=U.extend({cfg:b.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset()},reset:function(){U.reset.call(this),this._doReset()},update:function(f){return this._append(f),this._process(),this},finalize:function(f){return f&&this._append(f),this._doFinalize()},blockSize:16,_createHelper:function(f){return function(y,A){return new f.init(A).finalize(y)}},_createHmacHelper:function(f){return function(y,A){return new K.HMAC.init(f,A).finalize(y)}}});var K=t.algo={};return t}(Math);(function(){var O=S,l=O.lib,w=l.WordArray,t=l.Hasher,p=[],l=O.algo.SHA1=t.extend({_doReset:function(){this._hash=new w.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(k,R){for(var P=this._hash.words,M=P[0],F=P[1],U=P[2],K=P[3],q=P[4],f=0;80>f;f++){if(16>f)p[f]=k[R+f]|0;else{var y=p[f-3]^p[f-8]^p[f-14]^p[f-16];p[f]=y<<1|y>>>31}y=(M<<5|M>>>27)+q+p[f],y=20>f?y+((F&U|~F&K)+1518500249):40>f?y+((F^U^K)+1859775393):60>f?y+((F&U|F&K|U&K)-1894007588):y+((F^U^K)-899497514),q=K,K=U,U=F<<30|F>>>2,F=M,M=y}P[0]=P[0]+M|0,P[1]=P[1]+F|0,P[2]=P[2]+U|0,P[3]=P[3]+K|0,P[4]=P[4]+q|0},_doFinalize:function(){var k=this._data,R=k.words,P=8*this._nDataBytes,M=8*k.sigBytes;return R[M>>>5]|=128<<24-M%32,R[(M+64>>>9<<4)+14]=Math.floor(P/4294967296),R[(M+64>>>9<<4)+15]=P,k.sigBytes=4*R.length,this._process(),this._hash},clone:function(){var k=t.clone.call(this);return k._hash=this._hash.clone(),k}});O.SHA1=t._createHelper(l),O.HmacSHA1=t._createHmacHelper(l)})(),function(){var O=S,w=O.enc.Utf8;O.algo.HMAC=O.lib.Base.extend({init:function(p,l){p=this._hasher=new p.init,typeof l=="string"&&(l=w.parse(l));var b=p.blockSize,k=4*b;l.sigBytes>k&&(l=p.finalize(l)),l.clamp();for(var R=this._oKey=l.clone(),P=this._iKey=l.clone(),M=R.words,F=P.words,U=0;U<b;U++)M[U]^=1549556828,F[U]^=909522486;R.sigBytes=P.sigBytes=k,this.reset()},reset:function(){var p=this._hasher;p.reset(),p.update(this._iKey)},update:function(p){return this._hasher.update(p),this},finalize:function(p){var l=this._hasher;return p=l.finalize(p),l.reset(),l.finalize(this._oKey.clone().concat(p))}})}(),function(){var O=S,w=O.lib,t=w.WordArray,p=O.enc;p.Base64={stringify:function(b){var k=b.words,R=b.sigBytes,P=this._map;b.clamp();for(var M=[],F=0;F<R;F+=3)for(var U=k[F>>>2]>>>24-F%4*8&255,K=k[F+1>>>2]>>>24-(F+1)%4*8&255,q=k[F+2>>>2]>>>24-(F+2)%4*8&255,f=U<<16|K<<8|q,y=0;y<4&&F+y*.75<R;y++)M.push(P.charAt(f>>>6*(3-y)&63));var A=P.charAt(64);if(A)for(;M.length%4;)M.push(A);return M.join("")},parse:function(b){var k=b.length,R=this._map,P=R.charAt(64);if(P){var M=b.indexOf(P);M!=-1&&(k=M)}for(var F=[],U=0,K=0;K<k;K++)if(K%4){var q=R.indexOf(b.charAt(K-1))<<K%4*2,f=R.indexOf(b.charAt(K))>>>6-K%4*2;F[U>>>2]|=(q|f)<<24-U%4*8,U++}return t.create(F,U)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),h(d)==="object"?d.exports=S:window.CryptoJS=S}).call(this,g("./node_modules/webpack/buildin/module.js")(n))},"./lib/md5.js":function(n,r,g){(function(d){var h,S=g("./node_modules/@babel/runtime/helpers/typeof.js");(function(){var O=(typeof window>"u"?"undefined":S(window))==="object",w=O?window:{};w.JS_MD5_NO_WINDOW&&(O=!1);var t=!O&&(typeof self>"u"?"undefined":S(self))==="object";t&&(w=self);var p=!w.JS_MD5_NO_COMMON_JS&&S(d)==="object"&&d.exports,l=g("./node_modules/webpack/buildin/amd-options.js"),b=!w.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",k="0123456789abcdef".split(""),R=[128,32768,8388608,-2147483648],P=[0,8,16,24],M=["hex","array","digest","buffer","arrayBuffer","base64"],F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),U=[],K;if(b){var q=new ArrayBuffer(68);K=new Uint8Array(q),U=new Uint32Array(q)}(w.JS_MD5_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(o){return Object.prototype.toString.call(o)==="[object Array]"}),b&&(w.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(o){return S(o)==="object"&&o.buffer&&o.buffer.constructor===ArrayBuffer});var f=function(i){return function(u,v){return new A(!0).update(u,v)[i]()}},y=function(){var i=f("hex");i.getCtx=i.create=function(){return new A},i.update=function(B){return i.create().update(B)};for(var u=0;u<M.length;++u){var v=M[u];i[v]=f(v)}return i};function A(o){if(o)U[0]=U[16]=U[1]=U[2]=U[3]=U[4]=U[5]=U[6]=U[7]=U[8]=U[9]=U[10]=U[11]=U[12]=U[13]=U[14]=U[15]=0,this.blocks=U,this.buffer8=K;else if(b){var i=new ArrayBuffer(68);this.buffer8=new Uint8Array(i),this.blocks=new Uint32Array(i)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}A.prototype.update=function(o,i){if(!this.finalized){for(var u,v=0,B,D=o.length,N=this.blocks,z=this.buffer8;v<D;){if(this.hashed&&(this.hashed=!1,N[0]=N[16],N[16]=N[1]=N[2]=N[3]=N[4]=N[5]=N[6]=N[7]=N[8]=N[9]=N[10]=N[11]=N[12]=N[13]=N[14]=N[15]=0),b)for(B=this.start;v<D&&B<64;++v)u=o.charCodeAt(v),i||u<128?z[B++]=u:u<2048?(z[B++]=192|u>>6,z[B++]=128|u&63):u<55296||u>=57344?(z[B++]=224|u>>12,z[B++]=128|u>>6&63,z[B++]=128|u&63):(u=65536+((u&1023)<<10|o.charCodeAt(++v)&1023),z[B++]=240|u>>18,z[B++]=128|u>>12&63,z[B++]=128|u>>6&63,z[B++]=128|u&63);else for(B=this.start;v<D&&B<64;++v)u=o.charCodeAt(v),i||u<128?N[B>>2]|=u<<P[B++&3]:u<2048?(N[B>>2]|=(192|u>>6)<<P[B++&3],N[B>>2]|=(128|u&63)<<P[B++&3]):u<55296||u>=57344?(N[B>>2]|=(224|u>>12)<<P[B++&3],N[B>>2]|=(128|u>>6&63)<<P[B++&3],N[B>>2]|=(128|u&63)<<P[B++&3]):(u=65536+((u&1023)<<10|o.charCodeAt(++v)&1023),N[B>>2]|=(240|u>>18)<<P[B++&3],N[B>>2]|=(128|u>>12&63)<<P[B++&3],N[B>>2]|=(128|u>>6&63)<<P[B++&3],N[B>>2]|=(128|u&63)<<P[B++&3]);this.lastByteIndex=B,this.bytes+=B-this.start,B>=64?(this.start=B-64,this.hash(),this.hashed=!0):this.start=B}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},A.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var o=this.blocks,i=this.lastByteIndex;o[i>>2]|=R[i&3],i>=56&&(this.hashed||this.hash(),o[0]=o[16],o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),o[14]=this.bytes<<3,o[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},A.prototype.hash=function(){var o,i,u,v,B,D,N=this.blocks;this.first?(o=N[0]-680876937,o=(o<<7|o>>>25)-271733879<<0,v=(-1732584194^o&2004318071)+N[1]-117830708,v=(v<<12|v>>>20)+o<<0,u=(-271733879^v&(o^-271733879))+N[2]-1126478375,u=(u<<17|u>>>15)+v<<0,i=(o^u&(v^o))+N[3]-1316259209,i=(i<<22|i>>>10)+u<<0):(o=this.h0,i=this.h1,u=this.h2,v=this.h3,o+=(v^i&(u^v))+N[0]-680876936,o=(o<<7|o>>>25)+i<<0,v+=(u^o&(i^u))+N[1]-389564586,v=(v<<12|v>>>20)+o<<0,u+=(i^v&(o^i))+N[2]+606105819,u=(u<<17|u>>>15)+v<<0,i+=(o^u&(v^o))+N[3]-1044525330,i=(i<<22|i>>>10)+u<<0),o+=(v^i&(u^v))+N[4]-176418897,o=(o<<7|o>>>25)+i<<0,v+=(u^o&(i^u))+N[5]+1200080426,v=(v<<12|v>>>20)+o<<0,u+=(i^v&(o^i))+N[6]-1473231341,u=(u<<17|u>>>15)+v<<0,i+=(o^u&(v^o))+N[7]-45705983,i=(i<<22|i>>>10)+u<<0,o+=(v^i&(u^v))+N[8]+1770035416,o=(o<<7|o>>>25)+i<<0,v+=(u^o&(i^u))+N[9]-1958414417,v=(v<<12|v>>>20)+o<<0,u+=(i^v&(o^i))+N[10]-42063,u=(u<<17|u>>>15)+v<<0,i+=(o^u&(v^o))+N[11]-1990404162,i=(i<<22|i>>>10)+u<<0,o+=(v^i&(u^v))+N[12]+1804603682,o=(o<<7|o>>>25)+i<<0,v+=(u^o&(i^u))+N[13]-40341101,v=(v<<12|v>>>20)+o<<0,u+=(i^v&(o^i))+N[14]-1502002290,u=(u<<17|u>>>15)+v<<0,i+=(o^u&(v^o))+N[15]+1236535329,i=(i<<22|i>>>10)+u<<0,o+=(u^v&(i^u))+N[1]-165796510,o=(o<<5|o>>>27)+i<<0,v+=(i^u&(o^i))+N[6]-1069501632,v=(v<<9|v>>>23)+o<<0,u+=(o^i&(v^o))+N[11]+643717713,u=(u<<14|u>>>18)+v<<0,i+=(v^o&(u^v))+N[0]-373897302,i=(i<<20|i>>>12)+u<<0,o+=(u^v&(i^u))+N[5]-701558691,o=(o<<5|o>>>27)+i<<0,v+=(i^u&(o^i))+N[10]+38016083,v=(v<<9|v>>>23)+o<<0,u+=(o^i&(v^o))+N[15]-660478335,u=(u<<14|u>>>18)+v<<0,i+=(v^o&(u^v))+N[4]-405537848,i=(i<<20|i>>>12)+u<<0,o+=(u^v&(i^u))+N[9]+568446438,o=(o<<5|o>>>27)+i<<0,v+=(i^u&(o^i))+N[14]-1019803690,v=(v<<9|v>>>23)+o<<0,u+=(o^i&(v^o))+N[3]-187363961,u=(u<<14|u>>>18)+v<<0,i+=(v^o&(u^v))+N[8]+1163531501,i=(i<<20|i>>>12)+u<<0,o+=(u^v&(i^u))+N[13]-1444681467,o=(o<<5|o>>>27)+i<<0,v+=(i^u&(o^i))+N[2]-51403784,v=(v<<9|v>>>23)+o<<0,u+=(o^i&(v^o))+N[7]+1735328473,u=(u<<14|u>>>18)+v<<0,i+=(v^o&(u^v))+N[12]-1926607734,i=(i<<20|i>>>12)+u<<0,B=i^u,o+=(B^v)+N[5]-378558,o=(o<<4|o>>>28)+i<<0,v+=(B^o)+N[8]-2022574463,v=(v<<11|v>>>21)+o<<0,D=v^o,u+=(D^i)+N[11]+1839030562,u=(u<<16|u>>>16)+v<<0,i+=(D^u)+N[14]-35309556,i=(i<<23|i>>>9)+u<<0,B=i^u,o+=(B^v)+N[1]-1530992060,o=(o<<4|o>>>28)+i<<0,v+=(B^o)+N[4]+1272893353,v=(v<<11|v>>>21)+o<<0,D=v^o,u+=(D^i)+N[7]-155497632,u=(u<<16|u>>>16)+v<<0,i+=(D^u)+N[10]-1094730640,i=(i<<23|i>>>9)+u<<0,B=i^u,o+=(B^v)+N[13]+681279174,o=(o<<4|o>>>28)+i<<0,v+=(B^o)+N[0]-358537222,v=(v<<11|v>>>21)+o<<0,D=v^o,u+=(D^i)+N[3]-722521979,u=(u<<16|u>>>16)+v<<0,i+=(D^u)+N[6]+76029189,i=(i<<23|i>>>9)+u<<0,B=i^u,o+=(B^v)+N[9]-640364487,o=(o<<4|o>>>28)+i<<0,v+=(B^o)+N[12]-421815835,v=(v<<11|v>>>21)+o<<0,D=v^o,u+=(D^i)+N[15]+530742520,u=(u<<16|u>>>16)+v<<0,i+=(D^u)+N[2]-995338651,i=(i<<23|i>>>9)+u<<0,o+=(u^(i|~v))+N[0]-198630844,o=(o<<6|o>>>26)+i<<0,v+=(i^(o|~u))+N[7]+1126891415,v=(v<<10|v>>>22)+o<<0,u+=(o^(v|~i))+N[14]-1416354905,u=(u<<15|u>>>17)+v<<0,i+=(v^(u|~o))+N[5]-57434055,i=(i<<21|i>>>11)+u<<0,o+=(u^(i|~v))+N[12]+1700485571,o=(o<<6|o>>>26)+i<<0,v+=(i^(o|~u))+N[3]-1894986606,v=(v<<10|v>>>22)+o<<0,u+=(o^(v|~i))+N[10]-1051523,u=(u<<15|u>>>17)+v<<0,i+=(v^(u|~o))+N[1]-2054922799,i=(i<<21|i>>>11)+u<<0,o+=(u^(i|~v))+N[8]+1873313359,o=(o<<6|o>>>26)+i<<0,v+=(i^(o|~u))+N[15]-30611744,v=(v<<10|v>>>22)+o<<0,u+=(o^(v|~i))+N[6]-1560198380,u=(u<<15|u>>>17)+v<<0,i+=(v^(u|~o))+N[13]+1309151649,i=(i<<21|i>>>11)+u<<0,o+=(u^(i|~v))+N[4]-145523070,o=(o<<6|o>>>26)+i<<0,v+=(i^(o|~u))+N[11]-1120210379,v=(v<<10|v>>>22)+o<<0,u+=(o^(v|~i))+N[2]+718787259,u=(u<<15|u>>>17)+v<<0,i+=(v^(u|~o))+N[9]-343485551,i=(i<<21|i>>>11)+u<<0,this.first?(this.h0=o+1732584193<<0,this.h1=i-271733879<<0,this.h2=u-1732584194<<0,this.h3=v+271733878<<0,this.first=!1):(this.h0=this.h0+o<<0,this.h1=this.h1+i<<0,this.h2=this.h2+u<<0,this.h3=this.h3+v<<0)},A.prototype.hex=function(){this.finalize();var o=this.h0,i=this.h1,u=this.h2,v=this.h3;return k[o>>4&15]+k[o&15]+k[o>>12&15]+k[o>>8&15]+k[o>>20&15]+k[o>>16&15]+k[o>>28&15]+k[o>>24&15]+k[i>>4&15]+k[i&15]+k[i>>12&15]+k[i>>8&15]+k[i>>20&15]+k[i>>16&15]+k[i>>28&15]+k[i>>24&15]+k[u>>4&15]+k[u&15]+k[u>>12&15]+k[u>>8&15]+k[u>>20&15]+k[u>>16&15]+k[u>>28&15]+k[u>>24&15]+k[v>>4&15]+k[v&15]+k[v>>12&15]+k[v>>8&15]+k[v>>20&15]+k[v>>16&15]+k[v>>28&15]+k[v>>24&15]},A.prototype.toString=A.prototype.hex,A.prototype.digest=function(o){if(o==="hex")return this.hex();this.finalize();var i=this.h0,u=this.h1,v=this.h2,B=this.h3,D=[i&255,i>>8&255,i>>16&255,i>>24&255,u&255,u>>8&255,u>>16&255,u>>24&255,v&255,v>>8&255,v>>16&255,v>>24&255,B&255,B>>8&255,B>>16&255,B>>24&255];return D},A.prototype.array=A.prototype.digest,A.prototype.arrayBuffer=function(){this.finalize();var o=new ArrayBuffer(16),i=new Uint32Array(o);return i[0]=this.h0,i[1]=this.h1,i[2]=this.h2,i[3]=this.h3,o},A.prototype.buffer=A.prototype.arrayBuffer,A.prototype.base64=function(){for(var o,i,u,v="",B=this.array(),D=0;D<15;)o=B[D++],i=B[D++],u=B[D++],v+=F[o>>>2]+F[(o<<4|i>>>4)&63]+F[(i<<2|u>>>6)&63]+F[u&63];return o=B[D],v+=F[o>>>2]+F[o<<4&63]+"==",v};var c=y();p?d.exports=c:(w.md5=c,l&&(h=(function(){return c}).call(c,g,c,d),h!==void 0&&(d.exports=h)))})()}).call(this,g("./node_modules/webpack/buildin/module.js")(n))},"./lib/request.js":function(n,r,g){var d=g("./node_modules/@babel/runtime/helpers/typeof.js"),h=function(l){switch(d(l)){case"string":return l;case"boolean":return l?"true":"false";case"number":return isFinite(l)?l:"";default:return""}},S=function(l,b,k,R){return b=b||"&",k=k||"=",l===null&&(l=void 0),d(l)==="object"?Object.keys(l).map(function(P){var M=encodeURIComponent(h(P))+k;return Array.isArray(l[P])?l[P].map(function(F){return M+encodeURIComponent(h(F))}).join(b):M+encodeURIComponent(h(l[P]))}).filter(Boolean).join(b):R?encodeURIComponent(h(R))+k+encodeURIComponent(h(l)):""},O=function(l,b,k){var R={},P=b.getAllResponseHeaders();return P&&P.length>0&&P.trim().split("\n").forEach(function(M){if(M){var F=M.indexOf(":"),U=M.substr(0,F).trim().toLowerCase(),K=M.substr(F+1).trim();R[U]=K}}),{error:l,statusCode:b.status,statusMessage:b.statusText,headers:R,body:k}},w=function(l,b){return!b&&b==="text"?l.responseText:l.response},t=function(l,b){var k=(l.method||"GET").toUpperCase(),R=l.url;if(l.qs){var P=S(l.qs);P&&(R+=(R.indexOf("?")===-1?"?":"&")+P)}var M=new XMLHttpRequest;if(M.open(k,R,!0),M.responseType=l.dataType||"text",l.xhrFields)for(var F in l.xhrFields)M[F]=l.xhrFields[F];var U=l.headers;if(U)for(var K in U)U.hasOwnProperty(K)&&K.toLowerCase()!=="content-length"&&K.toLowerCase()!=="user-agent"&&K.toLowerCase()!=="origin"&&K.toLowerCase()!=="host"&&M.setRequestHeader(K,U[K]);return l.onProgress&&M.upload&&(M.upload.onprogress=l.onProgress),l.onDownloadProgress&&(M.onprogress=l.onDownloadProgress),l.timeout&&(M.timeout=l.timeout),M.ontimeout=function(q){var f=new Error("timeout");b(O(f,M))},M.onload=function(){b(O(null,M,w(M,l.dataType)))},M.onerror=function(q){var f=w(M,l.dataType);if(f)b(O(null,M,f));else{var y=M.statusText;!y&&M.status===0&&(y=new Error("CORS blocked or network error")),b(O(y,M,f))}},M.send(l.body||""),M};n.exports=t},"./node_modules/@babel/runtime/helpers/classCallCheck.js":function(n,r){function g(d,h){if(!(d instanceof h))throw new TypeError("Cannot call a class as a function")}n.exports=g,n.exports.__esModule=!0,n.exports.default=n.exports},"./node_modules/@babel/runtime/helpers/createClass.js":function(n,r,g){var d=g("./node_modules/@babel/runtime/helpers/toPropertyKey.js");function h(O,w){for(var t=0;t<w.length;t++){var p=w[t];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(O,d(p.key),p)}}function S(O,w,t){return w&&h(O.prototype,w),t&&h(O,t),Object.defineProperty(O,"prototype",{writable:!1}),O}n.exports=S,n.exports.__esModule=!0,n.exports.default=n.exports},"./node_modules/@babel/runtime/helpers/defineProperty.js":function(n,r,g){var d=g("./node_modules/@babel/runtime/helpers/toPropertyKey.js");function h(S,O,w){return(O=d(O))in S?Object.defineProperty(S,O,{value:w,enumerable:!0,configurable:!0,writable:!0}):S[O]=w,S}n.exports=h,n.exports.__esModule=!0,n.exports.default=n.exports},"./node_modules/@babel/runtime/helpers/toPrimitive.js":function(n,r,g){var d=g("./node_modules/@babel/runtime/helpers/typeof.js").default;function h(S,O){if(d(S)!="object"||!S)return S;var w=S[Symbol.toPrimitive];if(w!==void 0){var t=w.call(S,O||"default");if(d(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(S)}n.exports=h,n.exports.__esModule=!0,n.exports.default=n.exports},"./node_modules/@babel/runtime/helpers/toPropertyKey.js":function(n,r,g){var d=g("./node_modules/@babel/runtime/helpers/typeof.js").default,h=g("./node_modules/@babel/runtime/helpers/toPrimitive.js");function S(O){var w=h(O,"string");return d(w)=="symbol"?w:w+""}n.exports=S,n.exports.__esModule=!0,n.exports.default=n.exports},"./node_modules/@babel/runtime/helpers/typeof.js":function(n,r){function g(d){"@babel/helpers - typeof";return n.exports=g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},n.exports.__esModule=!0,n.exports.default=n.exports,g(d)}n.exports=g,n.exports.__esModule=!0,n.exports.default=n.exports},"./node_modules/fast-xml-parser/src/fxp.js":function(n,r,g){const d=g("./node_modules/fast-xml-parser/src/validator.js"),h=g("./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"),S=g("./node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js");n.exports={XMLParser:h,XMLValidator:d,XMLBuilder:S}},"./node_modules/fast-xml-parser/src/ignoreAttributes.js":function(n,r){function g(d){return typeof d=="function"?d:Array.isArray(d)?h=>{for(const S of d)if(typeof S=="string"&&h===S||S instanceof RegExp&&S.test(h))return!0}:()=>!1}n.exports=g},"./node_modules/fast-xml-parser/src/util.js":function(n,r,g){const d=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",h=d+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",S="["+d+"]["+h+"]*",O=new RegExp("^"+S+"$"),w=function(p,l){const b=[];let k=l.exec(p);for(;k;){const R=[];R.startIndex=l.lastIndex-k[0].length;const P=k.length;for(let M=0;M<P;M++)R.push(k[M]);b.push(R),k=l.exec(p)}return b},t=function(p){const l=O.exec(p);return!(l===null||typeof l>"u")};r.isExist=function(p){return typeof p<"u"},r.isEmptyObject=function(p){return Object.keys(p).length===0},r.merge=function(p,l,b){if(l){const k=Object.keys(l),R=k.length;for(let P=0;P<R;P++)b==="strict"?p[k[P]]=[l[k[P]]]:p[k[P]]=l[k[P]]}},r.getValue=function(p){return r.isExist(p)?p:""},r.isName=t,r.getAllMatches=w,r.nameRegexp=S},"./node_modules/fast-xml-parser/src/validator.js":function(n,r,g){const d=g("./node_modules/fast-xml-parser/src/util.js"),h={allowBooleanAttributes:!1,unpairedTags:[]};r.validate=function(f,y){y=Object.assign({},h,y);const A=[];let c=!1,o=!1;f[0]==="\uFEFF"&&(f=f.substr(1));for(let i=0;i<f.length;i++)if(f[i]==="<"&&f[i+1]==="?"){if(i+=2,i=O(f,i),i.err)return i}else if(f[i]==="<"){let u=i;if(i++,f[i]==="!"){i=w(f,i);continue}else{let v=!1;f[i]==="/"&&(v=!0,i++);let B="";for(;i<f.length&&f[i]!==">"&&f[i]!==" "&&f[i]!==" "&&f[i]!=="\n"&&f[i]!=="\r";i++)B+=f[i];if(B=B.trim(),B[B.length-1]==="/"&&(B=B.substring(0,B.length-1),i--),!U(B)){let z;return B.trim().length===0?z="Invalid space after '<'.":z="Tag '"+B+"' is an invalid name.",M("InvalidTag",z,K(f,i))}const D=l(f,i);if(D===!1)return M("InvalidAttr","Attributes for '"+B+"' have open quote.",K(f,i));let N=D.value;if(i=D.index,N[N.length-1]==="/"){const z=i-N.length;N=N.substring(0,N.length-1);const V=k(N,y);if(V===!0)c=!0;else return M(V.err.code,V.err.msg,K(f,z+V.err.line))}else if(v)if(D.tagClosed){if(N.trim().length>0)return M("InvalidTag","Closing tag '"+B+"' can't have attributes or invalid starting.",K(f,u));if(A.length===0)return M("InvalidTag","Closing tag '"+B+"' has not been opened.",K(f,u));{const z=A.pop();if(B!==z.tagName){let V=K(f,z.tagStartPos);return M("InvalidTag","Expected closing tag '"+z.tagName+"' (opened in line "+V.line+", col "+V.col+") instead of closing tag '"+B+"'.",K(f,u))}A.length==0&&(o=!0)}}else return M("InvalidTag","Closing tag '"+B+"' doesn't have proper closing.",K(f,i));else{const z=k(N,y);if(z!==!0)return M(z.err.code,z.err.msg,K(f,i-N.length+z.err.line));if(o===!0)return M("InvalidXml","Multiple possible root nodes found.",K(f,i));y.unpairedTags.indexOf(B)!==-1||A.push({tagName:B,tagStartPos:u}),c=!0}for(i++;i<f.length;i++)if(f[i]==="<")if(f[i+1]==="!"){i++,i=w(f,i);continue}else if(f[i+1]==="?"){if(i=O(f,++i),i.err)return i}else break;else if(f[i]==="&"){const z=P(f,i);if(z==-1)return M("InvalidChar","char '&' is not expected.",K(f,i));i=z}else if(o===!0&&!S(f[i]))return M("InvalidXml","Extra text at the end",K(f,i));f[i]==="<"&&i--}}else{if(S(f[i]))continue;return M("InvalidChar","char '"+f[i]+"' is not expected.",K(f,i))}if(c){if(A.length==1)return M("InvalidTag","Unclosed tag '"+A[0].tagName+"'.",K(f,A[0].tagStartPos));if(A.length>0)return M("InvalidXml","Invalid '"+JSON.stringify(A.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return M("InvalidXml","Start tag expected.",1);return!0};function S(f){return f===" "||f===" "||f==="\n"||f==="\r"}function O(f,y){const A=y;for(;y<f.length;y++)if(f[y]=="?"||f[y]==" "){const c=f.substr(A,y-A);if(y>5&&c==="xml")return M("InvalidXml","XML declaration allowed only at the start of the document.",K(f,y));if(f[y]=="?"&&f[y+1]==">"){y++;break}else continue}return y}function w(f,y){if(f.length>y+5&&f[y+1]==="-"&&f[y+2]==="-"){for(y+=3;y<f.length;y++)if(f[y]==="-"&&f[y+1]==="-"&&f[y+2]===">"){y+=2;break}}else if(f.length>y+8&&f[y+1]==="D"&&f[y+2]==="O"&&f[y+3]==="C"&&f[y+4]==="T"&&f[y+5]==="Y"&&f[y+6]==="P"&&f[y+7]==="E"){let A=1;for(y+=8;y<f.length;y++)if(f[y]==="<")A++;else if(f[y]===">"&&(A--,A===0))break}else if(f.length>y+9&&f[y+1]==="["&&f[y+2]==="C"&&f[y+3]==="D"&&f[y+4]==="A"&&f[y+5]==="T"&&f[y+6]==="A"&&f[y+7]==="["){for(y+=8;y<f.length;y++)if(f[y]==="]"&&f[y+1]==="]"&&f[y+2]===">"){y+=2;break}}return y}const t='"',p="'";function l(f,y){let A="",c="",o=!1;for(;y<f.length;y++){if(f[y]===t||f[y]===p)c===""?c=f[y]:c!==f[y]||(c="");else if(f[y]===">"&&c===""){o=!0;break}A+=f[y]}return c!==""?!1:{value:A,index:y,tagClosed:o}}const b=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function k(f,y){const A=d.getAllMatches(f,b),c={};for(let o=0;o<A.length;o++){if(A[o][1].length===0)return M("InvalidAttr","Attribute '"+A[o][2]+"' has no space in starting.",q(A[o]));if(A[o][3]!==void 0&&A[o][4]===void 0)return M("InvalidAttr","Attribute '"+A[o][2]+"' is without value.",q(A[o]));if(A[o][3]===void 0&&!y.allowBooleanAttributes)return M("InvalidAttr","boolean attribute '"+A[o][2]+"' is not allowed.",q(A[o]));const i=A[o][2];if(!F(i))return M("InvalidAttr","Attribute '"+i+"' is an invalid name.",q(A[o]));if(!c.hasOwnProperty(i))c[i]=1;else return M("InvalidAttr","Attribute '"+i+"' is repeated.",q(A[o]))}return!0}function R(f,y){let A=/\d/;for(f[y]==="x"&&(y++,A=/[\da-fA-F]/);y<f.length;y++){if(f[y]===";")return y;if(!f[y].match(A))break}return-1}function P(f,y){if(y++,f[y]===";")return-1;if(f[y]==="#")return y++,R(f,y);let A=0;for(;y<f.length;y++,A++)if(!(f[y].match(/\w/)&&A<20)){if(f[y]===";")break;return-1}return y}function M(f,y,A){return{err:{code:f,msg:y,line:A.line||A,col:A.col}}}function F(f){return d.isName(f)}function U(f){return d.isName(f)}function K(f,y){const A=f.substring(0,y).split(/\r?\n/);return{line:A.length,col:A[A.length-1].length+1}}function q(f){return f.startIndex+f[1].length}},"./node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js":function(n,r,g){const d=g("./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"),h=g("./node_modules/fast-xml-parser/src/ignoreAttributes.js"),S={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(l,b){return b},attributeValueProcessor:function(l,b){return b},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function O(l){this.options=Object.assign({},S,l),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=h(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=p),this.processTextOrObjNode=w,this.options.format?(this.indentate=t,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}O.prototype.build=function(l){return this.options.preserveOrder?d(l,this.options):(Array.isArray(l)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(l={[this.options.arrayNodeName]:l}),this.j2x(l,0,[]).val)},O.prototype.j2x=function(l,b,k){let R="",P="";const M=k.join(".");for(let F in l)if(Object.prototype.hasOwnProperty.call(l,F))if(typeof l[F]>"u")this.isAttribute(F)&&(P+="");else if(l[F]===null)this.isAttribute(F)?P+="":F[0]==="?"?P+=this.indentate(b)+"<"+F+"?"+this.tagEndChar:P+=this.indentate(b)+"<"+F+"/"+this.tagEndChar;else if(l[F]instanceof Date)P+=this.buildTextValNode(l[F],F,"",b);else if(typeof l[F]!="object"){const U=this.isAttribute(F);if(U&&!this.ignoreAttributesFn(U,M))R+=this.buildAttrPairStr(U,""+l[F]);else if(!U)if(F===this.options.textNodeName){let K=this.options.tagValueProcessor(F,""+l[F]);P+=this.replaceEntitiesValue(K)}else P+=this.buildTextValNode(l[F],F,"",b)}else if(Array.isArray(l[F])){const U=l[F].length;let K="",q="";for(let f=0;f<U;f++){const y=l[F][f];if(!(typeof y>"u"))if(y===null)F[0]==="?"?P+=this.indentate(b)+"<"+F+"?"+this.tagEndChar:P+=this.indentate(b)+"<"+F+"/"+this.tagEndChar;else if(typeof y=="object")if(this.options.oneListGroup){const A=this.j2x(y,b+1,k.concat(F));K+=A.val,this.options.attributesGroupName&&y.hasOwnProperty(this.options.attributesGroupName)&&(q+=A.attrStr)}else K+=this.processTextOrObjNode(y,F,b,k);else if(this.options.oneListGroup){let A=this.options.tagValueProcessor(F,y);A=this.replaceEntitiesValue(A),K+=A}else K+=this.buildTextValNode(y,F,"",b)}this.options.oneListGroup&&(K=this.buildObjectNode(K,F,q,b)),P+=K}else if(this.options.attributesGroupName&&F===this.options.attributesGroupName){const U=Object.keys(l[F]),K=U.length;for(let q=0;q<K;q++)R+=this.buildAttrPairStr(U[q],""+l[F][U[q]])}else P+=this.processTextOrObjNode(l[F],F,b,k);return{attrStr:R,val:P}},O.prototype.buildAttrPairStr=function(l,b){return b=this.options.attributeValueProcessor(l,""+b),b=this.replaceEntitiesValue(b),this.options.suppressBooleanAttributes&&b==="true"?" "+l:" "+l+'="'+b+'"'};function w(l,b,k,R){const P=this.j2x(l,k+1,R.concat(b));return l[this.options.textNodeName]!==void 0&&Object.keys(l).length===1?this.buildTextValNode(l[this.options.textNodeName],b,P.attrStr,k):this.buildObjectNode(P.val,b,P.attrStr,k)}O.prototype.buildObjectNode=function(l,b,k,R){if(l==="")return b[0]==="?"?this.indentate(R)+"<"+b+k+"?"+this.tagEndChar:this.indentate(R)+"<"+b+k+this.closeTag(b)+this.tagEndChar;{let P="</"+b+this.tagEndChar,M="";return b[0]==="?"&&(M="?",P=""),(k||k==="")&&l.indexOf("<")===-1?this.indentate(R)+"<"+b+k+M+">"+l+P:this.options.commentPropName!==!1&&b===this.options.commentPropName&&M.length===0?this.indentate(R)+"<!--".concat(l,"-->")+this.newLine:this.indentate(R)+"<"+b+k+M+this.tagEndChar+l+this.indentate(R)+P}},O.prototype.closeTag=function(l){let b="";return this.options.unpairedTags.indexOf(l)!==-1?this.options.suppressUnpairedNode||(b="/"):this.options.suppressEmptyNode?b="/":b="></".concat(l),b},O.prototype.buildTextValNode=function(l,b,k,R){if(this.options.cdataPropName!==!1&&b===this.options.cdataPropName)return this.indentate(R)+"<![CDATA[".concat(l,"]]>")+this.newLine;if(this.options.commentPropName!==!1&&b===this.options.commentPropName)return this.indentate(R)+"<!--".concat(l,"-->")+this.newLine;if(b[0]==="?")return this.indentate(R)+"<"+b+k+"?"+this.tagEndChar;{let P=this.options.tagValueProcessor(b,l);return P=this.replaceEntitiesValue(P),P===""?this.indentate(R)+"<"+b+k+this.closeTag(b)+this.tagEndChar:this.indentate(R)+"<"+b+k+">"+P+"</"+b+this.tagEndChar}},O.prototype.replaceEntitiesValue=function(l){if(l&&l.length>0&&this.options.processEntities)for(let b=0;b<this.options.entities.length;b++){const k=this.options.entities[b];l=l.replace(k.regex,k.val)}return l};function t(l){return this.options.indentBy.repeat(l)}function p(l){return l.startsWith(this.options.attributeNamePrefix)&&l!==this.options.textNodeName?l.substr(this.attrPrefixLen):!1}n.exports=O},"./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js":function(n,r){const g="\n";function d(p,l){let b="";return l.format&&l.indentBy.length>0&&(b=g),h(p,l,"",b)}function h(p,l,b,k){let R="",P=!1;for(let M=0;M<p.length;M++){const F=p[M],U=S(F);if(U===void 0)continue;let K="";if(b.length===0?K=U:K="".concat(b,".").concat(U),U===l.textNodeName){let c=F[U];w(K,l)||(c=l.tagValueProcessor(U,c),c=t(c,l)),P&&(R+=k),R+=c,P=!1;continue}else if(U===l.cdataPropName){P&&(R+=k),R+="<![CDATA[".concat(F[U][0][l.textNodeName],"]]>"),P=!1;continue}else if(U===l.commentPropName){R+=k+"<!--".concat(F[U][0][l.textNodeName],"-->"),P=!0;continue}else if(U[0]==="?"){const c=O(F[":@"],l),o=U==="?xml"?"":k;let i=F[U][0][l.textNodeName];i=i.length!==0?" "+i:"",R+=o+"<".concat(U).concat(i).concat(c,"?>"),P=!0;continue}let q=k;q!==""&&(q+=l.indentBy);const f=O(F[":@"],l),y=k+"<".concat(U).concat(f),A=h(F[U],l,K,q);l.unpairedTags.indexOf(U)!==-1?l.suppressUnpairedNode?R+=y+">":R+=y+"/>":(!A||A.length===0)&&l.suppressEmptyNode?R+=y+"/>":A&&A.endsWith(">")?R+=y+">".concat(A).concat(k,"</").concat(U,">"):(R+=y+">",A&&k!==""&&(A.includes("/>")||A.includes("</"))?R+=k+l.indentBy+A+k:R+=A,R+="</".concat(U,">")),P=!0}return R}function S(p){const l=Object.keys(p);for(let b=0;b<l.length;b++){const k=l[b];if(p.hasOwnProperty(k)&&k!==":@")return k}}function O(p,l){let b="";if(p&&!l.ignoreAttributes)for(let k in p){if(!p.hasOwnProperty(k))continue;let R=l.attributeValueProcessor(k,p[k]);R=t(R,l),R===!0&&l.suppressBooleanAttributes?b+=" ".concat(k.substr(l.attributeNamePrefix.length)):b+=" ".concat(k.substr(l.attributeNamePrefix.length),'="').concat(R,'"')}return b}function w(p,l){p=p.substr(0,p.length-l.textNodeName.length-1);let b=p.substr(p.lastIndexOf(".")+1);for(let k in l.stopNodes)if(l.stopNodes[k]===p||l.stopNodes[k]==="*."+b)return!0;return!1}function t(p,l){if(p&&p.length>0&&l.processEntities)for(let b=0;b<l.entities.length;b++){const k=l.entities[b];p=p.replace(k.regex,k.val)}return p}n.exports=d},"./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js":function(n,r,g){const d=g("./node_modules/fast-xml-parser/src/util.js");function h(k,R){const P={};if(k[R+3]==="O"&&k[R+4]==="C"&&k[R+5]==="T"&&k[R+6]==="Y"&&k[R+7]==="P"&&k[R+8]==="E"){R=R+9;let M=1,F=!1,U=!1,K="";for(;R<k.length;R++)if(k[R]==="<"&&!U){if(F&&w(k,R))R+=7,[entityName,val,R]=S(k,R+1),val.indexOf("&")===-1&&(P[b(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val});else if(F&&t(k,R))R+=8;else if(F&&p(k,R))R+=8;else if(F&&l(k,R))R+=9;else if(O)U=!0;else throw new Error("Invalid DOCTYPE");M++,K=""}else if(k[R]===">"){if(U?k[R-1]==="-"&&k[R-2]==="-"&&(U=!1,M--):M--,M===0)break}else k[R]==="["?F=!0:K+=k[R];if(M!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:P,i:R}}function S(k,R){let P="";for(;R<k.length&&k[R]!=="'"&&k[R]!=='"';R++)P+=k[R];if(P=P.trim(),P.indexOf(" ")!==-1)throw new Error("External entites are not supported");const M=k[R++];let F="";for(;R<k.length&&k[R]!==M;R++)F+=k[R];return[P,F,R]}function O(k,R){return k[R+1]==="!"&&k[R+2]==="-"&&k[R+3]==="-"}function w(k,R){return k[R+1]==="!"&&k[R+2]==="E"&&k[R+3]==="N"&&k[R+4]==="T"&&k[R+5]==="I"&&k[R+6]==="T"&&k[R+7]==="Y"}function t(k,R){return k[R+1]==="!"&&k[R+2]==="E"&&k[R+3]==="L"&&k[R+4]==="E"&&k[R+5]==="M"&&k[R+6]==="E"&&k[R+7]==="N"&&k[R+8]==="T"}function p(k,R){return k[R+1]==="!"&&k[R+2]==="A"&&k[R+3]==="T"&&k[R+4]==="T"&&k[R+5]==="L"&&k[R+6]==="I"&&k[R+7]==="S"&&k[R+8]==="T"}function l(k,R){return k[R+1]==="!"&&k[R+2]==="N"&&k[R+3]==="O"&&k[R+4]==="T"&&k[R+5]==="A"&&k[R+6]==="T"&&k[R+7]==="I"&&k[R+8]==="O"&&k[R+9]==="N"}function b(k){if(d.isName(k))return k;throw new Error("Invalid entity name ".concat(k))}n.exports=h},"./node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js":function(n,r){const g={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(h,S){return S},attributeValueProcessor:function(h,S){return S},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(h,S,O){return h}},d=function(h){return Object.assign({},g,h)};r.buildOptions=d,r.defaultOptions=g},"./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js":function(n,r,g){const d=g("./node_modules/fast-xml-parser/src/util.js"),h=g("./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"),S=g("./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"),O=g("./node_modules/strnum/strnum.js"),w=g("./node_modules/fast-xml-parser/src/ignoreAttributes.js");class t{constructor(i){this.options=i,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(u,v)=>String.fromCharCode(Number.parseInt(v,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(u,v)=>String.fromCharCode(Number.parseInt(v,16))}},this.addExternalEntities=p,this.parseXml=P,this.parseTextData=l,this.resolveNameSpace=b,this.buildAttributesMap=R,this.isItStopNode=K,this.replaceEntitiesValue=F,this.readStopNodeData=A,this.saveTextToParentTag=U,this.addChild=M,this.ignoreAttributesFn=w(this.options.ignoreAttributes)}}function p(o){const i=Object.keys(o);for(let u=0;u<i.length;u++){const v=i[u];this.lastEntities[v]={regex:new RegExp("&"+v+";","g"),val:o[v]}}}function l(o,i,u,v,B,D,N){if(o!==void 0&&(this.options.trimValues&&!v&&(o=o.trim()),o.length>0)){N||(o=this.replaceEntitiesValue(o));const z=this.options.tagValueProcessor(i,o,u,B,D);return z==null?o:typeof z!=typeof o||z!==o?z:this.options.trimValues?c(o,this.options.parseTagValue,this.options.numberParseOptions):o.trim()===o?c(o,this.options.parseTagValue,this.options.numberParseOptions):o}}function b(o){if(this.options.removeNSPrefix){const i=o.split(":"),u=o.charAt(0)==="/"?"/":"";if(i[0]==="xmlns")return"";i.length===2&&(o=u+i[1])}return o}const k=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function R(o,i,u){if(this.options.ignoreAttributes!==!0&&typeof o=="string"){const v=d.getAllMatches(o,k),B=v.length,D={};for(let N=0;N<B;N++){const z=this.resolveNameSpace(v[N][1]);if(this.ignoreAttributesFn(z,i))continue;let V=v[N][4],Z=this.options.attributeNamePrefix+z;if(z.length)if(this.options.transformAttributeName&&(Z=this.options.transformAttributeName(Z)),Z==="__proto__"&&(Z="#__proto__"),V!==void 0){this.options.trimValues&&(V=V.trim()),V=this.replaceEntitiesValue(V);const J=this.options.attributeValueProcessor(z,V,i);J==null?D[Z]=V:typeof J!=typeof V||J!==V?D[Z]=J:D[Z]=c(V,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(D[Z]=!0)}if(!Object.keys(D).length)return;if(this.options.attributesGroupName){const N={};return N[this.options.attributesGroupName]=D,N}return D}}const P=function(o){const i=new h("!xml");let u=i,v="",B="";for(let D=0;D<o.length;D++)if(o[D]==="<")if(o[D+1]==="/"){const z=f(o,">",D,"Closing Tag is not closed.");let V=o.substring(D+2,z).trim();if(this.options.removeNSPrefix){const te=V.indexOf(":");te!==-1&&(V=V.substr(te+1))}this.options.transformTagName&&(V=this.options.transformTagName(V)),u&&(v=this.saveTextToParentTag(v,u,B));const Z=B.substring(B.lastIndexOf(".")+1);if(V&&this.options.unpairedTags.indexOf(V)!==-1)throw new Error("Unpaired tag can not be used as closing tag: </".concat(V,">"));let J=0;Z&&this.options.unpairedTags.indexOf(Z)!==-1?(J=B.lastIndexOf(".",B.lastIndexOf(".")-1),this.tagsNodeStack.pop()):J=B.lastIndexOf("."),B=B.substring(0,J),u=this.tagsNodeStack.pop(),v="",D=z}else if(o[D+1]==="?"){let z=y(o,D,!1,"?>");if(!z)throw new Error("Pi Tag is not closed.");if(v=this.saveTextToParentTag(v,u,B),!(this.options.ignoreDeclaration&&z.tagName==="?xml"||this.options.ignorePiTags)){const V=new h(z.tagName);V.add(this.options.textNodeName,""),z.tagName!==z.tagExp&&z.attrExpPresent&&(V[":@"]=this.buildAttributesMap(z.tagExp,B,z.tagName)),this.addChild(u,V,B)}D=z.closeIndex+1}else if(o.substr(D+1,3)==="!--"){const z=f(o,"-->",D+4,"Comment is not closed.");if(this.options.commentPropName){const V=o.substring(D+4,z-2);v=this.saveTextToParentTag(v,u,B),u.add(this.options.commentPropName,[{[this.options.textNodeName]:V}])}D=z}else if(o.substr(D+1,2)==="!D"){const z=S(o,D);this.docTypeEntities=z.entities,D=z.i}else if(o.substr(D+1,2)==="!["){const z=f(o,"]]>",D,"CDATA is not closed.")-2,V=o.substring(D+9,z);v=this.saveTextToParentTag(v,u,B);let Z=this.parseTextData(V,u.tagname,B,!0,!1,!0,!0);Z==null&&(Z=""),this.options.cdataPropName?u.add(this.options.cdataPropName,[{[this.options.textNodeName]:V}]):u.add(this.options.textNodeName,Z),D=z+2}else{let z=y(o,D,this.options.removeNSPrefix),V=z.tagName;const Z=z.rawTagName;let J=z.tagExp,te=z.attrExpPresent,re=z.closeIndex;this.options.transformTagName&&(V=this.options.transformTagName(V)),u&&v&&u.tagname!=="!xml"&&(v=this.saveTextToParentTag(v,u,B,!1));const pe=u;if(pe&&this.options.unpairedTags.indexOf(pe.tagname)!==-1&&(u=this.tagsNodeStack.pop(),B=B.substring(0,B.lastIndexOf("."))),V!==i.tagname&&(B+=B?"."+V:V),this.isItStopNode(this.options.stopNodes,B,V)){let le="";if(J.length>0&&J.lastIndexOf("/")===J.length-1)V[V.length-1]==="/"?(V=V.substr(0,V.length-1),B=B.substr(0,B.length-1),J=V):J=J.substr(0,J.length-1),D=z.closeIndex;else if(this.options.unpairedTags.indexOf(V)!==-1)D=z.closeIndex;else{const ie=this.readStopNodeData(o,Z,re+1);if(!ie)throw new Error("Unexpected end of ".concat(Z));D=ie.i,le=ie.tagContent}const oe=new h(V);V!==J&&te&&(oe[":@"]=this.buildAttributesMap(J,B,V)),le&&(le=this.parseTextData(le,V,B,!0,te,!0,!0)),B=B.substr(0,B.lastIndexOf(".")),oe.add(this.options.textNodeName,le),this.addChild(u,oe,B)}else{if(J.length>0&&J.lastIndexOf("/")===J.length-1){V[V.length-1]==="/"?(V=V.substr(0,V.length-1),B=B.substr(0,B.length-1),J=V):J=J.substr(0,J.length-1),this.options.transformTagName&&(V=this.options.transformTagName(V));const le=new h(V);V!==J&&te&&(le[":@"]=this.buildAttributesMap(J,B,V)),this.addChild(u,le,B),B=B.substr(0,B.lastIndexOf("."))}else{const le=new h(V);this.tagsNodeStack.push(u),V!==J&&te&&(le[":@"]=this.buildAttributesMap(J,B,V)),this.addChild(u,le,B),u=le}v="",D=re}}else v+=o[D];return i.child};function M(o,i,u){const v=this.options.updateTag(i.tagname,u,i[":@"]);v===!1||(typeof v=="string"&&(i.tagname=v),o.addChild(i))}const F=function(o){if(this.options.processEntities){for(let i in this.docTypeEntities){const u=this.docTypeEntities[i];o=o.replace(u.regx,u.val)}for(let i in this.lastEntities){const u=this.lastEntities[i];o=o.replace(u.regex,u.val)}if(this.options.htmlEntities)for(let i in this.htmlEntities){const u=this.htmlEntities[i];o=o.replace(u.regex,u.val)}o=o.replace(this.ampEntity.regex,this.ampEntity.val)}return o};function U(o,i,u,v){return o&&(v===void 0&&(v=Object.keys(i.child).length===0),o=this.parseTextData(o,i.tagname,u,!1,i[":@"]?Object.keys(i[":@"]).length!==0:!1,v),o!==void 0&&o!==""&&i.add(this.options.textNodeName,o),o=""),o}function K(o,i,u){const v="*."+u;for(const B in o){const D=o[B];if(v===D||i===D)return!0}return!1}function q(o,i,u=">"){let v,B="";for(let D=i;D<o.length;D++){let N=o[D];if(v)N===v&&(v="");else if(N==='"'||N==="'")v=N;else if(N===u[0])if(u[1]){if(o[D+1]===u[1])return{data:B,index:D}}else return{data:B,index:D};else N===" "&&(N=" ");B+=N}}function f(o,i,u,v){const B=o.indexOf(i,u);if(B===-1)throw new Error(v);return B+i.length-1}function y(o,i,u,v=">"){const B=q(o,i+1,v);if(!B)return;let D=B.data;const N=B.index,z=D.search(/\s/);let V=D,Z=!0;z!==-1&&(V=D.substring(0,z),D=D.substring(z+1).trimStart());const J=V;if(u){const te=V.indexOf(":");te!==-1&&(V=V.substr(te+1),Z=V!==B.data.substr(te+1))}return{tagName:V,tagExp:D,closeIndex:N,attrExpPresent:Z,rawTagName:J}}function A(o,i,u){const v=u;let B=1;for(;u<o.length;u++)if(o[u]==="<")if(o[u+1]==="/"){const D=f(o,">",u,"".concat(i," is not closed"));if(o.substring(u+2,D).trim()===i&&(B--,B===0))return{tagContent:o.substring(v,u),i:D};u=D}else if(o[u+1]==="?")u=f(o,"?>",u+1,"StopNode is not closed.");else if(o.substr(u+1,3)==="!--")u=f(o,"-->",u+3,"StopNode is not closed.");else if(o.substr(u+1,2)==="![")u=f(o,"]]>",u,"StopNode is not closed.")-2;else{const D=y(o,u,">");D&&((D&&D.tagName)===i&&D.tagExp[D.tagExp.length-1]!=="/"&&B++,u=D.closeIndex)}}function c(o,i,u){if(i&&typeof o=="string"){const v=o.trim();return v==="true"?!0:v==="false"?!1:O(o,u)}else return d.isExist(o)?o:""}n.exports=t},"./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js":function(n,r,g){const{buildOptions:d}=g("./node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"),h=g("./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"),{prettify:S}=g("./node_modules/fast-xml-parser/src/xmlparser/node2json.js"),O=g("./node_modules/fast-xml-parser/src/validator.js");class w{constructor(p){this.externalEntities={},this.options=d(p)}parse(p,l){if(typeof p!="string")if(p.toString)p=p.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(l){l===!0&&(l={});const R=O.validate(p,l);if(R!==!0)throw Error("".concat(R.err.msg,":").concat(R.err.line,":").concat(R.err.col))}const b=new h(this.options);b.addExternalEntities(this.externalEntities);const k=b.parseXml(p);return this.options.preserveOrder||k===void 0?k:S(k,this.options)}addEntity(p,l){if(l.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(p.indexOf("&")!==-1||p.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(l==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[p]=l}}n.exports=w},"./node_modules/fast-xml-parser/src/xmlparser/node2json.js":function(n,r,g){function d(t,p){return h(t,p)}function h(t,p,l){let b;const k={};for(let R=0;R<t.length;R++){const P=t[R],M=S(P);let F="";if(l===void 0?F=M:F=l+"."+M,M===p.textNodeName)b===void 0?b=P[M]:b+=""+P[M];else{if(M===void 0)continue;if(P[M]){let U=h(P[M],p,F);const K=w(U,p);P[":@"]?O(U,P[":@"],F,p):Object.keys(U).length===1&&U[p.textNodeName]!==void 0&&!p.alwaysCreateTextNode?U=U[p.textNodeName]:Object.keys(U).length===0&&(p.alwaysCreateTextNode?U[p.textNodeName]="":U=""),k[M]!==void 0&&k.hasOwnProperty(M)?(Array.isArray(k[M])||(k[M]=[k[M]]),k[M].push(U)):p.isArray(M,F,K)?k[M]=[U]:k[M]=U}}}return typeof b=="string"?b.length>0&&(k[p.textNodeName]=b):b!==void 0&&(k[p.textNodeName]=b),k}function S(t){const p=Object.keys(t);for(let l=0;l<p.length;l++){const b=p[l];if(b!==":@")return b}}function O(t,p,l,b){if(p){const k=Object.keys(p),R=k.length;for(let P=0;P<R;P++){const M=k[P];b.isArray(M,l+"."+M,!0,!0)?t[M]=[p[M]]:t[M]=p[M]}}}function w(t,p){const{textNodeName:l}=p,b=Object.keys(t).length;return!!(b===0||b===1&&(t[l]||typeof t[l]=="boolean"||t[l]===0))}r.prettify=d},"./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js":function(n,r,g){class d{constructor(S){this.tagname=S,this.child=[],this[":@"]={}}add(S,O){S==="__proto__"&&(S="#__proto__"),this.child.push({[S]:O})}addChild(S){S.tagname==="__proto__"&&(S.tagname="#__proto__"),S[":@"]&&Object.keys(S[":@"]).length>0?this.child.push({[S.tagname]:S.child,":@":S[":@"]}):this.child.push({[S.tagname]:S.child})}}n.exports=d},"./node_modules/process/browser.js":function(n,r){var g=n.exports={},d,h;function S(){throw new Error("setTimeout has not been defined")}function O(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?d=setTimeout:d=S}catch(U){d=S}try{typeof clearTimeout=="function"?h=clearTimeout:h=O}catch(U){h=O}})();function w(U){if(d===setTimeout)return setTimeout(U,0);if((d===S||!d)&&setTimeout)return d=setTimeout,setTimeout(U,0);try{return d(U,0)}catch(K){try{return d.call(null,U,0)}catch(q){return d.call(this,U,0)}}}function t(U){if(h===clearTimeout)return clearTimeout(U);if((h===O||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(U);try{return h(U)}catch(K){try{return h.call(null,U)}catch(q){return h.call(this,U)}}}var p=[],l=!1,b,k=-1;function R(){!l||!b||(l=!1,b.length?p=b.concat(p):k=-1,p.length&&P())}function P(){if(!l){var U=w(R);l=!0;for(var K=p.length;K;){for(b=p,p=[];++k<K;)b&&b[k].run();k=-1,K=p.length}b=null,l=!1,t(U)}}g.nextTick=function(U){var K=new Array(arguments.length-1);if(arguments.length>1)for(var q=1;q<arguments.length;q++)K[q-1]=arguments[q];p.push(new M(U,K)),p.length===1&&!l&&w(P)};function M(U,K){this.fun=U,this.array=K}M.prototype.run=function(){this.fun.apply(null,this.array)},g.title="browser",g.browser=!0,g.env={},g.argv=[],g.version="",g.versions={};function F(){}g.on=F,g.addListener=F,g.once=F,g.off=F,g.removeListener=F,g.removeAllListeners=F,g.emit=F,g.prependListener=F,g.prependOnceListener=F,g.listeners=function(U){return[]},g.binding=function(U){throw new Error("process.binding is not supported")},g.cwd=function(){return"/"},g.chdir=function(U){throw new Error("process.chdir is not supported")},g.umask=function(){return 0}},"./node_modules/strnum/strnum.js":function(n,r){const g=/^[-+]?0x[a-fA-F0-9]+$/,d=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,h={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function S(t,p={}){if(p=Object.assign({},h,p),!t||typeof t!="string")return t;let l=t.trim();if(p.skipLike!==void 0&&p.skipLike.test(l))return t;if(t==="0")return 0;if(p.hex&&g.test(l))return w(l,16);if(l.search(/[eE]/)!==-1){const b=l.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(b){if(p.leadingZeros)l=(b[1]||"")+b[3];else if(!(b[2]==="0"&&b[3][0]==="."))return t;return p.eNotation?Number(l):t}else return t}else{const b=d.exec(l);if(b){const k=b[1],R=b[2];let P=O(b[3]);if(!p.leadingZeros&&R.length>0&&k&&l[2]!==".")return t;if(!p.leadingZeros&&R.length>0&&!k&&l[1]!==".")return t;if(p.leadingZeros&&R===t)return 0;{const M=Number(l),F=""+M;return F.search(/[eE]/)!==-1?p.eNotation?M:t:l.indexOf(".")!==-1?F==="0"&&P===""||F===P||k&&F==="-"+P?M:t:R?P===F||k+P===F?M:t:l===F||l===k+F?M:t}}else return t}}function O(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substr(0,t.length-1))),t}function w(t,p){if(parseInt)return parseInt(t,p);if(Number.parseInt)return Number.parseInt(t,p);if(window&&window.parseInt)return window.parseInt(t,p);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}n.exports=S},"./node_modules/webpack/buildin/amd-options.js":function(n,r){(function(g){n.exports=g}).call(this,{})},"./node_modules/webpack/buildin/module.js":function(n,r){n.exports=function(g){return g.webpackPolyfill||(g.deprecate=function(){},g.paths=[],g.children||(g.children=[]),Object.defineProperty(g,"loaded",{enumerable:!0,get:function(){return g.l}}),Object.defineProperty(g,"id",{enumerable:!0,get:function(){return g.i}}),g.webpackPolyfill=1),g}},"./package.json":function(n){n.exports=JSON.parse('{"name":"cos-js-sdk-v5","version":"1.10.1","description":"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)","main":"dist/cos-js-sdk-v5.js","types":"index.d.ts","scripts":{"prettier":"prettier --write src demo/demo.js demo/CIDemos/*.js test/test.js server/sts.js lib/request.js index.d.ts","server":"node server/sts.js","dev":"cross-env NODE_ENV=development webpack -w --mode=development","build":"cross-env NODE_ENV=production webpack --mode=production","cos-auth.min.js":"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m","test":"jest --runInBand --coverage","postinstall":"node scripts/patch-check.js"},"repository":{"type":"git","url":"git+https://github.com/tencentyun/cos-js-sdk-v5.git"},"keywords":[],"author":"carsonxu","license":"ISC","bugs":{"url":"https://github.com/tencentyun/cos-js-sdk-v5/issues"},"homepage":"https://github.com/tencentyun/cos-js-sdk-v5#readme","dependencies":{"fast-xml-parser":"4.5.0"},"devDependencies":{"@babel/core":"7.17.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^5.2.0","express":"^4.16.4","jest":"29.7.0","jest-environment-jsdom":"29.7.0","patch-package":"^8.0.0","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","request":"^2.87.0","terser-webpack-plugin":"4.2.3","uglifyjs":"^2.4.11","webpack":"4.46.0","webpack-cli":"4.10.0"}}')},"./src/advance.js":function(n,r,g){var d=g("./node_modules/@babel/runtime/helpers/typeof.js"),h=g("./src/session.js"),S=g("./src/async.js"),O=g("./src/event.js").EventProxy,w=g("./src/util.js"),t=g("./src/tracker.js");function p(c,o){var i=this,u=new O,v=c.TaskId,B=c.Bucket,D=c.Region,N=c.Key,z=c.Body,V=c.ChunkSize||c.SliceSize||i.options.ChunkSize,Z=c.AsyncLimit,J=c.StorageClass,te=c.ServerSideEncryption,re,pe,le=c.onHashProgress,oe=c.tracker;oe&&oe.setParams({chunkSize:V}),i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 分块上传开始")}),u.on("error",function(ie){if(i._isRunningTask(v))return c.UploadData.UploadId&&h.removeUsing(c.UploadData.UploadId),ie.UploadId=c.UploadData.UploadId||"",i.logger.error({cate:"RESULT",tag:"upload",msg:"[key=".concat(c.Key,"] 分块上传失败: ").concat(JSON.stringify(ie))}),o(ie)}),u.on("upload_complete",function(ie){var $=w.extend({UploadId:c.UploadData.UploadId||""},ie);o(null,$)}),u.on("upload_slice_complete",function(ie){var $={};w.each(c.Headers,function(ne,fe){var he=fe.toLowerCase();(he.indexOf("x-cos-meta-")===0||["pic-operations","x-cos-callback","x-cos-callback-var","x-cos-return-body"].includes(he))&&($[fe]=ne)}),i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 开始完成分块请求")}),M.call(i,{Bucket:B,Region:D,Key:N,UploadId:ie.UploadId,SliceList:ie.SliceList,Headers:$,tracker:oe},function(ne,fe){if(i._isRunningTask(v)){if(h.removeUsing(ie.UploadId),ne)return pe(null,!0),i.logger.error({cate:"RESULT",tag:"upload",msg:"[key=".concat(c.Key,"] 完成分块请求失败")}),u.emit("error",ne);h.removeUploadId.call(i,ie.UploadId),pe({loaded:re,total:re},!0),i.logger.info({cate:"RESULT",tag:"upload",msg:"[key=".concat(c.Key,"] 完成分块请求成功")}),u.emit("upload_complete",fe)}})}),u.on("get_upload_data_finish",function(ie){var $=h.getFileId(z,c.ChunkSize,B,N);$&&h.saveUploadId.call(i,$,ie.UploadId,i.options.UploadIdCacheLimit),h.setUsing(ie.UploadId),pe(null,!0),i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 开始上传各个分块")}),R.call(i,{TaskId:v,Bucket:B,Region:D,Key:N,Body:z,FileSize:re,SliceSize:V,AsyncLimit:Z,ServerSideEncryption:te,UploadData:ie,Headers:c.Headers,onProgress:pe,tracker:oe},function(ne,fe){if(i._isRunningTask(v)){if(ne)return pe(null,!0),i.logger.error({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 分块上传失败")}),u.emit("error",ne);i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 所有分块上传完成")}),u.emit("upload_slice_complete",fe)}})}),u.on("get_file_size_finish",function(){if(pe=w.throttleOnProgress.call(i,re,c.onProgress),c.UploadData.UploadId)i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 已经获取到 uploadId, ").concat(c.UploadData.UploadId)}),u.emit("get_upload_data_finish",c.UploadData);else{var ie=w.extend({TaskId:v,Bucket:B,Region:D,Key:N,Headers:c.Headers,StorageClass:J,Body:z,FileSize:re,SliceSize:V,onHashProgress:le,tracker:oe},c);i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 去获取 uploadId")}),l.call(i,ie,function($,ne){if(i._isRunningTask(v)){if($)return u.emit("error",$);c.UploadData.UploadId=ne.UploadId,c.UploadData.PartList=ne.PartList,i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 获取到 uploadId, ").concat(c.UploadData.UploadId)}),u.emit("get_upload_data_finish",c.UploadData)}})}}),re=c.ContentLength,delete c.ContentLength,!c.Headers&&(c.Headers={}),w.each(c.Headers,function(ie,$){$.toLowerCase()==="content-length"&&delete c.Headers[$]}),function(){for(var ie=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],$=1024*1024,ne=0;ne<ie.length&&($=ie[ne]*1024*1024,!(re/$<=i.options.MaxPartNumber));ne++);c.ChunkSize=c.SliceSize=V=Math.max(V,$)}(),re===0?(c.Body="",c.ContentLength=0,c.SkipTask=!0,i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 文件大小为 0,执行简单上传")}),i.putObject(c,o)):u.emit("get_file_size_finish")}function l(c,o){var i=c.TaskId,u=c.Bucket,v=c.Region,B=c.Key,D=c.StorageClass,N=this,z={},V=c.FileSize,Z=c.SliceSize,J=Math.ceil(V/Z),te=0,re=w.throttleOnProgress.call(N,V,c.onHashProgress),pe=function($,ne){var fe=Z*($-1),he=Math.min(fe+Z,V),se=he-fe;z[$]?ne(null,{PartNumber:$,ETag:z[$],Size:se}):w.fileSlice(c.Body,fe,he,!1,function(ce){w.getFileMd5(ce,function(ve,ye){if(ve)return ne(w.error(ve));var Ce='"'+ye+'"';z[$]=Ce,te+=se,re({loaded:te,total:V}),ne(null,{PartNumber:$,ETag:Ce,Size:se})})})},le=function($,ne){var fe=$.length;if(fe===0)return ne(null,!0);if(fe>J)return ne(null,!1);if(fe>1){var he=Math.max($[0].Size,$[1].Size);if(he!==Z)return ne(null,!1)}var se=function(ve){if(ve<fe){var ye=$[ve];pe(ye.PartNumber,function(Ce,Ae){Ae&&Ae.ETag===ye.ETag&&Ae.Size===ye.Size?se(ve+1):ne(null,!1)})}else ne(null,!0)};se(0)},oe=new O;oe.on("error",function(ie){if(N._isRunningTask(i))return o(ie)}),oe.on("upload_id_available",function(ie){var $={},ne=[];w.each(ie.PartList,function(se){$[se.PartNumber]=se});for(var fe=1;fe<=J;fe++){var he=$[fe];he?(he.PartNumber=fe,he.Uploaded=!0):he={PartNumber:fe,ETag:null,Uploaded:!1},ne.push(he)}ie.PartList=ne,o(null,ie)}),oe.on("no_available_upload_id",function(){if(N._isRunningTask(i)){var ie=w.extend({Bucket:u,Region:v,Key:B,Query:w.clone(c.Query),StorageClass:D,Body:c.Body,calledBySdk:"sliceUploadFile",tracker:c.tracker},c),$=w.clone(c.Headers);delete $["x-cos-mime-limit"],ie.Headers=$,N.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 准备初始化分块上传")}),N.multipartInit(ie,function(ne,fe){if(N._isRunningTask(i)){if(ne)return N.logger.error({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 初始化分块上传失败, ").concat(JSON.stringify(ne))}),oe.emit("error",ne);var he=fe.UploadId;if(!he)return o(w.error(new Error("no such upload id")));N.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 初始化分块上传成功")}),oe.emit("upload_id_available",{UploadId:he,PartList:[]})}})}}),oe.on("has_and_check_upload_id",function(ie){ie=ie.reverse(),S.eachLimit(ie,1,function($,ne){if(N._isRunningTask(i)){if(h.using[$]){ne();return}k.call(N,{Bucket:u,Region:v,Key:B,UploadId:$,tracker:c.tracker},function(fe,he){if(N._isRunningTask(i)){if(fe)return h.removeUsing($),oe.emit("error",fe);var se=he.PartList;se.forEach(function(ce){ce.PartNumber*=1,ce.Size*=1,ce.ETag=ce.ETag||""}),le(se,function(ce,ve){if(N._isRunningTask(i)){if(ce)return oe.emit("error",ce);ve?ne({UploadId:$,PartList:se}):ne()}})}})}},function($){N._isRunningTask(i)&&(re(null,!0),$&&$.UploadId?oe.emit("upload_id_available",$):oe.emit("no_available_upload_id"))})}),oe.on("seek_local_avail_upload_id",function(ie){var $=h.getFileId(c.Body,c.ChunkSize,u,B),ne=h.getUploadIdList.call(N,$);if(!$||!ne){oe.emit("has_and_check_upload_id",ie);return}var fe=function(se){if(se>=ne.length){oe.emit("has_and_check_upload_id",ie);return}var ce=ne[se];if(!w.isInArray(ie,ce)){h.removeUploadId.call(N,ce),fe(se+1);return}if(h.using[ce]){fe(se+1);return}k.call(N,{Bucket:u,Region:v,Key:B,UploadId:ce,tracker:c.tracker},function(ve,ye){N._isRunningTask(i)&&(ve?(h.removeUploadId.call(N,ce),fe(se+1)):oe.emit("upload_id_available",{UploadId:ce,PartList:ye.PartList}))})};fe(0)}),oe.on("get_remote_upload_id_list",function(){b.call(N,{Bucket:u,Region:v,Key:B,tracker:c.tracker},function(ie,$){if(N._isRunningTask(i)){if(ie)return oe.emit("error",ie);var ne=w.filter($.UploadList,function(se){return se.Key===B&&(!D||se.StorageClass.toUpperCase()===D.toUpperCase())}).reverse().map(function(se){return se.UploadId||se.UploadID});if(ne.length)oe.emit("seek_local_avail_upload_id",ne);else{var fe=h.getFileId(c.Body,c.ChunkSize,u,B),he;fe&&(he=h.getUploadIdList.call(N,fe))&&w.each(he,function(se){h.removeUploadId.call(N,se)}),oe.emit("no_available_upload_id")}}})}),oe.emit("get_remote_upload_id_list")}function b(c,o){var i=this,u=[],v={Bucket:c.Bucket,Region:c.Region,Prefix:c.Key,calledBySdk:c.calledBySdk||"sliceUploadFile",tracker:c.tracker},B=function(){i.multipartList(v,function(N,z){if(N)return o(N);u.push.apply(u,z.Upload||[]),z.IsTruncated==="true"?(v.KeyMarker=z.NextKeyMarker,v.UploadIdMarker=z.NextUploadIdMarker,B()):o(null,{UploadList:u})})};B()}function k(c,o){var i=this,u=[],v={Bucket:c.Bucket,Region:c.Region,Key:c.Key,UploadId:c.UploadId,calledBySdk:"sliceUploadFile",tracker:c.tracker},B=function(){i.multipartListPart(v,function(N,z){if(N)return o(N);u.push.apply(u,z.Part||[]),z.IsTruncated==="true"?(v.PartNumberMarker=z.NextPartNumberMarker,B()):o(null,{PartList:u})})};B()}function R(c,o){var i=this,u=c.TaskId,v=c.Bucket,B=c.Region,D=c.Key,N=c.UploadData,z=c.FileSize,V=c.SliceSize,Z=Math.min(c.AsyncLimit||i.options.ChunkParallelLimit||1,256),J=c.Body,te=Math.ceil(z/V),re=0,pe=c.ServerSideEncryption,le=c.Headers,oe=w.filter(N.PartList,function($){return $.Uploaded&&(re+=$.PartNumber>=te&&z%V||V),!$.Uploaded}),ie=c.onProgress;i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 开始并发上传各个分块")}),S.eachLimit(oe,Z,function($,ne){if(i._isRunningTask(u)){var fe=$.PartNumber,he=Math.min(z,$.PartNumber*V)-($.PartNumber-1)*V,se=0;i.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 分块").concat(fe,"开始上传")}),P.call(i,{TaskId:u,Bucket:v,Region:B,Key:D,SliceSize:V,FileSize:z,PartNumber:fe,ServerSideEncryption:pe,Body:J,UploadData:N,Headers:le,onProgress:function(ve){re+=ve.loaded-se,se=ve.loaded,ie({loaded:re,total:z})},tracker:c.tracker},function(ce,ve){i._isRunningTask(u)&&(!ce&&!ve.ETag&&(ce='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败,请在CORS ExposeHeader设置中添加ETag,请参考文档:https://cloud.tencent.com/document/product/436/13318 )',i.logger.error({cate:"PROCESS",tag:"upload",msg:"[key=".concat(c.Key,"] 分块").concat(fe,"上传请求成功,但是未获取到 eTag")})),ce?(re-=se,i.logger.info({cate:"RESULT",tag:"upload",msg:"[key=".concat(c.Key,"] 分块").concat(fe,"上传失败")})):(re+=he-se,$.ETag=ve.ETag),i.logger.info({cate:"RESULT",tag:"upload",msg:"[key=".concat(c.Key,"] 分块").concat(fe,"上传成功")}),ie({loaded:re,total:z}),ne(ce||null,ve))})}},function($){if(i._isRunningTask(u)){if($)return o($);o(null,{UploadId:N.UploadId,SliceList:N.PartList})}})}function P(c,o){var i=this,u=c.TaskId,v=c.Bucket,B=c.Region,D=c.Key,N=c.FileSize,z=c.Body,V=c.PartNumber*1,Z=c.SliceSize,J=c.ServerSideEncryption,te=c.UploadData,re=c.Headers||{},pe=i.options.ChunkRetryTimes+1,le=Z*(V-1),oe=Z,ie=le+Z;ie>N&&(ie=N,oe=ie-le);var $=["x-cos-traffic-limit","x-cos-mime-limit"],ne={};w.each(re,function(he,se){$.indexOf(se)>-1&&(ne[se]=he)});var fe=te.PartList[V-1];S.retry(pe,function(he){i._isRunningTask(u)&&w.fileSlice(z,le,ie,!0,function(se){i.multipartUpload({TaskId:u,Bucket:v,Region:B,Key:D,ContentLength:oe,PartNumber:V,UploadId:te.UploadId,ServerSideEncryption:J,Body:se,Headers:ne,onProgress:c.onProgress,calledBySdk:"sliceUploadFile",tracker:c.tracker},function(ce,ve){if(i._isRunningTask(u))return ce?he(ce):(fe.Uploaded=!0,he(null,ve))})})},function(he,se){if(i._isRunningTask(u))return o(he,se)})}function M(c,o){var i=c.Bucket,u=c.Region,v=c.Key,B=c.UploadId,D=c.SliceList,N=this,z=this.options.ChunkRetryTimes+1,V=c.Headers,Z=D.map(function(J){return{PartNumber:J.PartNumber,ETag:J.ETag}});S.retry(z,function(J){N.multipartComplete({Bucket:i,Region:u,Key:v,UploadId:B,Parts:Z,Headers:V,calledBySdk:"sliceUploadFile",tracker:c.tracker},J)},function(J,te){o(J,te)})}function F(c,o){var i=c.Bucket,u=c.Region,v=c.Key,B=c.UploadId,D=c.Level||"task",N=c.AsyncLimit,z=this,V=new O;if(V.on("error",function(Z){return o(Z)}),V.on("get_abort_array",function(Z){U.call(z,{Bucket:i,Region:u,Key:v,Headers:c.Headers,AsyncLimit:N,AbortArray:Z},o)}),D==="bucket")b.call(z,{Bucket:i,Region:u,calledBySdk:"abortUploadTask"},function(Z,J){if(Z)return o(Z);V.emit("get_abort_array",J.UploadList||[])});else if(D==="file"){if(!v)return o(w.error(new Error("abort_upload_task_no_key")));b.call(z,{Bucket:i,Region:u,Key:v,calledBySdk:"abortUploadTask"},function(Z,J){if(Z)return o(Z);V.emit("get_abort_array",J.UploadList||[])})}else if(D==="task"){if(!B)return o(w.error(new Error("abort_upload_task_no_id")));if(!v)return o(w.error(new Error("abort_upload_task_no_key")));V.emit("get_abort_array",[{Key:v,UploadId:B}])}else return o(w.error(new Error("abort_unknown_level")))}function U(c,o){var i=c.Bucket,u=c.Region,v=c.Key,B=c.AbortArray,D=c.AsyncLimit||1,N=this,z=0,V=new Array(B.length);S.eachLimit(B,D,function(Z,J){var te=z;if(v&&v!==Z.Key){V[te]={error:{KeyNotMatch:!0}},J(null);return}var re=Z.UploadId||Z.UploadID;N.multipartAbort({Bucket:i,Region:u,Key:Z.Key,Headers:c.Headers,UploadId:re},function(pe){var le={Bucket:i,Region:u,Key:Z.Key,UploadId:re};V[te]={error:pe,task:le},J(null)}),z++},function(Z){if(Z)return o(Z);for(var J=[],te=[],re=0,pe=V.length;re<pe;re++){var le=V[re];le.task&&(le.error?te.push(le.task):J.push(le.task))}return o(null,{successList:J,errorList:te})})}function K(c,o){var i=this,u=c.SliceSize===void 0?i.options.SliceSize:c.SliceSize,v=[],B=c.Body,D=B.size||B.length||0,N={TaskId:""};if(i.options.EnableReporter){var z=i.options.UseAccelerate||typeof i.options.Domain=="string"&&i.options.Domain.includes("accelerate."),V=D>u?"sliceUploadFile":"putObject";c.tracker=new t({Beacon:i.options.BeaconReporter,clsReporter:i.options.ClsReporter,bucket:c.Bucket,region:c.Region,apiName:"uploadFile",realApi:V,fileKey:c.Key,fileSize:D,accelerate:z,deepTracker:i.options.DeepTracker,customId:i.options.CustomId,delay:i.options.TrackerDelay})}w.each(c,function(le,oe){d(le)!=="object"&&typeof le!="function"&&(N[oe]=le)});var Z=c.onTaskReady,J=function(oe){N.TaskId=oe,Z&&Z(oe)};c.onTaskReady=J;var te=D>u?"sliceUploadFile":"putObject",re=c.onFileFinish,pe=function(oe,ie){c.tracker&&c.tracker.report(oe,ie),re&&re(oe,ie,N),o&&o(oe,ie)};v.push({api:te,params:c,callback:pe}),i._addTasks(v)}function q(c,o){var i=this,u=c.SliceSize===void 0?i.options.SliceSize:c.SliceSize,v=0,B=0,D=w.throttleOnProgress.call(i,B,c.onProgress),N=c.files.length,z=c.onFileFinish,V=Array(N),Z=function(re,pe,le){D(null,!0),z&&z(re,pe,le),V[le.Index]={options:le,error:re,data:pe},--N<=0&&o&&o(null,{files:V})},J=[];w.each(c.files,function(te,re){(function(){var pe=te.Body,le=pe.size||pe.length||0,oe={Index:re,TaskId:""};if(!i.options.UseRawKey&&te.Key&&te.Key.substr(0,1)==="/"&&(te.Key=te.Key.substr(1)),v+=le,i.options.EnableReporter){var ie=i.options.UseAccelerate||typeof i.options.Domain=="string"&&i.options.Domain.includes("accelerate."),$=le>u?"sliceUploadFile":"putObject";te.tracker=new t({Beacon:i.options.BeaconReporter,clsReporter:i.options.ClsReporter,bucket:te.Bucket,region:te.Region,apiName:"uploadFiles",realApi:$,fileKey:te.Key,fileSize:le,accelerate:ie,deepTracker:i.options.DeepTracker,customId:i.options.CustomId,delay:i.options.TrackerDelay})}w.each(te,function(Ae,Se){d(Ae)!=="object"&&typeof Ae!="function"&&(oe[Se]=Ae)});var ne=te.onTaskReady,fe=function(Se){oe.TaskId=Se,ne&&ne(Se)};te.onTaskReady=fe;var he=0,se=te.onProgress,ce=function(Se){B=B-he+Se.loaded,he=Se.loaded,se&&se(Se),D({loaded:B,total:v})};te.onProgress=ce;var ve=le>u?"sliceUploadFile":"putObject",ye=te.onFileFinish,Ce=function(Se,Fe){te.tracker&&te.tracker.report(Se,Fe),ye&&ye(Se,Fe),Z&&Z(Se,Fe,oe)};J.push({api:ve,params:te,callback:Ce})})()}),i._addTasks(J)}function f(c,o){var i=new O,u=this,v=c.Bucket,B=c.Region,D=c.Key,N=c.CopySource,z=w.getSourceParams.call(this,N);if(!z){o(w.error(new Error("CopySource format error")));return}var V=z.Bucket,Z=z.Region,J=decodeURIComponent(z.Key),te=c.CopySliceSize===void 0?u.options.CopySliceSize:c.CopySliceSize;te=Math.max(0,te);var re=c.CopyChunkSize||this.options.CopyChunkSize,pe=this.options.CopyChunkParallelLimit,le=this.options.ChunkRetryTimes+1,oe=0,ie=0,$,ne,fe={},he={},se={};i.on("copy_slice_complete",function(ce){w.each(c.Headers,function(ye,Ce){Ce.toLowerCase().indexOf("x-cos-meta-")});var ve=w.map(ce.PartList,function(ye){return{PartNumber:ye.PartNumber,ETag:ye.ETag}});S.retry(le,function(ye){u.multipartComplete({Bucket:v,Region:B,Key:D,UploadId:ce.UploadId,Parts:ve,tracker:c.tracker,calledBySdk:"sliceCopyFile"},ye)},function(ye,Ce){if(h.removeUsing(ce.UploadId),ye)return ne(null,!0),o(ye);h.removeUploadId(ce.UploadId),ne({loaded:$,total:$},!0),o(null,Ce)})}),i.on("get_copy_data_finish",function(ce){var ve=h.getCopyFileId(N,fe,re,v,D);ve&&h.saveUploadId(ve,ce.UploadId,u.options.UploadIdCacheLimit),h.setUsing(ce.UploadId);var ye=w.filter(ce.PartList,function(Ce){return Ce.Uploaded&&(ie+=Ce.PartNumber>=oe&&$%re||re),!Ce.Uploaded});S.eachLimit(ye,pe,function(Ce,Ae){var Se=Ce.PartNumber,Fe=Ce.CopySourceRange,it=Ce.end-Ce.start;S.retry(le,function(Xe){y.call(u,{Bucket:v,Region:B,Key:D,CopySource:N,UploadId:ce.UploadId,PartNumber:Se,CopySourceRange:Fe,tracker:c.tracker,calledBySdk:"sliceCopyFile"},Xe)},function(Xe,st){if(Xe)return Ae(Xe);ie+=it,ne({loaded:ie,total:$}),Ce.ETag=st.ETag,Ae(Xe||null,st)})},function(Ce){if(Ce)return h.removeUsing(ce.UploadId),ne(null,!0),o(Ce);i.emit("copy_slice_complete",ce)})}),i.on("get_chunk_size_finish",function(){var ce=function(){u.multipartInit({Bucket:v,Region:B,Key:D,Headers:se,tracker:c.tracker,calledBySdk:"sliceCopyFile"},function(Se,Fe){if(Se)return o(Se);c.UploadId=Fe.UploadId,i.emit("get_copy_data_finish",{UploadId:c.UploadId,PartList:c.PartList})})},ve=h.getCopyFileId(N,fe,re,v,D),ye=h.getUploadIdList(ve);if(!ve||!ye)return ce();var Ce=function(Se){if(Se>=ye.length)return ce();var Fe=ye[Se];if(h.using[Fe])return Ce(Se+1);k.call(u,{Bucket:v,Region:B,Key:D,UploadId:Fe,tracker:c.tracker,calledBySdk:"sliceCopyFile"},function(it,Xe){if(it)h.removeUploadId(Fe),Ce(Se+1);else{if(h.using[Fe])return Ce(Se+1);var st={},lt=0;w.each(Xe.PartList,function($e){var at=parseInt($e.Size),Ot=lt+at-1;st[$e.PartNumber+"|"+lt+"|"+Ot]=$e.ETag,lt+=at}),w.each(c.PartList,function($e){var at=st[$e.PartNumber+"|"+$e.start+"|"+$e.end];at&&($e.ETag=at,$e.Uploaded=!0)}),i.emit("get_copy_data_finish",{UploadId:Fe,PartList:c.PartList})}})};Ce(0)}),i.on("get_file_size_finish",function(){if(function(){for(var ve=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],ye=1024*1024,Ce=0;Ce<ve.length&&(ye=ve[Ce]*1024*1024,!($/ye<=u.options.MaxPartNumber));Ce++);c.ChunkSize=re=Math.max(re,ye),oe=Math.ceil($/re);for(var Ae=[],Se=1;Se<=oe;Se++){var Fe=(Se-1)*re,it=Se*re<$?Se*re-1:$-1,Xe={PartNumber:Se,start:Fe,end:it,CopySourceRange:"bytes="+Fe+"-"+it};Ae.push(Xe)}c.PartList=Ae}(),c.Headers["x-cos-metadata-directive"]==="Replaced"?se=c.Headers:se=he,se["x-cos-storage-class"]=c.Headers["x-cos-storage-class"]||he["x-cos-storage-class"],se=w.clearKey(se),he["x-cos-storage-class"]==="ARCHIVE"||he["x-cos-storage-class"]==="DEEP_ARCHIVE"){var ce=he["x-cos-restore"];if(!ce||ce==='ongoing-request="true"'){o(w.error(new Error("Unrestored archive object is not allowed to be copied")));return}}delete se["x-cos-copy-source"],delete se["x-cos-metadata-directive"],delete se["x-cos-copy-source-If-Modified-Since"],delete se["x-cos-copy-source-If-Unmodified-Since"],delete se["x-cos-copy-source-If-Match"],delete se["x-cos-copy-source-If-None-Match"],i.emit("get_chunk_size_finish")}),u.headObject({Bucket:V,Region:Z,Key:J,tracker:c.tracker,calledBySdk:"sliceCopyFile"},function(ce,ve){if(ce){ce.statusCode&&ce.statusCode===404?o(w.error(ce,{ErrorStatus:J+" Not Exist"})):o(ce);return}if($=c.FileSize=ve.headers["content-length"],$===void 0||!$){o(w.error(new Error('get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.( 获取Content-Length失败,请在CORS ExposeHeader设置中添加Content-Length,请参考文档:https://cloud.tencent.com/document/product/436/13318 )')));return}if(c.tracker&&c.tracker.setParams({httpSize:$}),ne=w.throttleOnProgress.call(u,$,c.onProgress),$<=te)c.Headers["x-cos-metadata-directive"]||(c.Headers["x-cos-metadata-directive"]="Copy"),u.putObjectCopy(Object.assign(c,{calledBySdk:"sliceCopyFile"}),function(Ce,Ae){if(Ce)return ne(null,!0),o(Ce);ne({loaded:$,total:$},!0),o(Ce,Ae)});else{var ye=ve.headers;fe=ye,he={"Cache-Control":ye["cache-control"],"Content-Disposition":ye["content-disposition"],"Content-Encoding":ye["content-encoding"],"Content-Type":ye["content-type"],Expires:ye.expires,"x-cos-storage-class":ye["x-cos-storage-class"]},w.each(ye,function(Ce,Ae){var Se="x-cos-meta-";Ae.indexOf(Se)===0&&Ae.length>Se.length&&(he[Ae]=Ce)}),i.emit("get_file_size_finish")}})}function y(c,o){var i=c.TaskId,u=c.Bucket,v=c.Region,B=c.Key,D=c.CopySource,N=c.UploadId,z=c.PartNumber*1,V=c.CopySourceRange,Z=this.options.ChunkRetryTimes+1,J=this;S.retry(Z,function(te){J.uploadPartCopy({TaskId:i,Bucket:u,Region:v,Key:B,CopySource:D,UploadId:N,PartNumber:z,CopySourceRange:V,tracker:c.tracker,calledBySdk:c.calledBySdk},function(re,pe){te(re||null,pe)})},function(te,re){return o(te,re)})}var A={sliceUploadFile:p,abortUploadTask:F,uploadFile:K,uploadFiles:q,sliceCopyFile:f};n.exports.init=function(c,o){o.transferToTaskMethod(A,"sliceUploadFile"),w.each(A,function(i,u){c.prototype[u]=w.apiWrapper(u,i)})}},"./src/async.js":function(n,r){var g=function(O,w,t,p){if(p=p||function(){},!O.length||w<=0)return p();var l=0,b=0,k=0;(function R(){if(l>=O.length)return p();for(;k<w&&b<O.length;)b+=1,k+=1,t(O[b-1],function(P){P?(p(P),p=function(){}):(l+=1,k-=1,l>=O.length?p():R())})})()},d=function(O,w,t){var p=function(b){w(function(k,R){k&&b<O?p(b+1):t(k,R)})};O<1?t():p(1)},h={eachLimit:g,retry:d};n.exports=h},"./src/base.js":function(n,r,g){var d=g("./node_modules/@babel/runtime/helpers/defineProperty.js"),h=g("./node_modules/@babel/runtime/helpers/typeof.js");function S(e,C){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(e);C&&(m=m.filter(function(E){return Object.getOwnPropertyDescriptor(e,E).enumerable})),s.push.apply(s,m)}return s}function O(e){for(var C=1;C<arguments.length;C++){var s=arguments[C]!=null?arguments[C]:{};C%2?S(Object(s),!0).forEach(function(m){d(e,m,s[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):S(Object(s)).forEach(function(m){Object.defineProperty(e,m,Object.getOwnPropertyDescriptor(s,m))})}return e}var w=g("./lib/request.js"),t=g("./src/util.js");function p(e,C){var s=this.options.Protocol||(t.isBrowser&&(typeof location>"u"?"undefined":h(location))==="object"&&location.protocol==="http:"?"http:":"https:"),m=this.options.ServiceDomain,E=e.AppId||this.options.appId,T=e.Region;m?(m=m.replace(/\{\{AppId\}\}/gi,E||"").replace(/\{\{Region\}\}/gi,T||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(m)||(m=s+"//"+m),m.slice(-1)==="/"&&(m=m.slice(0,-1))):T?m=s+"//cos."+T+".myqcloud.com":m=s+"//service.cos.myqcloud.com";var I="",j=T?"cos."+T+".myqcloud.com":"service.cos.myqcloud.com",G=m.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");j===G&&(I=j),ee.call(this,{Action:"name/cos:GetService",url:m,method:"GET",headers:e.Headers,SignHost:I,tracker:e.tracker},function(de,ue){if(de)return C(de);var xe=ue&&ue.ListAllMyBucketsResult&&ue.ListAllMyBucketsResult.Buckets&&ue.ListAllMyBucketsResult.Buckets.Bucket||[];xe=t.isArray(xe)?xe:[xe];var Y=ue&&ue.ListAllMyBucketsResult&&ue.ListAllMyBucketsResult.Owner||{};C(null,{Buckets:xe,Owner:Y,statusCode:ue.statusCode,headers:ue.headers})})}function l(e,C){var s=this,m="";if(e.BucketAZConfig){var E={BucketAZConfig:e.BucketAZConfig};m=t.json2xml({CreateBucketConfiguration:E})}ee.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:m,tracker:e.tracker},function(T,I){if(T)return C(T);var j=Qe({protocol:s.options.Protocol,domain:s.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});C(null,{Location:j,statusCode:I.statusCode,headers:I.headers})})}function b(e,C){ee.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD",tracker:e.tracker},C)}function k(e,C){var s={};s.prefix=e.Prefix||"",s.delimiter=e.Delimiter,s.marker=e.Marker,s["max-keys"]=e.MaxKeys,s["encoding-type"]=e.EncodingType,ee.call(this,{Action:"name/cos:GetBucket",ResourceKey:s.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:s,tracker:e.tracker},function(m,E){if(m)return C(m);var T=E.ListBucketResult||{},I=T.Contents||[],j=T.CommonPrefixes||[];I=t.isArray(I)?I:[I],j=t.isArray(j)?j:[j];var G=t.clone(T);t.extend(G,{Contents:I,CommonPrefixes:j,statusCode:E.statusCode,headers:E.headers}),C(null,G)})}function R(e,C){ee.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function P(e,C){var s=e.Headers,m="";if(e.AccessControlPolicy){var E=t.clone(e.AccessControlPolicy||{}),T=E.Grants||E.Grant;T=t.isArray(T)?T:[T],delete E.Grant,delete E.Grants,E.AccessControlList={Grant:T},m=t.json2xml({AccessControlPolicy:E}),s["Content-Type"]="application/xml",s["Content-MD5"]=t.b64(t.md5(m))}t.each(s,function(I,j){j.indexOf("x-cos-grant-")===0&&(s[j]=nt(s[j]))}),ee.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:s,action:"acl",body:m,tracker:e.tracker},function(I,j){if(I)return C(I);C(null,{statusCode:j.statusCode,headers:j.headers})})}function M(e,C){ee.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl",tracker:e.tracker},function(s,m){if(s)return C(s);var E=m.AccessControlPolicy||{},T=E.Owner||{},I=E.AccessControlList.Grant||[];I=t.isArray(I)?I:[I];var j=Be(E);m.headers&&m.headers["x-cos-acl"]&&(j.ACL=m.headers["x-cos-acl"]),j=t.extend(j,{Owner:T,Grants:I,statusCode:m.statusCode,headers:m.headers}),C(null,j)})}function F(e,C){var s=e.CORSConfiguration||{},m=s.CORSRules||e.CORSRules||[];m=t.clone(t.isArray(m)?m:[m]),t.each(m,function(j){t.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(G){var de=G+"s",ue=j[de]||j[G]||[];delete j[de],j[G]=t.isArray(ue)?ue:[ue]})});var E={CORSRule:m};e.ResponseVary&&(E.ResponseVary=e.ResponseVary);var T=t.json2xml({CORSConfiguration:E}),I=e.Headers;I["Content-Type"]="application/xml",I["Content-MD5"]=t.b64(t.md5(T)),ee.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:T,action:"cors",headers:I,tracker:e.tracker},function(j,G){if(j)return C(j);C(null,{statusCode:G.statusCode,headers:G.headers})})}function U(e,C){ee.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},function(s,m){if(s){if(s.statusCode===404&&s.error&&s.error.Code==="NoSuchCORSConfiguration"){var E={CORSRules:[],statusCode:s.statusCode};s.headers&&(E.headers=s.headers),C(null,E)}else C(s);return}var T=m.CORSConfiguration||{},I=T.CORSRules||T.CORSRule||[];I=t.clone(t.isArray(I)?I:[I]);var j=T.ResponseVary;t.each(I,function(G){t.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(de){var ue=de+"s",xe=G[ue]||G[de]||[];delete G[de],G[ue]=t.isArray(xe)?xe:[xe]})}),C(null,{CORSRules:I,ResponseVary:j,statusCode:m.statusCode,headers:m.headers})})}function K(e,C){ee.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode||s.statusCode,headers:m.headers})})}function q(e,C){ee.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location",tracker:e.tracker},C)}function f(e,C){var s=e.Policy;try{typeof s=="string"&&(s=JSON.parse(s))}catch(T){}if(!s||typeof s=="string")return C(t.error(new Error("Policy format error")));var m=JSON.stringify(s);s.version||(s.version="2.0");var E=e.Headers;E["Content-Type"]="application/json",E["Content-MD5"]=t.b64(t.md5(m)),ee.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:m,headers:E,tracker:e.tracker},function(T,I){if(T&&T.statusCode===204)return C(null,{statusCode:T.statusCode});if(T)return C(T);C(null,{statusCode:I.statusCode,headers:I.headers})})}function y(e,C){ee.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0,tracker:e.tracker},function(s,m){if(s)return s.statusCode&&s.statusCode===403?C(t.error(s,{ErrorStatus:"Access Denied"})):s.statusCode&&s.statusCode===405?C(t.error(s,{ErrorStatus:"Method Not Allowed"})):s.statusCode&&s.statusCode===404?C(t.error(s,{ErrorStatus:"Policy Not Found"})):C(s);var E={};try{E=JSON.parse(m.body)}catch(T){}C(null,{Policy:E,statusCode:m.statusCode,headers:m.headers})})}function A(e,C){ee.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode||s.statusCode,headers:m.headers})})}function c(e,C){var s=e.Tagging||{},m=s.TagSet||s.Tags||e.Tags||[];m=t.clone(t.isArray(m)?m:[m]);var E=t.json2xml({Tagging:{TagSet:{Tag:m}}}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=t.b64(t.md5(E)),ee.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:E,action:"tagging",headers:T,tracker:e.tracker},function(I,j){if(I&&I.statusCode===204)return C(null,{statusCode:I.statusCode});if(I)return C(I);C(null,{statusCode:j.statusCode,headers:j.headers})})}function o(e,C){ee.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},function(s,m){if(s){if(s.statusCode===404&&s.error&&(s.error==="Not Found"||s.error.Code==="NoSuchTagSet")){var E={Tags:[],statusCode:s.statusCode};s.headers&&(E.headers=s.headers),C(null,E)}else C(s);return}var T=[];try{T=m.Tagging.TagSet.Tag||[]}catch(I){}T=t.clone(t.isArray(T)?T:[T]),C(null,{Tags:T,statusCode:m.statusCode,headers:m.headers})})}function i(e,C){ee.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function u(e,C){var s=e.LifecycleConfiguration||{},m=s.Rules||e.Rules||[];m=t.clone(m);var E=t.json2xml({LifecycleConfiguration:{Rule:m}}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=t.b64(t.md5(E)),ee.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:E,action:"lifecycle",headers:T,tracker:e.tracker},function(I,j){if(I&&I.statusCode===204)return C(null,{statusCode:I.statusCode});if(I)return C(I);C(null,{statusCode:j.statusCode,headers:j.headers})})}function v(e,C){ee.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},function(s,m){if(s){if(s.statusCode===404&&s.error&&s.error.Code==="NoSuchLifecycleConfiguration"){var E={Rules:[],statusCode:s.statusCode};s.headers&&(E.headers=s.headers),C(null,E)}else C(s);return}var T=[];try{T=m.LifecycleConfiguration.Rule||[]}catch(I){}T=t.clone(t.isArray(T)?T:[T]),C(null,{Rules:T,statusCode:m.statusCode,headers:m.headers})})}function B(e,C){ee.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function D(e,C){if(!e.VersioningConfiguration){C(t.error(new Error("missing param VersioningConfiguration")));return}var s=e.VersioningConfiguration||{},m=t.json2xml({VersioningConfiguration:s}),E=e.Headers;E["Content-Type"]="application/xml",E["Content-MD5"]=t.b64(t.md5(m)),ee.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:m,action:"versioning",headers:E,tracker:e.tracker},function(T,I){if(T&&T.statusCode===204)return C(null,{statusCode:T.statusCode});if(T)return C(T);C(null,{statusCode:I.statusCode,headers:I.headers})})}function N(e,C){ee.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning",tracker:e.tracker},function(s,m){s||!m.VersioningConfiguration&&(m.VersioningConfiguration={}),C(s,m)})}function z(e,C){var s=t.clone(e.ReplicationConfiguration),m=t.json2xml({ReplicationConfiguration:s});m=m.replace(/<(\/?)Rules>/gi,"<$1Rule>"),m=m.replace(/<(\/?)Tags>/gi,"<$1Tag>");var E=e.Headers;E["Content-Type"]="application/xml",E["Content-MD5"]=t.b64(t.md5(m)),ee.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:m,action:"replication",headers:E,tracker:e.tracker},function(T,I){if(T&&T.statusCode===204)return C(null,{statusCode:T.statusCode});if(T)return C(T);C(null,{statusCode:I.statusCode,headers:I.headers})})}function V(e,C){ee.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},function(s,m){if(s){if(s.statusCode===404&&s.error&&(s.error==="Not Found"||s.error.Code==="ReplicationConfigurationnotFoundError")){var E={ReplicationConfiguration:{Rules:[]},statusCode:s.statusCode};s.headers&&(E.headers=s.headers),C(null,E)}else C(s);return}!m.ReplicationConfiguration&&(m.ReplicationConfiguration={}),m.ReplicationConfiguration.Rule&&(m.ReplicationConfiguration.Rules=t.makeArray(m.ReplicationConfiguration.Rule),delete m.ReplicationConfiguration.Rule),C(s,m)})}function Z(e,C){ee.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function J(e,C){if(!e.WebsiteConfiguration){C(t.error(new Error("missing param WebsiteConfiguration")));return}var s=t.clone(e.WebsiteConfiguration||{}),m=s.RoutingRules||s.RoutingRule||[];m=t.isArray(m)?m:[m],delete s.RoutingRule,delete s.RoutingRules,m.length&&(s.RoutingRules={RoutingRule:m});var E=t.json2xml({WebsiteConfiguration:s}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=t.b64(t.md5(E)),ee.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:E,action:"website",headers:T,tracker:e.tracker},function(I,j){if(I&&I.statusCode===204)return C(null,{statusCode:I.statusCode});if(I)return C(I);C(null,{statusCode:j.statusCode,headers:j.headers})})}function te(e,C){ee.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website",tracker:e.tracker},function(s,m){if(s){if(s.statusCode===404&&s.error.Code==="NoSuchWebsiteConfiguration"){var E={WebsiteConfiguration:{},statusCode:s.statusCode};s.headers&&(E.headers=s.headers),C(null,E)}else C(s);return}var T=m.WebsiteConfiguration||{};if(T.RoutingRules){var I=t.clone(T.RoutingRules.RoutingRule||[]);I=t.makeArray(I),T.RoutingRules=I}C(null,{WebsiteConfiguration:T,statusCode:m.statusCode,headers:m.headers})})}function re(e,C){ee.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function pe(e,C){if(!e.RefererConfiguration){C(t.error(new Error("missing param RefererConfiguration")));return}var s=t.clone(e.RefererConfiguration||{}),m=s.DomainList||{},E=m.Domains||m.Domain||[];E=t.isArray(E)?E:[E],E.length&&(s.DomainList={Domain:E});var T=t.json2xml({RefererConfiguration:s}),I=e.Headers;I["Content-Type"]="application/xml",I["Content-MD5"]=t.b64(t.md5(T)),ee.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:T,action:"referer",headers:I,tracker:e.tracker},function(j,G){if(j&&j.statusCode===204)return C(null,{statusCode:j.statusCode});if(j)return C(j);C(null,{statusCode:G.statusCode,headers:G.headers})})}function le(e,C){ee.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer",tracker:e.tracker},function(s,m){if(s){if(s.statusCode===404&&s.error.Code==="NoSuchRefererConfiguration"){var E={WebsiteConfiguration:{},statusCode:s.statusCode};s.headers&&(E.headers=s.headers),C(null,E)}else C(s);return}var T=m.RefererConfiguration||{};if(T.DomainList){var I=t.makeArray(T.DomainList.Domain||[]);T.DomainList={Domains:I}}C(null,{RefererConfiguration:T,statusCode:m.statusCode,headers:m.headers})})}function oe(e,C){var s=e.DomainConfiguration||{},m=s.DomainRule||e.DomainRule||[];m=t.clone(m);var E=t.json2xml({DomainConfiguration:{DomainRule:m}}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=t.b64(t.md5(E)),ee.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:E,action:"domain",headers:T,tracker:e.tracker},function(I,j){if(I&&I.statusCode===204)return C(null,{statusCode:I.statusCode});if(I)return C(I);C(null,{statusCode:j.statusCode,headers:j.headers})})}function ie(e,C){ee.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},function(s,m){if(s)return C(s);var E=[];try{E=m.DomainConfiguration.DomainRule||[]}catch(T){}E=t.clone(t.isArray(E)?E:[E]),C(null,{DomainRule:E,statusCode:m.statusCode,headers:m.headers})})}function $(e,C){ee.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function ne(e,C){var s=e.OriginConfiguration||{},m=s.OriginRule||e.OriginRule||[];m=t.clone(m);var E=t.json2xml({OriginConfiguration:{OriginRule:m}}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=t.b64(t.md5(E)),ee.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:E,action:"origin",headers:T,tracker:e.tracker},function(I,j){if(I&&I.statusCode===204)return C(null,{statusCode:I.statusCode});if(I)return C(I);C(null,{statusCode:j.statusCode,headers:j.headers})})}function fe(e,C){ee.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},function(s,m){if(s)return C(s);var E=[];try{E=m.OriginConfiguration.OriginRule||[]}catch(T){}E=t.clone(t.isArray(E)?E:[E]),C(null,{OriginRule:E,statusCode:m.statusCode,headers:m.headers})})}function he(e,C){ee.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function se(e,C){var s=t.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),m=e.Headers;m["Content-Type"]="application/xml",m["Content-MD5"]=t.b64(t.md5(s)),ee.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"logging",headers:m,tracker:e.tracker},function(E,T){if(E&&E.statusCode===204)return C(null,{statusCode:E.statusCode});if(E)return C(E);C(null,{statusCode:T.statusCode,headers:T.headers})})}function ce(e,C){ee.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging",tracker:e.tracker},function(s,m){if(s)return C(s);C(null,{BucketLoggingStatus:m.BucketLoggingStatus,statusCode:m.statusCode,headers:m.headers})})}function ve(e,C,s){var m=t.clone(C.InventoryConfiguration);if(m.OptionalFields){var E=m.OptionalFields||[];m.OptionalFields={Field:E}}if(m.Destination&&m.Destination.COSBucketDestination&&m.Destination.COSBucketDestination.Encryption){var T=m.Destination.COSBucketDestination.Encryption;Object.keys(T).indexOf("SSECOS")>-1&&(T["SSE-COS"]=T.SSECOS,delete T.SSECOS)}var I=t.json2xml({InventoryConfiguration:m}),j=C.Headers;j["Content-Type"]="application/xml",j["Content-MD5"]=t.b64(t.md5(I));var G=e==="PUT"?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";ee.call(this,{Action:G,method:e,Bucket:C.Bucket,Region:C.Region,body:I,action:"inventory",qs:{id:C.Id},headers:j,tracker:C.tracker},function(de,ue){if(de&&de.statusCode===204)return s(null,{statusCode:de.statusCode});if(de)return s(de);s(null,{statusCode:ue.statusCode,headers:ue.headers})})}function ye(e,C){return ve.call(this,"PUT",e,C)}function Ce(e,C){return ve.call(this,"POST",e,C)}function Ae(e,C){ee.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},function(s,m){if(s)return C(s);var E=m.InventoryConfiguration;if(E&&E.OptionalFields&&E.OptionalFields.Field){var T=E.OptionalFields.Field;t.isArray(T)||(T=[T]),E.OptionalFields=T}if(E.Destination&&E.Destination.COSBucketDestination&&E.Destination.COSBucketDestination.Encryption){var I=E.Destination.COSBucketDestination.Encryption;Object.keys(I).indexOf("SSE-COS")>-1&&(I.SSECOS=I["SSE-COS"],delete I["SSE-COS"])}C(null,{InventoryConfiguration:E,statusCode:m.statusCode,headers:m.headers})})}function Se(e,C){ee.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken},tracker:e.tracker},function(s,m){if(s)return C(s);var E=m.ListInventoryConfigurationResult,T=E.InventoryConfiguration||[];T=t.isArray(T)?T:[T],delete E.InventoryConfiguration,t.each(T,function(I){if(I&&I.OptionalFields&&I.OptionalFields.Field){var j=I.OptionalFields.Field;t.isArray(j)||(j=[j]),I.OptionalFields=j}if(I.Destination&&I.Destination.COSBucketDestination&&I.Destination.COSBucketDestination.Encryption){var G=I.Destination.COSBucketDestination.Encryption;Object.keys(G).indexOf("SSE-COS")>-1&&(G.SSECOS=G["SSE-COS"],delete G["SSE-COS"])}}),E.InventoryConfigurations=T,t.extend(E,{statusCode:m.statusCode,headers:m.headers}),C(null,E)})}function Fe(e,C){ee.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function it(e,C){if(!e.AccelerateConfiguration){C(t.error(new Error("missing param AccelerateConfiguration")));return}var s={AccelerateConfiguration:e.AccelerateConfiguration||{}},m=t.json2xml(s),E={};E["Content-Type"]="application/xml",E["Content-MD5"]=t.b64(t.md5(m)),ee.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:m,action:"accelerate",headers:E,tracker:e.tracker},function(T,I){if(T)return C(T);C(null,{statusCode:I.statusCode,headers:I.headers})})}function Xe(e,C){ee.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate",tracker:e.tracker},function(s,m){s||!m.AccelerateConfiguration&&(m.AccelerateConfiguration={}),C(s,m)})}function st(e,C){var s=e.ServerSideEncryptionConfiguration||{},m=s.Rule||s.Rules||[],E=t.json2xml({ServerSideEncryptionConfiguration:{Rule:m}}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=t.b64(t.md5(E)),ee.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:E,action:"encryption",headers:T,tracker:e.tracker},function(I,j){if(I&&I.statusCode===204)return C(null,{statusCode:I.statusCode});if(I)return C(I);C(null,{statusCode:j.statusCode,headers:j.headers})})}function lt(e,C){ee.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},function(s,m){if(s){if(s.statusCode===404&&s.code==="NoSuchEncryptionConfiguration"){var E={EncryptionConfiguration:{Rules:[]},statusCode:s.statusCode};s.headers&&(E.headers=s.headers),C(null,E)}else C(s);return}var T=t.makeArray(m.EncryptionConfiguration&&m.EncryptionConfiguration.Rule||[]);m.EncryptionConfiguration={Rules:T},C(s,m)})}function $e(e,C){ee.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function at(e,C){ee.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},function(s,m){if(s){var E=s.statusCode;return e.Headers["If-Modified-Since"]&&E&&E===304?C(null,{NotModified:!0,statusCode:E}):C(s)}m.ETag=t.attr(m.headers,"etag",""),C(null,m)})}function Ot(e,C){var s={};s.prefix=e.Prefix||"",s.delimiter=e.Delimiter,s["key-marker"]=e.KeyMarker,s["version-id-marker"]=e.VersionIdMarker,s["max-keys"]=e.MaxKeys,s["encoding-type"]=e.EncodingType,ee.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:s.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:s,action:"versions",tracker:e.tracker},function(m,E){if(m)return C(m);var T=E.ListVersionsResult||{},I=T.DeleteMarker||[];I=t.isArray(I)?I:[I];var j=T.Version||[];j=t.isArray(j)?j:[j];var G=t.clone(T);delete G.DeleteMarker,delete G.Version,t.extend(G,{DeleteMarkers:I,Versions:j,statusCode:E.statusCode,headers:E.headers}),C(null,G)})}function Gt(e,C){var s=this;if(s.logger.info({cate:"PROCESS",tag:"download",msg:"[key=".concat(e.Key,"] getObject开始")}),this.options.ObjectKeySimplifyCheck){var m=t.simplifyPath(e.Key);if(m==="/"){C(t.error(new Error("The Getobject Key is illegal")));return}}var E=e.Query||{},T=e.QueryString||"",I=t.throttleOnProgress.call(this,0,e.onProgress),j=e.tracker;j&&j.setParams({signStartTime:new Date().getTime()}),E["response-content-type"]=e.ResponseContentType,E["response-content-language"]=e.ResponseContentLanguage,E["response-expires"]=e.ResponseExpires,E["response-cache-control"]=e.ResponseCacheControl,E["response-content-disposition"]=e.ResponseContentDisposition,E["response-content-encoding"]=e.ResponseContentEncoding,ee.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,DataType:e.DataType,headers:e.Headers,qs:E,qsStr:T,rawBody:!0,onDownloadProgress:I,tracker:j},function(G,de){if(I(null,!0),G){var ue=G.statusCode;return e.Headers["If-Modified-Since"]&&ue&&ue===304?C(null,{NotModified:!0}):C(G)}C(null,{Body:de.body,ETag:t.attr(de.headers,"etag",""),statusCode:de.statusCode,headers:de.headers}),s.logger.info({cate:"PROCESS",tag:"download",msg:"[key=".concat(e.Key,"] getObject结束")})})}function Wt(e,C){var s=this,m=e.ContentLength,E=t.throttleOnProgress.call(s,m,e.onProgress);s.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] putObject开始")});var T=e.Headers;!T["Cache-Control"]&&!T["cache-control"]&&(T["Cache-Control"]=""),!T["Content-Type"]&&!T["content-type"]&&(T["Content-Type"]=e.Body&&e.Body.type||"");var I=e.UploadAddMetaMd5||s.options.UploadAddMetaMd5||s.options.UploadCheckContentMd5,j=e.tracker;I&&j&&j.setParams({md5StartTime:new Date().getTime()}),I&&s.logger.debug({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] 开始计算 md5")}),t.getBodyMd5(I,e.Body,function(G){G&&(s.logger.debug({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] md5: ").concat(G,",md5Base64=").concat(t.b64(G))}),j&&j.setParams({md5EndTime:new Date().getTime()}),s.options.UploadCheckContentMd5&&(T["Content-MD5"]=t.b64(G)),(e.UploadAddMetaMd5||s.options.UploadAddMetaMd5)&&(T["x-cos-meta-md5"]=G)),e.ContentLength!==void 0&&(T["Content-Length"]=e.ContentLength),E(null,!0),ee.call(s,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:E,tracker:j},function(de,ue){if(de)return s.logger.error({cate:"ERROR",tag:"upload",msg:"上传失败,错误信息:".concat(JSON.stringify(de))}),E(null,!0),C(de);E({loaded:m,total:m},!0);var xe=Qe({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:e.Bucket,region:s.options.UseAccelerate?"accelerate":e.Region,object:e.Key});xe=xe.substr(xe.indexOf("://")+3),ue.Location=xe,ue.ETag=t.attr(ue.headers,"etag",""),s.logger.info({cate:"RESULT",tag:"upload",msg:"上传成功,Location=".concat(xe)}),s.logger.info({cate:"PROCESS",tag:"upload",msg:"[key=".concat(e.Key,"] putObject结束")}),C(null,ue)})},e.onHashProgress)}function Xt(e,C){ee.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId,action:e.Recursive?"recursive":"",tracker:e.tracker},function(s,m){if(s){var E=s.statusCode;return E&&E===404?C(null,{BucketNotFound:!0,statusCode:E}):C(s)}C(null,{statusCode:m.statusCode,headers:m.headers})})}function $t(e,C){var s={};e.VersionId&&(s.versionId=e.VersionId),ee.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:s,action:"acl",tracker:e.tracker},function(m,E){if(m)return C(m);var T=E.AccessControlPolicy||{},I=T.Owner||{},j=T.AccessControlList&&T.AccessControlList.Grant||[];j=t.isArray(j)?j:[j];var G=Be(T);delete G.GrantWrite,E.headers&&E.headers["x-cos-acl"]&&(G.ACL=E.headers["x-cos-acl"]),G=t.extend(G,{Owner:I,Grants:j,statusCode:E.statusCode,headers:E.headers}),C(null,G)})}function Yt(e,C){var s=e.Headers,m="";if(e.AccessControlPolicy){var E=t.clone(e.AccessControlPolicy||{}),T=E.Grants||E.Grant;T=t.isArray(T)?T:[T],delete E.Grant,delete E.Grants,E.AccessControlList={Grant:T},m=t.json2xml({AccessControlPolicy:E}),s["Content-Type"]="application/xml",s["Content-MD5"]=t.b64(t.md5(m))}t.each(s,function(I,j){j.indexOf("x-cos-grant-")===0&&(s[j]=nt(s[j]))}),ee.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:s,body:m,tracker:e.tracker},function(I,j){if(I)return C(I);C(null,{statusCode:j.statusCode,headers:j.headers})})}function Qt(e,C){var s=e.Headers;s.Origin=e.Origin,s["Access-Control-Request-Method"]=e.AccessControlRequestMethod,s["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,ee.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:s,tracker:e.tracker},function(m,E){if(m)return m.statusCode&&m.statusCode===403?C(null,{OptionsForbidden:!0,statusCode:m.statusCode}):C(m);var T=E.headers||{};C(null,{AccessControlAllowOrigin:T["access-control-allow-origin"],AccessControlAllowMethods:T["access-control-allow-methods"],AccessControlAllowHeaders:T["access-control-allow-headers"],AccessControlExposeHeaders:T["access-control-expose-headers"],AccessControlMaxAge:T["access-control-max-age"],statusCode:E.statusCode,headers:E.headers})})}function Jt(e,C){var s=this,m=e.Headers;!m["Cache-Control"]&&!m["cache-control"]&&(m["Cache-Control"]="");var E=e.CopySource||"",T=t.getSourceParams.call(this,E);if(!T){C(t.error(new Error("CopySource format error")));return}var I=T.Bucket,j=T.Region,G=decodeURIComponent(T.Key);ee.call(this,{Scope:[{action:"name/cos:GetObject",bucket:I,region:j,prefix:G},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},function(de,ue){if(de)return C(de);var xe=t.clone(ue.CopyObjectResult||{}),Y=Qe({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});t.extend(xe,{Location:Y,statusCode:ue.statusCode,headers:ue.headers}),C(null,xe)})}function ze(e,C){var s=e.CopySource||"",m=t.getSourceParams.call(this,s);if(!m){C(t.error(new Error("CopySource format error")));return}var E=m.Bucket,T=m.Region,I=decodeURIComponent(m.Key);ee.call(this,{Scope:[{action:"name/cos:GetObject",bucket:E,region:T,prefix:I},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,tracker:e.tracker},function(j,G){if(j)return C(j);var de=t.clone(G.CopyPartResult||{});t.extend(de,{statusCode:G.statusCode,headers:G.headers}),C(null,de)})}function W(e,C){var s=e.Objects||[],m=e.Quiet;s=t.isArray(s)?s:[s];var E=t.json2xml({Delete:{Object:s,Quiet:m||!1}}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=t.b64(t.md5(E));var I=t.map(s,function(j){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:j.Key}});ee.call(this,{Scope:I,method:"POST",Bucket:e.Bucket,Region:e.Region,body:E,action:"delete",headers:T,tracker:e.tracker},function(j,G){if(j)return C(j);var de=G.DeleteResult||{},ue=de.Deleted||[],xe=de.Error||[];ue=t.isArray(ue)?ue:[ue],xe=t.isArray(xe)?xe:[xe];var Y=t.clone(de);t.extend(Y,{Error:xe,Deleted:ue,statusCode:G.statusCode,headers:G.headers}),C(null,Y)})}function L(e,C){var s=e.Headers;if(!e.RestoreRequest){C(t.error(new Error("missing param RestoreRequest")));return}var m=e.RestoreRequest||{},E=t.json2xml({RestoreRequest:m});s["Content-Type"]="application/xml",s["Content-MD5"]=t.b64(t.md5(E)),ee.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:E,action:"restore",headers:s,tracker:e.tracker},C)}function _(e,C){var s=e.Tagging||{},m=s.TagSet||s.Tags||e.Tags||[];m=t.clone(t.isArray(m)?m:[m]);var E=t.json2xml({Tagging:{TagSet:{Tag:m}}}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=t.b64(t.md5(E)),ee.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:E,action:"tagging",headers:T,VersionId:e.VersionId,tracker:e.tracker},function(I,j){if(I&&I.statusCode===204)return C(null,{statusCode:I.statusCode});if(I)return C(I);C(null,{statusCode:j.statusCode,headers:j.headers})})}function H(e,C){ee.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},function(s,m){if(s){if(s.statusCode===404&&s.error&&(s.error==="Not Found"||s.error.Code==="NoSuchTagSet")){var E={Tags:[],statusCode:s.statusCode};s.headers&&(E.headers=s.headers),C(null,E)}else C(s);return}var T=[];try{T=m.Tagging.TagSet.Tag||[]}catch(I){}T=t.clone(t.isArray(T)?T:[T]),C(null,{Tags:T,statusCode:m.statusCode,headers:m.headers})})}function X(e,C){ee.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},function(s,m){if(s&&s.statusCode===204)return C(null,{statusCode:s.statusCode});if(s)return C(s);C(null,{statusCode:m.statusCode,headers:m.headers})})}function Q(e,C){var s=e.SelectType;if(!s)return C(t.error(new Error("missing param SelectType")));var m=e.SelectRequest||{},E=t.json2xml({SelectRequest:m}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=t.b64(t.md5(E)),ee.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"select",qs:{"select-type":e.SelectType},VersionId:e.VersionId,body:E,DataType:"arraybuffer",rawBody:!0,tracker:e.tracker},function(I,j){if(I&&I.statusCode===204)return C(null,{statusCode:I.statusCode});if(I)return C(I);var G=t.parseSelectPayload(j.body);C(null,{statusCode:j.statusCode,headers:j.headers,Body:G.body,Payload:G.payload})})}function ae(e,C){var s=this,m=e.Headers,E=e.tracker;!m["Cache-Control"]&&!m["cache-control"]&&(m["Cache-Control"]=""),!m["Content-Type"]&&!m["content-type"]&&(m["Content-Type"]=e.Body&&e.Body.type||"");var T=e.Body&&(e.UploadAddMetaMd5||s.options.UploadAddMetaMd5);T&&E&&E.setParams({md5StartTime:new Date().getTime()}),t.getBodyMd5(T,e.Body,function(I){I&&(e.Headers["x-cos-meta-md5"]=I),T&&E&&E.setParams({md5EndTime:new Date().getTime()}),ee.call(s,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:E},function(j,G){if(j)return E&&E.parent&&E.parent.setParams({errorNode:"multipartInit"}),C(j);if(G=t.clone(G||{}),G&&G.InitiateMultipartUploadResult)return C(null,t.extend(G.InitiateMultipartUploadResult,{statusCode:G.statusCode,headers:G.headers}));C(null,G)})},e.onHashProgress)}function ge(e,C){var s=this;t.getFileSize("multipartUpload",e,function(){var m=e.tracker,E=s.options.UploadCheckContentMd5;E&&m&&m.setParams({md5StartTime:new Date().getTime()}),t.getBodyMd5(E,e.Body,function(T){T&&(e.Headers["Content-MD5"]=t.b64(T)),E&&m&&m.setParams({md5EndTime:new Date().getTime()}),m&&m.setParams({partNumber:e.PartNumber}),ee.call(s,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null,tracker:m},function(I,j){if(I)return m&&m.parent&&m.parent.setParams({errorNode:"multipartUpload"}),C(I);C(null,{ETag:t.attr(j.headers,"etag",""),statusCode:j.statusCode,headers:j.headers})})})})}function ke(e,C){for(var s=this,m=e.UploadId,E=e.Parts,T=e.tracker,I=0,j=E.length;I<j;I++)E[I].ETag&&E[I].ETag.indexOf('"')===0||(E[I].ETag='"'+E[I].ETag+'"');var G=t.json2xml({CompleteMultipartUpload:{Part:E}});G=G.replace(/\n\s*/g,"");var de=e.Headers;de["Content-Type"]="application/xml",de["Content-MD5"]=t.b64(t.md5(G)),ee.call(this,{Action:"name/cos:CompleteMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{uploadId:m},body:G,headers:de,tracker:T},function(ue,xe){if(ue)return T&&T.parent&&T.parent.setParams({errorNode:"multipartComplete"}),C(ue);var Y=Qe({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:e.Bucket,region:s.options.UseAccelerate?"accelerate":e.Region,object:e.Key,isLocation:!0}),Re=xe.CompleteMultipartUploadResult||{};if(Re.ProcessResults&&(Re.UploadResult={OriginalInfo:{Key:Re.Key,Location:Y,ETag:Re.ETag,ImageInfo:Re.ImageInfo},ProcessResults:Re.ProcessResults},delete Re.ImageInfo,delete Re.ProcessResults),Re.CallbackResult){var Ue=Re.CallbackResult;if(Ue.Status==="200"&&Ue.CallbackBody)try{Re.CallbackBody=JSON.parse(t.decodeBase64(Ue.CallbackBody))}catch(qe){Re.CallbackBody={}}else Re.CallbackError=Ue.Error||{};delete Re.CallbackResult}if(Re.ReturnBodyResult){var Ke=Re.ReturnBodyResult;if(Ke.Status==="200"&&Ke.ReturnBody)try{Re.ReturnBody=JSON.parse(t.decodeBase64(Ke.ReturnBody))}catch(qe){Re.ReturnBody={}}else Re.ReturnError={Code:Ke.Code,Message:Ke.Message,Status:Ke.Status};delete Re.ReturnBodyResult}var Ve=t.extend(Re,{Location:Y,statusCode:xe.statusCode,headers:xe.headers});C(null,Ve)})}function Ee(e,C){var s={};s.delimiter=e.Delimiter,s["encoding-type"]=e.EncodingType,s.prefix=e.Prefix||"",s["max-uploads"]=e.MaxUploads,s["key-marker"]=e.KeyMarker,s["upload-id-marker"]=e.UploadIdMarker,s=t.clearKey(s);var m=e.tracker;m&&m.setParams({signStartTime:new Date().getTime()}),ee.call(this,{Action:"name/cos:ListMultipartUploads",ResourceKey:s.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:s,action:"uploads",tracker:m},function(E,T){if(E)return m&&m.parent&&m.parent.setParams({errorNode:"multipartList"}),C(E);if(T&&T.ListMultipartUploadsResult){var I=T.ListMultipartUploadsResult.Upload||[];I=t.isArray(I)?I:[I],T.ListMultipartUploadsResult.Upload=I}var j=t.clone(T.ListMultipartUploadsResult||{});t.extend(j,{statusCode:T.statusCode,headers:T.headers}),C(null,j)})}function Pe(e,C){var s={},m=e.tracker;s.uploadId=e.UploadId,s["encoding-type"]=e.EncodingType,s["max-parts"]=e.MaxParts,s["part-number-marker"]=e.PartNumberMarker,ee.call(this,{Action:"name/cos:ListParts",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:s,tracker:m},function(E,T){if(E)return m&&m.parent&&m.parent.setParams({errorNode:"multipartListPart"}),C(E);var I=T.ListPartsResult||{},j=I.Part||[];j=t.isArray(j)?j:[j],I.Part=j;var G=t.clone(I);t.extend(G,{statusCode:T.statusCode,headers:T.headers}),C(null,G)})}function De(e,C){var s={};s.uploadId=e.UploadId,ee.call(this,{Action:"name/cos:AbortMultipartUpload",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:s,tracker:e.tracker},function(m,E){if(m)return C(m);C(null,{statusCode:E.statusCode,headers:E.headers})})}function Me(e,C){ee.call(this,{method:e.Method,Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:e.Action,headers:e.Headers,qs:e.Query,body:e.Body,Url:e.Url,rawBody:e.RawBody,DataType:e.DataType,tracker:e.tracker},function(s,m){if(s)return C(s);m&&m.body&&(m.Body=m.body,delete m.body),C(s,m)})}function Ye(e,C){var s=e.Headers;!s["Cache-Control"]&&!s["cache-control"]&&(s["Cache-Control"]=""),!s["Content-Type"]&&!s["content-type"]&&(s["Content-Type"]=e.Body&&e.Body.type||""),ee.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers,tracker:e.tracker},function(m,E){if(m)return C(m);C(null,E)})}function gt(e){var C=this;return t.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,UseRawKey:C.options.UseRawKey,SystemClockOffset:C.options.SystemClockOffset})}function Ze(e,C){var s=this,m=e.UseAccelerate===void 0?s.options.UseAccelerate:e.UseAccelerate,E=Qe({ForcePathStyle:s.options.ForcePathStyle,protocol:e.Protocol||s.options.Protocol,domain:e.Domain||s.options.Domain,bucket:e.Bucket,region:m?"accelerate":e.Region,object:e.Key}),T="";e.Query&&(T+=t.obj2str(e.Query)),e.QueryString&&(T+=(T?"&":"")+e.QueryString);var I=E;if(e.Sign!==void 0&&!e.Sign)return T&&(I+="?"+T),C(null,{Url:I}),I;var j=bt.call(this,{Bucket:e.Bucket,Region:e.Region,UseAccelerate:e.UseAccelerate,Url:E}),G=jt.call(this,{Action:(e.Method||"").toUpperCase()==="PUT"?"name/cos:PutObject":"name/cos:GetObject",Bucket:e.Bucket||"",Region:e.Region||"",Method:e.Method||"get",Key:e.Key,Expires:e.Expires,Headers:e.Headers,Query:e.Query,SignHost:j,ForceSignHost:e.ForceSignHost===!1?!1:s.options.ForceSignHost},function(de,ue){if(C){if(de){C(de);return}var xe=function(Ue){var Ke=Ue.match(/q-url-param-list.*?(?=&)/g)[0],Ve="q-url-param-list="+encodeURIComponent(Ke.replace(/q-url-param-list=/,"")).toLowerCase(),qe=new RegExp(Ke,"g"),ut=Ue.replace(qe,Ve);return ut},Y=E;Y+="?"+(ue.Authorization.indexOf("q-signature")>-1?xe(ue.Authorization):"sign="+encodeURIComponent(ue.Authorization)),ue.SecurityToken&&(Y+="&x-cos-security-token="+ue.SecurityToken),ue.ClientIP&&(Y+="&clientIP="+ue.ClientIP),ue.ClientUA&&(Y+="&clientUA="+ue.ClientUA),ue.Token&&(Y+="&token="+ue.Token),T&&(Y+="&"+T),setTimeout(function(){C(null,{Url:Y})})}});return G?(I+="?"+G.Authorization+(G.SecurityToken?"&x-cos-security-token="+G.SecurityToken:""),T&&(I+="&"+T)):T&&(I+="?"+T),I}function Be(e){var C={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},s={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},m=e&&e.AccessControlList||{},E=m.Grant;E&&(E=t.isArray(E)?E:[E]);var T={READ:0,WRITE:0,FULL_CONTROL:0};return E&&E.length&&t.each(E,function(I){var j=I.Grantee.URI&&I.Grantee.URI.endsWith("/groups/global/AllUsers");I.Grantee.ID==="qcs::cam::anyone:anyone"||j?T[I.Permission]=1:I.Grantee.ID!==e.Owner.ID&&C[s[I.Permission]].push('id="'+I.Grantee.ID+'"')}),T.FULL_CONTROL||T.WRITE&&T.READ?C.ACL="public-read-write":T.READ?C.ACL="public-read":C.ACL="private",t.each(s,function(I){C[I]=nt(C[I].join(","))}),C}function nt(e){var C=e.split(","),s={},m,E;for(m=0;m<C.length;)E=C[m].trim(),s[E]?C.splice(m,1):(s[E]=!0,C[m]=E,m++);return C.join(",")}function Qe(e){var C=e.region||"",s=e.bucket||"",m=s.substr(0,s.lastIndexOf("-")),E=s.substr(s.lastIndexOf("-")+1),T=e.domain,I=e.object;typeof T=="function"&&(T=T({Bucket:s,Region:C})),["http","https"].includes(e.protocol)&&(e.protocol=e.protocol+":");var j=e.protocol||(t.isBrowser&&(typeof location>"u"?"undefined":h(location))==="object"&&location.protocol==="http:"?"http:":"https:");T||(["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(C)>-1?T="{Region}.myqcloud.com":T="cos.{Region}.myqcloud.com",e.ForcePathStyle||(T="{Bucket}."+T)),T=T.replace(/\{\{AppId\}\}/gi,E).replace(/\{\{Bucket\}\}/gi,m).replace(/\{\{Region\}\}/gi,C).replace(/\{\{.*?\}\}/gi,""),T=T.replace(/\{AppId\}/gi,E).replace(/\{BucketName\}/gi,m).replace(/\{Bucket\}/gi,s).replace(/\{Region\}/gi,C).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(T)||(T=j+"//"+T),T.slice(-1)==="/"&&(T=T.slice(0,-1));var G=T;return e.ForcePathStyle&&(G+="/"+s),G+="/",I&&(G+=t.camSafeUrlEncode(I).replace(/%2F/g,"/")),e.isLocation&&(G=G.replace(/^https?:\/\//,"")),G}var bt=function(C){var s=C.Url||C.Bucket&&C.Region;if(!s)return"";var m=C.UseAccelerate===void 0?this.options.UseAccelerate:C.UseAccelerate,E=C.Url||Qe({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:C.Bucket,region:m?"accelerate":C.Region}),T=E.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");return T};function jt(e,C){var s=t.clone(e.Headers),m="";t.each(s,function(we,me){(we===""||["content-type","cache-control","expires"].indexOf(me.toLowerCase())>-1)&&delete s[me],me.toLowerCase()==="host"&&(m=we)});var E=e.ForceSignHost!==!1;!m&&e.SignHost&&E&&(s.Host=e.SignHost);var T=!1,I=function(me,Oe){T||(T=!0,Oe&&Oe.XCosSecurityToken&&!Oe.SecurityToken&&(Oe=t.clone(Oe),Oe.SecurityToken=Oe.XCosSecurityToken,delete Oe.XCosSecurityToken),C&&C(me,Oe))},j=this,G=e.Bucket||"",de=e.Region||"",ue=e.Key||"";j.options.ForcePathStyle&&G&&(ue=G+"/"+ue);var xe="/"+ue,Y={},Re=e.Scope;if(!Re){var Ue=e.Action||"",Ke=e.ResourceKey||e.Key||"";Re=e.Scope||[{action:Ue,bucket:G,region:de,prefix:Ke}]}var Ve=t.md5(JSON.stringify(Re));j._StsCache=j._StsCache||[],function(){var we,me;for(we=j._StsCache.length-1;we>=0;we--){me=j._StsCache[we];var Oe=Math.round(t.getSkewTime(j.options.SystemClockOffset)/1e3)+30;if(me.StartTime&&Oe<me.StartTime||Oe>=me.ExpiredTime){j._StsCache.splice(we,1);continue}if(!me.ScopeLimit||me.ScopeLimit&&me.ScopeKey===Ve){Y=me;break}}}();var qe=function(){var me="";Y.StartTime&&e.Expires?me=Y.StartTime+";"+(Y.StartTime+e.Expires*1):Y.StartTime&&Y.ExpiredTime&&(me=Y.StartTime+";"+Y.ExpiredTime);var Oe=t.getAuth({SecretId:Y.TmpSecretId,SecretKey:Y.TmpSecretKey,Method:e.Method,Pathname:xe,Query:e.Query,Headers:s,Expires:e.Expires,UseRawKey:j.options.UseRawKey,SystemClockOffset:j.options.SystemClockOffset,KeyTime:me,ForceSignHost:E}),be={Authorization:Oe,SecurityToken:Y.SecurityToken||Y.XCosSecurityToken||"",Token:Y.Token||"",ClientIP:Y.ClientIP||"",ClientUA:Y.ClientUA||"",SignFrom:"client"};I(null,be)},ut=function(me){if(me.Authorization){var Oe=!1,be=me.Authorization;if(be)if(be.indexOf(" ")>-1)Oe=!1;else if(be.indexOf("q-sign-algorithm=")>-1&&be.indexOf("q-ak=")>-1&&be.indexOf("q-sign-time=")>-1&&be.indexOf("q-key-time=")>-1&&be.indexOf("q-url-param-list=")>-1)Oe=!0;else try{be=atob(be),be.indexOf("a=")>-1&&be.indexOf("k=")>-1&&be.indexOf("t=")>-1&&be.indexOf("r=")>-1&&be.indexOf("b=")>-1&&(Oe=!0)}catch(et){}if(!Oe)return t.error(new Error("getAuthorization callback params format error"))}else{if(!me.TmpSecretId)return t.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!me.TmpSecretKey)return t.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!me.SecurityToken&&!me.XCosSecurityToken)return t.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!me.ExpiredTime)return t.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(me.ExpiredTime&&me.ExpiredTime.toString().length!==10)return t.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(me.StartTime&&me.StartTime.toString().length!==10)return t.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(Y.ExpiredTime&&Y.ExpiredTime-t.getSkewTime(j.options.SystemClockOffset)/1e3>60)qe();else if(j.options.getAuthorization)j.options.getAuthorization.call(j,{Bucket:G,Region:de,Method:e.Method,Key:ue,Pathname:xe,Query:e.Query,Headers:s,Scope:Re,SystemClockOffset:j.options.SystemClockOffset,ForceSignHost:E},function(we){typeof we=="string"&&(we={Authorization:we});var me=ut(we);if(me)return I(me);we.Authorization?I(null,we):(Y=we||{},Y.Scope=Re,Y.ScopeKey=Ve,j._StsCache.push(Y),qe())});else if(j.options.getSTS)j.options.getSTS.call(j,{Bucket:G,Region:de},function(we){Y=we||{},Y.Scope=Re,Y.ScopeKey=Ve,Y.TmpSecretId||(Y.TmpSecretId=Y.SecretId),Y.TmpSecretKey||(Y.TmpSecretKey=Y.SecretKey);var me=ut(Y);if(me)return I(me);j._StsCache.push(Y),qe()});else return function(){var we="";if(j.options.StartTime&&e.Expires){if(j.options.StartTime.toString().length!==10)return I(t.error(new Error('params "StartTime" should be 10 digits')));we=j.options.StartTime+";"+(j.options.StartTime+e.Expires*1)}else if(j.options.StartTime&&j.options.ExpiredTime){if(j.options.StartTime.toString().length!==10)return I(t.error(new Error('params "StartTime" should be 10 digits')));if(j.options.ExpiredTime.toString().length!==10)return I(t.error(new Error('params "ExpiredTime" should be 10 digits')));we=j.options.StartTime+";"+j.options.ExpiredTime*1}var me=t.getAuth({SecretId:e.SecretId||j.options.SecretId,SecretKey:e.SecretKey||j.options.SecretKey,Method:e.Method,Pathname:xe,Query:e.Query,Headers:s,Expires:e.Expires,KeyTime:we,UseRawKey:j.options.UseRawKey,SystemClockOffset:j.options.SystemClockOffset,ForceSignHost:E}),Oe={Authorization:me,SecurityToken:j.options.SecurityToken||j.options.XCosSecurityToken,SignFrom:"client"};return I(null,Oe),Oe}();return""}function Zt(e){var C=this,s=!1,m=!1,E=!1,T=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var I=e.error.Code,j=e.error.Message;(I==="RequestTimeTooSkewed"||I==="AccessDenied"&&j==="Request has expired")&&(m=!0)}catch(de){}if(e)if(m&&T){var G=Date.parse(T);this.options.CorrectClockSkew&&Math.abs(t.getSkewTime(this.options.SystemClockOffset)-G)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=G-Date.now(),s=!0)}else Math.floor(e.statusCode/100)===5?(s=!0,E=!1):(e.message==="timeout"||e.message==="CORS blocked or network error")&&(s=!0,E=C.options.AutoSwitchHost);return{canRetry:s,networkError:E}}function ei(e){var C=e.requestUrl,s=e.clientCalcSign,m=e.networkError;if(!this.options.AutoSwitchHost||!C||!s||!m)return!1;var E=/^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/,T=/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/,I=E.test(C)&&!T.test(C);return I}function ee(e,C){var s=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=t.clearKey(e.qs),e.headers&&(e.headers=t.clearKey(e.headers)),e.qs&&(e.qs=t.clearKey(e.qs));var m=t.clone(e.qs);e.action&&(m[e.action]="");var E=e.url||e.Url,T=e.SignHost||bt.call(this,{Bucket:e.Bucket,Region:e.Region,Url:E}),I=e.tracker,j=function(de){var ue=s.options.SystemClockOffset;I&&I.setParams({signStartTime:new Date().getTime(),httpRetryTimes:de-1}),e.SwitchHost&&(T=T.replace(/myqcloud.com/,"tencentcos.cn"));var xe=O(O({},e),{},{Query:m,SignHost:T,ForceSignHost:s.options.ForceSignHost});delete xe.tracker,s.logger.debug({cate:"PROCESS",tag:"base",msg:"开始计算签名, opt=".concat(JSON.stringify(xe))}),jt.call(s,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:m,Headers:e.headers,SignHost:T,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:s.options.ForceSignHost,SwitchHost:e.SwitchHost},function(Y,Re){if(Y){s.logger.error({cate:"PROCESS",tag:"base",msg:"签名获取失败, err=".concat(JSON.stringify(Y.message))}),C(Y);return}I&&I.setParams({signEndTime:new Date().getTime(),httpStartTime:new Date().getTime()}),e.AuthData=Re,s.logger.debug({cate:"PROCESS",tag:"base",msg:"签名获取成功"}),s.logger.info({cate:"PROCESS",tag:"base",msg:"准备发起请求"}),ti.call(s,e,function(Ue,Ke){I&&I.setParams({httpEndTime:new Date().getTime()});var Ve=!1,qe=!1;if(Ue){var ut=Zt.call(s,Ue);Ve=ut.canRetry||ue!==s.options.SystemClockOffset,qe=ut.networkError,s.logger.error({cate:"PROCESS",tag:"network",msg:"请求失败, err=".concat(JSON.stringify(Ue),", canRetry=").concat(Ve,", networkError=").concat(qe,", tryTimes=").concat(de)})}if(Ue&&de<4&&Ve){e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,e.headers["x-cos-security-token"]&&delete e.headers["x-cos-security-token"],e.headers["x-ci-security-token"]&&delete e.headers["x-ci-security-token"]);var we=ei.call(s,{requestUrl:(Ue==null?void 0:Ue.url)||"",clientCalcSign:Re.SignFrom==="client",networkError:qe});e.SwitchHost=we,e.headers["x-cos-sdk-retry"]=!0,s.logger.info({cate:"PROCESS",tag:"base",msg:"重试请求, 重试第".concat(de,"次")}),j(de+1)}else s.logger.info({cate:"PROCESS",tag:"base",msg:"请求完成"}),C(Ue,Ke)})})};j(1)}function ti(e,C){var s=this,m=e.TaskId;if(!(m&&!s._isRunningTask(m))){var E=e.Bucket,T=e.Region,I=e.Key,j=e.method||"GET",G=e.Url||e.url,de=e.body,ue=e.rawBody;s.options.UseAccelerate&&(T="accelerate"),G=G||Qe({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:E,region:T,object:I}),e.SwitchHost&&(G=G.replace(/myqcloud.com/,"tencentcos.cn"));var xe=I?G:"";e.action&&(G=G+"?"+(t.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(G.indexOf("?")>-1?G=G+"&"+e.qsStr:G=G+"?"+e.qsStr);var Y={method:j,url:G,headers:e.headers,qs:e.qs,body:de},Re="x-cos-security-token";if(t.isCIHost(G)&&(Re="x-ci-security-token"),Y.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(Y.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(Y.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(Y.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(Y.headers[Re]=e.AuthData.SecurityToken),e.Action&&(Y.action=e.Action),Y.key=e.Key||e.ResourceKey,Y.headers&&(Y.headers=t.clearKey(Y.headers)),Y=t.clearKey(Y),e.onProgress&&typeof e.onProgress=="function"){var Ue=de&&(de.size||de.length)||0;Y.onProgress=function(be){if(!(m&&!s._isRunningTask(m))){var et=be?be.loaded:0;e.onProgress({loaded:et,total:Ue})}}}e.onDownloadProgress&&(Y.onDownloadProgress=e.onDownloadProgress),e.DataType&&(Y.dataType=e.DataType),this.options.Timeout&&(Y.timeout=this.options.Timeout),s.options.ForcePathStyle&&(Y.pathStyle=s.options.ForcePathStyle);var Ke=t.uuid();s.logger.info({cate:"PROCESS",tag:"network",msg:"[Request] ".concat(Ke,", requestOpt=").concat(JSON.stringify(Y))}),s.emit("before-send",Y);var Ve=Y.url.includes("accelerate."),qe=Y.qs?Object.keys(Y.qs).map(function(be){return"".concat(be,"=").concat(Y.qs[be])}).join("&"):"",ut=qe?Y.url+"?"+qe:Y.url;if(e.tracker){var we;e.tracker.setParams({url:ut,httpMethod:Y.method,accelerate:Ve,httpSize:((we=Y.body)===null||we===void 0?void 0:we.size)||0}),e.tracker.parent&&!e.tracker.parent.params.url&&e.tracker.parent.setParams({url:xe,accelerate:Ve})}var me=(s.options.Request||w)(Y,function(be){if(!(be&&be.error==="abort")){var et={options:Y,error:be&&be.error,statusCode:be&&be.statusCode||0,statusMessage:be&&be.statusMessage||"",headers:be&&be.headers||{},body:be&&be.body};s.emit("after-receive",et);var ii=et.error,Dt=et.body,ct={statusCode:et.statusCode,statusMessage:et.statusMessage,headers:et.headers},vn=ii?"[error]":"[success]";s.logger.info({cate:"PROCESS",tag:"network",msg:"[Response] ".concat(Ke,", ").concat(vn,", response=").concat(JSON.stringify(ct))});var Ti,pt=function(vt,_e){if(m&&s.off("inner-kill-task",Oe),!Ti){Ti=!0;var Tt={};if(ct&&ct.statusCode&&(Tt.statusCode=ct.statusCode),ct&&ct.headers&&(Tt.headers=ct.headers),vt)Y.url&&(Tt.url=Y.url),Y.method&&(Tt.method=Y.method),vt=t.extend(vt||{},Tt),C(vt,null);else{if(e.Action==="name/cos:PutObject"){var ri={};for(var Ei in e.headers){var yn=Ei.toLowerCase();ri[yn]=e.headers[Ei]}ri["x-cos-callback"]?_e.Error?(_e.CallbackError=t.clone(_e.Error),delete _e.Error):_e.CallbackBody=t.clone(_e):ri["x-cos-return-body"]&&(_e.Error?(_e.ReturnError=t.clone(_e.Error),delete _e.Error):_e.ReturnBody=t.clone(_e))}_e=t.extend(_e||{},Tt),C(null,_e)}me=null}};if(ii)return pt(t.error(ii));var _t=ct.statusCode,Ri=Math.floor(_t/100)===2;if(ue){if(Ri)return pt(null,{body:Dt});if(Dt instanceof Blob){t.readAsBinaryString(Dt,function(Bi){var vt=t.parseResBody(Bi),_e=vt.Error||vt;return pt(t.error(new Error(_e.Message||"response body error"),{code:_e.Code,error:_e}))});return}}var ni=t.parseResBody(Dt),Ht=ni.Error||ni;Ri?pt(null,ni):Ht?pt(t.error(new Error(Ht.Message),{code:Ht.Code,error:Ht})):_t?pt(t.error(new Error(ct.statusMessage),{code:""+_t})):_t&&pt(t.error(new Error("statusCode error")))}}),Oe=function(et){et.TaskId===m&&(me&&me.abort&&me.abort(),s.off("inner-kill-task",Oe))};m&&s.on("inner-kill-task",Oe)}}var bi={getService:p,putBucket:l,headBucket:b,getBucket:k,deleteBucket:R,putBucketAcl:P,getBucketAcl:M,putBucketCors:F,getBucketCors:U,deleteBucketCors:K,getBucketLocation:q,getBucketPolicy:y,putBucketPolicy:f,deleteBucketPolicy:A,putBucketTagging:c,getBucketTagging:o,deleteBucketTagging:i,putBucketLifecycle:u,getBucketLifecycle:v,deleteBucketLifecycle:B,putBucketVersioning:D,getBucketVersioning:N,putBucketReplication:z,getBucketReplication:V,deleteBucketReplication:Z,putBucketWebsite:J,getBucketWebsite:te,deleteBucketWebsite:re,putBucketReferer:pe,getBucketReferer:le,putBucketDomain:oe,getBucketDomain:ie,deleteBucketDomain:$,putBucketOrigin:ne,getBucketOrigin:fe,deleteBucketOrigin:he,putBucketLogging:se,getBucketLogging:ce,putBucketInventory:ye,postBucketInventory:Ce,getBucketInventory:Ae,listBucketInventory:Se,deleteBucketInventory:Fe,putBucketAccelerate:it,getBucketAccelerate:Xe,putBucketEncryption:st,getBucketEncryption:lt,deleteBucketEncryption:$e,getObject:Gt,headObject:at,listObjectVersions:Ot,putObject:Wt,deleteObject:Xt,getObjectAcl:$t,putObjectAcl:Yt,optionsObject:Qt,putObjectCopy:Jt,deleteMultipleObject:W,restoreObject:L,putObjectTagging:_,getObjectTagging:H,deleteObjectTagging:X,selectObjectContent:Q,appendObject:Ye,uploadPartCopy:ze,multipartInit:ae,multipartUpload:ge,multipartComplete:ke,multipartList:Ee,multipartListPart:Pe,multipartAbort:De,request:Me,getObjectUrl:Ze,getAuth:gt};function pn(e,C,s){t.each(["Cors","Acl"],function(m){if(e.slice(-m.length)===m){var E=e.slice(0,-m.length)+m.toUpperCase(),T=t.apiWrapper(e,C),I=!1;s[E]=function(){!I&&console.warn("warning: cos."+E+" has been deprecated. Please Use cos."+e+" instead."),I=!0,T.apply(this,arguments)}}})}n.exports.init=function(e,C){C.transferToTaskMethod(bi,"putObject"),t.each(bi,function(s,m){e.prototype[m]=t.apiWrapper(m,s),pn(m,s,e.prototype)})}},"./src/cos.js":function(n,r,g){var d=g("./src/util.js"),h=g("./src/event.js"),S=g("./src/task.js"),O=g("./src/base.js"),w=g("./src/advance.js"),t=g("./src/logger.js"),p=g("./package.json"),l={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",StartTime:0,ExpiredTime:0,ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1024*1024,SliceSize:1024*1024,CopyChunkParallelLimit:20,CopyChunkSize:1024*1024*10,CopySliceSize:1024*1024*10,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,AutoSwitchHost:!0,CopySourceParser:null,ObjectKeySimplifyCheck:!0,DeepTracker:!1,TrackerDelay:5e3,CustomId:"",BeaconReporter:null,ClsReporter:null,EnableLog:!1,EnableLogcat:!1,LogLevel:"VERBOSE",ClsLogger:null,LogExtras:{}},b=function(R){var P,M,F=this;if(this.options=d.extend(d.clone(l),R||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1024*1024,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1024*1024,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.EnableReporter=this.options.BeaconReporter||this.options.ClsReporter,this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),this.options.SecretId&&this.options.SecretId.indexOf(" ")>-1&&(console.error("error: SecretId格式错误,请检查"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey格式错误,请检查"),console.error("error: SecretKey format is incorrect. Please check")),d.isNode()&&(console.log("Tip: Next.js、Nuxt.js 等服务端渲染技术可正常使用JavaScript SDK,请忽略下方 nodejs 环境警告"),console.warn("warning: cos-js-sdk-v5 不支持 nodejs 环境使用,请改用 cos-nodejs-sdk-v5,参考文档: https://cloud.tencent.com/document/product/436/8629"),console.warn("warning: cos-js-sdk-v5 does not support nodejs environment. Please use cos-nodejs-sdk-v5 instead. See: https://cloud.tencent.com/document/product/436/8629")),this.options.ForcePathStyle)throw console.warn("cos-js-sdk-v5不再支持使用path-style,仅支持使用virtual-hosted-style,参考文档:https://cloud.tencent.com/document/product/436/96243"),new Error("ForcePathStyle is not supported");h.init(this),S.init(this),this.logger=new t({enableLog:this.options.EnableLog,enableLogcat:this.options.EnableLogcat,level:(P=this.options.LogLevel)!==null&&P!==void 0?P:"VERBOSE",clsLogger:this.options.ClsLogger,logExtras:(M=this.options.LogExtras)!==null&&M!==void 0?M:{}}),this.options.EnableLog&&(h.init(this.logger),this.logger.on("log-message",function(U){F.emit("log-message",U)}))};O.init(b,S),w.init(b,S),b.util={md5:d.md5,xml2json:d.xml2json,json2xml:d.json2xml,encodeBase64:d.encodeBase64},b.getAuthorization=d.getAuth,b.version=p.version,n.exports=b},"./src/event.js":function(n,r){var g=function(S){var O={},w=function(p){return!O[p]&&(O[p]=[]),O[p]};S.on=function(t,p){t==="task-list-update"&&console.warn('warning: Event "'+t+'" has been deprecated. Please use "list-update" instead.'),w(t).push(p)},S.off=function(t,p){for(var l=w(t),b=l.length-1;b>=0;b--)p===l[b]&&l.splice(b,1)},S.emit=function(t,p){for(var l=w(t).map(function(k){return k}),b=0;b<l.length;b++)l[b](p)}},d=function(){g(this)};n.exports.init=g,n.exports.EventProxy=d},"./src/logger.js":function(n,r,g){var d=g("./node_modules/@babel/runtime/helpers/classCallCheck.js"),h=g("./node_modules/@babel/runtime/helpers/createClass.js"),S=g("./node_modules/@babel/runtime/helpers/defineProperty.js"),O=g("./package.json"),w=O.version,t=["VERBOSE","DEBUG","INFO","WARN","ERROR"],p=function(){function l(b){var k;d(this,l),S(this,"level","VERBOSE"),S(this,"clsLogger",null),S(this,"logExtras",{}),this.enableLog=(k=b.enableLog)!==null&&k!==void 0?k:!1,this.level=b.level||"VERBOSE",t.includes(this.level)||(this.level="VERBOSE"),this.enableLogcat=b.enableLogcat,this.clsLogger=b.clsLogger,this.logExtras=b.logExtras}return h(l,[{key:"info",value:function(){if(["VERBOSE","INFO"].includes(this.level)){for(var k=arguments.length,R=new Array(k),P=0;P<k;P++)R[P]=arguments[P];this.log.apply(this,["info"].concat(R))}}},{key:"debug",value:function(){if(["VERBOSE","DEBUG"].includes(this.level)){for(var k=arguments.length,R=new Array(k),P=0;P<k;P++)R[P]=arguments[P];this.log.apply(this,["debug"].concat(R))}}},{key:"warn",value:function(){if(["VERBOSE","WARN"].includes(this.level)){for(var k=arguments.length,R=new Array(k),P=0;P<k;P++)R[P]=arguments[P];this.log.apply(this,["warn"].concat(R))}}},{key:"error",value:function(){if(["VERBOSE","ERROR"].includes(this.level)){for(var k=arguments.length,R=new Array(k),P=0;P<k;P++)R[P]=arguments[P];this.log.apply(this,["error"].concat(R))}}},{key:"log",value:function(){if(this.enableLog){var k=arguments.length<=0?void 0:arguments[0],R=arguments.length<=1?void 0:arguments[1],P=R.cate,M=P===void 0?"base":P,F=R.tag,U=F===void 0?"base":F,K=R.msg,q={version:"cos-js-sdk-v5-".concat(w),timestamp:new Date().toISOString(),cate:"[".concat(M.toUpperCase(),"]"),tag:"[".concat(U.toUpperCase(),"]"),msg:K,extras:this.logExtras};this.enableLogcat&&console[k]("[".concat(q.version,"] ").concat(q.timestamp," ").concat(q.cate," ").concat(q.tag," ").concat(q.msg," ").concat(q.extras?JSON.stringify(q.extras):"")),this.clsLogger&&this.clsLogger.log(q,!1),this.emit("log-message",q)}}}])}();n.exports=p},"./src/session.js":function(n,r,g){var d=g("./src/util.js"),h="cos_sdk_upload_cache",S=30*24*3600,O,w,t=function(){try{var P=JSON.parse(localStorage.getItem(h))}catch(M){}P||(P=[]),O=P},p=function(){try{O.length?localStorage.setItem(h,JSON.stringify(O)):localStorage.removeItem(h)}catch(P){}},l=function(){if(!O){t.call(this);for(var P=!1,M=Math.round(Date.now()/1e3),F=O.length-1;F>=0;F--){var U=O[F][2];(!U||U+S<M)&&(O.splice(F,1),P=!0)}P&&p()}},b=function(){w||(w=setTimeout(function(){p(),w=null},400))},k={using:{},setUsing:function(P){k.using[P]=!0},removeUsing:function(P){delete k.using[P]},getFileId:function(P,M,F,U){return P.name&&P.size&&P.lastModifiedDate&&M?d.md5([P.name,P.size,P.lastModifiedDate,M,F,U].join("::")):null},getCopyFileId:function(P,M,F,U,K){var q=M["content-length"],f=M.etag||"",y=M["last-modified"];return P&&F?d.md5([P,q,f,y,F,U,K].join("::")):null},getUploadIdList:function(P){if(!P)return null;l.call(this);for(var M=[],F=0;F<O.length;F++)O[F][0]===P&&M.push(O[F][1]);return M.length?M:null},saveUploadId:function(P,M,F){if(l.call(this),!!P){for(var U=O.length-1;U>=0;U--){var K=O[U];K[0]===P&&K[1]===M&&O.splice(U,1)}O.unshift([P,M,Math.round(Date.now()/1e3)]),O.length>F&&O.splice(F),b()}},removeUploadId:function(P){l.call(this),delete k.using[P];for(var M=O.length-1;M>=0;M--)O[M][1]===P&&O.splice(M,1);b()}};n.exports=k},"./src/task.js":function(n,r,g){var d=g("./src/session.js"),h=g("./src/util.js"),S={},O=function(p,l){S[l]=p[l],p[l]=function(b,k){b.SkipTask?S[l].call(this,b,k):this._addTask(l,b,k)}},w=function(p){var l=[],b={},k=0,R=0,P=function(y){var A={id:y.id,Bucket:y.Bucket,Region:y.Region,Key:y.Key,FilePath:y.FilePath,state:y.state,loaded:y.loaded,size:y.size,speed:y.speed,percent:y.percent,hashPercent:y.hashPercent,error:y.error};return y.FilePath&&(A.FilePath=y.FilePath),y._custom&&(A._custom=y._custom),A},M=function(){var f,y=function(){f=0,p.emit("task-list-update",{list:h.map(l,P)}),p.emit("list-update",{list:h.map(l,P)})};return function(){f||(f=setTimeout(y))}}(),F=function(){if(!(l.length<=p.options.UploadQueueSize)){for(var y=0;y<R&&y<l.length&&l.length>p.options.UploadQueueSize;){var A=l[y].state==="waiting"||l[y].state==="checking"||l[y].state==="uploading";!l[y]||!A?(b[l[y].id]&&delete b[l[y].id],l.splice(y,1),R--):y++}M()}},U=function(){if(!(k>=p.options.FileParallelLimit)){for(;l[R]&&l[R].state!=="waiting";)R++;if(!(R>=l.length)){var y=l[R];R++,k++,y.state="checking",y.params.onTaskStart&&y.params.onTaskStart(P(y)),!y.params.UploadData&&(y.params.UploadData={});var A=h.formatParams(y.api,y.params);S[y.api].call(p,A,function(c,o){p._isRunningTask(y.id)&&((y.state==="checking"||y.state==="uploading")&&(y.state=c?"error":"success",c&&(y.error=c),k--,M(),U(),y.callback&&y.callback(c,o),y.state==="success"&&(y.params&&(delete y.params.UploadData,delete y.params.Body,delete y.params),delete y.callback)),F())}),M(),setTimeout(U)}}},K=function(y,A){var c=b[y];if(c){var o=c&&c.state==="waiting",i=c&&(c.state==="checking"||c.state==="uploading");if(A==="canceled"&&c.state!=="canceled"||A==="paused"&&o||A==="paused"&&i){c.state=A,p.emit("inner-kill-task",{TaskId:y,toState:A});try{var u=c&&c.params&&c.params.UploadData.UploadId}catch(v){}A==="canceled"&&u&&d.removeUsing(u),M(),i&&(k--,U()),A==="canceled"&&(c.params&&(delete c.params.UploadData,delete c.params.Body,delete c.params),delete c.callback)}F()}};p._addTasks=function(f){h.each(f,function(y){p._addTask(y.api,y.params,y.callback,!0)}),M()};var q=!0;p._addTask=function(f,y,A,c){y=h.formatParams(f,y);var o=h.uuid();y.TaskId=o,y.onTaskReady&&y.onTaskReady(o),y.TaskReady&&(y.TaskReady(o),q&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),q=!1);var i={params:y,callback:A,api:f,index:l.length,id:o,Bucket:y.Bucket,Region:y.Region,Key:y.Key,FilePath:y.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:y._custom},u=y.onHashProgress;y.onHashProgress=function(B){p._isRunningTask(i.id)&&(i.hashPercent=B.percent,u&&u(B),M())};var v=y.onProgress;return y.onProgress=function(B){p._isRunningTask(i.id)&&(i.state==="checking"&&(i.state="uploading"),i.loaded=B.loaded,i.speed=B.speed,i.percent=B.percent,v&&v(B),M())},h.getFileSize(f,y,function(B,D){if(B)return A(h.error(B));b[o]=i,l.push(i),i.size=D,!c&&M(),U(),F()}),o},p._isRunningTask=function(f){var y=b[f];return!!(y&&(y.state==="checking"||y.state==="uploading"))},p.getTaskList=function(){return h.map(l,P)},p.cancelTask=function(f){K(f,"canceled")},p.pauseTask=function(f){K(f,"paused")},p.restartTask=function(f){var y=b[f];y&&(y.state==="paused"||y.state==="error")&&(y.state="waiting",M(),R=Math.min(R,y.index),U())},p.isUploadRunning=function(){return k||R<l.length}};n.exports.transferToTaskMethod=O,n.exports.init=w},"./src/tracker.js":function(n,r,g){var d=g("./node_modules/@babel/runtime/helpers/classCallCheck.js"),h=g("./node_modules/@babel/runtime/helpers/createClass.js"),S=g("./node_modules/@babel/runtime/helpers/typeof.js"),O=g("./package.json"),w=null,t=function(A,c){if(!w){if(typeof A!="function")throw new Error("Beacon not found");w=new A({appkey:"0WEB05PY6MHRGK0U",versionCode:O.version,channelID:"js_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:c,sessionDuration:60*1e3})}return w},p=function(A){return!A||A<0?0:(A/1e3).toFixed(3)},l={getUid:function(){var A=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return A()+A()+"-"+A()+"-"+A()+"-"+A()+"-"+A()+A()+A()},getNetType:function(){if((typeof navigator>"u"?"undefined":S(navigator))==="object"){var A=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(A==null?void 0:A.type)||(A==null?void 0:A.effectiveType)||"unknown"}return"unknown"},getProtocol:function(){return(typeof location>"u"?"undefined":S(location))==="object"?location.protocol.replace(/:/,""):"unknown protocol"},getOsType:function(){if((typeof navigator>"u"?"undefined":S(navigator))!=="object")return"unknown os";var A=navigator.userAgent.toLowerCase(),c=/macintosh|mac os x/i.test(navigator.userAgent);return A.indexOf("win32")>=0||A.indexOf("wow32")>=0?"win32":A.indexOf("win64")>=0||A.indexOf("wow64")>=0?"win64":c?"mac":"unknown os"},isMobile:function(){var A=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;return!!((typeof navigator>"u"?"undefined":S(navigator))==="object"&&navigator.userAgent.match(A))},isAndroid:function(){var A=/(Android|Adr|Linux)/i;return!!((typeof navigator>"u"?"undefined":S(navigator))==="object"&&navigator.userAgent.match(A))},isIOS:function(){var A=/(iPhone|iPod|iPad|iOS)/i;return!!((typeof navigator>"u"?"undefined":S(navigator))==="object"&&navigator.userAgent.match(A))},isOtherMobile:function(){return b&&!isAndroid&&!isIOS},getUA:function(){if((typeof navigator>"u"?"undefined":S(navigator))!=="object")return"unknown device";var A=navigator.userAgent;return A}},b=l.isMobile(),k=l.isAndroid()?"android":l.isIOS?"ios":"other_mobile",R=l.getOsType(),P=b?k:R,M=l.getUA(),F=l.getProtocol(),U=function(A){return["putObject","sliceUploadFile","uploadFile","uploadFiles"].includes(A)?"UploadTask":A==="getObject"?"DownloadTask":["putObjectCopy","sliceCopyFile"].includes(A)?"CopyTask":A};function K(y){return y.replace(/([A-Z])/g,"_$1").toLowerCase()}function q(y){var A={},c=["sdkVersionName","sdkVersionCode","osName","networkType","requestName","requestResult","bucket","region","appid","accelerate","url","host","requestPath","userAgent","networkProtocol","httpMethod","httpSize","httpSpeed","httpTookTime","httpMd5","httpSign","httpFullTime","httpDomain","partNumber","httpRetryTimes","customId","traceId","realApi"],o=[].concat(c,["errorNode","errorCode","errorName","errorMessage","errorRequestId","errorHttpCode","errorServiceName","errorType","fullError"]),i=y.requestResult==="Success"?c:o;for(var u in y)if(i.includes(u)){var v=K(u);A[v]=y[u]}return A.request_name=y.realApi?U(y.realApi):y.requestName,A}var f=function(){function y(A){d(this,y);var c=A.parent,o=A.traceId,i=A.bucket,u=A.region,v=A.apiName,B=A.realApi,D=A.httpMethod,N=A.fileKey,z=A.fileSize,V=A.accelerate,Z=A.customId,J=A.delay,te=A.deepTracker,re=A.Beacon,pe=A.clsReporter,le=i&&i.substr(i.lastIndexOf("-")+1)||"";this.parent=c,this.deepTracker=te,this.delay=J,pe&&!this.clsReporter&&(this.clsReporter=pe),this.params={sdkVersionName:"cos-js-sdk-v5",sdkVersionCode:O.version,osName:P,networkType:"",requestName:v||"",requestResult:"",realApi:B,bucket:i,region:u,accelerate:V,httpMethod:D,url:"",host:"",httpDomain:"",requestPath:N||"",userAgent:M,networkProtocol:F,errorType:"",errorCode:"",errorName:"",errorMessage:"",errorRequestId:"",errorHttpCode:0,errorServiceName:"",errorNode:"",httpTookTime:0,httpSize:z||0,httpMd5:0,httpSign:0,httpFullTime:0,httpSpeed:0,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:new Date().getTime(),endTime:0,traceId:o||l.getUid(),appid:le,partNumber:0,httpRetryTimes:0,customId:Z||"",partTime:0},re&&(this.beacon=t(re,J))}return h(y,[{key:"formatResult",value:function(c,o){var i,u,v,B,D,N,z=new Date().getTime(),V=l.getNetType(),Z=c?(c==null?void 0:c.code)||(c==null||(i=c.error)===null||i===void 0?void 0:i.code)||(c==null||(u=c.error)===null||u===void 0?void 0:u.Code):"",J=c?(c==null?void 0:c.message)||(c==null||(v=c.error)===null||v===void 0?void 0:v.message)||(c==null||(B=c.error)===null||B===void 0?void 0:B.Message):"",te=J,re=c?(c==null?void 0:c.resource)||(c==null||(D=c.error)===null||D===void 0?void 0:D.resource)||(c==null||(N=c.error)===null||N===void 0?void 0:N.Resource):"",pe=c?c==null?void 0:c.statusCode:o.statusCode,le=c?(c==null?void 0:c.headers)&&(c==null?void 0:c.headers["x-cos-request-id"]):(o==null?void 0:o.headers)&&(o==null?void 0:o.headers["x-cos-request-id"]),oe=c?le?"Server":"Client":"";this.params.requestName==="getObject"&&(this.params.httpSize=o?o.headers&&o.headers["content-length"]:0);var ie=this.params.realApi==="sliceUploadFile",$=this.params.realApi==="sliceCopyFile";if(ie||$){var ne=this.params.httpSize/1024/this.params.partTime;Object.assign(this.params,{httpSpeed:ne<0?0:ne.toFixed(3)})}else{var fe=z-this.params.startTime,he=this.params.httpEndTime-this.params.httpStartTime,se=this.params.httpSize/1024/(he/1e3),ce=this.params.md5EndTime-this.params.md5StartTime,ve=this.params.signEndTime-this.params.signStartTime;this.parent&&(this.parent.addParamValue("httpTookTime",p(he)),this.parent.addParamValue("httpFullTime",p(fe)),this.parent.addParamValue("httpMd5",p(ce)),this.parent.addParamValue("httpSign",p(ve)),["multipartUpload","uploadPartCopy","putObjectCopy"].includes(this.params.requestName)&&this.parent.addParamValue("partTime",p(he))),Object.assign(this.params,{httpFullTime:p(fe),httpMd5:p(ce),httpSign:p(ve),httpTookTime:p(he),httpSpeed:se<0?0:se.toFixed(3)})}if(Object.assign(this.params,{networkType:V,requestResult:c?"Failure":"Success",errorType:oe,errorCode:Z,errorHttpCode:pe,errorName:te,errorMessage:J,errorServiceName:re,errorRequestId:le}),c&&(!Z||!J)&&(this.params.fullError=c?JSON.stringify(c):""),this.params.url){try{var ye=/^http(s)?:\/\/(.*?)\//.exec(this.params.url);this.params.host=ye[2]}catch(Ce){this.params.host=this.params.url}this.params.httpDomain=this.params.host}}},{key:"report",value:function(c,o){if(!(!this.beacon&&!this.clsReporter)){this.formatResult(c,o);var i=q(this.params);this.beacon&&this.sendEventsToBeacon(i),this.clsReporter&&this.sendEventsToCLS(i)}}},{key:"setParams",value:function(c){Object.assign(this.params,c)}},{key:"addParamValue",value:function(c,o){this.params[c]=(+this.params[c]+ +o).toFixed(3)}},{key:"sendEventsToBeacon",value:function(c){var o=this.params.requestName==="sliceUploadFile"||this.params.realApi==="sliceUploadFile";if(!(o&&!this.deepTracker)){var i="qcloud_track_cos_sdk";this.delay===0?this.beacon&&this.beacon.onDirectUserAction(i,c):this.beacon&&this.beacon.onUserAction(i,c)}}},{key:"sendEventsToCLS",value:function(c){var o=this.delay===0;this.clsReporter.log(c,o)}},{key:"generateSubTracker",value:function(c){return Object.assign(c,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,accelerate:this.params.accelerate,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay,clsReporter:this.clsReporter}),new y(c)}}])}();n.exports=f},"./src/util.js":function(n,r,g){(function(d){var h=g("./node_modules/@babel/runtime/helpers/typeof.js");function S(W,L){var _=typeof Symbol<"u"&&W[Symbol.iterator]||W["@@iterator"];if(!_){if(Array.isArray(W)||(_=O(W))||L&&W&&typeof W.length=="number"){_&&(W=_);var H=0,X=function(){};return{s:X,n:function(){return H>=W.length?{done:!0}:{done:!1,value:W[H++]}},e:function(Ee){throw Ee},f:X}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Q,ae=!0,ge=!1;return{s:function(){_=_.call(W)},n:function(){var Ee=_.next();return ae=Ee.done,Ee},e:function(Ee){ge=!0,Q=Ee},f:function(){try{ae||_.return==null||_.return()}finally{if(ge)throw Q}}}}function O(W,L){if(W){if(typeof W=="string")return w(W,L);var _={}.toString.call(W).slice(8,-1);return _==="Object"&&W.constructor&&(_=W.constructor.name),_==="Map"||_==="Set"?Array.from(W):_==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_)?w(W,L):void 0}}function w(W,L){(L==null||L>W.length)&&(L=W.length);for(var _=0,H=Array(L);_<L;_++)H[_]=W[_];return H}var t=g("./lib/md5.js"),p=g("./lib/crypto.js"),l=g("./node_modules/fast-xml-parser/src/fxp.js"),b=l.XMLParser,k=l.XMLBuilder,R=new b({ignoreDeclaration:!0,ignoreAttributes:!0,parseTagValue:!1,trimValues:!1}),P=new k,M=g("./lib/base64.js"),F=g("./src/tracker.js"),U="#text",K=function(L){if(fe(L))for(var _ in L){var H=L[_];typeof H=="string"?_===U&&delete L[_]:Array.isArray(H)?H.forEach(function(X){K(X)}):fe(H)&&K(H)}},q=function(L){var _=R.parse(L);return K(_),_},f=function(L){var _=P.build(L);return _};function y(W){return encodeURIComponent(W).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function A(W,L){var _=[];for(var H in W)W.hasOwnProperty(H)&&_.push(L?y(H).toLowerCase():H);return _.sort(function(X,Q){return X=X.toLowerCase(),Q=Q.toLowerCase(),X===Q?0:X>Q?1:-1})}var c=function(L,_){var H,X,Q,ae=[],ge=A(L);for(H=0;H<ge.length;H++)X=ge[H],Q=L[X]===void 0||L[X]===null?"":""+L[X],X=_?y(X).toLowerCase():y(X),Q=y(Q)||"",ae.push(X+"="+Q);return ae.join("&")},o=["cache-control","content-disposition","content-encoding","content-length","content-md5","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding","pic-operations"],i=function(L){var _={};for(var H in L){var X=H.toLowerCase();(X.indexOf("x-cos-")>-1||X.indexOf("x-ci-")>-1||o.indexOf(X)>-1)&&(_[H]=L[H])}return _},u=function(L){L=L||{};var _=L.SecretId,H=L.SecretKey,X=L.KeyTime,Q=(L.method||L.Method||"get").toLowerCase(),ae=oe(L.Query||L.params||{}),ge=i(oe(L.Headers||L.headers||{})),ke=L.Key||"",Ee;L.UseRawKey?Ee=L.Pathname||L.pathname||"/"+ke:(Ee=L.Pathname||L.pathname||ke,Ee.indexOf("/")!==0&&(Ee="/"+Ee));var Pe=L.ForceSignHost!==!1;if(!ge.Host&&!ge.host&&L.Bucket&&L.Region&&Pe&&(ge.Host=L.Bucket+".cos."+L.Region+".myqcloud.com"),!_)throw new Error("missing param SecretId");if(!H)throw new Error("missing param SecretKey");var De=Math.round(lt(L.SystemClockOffset)/1e3)-1,Me=De,Ye=L.Expires||L.expires;Ye===void 0?Me+=900:Me+=Ye*1||0;var gt="sha1",Ze=_,Be=X||De+";"+Me,nt=X||De+";"+Me,Qe=A(ge,!0).join(";").toLowerCase(),bt=A(ae,!0).join(";").toLowerCase(),jt=p.HmacSHA1(nt,H).toString(),Zt=[Q,Ee,ze.obj2str(ae,!0),ze.obj2str(ge,!0),""].join("\n"),ei=["sha1",Be,p.SHA1(Zt).toString(),""].join("\n"),ee=p.HmacSHA1(ei,jt).toString(),ti=["q-sign-algorithm="+gt,"q-ak="+Ze,"q-sign-time="+Be,"q-key-time="+nt,"q-header-list="+Qe,"q-url-param-list="+bt,"q-signature="+ee].join("&");return ti},v=function(L,_,H){var X=_/8,Q=L.slice(H,H+X);return new Uint8Array(Q).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[_](Q)[0]},B=function(L,_,H,X){var Q=L.slice(_,H),ae="";return new Uint8Array(Q).forEach(function(ge){ae+=String.fromCharCode(ge)}),X&&(ae=decodeURIComponent(escape(ae))),ae},D=function(L){for(var _={},H=B(L),X={records:[]};L.byteLength;){var Q=v(L,32,0),ae=v(L,32,4),ge=Q-ae-16,ke=0,Ee;for(L=L.slice(12);ke<ae;){var Pe=v(L,8,ke),De=B(L,ke+1,ke+1+Pe),Me=v(L,16,ke+Pe+2),Ye=B(L,ke+Pe+4,ke+Pe+4+Me);_[De]=Ye,ke+=Pe+4+Me}if(_[":event-type"]==="Records")Ee=B(L,ke,ke+ge,!0),X.records.push(Ee);else if(_[":event-type"]==="Stats")Ee=B(L,ke,ke+ge,!0),X.stats=ze.xml2json(Ee).Stats;else if(_[":event-type"]==="error"){var gt=_[":error-code"],Ze=_[":error-message"],Be=new Error(Ze);Be.message=Ze,Be.name=Be.code=gt,X.error=Be}L=L.slice(ke+ge+4)}return{payload:X.records.join(""),body:H}},N=function(L){var _=this.options.CopySourceParser;if(_)return _(L);var H=L.match(/^([^.]+-\d+)\.cos(v6|-cdc|-cdz|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return H?{Bucket:H[1],Region:H[3],Key:H[7]}:null},z=function(){},V=function(L){var _={};for(var H in L)L.hasOwnProperty(H)&&L[H]!==void 0&&L[H]!==null&&(_[H]=L[H]);return _},Z=function(L,_){var H,X=new FileReader;FileReader.prototype.readAsBinaryString?(H=FileReader.prototype.readAsBinaryString,X.onload=function(){_(this.result)}):FileReader.prototype.readAsArrayBuffer?H=function(ae){var ge="",ke=new FileReader;ke.onload=function(Ee){for(var Pe=new Uint8Array(ke.result),De=Pe.byteLength,Me=0;Me<De;Me++)ge+=String.fromCharCode(Pe[Me]);_(ge)},ke.readAsArrayBuffer(ae)}:console.error("FileReader not support readAsBinaryString"),H.call(X,L)},J=function(){var W=function(H,X){H=H.split("."),X=X.split(".");for(var Q=0;Q<X.length;Q++)if(H[Q]!==X[Q])return parseInt(H[Q])>parseInt(X[Q])?1:-1;return 0},L=function(H){if(!H)return!1;var X=(H.match(/Chrome\/([.\d]+)/)||[])[1],Q=(H.match(/QBCore\/([.\d]+)/)||[])[1],ae=(H.match(/QQBrowser\/([.\d]+)/)||[])[1],ge=X&&W(X,"53.0.2785.116")<0&&Q&&W(Q,"3.53.991.400")<0&&ae&&W(ae,"9.0.2524.400")<=0||!1;return ge};return L(typeof navigator<"u"&&navigator.userAgent)}(),te=function(L,_,H,X,Q){var ae;if(L.slice?ae=L.slice(_,H):L.mozSlice?ae=L.mozSlice(_,H):L.webkitSlice&&(ae=L.webkitSlice(_,H)),X&&J){var ge=new FileReader;ge.onload=function(ke){ae=null,Q(new Blob([ge.result]))},ge.readAsArrayBuffer(ae)}else Q(ae)},re=function(L,_,H,X){H=H||z,L?typeof _=="string"?H(ze.md5(_,!0)):Blob&&_ instanceof Blob?ze.getFileMd5(_,function(Q,ae){H(ae)},X):H():H()},pe=1024*1024,le=function(L,_,H){var X=L.size,Q=0,ae=t.getCtx(),ge=function(Ee){if(Ee>=X){var Pe=ae.digest("hex");_(null,Pe);return}var De=Math.min(X,Ee+pe);ze.fileSlice(L,Ee,De,!1,function(Me){Z(Me,function(Ye){Me=null,ae=ae.update(Ye,!0),Q+=Ye.length,Ye=null,H&&H({loaded:Q,total:X,percent:Math.round(Q/X*1e4)/1e4}),ge(Ee+pe)})})};ge(0)};function oe(W){return ve(W,function(L){return h(L)==="object"&&L!==null?oe(L):L})}function ie(W,L,_){return W&&L in W?W[L]:_}function $(W,L){return ce(L,function(_,H){W[H]=L[H]}),W}function ne(W){return W instanceof Array}function fe(W){return Object.prototype.toString.call(W)==="[object Object]"}function he(W,L){for(var _=!1,H=0;H<W.length;H++)if(L===W[H]){_=!0;break}return _}function se(W){return ne(W)?W:[W]}function ce(W,L){for(var _ in W)W.hasOwnProperty(_)&&L(W[_],_)}function ve(W,L){var _=ne(W)?[]:{};for(var H in W)W.hasOwnProperty(H)&&(_[H]=L(W[H],H));return _}function ye(W,L){var _=ne(W),H=_?[]:{};for(var X in W)W.hasOwnProperty(X)&&L(W[X],X)&&(_?H.push(W[X]):H[X]=W[X]);return H}var Ce=function(L){var _,H,X,Q="";for(_=0,H=L.length/2;_<H;_++)X=parseInt(L[_*2]+L[_*2+1],16),Q+=String.fromCharCode(X);return btoa(Q)},Ae=function(){var L=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return L()+L()+"-"+L()+"-"+L()+"-"+L()+"-"+L()+L()+L()},Se=function(L,_){var H=_.Bucket,X=_.Region,Q=_.Key,ae=this.options.Domain,ge=!ae||typeof ae=="string"&&ae.indexOf("{Bucket}")>-1,ke=!ae||typeof ae=="string"&&ae.indexOf("{Region}")>-1;if(L.indexOf("Bucket")>-1||L==="deleteMultipleObject"||L==="multipartList"||L==="listObjectVersions"){if(ge&&!H)return"Bucket";if(ke&&!X)return"Region"}else if(L.indexOf("Object")>-1||L.indexOf("multipart")>-1||L==="sliceUploadFile"||L==="abortUploadTask"||L==="uploadFile"){if(ge&&!H)return"Bucket";if(ke&&!X)return"Region";if(!Q)return"Key"}return!1},Fe=function(L,_){if(_=$({},_),L!=="getAuth"&&L!=="getV4Auth"&&L!=="getObjectUrl"){var H=_.Headers||{};if(_&&h(_)==="object"){(function(){for(var Q in _)_.hasOwnProperty(Q)&&Q.indexOf("x-cos-")>-1&&(H[Q]=_[Q])})();var X={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext","Pic-Operations":"PicOperations","x-cos-callback":"Callback","x-cos-callback-var":"CallbackVar","x-cos-return-body":"ReturnBody"};ze.each(X,function(Q,ae){_[Q]!==void 0&&(H[ae]=_[Q])}),_.Headers=V(H)}}return _},it=function(L,_){return function(H,X){var Q=this;typeof H=="function"&&(X=H,H={}),H=Fe(L,H);var ae;if(Q.options.EnableReporter)if(H.calledBySdk==="sliceUploadFile"||H.calledBySdk==="sliceCopyFile")ae=H.tracker&&H.tracker.generateSubTracker({apiName:L});else if(["uploadFile","uploadFiles"].includes(L))ae=null;else{var ge=0;H.Body&&(ge=typeof H.Body=="string"?H.Body.length:H.Body.size||H.Body.byteLength||0);var ke=Q.options.UseAccelerate||typeof Q.options.Domain=="string"&&Q.options.Domain.includes("accelerate.");ae=new F({Beacon:Q.options.BeaconReporter,clsReporter:Q.options.ClsReporter,bucket:H.Bucket,region:H.Region,apiName:L,realApi:L,accelerate:ke,fileKey:H.Key,fileSize:ge,deepTracker:Q.options.DeepTracker,customId:Q.options.CustomId,delay:Q.options.TrackerDelay})}H.tracker=ae;var Ee=function(Be){return Be&&Be.headers&&(Be.headers["x-ci-request-id"]&&(Be.RequestId=Be.headers["x-ci-request-id"]),Be.headers["x-cos-request-id"]&&(Be.RequestId=Be.headers["x-cos-request-id"]),Be.headers["x-cos-version-id"]&&(Be.VersionId=Be.headers["x-cos-version-id"]),Be.headers["x-cos-delete-marker"]&&(Be.DeleteMarker=Be.headers["x-cos-delete-marker"])),Be},Pe=function(Be,nt){ae&&ae.report(Be,nt),X&&X(Ee(Be),Ee(nt))},De=function(){if(L!=="getService"&&L!=="abortUploadTask"){var Be=Se.call(Q,L,H);if(Be)return"missing param "+Be;if(H.Region){if(Q.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(H.Region))return"Region format error."}else{if(H.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(H.Region))return"Region format error."}!Q.options.CompatibilityMode&&H.Region.indexOf("-")===-1&&H.Region!=="yfb"&&H.Region!=="default"&&H.Region!=="accelerate"&&console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(H.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(H.Bucket))if(H.AppId)H.Bucket=H.Bucket+"-"+H.AppId;else if(Q.options.AppId)H.Bucket=H.Bucket+"-"+Q.options.AppId;else return'Bucket should format as "test-1250000000".';H.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete H.AppId)}!Q.options.UseRawKey&&H.Key&&H.Key.substr(0,1)==="/"&&(H.Key=H.Key.substr(1))}},Me=De(),Ye=["getAuth","getObjectUrl"].includes(L);if(typeof Promise=="function"&&!Ye&&!X)return new Promise(function(Ze,Be){if(X=function(Qe,bt){Qe?Be(Qe):Ze(bt)},Me)return Pe(ze.error(new Error(Me)));_.call(Q,H,Pe)});if(Me)return Pe(ze.error(new Error(Me)));var gt=_.call(Q,H,Pe);if(Ye)return gt}},Xe=function(L,_){var H=this,X=0,Q=0,ae=Date.now(),ge,ke;function Ee(){if(ke=0,_&&typeof _=="function"){ge=Date.now();var Pe=Math.max(0,Math.round((Q-X)/((ge-ae)/1e3)*100)/100)||0,De;Q===0&&L===0?De=1:De=Math.floor(Q/L*100)/100||0,ae=ge,X=Q;try{_({loaded:Q,total:L,speed:Pe,percent:De})}catch(Me){}}}return function(Pe,De){if(Pe&&(Q=Pe.loaded,L=Pe.total),De)clearTimeout(ke),Ee();else{if(ke)return;ke=setTimeout(Ee,H.options.ProgressInterval)}}},st=function(L,_,H){var X;if(typeof _.Body=="string"?_.Body=new Blob([_.Body],{type:"text/plain"}):_.Body instanceof ArrayBuffer&&(_.Body=new Blob([_.Body])),_.Body&&(_.Body instanceof Blob||_.Body.toString()==="[object File]"||_.Body.toString()==="[object Blob]"))X=_.Body.size;else{H(ze.error(new Error("params body format error, Only allow File|Blob|String.")));return}_.ContentLength=X,H(null,X)},lt=function(L){return Date.now()+(L||0)},$e=function(L,_){var H=L;return L.message=L.message||null,typeof _=="string"?(L.error=_,L.message=_):h(_)==="object"&&_!==null&&($(L,_),(_.code||_.name)&&(L.code=_.code||_.name),_.message&&(L.message=_.message),_.stack&&(L.stack=_.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(L,"name",{writable:!0,enumerable:!1}),Object.defineProperty(L,"message",{enumerable:!0})),L.name=_&&_.name||L.name||L.code||"Error",L.code||(L.code=L.name),L.error||(L.error=oe(H)),L},at=function(){return(typeof globalThis>"u"?"undefined":h(globalThis))==="object"&&(globalThis.constructor.name==="DedicatedWorkerGlobalScope"||globalThis.FileReaderSync)},Ot=function(){return(typeof window>"u"?"undefined":h(window))!=="object"&&(typeof d>"u"?"undefined":h(d))==="object"&&!0&&!at()},Gt=function(L){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(L)},Wt=function(){if((typeof navigator>"u"?"undefined":h(navigator))!=="object")return!1;var W=navigator.userAgent,L=!!W.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return L}(),Xt=function(){return(typeof navigator>"u"?"undefined":h(navigator))!=="object"?!1:/\sQQ/i.test(navigator.userAgent)}(),$t=function(L,_){var H=M.encode(L);return _&&(H=H.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),H},Yt=function(L){return L?M.decode(L):""},Qt=function(L){var _=L.split("/"),H=[],X=S(_),Q;try{for(X.s();!(Q=X.n()).done;){var ae=Q.value;ae===".."?H.length&&H.pop():ae.length&&ae!=="."&&H.push(ae)}}catch(ge){X.e(ge)}finally{X.f()}return"/"+H.join("/")},Jt=function(L){var _;if(L&&typeof L=="string"){var H=L.trim(),X=H.indexOf("<")===0,Q=H.indexOf("{")===0;if(X)_=ze.xml2json(L)||{};else if(Q)try{var ae=L.replace(/\n/g," "),ge=JSON.parse(ae);Object.prototype.toString.call(ge)==="[object Object]"?_=ge:_=L}catch(ke){_=L}else _=L}else _=L||{};return _},ze={noop:z,formatParams:Fe,apiWrapper:it,xml2json:q,json2xml:f,md5:t,clearKey:V,fileSlice:te,getBodyMd5:re,getFileMd5:le,b64:Ce,extend:$,isArray:ne,isInArray:he,makeArray:se,each:ce,map:ve,filter:ye,clone:oe,attr:ie,uuid:Ae,camSafeUrlEncode:y,throttleOnProgress:Xe,getFileSize:st,getSkewTime:lt,error:$e,obj2str:c,getAuth:u,parseSelectPayload:D,getSourceParams:N,isBrowser:!0,isNode:Ot,isCIHost:Gt,isIOS_QQ:Wt&&Xt,encodeBase64:$t,decodeBase64:Yt,simplifyPath:Qt,readAsBinaryString:Z,parseResBody:Jt};n.exports=ze}).call(this,g("./node_modules/process/browser.js"))}})})})(Yi);var En=Yi.exports;const Qi=Cn(En),wn="tencent",yi="daya-online-1303457149",Pi=async x=>{const{bucketName:a,filename:n,postData:r}=x,g=wn;let d=a,h=n,S={};return d=yi,h="ktyq/"+n,S={key:"ktyq/"+r.key},kn.post("/edu-app/open/getUploadSign",{data:{postData:S,pluginName:g,bucketName:d,filename:h},params:{pluginName:g}})},An=({file:x,action:a,data:n,onProgress:r,onFinish:g,onError:d})=>{new Qi({Domain:"https://oss.dayaedu.com",Protocol:"https",getAuthorization:async(S,O)=>{O({Authorization:n.signature})}}).uploadFile({Bucket:yi,Region:"ap-nanjing",Key:"ktyq/".concat(n.name),Body:n.file.file,SliceSize:1024*1024*500,onProgress:function(S){r({percent:Math.ceil((S.percent||0)*100)})}}).then(S=>{var O;((O=S.Location)==null?void 0:O.indexOf("http"))>=0?x.url=S.Location:x.url="https://"+S.Location,g()}).catch(S=>{console.log(S,"error"),d()})},On=async(x,a)=>{{let n="",r=null;if(await new Qi({Domain:"https://oss.dayaedu.com",Protocol:"https",getAuthorization:async(d,h)=>{h({Authorization:a.signature})}}).uploadFile({Bucket:yi,Region:"ap-nanjing",Key:"ktyq/".concat(a.name),Body:a.file,SliceSize:1024*1024*500}).then(d=>{var h;((h=d.Location)==null?void 0:h.indexOf("http"))>=0?n=d.Location:n="https://"+d.Location}).catch(d=>{r=d}),n)return n;throw new Error(r)}};/*!
  2. * Cropper.js v1.6.2
  3. * https://fengyuanchen.github.io/cropperjs
  4. *
  5. * Copyright 2015-present Chen Fengyuan
  6. * Released under the MIT license
  7. *
  8. * Date: 2024-04-21T07:43:05.335Z
  9. */function Ii(x,a){var n=Object.keys(x);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(x);a&&(r=r.filter(function(g){return Object.getOwnPropertyDescriptor(x,g).enumerable})),n.push.apply(n,r)}return n}function Ji(x){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?arguments[a]:{};a%2?Ii(Object(n),!0).forEach(function(r){Mn(x,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach(function(r){Object.defineProperty(x,r,Object.getOwnPropertyDescriptor(n,r))})}return x}function Pn(x,a){if(typeof x!="object"||!x)return x;var n=x[Symbol.toPrimitive];if(n!==void 0){var r=n.call(x,a||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(x)}function Zi(x){var a=Pn(x,"string");return typeof a=="symbol"?a:a+""}function ai(x){"@babel/helpers - typeof";return ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},ai(x)}function In(x,a){if(!(x instanceof a))throw new TypeError("Cannot call a class as a function")}function Ni(x,a){for(var n=0;n<a.length;n++){var r=a[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(x,Zi(r.key),r)}}function Nn(x,a,n){return a&&Ni(x.prototype,a),n&&Ni(x,n),Object.defineProperty(x,"prototype",{writable:!1}),x}function Mn(x,a,n){return a=Zi(a),a in x?Object.defineProperty(x,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):x[a]=n,x}function en(x){return Ln(x)||Fn(x)||Un(x)||jn()}function Ln(x){if(Array.isArray(x))return ui(x)}function Fn(x){if(typeof Symbol<"u"&&x[Symbol.iterator]!=null||x["@@iterator"]!=null)return Array.from(x)}function Un(x,a){if(x){if(typeof x=="string")return ui(x,a);var n=Object.prototype.toString.call(x).slice(8,-1);if(n==="Object"&&x.constructor&&(n=x.constructor.name),n==="Map"||n==="Set")return Array.from(x);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ui(x,a)}}function ui(x,a){(a==null||a>x.length)&&(a=x.length);for(var n=0,r=new Array(a);n<a;n++)r[n]=x[n];return r}function jn(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var qt=typeof window<"u"&&typeof window.document<"u",ot=qt?window:{},mi=qt&&ot.document.documentElement?"ontouchstart"in ot.document.documentElement:!1,Ci=qt?"PointerEvent"in ot:!1,Ie="cropper",ki="all",tn="crop",nn="move",rn="zoom",mt="e",Ct="w",Rt="s",dt="n",Pt="ne",It="nw",Nt="se",Mt="sw",ci="".concat(Ie,"-crop"),Mi="".concat(Ie,"-disabled"),We="".concat(Ie,"-hidden"),Li="".concat(Ie,"-hide"),Dn="".concat(Ie,"-invisible"),Vt="".concat(Ie,"-modal"),li="".concat(Ie,"-move"),Ft="".concat(Ie,"Action"),Kt="".concat(Ie,"Preview"),xi="crop",on="move",sn="none",di="crop",fi="cropend",hi="cropmove",gi="cropstart",Fi="dblclick",_n=mi?"touchstart":"mousedown",Hn=mi?"touchmove":"mousemove",Kn=mi?"touchend touchcancel":"mouseup",Ui=Ci?"pointerdown":_n,ji=Ci?"pointermove":Hn,Di=Ci?"pointerup pointercancel":Kn,_i="ready",Hi="resize",Ki="wheel",pi="zoom",zi="image/jpeg",zn=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Vn=/^data:/,qn=/^data:image\/jpeg;base64,/,Gn=/^img|canvas$/i,an=200,un=100,Vi={viewMode:0,dragMode:xi,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:an,minContainerHeight:un,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Wn='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Xn=Number.isNaN||ot.isNaN;function Te(x){return typeof x=="number"&&!Xn(x)}var qi=function(a){return a>0&&a<1/0};function oi(x){return typeof x>"u"}function St(x){return ai(x)==="object"&&x!==null}var $n=Object.prototype.hasOwnProperty;function Bt(x){if(!St(x))return!1;try{var a=x.constructor,n=a.prototype;return a&&n&&$n.call(n,"isPrototypeOf")}catch(r){return!1}}function Ge(x){return typeof x=="function"}var Yn=Array.prototype.slice;function cn(x){return Array.from?Array.from(x):Yn.call(x)}function je(x,a){return x&&Ge(a)&&(Array.isArray(x)||Te(x.length)?cn(x).forEach(function(n,r){a.call(x,n,r,x)}):St(x)&&Object.keys(x).forEach(function(n){a.call(x,x[n],n,x)})),x}var Ne=Object.assign||function(a){for(var n=arguments.length,r=new Array(n>1?n-1:0),g=1;g<n;g++)r[g-1]=arguments[g];return St(a)&&r.length>0&&r.forEach(function(d){St(d)&&Object.keys(d).forEach(function(h){a[h]=d[h]})}),a},Qn=/\.\d*(?:0|9){12}\d*$/;function wt(x){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Qn.test(x)?Math.round(x*a)/a:x}var Jn=/^width|height|left|top|marginLeft|marginTop$/;function ft(x,a){var n=x.style;je(a,function(r,g){Jn.test(g)&&Te(r)&&(r="".concat(r,"px")),n[g]=r})}function Zn(x,a){return x.classList?x.classList.contains(a):x.className.indexOf(a)>-1}function He(x,a){if(a){if(Te(x.length)){je(x,function(r){He(r,a)});return}if(x.classList){x.classList.add(a);return}var n=x.className.trim();n?n.indexOf(a)<0&&(x.className="".concat(n," ").concat(a)):x.className=a}}function rt(x,a){if(a){if(Te(x.length)){je(x,function(n){rt(n,a)});return}if(x.classList){x.classList.remove(a);return}x.className.indexOf(a)>=0&&(x.className=x.className.replace(a,""))}}function Et(x,a,n){if(a){if(Te(x.length)){je(x,function(r){Et(r,a,n)});return}n?He(x,a):rt(x,a)}}var er=/([a-z\d])([A-Z])/g;function Si(x){return x.replace(er,"$1-$2").toLowerCase()}function vi(x,a){return St(x[a])?x[a]:x.dataset?x.dataset[a]:x.getAttribute("data-".concat(Si(a)))}function Ut(x,a,n){St(n)?x[a]=n:x.dataset?x.dataset[a]=n:x.setAttribute("data-".concat(Si(a)),n)}function tr(x,a){if(St(x[a]))try{delete x[a]}catch(n){x[a]=void 0}else if(x.dataset)try{delete x.dataset[a]}catch(n){x.dataset[a]=void 0}else x.removeAttribute("data-".concat(Si(a)))}var ln=/\s\s*/,dn=function(){var x=!1;if(qt){var a=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return x=!0,a},set:function(d){a=d}});ot.addEventListener("test",n,r),ot.removeEventListener("test",n,r)}return x}();function tt(x,a,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},g=n;a.trim().split(ln).forEach(function(d){if(!dn){var h=x.listeners;h&&h[d]&&h[d][n]&&(g=h[d][n],delete h[d][n],Object.keys(h[d]).length===0&&delete h[d],Object.keys(h).length===0&&delete x.listeners)}x.removeEventListener(d,g,r)})}function Je(x,a,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},g=n;a.trim().split(ln).forEach(function(d){if(r.once&&!dn){var h=x.listeners,S=h===void 0?{}:h;g=function(){delete S[d][n],x.removeEventListener(d,g,r);for(var w=arguments.length,t=new Array(w),p=0;p<w;p++)t[p]=arguments[p];n.apply(x,t)},S[d]||(S[d]={}),S[d][n]&&x.removeEventListener(d,S[d][n],r),S[d][n]=g,x.listeners=S}x.addEventListener(d,g,r)})}function At(x,a,n){var r;return Ge(Event)&&Ge(CustomEvent)?r=new CustomEvent(a,{detail:n,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(a,!0,!0,n)),x.dispatchEvent(r)}function fn(x){var a=x.getBoundingClientRect();return{left:a.left+(window.pageXOffset-document.documentElement.clientLeft),top:a.top+(window.pageYOffset-document.documentElement.clientTop)}}var si=ot.location,ir=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Gi(x){var a=x.match(ir);return a!==null&&(a[1]!==si.protocol||a[2]!==si.hostname||a[3]!==si.port)}function Wi(x){var a="timestamp=".concat(new Date().getTime());return x+(x.indexOf("?")===-1?"?":"&")+a}function Lt(x){var a=x.rotate,n=x.scaleX,r=x.scaleY,g=x.translateX,d=x.translateY,h=[];Te(g)&&g!==0&&h.push("translateX(".concat(g,"px)")),Te(d)&&d!==0&&h.push("translateY(".concat(d,"px)")),Te(a)&&a!==0&&h.push("rotate(".concat(a,"deg)")),Te(n)&&n!==1&&h.push("scaleX(".concat(n,")")),Te(r)&&r!==1&&h.push("scaleY(".concat(r,")"));var S=h.length?h.join(" "):"none";return{WebkitTransform:S,msTransform:S,transform:S}}function nr(x){var a=Ji({},x),n=0;return je(x,function(r,g){delete a[g],je(a,function(d){var h=Math.abs(r.startX-d.startX),S=Math.abs(r.startY-d.startY),O=Math.abs(r.endX-d.endX),w=Math.abs(r.endY-d.endY),t=Math.sqrt(h*h+S*S),p=Math.sqrt(O*O+w*w),l=(p-t)/t;Math.abs(l)>Math.abs(n)&&(n=l)})}),n}function zt(x,a){var n=x.pageX,r=x.pageY,g={endX:n,endY:r};return a?g:Ji({startX:n,startY:r},g)}function rr(x){var a=0,n=0,r=0;return je(x,function(g){var d=g.startX,h=g.startY;a+=d,n+=h,r+=1}),a/=r,n/=r,{pageX:a,pageY:n}}function ht(x){var a=x.aspectRatio,n=x.height,r=x.width,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",d=qi(r),h=qi(n);if(d&&h){var S=n*a;g==="contain"&&S>r||g==="cover"&&S<r?n=r/a:r=n*a}else d?n=r/a:h&&(r=n*a);return{width:r,height:n}}function or(x){var a=x.width,n=x.height,r=x.degree;if(r=Math.abs(r)%180,r===90)return{width:n,height:a};var g=r%90*Math.PI/180,d=Math.sin(g),h=Math.cos(g),S=a*h+n*d,O=a*d+n*h;return r>90?{width:O,height:S}:{width:S,height:O}}function sr(x,a,n,r){var g=a.aspectRatio,d=a.naturalWidth,h=a.naturalHeight,S=a.rotate,O=S===void 0?0:S,w=a.scaleX,t=w===void 0?1:w,p=a.scaleY,l=p===void 0?1:p,b=n.aspectRatio,k=n.naturalWidth,R=n.naturalHeight,P=r.fillColor,M=P===void 0?"transparent":P,F=r.imageSmoothingEnabled,U=F===void 0?!0:F,K=r.imageSmoothingQuality,q=K===void 0?"low":K,f=r.maxWidth,y=f===void 0?1/0:f,A=r.maxHeight,c=A===void 0?1/0:A,o=r.minWidth,i=o===void 0?0:o,u=r.minHeight,v=u===void 0?0:u,B=document.createElement("canvas"),D=B.getContext("2d"),N=ht({aspectRatio:b,width:y,height:c}),z=ht({aspectRatio:b,width:i,height:v},"cover"),V=Math.min(N.width,Math.max(z.width,k)),Z=Math.min(N.height,Math.max(z.height,R)),J=ht({aspectRatio:g,width:y,height:c}),te=ht({aspectRatio:g,width:i,height:v},"cover"),re=Math.min(J.width,Math.max(te.width,d)),pe=Math.min(J.height,Math.max(te.height,h)),le=[-re/2,-pe/2,re,pe];return B.width=wt(V),B.height=wt(Z),D.fillStyle=M,D.fillRect(0,0,V,Z),D.save(),D.translate(V/2,Z/2),D.rotate(O*Math.PI/180),D.scale(t,l),D.imageSmoothingEnabled=U,D.imageSmoothingQuality=q,D.drawImage.apply(D,[x].concat(en(le.map(function(oe){return Math.floor(wt(oe))})))),D.restore(),B}var hn=String.fromCharCode;function ar(x,a,n){var r="";n+=a;for(var g=a;g<n;g+=1)r+=hn(x.getUint8(g));return r}var ur=/^data:.*,/;function cr(x){var a=x.replace(ur,""),n=atob(a),r=new ArrayBuffer(n.length),g=new Uint8Array(r);return je(g,function(d,h){g[h]=n.charCodeAt(h)}),r}function lr(x,a){for(var n=[],r=8192,g=new Uint8Array(x);g.length>0;)n.push(hn.apply(null,cn(g.subarray(0,r)))),g=g.subarray(r);return"data:".concat(a,";base64,").concat(btoa(n.join("")))}function dr(x){var a=new DataView(x),n;try{var r,g,d;if(a.getUint8(0)===255&&a.getUint8(1)===216)for(var h=a.byteLength,S=2;S+1<h;){if(a.getUint8(S)===255&&a.getUint8(S+1)===225){g=S;break}S+=1}if(g){var O=g+4,w=g+10;if(ar(a,O,4)==="Exif"){var t=a.getUint16(w);if(r=t===18761,(r||t===19789)&&a.getUint16(w+2,r)===42){var p=a.getUint32(w+4,r);p>=8&&(d=w+p)}}}if(d){var l=a.getUint16(d,r),b,k;for(k=0;k<l;k+=1)if(b=d+k*12+2,a.getUint16(b,r)===274){b+=8,n=a.getUint16(b,r),a.setUint16(b,1,r);break}}}catch(R){n=1}return n}function fr(x){var a=0,n=1,r=1;switch(x){case 2:n=-1;break;case 3:a=-180;break;case 4:r=-1;break;case 5:a=90,r=-1;break;case 6:a=90;break;case 7:a=90,n=-1;break;case 8:a=-90;break}return{rotate:a,scaleX:n,scaleY:r}}var hr={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var a=this.element,n=this.options,r=this.container,g=this.cropper,d=Number(n.minContainerWidth),h=Number(n.minContainerHeight);He(g,We),rt(a,We);var S={width:Math.max(r.offsetWidth,d>=0?d:an),height:Math.max(r.offsetHeight,h>=0?h:un)};this.containerData=S,ft(g,{width:S.width,height:S.height}),He(a,We),rt(g,We)},initCanvas:function(){var a=this.containerData,n=this.imageData,r=this.options.viewMode,g=Math.abs(n.rotate)%180===90,d=g?n.naturalHeight:n.naturalWidth,h=g?n.naturalWidth:n.naturalHeight,S=d/h,O=a.width,w=a.height;a.height*S>a.width?r===3?O=a.height*S:w=a.width/S:r===3?w=a.width/S:O=a.height*S;var t={aspectRatio:S,naturalWidth:d,naturalHeight:h,width:O,height:w};this.canvasData=t,this.limited=r===1||r===2,this.limitCanvas(!0,!0),t.width=Math.min(Math.max(t.width,t.minWidth),t.maxWidth),t.height=Math.min(Math.max(t.height,t.minHeight),t.maxHeight),t.left=(a.width-t.width)/2,t.top=(a.height-t.height)/2,t.oldLeft=t.left,t.oldTop=t.top,this.initialCanvasData=Ne({},t)},limitCanvas:function(a,n){var r=this.options,g=this.containerData,d=this.canvasData,h=this.cropBoxData,S=r.viewMode,O=d.aspectRatio,w=this.cropped&&h;if(a){var t=Number(r.minCanvasWidth)||0,p=Number(r.minCanvasHeight)||0;S>1?(t=Math.max(t,g.width),p=Math.max(p,g.height),S===3&&(p*O>t?t=p*O:p=t/O)):S>0&&(t?t=Math.max(t,w?h.width:0):p?p=Math.max(p,w?h.height:0):w&&(t=h.width,p=h.height,p*O>t?t=p*O:p=t/O));var l=ht({aspectRatio:O,width:t,height:p});t=l.width,p=l.height,d.minWidth=t,d.minHeight=p,d.maxWidth=1/0,d.maxHeight=1/0}if(n)if(S>(w?0:1)){var b=g.width-d.width,k=g.height-d.height;d.minLeft=Math.min(0,b),d.minTop=Math.min(0,k),d.maxLeft=Math.max(0,b),d.maxTop=Math.max(0,k),w&&this.limited&&(d.minLeft=Math.min(h.left,h.left+(h.width-d.width)),d.minTop=Math.min(h.top,h.top+(h.height-d.height)),d.maxLeft=h.left,d.maxTop=h.top,S===2&&(d.width>=g.width&&(d.minLeft=Math.min(0,b),d.maxLeft=Math.max(0,b)),d.height>=g.height&&(d.minTop=Math.min(0,k),d.maxTop=Math.max(0,k))))}else d.minLeft=-d.width,d.minTop=-d.height,d.maxLeft=g.width,d.maxTop=g.height},renderCanvas:function(a,n){var r=this.canvasData,g=this.imageData;if(n){var d=or({width:g.naturalWidth*Math.abs(g.scaleX||1),height:g.naturalHeight*Math.abs(g.scaleY||1),degree:g.rotate||0}),h=d.width,S=d.height,O=r.width*(h/r.naturalWidth),w=r.height*(S/r.naturalHeight);r.left-=(O-r.width)/2,r.top-=(w-r.height)/2,r.width=O,r.height=w,r.aspectRatio=h/S,r.naturalWidth=h,r.naturalHeight=S,this.limitCanvas(!0,!1)}(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCanvas(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,ft(this.canvas,Ne({width:r.width,height:r.height},Lt({translateX:r.left,translateY:r.top}))),this.renderImage(a),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(a){var n=this.canvasData,r=this.imageData,g=r.naturalWidth*(n.width/n.naturalWidth),d=r.naturalHeight*(n.height/n.naturalHeight);Ne(r,{width:g,height:d,left:(n.width-g)/2,top:(n.height-d)/2}),ft(this.image,Ne({width:r.width,height:r.height},Lt(Ne({translateX:r.left,translateY:r.top},r)))),a&&this.output()},initCropBox:function(){var a=this.options,n=this.canvasData,r=a.aspectRatio||a.initialAspectRatio,g=Number(a.autoCropArea)||.8,d={width:n.width,height:n.height};r&&(n.height*r>n.width?d.height=d.width/r:d.width=d.height*r),this.cropBoxData=d,this.limitCropBox(!0,!0),d.width=Math.min(Math.max(d.width,d.minWidth),d.maxWidth),d.height=Math.min(Math.max(d.height,d.minHeight),d.maxHeight),d.width=Math.max(d.minWidth,d.width*g),d.height=Math.max(d.minHeight,d.height*g),d.left=n.left+(n.width-d.width)/2,d.top=n.top+(n.height-d.height)/2,d.oldLeft=d.left,d.oldTop=d.top,this.initialCropBoxData=Ne({},d)},limitCropBox:function(a,n){var r=this.options,g=this.containerData,d=this.canvasData,h=this.cropBoxData,S=this.limited,O=r.aspectRatio;if(a){var w=Number(r.minCropBoxWidth)||0,t=Number(r.minCropBoxHeight)||0,p=S?Math.min(g.width,d.width,d.width+d.left,g.width-d.left):g.width,l=S?Math.min(g.height,d.height,d.height+d.top,g.height-d.top):g.height;w=Math.min(w,g.width),t=Math.min(t,g.height),O&&(w&&t?t*O>w?t=w/O:w=t*O:w?t=w/O:t&&(w=t*O),l*O>p?l=p/O:p=l*O),h.minWidth=Math.min(w,p),h.minHeight=Math.min(t,l),h.maxWidth=p,h.maxHeight=l}n&&(S?(h.minLeft=Math.max(0,d.left),h.minTop=Math.max(0,d.top),h.maxLeft=Math.min(g.width,d.left+d.width)-h.width,h.maxTop=Math.min(g.height,d.top+d.height)-h.height):(h.minLeft=0,h.minTop=0,h.maxLeft=g.width-h.width,h.maxTop=g.height-h.height))},renderCropBox:function(){var a=this.options,n=this.containerData,r=this.cropBoxData;(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCropBox(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,a.movable&&a.cropBoxMovable&&Ut(this.face,Ft,r.width>=n.width&&r.height>=n.height?nn:ki),ft(this.cropBox,Ne({width:r.width,height:r.height},Lt({translateX:r.left,translateY:r.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),At(this.element,di,this.getData())}},gr={initPreview:function(){var a=this.element,n=this.crossOrigin,r=this.options.preview,g=n?this.crossOriginUrl:this.url,d=a.alt||"The image to preview",h=document.createElement("img");if(n&&(h.crossOrigin=n),h.src=g,h.alt=d,this.viewBox.appendChild(h),this.viewBoxImage=h,!!r){var S=r;typeof r=="string"?S=a.ownerDocument.querySelectorAll(r):r.querySelector&&(S=[r]),this.previews=S,je(S,function(O){var w=document.createElement("img");Ut(O,Kt,{width:O.offsetWidth,height:O.offsetHeight,html:O.innerHTML}),n&&(w.crossOrigin=n),w.src=g,w.alt=d,w.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',O.innerHTML="",O.appendChild(w)})}},resetPreview:function(){je(this.previews,function(a){var n=vi(a,Kt);ft(a,{width:n.width,height:n.height}),a.innerHTML=n.html,tr(a,Kt)})},preview:function(){var a=this.imageData,n=this.canvasData,r=this.cropBoxData,g=r.width,d=r.height,h=a.width,S=a.height,O=r.left-n.left-a.left,w=r.top-n.top-a.top;!this.cropped||this.disabled||(ft(this.viewBoxImage,Ne({width:h,height:S},Lt(Ne({translateX:-O,translateY:-w},a)))),je(this.previews,function(t){var p=vi(t,Kt),l=p.width,b=p.height,k=l,R=b,P=1;g&&(P=l/g,R=d*P),d&&R>b&&(P=b/d,k=g*P,R=b),ft(t,{width:k,height:R}),ft(t.getElementsByTagName("img")[0],Ne({width:h*P,height:S*P},Lt(Ne({translateX:-O*P,translateY:-w*P},a))))}))}},pr={bind:function(){var a=this.element,n=this.options,r=this.cropper;Ge(n.cropstart)&&Je(a,gi,n.cropstart),Ge(n.cropmove)&&Je(a,hi,n.cropmove),Ge(n.cropend)&&Je(a,fi,n.cropend),Ge(n.crop)&&Je(a,di,n.crop),Ge(n.zoom)&&Je(a,pi,n.zoom),Je(r,Ui,this.onCropStart=this.cropStart.bind(this)),n.zoomable&&n.zoomOnWheel&&Je(r,Ki,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),n.toggleDragModeOnDblclick&&Je(r,Fi,this.onDblclick=this.dblclick.bind(this)),Je(a.ownerDocument,ji,this.onCropMove=this.cropMove.bind(this)),Je(a.ownerDocument,Di,this.onCropEnd=this.cropEnd.bind(this)),n.responsive&&Je(window,Hi,this.onResize=this.resize.bind(this))},unbind:function(){var a=this.element,n=this.options,r=this.cropper;Ge(n.cropstart)&&tt(a,gi,n.cropstart),Ge(n.cropmove)&&tt(a,hi,n.cropmove),Ge(n.cropend)&&tt(a,fi,n.cropend),Ge(n.crop)&&tt(a,di,n.crop),Ge(n.zoom)&&tt(a,pi,n.zoom),tt(r,Ui,this.onCropStart),n.zoomable&&n.zoomOnWheel&&tt(r,Ki,this.onWheel,{passive:!1,capture:!0}),n.toggleDragModeOnDblclick&&tt(r,Fi,this.onDblclick),tt(a.ownerDocument,ji,this.onCropMove),tt(a.ownerDocument,Di,this.onCropEnd),n.responsive&&tt(window,Hi,this.onResize)}},vr={resize:function(){if(!this.disabled){var a=this.options,n=this.container,r=this.containerData,g=n.offsetWidth/r.width,d=n.offsetHeight/r.height,h=Math.abs(g-1)>Math.abs(d-1)?g:d;if(h!==1){var S,O;a.restore&&(S=this.getCanvasData(),O=this.getCropBoxData()),this.render(),a.restore&&(this.setCanvasData(je(S,function(w,t){S[t]=w*h})),this.setCropBoxData(je(O,function(w,t){O[t]=w*h})))}}},dblclick:function(){this.disabled||this.options.dragMode===sn||this.setDragMode(Zn(this.dragBox,ci)?on:xi)},wheel:function(a){var n=this,r=Number(this.options.wheelZoomRatio)||.1,g=1;this.disabled||(a.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){n.wheeling=!1},50),a.deltaY?g=a.deltaY>0?1:-1:a.wheelDelta?g=-a.wheelDelta/120:a.detail&&(g=a.detail>0?1:-1),this.zoom(-g*r,a)))},cropStart:function(a){var n=a.buttons,r=a.button;if(!(this.disabled||(a.type==="mousedown"||a.type==="pointerdown"&&a.pointerType==="mouse")&&(Te(n)&&n!==1||Te(r)&&r!==0||a.ctrlKey))){var g=this.options,d=this.pointers,h;a.changedTouches?je(a.changedTouches,function(S){d[S.identifier]=zt(S)}):d[a.pointerId||0]=zt(a),Object.keys(d).length>1&&g.zoomable&&g.zoomOnTouch?h=rn:h=vi(a.target,Ft),zn.test(h)&&At(this.element,gi,{originalEvent:a,action:h})!==!1&&(a.preventDefault(),this.action=h,this.cropping=!1,h===tn&&(this.cropping=!0,He(this.dragBox,Vt)))}},cropMove:function(a){var n=this.action;if(!(this.disabled||!n)){var r=this.pointers;a.preventDefault(),At(this.element,hi,{originalEvent:a,action:n})!==!1&&(a.changedTouches?je(a.changedTouches,function(g){Ne(r[g.identifier]||{},zt(g,!0))}):Ne(r[a.pointerId||0]||{},zt(a,!0)),this.change(a))}},cropEnd:function(a){if(!this.disabled){var n=this.action,r=this.pointers;a.changedTouches?je(a.changedTouches,function(g){delete r[g.identifier]}):delete r[a.pointerId||0],n&&(a.preventDefault(),Object.keys(r).length||(this.action=""),this.cropping&&(this.cropping=!1,Et(this.dragBox,Vt,this.cropped&&this.options.modal)),At(this.element,fi,{originalEvent:a,action:n}))}}},yr={change:function(a){var n=this.options,r=this.canvasData,g=this.containerData,d=this.cropBoxData,h=this.pointers,S=this.action,O=n.aspectRatio,w=d.left,t=d.top,p=d.width,l=d.height,b=w+p,k=t+l,R=0,P=0,M=g.width,F=g.height,U=!0,K;!O&&a.shiftKey&&(O=p&&l?p/l:1),this.limited&&(R=d.minLeft,P=d.minTop,M=R+Math.min(g.width,r.width,r.left+r.width),F=P+Math.min(g.height,r.height,r.top+r.height));var q=h[Object.keys(h)[0]],f={x:q.endX-q.startX,y:q.endY-q.startY},y=function(c){switch(c){case mt:b+f.x>M&&(f.x=M-b);break;case Ct:w+f.x<R&&(f.x=R-w);break;case dt:t+f.y<P&&(f.y=P-t);break;case Rt:k+f.y>F&&(f.y=F-k);break}};switch(S){case ki:w+=f.x,t+=f.y;break;case mt:if(f.x>=0&&(b>=M||O&&(t<=P||k>=F))){U=!1;break}y(mt),p+=f.x,p<0&&(S=Ct,p=-p,w-=p),O&&(l=p/O,t+=(d.height-l)/2);break;case dt:if(f.y<=0&&(t<=P||O&&(w<=R||b>=M))){U=!1;break}y(dt),l-=f.y,t+=f.y,l<0&&(S=Rt,l=-l,t-=l),O&&(p=l*O,w+=(d.width-p)/2);break;case Ct:if(f.x<=0&&(w<=R||O&&(t<=P||k>=F))){U=!1;break}y(Ct),p-=f.x,w+=f.x,p<0&&(S=mt,p=-p,w-=p),O&&(l=p/O,t+=(d.height-l)/2);break;case Rt:if(f.y>=0&&(k>=F||O&&(w<=R||b>=M))){U=!1;break}y(Rt),l+=f.y,l<0&&(S=dt,l=-l,t-=l),O&&(p=l*O,w+=(d.width-p)/2);break;case Pt:if(O){if(f.y<=0&&(t<=P||b>=M)){U=!1;break}y(dt),l-=f.y,t+=f.y,p=l*O}else y(dt),y(mt),f.x>=0?b<M?p+=f.x:f.y<=0&&t<=P&&(U=!1):p+=f.x,f.y<=0?t>P&&(l-=f.y,t+=f.y):(l-=f.y,t+=f.y);p<0&&l<0?(S=Mt,l=-l,p=-p,t-=l,w-=p):p<0?(S=It,p=-p,w-=p):l<0&&(S=Nt,l=-l,t-=l);break;case It:if(O){if(f.y<=0&&(t<=P||w<=R)){U=!1;break}y(dt),l-=f.y,t+=f.y,p=l*O,w+=d.width-p}else y(dt),y(Ct),f.x<=0?w>R?(p-=f.x,w+=f.x):f.y<=0&&t<=P&&(U=!1):(p-=f.x,w+=f.x),f.y<=0?t>P&&(l-=f.y,t+=f.y):(l-=f.y,t+=f.y);p<0&&l<0?(S=Nt,l=-l,p=-p,t-=l,w-=p):p<0?(S=Pt,p=-p,w-=p):l<0&&(S=Mt,l=-l,t-=l);break;case Mt:if(O){if(f.x<=0&&(w<=R||k>=F)){U=!1;break}y(Ct),p-=f.x,w+=f.x,l=p/O}else y(Rt),y(Ct),f.x<=0?w>R?(p-=f.x,w+=f.x):f.y>=0&&k>=F&&(U=!1):(p-=f.x,w+=f.x),f.y>=0?k<F&&(l+=f.y):l+=f.y;p<0&&l<0?(S=Pt,l=-l,p=-p,t-=l,w-=p):p<0?(S=Nt,p=-p,w-=p):l<0&&(S=It,l=-l,t-=l);break;case Nt:if(O){if(f.x>=0&&(b>=M||k>=F)){U=!1;break}y(mt),p+=f.x,l=p/O}else y(Rt),y(mt),f.x>=0?b<M?p+=f.x:f.y>=0&&k>=F&&(U=!1):p+=f.x,f.y>=0?k<F&&(l+=f.y):l+=f.y;p<0&&l<0?(S=It,l=-l,p=-p,t-=l,w-=p):p<0?(S=Mt,p=-p,w-=p):l<0&&(S=Pt,l=-l,t-=l);break;case nn:this.move(f.x,f.y),U=!1;break;case rn:this.zoom(nr(h),a),U=!1;break;case tn:if(!f.x||!f.y){U=!1;break}K=fn(this.cropper),w=q.startX-K.left,t=q.startY-K.top,p=d.minWidth,l=d.minHeight,f.x>0?S=f.y>0?Nt:Pt:f.x<0&&(w-=p,S=f.y>0?Mt:It),f.y<0&&(t-=l),this.cropped||(rt(this.cropBox,We),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}U&&(d.width=p,d.height=l,d.left=w,d.top=t,this.action=S,this.renderCropBox()),je(h,function(A){A.startX=A.endX,A.startY=A.endY})}},mr={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&He(this.dragBox,Vt),rt(this.cropBox,We),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Ne({},this.initialImageData),this.canvasData=Ne({},this.initialCanvasData),this.cropBoxData=Ne({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Ne(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),rt(this.dragBox,Vt),He(this.cropBox,We)),this},replace:function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&a&&(this.isImg&&(this.element.src=a),n?(this.url=a,this.image.src=a,this.ready&&(this.viewBoxImage.src=a,je(this.previews,function(r){r.getElementsByTagName("img")[0].src=a}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(a))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,rt(this.cropper,Mi)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,He(this.cropper,Mi)),this},destroy:function(){var a=this.element;return a[Ie]?(a[Ie]=void 0,this.isImg&&this.replaced&&(a.src=this.originalUrl),this.uncreate(),this):this},move:function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a,r=this.canvasData,g=r.left,d=r.top;return this.moveTo(oi(a)?a:g+Number(a),oi(n)?n:d+Number(n))},moveTo:function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a,r=this.canvasData,g=!1;return a=Number(a),n=Number(n),this.ready&&!this.disabled&&this.options.movable&&(Te(a)&&(r.left=a,g=!0),Te(n)&&(r.top=n,g=!0),g&&this.renderCanvas(!0)),this},zoom:function(a,n){var r=this.canvasData;return a=Number(a),a<0?a=1/(1-a):a=1+a,this.zoomTo(r.width*a/r.naturalWidth,null,n)},zoomTo:function(a,n,r){var g=this.options,d=this.canvasData,h=d.width,S=d.height,O=d.naturalWidth,w=d.naturalHeight;if(a=Number(a),a>=0&&this.ready&&!this.disabled&&g.zoomable){var t=O*a,p=w*a;if(At(this.element,pi,{ratio:a,oldRatio:h/O,originalEvent:r})===!1)return this;if(r){var l=this.pointers,b=fn(this.cropper),k=l&&Object.keys(l).length?rr(l):{pageX:r.pageX,pageY:r.pageY};d.left-=(t-h)*((k.pageX-b.left-d.left)/h),d.top-=(p-S)*((k.pageY-b.top-d.top)/S)}else Bt(n)&&Te(n.x)&&Te(n.y)?(d.left-=(t-h)*((n.x-d.left)/h),d.top-=(p-S)*((n.y-d.top)/S)):(d.left-=(t-h)/2,d.top-=(p-S)/2);d.width=t,d.height=p,this.renderCanvas(!0)}return this},rotate:function(a){return this.rotateTo((this.imageData.rotate||0)+Number(a))},rotateTo:function(a){return a=Number(a),Te(a)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=a%360,this.renderCanvas(!0,!0)),this},scaleX:function(a){var n=this.imageData.scaleY;return this.scale(a,Te(n)?n:1)},scaleY:function(a){var n=this.imageData.scaleX;return this.scale(Te(n)?n:1,a)},scale:function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a,r=this.imageData,g=!1;return a=Number(a),n=Number(n),this.ready&&!this.disabled&&this.options.scalable&&(Te(a)&&(r.scaleX=a,g=!0),Te(n)&&(r.scaleY=n,g=!0),g&&this.renderCanvas(!0,!0)),this},getData:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=this.options,r=this.imageData,g=this.canvasData,d=this.cropBoxData,h;if(this.ready&&this.cropped){h={x:d.left-g.left,y:d.top-g.top,width:d.width,height:d.height};var S=r.width/r.naturalWidth;if(je(h,function(t,p){h[p]=t/S}),a){var O=Math.round(h.y+h.height),w=Math.round(h.x+h.width);h.x=Math.round(h.x),h.y=Math.round(h.y),h.width=w-h.x,h.height=O-h.y}}else h={x:0,y:0,width:0,height:0};return n.rotatable&&(h.rotate=r.rotate||0),n.scalable&&(h.scaleX=r.scaleX||1,h.scaleY=r.scaleY||1),h},setData:function(a){var n=this.options,r=this.imageData,g=this.canvasData,d={};if(this.ready&&!this.disabled&&Bt(a)){var h=!1;n.rotatable&&Te(a.rotate)&&a.rotate!==r.rotate&&(r.rotate=a.rotate,h=!0),n.scalable&&(Te(a.scaleX)&&a.scaleX!==r.scaleX&&(r.scaleX=a.scaleX,h=!0),Te(a.scaleY)&&a.scaleY!==r.scaleY&&(r.scaleY=a.scaleY,h=!0)),h&&this.renderCanvas(!0,!0);var S=r.width/r.naturalWidth;Te(a.x)&&(d.left=a.x*S+g.left),Te(a.y)&&(d.top=a.y*S+g.top),Te(a.width)&&(d.width=a.width*S),Te(a.height)&&(d.height=a.height*S),this.setCropBoxData(d)}return this},getContainerData:function(){return this.ready?Ne({},this.containerData):{}},getImageData:function(){return this.sized?Ne({},this.imageData):{}},getCanvasData:function(){var a=this.canvasData,n={};return this.ready&&je(["left","top","width","height","naturalWidth","naturalHeight"],function(r){n[r]=a[r]}),n},setCanvasData:function(a){var n=this.canvasData,r=n.aspectRatio;return this.ready&&!this.disabled&&Bt(a)&&(Te(a.left)&&(n.left=a.left),Te(a.top)&&(n.top=a.top),Te(a.width)?(n.width=a.width,n.height=a.width/r):Te(a.height)&&(n.height=a.height,n.width=a.height*r),this.renderCanvas(!0)),this},getCropBoxData:function(){var a=this.cropBoxData,n;return this.ready&&this.cropped&&(n={left:a.left,top:a.top,width:a.width,height:a.height}),n||{}},setCropBoxData:function(a){var n=this.cropBoxData,r=this.options.aspectRatio,g,d;return this.ready&&this.cropped&&!this.disabled&&Bt(a)&&(Te(a.left)&&(n.left=a.left),Te(a.top)&&(n.top=a.top),Te(a.width)&&a.width!==n.width&&(g=!0,n.width=a.width),Te(a.height)&&a.height!==n.height&&(d=!0,n.height=a.height),r&&(g?n.height=n.width/r:d&&(n.width=n.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var n=this.canvasData,r=sr(this.image,this.imageData,n,a);if(!this.cropped)return r;var g=this.getData(a.rounded),d=g.x,h=g.y,S=g.width,O=g.height,w=r.width/Math.floor(n.naturalWidth);w!==1&&(d*=w,h*=w,S*=w,O*=w);var t=S/O,p=ht({aspectRatio:t,width:a.maxWidth||1/0,height:a.maxHeight||1/0}),l=ht({aspectRatio:t,width:a.minWidth||0,height:a.minHeight||0},"cover"),b=ht({aspectRatio:t,width:a.width||(w!==1?r.width:S),height:a.height||(w!==1?r.height:O)}),k=b.width,R=b.height;k=Math.min(p.width,Math.max(l.width,k)),R=Math.min(p.height,Math.max(l.height,R));var P=document.createElement("canvas"),M=P.getContext("2d");P.width=wt(k),P.height=wt(R),M.fillStyle=a.fillColor||"transparent",M.fillRect(0,0,k,R);var F=a.imageSmoothingEnabled,U=F===void 0?!0:F,K=a.imageSmoothingQuality;M.imageSmoothingEnabled=U,K&&(M.imageSmoothingQuality=K);var q=r.width,f=r.height,y=d,A=h,c,o,i,u,v,B;y<=-S||y>q?(y=0,c=0,i=0,v=0):y<=0?(i=-y,y=0,c=Math.min(q,S+y),v=c):y<=q&&(i=0,c=Math.min(S,q-y),v=c),c<=0||A<=-O||A>f?(A=0,o=0,u=0,B=0):A<=0?(u=-A,A=0,o=Math.min(f,O+A),B=o):A<=f&&(u=0,o=Math.min(O,f-A),B=o);var D=[y,A,c,o];if(v>0&&B>0){var N=k/S;D.push(i*N,u*N,v*N,B*N)}return M.drawImage.apply(M,[r].concat(en(D.map(function(z){return Math.floor(wt(z))})))),P},setAspectRatio:function(a){var n=this.options;return!this.disabled&&!oi(a)&&(n.aspectRatio=Math.max(0,a)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(a){var n=this.options,r=this.dragBox,g=this.face;if(this.ready&&!this.disabled){var d=a===xi,h=n.movable&&a===on;a=d||h?a:sn,n.dragMode=a,Ut(r,Ft,a),Et(r,ci,d),Et(r,li,h),n.cropBoxMovable||(Ut(g,Ft,a),Et(g,ci,d),Et(g,li,h))}return this}},Cr=ot.Cropper,gn=function(){function x(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(In(this,x),!a||!Gn.test(a.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=a,this.options=Ne({},Vi,Bt(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Nn(x,[{key:"init",value:function(){var n=this.element,r=n.tagName.toLowerCase(),g;if(!n[Ie]){if(n[Ie]=this,r==="img"){if(this.isImg=!0,g=n.getAttribute("src")||"",this.originalUrl=g,!g)return;g=n.src}else r==="canvas"&&window.HTMLCanvasElement&&(g=n.toDataURL());this.load(g)}}},{key:"load",value:function(n){var r=this;if(n){this.url=n,this.imageData={};var g=this.element,d=this.options;if(!d.rotatable&&!d.scalable&&(d.checkOrientation=!1),!d.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Vn.test(n)){qn.test(n)?this.read(cr(n)):this.clone();return}var h=new XMLHttpRequest,S=this.clone.bind(this);this.reloading=!0,this.xhr=h,h.onabort=S,h.onerror=S,h.ontimeout=S,h.onprogress=function(){h.getResponseHeader("content-type")!==zi&&h.abort()},h.onload=function(){r.read(h.response)},h.onloadend=function(){r.reloading=!1,r.xhr=null},d.checkCrossOrigin&&Gi(n)&&g.crossOrigin&&(n=Wi(n)),h.open("GET",n,!0),h.responseType="arraybuffer",h.withCredentials=g.crossOrigin==="use-credentials",h.send()}}},{key:"read",value:function(n){var r=this.options,g=this.imageData,d=dr(n),h=0,S=1,O=1;if(d>1){this.url=lr(n,zi);var w=fr(d);h=w.rotate,S=w.scaleX,O=w.scaleY}r.rotatable&&(g.rotate=h),r.scalable&&(g.scaleX=S,g.scaleY=O),this.clone()}},{key:"clone",value:function(){var n=this.element,r=this.url,g=n.crossOrigin,d=r;this.options.checkCrossOrigin&&Gi(r)&&(g||(g="anonymous"),d=Wi(r)),this.crossOrigin=g,this.crossOriginUrl=d;var h=document.createElement("img");g&&(h.crossOrigin=g),h.src=d||r,h.alt=n.alt||"The image to crop",this.image=h,h.onload=this.start.bind(this),h.onerror=this.stop.bind(this),He(h,Li),n.parentNode.insertBefore(h,n.nextSibling)}},{key:"start",value:function(){var n=this,r=this.image;r.onload=null,r.onerror=null,this.sizing=!0;var g=ot.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ot.navigator.userAgent),d=function(w,t){Ne(n.imageData,{naturalWidth:w,naturalHeight:t,aspectRatio:w/t}),n.initialImageData=Ne({},n.imageData),n.sizing=!1,n.sized=!0,n.build()};if(r.naturalWidth&&!g){d(r.naturalWidth,r.naturalHeight);return}var h=document.createElement("img"),S=document.body||document.documentElement;this.sizingImage=h,h.onload=function(){d(h.width,h.height),g||S.removeChild(h)},h.src=r.src,g||(h.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",S.appendChild(h))}},{key:"stop",value:function(){var n=this.image;n.onload=null,n.onerror=null,n.parentNode.removeChild(n),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var n=this.element,r=this.options,g=this.image,d=n.parentNode,h=document.createElement("div");h.innerHTML=Wn;var S=h.querySelector(".".concat(Ie,"-container")),O=S.querySelector(".".concat(Ie,"-canvas")),w=S.querySelector(".".concat(Ie,"-drag-box")),t=S.querySelector(".".concat(Ie,"-crop-box")),p=t.querySelector(".".concat(Ie,"-face"));this.container=d,this.cropper=S,this.canvas=O,this.dragBox=w,this.cropBox=t,this.viewBox=S.querySelector(".".concat(Ie,"-view-box")),this.face=p,O.appendChild(g),He(n,We),d.insertBefore(S,n.nextSibling),rt(g,Li),this.initPreview(),this.bind(),r.initialAspectRatio=Math.max(0,r.initialAspectRatio)||NaN,r.aspectRatio=Math.max(0,r.aspectRatio)||NaN,r.viewMode=Math.max(0,Math.min(3,Math.round(r.viewMode)))||0,He(t,We),r.guides||He(t.getElementsByClassName("".concat(Ie,"-dashed")),We),r.center||He(t.getElementsByClassName("".concat(Ie,"-center")),We),r.background&&He(S,"".concat(Ie,"-bg")),r.highlight||He(p,Dn),r.cropBoxMovable&&(He(p,li),Ut(p,Ft,ki)),r.cropBoxResizable||(He(t.getElementsByClassName("".concat(Ie,"-line")),We),He(t.getElementsByClassName("".concat(Ie,"-point")),We)),this.render(),this.ready=!0,this.setDragMode(r.dragMode),r.autoCrop&&this.crop(),this.setData(r.data),Ge(r.ready)&&Je(n,_i,r.ready,{once:!0}),At(n,_i)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var n=this.cropper.parentNode;n&&n.removeChild(this.cropper),rt(this.element,We)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Cr,x}},{key:"setDefaults",value:function(n){Ne(Vi,Bt(n)&&n)}}])}();Ne(gn.prototype,hr,gr,pr,vr,yr,mr);const kr=Xi({name:"copper-image",emits:["close","cropperNo","cropperOk"],setup(x,{emit:a,expose:n}){const r=$i({visible:!1,img:null,confirmLoading:!1,options:{img:"",autoCrop:!0,autoCropWidth:180,autoCropHeight:180,fixedBox:!0,full:!1,enlarge:1,previewsCircle:!0,centerBox:!0,outputType:"png",title:"修改头像",name:null},previews:{},url:{upload:"/sys/common/saveToImgByStr"},myCropper:null}),g=kt(),d=w=>{const{options:t}=r;r.visible=!0,r.options=Object.assign({},t,w),Sn(()=>{h()})},h=()=>{r.myCropper=new gn(g.value,{viewMode:1,dragMode:"move",aspectRatio:r.options.autoCropWidth/r.options.autoCropHeight,initialAspectRatio:1,autoCropArea:1,cropBoxMovable:!0,cropBoxResizable:!1,background:!0,movable:!0,modal:!0,preview:".before"})},S=w=>{switch(w){case"left":r.myCropper.rotate(90);break;case"right":r.myCropper.rotate(-90);break;case"zoomIn":r.myCropper.zoom(.1);break;case"zoomOut":r.myCropper.zoom(-.1);break}},O=()=>{r.confirmLoading=!0,r.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toBlob(w=>{console.log(w,"1212"),a("cropperOk",w),r.confirmLoading=!1})};return n({edit:d}),()=>Le("div",null,[Le(xn,{cols:2,xGap:24,style:{paddingTop:"12px"}},{default:()=>[Le(wi,null,{default:()=>{var w,t;return[Le("div",{style:"width: 100%; height: 300px"},[((w=r.options)==null?void 0:w.img)&&Le("img",{ref:g,src:(t=r.options)==null?void 0:t.img,alt:""},null)]),Le(Ai,{justify:"center",style:{paddingTop:"12px"}},{default:()=>[Le(xt,{type:"primary",size:"small",onClick:()=>S("left")},{default:()=>[yt("逆时针旋转")]}),Le(xt,{type:"primary",size:"small",onClick:()=>S("right")},{default:()=>[yt("顺时针旋转")]}),Le(xt,{type:"primary",size:"small",onClick:()=>S("zoomIn")},{default:()=>[yt("放大")]}),Le(xt,{type:"primary",size:"small",onClick:()=>S("zoomOut")},{default:()=>[yt("缩小")]})]})]}}),Le(wi,null,{default:()=>[Le("span",{style:{fontSize:"15px",fontWeight:600,paddingBottom:"8px",display:"inline-block"}},[yt("预览图片")]),Le("div",{class:"before",style:{width:r.options.autoCropWidth+"px",height:r.options.autoCropHeight+"px",overflow:"hidden"}},null)]})]}),Le(Ai,{justify:"end"},{default:()=>[Le(xt,{type:"default",onClick:()=>{r.confirmLoading=!1,a("close"),a("cropperNo")}},{default:()=>[yt("取消")]}),Le(xt,{type:"primary",loading:r.confirmLoading,onClick:O},{default:()=>[yt("确认")]})]})])}}),Sr=Xi({name:"upload-file",props:{fileList:{type:String,default:""},imageList:{type:Array,default:()=>[]},accept:{type:String,default:".jpg,.png,.jpeg,.gif"},listType:{type:String,default:"image-card"},showType:{type:String,default:"default"},showFileList:{type:Boolean,default:!0},text:{type:String,default:"上传文件"},size:{type:Number,default:5},max:{type:Number,default:1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tips:{type:String,default:""},bucketName:{type:String,default:"gyt"},path:{type:String,default:""},fileName:{type:String,default:""},cropper:{type:Boolean,default:!1},options:{type:Object,default:()=>({viewMode:0,autoCrop:!0,enlarge:1,autoCropWidth:200,autoCropHeight:200,fixedBox:!1,previewsCircle:!0,title:"上传图片"})}},emits:["update:fileList","close","readFileInputEventAsArrayBuffer","remove"],setup(x,{emit:a,expose:n,slots:r}){const g="https://".concat(x.bucketName,".ks3-cn-beijing.ksyuncs.com/"),d=bn(),h=kt(!1),S=kt(!1);kt();const O=kt(),w=$i([]),t=kt([]),p=()=>{if(x.fileList){const K=x.fileList.split("/");t.value=[{id:new Date().getTime().toString(),name:K[K.length-1],status:"finished",url:x.fileList}]}else if(Array.isArray(x.imageList)){const K=[];x.imageList.forEach(q=>{const f=q.split("/");K.push({id:Date.now().toString(),name:f[f.length-1],status:"finished",url:q})}),t.value=K}else t.value=[]};p(),Oi(()=>x.imageList,()=>{p()}),Oi(()=>x.fileList,()=>{p()}),n({handleClearFile:()=>{var K;(K=O.value)==null||K.clear(),console.log("清空",O.value)}});const b=kt(),k=async K=>{const q=K.file;let f=!0;if(x.size&&(f=q.file.size/1024/1024<x.size,!f))return d.error("文件大小不能超过".concat(x.size,"M")),!1;if(!f)return f;if(x.cropper)return R(q.file,y=>{const A=Object.assign({},x.options,{img:y,name:q.file.name});h.value=!0,setTimeout(()=>{var c;(c=b.value)==null||c.edit(A),console.log(b.value,"cropper")},100)}),!1;try{S.value=!0,console.log(x.path,q.file);const y=q.file.name,A=y.slice(y.lastIndexOf(".")),c="".concat(x.path).concat(x.fileName||Date.now()+A),o={filename:c,bucketName:x.bucketName,postData:{filename:c,acl:"public-read",key:c,unknowValueField:[]}},{data:i}=await Pi(o);w.push({id:q.id,tempFiileBuffer:q.file,policy:i.policy,signature:i.signature,acl:"public-read",key:c,KSSAccessKeyId:i.kssAccessKeyId,name:c})}catch(y){return S.value=!1,!1}return!0},R=async(K,q)=>{const f=new FileReader;f.addEventListener("load",()=>q(f.result)),f.readAsDataURL(K)},P=K=>{const q=w.find(f=>f.id==K.file.id);a("update:fileList",K.file.url),a("readFileInputEventAsArrayBuffer",q.tempFiileBuffer),h.value=!1,S.value=!1},M=async K=>{console.log("🚀 ~ options",K),a("update:fileList",""),a("remove"),S.value=!1},F=({file:K,action:q,onFinish:f,onError:y,onProgress:A})=>{const c=w.find(o=>o.id==K.id);c.file=K,An({file:K,action:q,data:c,onProgress:A,onFinish:f,onError:y})},U=async K=>{try{const q="".concat(x.path).concat(x.fileName||new Date().getTime()+".png"),f={filename:q,bucketName:x.bucketName,postData:{filename:q,acl:"public-read",key:q,unknowValueField:[]}},{data:y}=await Pi(f),A={policy:y.policy,signature:y.signature,acl:"public-read",key:q,KSSAccessKeyId:y.kssAccessKeyId,name:q,file:K},c=await On(g,A);console.log(c,"upload"),a("update:fileList",c),h.value=!1}catch(q){return!1}};return()=>Le("div",null,[Le(Tn,{ref:O,action:g,customRequest:F,fileList:t.value,"onUpdate:fileList":K=>t.value=K,listType:x.listType,accept:x.accept,multiple:x.multiple,max:x.max,disabled:x.disabled,showFileList:x.showFileList,showPreviewButton:!0,onBeforeUpload:K=>k(K),onFinish:K=>P(K),onRemove:K=>M(K)},{default:()=>[x.showType==="default"&&x.listType==="image"&&Le(xt,{loading:S.value,type:"primary"},{default:()=>[x.text]}),x.showType==="custom"&&r.custom&&r.custom()]}),x.tips&&Le("p",{style:"font-size: 13px; color: #666; padding-top: 4px;"},[x.tips]),Le(Rn,{maskClosable:Bn,show:h.value,"onUpdate:show":K=>h.value=K,preset:"dialog",showIcon:!1,class:["modalTitle background"],title:"上传图片",style:{width:"800px"}},{default:()=>[Le(kr,{ref:b,onClose:()=>h.value=!1,onCropperOk:U},null)]})])}});export{gn as C,Sr as U,On as a,Pi as g,An as o};