var ct=(g,y,s)=>new Promise((h,R)=>{var c=N=>{try{_(s.next(N))}catch(I){R(I)}},x=N=>{try{_(s.throw(N))}catch(I){R(I)}},_=N=>N.done?h(N.value):Promise.resolve(N.value).then(c,x);_((s=s.apply(g,y)).next())});import{cc as commonjsGlobal,cb as getDefaultExportFromCjs,ab as service}from"./index.0d3a6da1.js";var cosJsSdkV5={exports:{}};(function(module,exports){(function(y,s){module.exports=s()})(commonjsGlobal,function(){return function(g){var y={};function s(h){if(y[h])return y[h].exports;var R=y[h]={i:h,l:!1,exports:{}};return g[h].call(R.exports,R,R.exports,s),R.l=!0,R.exports}return s.m=g,s.c=y,s.d=function(h,R,c){s.o(h,R)||Object.defineProperty(h,R,{enumerable:!0,get:c})},s.r=function(h){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})},s.t=function(h,R){if(R&1&&(h=s(h)),R&8||R&4&&typeof h=="object"&&h&&h.__esModule)return h;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:h}),R&2&&typeof h!="string")for(var x in h)s.d(c,x,function(_){return h[_]}.bind(null,x));return c},s.n=function(h){var R=h&&h.__esModule?function(){return h.default}:function(){return h};return s.d(R,"a",R),R},s.o=function(h,R){return Object.prototype.hasOwnProperty.call(h,R)},s.p="/dist/",s(s.s="./index.js")}({"./index.js":function(g,y,s){var h=s("./src/cos.js");g.exports=h},"./lib/base64.js":function(g,y){var s=function(h){h=h||{};var R=h.Base64,c="2.1.9",x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=function(P){for(var F={},b=0,U=P.length;b>>6)+N(128|b&63):N(224|b>>>12&15)+N(128|b>>>6&63)+N(128|b&63)}else{var b=65536+(F.charCodeAt(0)-55296)*1024+(F.charCodeAt(1)-56320);return N(240|b>>>18&7)+N(128|b>>>12&63)+N(128|b>>>6&63)+N(128|b&63)}},w=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,K=function(F){return F.replace(w,I)},X=function(F){var b=[0,2,1][F.length%3],U=F.charCodeAt(0)<<16|(F.length>1?F.charCodeAt(1):0)<<8|(F.length>2?F.charCodeAt(2):0),z=[x.charAt(U>>>18),x.charAt(U>>>12&63),b>=2?"=":x.charAt(U>>>6&63),b>=1?"=":x.charAt(U&63)];return z.join("")},V=h.btoa?function(P){return h.btoa(P)}:function(P){return P.replace(/[\s\S]{1,3}/g,X)},M=function(P){return V(K(P))},j=function(F,b){return b?M(String(F)).replace(/[+\/]/g,function(U){return U=="+"?"-":"_"}).replace(/=/g,""):M(String(F))},ne=function(F){return j(F,!0)},Q=new RegExp(["[\xC0-\xDF][\x80-\xBF]","[\xE0-\xEF][\x80-\xBF]{2}","[\xF0-\xF7][\x80-\xBF]{3}"].join("|"),"g"),se=function(F){switch(F.length){case 4:var b=(7&F.charCodeAt(0))<<18|(63&F.charCodeAt(1))<<12|(63&F.charCodeAt(2))<<6|63&F.charCodeAt(3),U=b-65536;return N((U>>>10)+55296)+N((U&1023)+56320);case 3:return N((15&F.charCodeAt(0))<<12|(63&F.charCodeAt(1))<<6|63&F.charCodeAt(2));default:return N((31&F.charCodeAt(0))<<6|63&F.charCodeAt(1))}},B=function(F){return F.replace(Q,se)},S=function(F){var b=F.length,U=b%4,z=(b>0?_[F.charAt(0)]<<18:0)|(b>1?_[F.charAt(1)]<<12:0)|(b>2?_[F.charAt(2)]<<6:0)|(b>3?_[F.charAt(3)]:0),q=[N(z>>>16),N(z>>>8&255),N(z&255)];return q.length-=[0,0,2,1][U],q.join("")},v=h.atob?function(P){return h.atob(P)}:function(P){return P.replace(/[\s\S]{1,4}/g,S)},W=function(P){return B(v(P))},p=function(F){return W(String(F).replace(/[-_]/g,function(b){return b=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},L=function(){var F=h.Base64;return h.Base64=R,F},H={VERSION:c,atob:v,btoa:V,fromBase64:p,toBase64:j,utob:K,encode:j,encodeURI:ne,btou:B,decode:p,noConflict:L};return H}();g.exports=s},"./lib/beacon.min.js":function(g,y,s){var h,R,c=s("./node_modules/@babel/runtime/helpers/typeof.js");(function(x,_){c(y)=="object"&&typeof g!="undefined"?g.exports=_():(h=_,R=typeof h=="function"?h.call(y,s,y,g):h,R!==void 0&&(g.exports=R))})(this,function(){var x=function(r,n){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,f){o.__proto__=f}||function(o,f){for(var E in f)Object.prototype.hasOwnProperty.call(f,E)&&(o[E]=f[E])},x(r,n)},_=function(){return _=Object.assign||function(r){for(var n,o=1,f=arguments.length;o0&&f[f.length-1])||J[0]!==6&&J[0]!==2)){A=0;continue}if(J[0]===3&&(!f||J[1]>f[0]&&J[1]60*this.strategy.requestInterval*1e3},a.prototype.getUploadUrl=function(){return this.strategy.httpsUploadUrl+"?appkey="+this.appkey},a.prototype.isBlackEvent=function(r){return this.strategy.blacklist.indexOf(r)!=-1},a.prototype.isEventUpOnOff=function(){return this.strategy.isEventUpOnOff},a.prototype.isSampleEvent=function(r){return!!Object.prototype.hasOwnProperty.call(this.realSample,r)&&this.realSample[r]this.duration)return this.createSession();n=f.sessionId,o=f.sessionStart,this.getSessionStackDepth=0}catch(A){}return{sessionId:n,sessionStart:o}},a.prototype.createSession=function(){var r=Date.now(),n={sessionId:this.appkey+"_"+r.toString(),sessionStart:r};this.storage.setItem(L,JSON.stringify(n)),this.storage.setItem(X,r.toString());var o="is_new_user",f=this.storage.getItem(o);return this.getSessionStackDepth<=1&&this.beacon.onDirectUserAction("rqd_applaunched",{A21:f?"N":"Y"}),this.storage.setItem(o,JSON.stringify(!1)),n},a}();function P(){var a=navigator.userAgent,r=a.indexOf("compatible")>-1&&a.indexOf("MSIE")>-1,n=a.indexOf("Edge")>-1&&!r,o=a.indexOf("Trident")>-1&&a.indexOf("rv:11.0")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(a);var f=parseFloat(RegExp.$1);return f==7?7:f==8?8:f==9?9:f==10?10:6}return n?-2:o?11:-1}function F(a,r){var n,o;return(n="https://tun-cos-1258344701.file.myqcloud.com/fp.js",o===void 0&&(o=Date.now()+"-"+Math.random()),new Promise(function(f,E){if(document.getElementById(o))f(void 0);else{var A=document.getElementsByTagName("head")[0],G=document.createElement("script");G.onload=function(){return function(){G.onload=null,f(void 0)}},G.onerror=function(de){G.onerror=null,A.removeChild(G),E(de)},G.src=n,G.id=o,A.appendChild(G)}})).then(function(){new Fingerprint().getQimei36(a,r)}).catch(function(f){}),""}var b=function(){return(b=Object.assign||function(r){for(var n,o=1,f=arguments.length;o0||!window.indexedDB||/X5Lite/.test(navigator.userAgent)?(this.store=new ce(n),this.dbEventCount=this.store.getCount()):(this.store=new re(r),this.getCount().then(function(f){o.dbEventCount=f}).catch(function(f){}))}return a.prototype.getCount=function(){return N(this,void 0,void 0,function(){return I(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.store.getCount()];case 1:return[2,r.sent()];case 2:return r.sent(),[2,Promise.reject()];case 3:return[2]}})})},a.prototype.insertEvent=function(r,n){return N(this,void 0,void 0,function(){var o,f;return I(this,function(E){switch(E.label){case 0:if(this.dbEventCount>=1e4)return[2,Promise.reject()];o=B(r.mapValue),E.label=1;case 1:return E.trys.push([1,3,,4]),this.dbEventCount++,[4,this.store.setItem(o,r)];case 2:return[2,E.sent()];case 3:return f=E.sent(),n&&n(f,r),this.dbEventCount--,[2,Promise.reject()];case 4:return[2]}})})},a.prototype.getEvents=function(){return N(this,void 0,void 0,function(){var r;return I(this,function(n){switch(n.label){case 0:r=[],n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.store.iterate(function(o){r.push(o)})];case 2:return n.sent(),[2,Promise.all(r)];case 3:return n.sent(),[2,Promise.all(r)];case 4:return[2]}})})},a.prototype.removeEvent=function(r){return N(this,void 0,void 0,function(){var n;return I(this,function(o){switch(o.label){case 0:n=B(r.mapValue),o.label=1;case 1:return o.trys.push([1,3,,4]),this.dbEventCount--,[4,this.store.removeItem(n)];case 2:return[2,o.sent()];case 3:return o.sent(),this.dbEventCount++,[2,Promise.reject()];case 4:return[2]}})})},a}(),ee=function(){return(ee=Object.assign||function(r){for(var n,o=1,f=arguments.length;o0&&f[f.length-1])||J[0]!==6&&J[0]!==2)){A=0;continue}if(J[0]===3&&(!f||J[1]>f[0]&&J[1]0&&A<8,o.isUnderIE8||(o.isUnderIE=A>0,n.needInitQimei&&F(n.appkey,function(G){o.qimei36=G.q36}),o.network=new Pe(n),o.storage=new je(n.appkey),o.initCommonInfo(n),o.store=new ie(n.appkey,o.storage),o.errorReport=new W(o.config,o.commonInfo,"web",o.network),o.strategy=new p(n.needQueryConfig==null||n.needQueryConfig,o.config,o.commonInfo,o.storage,o.network),o.logidStartTime=o.storage.getItem(Ue),o.logidStartTime||(o.logidStartTime=Date.now().toString(),o.storage.setItem(Ue,o.logidStartTime)),f=o.logidStartTime,E=Date.now()-Number.parseFloat(f),Math.floor(E/864e5)>=365&&o.storage.clear(),o.initSession(n),o.onDirectUserAction("rqd_js_init",{}),setTimeout(function(){return o.lifeCycle.emit("init")},0),o.initDelayTime=n.delay?n.delay:1e3,o.cycleTask(o.initDelayTime)),o}return function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function f(){this.constructor=n}x(n,o),n.prototype=o===null?Object.create(o):(f.prototype=o.prototype,new f)}(r,a),r.prototype.initSession=function(n){var o=18e5;n.sessionDuration&&n.sessionDuration>3e4&&(o=n.sessionDuration),this.beaconSession=new H(this.storage,o,this)},r.prototype.initCommonInfo=function(n){var o=Number(this.storage.getItem(X));try{var f=JSON.parse(this.storage.getItem(V));(Date.now()-o>3e4||!f)&&this.storage.setItem(V,JSON.stringify([]))}catch(A){}n.uploadUrl&&(this.uploadUrl=n.uploadUrl+"?appkey="+n.appkey);var E=[window.screen.width,window.screen.height];window.devicePixelRatio&&E.push(window.devicePixelRatio),this.commonInfo={deviceId:this.storage.createDeviceId(),language:navigator&&navigator.language||"zh_CN",query:window.location.search,userAgent:navigator.userAgent,pixel:E.join("*"),channelID:n.channelID?String(n.channelID):"",openid:n.openid?String(n.openid):"",unid:n.unionid?String(n.unionid):"",sdkVersion:oe},this.config.appVersion=n.versionCode?String(n.versionCode):"",this.config.strictMode=n.strictMode},r.prototype.cycleTask=function(n){var o=this;this.intervalID=window.setInterval(function(){o.pauseSearching||o.store.getEvents().then(function(f){f.length==0&&(o.pauseSearching=!0);var E=[],A=JSON.parse(o.storage.getItem(V));A||(A=[]),f&&f.forEach(function(G){var de=B(G.mapValue);A.indexOf(de)==-1&&(E.push(G),A.push(de))}),E.length!=0&&(o.storage.setItem(V,JSON.stringify(A)),o._normalLogPipeline(o.assembleData(E)))}).catch(function(f){})},n)},r.prototype.onReport=function(n,o,f){var E=this;if(this.isUnderIE8)this.errorReport.reportError("601","UnderIE8");else{this.pauseSearching=!1;var A=this.generateData(n,o,f);if(f&&this.delayTime==0&&!this.underWeakNet)this._normalLogPipeline(this.assembleData(A));else{var G=A.shift();G&&this.store.insertEvent(G,function(de){de&&E.errorReport.reportError("604","insertEvent fail!")}).catch(function(de){E._normalLogPipeline(E.assembleData(A))})}}},r.prototype.onSendBeacon=function(n,o){if(this.isUnderIE)this.errorReport.reportError("605","UnderIE");else{this.pauseSearching=!1;var f=this.assembleData(this.generateData(n,o,!0));typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.uploadUrl||this.strategy.getUploadUrl(),JSON.stringify(f))}},r.prototype.generateData=function(n,o,f){var E=[],A="4.5.14-web_"+(f?"direct_log_id":"normal_log_id"),G=Number(this.storage.getItem(A));return G=G||1,o=_(_({},o),{A99:f?"Y":"N",A100:G.toString(),A72:oe,A88:this.logidStartTime}),G++,this.storage.setItem(A,G.toString()),E.push({eventCode:n,eventTime:Date.now().toString(),mapValue:Q(o,this.config.strictMode)}),E},r.prototype.assembleData=function(n){var o=this.beaconSession.getSession();return{appVersion:this.config.appVersion?se(this.config.appVersion):"",sdkId:"js",sdkVersion:oe,mainAppKey:this.config.appkey,platformId:3,common:Q(_(_({},this.additionalParams),{A2:this.commonInfo.deviceId,A8:this.commonInfo.openid,A12:this.commonInfo.language,A17:this.commonInfo.pixel,A23:this.commonInfo.channelID,A50:this.commonInfo.unid,A76:o.sessionId,A101:this.commonInfo.userAgent,A102:window.location.href,A104:document.referrer,A119:this.commonInfo.query,A153:this.qimei36}),!1),events:n}},r.prototype.monitorUploadFailed=function(){this.uselessCycleTaskNum++,this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(6e4),this.underWeakNet=!0)},r.prototype.doCustomCycleTask=function(){this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(this.initDelayTime)),this.uselessCycleTaskNum=0,this.underWeakNet=!1},r}(v)})},"./lib/crypto.js":function(g,y,s){(function(h){var R=s("./node_modules/@babel/runtime/helpers/typeof.js"),c=c||function(x,_){var N={},I=N.lib={},w=function(){},K=I.Base={extend:function(S){w.prototype=this;var v=new w;return S&&v.mixIn(S),v.hasOwnProperty("init")||(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var S=this.extend();return S.init.apply(S,arguments),S},init:function(){},mixIn:function(S){for(var v in S)S.hasOwnProperty(v)&&(this[v]=S[v]);S.hasOwnProperty("toString")&&(this.toString=S.toString)},clone:function(){return this.init.prototype.extend(this)}},X=I.WordArray=K.extend({init:function(S,v){S=this.words=S||[],this.sigBytes=v!=_?v:4*S.length},toString:function(S){return(S||M).stringify(this)},concat:function(S){var v=this.words,W=S.words,p=this.sigBytes;if(S=S.sigBytes,this.clamp(),p%4)for(var L=0;L>>2]|=(W[L>>>2]>>>24-8*(L%4)&255)<<24-8*((p+L)%4);else if(65535>>2]=W[L>>>2];else v.push.apply(v,W);return this.sigBytes+=S,this},clamp:function(){var S=this.words,v=this.sigBytes;S[v>>>2]&=4294967295<<32-8*(v%4),S.length=x.ceil(v/4)},clone:function(){var S=K.clone.call(this);return S.words=this.words.slice(0),S},random:function(S){for(var v=[],W=0;W>>2]>>>24-8*(p%4)&255;W.push((L>>>4).toString(16)),W.push((L&15).toString(16))}return W.join("")},parse:function(S){for(var v=S.length,W=[],p=0;p>>3]|=parseInt(S.substr(p,2),16)<<24-4*(p%8);return new X.init(W,v/2)}},j=V.Latin1={stringify:function(S){var v=S.words;S=S.sigBytes;for(var W=[],p=0;p>>2]>>>24-8*(p%4)&255));return W.join("")},parse:function(S){for(var v=S.length,W=[],p=0;p>>2]|=(S.charCodeAt(p)&255)<<24-8*(p%4);return new X.init(W,v)}},ne=V.Utf8={stringify:function(S){try{return decodeURIComponent(escape(j.stringify(S)))}catch(v){throw Error("Malformed UTF-8 data")}},parse:function(S){return j.parse(unescape(encodeURIComponent(S)))}},Q=I.BufferedBlockAlgorithm=K.extend({reset:function(){this._data=new X.init,this._nDataBytes=0},_append:function(S){typeof S=="string"&&(S=ne.parse(S)),this._data.concat(S),this._nDataBytes+=S.sigBytes},_process:function(S){var v=this._data,W=v.words,p=v.sigBytes,L=this.blockSize,H=p/(4*L),H=S?x.ceil(H):x.max((H|0)-this._minBufferSize,0);if(S=H*L,p=x.min(4*S,p),S){for(var P=0;PS;S++){if(16>S)I[S]=X[V+S]|0;else{var v=I[S-3]^I[S-8]^I[S-14]^I[S-16];I[S]=v<<1|v>>>31}v=(j<<5|j>>>27)+B+I[S],v=20>S?v+((ne&Q|~ne&se)+1518500249):40>S?v+((ne^Q^se)+1859775393):60>S?v+((ne&Q|ne&se|Q&se)-1894007588):v+((ne^Q^se)-899497514),B=se,se=Q,Q=ne<<30|ne>>>2,ne=j,j=v}M[0]=M[0]+j|0,M[1]=M[1]+ne|0,M[2]=M[2]+Q|0,M[3]=M[3]+se|0,M[4]=M[4]+B|0},_doFinalize:function(){var X=this._data,V=X.words,M=8*this._nDataBytes,j=8*X.sigBytes;return V[j>>>5]|=128<<24-j%32,V[(j+64>>>9<<4)+14]=Math.floor(M/4294967296),V[(j+64>>>9<<4)+15]=M,X.sigBytes=4*V.length,this._process(),this._hash},clone:function(){var X=N.clone.call(this);return X._hash=this._hash.clone(),X}});x.SHA1=N._createHelper(w),x.HmacSHA1=N._createHmacHelper(w)})(),function(){var x=c,_=x.enc.Utf8;x.algo.HMAC=x.lib.Base.extend({init:function(I,w){I=this._hasher=new I.init,typeof w=="string"&&(w=_.parse(w));var K=I.blockSize,X=4*K;w.sigBytes>X&&(w=I.finalize(w)),w.clamp();for(var V=this._oKey=w.clone(),M=this._iKey=w.clone(),j=V.words,ne=M.words,Q=0;Q>>2]>>>24-ne%4*8&255,se=X[ne+1>>>2]>>>24-(ne+1)%4*8&255,B=X[ne+2>>>2]>>>24-(ne+2)%4*8&255,S=Q<<16|se<<8|B,v=0;v<4&&ne+v*.75>>6*(3-v)&63));var W=M.charAt(64);if(W)for(;j.length%4;)j.push(W);return j.join("")},parse:function(K){var X=K.length,V=this._map,M=V.charAt(64);if(M){var j=K.indexOf(M);j!=-1&&(X=j)}for(var ne=[],Q=0,se=0;se>>6-se%4*2;ne[Q>>>2]|=(B|S)<<24-Q%4*8,Q++}return N.create(ne,Q)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),R(h)==="object"?h.exports=c:window.CryptoJS=c}).call(this,s("./node_modules/webpack/buildin/module.js")(g))},"./lib/json2xml.js":function(g,y,s){var h=s("./node_modules/@babel/runtime/helpers/typeof.js"),R="a-zA-Z_\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FFF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",c="-.0-9\xB7\u0300-\u036F\u203F\u2040",x=new RegExp("^([^"+R+"])|^((x|X)(m|M)(l|L))|([^"+R+c+"])","g"),_=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,N=function(V){var M=[];if(V instanceof Object)for(var j in V)V.hasOwnProperty(j)&&M.push(j);return M},I=function(V,M){var j=function(Q,se,B,S,v){var W=M.indent!==void 0?M.indent:" ",p=M.prettyPrint?` `+new Array(S).join(W):"";M.removeIllegalNameCharacters&&(Q=Q.replace(x,"_"));var L=[p,"<",Q,B||""];return se&&se.length>0?(L.push(">"),L.push(se),v&&L.push(p),L.push("")):L.push("/>"),L.join("")};return function ne(Q,se,B){var S=h(Q);switch((Array.isArray?Array.isArray(Q):Q instanceof Array)?S="array":Q instanceof Date&&(S="date"),S){case"array":var v=[];return Q.map(function(H){v.push(ne(H,1,B+1))}),M.prettyPrint&&v.push(` `),v.join("");case"date":return Q.toJSON?Q.toJSON():Q+"";case"object":var W=[];for(var p in Q)if(Q.hasOwnProperty(p))if(Q[p]instanceof Array)for(var L=0;L0&&W.push(` `),W.join("");case"function":return Q();default:return M.escape?K(Q):""+Q}}(V,0,0)},w=function(V){var M=['"),M.join("")};function K(X){return(""+X).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(_,"")}g.exports=function(X,V){if(V||(V={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),typeof X=="string")try{X=JSON.parse(X.toString())}catch(Q){return!1}var M="",j="";V&&(h(V)=="object"?(V.xmlHeader&&(M=w(!!V.xmlHeader.standalone)),typeof V.docType!="undefined"&&(j="")):M=w()),V=V||{};var ne=[M,V.prettyPrint&&j?` `:"",j,I(X,V)];return ne.join("").replace(/\n{2,}/g,` `).replace(/\s+$/g,"")}},"./lib/md5.js":function(module,exports,__webpack_require__){(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");(function(){var ERROR="input is invalid type",WINDOW=(typeof window=="undefined"?"undefined":_typeof(window))==="object",root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&(typeof self=="undefined"?"undefined":_typeof(self))==="object",NODE_JS=!root.JS_MD5_NO_NODE_JS&&(typeof process=="undefined"?"undefined":_typeof(process))==="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&_typeof(module)==="object"&&module.exports,AMD=__webpack_require__("./node_modules/webpack/buildin/amd-options.js"),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}(root.JS_MD5_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(g){return Object.prototype.toString.call(g)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(g){return _typeof(g)==="object"&&g.buffer&&g.buffer.constructor===ArrayBuffer});var createOutputMethod=function(y){return function(s,h){return new Md5(!0).update(s,h)[y]()}},createMethod=function(){var y=createOutputMethod("hex");NODE_JS&&(y=nodeWrap(y)),y.getCtx=y.create=function(){return new Md5},y.update=function(R){return y.create().update(R)};for(var s=0;s>6,_[R++]=128|s&63):s<55296||s>=57344?(_[R++]=224|s>>12,_[R++]=128|s>>6&63,_[R++]=128|s&63):(s=65536+((s&1023)<<10|g.charCodeAt(++h)&1023),_[R++]=240|s>>18,_[R++]=128|s>>12&63,_[R++]=128|s>>6&63,_[R++]=128|s&63);else for(R=this.start;h>2]|=s<>2]|=(192|s>>6)<>2]|=(128|s&63)<=57344?(x[R>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|s&63)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|s&63)<=64?(this.start=R-64,this.hash(),this.hashed=!0):this.start=R}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var g=this.blocks,y=this.lastByteIndex;g[y>>2]|=EXTRA[y&3],y>=56&&(this.hashed||this.hash(),g[0]=g[16],g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0),g[14]=this.bytes<<3,g[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var g,y,s,h,R,c,x=this.blocks;this.first?(g=x[0]-680876937,g=(g<<7|g>>>25)-271733879<<0,h=(-1732584194^g&2004318071)+x[1]-117830708,h=(h<<12|h>>>20)+g<<0,s=(-271733879^h&(g^-271733879))+x[2]-1126478375,s=(s<<17|s>>>15)+h<<0,y=(g^s&(h^g))+x[3]-1316259209,y=(y<<22|y>>>10)+s<<0):(g=this.h0,y=this.h1,s=this.h2,h=this.h3,g+=(h^y&(s^h))+x[0]-680876936,g=(g<<7|g>>>25)+y<<0,h+=(s^g&(y^s))+x[1]-389564586,h=(h<<12|h>>>20)+g<<0,s+=(y^h&(g^y))+x[2]+606105819,s=(s<<17|s>>>15)+h<<0,y+=(g^s&(h^g))+x[3]-1044525330,y=(y<<22|y>>>10)+s<<0),g+=(h^y&(s^h))+x[4]-176418897,g=(g<<7|g>>>25)+y<<0,h+=(s^g&(y^s))+x[5]+1200080426,h=(h<<12|h>>>20)+g<<0,s+=(y^h&(g^y))+x[6]-1473231341,s=(s<<17|s>>>15)+h<<0,y+=(g^s&(h^g))+x[7]-45705983,y=(y<<22|y>>>10)+s<<0,g+=(h^y&(s^h))+x[8]+1770035416,g=(g<<7|g>>>25)+y<<0,h+=(s^g&(y^s))+x[9]-1958414417,h=(h<<12|h>>>20)+g<<0,s+=(y^h&(g^y))+x[10]-42063,s=(s<<17|s>>>15)+h<<0,y+=(g^s&(h^g))+x[11]-1990404162,y=(y<<22|y>>>10)+s<<0,g+=(h^y&(s^h))+x[12]+1804603682,g=(g<<7|g>>>25)+y<<0,h+=(s^g&(y^s))+x[13]-40341101,h=(h<<12|h>>>20)+g<<0,s+=(y^h&(g^y))+x[14]-1502002290,s=(s<<17|s>>>15)+h<<0,y+=(g^s&(h^g))+x[15]+1236535329,y=(y<<22|y>>>10)+s<<0,g+=(s^h&(y^s))+x[1]-165796510,g=(g<<5|g>>>27)+y<<0,h+=(y^s&(g^y))+x[6]-1069501632,h=(h<<9|h>>>23)+g<<0,s+=(g^y&(h^g))+x[11]+643717713,s=(s<<14|s>>>18)+h<<0,y+=(h^g&(s^h))+x[0]-373897302,y=(y<<20|y>>>12)+s<<0,g+=(s^h&(y^s))+x[5]-701558691,g=(g<<5|g>>>27)+y<<0,h+=(y^s&(g^y))+x[10]+38016083,h=(h<<9|h>>>23)+g<<0,s+=(g^y&(h^g))+x[15]-660478335,s=(s<<14|s>>>18)+h<<0,y+=(h^g&(s^h))+x[4]-405537848,y=(y<<20|y>>>12)+s<<0,g+=(s^h&(y^s))+x[9]+568446438,g=(g<<5|g>>>27)+y<<0,h+=(y^s&(g^y))+x[14]-1019803690,h=(h<<9|h>>>23)+g<<0,s+=(g^y&(h^g))+x[3]-187363961,s=(s<<14|s>>>18)+h<<0,y+=(h^g&(s^h))+x[8]+1163531501,y=(y<<20|y>>>12)+s<<0,g+=(s^h&(y^s))+x[13]-1444681467,g=(g<<5|g>>>27)+y<<0,h+=(y^s&(g^y))+x[2]-51403784,h=(h<<9|h>>>23)+g<<0,s+=(g^y&(h^g))+x[7]+1735328473,s=(s<<14|s>>>18)+h<<0,y+=(h^g&(s^h))+x[12]-1926607734,y=(y<<20|y>>>12)+s<<0,R=y^s,g+=(R^h)+x[5]-378558,g=(g<<4|g>>>28)+y<<0,h+=(R^g)+x[8]-2022574463,h=(h<<11|h>>>21)+g<<0,c=h^g,s+=(c^y)+x[11]+1839030562,s=(s<<16|s>>>16)+h<<0,y+=(c^s)+x[14]-35309556,y=(y<<23|y>>>9)+s<<0,R=y^s,g+=(R^h)+x[1]-1530992060,g=(g<<4|g>>>28)+y<<0,h+=(R^g)+x[4]+1272893353,h=(h<<11|h>>>21)+g<<0,c=h^g,s+=(c^y)+x[7]-155497632,s=(s<<16|s>>>16)+h<<0,y+=(c^s)+x[10]-1094730640,y=(y<<23|y>>>9)+s<<0,R=y^s,g+=(R^h)+x[13]+681279174,g=(g<<4|g>>>28)+y<<0,h+=(R^g)+x[0]-358537222,h=(h<<11|h>>>21)+g<<0,c=h^g,s+=(c^y)+x[3]-722521979,s=(s<<16|s>>>16)+h<<0,y+=(c^s)+x[6]+76029189,y=(y<<23|y>>>9)+s<<0,R=y^s,g+=(R^h)+x[9]-640364487,g=(g<<4|g>>>28)+y<<0,h+=(R^g)+x[12]-421815835,h=(h<<11|h>>>21)+g<<0,c=h^g,s+=(c^y)+x[15]+530742520,s=(s<<16|s>>>16)+h<<0,y+=(c^s)+x[2]-995338651,y=(y<<23|y>>>9)+s<<0,g+=(s^(y|~h))+x[0]-198630844,g=(g<<6|g>>>26)+y<<0,h+=(y^(g|~s))+x[7]+1126891415,h=(h<<10|h>>>22)+g<<0,s+=(g^(h|~y))+x[14]-1416354905,s=(s<<15|s>>>17)+h<<0,y+=(h^(s|~g))+x[5]-57434055,y=(y<<21|y>>>11)+s<<0,g+=(s^(y|~h))+x[12]+1700485571,g=(g<<6|g>>>26)+y<<0,h+=(y^(g|~s))+x[3]-1894986606,h=(h<<10|h>>>22)+g<<0,s+=(g^(h|~y))+x[10]-1051523,s=(s<<15|s>>>17)+h<<0,y+=(h^(s|~g))+x[1]-2054922799,y=(y<<21|y>>>11)+s<<0,g+=(s^(y|~h))+x[8]+1873313359,g=(g<<6|g>>>26)+y<<0,h+=(y^(g|~s))+x[15]-30611744,h=(h<<10|h>>>22)+g<<0,s+=(g^(h|~y))+x[6]-1560198380,s=(s<<15|s>>>17)+h<<0,y+=(h^(s|~g))+x[13]+1309151649,y=(y<<21|y>>>11)+s<<0,g+=(s^(y|~h))+x[4]-145523070,g=(g<<6|g>>>26)+y<<0,h+=(y^(g|~s))+x[11]-1120210379,h=(h<<10|h>>>22)+g<<0,s+=(g^(h|~y))+x[2]+718787259,s=(s<<15|s>>>17)+h<<0,y+=(h^(s|~g))+x[9]-343485551,y=(y<<21|y>>>11)+s<<0,this.first?(this.h0=g+1732584193<<0,this.h1=y-271733879<<0,this.h2=s-1732584194<<0,this.h3=h+271733878<<0,this.first=!1):(this.h0=this.h0+g<<0,this.h1=this.h1+y<<0,this.h2=this.h2+s<<0,this.h3=this.h3+h<<0)},Md5.prototype.hex=function(){this.finalize();var g=this.h0,y=this.h1,s=this.h2,h=this.h3;return HEX_CHARS[g>>4&15]+HEX_CHARS[g&15]+HEX_CHARS[g>>12&15]+HEX_CHARS[g>>8&15]+HEX_CHARS[g>>20&15]+HEX_CHARS[g>>16&15]+HEX_CHARS[g>>28&15]+HEX_CHARS[g>>24&15]+HEX_CHARS[y>>4&15]+HEX_CHARS[y&15]+HEX_CHARS[y>>12&15]+HEX_CHARS[y>>8&15]+HEX_CHARS[y>>20&15]+HEX_CHARS[y>>16&15]+HEX_CHARS[y>>28&15]+HEX_CHARS[y>>24&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[h&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(g){if(g==="hex")return this.hex();this.finalize();var y=this.h0,s=this.h1,h=this.h2,R=this.h3,c=[y&255,y>>8&255,y>>16&255,y>>24&255,s&255,s>>8&255,s>>16&255,s>>24&255,h&255,h>>8&255,h>>16&255,h>>24&255,R&255,R>>8&255,R>>16&255,R>>24&255];return c},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var g=new ArrayBuffer(16),y=new Uint32Array(g);return y[0]=this.h0,y[1]=this.h1,y[2]=this.h2,y[3]=this.h3,g},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var g,y,s,h="",R=this.array(),c=0;c<15;)g=R[c++],y=R[c++],s=R[c++],h+=BASE64_ENCODE_CHAR[g>>>2]+BASE64_ENCODE_CHAR[(g<<4|y>>>4)&63]+BASE64_ENCODE_CHAR[(y<<2|s>>>6)&63]+BASE64_ENCODE_CHAR[s&63];return g=R[c],h+=BASE64_ENCODE_CHAR[g>>>2]+BASE64_ENCODE_CHAR[g<<4&63]+"==",h};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()}).call(this,__webpack_require__("./node_modules/process/browser.js"),__webpack_require__("./node_modules/webpack/buildin/global.js"),__webpack_require__("./node_modules/webpack/buildin/module.js")(module))},"./lib/request.js":function(g,y,s){var h=s("./node_modules/@babel/runtime/helpers/typeof.js"),R=function(w){switch(h(w)){case"string":return w;case"boolean":return w?"true":"false";case"number":return isFinite(w)?w:"";default:return""}},c=function(w,K,X,V){return K=K||"&",X=X||"=",w===null&&(w=void 0),h(w)==="object"?Object.keys(w).map(function(M){var j=encodeURIComponent(R(M))+X;return Array.isArray(w[M])?w[M].map(function(ne){return j+encodeURIComponent(R(ne))}).join(K):j+encodeURIComponent(R(w[M]))}).filter(Boolean).join(K):V?encodeURIComponent(R(V))+X+encodeURIComponent(R(w)):""},x=function(w,K,X){var V={};return K.getAllResponseHeaders().trim().split(` `).forEach(function(M){if(M){var j=M.indexOf(":"),ne=M.substr(0,j).trim().toLowerCase(),Q=M.substr(j+1).trim();V[ne]=Q}}),{error:w,statusCode:K.status,statusMessage:K.statusText,headers:V,body:X}},_=function(w,K){return!K&&K==="text"?w.responseText:w.response},N=function(w,K){var X=(w.method||"GET").toUpperCase(),V=w.url;if(w.qs){var M=c(w.qs);M&&(V+=(V.indexOf("?")===-1?"?":"&")+M)}var j=new XMLHttpRequest;if(j.open(X,V,!0),j.responseType=w.dataType||"text",w.xhrFields)for(var ne in w.xhrFields)j[ne]=w.xhrFields[ne];var Q=w.headers;if(Q)for(var se in Q)Q.hasOwnProperty(se)&&se.toLowerCase()!=="content-length"&&se.toLowerCase()!=="user-agent"&&se.toLowerCase()!=="origin"&&se.toLowerCase()!=="host"&&j.setRequestHeader(se,Q[se]);return w.onProgress&&j.upload&&(j.upload.onprogress=w.onProgress),w.onDownloadProgress&&(j.onprogress=w.onDownloadProgress),w.timeout&&(j.timeout=w.timeout),j.ontimeout=function(B){var S=new Error("timeout");K(x(S,j))},j.onload=function(){K(x(null,j,_(j,w.dataType)))},j.onerror=function(B){var S=_(j,w.dataType);if(S)K(x(null,j,S));else{var v=j.statusText;!v&&j.status===0&&(v=new Error("CORS blocked or network error")),K(x(v,j,S))}},j.send(w.body||""),j};g.exports=N},"./lib/xml2json.js":function(g,y,s){var h=s("./node_modules/@xmldom/xmldom/lib/index.js").DOMParser,R=function(){this.version="1.3.5";var x={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},_=new RegExp(/(?!xmlns)^.*:/);return this.grokType=function(N){return/^\s*$/.test(N)?null:/^(?:true|false)$/i.test(N)?N.toLowerCase()==="true":isFinite(N)?parseFloat(N):N},this.parseString=function(N,I){if(N){var w=this.stringToXML(N);return w.getElementsByTagName("parsererror").length?null:this.parseXML(w,I)}else return null},this.parseXML=function(N,I){for(var w in I)x[w]=I[w];var K={},X=0,V="",M=N.childNodes.length;if(M)for(var j,ne,Q,se=0;se=S+v||S?new java.lang.String(B,S,v)+"":B}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(B){M.prototype[B]=function(){return null}});function se(B,S){B.currentElement?B.currentElement.appendChild(S):B.doc.appendChild(S)}y.__DOMHandler=M,y.normalizeLineEndings=K,y.DOMParser=X},"./node_modules/@xmldom/xmldom/lib/dom.js":function(g,y,s){var h=s("./node_modules/@xmldom/xmldom/lib/conventions.js"),R=h.find,c=h.NAMESPACE;function x(i){return i!==""}function _(i){return i?i.split(/[\t\n\f\r ]+/).filter(x):[]}function N(i,l){return i.hasOwnProperty(l)||(i[l]=!0),i}function I(i){if(!i)return[];var l=_(i);return Object.keys(l.reduce(N,{}))}function w(i){return function(l){return i&&i.indexOf(l)!==-1}}function K(i,l){for(var k in i)Object.prototype.hasOwnProperty.call(i,k)&&(l[k]=i[k])}function X(i,l){var k=i.prototype;if(!(k instanceof l)){let D=function(){};D.prototype=l.prototype,D=new D,K(k,D),i.prototype=k=D}k.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),k.constructor=i)}var V={},M=V.ELEMENT_NODE=1,j=V.ATTRIBUTE_NODE=2,ne=V.TEXT_NODE=3,Q=V.CDATA_SECTION_NODE=4,se=V.ENTITY_REFERENCE_NODE=5,B=V.ENTITY_NODE=6,S=V.PROCESSING_INSTRUCTION_NODE=7,v=V.COMMENT_NODE=8,W=V.DOCUMENT_NODE=9,p=V.DOCUMENT_TYPE_NODE=10,L=V.DOCUMENT_FRAGMENT_NODE=11,H=V.NOTATION_NODE=12,P={},F={};P.INDEX_SIZE_ERR=(F[1]="Index size error",1),P.DOMSTRING_SIZE_ERR=(F[2]="DOMString size error",2);var b=P.HIERARCHY_REQUEST_ERR=(F[3]="Hierarchy request error",3);P.WRONG_DOCUMENT_ERR=(F[4]="Wrong document",4),P.INVALID_CHARACTER_ERR=(F[5]="Invalid character",5),P.NO_DATA_ALLOWED_ERR=(F[6]="No data allowed",6),P.NO_MODIFICATION_ALLOWED_ERR=(F[7]="No modification allowed",7);var U=P.NOT_FOUND_ERR=(F[8]="Not found",8);P.NOT_SUPPORTED_ERR=(F[9]="Not supported",9);var z=P.INUSE_ATTRIBUTE_ERR=(F[10]="Attribute in use",10);P.INVALID_STATE_ERR=(F[11]="Invalid state",11),P.SYNTAX_ERR=(F[12]="Syntax error",12),P.INVALID_MODIFICATION_ERR=(F[13]="Invalid modification",13),P.NAMESPACE_ERR=(F[14]="Invalid namespace",14),P.INVALID_ACCESS_ERR=(F[15]="Invalid access",15);function q(i,l){if(l instanceof Error)var k=l;else k=this,Error.call(this,F[i]),this.message=F[i],Error.captureStackTrace&&Error.captureStackTrace(this,q);return k.code=i,l&&(this.message=this.message+": "+l),k}q.prototype=Error.prototype,K(P,q);function $(){}$.prototype={length:0,item:function(i){return this[i]||null},toString:function(i,l){for(var k=[],D=0;D=0){for(var fe=l.length-1;D0},lookupPrefix:function(i){for(var l=this;l;){var k=l._nsMap;if(k){for(var D in k)if(Object.prototype.hasOwnProperty.call(k,D)&&k[D]===i)return D}l=l.nodeType==j?l.ownerDocument:l.parentNode}return null},lookupNamespaceURI:function(i){for(var l=this;l;){var k=l._nsMap;if(k&&Object.prototype.hasOwnProperty.call(k,i))return k[i];l=l.nodeType==j?l.ownerDocument:l.parentNode}return null},isDefaultNamespace:function(i){var l=this.lookupPrefix(i);return l==null}};function te(i){return i=="<"&&"<"||i==">"&&">"||i=="&"&&"&"||i=='"'&&"""||"&#"+i.charCodeAt()+";"}K(V,Y),K(V,Y.prototype);function pe(i,l){if(l(i))return!0;if(i=i.firstChild)do if(pe(i,l))return!0;while(i=i.nextSibling)}function me(){this.ownerDocument=this}function ge(i,l,k){i&&i._inc++;var D=k.namespaceURI;D===c.XMLNS&&(l._nsMap[k.prefix?k.localName:""]=k.value)}function ve(i,l,k,D){i&&i._inc++;var fe=k.namespaceURI;fe===c.XMLNS&&delete l._nsMap[k.prefix?k.localName:""]}function Ce(i,l,k){if(i&&i._inc){i._inc++;var D=l.childNodes;if(k)D[D.length++]=k;else{for(var fe=l.firstChild,be=0;fe;)D[be++]=fe,fe=fe.nextSibling;D.length=be,delete D[D.length]}}}function Te(i,l){var k=l.previousSibling,D=l.nextSibling;return k?k.nextSibling=D:i.firstChild=D,D?D.previousSibling=k:i.lastChild=k,l.parentNode=null,l.previousSibling=null,l.nextSibling=null,Ce(i.ownerDocument,i),l}function Ee(i){return i&&(i.nodeType===Y.DOCUMENT_NODE||i.nodeType===Y.DOCUMENT_FRAGMENT_NODE||i.nodeType===Y.ELEMENT_NODE)}function we(i){return i&&(Pe(i)||je(i)||Ae(i)||i.nodeType===Y.DOCUMENT_FRAGMENT_NODE||i.nodeType===Y.COMMENT_NODE||i.nodeType===Y.PROCESSING_INSTRUCTION_NODE)}function Ae(i){return i&&i.nodeType===Y.DOCUMENT_TYPE_NODE}function Pe(i){return i&&i.nodeType===Y.ELEMENT_NODE}function je(i){return i&&i.nodeType===Y.TEXT_NODE}function Ue(i,l){var k=i.childNodes||[];if(R(k,Pe)||Ae(l))return!1;var D=R(k,Ae);return!(l&&D&&k.indexOf(D)>k.indexOf(l))}function oe(i,l){var k=i.childNodes||[];function D(be){return Pe(be)&&be!==l}if(R(k,D))return!1;var fe=R(k,Ae);return!(l&&fe&&k.indexOf(fe)>k.indexOf(l))}function a(i,l,k){if(!Ee(i))throw new q(b,"Unexpected parent node type "+i.nodeType);if(k&&k.parentNode!==i)throw new q(U,"child not in parent");if(!we(l)||Ae(l)&&i.nodeType!==Y.DOCUMENT_NODE)throw new q(b,"Unexpected node type "+l.nodeType+" for parent node type "+i.nodeType)}function r(i,l,k){var D=i.childNodes||[],fe=l.childNodes||[];if(l.nodeType===Y.DOCUMENT_FRAGMENT_NODE){var be=fe.filter(Pe);if(be.length>1||R(fe,je))throw new q(b,"More than one element or text in fragment");if(be.length===1&&!Ue(i,k))throw new q(b,"Element in fragment can not be inserted before doctype")}if(Pe(l)&&!Ue(i,k))throw new q(b,"Only one element can be added and only after doctype");if(Ae(l)){if(R(D,Ae))throw new q(b,"Only one doctype is allowed");var Ne=R(D,Pe);if(k&&D.indexOf(Ne)1||R(fe,je))throw new q(b,"More than one element or text in fragment");if(be.length===1&&!oe(i,k))throw new q(b,"Element in fragment can not be inserted before doctype")}if(Pe(l)&&!oe(i,k))throw new q(b,"Only one element can be added and only after doctype");if(Ae(l)){if(R(D,function(Qe){return Ae(Qe)&&Qe!==k}))throw new q(b,"Only one doctype is allowed");var Ne=R(D,Pe);if(k&&D.indexOf(Ne)0&&pe(k.documentElement,function(fe){if(fe!==k&&fe.nodeType===M){var be=fe.getAttribute("class");if(be){var Ne=i===be;if(!Ne){var ue=I(be);Ne=l.every(w(ue))}Ne&&D.push(fe)}}}),D})},createElement:function(i){var l=new E;l.ownerDocument=this,l.nodeName=i,l.tagName=i,l.localName=i,l.childNodes=new $;var k=l.attributes=new ie;return k._ownerElement=l,l},createDocumentFragment:function(){var i=new Fe;return i.ownerDocument=this,i.childNodes=new $,i},createTextNode:function(i){var l=new de;return l.ownerDocument=this,l.appendData(i),l},createComment:function(i){var l=new he;return l.ownerDocument=this,l.appendData(i),l},createCDATASection:function(i){var l=new J;return l.ownerDocument=this,l.appendData(i),l},createProcessingInstruction:function(i,l){var k=new qe;return k.ownerDocument=this,k.tagName=k.target=i,k.nodeValue=k.data=l,k},createAttribute:function(i){var l=new A;return l.ownerDocument=this,l.name=i,l.nodeName=i,l.localName=i,l.specified=!0,l},createEntityReference:function(i){var l=new Be;return l.ownerDocument=this,l.nodeName=i,l},createElementNS:function(i,l){var k=new E,D=l.split(":"),fe=k.attributes=new ie;return k.childNodes=new $,k.ownerDocument=this,k.nodeName=l,k.tagName=l,k.namespaceURI=i,D.length==2?(k.prefix=D[0],k.localName=D[1]):k.localName=l,fe._ownerElement=k,k},createAttributeNS:function(i,l){var k=new A,D=l.split(":");return k.ownerDocument=this,k.nodeName=l,k.name=l,k.namespaceURI=i,k.specified=!0,D.length==2?(k.prefix=D[0],k.localName=D[1]):k.localName=l,k}},X(me,Y);function E(){this._nsMap={}}E.prototype={nodeType:M,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var l=this.getAttributeNode(i);return l&&l.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,l){var k=this.ownerDocument.createAttribute(i);k.value=k.nodeValue=""+l,this.setAttributeNode(k)},removeAttribute:function(i){var l=this.getAttributeNode(i);l&&this.removeAttributeNode(l)},appendChild:function(i){return i.nodeType===L?this.insertBefore(i,null):f(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,l){var k=this.getAttributeNodeNS(i,l);k&&this.removeAttributeNode(k)},hasAttributeNS:function(i,l){return this.getAttributeNodeNS(i,l)!=null},getAttributeNS:function(i,l){var k=this.getAttributeNodeNS(i,l);return k&&k.value||""},setAttributeNS:function(i,l,k){var D=this.ownerDocument.createAttributeNS(i,l);D.value=D.nodeValue=""+k,this.setAttributeNode(D)},getAttributeNodeNS:function(i,l){return this.attributes.getNamedItemNS(i,l)},getElementsByTagName:function(i){return new re(this,function(l){var k=[];return pe(l,function(D){D!==l&&D.nodeType==M&&(i==="*"||D.tagName==i)&&k.push(D)}),k})},getElementsByTagNameNS:function(i,l){return new re(this,function(k){var D=[];return pe(k,function(fe){fe!==k&&fe.nodeType===M&&(i==="*"||fe.namespaceURI===i)&&(l==="*"||fe.localName==l)&&D.push(fe)}),D})}},me.prototype.getElementsByTagName=E.prototype.getElementsByTagName,me.prototype.getElementsByTagNameNS=E.prototype.getElementsByTagNameNS,X(E,Y);function A(){}A.prototype.nodeType=j,X(A,Y);function G(){}G.prototype={data:"",substringData:function(i,l){return this.data.substring(i,i+l)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,l){this.replaceData(i,0,l)},appendChild:function(i){throw new Error(F[b])},deleteData:function(i,l){this.replaceData(i,l,"")},replaceData:function(i,l,k){var D=this.data.substring(0,i),fe=this.data.substring(i+l);k=D+k+fe,this.nodeValue=this.data=k,this.length=k.length}},X(G,Y);function de(){}de.prototype={nodeName:"#text",nodeType:ne,splitText:function(i){var l=this.data,k=l.substring(i);l=l.substring(0,i),this.data=this.nodeValue=l,this.length=l.length;var D=this.ownerDocument.createTextNode(k);return this.parentNode&&this.parentNode.insertBefore(D,this.nextSibling),D}},X(de,G);function he(){}he.prototype={nodeName:"#comment",nodeType:v},X(he,G);function J(){}J.prototype={nodeName:"#cdata-section",nodeType:Q},X(J,G);function ke(){}ke.prototype.nodeType=p,X(ke,Y);function De(){}De.prototype.nodeType=H,X(De,Y);function Me(){}Me.prototype.nodeType=B,X(Me,Y);function Be(){}Be.prototype.nodeType=se,X(Be,Y);function Fe(){}Fe.prototype.nodeName="#document-fragment",Fe.prototype.nodeType=L,X(Fe,Y);function qe(){}qe.prototype.nodeType=S,X(qe,Y);function Ve(){}Ve.prototype.serializeToString=function(i,l,k){return We.call(i,l,k)},Y.prototype.toString=We;function We(i,l){var k=[],D=this.nodeType==9&&this.documentElement||this,fe=D.prefix,be=D.namespaceURI;if(be&&fe==null){var fe=D.lookupPrefix(be);if(fe==null)var Ne=[{namespace:be,prefix:null}]}return Xe(this,k,i,l,Ne),k.join("")}function ze(i,l,k){var D=i.prefix||"",fe=i.namespaceURI;if(!fe||D==="xml"&&fe===c.XML||fe===c.XMLNS)return!1;for(var be=k.length;be--;){var Ne=k[be];if(Ne.prefix===D)return Ne.namespace!==fe}return!0}function Ge(i,l,k){i.push(" ",l,'="',k.replace(/[<>&"\t\n\r]/g,te),'"')}function Xe(i,l,k,D,fe){if(fe||(fe=[]),D)if(i=D(i),i){if(typeof i=="string"){l.push(i);return}}else return;switch(i.nodeType){case M:var be=i.attributes,Ne=be.length,T=i.firstChild,ue=i.tagName;k=c.isHTML(i.namespaceURI)||k;var Qe=ue;if(!k&&!i.prefix&&i.namespaceURI){for(var Je,$e=0;$e=0;e--){var d=fe[e];if(d.prefix===""&&d.namespace===i.namespaceURI){Je=d.namespace;break}}if(Je!==i.namespaceURI)for(var e=fe.length-1;e>=0;e--){var d=fe[e];if(d.namespace===i.namespaceURI){d.prefix&&(Qe=d.prefix+":"+ue);break}}}l.push("<",Qe);for(var t=0;t"),k&&/^script$/i.test(ue))for(;T;)T.data?l.push(T.data):Xe(T,l,k,D,fe.slice()),T=T.nextSibling;else for(;T;)Xe(T,l,k,D,fe.slice()),T=T.nextSibling;l.push("")}else l.push("/>");return;case W:case L:for(var T=i.firstChild;T;)Xe(T,l,k,D,fe.slice()),T=T.nextSibling;return;case j:return Ge(l,i.name,i.value);case ne:return l.push(i.data.replace(/[<&>]/g,te));case Q:return l.push("");case v:return l.push("");case p:var O=i.publicId,Z=i.systemId;if(l.push("");else if(Z&&Z!=".")l.push(" SYSTEM ",Z,">");else{var Oe=i.internalSubset;Oe&&l.push(" [",Oe,"]"),l.push(">")}return;case S:return l.push("");case se:return l.push("&",i.nodeName,";");default:l.push("??",i.nodeName)}}function nt(i,l,k){var D;switch(l.nodeType){case M:D=l.cloneNode(!1),D.ownerDocument=i;case L:break;case j:k=!0;break}if(D||(D=l.cloneNode(!1)),D.ownerDocument=i,D.parentNode=null,k)for(var fe=l.firstChild;fe;)D.appendChild(nt(i,fe,k)),fe=fe.nextSibling;return D}function et(i,l,k){var D=new l.constructor;for(var fe in l)if(Object.prototype.hasOwnProperty.call(l,fe)){var be=l[fe];typeof be!="object"&&be!=D[fe]&&(D[fe]=be)}switch(l.childNodes&&(D.childNodes=new $),D.ownerDocument=i,D.nodeType){case M:var Ne=l.attributes,ue=D.attributes=new ie,Qe=Ne.length;ue._ownerElement=D;for(var Je=0;Je",lt:"<",quot:'"'}),y.HTML_ENTITIES=h({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",times:"\xD7",divide:"\xF7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",euro:"\u20AC",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}),y.entityMap=y.HTML_ENTITIES},"./node_modules/@xmldom/xmldom/lib/index.js":function(g,y,s){var h=s("./node_modules/@xmldom/xmldom/lib/dom.js");y.DOMImplementation=h.DOMImplementation,y.XMLSerializer=h.XMLSerializer,y.DOMParser=s("./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser},"./node_modules/@xmldom/xmldom/lib/sax.js":function(g,y,s){var h=s("./node_modules/@xmldom/xmldom/lib/conventions.js").NAMESPACE,R=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,c=new RegExp("[\\-\\.0-9"+R.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),x=new RegExp("^"+R.source+c.source+"*(?::"+R.source+c.source+"*)?$"),_=0,N=1,I=2,w=3,K=4,X=5,V=6,M=7;function j(b,U){this.message=b,this.locator=U,Error.captureStackTrace&&Error.captureStackTrace(this,j)}j.prototype=new Error,j.prototype.name=j.name;function ne(){}ne.prototype={parse:function(b,U,z){var q=this.domBuilder;q.startDocument(),p(U,U={}),Q(b,U,z,q,this.errorHandler),q.endDocument()}};function Q(b,U,z,q,$){function re(E){if(E>65535){E-=65536;var A=55296+(E>>10),G=56320+(E&1023);return String.fromCharCode(A,G)}else return String.fromCharCode(E)}function ce(E){var A=E.slice(1,-1);return Object.hasOwnProperty.call(z,A)?z[A]:A.charAt(0)==="#"?re(parseInt(A.substr(1).replace("x","0x"))):($.error("entity not found:"+E),E)}function ie(E){if(E>me){var A=b.substring(me,E).replace(/&#?\w+;/g,ce);Y&&ee(me),q.characters(A,0,E-me),me=E}}function ee(E,A){for(;E>=ae&&(A=ye.exec(b));)le=A.index,ae=le+A[0].length,Y.lineNumber++;Y.columnNumber=E-le+1}for(var le=0,ae=0,ye=/.*(?:\r\n?|\n)|.*$/g,Y=q.locator,te=[{currentNSMap:U}],pe={},me=0;;){try{var ge=b.indexOf("<",me);if(ge<0){if(!b.substr(me).match(/^\s*$/)){var ve=q.doc,Ce=ve.createTextNode(b.substr(me));ve.appendChild(Ce),q.currentElement=Ce}return}switch(ge>me&&ie(ge),b.charAt(ge+1)){case"/":var a=b.indexOf(">",ge+3),Te=b.substring(ge+2,a).replace(/[ \t\n\r]+$/g,""),Ee=te.pop();a<0?(Te=b.substring(ge+2).replace(/[\s<].*/,""),$.error("end tag name: "+Te+" is not complete:"+Ee.tagName),a=ge+1+Te.length):Te.match(/\sme?me=a:ie(Math.max(ge,me)+1)}}function se(b,U){return U.lineNumber=b.lineNumber,U.columnNumber=b.columnNumber,U}function B(b,U,z,q,$,re){function ce(Y,te,pe){z.attributeNames.hasOwnProperty(Y)&&re.fatalError("Attribute "+Y+" redefined"),z.addValue(Y,te.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,$),pe)}for(var ie,ee,le=++U,ae=_;;){var ye=b.charAt(le);switch(ye){case"=":if(ae===N)ie=b.slice(U,le),ae=w;else if(ae===I)ae=w;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ae===w||ae===N)if(ae===N&&(re.warning('attribute value must after "="'),ie=b.slice(U,le)),U=le+1,le=b.indexOf(ye,U),le>0)ee=b.slice(U,le),ce(ie,ee,U-1),ae=X;else throw new Error("attribute value no end '"+ye+"' match");else if(ae==K)ee=b.slice(U,le),ce(ie,ee,U),re.warning('attribute "'+ie+'" missed start quot('+ye+")!!"),U=le+1,ae=X;else throw new Error('attribute value must after "="');break;case"/":switch(ae){case _:z.setTagName(b.slice(U,le));case X:case V:case M:ae=M,z.closed=!0;case K:case N:case I:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return re.error("unexpected end of input"),ae==_&&z.setTagName(b.slice(U,le)),le;case">":switch(ae){case _:z.setTagName(b.slice(U,le));case X:case V:case M:break;case K:case N:ee=b.slice(U,le),ee.slice(-1)==="/"&&(z.closed=!0,ee=ee.slice(0,-1));case I:ae===I&&(ee=ie),ae==K?(re.warning('attribute "'+ee+'" missed quot(")!'),ce(ie,ee,U)):((!h.isHTML(q[""])||!ee.match(/^(?:disabled|checked|selected)$/i))&&re.warning('attribute "'+ee+'" missed value!! "'+ee+'" instead!!'),ce(ee,ee,U));break;case w:throw new Error("attribute value missed!!")}return le;case"\x80":ye=" ";default:if(ye<=" ")switch(ae){case _:z.setTagName(b.slice(U,le)),ae=V;break;case N:ie=b.slice(U,le),ae=I;break;case K:var ee=b.slice(U,le);re.warning('attribute "'+ee+'" missed quot(")!!'),ce(ie,ee,U);case X:ae=V;break}else switch(ae){case I:z.tagName,(!h.isHTML(q[""])||!ie.match(/^(?:disabled|checked|selected)$/i))&&re.warning('attribute "'+ie+'" missed value!! "'+ie+'" instead2!!'),ce(ie,ie,U),U=le,ae=N;break;case X:re.warning('attribute space is required"'+ie+'"!!');case V:ae=N,U=le;break;case w:ae=K,U=le;break;case M:throw new Error("elements closed character '/' and '>' must be connected to")}}le++}}function S(b,U,z){for(var q=b.tagName,$=null,ye=b.length;ye--;){var re=b[ye],ce=re.qName,ie=re.value,Y=ce.indexOf(":");if(Y>0)var ee=re.prefix=ce.slice(0,Y),le=ce.slice(Y+1),ae=ee==="xmlns"&≤else le=ce,ee=null,ae=ce==="xmlns"&&"";re.localName=le,ae!==!1&&($==null&&($={},p(z,z={})),z[ae]=$[ae]=ie,re.uri=h.XMLNS,U.startPrefixMapping(ae,ie))}for(var ye=b.length;ye--;){re=b[ye];var ee=re.prefix;ee&&(ee==="xml"&&(re.uri=h.XML),ee!=="xmlns"&&(re.uri=z[ee||""]))}var Y=q.indexOf(":");Y>0?(ee=b.prefix=q.slice(0,Y),le=b.localName=q.slice(Y+1)):(ee=null,le=b.localName=q);var te=b.uri=z[ee||""];if(U.startElement(te,le,q,b),b.closed){if(U.endElement(te,le,q),$)for(ee in $)Object.prototype.hasOwnProperty.call($,ee)&&U.endPrefixMapping(ee)}else return b.currentNSMap=z,b.localNSMap=$,!0}function v(b,U,z,q,$){if(/^(?:script|textarea)$/i.test(z)){var re=b.indexOf("",U),ce=b.substring(U+1,re);if(/[&<]/.test(ce))return/^script$/i.test(z)?($.characters(ce,0,ce.length),re):(ce=ce.replace(/&#?\w+;/g,q),$.characters(ce,0,ce.length),re)}return U+1}function W(b,U,z,q){var $=q[z];return $==null&&($=b.lastIndexOf(""),$",U+4);return re>U?(z.comment(b,U+4,re-U-4),re+3):(q.error("Unclosed comment"),-1)}else return-1;default:if(b.substr(U+3,6)=="CDATA["){var re=b.indexOf("]]>",U+9);return z.startCDATA(),z.characters(b,U+9,re-U-9),z.endCDATA(),re+3}var ce=F(b,U),ie=ce.length;if(ie>1&&/!doctype/i.test(ce[0][0])){var ee=ce[1][0],le=!1,ae=!1;ie>3&&(/^public$/i.test(ce[2][0])?(le=ce[3][0],ae=ie>4&&ce[4][0]):/^system$/i.test(ce[2][0])&&(ae=ce[3][0]));var ye=ce[ie-1];return z.startDTD(ee,le,ae),z.endDTD(),ye.index+ye[0].length}}return-1}function H(b,U,z){var q=b.indexOf("?>",U);if(q){var $=b.substring(U,q).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return $?($[0].length,z.processingInstruction($[1],$[2]),q+2):-1}return-1}function P(){this.attributeNames={}}P.prototype={setTagName:function(b){if(!x.test(b))throw new Error("invalid tagName:"+b);this.tagName=b},addValue:function(b,U,z){if(!x.test(b))throw new Error("invalid attribute:"+b);this.attributeNames[b]=this.length,this[this.length++]={qName:b,value:U,offset:z}},length:0,getLocalName:function(b){return this[b].localName},getLocator:function(b){return this[b].locator},getQName:function(b){return this[b].qName},getURI:function(b){return this[b].uri},getValue:function(b){return this[b].value}};function F(b,U){var z,q=[],$=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for($.lastIndex=U,$.exec(b);z=$.exec(b);)if(q.push(z),z[1])return q}y.XMLReader=ne,y.ParseError=j},"./node_modules/process/browser.js":function(g,y){var s=g.exports={},h,R;function c(){throw new Error("setTimeout has not been defined")}function x(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?h=setTimeout:h=c}catch(Q){h=c}try{typeof clearTimeout=="function"?R=clearTimeout:R=x}catch(Q){R=x}})();function _(Q){if(h===setTimeout)return setTimeout(Q,0);if((h===c||!h)&&setTimeout)return h=setTimeout,setTimeout(Q,0);try{return h(Q,0)}catch(se){try{return h.call(null,Q,0)}catch(B){return h.call(this,Q,0)}}}function N(Q){if(R===clearTimeout)return clearTimeout(Q);if((R===x||!R)&&clearTimeout)return R=clearTimeout,clearTimeout(Q);try{return R(Q)}catch(se){try{return R.call(null,Q)}catch(B){return R.call(this,Q)}}}var I=[],w=!1,K,X=-1;function V(){!w||!K||(w=!1,K.length?I=K.concat(I):X=-1,I.length&&M())}function M(){if(!w){var Q=_(V);w=!0;for(var se=I.length;se;){for(K=I,I=[];++X1)for(var B=1;Bce)return pe(null,!1);if(me>1){var ge=Math.max(te[0].Size,te[1].Size);if(ge!==re)return pe(null,!1)}var ve=function Ce(Te){if(Te=pe.length){ye.emit("has_and_check_upload_id",Y);return}var Ce=pe[ve];if(!_.isInArray(Y,Ce)){R.removeUploadId.call(z,Ce),ge(ve+1);return}if(R.using[Ce]){ge(ve+1);return}X.call(z,{Bucket:P,Region:F,Key:b,UploadId:Ce,tracker:p.tracker},function(Te,Ee){!z._isRunningTask(H)||(Te?(R.removeUploadId.call(z,Ce),ge(ve+1)):ye.emit("upload_id_available",{UploadId:Ce,PartList:Ee.PartList}))})};me(0)}),ye.on("get_remote_upload_id_list",function(){K.call(z,{Bucket:P,Region:F,Key:b,tracker:p.tracker},function(Y,te){if(!!z._isRunningTask(H)){if(Y)return ye.emit("error",Y);var pe=_.filter(te.UploadList,function(ve){return ve.Key===b&&(!U||ve.StorageClass.toUpperCase()===U.toUpperCase())}).reverse().map(function(ve){return ve.UploadId||ve.UploadID});if(pe.length)ye.emit("seek_local_avail_upload_id",pe);else{var me=R.getFileId(p.Body,p.ChunkSize,P,b),ge;me&&(ge=R.getUploadIdList.call(z,me))&&_.each(ge,function(ve){R.removeUploadId.call(z,ve)}),ye.emit("no_available_upload_id")}}})}),ye.emit("get_remote_upload_id_list")}function K(p,L){var H=this,P=[],F={Bucket:p.Bucket,Region:p.Region,Prefix:p.Key,calledBySdk:p.calledBySdk||"sliceUploadFile",tracker:p.tracker},b=function U(){H.multipartList(F,function(z,q){if(z)return L(z);P.push.apply(P,q.Upload||[]),q.IsTruncated==="true"?(F.KeyMarker=q.NextKeyMarker,F.UploadIdMarker=q.NextUploadIdMarker,U()):L(null,{UploadList:P})})};b()}function X(p,L){var H=this,P=[],F={Bucket:p.Bucket,Region:p.Region,Key:p.Key,UploadId:p.UploadId,calledBySdk:"sliceUploadFile",tracker:p.tracker},b=function U(){H.multipartListPart(F,function(z,q){if(z)return L(z);P.push.apply(P,q.Part||[]),q.IsTruncated==="true"?(F.PartNumberMarker=q.NextPartNumberMarker,U()):L(null,{PartList:P})})};b()}function V(p,L){var H=this,P=p.TaskId,F=p.Bucket,b=p.Region,U=p.Key,z=p.UploadData,q=p.FileSize,$=p.SliceSize,re=Math.min(p.AsyncLimit||H.options.ChunkParallelLimit||1,256),ce=p.Body,ie=Math.ceil(q/$),ee=0,le=p.ServerSideEncryption,ae=p.Headers,ye=_.filter(z.PartList,function(te){return te.Uploaded&&(ee+=te.PartNumber>=ie&&q%$||$),!te.Uploaded}),Y=p.onProgress;c.eachLimit(ye,re,function(te,pe){if(!!H._isRunningTask(P)){var me=te.PartNumber,ge=Math.min(q,te.PartNumber*$)-(te.PartNumber-1)*$,ve=0;M.call(H,{TaskId:P,Bucket:F,Region:b,Key:U,SliceSize:$,FileSize:q,PartNumber:me,ServerSideEncryption:le,Body:ce,UploadData:z,Headers:ae,onProgress:function(Te){ee+=Te.loaded-ve,ve=Te.loaded,Y({loaded:ee,total:q})},tracker:p.tracker},function(Ce,Te){!H._isRunningTask(P)||(!Ce&&!Te.ETag&&(Ce='get ETag error, please add "ETag" to CORS ExposeHeader setting.( \u83B7\u53D6ETag\u5931\u8D25\uFF0C\u8BF7\u5728CORS ExposeHeader\u8BBE\u7F6E\u4E2D\u6DFB\u52A0ETag\uFF0C\u8BF7\u53C2\u8003\u6587\u6863\uFF1Ahttps://cloud.tencent.com/document/product/436/13318 )'),Ce?ee-=ve:(ee+=ge-ve,te.ETag=Te.ETag),Y({loaded:ee,total:q}),pe(Ce||null,Te))})}},function(te){if(!!H._isRunningTask(P)){if(te)return L(te);L(null,{UploadId:z.UploadId,SliceList:z.PartList})}})}function M(p,L){var H=this,P=p.TaskId,F=p.Bucket,b=p.Region,U=p.Key,z=p.FileSize,q=p.Body,$=p.PartNumber*1,re=p.SliceSize,ce=p.ServerSideEncryption,ie=p.UploadData,ee=p.Headers||{},le=H.options.ChunkRetryTimes+1,ae=re*($-1),ye=re,Y=ae+re;Y>z&&(Y=z,ye=Y-ae);var te=["x-cos-traffic-limit","x-cos-mime-limit"],pe={};_.each(ee,function(ge,ve){te.indexOf(ve)>-1&&(pe[ve]=ge)});var me=ie.PartList[$-1];c.retry(le,function(ge){!H._isRunningTask(P)||_.fileSlice(q,ae,Y,!0,function(ve){H.multipartUpload({TaskId:P,Bucket:F,Region:b,Key:U,ContentLength:ye,PartNumber:$,UploadId:ie.UploadId,ServerSideEncryption:ce,Body:ve,Headers:pe,onProgress:p.onProgress,calledBySdk:"sliceUploadFile",tracker:p.tracker},function(Ce,Te){if(!!H._isRunningTask(P))return Ce?ge(Ce):(me.Uploaded=!0,ge(null,Te))})})},function(ge,ve){if(!!H._isRunningTask(P))return L(ge,ve)})}function j(p,L){var H=p.Bucket,P=p.Region,F=p.Key,b=p.UploadId,U=p.SliceList,z=this,q=this.options.ChunkRetryTimes+1,$=p.Headers,re=U.map(function(ce){return{PartNumber:ce.PartNumber,ETag:ce.ETag}});c.retry(q,function(ce){z.multipartComplete({Bucket:H,Region:P,Key:F,UploadId:b,Parts:re,Headers:$,calledBySdk:"sliceUploadFile",tracker:p.tracker},ce)},function(ce,ie){L(ce,ie)})}function ne(p,L){var H=p.Bucket,P=p.Region,F=p.Key,b=p.UploadId,U=p.Level||"task",z=p.AsyncLimit,q=this,$=new x;if($.on("error",function(re){return L(re)}),$.on("get_abort_array",function(re){Q.call(q,{Bucket:H,Region:P,Key:F,Headers:p.Headers,AsyncLimit:z,AbortArray:re},L)}),U==="bucket")K.call(q,{Bucket:H,Region:P,calledBySdk:"abortUploadTask"},function(re,ce){if(re)return L(re);$.emit("get_abort_array",ce.UploadList||[])});else if(U==="file"){if(!F)return L(_.error(new Error("abort_upload_task_no_key")));K.call(q,{Bucket:H,Region:P,Key:F,calledBySdk:"abortUploadTask"},function(re,ce){if(re)return L(re);$.emit("get_abort_array",ce.UploadList||[])})}else if(U==="task"){if(!b)return L(_.error(new Error("abort_upload_task_no_id")));if(!F)return L(_.error(new Error("abort_upload_task_no_key")));$.emit("get_abort_array",[{Key:F,UploadId:b}])}else return L(_.error(new Error("abort_unknown_level")))}function Q(p,L){var H=p.Bucket,P=p.Region,F=p.Key,b=p.AbortArray,U=p.AsyncLimit||1,z=this,q=0,$=new Array(b.length);c.eachLimit(b,U,function(re,ce){var ie=q;if(F&&F!==re.Key){$[ie]={error:{KeyNotMatch:!0}},ce(null);return}var ee=re.UploadId||re.UploadID;z.multipartAbort({Bucket:H,Region:P,Key:re.Key,Headers:p.Headers,UploadId:ee},function(le){var ae={Bucket:H,Region:P,Key:re.Key,UploadId:ee};$[ie]={error:le,task:ae},ce(null)}),q++},function(re){if(re)return L(re);for(var ce=[],ie=[],ee=0,le=$.length;eeP?"sliceUploadFile":"putObject",ie=p.onFileFinish,ee=function(ae,ye){p.tracker&&p.tracker.formatResult(ae,ye),ie&&ie(ae,ye,z),L&&L(ae,ye)};F.push({api:ce,params:p,callback:ee}),H._addTasks(F)}function B(p,L){var H=this,P=p.SliceSize===void 0?H.options.SliceSize:p.SliceSize,F=0,b=0,U=_.throttleOnProgress.call(H,b,p.onProgress),z=p.files.length,q=p.onFileFinish,$=Array(z),re=function(ee,le,ae){U(null,!0),q&&q(ee,le,ae),$[ae.Index]={options:ae,error:ee,data:le},--z<=0&&L&&L(null,{files:$})},ce=[];_.each(p.files,function(ie,ee){(function(){var le=ie.Body,ae=le.size||le.length||0,ye={Index:ee,TaskId:""};if(!H.options.UseRawKey&&ie.Key&&ie.Key.substr(0,1)==="/"&&(ie.Key=ie.Key.substr(1)),F+=ae,H.options.EnableTracker){var Y=H.options.UseAccelerate||typeof H.options.Domain=="string"&&H.options.Domain.includes("accelerate.");ie.tracker=new N({bucket:ie.Bucket,region:ie.Region,apiName:"uploadFiles",fileKey:ie.Key,fileSize:ae,accelerate:Y,deepTracker:H.options.DeepTracker,customId:H.options.CustomId,delay:H.options.TrackerDelay})}_.each(ie,function(we,Ae){h(we)!=="object"&&typeof we!="function"&&(ye[Ae]=we)});var te=ie.onTaskReady,pe=function(Ae){ye.TaskId=Ae,te&&te(Ae)};ie.onTaskReady=pe;var me=0,ge=ie.onProgress,ve=function(Ae){b=b-me+Ae.loaded,me=Ae.loaded,ge&&ge(Ae),U({loaded:b,total:F})};ie.onProgress=ve;var Ce=ae>P?"sliceUploadFile":"putObject",Te=ie.onFileFinish,Ee=function(Ae,Pe){ie.tracker&&ie.tracker.formatResult(Ae,Pe),Te&&Te(Ae,Pe),re&&re(Ae,Pe,ye)};ce.push({api:Ce,params:ie,callback:Ee})})()}),H._addTasks(ce)}function S(p,L){var H=new x,P=this,F=p.Bucket,b=p.Region,U=p.Key,z=p.CopySource,q=_.getSourceParams.call(this,z);if(!q){L(_.error(new Error("CopySource format error")));return}var $=q.Bucket,re=q.Region,ce=decodeURIComponent(q.Key),ie=p.CopySliceSize===void 0?P.options.CopySliceSize:p.CopySliceSize;ie=Math.max(0,ie);var ee=p.CopyChunkSize||this.options.CopyChunkSize,le=this.options.CopyChunkParallelLimit,ae=this.options.ChunkRetryTimes+1,ye=0,Y=0,te,pe,me={},ge={},ve={};H.on("copy_slice_complete",function(Ce){_.each(p.Headers,function(Ee,we){we.toLowerCase().indexOf("x-cos-meta-")});var Te=_.map(Ce.PartList,function(Ee){return{PartNumber:Ee.PartNumber,ETag:Ee.ETag}});c.retry(ae,function(Ee){P.multipartComplete({Bucket:F,Region:b,Key:U,UploadId:Ce.UploadId,Parts:Te,calledBySdk:"sliceCopyFile"},Ee)},function(Ee,we){if(R.removeUsing(Ce.UploadId),Ee)return pe(null,!0),L(Ee);R.removeUploadId(Ce.UploadId),pe({loaded:te,total:te},!0),L(null,we)})}),H.on("get_copy_data_finish",function(Ce){var Te=R.getCopyFileId(z,me,ee,F,U);Te&&R.saveUploadId(Te,Ce.UploadId,P.options.UploadIdCacheLimit),R.setUsing(Ce.UploadId);var Ee=_.filter(Ce.PartList,function(we){return we.Uploaded&&(Y+=we.PartNumber>=ye&&te%ee||ee),!we.Uploaded});c.eachLimit(Ee,le,function(we,Ae){var Pe=we.PartNumber,je=we.CopySourceRange,Ue=we.end-we.start;c.retry(ae,function(oe){v.call(P,{Bucket:F,Region:b,Key:U,CopySource:z,UploadId:Ce.UploadId,PartNumber:Pe,CopySourceRange:je},oe)},function(oe,a){if(oe)return Ae(oe);Y+=Ue,pe({loaded:Y,total:te}),we.ETag=a.ETag,Ae(oe||null,a)})},function(we){if(we)return R.removeUsing(Ce.UploadId),pe(null,!0),L(we);H.emit("copy_slice_complete",Ce)})}),H.on("get_chunk_size_finish",function(){var Ce=function(){P.multipartInit({Bucket:F,Region:b,Key:U,Headers:ve},function(Pe,je){if(Pe)return L(Pe);p.UploadId=je.UploadId,H.emit("get_copy_data_finish",{UploadId:p.UploadId,PartList:p.PartList})})},Te=R.getCopyFileId(z,me,ee,F,U),Ee=R.getUploadIdList(Te);if(!Te||!Ee)return Ce();var we=function Ae(Pe){if(Pe>=Ee.length)return Ce();var je=Ee[Pe];if(R.using[je])return Ae(Pe+1);X.call(P,{Bucket:F,Region:b,Key:U,UploadId:je},function(Ue,oe){if(Ue)R.removeUploadId(je),Ae(Pe+1);else{if(R.using[je])return Ae(Pe+1);var a={},r=0;_.each(oe.PartList,function(n){var o=parseInt(n.Size),f=r+o-1;a[n.PartNumber+"|"+r+"|"+f]=n.ETag,r+=o}),_.each(p.PartList,function(n){var o=a[n.PartNumber+"|"+n.start+"|"+n.end];o&&(n.ETag=o,n.Uploaded=!0)}),H.emit("get_copy_data_finish",{UploadId:je,PartList:p.PartList})}})};we(0)}),H.on("get_file_size_finish",function(){if(function(){for(var Te=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],Ee=1024*1024,we=0;wePe.length&&(ge[Ae]=we)}),H.emit("get_file_size_finish")}})}function v(p,L){var H=p.TaskId,P=p.Bucket,F=p.Region,b=p.Key,U=p.CopySource,z=p.UploadId,q=p.PartNumber*1,$=p.CopySourceRange,re=this.options.ChunkRetryTimes+1,ce=this;c.retry(re,function(ie){ce.uploadPartCopy({TaskId:H,Bucket:P,Region:F,Key:b,CopySource:U,UploadId:z,PartNumber:q,CopySourceRange:$},function(ee,le){ie(ee||null,le)})},function(ie,ee){return L(ie,ee)})}var W={sliceUploadFile:I,abortUploadTask:ne,uploadFile:se,uploadFiles:B,sliceCopyFile:S};g.exports.init=function(p,L){L.transferToTaskMethod(W,"sliceUploadFile"),_.each(W,function(H,P){p.prototype[P]=_.apiWrapper(P,H)})}},"./src/async.js":function(g,y){var s=function(x,_,N,I){if(I=I||function(){},!x.length||_<=0)return I();var w=0,K=0,X=0;(function V(){if(w>=x.length)return I();for(;X<_&&K=x.length?I():V())})})()},h=function(x,_,N){var I=function w(K){_(function(X,V){X&&K/gi,"<$1Rule>"),u=u.replace(/<(\/?)Tags>/gi,"<$1Tag>");var C=e.Headers;C["Content-Type"]="application/xml",C["Content-MD5"]=c.b64(c.md5(u)),ue.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:u,action:"replication",headers:C},function(m,T){if(m&&m.statusCode===204)return d(null,{statusCode:m.statusCode});if(m)return d(m);d(null,{statusCode:T.statusCode,headers:T.headers})})}function U(e,d){ue.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(t,u){if(t){if(t.statusCode===404&&t.error&&(t.error==="Not Found"||t.error.Code==="ReplicationConfigurationnotFoundError")){var C={ReplicationConfiguration:{Rules:[]},statusCode:t.statusCode};t.headers&&(C.headers=t.headers),d(null,C)}else d(t);return}!u.ReplicationConfiguration&&(u.ReplicationConfiguration={}),u.ReplicationConfiguration.Rule&&(u.ReplicationConfiguration.Rules=c.makeArray(u.ReplicationConfiguration.Rule),delete u.ReplicationConfiguration.Rule),d(t,u)})}function z(e,d){ue.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(t,u){if(t&&t.statusCode===204)return d(null,{statusCode:t.statusCode});if(t)return d(t);d(null,{statusCode:u.statusCode,headers:u.headers})})}function q(e,d){if(!e.WebsiteConfiguration){d(c.error(new Error("missing param WebsiteConfiguration")));return}var t=c.clone(e.WebsiteConfiguration||{}),u=t.RoutingRules||t.RoutingRule||[];u=c.isArray(u)?u:[u],delete t.RoutingRule,delete t.RoutingRules,u.length&&(t.RoutingRules={RoutingRule:u});var C=c.json2xml({WebsiteConfiguration:t}),m=e.Headers;m["Content-Type"]="application/xml",m["Content-MD5"]=c.b64(c.md5(C)),ue.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:C,action:"website",headers:m},function(T,O){if(T&&T.statusCode===204)return d(null,{statusCode:T.statusCode});if(T)return d(T);d(null,{statusCode:O.statusCode,headers:O.headers})})}function $(e,d){ue.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(t,u){if(t){if(t.statusCode===404&&t.error.Code==="NoSuchWebsiteConfiguration"){var C={WebsiteConfiguration:{},statusCode:t.statusCode};t.headers&&(C.headers=t.headers),d(null,C)}else d(t);return}var m=u.WebsiteConfiguration||{};if(m.RoutingRules){var T=c.clone(m.RoutingRules.RoutingRule||[]);T=c.makeArray(T),m.RoutingRules=T}d(null,{WebsiteConfiguration:m,statusCode:u.statusCode,headers:u.headers})})}function re(e,d){ue.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(t,u){if(t&&t.statusCode===204)return d(null,{statusCode:t.statusCode});if(t)return d(t);d(null,{statusCode:u.statusCode,headers:u.headers})})}function ce(e,d){if(!e.RefererConfiguration){d(c.error(new Error("missing param RefererConfiguration")));return}var t=c.clone(e.RefererConfiguration||{}),u=t.DomainList||{},C=u.Domains||u.Domain||[];C=c.isArray(C)?C:[C],C.length&&(t.DomainList={Domain:C});var m=c.json2xml({RefererConfiguration:t}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=c.b64(c.md5(m)),ue.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:m,action:"referer",headers:T},function(O,Z){if(O&&O.statusCode===204)return d(null,{statusCode:O.statusCode});if(O)return d(O);d(null,{statusCode:Z.statusCode,headers:Z.headers})})}function ie(e,d){ue.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(t,u){if(t){if(t.statusCode===404&&t.error.Code==="NoSuchRefererConfiguration"){var C={WebsiteConfiguration:{},statusCode:t.statusCode};t.headers&&(C.headers=t.headers),d(null,C)}else d(t);return}var m=u.RefererConfiguration||{};if(m.DomainList){var T=c.makeArray(m.DomainList.Domain||[]);m.DomainList={Domains:T}}d(null,{RefererConfiguration:m,statusCode:u.statusCode,headers:u.headers})})}function ee(e,d){var t=e.DomainConfiguration||{},u=t.DomainRule||e.DomainRule||[];u=c.clone(u);var C=c.json2xml({DomainConfiguration:{DomainRule:u}}),m=e.Headers;m["Content-Type"]="application/xml",m["Content-MD5"]=c.b64(c.md5(C)),ue.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:C,action:"domain",headers:m},function(T,O){if(T&&T.statusCode===204)return d(null,{statusCode:T.statusCode});if(T)return d(T);d(null,{statusCode:O.statusCode,headers:O.headers})})}function le(e,d){ue.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(t,u){if(t)return d(t);var C=[];try{C=u.DomainConfiguration.DomainRule||[]}catch(m){}C=c.clone(c.isArray(C)?C:[C]),d(null,{DomainRule:C,statusCode:u.statusCode,headers:u.headers})})}function ae(e,d){ue.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(t,u){if(t&&t.statusCode===204)return d(null,{statusCode:t.statusCode});if(t)return d(t);d(null,{statusCode:u.statusCode,headers:u.headers})})}function ye(e,d){var t=e.OriginConfiguration||{},u=t.OriginRule||e.OriginRule||[];u=c.clone(u);var C=c.json2xml({OriginConfiguration:{OriginRule:u}}),m=e.Headers;m["Content-Type"]="application/xml",m["Content-MD5"]=c.b64(c.md5(C)),ue.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:C,action:"origin",headers:m},function(T,O){if(T&&T.statusCode===204)return d(null,{statusCode:T.statusCode});if(T)return d(T);d(null,{statusCode:O.statusCode,headers:O.headers})})}function Y(e,d){ue.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(t,u){if(t)return d(t);var C=[];try{C=u.OriginConfiguration.OriginRule||[]}catch(m){}C=c.clone(c.isArray(C)?C:[C]),d(null,{OriginRule:C,statusCode:u.statusCode,headers:u.headers})})}function te(e,d){ue.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(t,u){if(t&&t.statusCode===204)return d(null,{statusCode:t.statusCode});if(t)return d(t);d(null,{statusCode:u.statusCode,headers:u.headers})})}function pe(e,d){var t=c.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),u=e.Headers;u["Content-Type"]="application/xml",u["Content-MD5"]=c.b64(c.md5(t)),ue.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:t,action:"logging",headers:u},function(C,m){if(C&&C.statusCode===204)return d(null,{statusCode:C.statusCode});if(C)return d(C);d(null,{statusCode:m.statusCode,headers:m.headers})})}function me(e,d){ue.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(t,u){if(t)return d(t);d(null,{BucketLoggingStatus:u.BucketLoggingStatus,statusCode:u.statusCode,headers:u.headers})})}function ge(e,d,t){var u=c.clone(d.InventoryConfiguration);if(u.OptionalFields){var C=u.OptionalFields||[];u.OptionalFields={Field:C}}if(u.Destination&&u.Destination.COSBucketDestination&&u.Destination.COSBucketDestination.Encryption){var m=u.Destination.COSBucketDestination.Encryption;Object.keys(m).indexOf("SSECOS")>-1&&(m["SSE-COS"]=m.SSECOS,delete m.SSECOS)}var T=c.json2xml({InventoryConfiguration:u}),O=d.Headers;O["Content-Type"]="application/xml",O["Content-MD5"]=c.b64(c.md5(T));var Z=e==="PUT"?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";ue.call(this,{Action:Z,method:e,Bucket:d.Bucket,Region:d.Region,body:T,action:"inventory",qs:{id:d.Id},headers:O},function(Oe,xe){if(Oe&&Oe.statusCode===204)return t(null,{statusCode:Oe.statusCode});if(Oe)return t(Oe);t(null,{statusCode:xe.statusCode,headers:xe.headers})})}function ve(e,d){return ge.call(this,"PUT",e,d)}function Ce(e,d){return ge.call(this,"POST",e,d)}function Te(e,d){ue.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(t,u){if(t)return d(t);var C=u.InventoryConfiguration;if(C&&C.OptionalFields&&C.OptionalFields.Field){var m=C.OptionalFields.Field;c.isArray(m)||(m=[m]),C.OptionalFields=m}if(C.Destination&&C.Destination.COSBucketDestination&&C.Destination.COSBucketDestination.Encryption){var T=C.Destination.COSBucketDestination.Encryption;Object.keys(T).indexOf("SSE-COS")>-1&&(T.SSECOS=T["SSE-COS"],delete T["SSE-COS"])}d(null,{InventoryConfiguration:C,statusCode:u.statusCode,headers:u.headers})})}function Ee(e,d){ue.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(t,u){if(t)return d(t);var C=u.ListInventoryConfigurationResult,m=C.InventoryConfiguration||[];m=c.isArray(m)?m:[m],delete C.InventoryConfiguration,c.each(m,function(T){if(T&&T.OptionalFields&&T.OptionalFields.Field){var O=T.OptionalFields.Field;c.isArray(O)||(O=[O]),T.OptionalFields=O}if(T.Destination&&T.Destination.COSBucketDestination&&T.Destination.COSBucketDestination.Encryption){var Z=T.Destination.COSBucketDestination.Encryption;Object.keys(Z).indexOf("SSE-COS")>-1&&(Z.SSECOS=Z["SSE-COS"],delete Z["SSE-COS"])}}),C.InventoryConfigurations=m,c.extend(C,{statusCode:u.statusCode,headers:u.headers}),d(null,C)})}function we(e,d){ue.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(t,u){if(t&&t.statusCode===204)return d(null,{statusCode:t.statusCode});if(t)return d(t);d(null,{statusCode:u.statusCode,headers:u.headers})})}function Ae(e,d){if(!e.AccelerateConfiguration){d(c.error(new Error("missing param AccelerateConfiguration")));return}var t={AccelerateConfiguration:e.AccelerateConfiguration||{}},u=c.json2xml(t),C={};C["Content-Type"]="application/xml",C["Content-MD5"]=c.b64(c.md5(u)),ue.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:u,action:"accelerate",headers:C},function(m,T){if(m)return d(m);d(null,{statusCode:T.statusCode,headers:T.headers})})}function Pe(e,d){ue.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(t,u){t||!u.AccelerateConfiguration&&(u.AccelerateConfiguration={}),d(t,u)})}function je(e,d){var t=e.ServerSideEncryptionConfiguration||{},u=t.Rule||t.Rules||[],C=c.json2xml({ServerSideEncryptionConfiguration:{Rule:u}}),m=e.Headers;m["Content-Type"]="application/xml",m["Content-MD5"]=c.b64(c.md5(C)),ue.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:C,action:"encryption",headers:m},function(T,O){if(T&&T.statusCode===204)return d(null,{statusCode:T.statusCode});if(T)return d(T);d(null,{statusCode:O.statusCode,headers:O.headers})})}function Ue(e,d){ue.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(t,u){if(t){if(t.statusCode===404&&t.code==="NoSuchEncryptionConfiguration"){var C={EncryptionConfiguration:{Rules:[]},statusCode:t.statusCode};t.headers&&(C.headers=t.headers),d(null,C)}else d(t);return}var m=c.makeArray(u.EncryptionConfiguration&&u.EncryptionConfiguration.Rule||[]);u.EncryptionConfiguration={Rules:m},d(t,u)})}function oe(e,d){ue.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(t,u){if(t&&t.statusCode===204)return d(null,{statusCode:t.statusCode});if(t)return d(t);d(null,{statusCode:u.statusCode,headers:u.headers})})}function a(e,d){ue.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(t,u){if(t){var C=t.statusCode;return e.Headers["If-Modified-Since"]&&C&&C===304?d(null,{NotModified:!0,statusCode:C}):d(t)}u.ETag=c.attr(u.headers,"etag",""),d(null,u)})}function r(e,d){var t={};t.prefix=e.Prefix||"",t.delimiter=e.Delimiter,t["key-marker"]=e.KeyMarker,t["version-id-marker"]=e.VersionIdMarker,t["max-keys"]=e.MaxKeys,t["encoding-type"]=e.EncodingType,ue.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:t.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:t,action:"versions"},function(u,C){if(u)return d(u);var m=C.ListVersionsResult||{},T=m.DeleteMarker||[];T=c.isArray(T)?T:[T];var O=m.Version||[];O=c.isArray(O)?O:[O];var Z=c.clone(m);delete Z.DeleteMarker,delete Z.Version,c.extend(Z,{DeleteMarkers:T,Versions:O,statusCode:C.statusCode,headers:C.headers}),d(null,Z)})}function n(e,d){var t=e.Query||{},u=e.QueryString||"",C=c.throttleOnProgress.call(this,0,e.onProgress),m=e.tracker;m&&m.setParams({signStartTime:new Date().getTime()}),t["response-content-type"]=e.ResponseContentType,t["response-content-language"]=e.ResponseContentLanguage,t["response-expires"]=e.ResponseExpires,t["response-cache-control"]=e.ResponseCacheControl,t["response-content-disposition"]=e.ResponseContentDisposition,t["response-content-encoding"]=e.ResponseContentEncoding,ue.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:t,qsStr:u,rawBody:!0,onDownloadProgress:C,tracker:m},function(T,O){if(C(null,!0),T){var Z=T.statusCode;return e.Headers["If-Modified-Since"]&&Z&&Z===304?d(null,{NotModified:!0}):d(T)}d(null,{Body:O.body,ETag:c.attr(O.headers,"etag",""),statusCode:O.statusCode,headers:O.headers})})}function o(e,d){var t=this,u=e.ContentLength,C=c.throttleOnProgress.call(t,u,e.onProgress),m=e.Headers;!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.UploadAddMetaMd5||t.options.UploadAddMetaMd5||t.options.UploadCheckContentMd5,O=e.tracker;T&&O&&O.setParams({md5StartTime:new Date().getTime()}),c.getBodyMd5(T,e.Body,function(Z){Z&&(O&&O.setParams({md5EndTime:new Date().getTime()}),t.options.UploadCheckContentMd5&&(m["Content-MD5"]=c.b64(Z)),(e.UploadAddMetaMd5||t.options.UploadAddMetaMd5)&&(m["x-cos-meta-md5"]=Z)),e.ContentLength!==void 0&&(m["Content-Length"]=e.ContentLength),C(null,!0),ue.call(t,{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:C,tracker:O},function(Oe,xe){if(Oe)return C(null,!0),d(Oe);C({loaded:u,total:u},!0);var Se=D({ForcePathStyle:t.options.ForcePathStyle,protocol:t.options.Protocol,domain:t.options.Domain,bucket:e.Bucket,region:t.options.UseAccelerate?"accelerate":e.Region,object:e.Key});Se=Se.substr(Se.indexOf("://")+3),xe.Location=Se,xe.ETag=c.attr(xe.headers,"etag",""),d(null,xe)})},e.onHashProgress)}function f(e,d){ue.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":""},function(t,u){if(t){var C=t.statusCode;return C&&C===404?d(null,{BucketNotFound:!0,statusCode:C}):d(t)}d(null,{statusCode:u.statusCode,headers:u.headers})})}function E(e,d){var t={};e.VersionId&&(t.versionId=e.VersionId),ue.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:t,action:"acl"},function(u,C){if(u)return d(u);var m=C.AccessControlPolicy||{},T=m.Owner||{},O=m.AccessControlList&&m.AccessControlList.Grant||[];O=c.isArray(O)?O:[O];var Z=l(m);delete Z.GrantWrite,C.headers&&C.headers["x-cos-acl"]&&(Z.ACL=C.headers["x-cos-acl"]),Z=c.extend(Z,{Owner:T,Grants:O,statusCode:C.statusCode,headers:C.headers}),d(null,Z)})}function A(e,d){var t=e.Headers,u="";if(e.AccessControlPolicy){var C=c.clone(e.AccessControlPolicy||{}),m=C.Grants||C.Grant;m=c.isArray(m)?m:[m],delete C.Grant,delete C.Grants,C.AccessControlList={Grant:m},u=c.json2xml({AccessControlPolicy:C}),t["Content-Type"]="application/xml",t["Content-MD5"]=c.b64(c.md5(u))}c.each(t,function(T,O){O.indexOf("x-cos-grant-")===0&&(t[O]=k(t[O]))}),ue.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:t,body:u},function(T,O){if(T)return d(T);d(null,{statusCode:O.statusCode,headers:O.headers})})}function G(e,d){var t=e.Headers;t.Origin=e.Origin,t["Access-Control-Request-Method"]=e.AccessControlRequestMethod,t["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,ue.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:t},function(u,C){if(u)return u.statusCode&&u.statusCode===403?d(null,{OptionsForbidden:!0,statusCode:u.statusCode}):d(u);var m=C.headers||{};d(null,{AccessControlAllowOrigin:m["access-control-allow-origin"],AccessControlAllowMethods:m["access-control-allow-methods"],AccessControlAllowHeaders:m["access-control-allow-headers"],AccessControlExposeHeaders:m["access-control-expose-headers"],AccessControlMaxAge:m["access-control-max-age"],statusCode:C.statusCode,headers:C.headers})})}function de(e,d){var t=this,u=e.Headers;!u["Cache-Control"]&&!u["cache-control"]&&(u["Cache-Control"]="");var C=e.CopySource||"",m=c.getSourceParams.call(this,C);if(!m){d(c.error(new Error("CopySource format error")));return}var T=m.Bucket,O=m.Region,Z=decodeURIComponent(m.Key);ue.call(this,{Scope:[{action:"name/cos:GetObject",bucket:T,region:O,prefix:Z},{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},function(Oe,xe){if(Oe)return d(Oe);var Se=c.clone(xe.CopyObjectResult||{}),Re=D({ForcePathStyle:t.options.ForcePathStyle,protocol:t.options.Protocol,domain:t.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});c.extend(Se,{Location:Re,statusCode:xe.statusCode,headers:xe.headers}),d(null,Se)})}function he(e,d){var t=e.CopySource||"",u=c.getSourceParams.call(this,t);if(!u){d(c.error(new Error("CopySource format error")));return}var C=u.Bucket,m=u.Region,T=decodeURIComponent(u.Key);ue.call(this,{Scope:[{action:"name/cos:GetObject",bucket:C,region:m,prefix:T},{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},function(O,Z){if(O)return d(O);var Oe=c.clone(Z.CopyPartResult||{});c.extend(Oe,{statusCode:Z.statusCode,headers:Z.headers}),d(null,Oe)})}function J(e,d){var t=e.Objects||[],u=e.Quiet;t=c.isArray(t)?t:[t];var C=c.json2xml({Delete:{Object:t,Quiet:u||!1}}),m=e.Headers;m["Content-Type"]="application/xml",m["Content-MD5"]=c.b64(c.md5(C));var T=c.map(t,function(O){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:O.Key}});ue.call(this,{Scope:T,method:"POST",Bucket:e.Bucket,Region:e.Region,body:C,action:"delete",headers:m},function(O,Z){if(O)return d(O);var Oe=Z.DeleteResult||{},xe=Oe.Deleted||[],Se=Oe.Error||[];xe=c.isArray(xe)?xe:[xe],Se=c.isArray(Se)?Se:[Se];var Re=c.clone(Oe);c.extend(Re,{Error:Se,Deleted:xe,statusCode:Z.statusCode,headers:Z.headers}),d(null,Re)})}function ke(e,d){var t=e.Headers;if(!e.RestoreRequest){d(c.error(new Error("missing param RestoreRequest")));return}var u=e.RestoreRequest||{},C=c.json2xml({RestoreRequest:u});t["Content-Type"]="application/xml",t["Content-MD5"]=c.b64(c.md5(C)),ue.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:C,action:"restore",headers:t},d)}function De(e,d){var t=e.Tagging||{},u=t.TagSet||t.Tags||e.Tags||[];u=c.clone(c.isArray(u)?u:[u]);var C=c.json2xml({Tagging:{TagSet:{Tag:u}}}),m=e.Headers;m["Content-Type"]="application/xml",m["Content-MD5"]=c.b64(c.md5(C)),ue.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:C,action:"tagging",headers:m,VersionId:e.VersionId},function(T,O){if(T&&T.statusCode===204)return d(null,{statusCode:T.statusCode});if(T)return d(T);d(null,{statusCode:O.statusCode,headers:O.headers})})}function Me(e,d){ue.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},function(t,u){if(t){if(t.statusCode===404&&t.error&&(t.error==="Not Found"||t.error.Code==="NoSuchTagSet")){var C={Tags:[],statusCode:t.statusCode};t.headers&&(C.headers=t.headers),d(null,C)}else d(t);return}var m=[];try{m=u.Tagging.TagSet.Tag||[]}catch(T){}m=c.clone(c.isArray(m)?m:[m]),d(null,{Tags:m,statusCode:u.statusCode,headers:u.headers})})}function Be(e,d){ue.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},function(t,u){if(t&&t.statusCode===204)return d(null,{statusCode:t.statusCode});if(t)return d(t);d(null,{statusCode:u.statusCode,headers:u.headers})})}function Fe(e,d){var t=e.SelectType;if(!t)return d(c.error(new Error("missing param SelectType")));var u=e.SelectRequest||{},C=c.json2xml({SelectRequest:u}),m=e.Headers;m["Content-Type"]="application/xml",m["Content-MD5"]=c.b64(c.md5(C)),ue.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:C,DataType:"arraybuffer",rawBody:!0},function(T,O){if(T&&T.statusCode===204)return d(null,{statusCode:T.statusCode});if(T)return d(T);var Z=c.parseSelectPayload(O.body);d(null,{statusCode:O.statusCode,headers:O.headers,Body:Z.body,Payload:Z.payload})})}function qe(e,d){var t=this,u=e.Headers,C=e.tracker;!u["Cache-Control"]&&!u["cache-control"]&&(u["Cache-Control"]=""),!u["Content-Type"]&&!u["content-type"]&&(u["Content-Type"]=e.Body&&e.Body.type||"");var m=e.Body&&(e.UploadAddMetaMd5||t.options.UploadAddMetaMd5);m&&C&&C.setParams({md5StartTime:new Date().getTime()}),c.getBodyMd5(m,e.Body,function(T){T&&(e.Headers["x-cos-meta-md5"]=T),m&&C&&C.setParams({md5EndTime:new Date().getTime()}),ue.call(t,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:C},function(O,Z){if(O)return C&&C.parent&&C.parent.setParams({errorNode:"multipartInit"}),d(O);if(Z=c.clone(Z||{}),Z&&Z.InitiateMultipartUploadResult)return d(null,c.extend(Z.InitiateMultipartUploadResult,{statusCode:Z.statusCode,headers:Z.headers}));d(null,Z)})},e.onHashProgress)}function Ve(e,d){var t=this;c.getFileSize("multipartUpload",e,function(){var u=e.tracker,C=t.options.UploadCheckContentMd5;C&&u&&u.setParams({md5StartTime:new Date().getTime()}),c.getBodyMd5(C,e.Body,function(m){m&&(e.Headers["Content-MD5"]=c.b64(m)),C&&u&&u.setParams({md5EndTime:new Date().getTime()}),u&&u.setParams({partNumber:e.PartNumber}),ue.call(t,{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:u},function(T,O){if(T)return u&&u.parent&&u.parent.setParams({errorNode:"multipartUpload"}),d(T);d(null,{ETag:c.attr(O.headers,"etag",""),statusCode:O.statusCode,headers:O.headers})})})})}function We(e,d){for(var t=this,u=e.UploadId,C=e.Parts,m=e.tracker,T=0,O=C.length;T-1?Se(xe.Authorization):"sign="+encodeURIComponent(xe.Authorization)),xe.SecurityToken&&(Re+="&x-cos-security-token="+xe.SecurityToken),xe.ClientIP&&(Re+="&clientIP="+xe.ClientIP),xe.ClientUA&&(Re+="&clientUA="+xe.ClientUA),xe.Token&&(Re+="&token="+xe.Token),m&&(Re+="&"+m),setTimeout(function(){d(null,{Url:Re})})}});return Z?(T+="?"+Z.Authorization+(Z.SecurityToken?"&x-cos-security-token="+Z.SecurityToken:""),m&&(T+="&"+m)):m&&(T+="?"+m),T}function l(e){var d={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},t={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},u=e&&e.AccessControlList||{},C=u.Grant;C&&(C=c.isArray(C)?C:[C]);var m={READ:0,WRITE:0,FULL_CONTROL:0};return C&&C.length&&c.each(C,function(T){T.Grantee.ID==="qcs::cam::anyone:anyone"||T.Grantee.URI==="http://cam.qcloud.com/groups/global/AllUsers"?m[T.Permission]=1:T.Grantee.ID!==e.Owner.ID&&d[t[T.Permission]].push('id="'+T.Grantee.ID+'"')}),m.FULL_CONTROL||m.WRITE&&m.READ?d.ACL="public-read-write":m.READ?d.ACL="public-read":d.ACL="private",c.each(t,function(T){d[T]=k(d[T].join(","))}),d}function k(e){var d=e.split(","),t={},u,C;for(u=0;u-1?m="{Region}.myqcloud.com":m="cos.{Region}.myqcloud.com",e.ForcePathStyle||(m="{Bucket}."+m)),m=m.replace(/\{\{AppId\}\}/gi,C).replace(/\{\{Bucket\}\}/gi,u).replace(/\{\{Region\}\}/gi,d).replace(/\{\{.*?\}\}/gi,""),m=m.replace(/\{AppId\}/gi,C).replace(/\{BucketName\}/gi,u).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,d).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(m)||(m=O+"//"+m),m.slice(-1)==="/"&&(m=m.slice(0,-1));var Z=m;return e.ForcePathStyle&&(Z+="/"+t),Z+="/",T&&(Z+=c.camSafeUrlEncode(T).replace(/%2F/g,"/")),e.isLocation&&(Z=Z.replace(/^https?:\/\//,"")),Z}var fe=function(d){if(!d.Bucket||!d.Region)return"";var t=d.UseAccelerate===void 0?this.options.UseAccelerate:d.UseAccelerate,u=d.Url||D({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:d.Bucket,region:t?"accelerate":d.Region}),C=u.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1"),m=new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$");return m.test(C)?C:""};function be(e,d){var t=c.clone(e.Headers),u="";c.each(t,function(_e,Ie){(_e===""||["content-type","cache-control","expires"].indexOf(Ie.toLowerCase())>-1)&&delete t[Ie],Ie.toLowerCase()==="host"&&(u=_e)});var C=e.ForceSignHost!==!1;!u&&e.SignHost&&C&&(t.Host=e.SignHost);var m=!1,T=function(Ie,He){m||(m=!0,He&&He.XCosSecurityToken&&!He.SecurityToken&&(He=c.clone(He),He.SecurityToken=He.XCosSecurityToken,delete He.XCosSecurityToken),d&&d(Ie,He))},O=this,Z=e.Bucket||"",Oe=e.Region||"",xe=e.Key||"";O.options.ForcePathStyle&&Z&&(xe=Z+"/"+xe);var Se="/"+xe,Re={},Le=e.Scope;if(!Le){var Ye=e.Action||"",it=e.ResourceKey||e.Key||"";Le=e.Scope||[{action:Ye,bucket:Z,region:Oe,prefix:it}]}var ot=c.md5(JSON.stringify(Le));O._StsCache=O._StsCache||[],function(){var _e,Ie;for(_e=O._StsCache.length-1;_e>=0;_e--){Ie=O._StsCache[_e];var He=Math.round(c.getSkewTime(O.options.SystemClockOffset)/1e3)+30;if(Ie.StartTime&&He=Ie.ExpiredTime){O._StsCache.splice(_e,1);continue}if(!Ie.ScopeLimit||Ie.ScopeLimit&&Ie.ScopeKey===ot){Re=Ie;break}}}();var Ze=function(){var Ie="";Re.StartTime&&e.Expires?Ie=Re.StartTime+";"+(Re.StartTime+e.Expires*1):Re.StartTime&&Re.ExpiredTime&&(Ie=Re.StartTime+";"+Re.ExpiredTime);var He=c.getAuth({SecretId:Re.TmpSecretId,SecretKey:Re.TmpSecretKey,Method:e.Method,Pathname:Se,Query:e.Query,Headers:t,Expires:e.Expires,UseRawKey:O.options.UseRawKey,SystemClockOffset:O.options.SystemClockOffset,KeyTime:Ie,ForceSignHost:C}),Ke={Authorization:He,SecurityToken:Re.SecurityToken||Re.XCosSecurityToken||"",Token:Re.Token||"",ClientIP:Re.ClientIP||"",ClientUA:Re.ClientUA||""};T(null,Ke)},st=function(Ie){if(Ie.Authorization){var He=!1,Ke=Ie.Authorization;if(Ke)if(Ke.indexOf(" ")>-1)He=!1;else if(Ke.indexOf("q-sign-algorithm=")>-1&&Ke.indexOf("q-ak=")>-1&&Ke.indexOf("q-sign-time=")>-1&&Ke.indexOf("q-key-time=")>-1&&Ke.indexOf("q-url-param-list=")>-1)He=!0;else try{Ke=atob(Ke),Ke.indexOf("a=")>-1&&Ke.indexOf("k=")>-1&&Ke.indexOf("t=")>-1&&Ke.indexOf("r=")>-1&&Ke.indexOf("b=")>-1&&(He=!0)}catch(tt){}if(!He)return c.error(new Error("getAuthorization callback params format error"))}else{if(!Ie.TmpSecretId)return c.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!Ie.TmpSecretKey)return c.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!Ie.SecurityToken&&!Ie.XCosSecurityToken)return c.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!Ie.ExpiredTime)return c.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(Ie.ExpiredTime&&Ie.ExpiredTime.toString().length!==10)return c.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(Ie.StartTime&&Ie.StartTime.toString().length!==10)return c.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(Re.ExpiredTime&&Re.ExpiredTime-c.getSkewTime(O.options.SystemClockOffset)/1e3>60)Ze();else if(O.options.getAuthorization)O.options.getAuthorization.call(O,{Bucket:Z,Region:Oe,Method:e.Method,Key:xe,Pathname:Se,Query:e.Query,Headers:t,Scope:Le,SystemClockOffset:O.options.SystemClockOffset,ForceSignHost:C},function(_e){typeof _e=="string"&&(_e={Authorization:_e});var Ie=st(_e);if(Ie)return T(Ie);_e.Authorization?T(null,_e):(Re=_e||{},Re.Scope=Le,Re.ScopeKey=ot,O._StsCache.push(Re),Ze())});else if(O.options.getSTS)O.options.getSTS.call(O,{Bucket:Z,Region:Oe},function(_e){Re=_e||{},Re.Scope=Le,Re.ScopeKey=ot,Re.TmpSecretId||(Re.TmpSecretId=Re.SecretId),Re.TmpSecretKey||(Re.TmpSecretKey=Re.SecretKey);var Ie=st(Re);if(Ie)return T(Ie);O._StsCache.push(Re),Ze()});else return function(){var _e=c.getAuth({SecretId:e.SecretId||O.options.SecretId,SecretKey:e.SecretKey||O.options.SecretKey,Method:e.Method,Pathname:Se,Query:e.Query,Headers:t,Expires:e.Expires,UseRawKey:O.options.UseRawKey,SystemClockOffset:O.options.SystemClockOffset,ForceSignHost:C}),Ie={Authorization:_e,SecurityToken:O.options.SecurityToken||O.options.XCosSecurityToken};return T(null,Ie),Ie}();return""}function Ne(e){var d=!1,t=!1,u=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var C=e.error.Code,m=e.error.Message;(C==="RequestTimeTooSkewed"||C==="AccessDenied"&&m==="Request has expired")&&(t=!0)}catch(O){}if(e)if(t&&u){var T=Date.parse(u);this.options.CorrectClockSkew&&Math.abs(c.getSkewTime(this.options.SystemClockOffset)-T)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=T-Date.now(),d=!0)}else Math.floor(e.statusCode/100)===5&&(d=!0);return d}function ue(e,d){var t=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=c.clearKey(e.qs),e.headers&&(e.headers=c.clearKey(e.headers)),e.qs&&(e.qs=c.clearKey(e.qs));var u=c.clone(e.qs);e.action&&(u[e.action]="");var C=e.url||e.Url,m=e.SignHost||fe.call(this,{Bucket:e.Bucket,Region:e.Region,Url:C}),T=e.tracker,O=function Z(Oe){var xe=t.options.SystemClockOffset;T&&T.setParams({signStartTime:new Date().getTime(),retryTimes:Oe-1}),be.call(t,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:u,Headers:e.headers,SignHost:m,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:t.options.ForceSignHost},function(Se,Re){if(Se){d(Se);return}T&&T.setParams({signEndTime:new Date().getTime(),httpStartTime:new Date().getTime()}),e.AuthData=Re,Qe.call(t,e,function(Le,Ye){T&&T.setParams({httpEndTime:new Date().getTime()}),Le&&Oe<2&&(xe!==t.options.SystemClockOffset||Ne.call(t,Le))?(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"]),Z(Oe+1)):d(Le,Ye)})})};O(1)}function Qe(e,d){var t=this,u=e.TaskId;if(!(u&&!t._isRunningTask(u))){var C=e.Bucket,m=e.Region,T=e.Key,O=e.method||"GET",Z=e.Url||e.url,Oe=e.body,xe=e.rawBody;t.options.UseAccelerate&&(m="accelerate"),Z=Z||D({ForcePathStyle:t.options.ForcePathStyle,protocol:t.options.Protocol,domain:t.options.Domain,bucket:C,region:m,object:T}),e.action&&(Z=Z+"?"+(c.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(Z.indexOf("?")>-1?Z=Z+"&"+e.qsStr:Z=Z+"?"+e.qsStr);var Se={method:O,url:Z,headers:e.headers,qs:e.qs,body:Oe},Re="x-cos-security-token";if(c.isCIHost(Z)&&(Re="x-ci-security-token"),Se.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(Se.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(Se.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(Se.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(Se.headers[Re]=e.AuthData.SecurityToken),Se.headers&&(Se.headers=c.clearKey(Se.headers)),Se=c.clearKey(Se),e.onProgress&&typeof e.onProgress=="function"){var Le=Oe&&(Oe.size||Oe.length)||0;Se.onProgress=function(_e){if(!(u&&!t._isRunningTask(u))){var Ie=_e?_e.loaded:0;e.onProgress({loaded:Ie,total:Le})}}}e.onDownloadProgress&&(Se.onDownloadProgress=e.onDownloadProgress),e.DataType&&(Se.dataType=e.DataType),this.options.Timeout&&(Se.timeout=this.options.Timeout),t.options.ForcePathStyle&&(Se.pathStyle=t.options.ForcePathStyle),t.emit("before-send",Se);var Ye=Se.url.includes("accelerate."),it=Se.qs?Object.keys(Se.qs).map(function(_e){return"".concat(_e,"=").concat(Se.qs[_e])}).join("&"):"",ot=it?Se.url+"?"+it:Se.url;e.tracker&&e.tracker.setParams({reqUrl:ot,accelerate:Ye?"Y":"N"}),e.tracker&&e.tracker.parent&&e.tracker.parent.setParams({reqUrl:ot,accelerate:Ye?"Y":"N"});var Ze=(t.options.Request||R)(Se,function(_e){if(!(_e&&_e.error==="abort")){var Ie={options:Se,error:_e&&_e.error,statusCode:_e&&_e.statusCode||0,statusMessage:_e&&_e.statusMessage||"",headers:_e&&_e.headers||{},body:_e&&_e.body};t.emit("after-receive",Ie);var He=Ie.error,Ke=Ie.body,tt={statusCode:Ie.statusCode,statusMessage:Ie.statusMessage,headers:Ie.headers},gt,at=function(ft,pt){if(u&&t.off("inner-kill-task",st),!gt){gt=!0;var ht={};tt&&tt.statusCode&&(ht.statusCode=tt.statusCode),tt&&tt.headers&&(ht.headers=tt.headers),ft?(ft=c.extend(ft||{},ht),d(ft,null)):(pt=c.extend(pt||{},ht),d(null,pt)),Ze=null}};if(He)return at(c.error(He));var lt=tt.statusCode,vt=Math.floor(lt/100)===2;if(xe&&vt)return at(null,{body:Ke});var ut;try{ut=Ke&&Ke.indexOf("<")>-1&&Ke.indexOf(">")>-1&&c.xml2json(Ke)||{}}catch(yt){ut={}}var dt=ut&&ut.Error;vt?at(null,ut):dt?at(c.error(new Error(dt.Message),{code:dt.Code,error:dt})):lt?at(c.error(new Error(tt.statusMessage),{code:""+lt})):lt&&at(c.error(new Error("statusCode error")))}}),st=function _e(Ie){Ie.TaskId===u&&(Ze&&Ze.abort&&Ze.abort(),t.off("inner-kill-task",_e))};u&&t.on("inner-kill-task",st)}}var Je={getService:x,putBucket:_,headBucket:N,getBucket:I,deleteBucket:w,putBucketAcl:K,getBucketAcl:X,putBucketCors:V,getBucketCors:M,deleteBucketCors:j,getBucketLocation:ne,getBucketPolicy:se,putBucketPolicy:Q,deleteBucketPolicy:B,putBucketTagging:S,getBucketTagging:v,deleteBucketTagging:W,putBucketLifecycle:p,getBucketLifecycle:L,deleteBucketLifecycle:H,putBucketVersioning:P,getBucketVersioning:F,putBucketReplication:b,getBucketReplication:U,deleteBucketReplication:z,putBucketWebsite:q,getBucketWebsite:$,deleteBucketWebsite:re,putBucketReferer:ce,getBucketReferer:ie,putBucketDomain:ee,getBucketDomain:le,deleteBucketDomain:ae,putBucketOrigin:ye,getBucketOrigin:Y,deleteBucketOrigin:te,putBucketLogging:pe,getBucketLogging:me,putBucketInventory:ve,postBucketInventory:Ce,getBucketInventory:Te,listBucketInventory:Ee,deleteBucketInventory:we,putBucketAccelerate:Ae,getBucketAccelerate:Pe,putBucketEncryption:je,getBucketEncryption:Ue,deleteBucketEncryption:oe,getObject:n,headObject:a,listObjectVersions:r,putObject:o,deleteObject:f,getObjectAcl:E,putObjectAcl:A,optionsObject:G,putObjectCopy:de,deleteMultipleObject:J,restoreObject:ke,putObjectTagging:De,getObjectTagging:Me,deleteObjectTagging:Be,selectObjectContent:Fe,appendObject:et,uploadPartCopy:he,multipartInit:qe,multipartUpload:Ve,multipartComplete:We,multipartList:ze,multipartListPart:Ge,multipartAbort:Xe,request:nt,getObjectUrl:i,getAuth:rt};function $e(e,d,t){c.each(["Cors","Acl"],function(u){if(e.slice(-u.length)===u){var C=e.slice(0,-u.length)+u.toUpperCase(),m=c.apiWrapper(e,d),T=!1;t[C]=function(){!T&&console.warn("warning: cos."+C+" has been deprecated. Please Use cos."+e+" instead."),T=!0,m.apply(this,arguments)}}})}g.exports.init=function(e,d){d.transferToTaskMethod(Je,"putObject"),c.each(Je,function(t,u){e.prototype[u]=c.apiWrapper(u,t),$e(u,t,e.prototype)})}},"./src/cos.js":function(g,y,s){var h=s("./src/util.js"),R=s("./src/event.js"),c=s("./src/task.js"),x=s("./src/base.js"),_=s("./src/advance.js"),N=s("./package.json"),I={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",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,EnableTracker:!1,DeepTracker:!1,TrackerDelay:5e3,CustomId:""},w=function(X){this.options=h.extend(h.clone(I),X||{}),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.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\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5"),console.error("error: SecretKey format is incorrect. Please check")),h.isNode()&&(console.warn("warning: cos-js-sdk-v5 \u4E0D\u652F\u6301 nodejs \u73AF\u5883\u4F7F\u7528\uFF0C\u8BF7\u6539\u7528 cos-nodejs-sdk-v5\uFF0C\u53C2\u8003\u6587\u6863\uFF1A 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")),R.init(this),c.init(this)};x.init(w,c),_.init(w,c),w.util={md5:h.md5,xml2json:h.xml2json,json2xml:h.json2xml,encodeBase64:h.encodeBase64},w.getAuthorization=h.getAuth,w.version=N.version,g.exports=w},"./src/event.js":function(g,y){var s=function(c){var x={},_=function(I){return!x[I]&&(x[I]=[]),x[I]};c.on=function(N,I){N==="task-list-update"&&console.warn('warning: Event "'+N+'" has been deprecated. Please use "list-update" instead.'),_(N).push(I)},c.off=function(N,I){for(var w=_(N),K=w.length-1;K>=0;K--)I===w[K]&&w.splice(K,1)},c.emit=function(N,I){for(var w=_(N).map(function(X){return X}),K=0;K=0;ne--){var Q=x[ne][2];(!Q||Q+c=0;Q--){var se=x[Q];se[0]===M&&se[1]===j&&x.splice(Q,1)}x.unshift([M,j,Math.round(Date.now()/1e3)]),x.length>ne&&x.splice(ne),K()}},removeUploadId:function(M){w.call(this),delete X.using[M];for(var j=x.length-1;j>=0;j--)x[j][1]===M&&x.splice(j,1);K()}};g.exports=X},"./src/task.js":function(g,y,s){var h=s("./src/session.js"),R=s("./src/util.js"),c={},x=function(I,w){c[w]=I[w],I[w]=function(K,X){K.SkipTask?c[w].call(this,K,X):this._addTask(w,K,X)}},_=function(I){var w=[],K={},X=0,V=0,M=function(v){var W={id:v.id,Bucket:v.Bucket,Region:v.Region,Key:v.Key,FilePath:v.FilePath,state:v.state,loaded:v.loaded,size:v.size,speed:v.speed,percent:v.percent,hashPercent:v.hashPercent,error:v.error};return v.FilePath&&(W.FilePath=v.FilePath),v._custom&&(W._custom=v._custom),W},j=function(){var S,v=function(){S=0,I.emit("task-list-update",{list:R.map(w,M)}),I.emit("list-update",{list:R.map(w,M)})};return function(){S||(S=setTimeout(v))}}(),ne=function(){if(!(w.length<=I.options.UploadQueueSize)){for(var v=0;vI.options.UploadQueueSize;){var W=w[v].state==="waiting"||w[v].state==="checking"||w[v].state==="uploading";!w[v]||!W?(K[w[v].id]&&delete K[w[v].id],w.splice(v,1),V--):v++}j()}},Q=function S(){if(!(X>=I.options.FileParallelLimit)){for(;w[V]&&w[V].state!=="waiting";)V++;if(!(V>=w.length)){var v=w[V];V++,X++,v.state="checking",v.params.onTaskStart&&v.params.onTaskStart(M(v)),!v.params.UploadData&&(v.params.UploadData={});var W=R.formatParams(v.api,v.params);c[v.api].call(I,W,function(p,L){!I._isRunningTask(v.id)||((v.state==="checking"||v.state==="uploading")&&(v.state=p?"error":"success",p&&(v.error=p),X--,j(),S(),v.callback&&v.callback(p,L),v.state==="success"&&(v.params&&(delete v.params.UploadData,delete v.params.Body,delete v.params),delete v.callback)),ne())}),j(),setTimeout(S)}}},se=function(v,W){var p=K[v];if(!!p){var L=p&&p.state==="waiting",H=p&&(p.state==="checking"||p.state==="uploading");if(W==="canceled"&&p.state!=="canceled"||W==="paused"&&L||W==="paused"&&H){if(W==="paused"&&p.params.Body&&typeof p.params.Body.pipe=="function"){console.error("stream not support pause");return}p.state=W,I.emit("inner-kill-task",{TaskId:v,toState:W});try{var P=p&&p.params&&p.params.UploadData.UploadId}catch(F){}W==="canceled"&&P&&h.removeUsing(P),j(),H&&(X--,Q()),W==="canceled"&&(p.params&&(delete p.params.UploadData,delete p.params.Body,delete p.params),delete p.callback)}ne()}};I._addTasks=function(S){R.each(S,function(v){I._addTask(v.api,v.params,v.callback,!0)}),j()};var B=!0;I._addTask=function(S,v,W,p){v=R.formatParams(S,v);var L=R.uuid();v.TaskId=L,v.onTaskReady&&v.onTaskReady(L),v.TaskReady&&(v.TaskReady(L),B&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),B=!1);var H={params:v,callback:W,api:S,index:w.length,id:L,Bucket:v.Bucket,Region:v.Region,Key:v.Key,FilePath:v.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:v._custom},P=v.onHashProgress;v.onHashProgress=function(b){!I._isRunningTask(H.id)||(H.hashPercent=b.percent,P&&P(b),j())};var F=v.onProgress;return v.onProgress=function(b){!I._isRunningTask(H.id)||(H.state==="checking"&&(H.state="uploading"),H.loaded=b.loaded,H.speed=b.speed,H.percent=b.percent,F&&F(b),j())},R.getFileSize(S,v,function(b,U){if(b)return W(R.error(b));K[L]=H,w.push(H),H.size=U,!p&&j(),Q(),ne()}),L},I._isRunningTask=function(S){var v=K[S];return!!(v&&(v.state==="checking"||v.state==="uploading"))},I.getTaskList=function(){return R.map(w,M)},I.cancelTask=function(S){se(S,"canceled")},I.pauseTask=function(S){se(S,"paused")},I.restartTask=function(S){var v=K[S];v&&(v.state==="paused"||v.state==="error")&&(v.state="waiting",j(),V=Math.min(V,v.index),Q())},I.isUploadRunning=function(){return X||V=0||S.indexOf("wow32")>=0?"win32":S.indexOf("win64")>=0||S.indexOf("wow64")>=0?"win64":v?"mac":"unknown os"},isMobile:function(){var S=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;return!!((typeof navigator=="undefined"?"undefined":c(navigator))==="object"&&navigator.userAgent.match(S))},isAndroid:function(){var S=/(Android|Adr|Linux)/i;return!!((typeof navigator=="undefined"?"undefined":c(navigator))==="object"&&navigator.userAgent.match(S))},isIOS:function(){var S=/(iPhone|iPod|iPad|iOS)/i;return!!((typeof navigator=="undefined"?"undefined":c(navigator))==="object"&&navigator.userAgent.match(S))},isOtherMobile:function(){return isMobile&&!isAndroid&&!isIOS},getDeviceName:function(){if((typeof navigator=="undefined"?"undefined":c(navigator))!=="object")return"unknown device";var S=navigator.userAgent.toLowerCase();if(S.includes("app/tencent_wemeet"))return"tencent_wemeet";if(S.indexOf("maxthon")>=0){var v=S.match(/maxthon\/([\d.]+)/),W=v&&v[1]||"";return"\u50B2\u6E38\u6D4F\u89C8\u5668 ".concat(W).trim()}if(S.indexOf("qqbrowser")>=0){var p=S.match(/qqbrowser\/([\d.]+)/),L=p&&p[1]||"";return"QQ\u6D4F\u89C8\u5668 ".concat(L).trim()}if(S.indexOf("se 2.x")>=0)return"\u641C\u72D7\u6D4F\u89C8\u5668";if(S.indexOf("wxwork")>=0)return"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668";if(S.indexOf("msie")>=0){var H=S.match(/msie ([\d.]+)/),P=H&&H[1]||"";return"IE ".concat(P).trim()}if(S.indexOf("firefox")>=0){var F=S.match(/firefox\/([\d.]+)/),b=F&&F[1]||"";return"Firefox ".concat(b).trim()}if(S.indexOf("chrome")>=0){var U=S.match(/chrome\/([\d.]+)/),z=U&&U[1]||"";return"Chrome ".concat(z).trim()}if(S.indexOf("opera")>=0){var q=S.match(/opera.([\d.]+)/),$=q&&q[1]||"";return"Opera ".concat($).trim()}if(S.indexOf("safari")>=0){var re=S.match(/version\/([\d.]+)/),ce=re&&re[1]||"";return"Safari ".concat(ce).trim()}if(S.indexOf("edge")>=0){var ie=S.match(/edge\/([\d.]+)/),ee=ie&&ie[1]||"";return"edge ".concat(ee).trim()}return S.substr(0,200)}},w={isMobile:I.isMobile(),isBrowser:!I.isMobile(),mobileOsType:I.isAndroid()?"android":I.isIOS?"ios":"other_mobile",pcOsType:I.getOsType()},K={deviceType:w.isMobile?"mobile":w.isBrowser?"browser":"unknown",devicePlatform:w.isMobile?w.mobileOsType:w.pcOsType,deviceName:I.getDeviceName()},X=["multipartInit","multipartUpload","multipartComplete","multipartList","multipartListPart","multipartAbort"],V=["putObject","postObject","appendObject","sliceUploadFile","uploadFile","uploadFiles"].concat(X),M=["getObject"];function j(B){return V.includes(B)?"cos_upload":M.includes(B)?"cos_download":"base_service"}function ne(B){return B.replace(/([A-Z])/g,"_$1").toLowerCase()}function Q(B){var S={},v=["tracePlatform","cossdkVersion","region","networkType","host","accelerate","requestPath","size","httpMd5","httpSign","httpFull","name","result","tookTime","errorNode","errorCode","errorMessage","errorRequestId","errorStatusCode","errorServiceName","errorType","traceId","bucket","appid","partNumber","retryTimes","reqUrl","customId","fullError","deviceType","devicePlatform","deviceName"],W=["tracePlatform","cossdkVersion","region","bucket","appid","networkType","host","accelerate","requestPath","partNumber","size","name","result","tookTime","errorRequestId","retryTimes","reqUrl","customId","deviceType","devicePlatform","deviceName"],p=B.result==="Success"?W:v;for(var L in B)if(!!p.includes(L)){var H=ne(L);S[H]=B[L]}return S}var se=function(){function B(S){h(this,B);var v=S.parent,W=S.traceId,p=S.bucket,L=S.region,H=S.apiName,P=S.fileKey,F=S.fileSize,b=S.accelerate,U=S.customId,z=S.delay,q=S.deepTracker,$=p&&p.substr(p.lastIndexOf("-")+1)||"";this.parent=v,this.deepTracker=q,this.delay=z,this.params={cossdkVersion:x.version,region:L,networkType:"",host:"",accelerate:b?"Y":"N",requestPath:P||"",size:F||-1,httpMd5:0,httpSign:0,httpFull:0,name:H||"",result:"",tookTime:0,errorNode:"",errorCode:"",errorMessage:"",errorRequestId:"",errorStatusCode:0,errorServiceName:"",tracePlatform:"cos-js-sdk-v5",traceId:W||I.getUid(),bucket:p,appid:$,partNumber:0,retryTimes:0,reqUrl:"",customId:U||"",deviceType:K.deviceType,devicePlatform:K.devicePlatform,deviceName:K.deviceName,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:new Date().getTime(),endTime:0},this.beacon=N(z)}return R(B,[{key:"formatResult",value:function(v,W){var p,L,H,P,F,b,U=new Date().getTime(),z=U-this.params.startTime,q=I.getNetType(),$=v?(v==null?void 0:v.code)||(v==null||(p=v.error)===null||p===void 0?void 0:p.code)||(v==null||(L=v.error)===null||L===void 0?void 0:L.Code):"",re=v?(v==null?void 0:v.message)||(v==null||(H=v.error)===null||H===void 0?void 0:H.message)||(v==null||(P=v.error)===null||P===void 0?void 0:P.Message):"",ce=v?(v==null?void 0:v.resource)||(v==null||(F=v.error)===null||F===void 0?void 0:F.resource)||(v==null||(b=v.error)===null||b===void 0?void 0:b.Resource):"",ie=v?v==null?void 0:v.statusCode:W.statusCode,ee=v?(v==null?void 0:v.headers)&&(v==null?void 0:v.headers["x-cos-request-id"]):(W==null?void 0:W.headers)&&(W==null?void 0:W.headers["x-cos-request-id"]),le=v?ee?"Server":"Client":"";if(Object.assign(this.params,{tookTime:z,networkType:q,httpMd5:this.params.md5EndTime-this.params.md5StartTime,httpSign:this.params.signEndTime-this.params.signStartTime,httpFull:this.params.httpEndTime-this.params.httpStartTime,result:v?"Fail":"Success",errorType:le,errorCode:$,errorStatusCode:ie,errorMessage:re,errorServiceName:ce,errorRequestId:ee}),v&&(!$||!re)&&(this.params.fullError=v?JSON.stringify(v):""),this.params.name==="getObject"&&(this.params.size=W?W.headers&&W.headers["content-length"]:-1),this.params.reqUrl)try{var ae=/^http(s)?:\/\/(.*?)\//.exec(this.params.reqUrl);this.params.host=ae[2]}catch(ye){this.params.host=this.params.reqUrl}this.sendEvents()}},{key:"setParams",value:function(v){Object.assign(this.params,v)}},{key:"sendEvents",value:function(){if(!(X.includes(this.params.name)&&!this.deepTracker)){var v=j(this.params.name),W=Q(this.params);this.beacon||(this.beacon=N(this.delay||5e3)),this.delay===0?this.beacon&&this.beacon.onDirectUserAction(v,W):this.beacon&&this.beacon.onUserAction(v,W)}}},{key:"generateSubTracker",value:function(v){return Object.assign(v,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay}),new B(v)}}]),B}();g.exports=se},"./src/util.js":function(g,y,s){(function(h){var R=s("./node_modules/@babel/runtime/helpers/typeof.js"),c=s("./lib/md5.js"),x=s("./lib/crypto.js"),_=s("./lib/xml2json.js"),N=s("./lib/json2xml.js"),I=s("./lib/base64.js"),w=s("./src/tracker.js");function K(oe){return encodeURIComponent(oe).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function X(oe,a){var r=[];for(var n in oe)oe.hasOwnProperty(n)&&r.push(a?K(n).toLowerCase():n);return r.sort(function(o,f){return o=o.toLowerCase(),f=f.toLowerCase(),o===f?0:o>f?1:-1})}var V=function(a,r){var n,o,f,E=[],A=X(a);for(n=0;n-1||M.indexOf(o)>-1)&&(r[n]=a[n])}return r},ne=function(a){a=a||{};var r=a.SecretId,n=a.SecretKey,o=a.KeyTime,f=(a.method||a.Method||"get").toLowerCase(),E=U(a.Query||a.params||{}),A=j(U(a.Headers||a.headers||{})),G=a.Key||"",de;a.UseRawKey?de=a.Pathname||a.pathname||"/"+G:(de=a.Pathname||a.pathname||G,de.indexOf("/")!==0&&(de="/"+de));var he=a.ForceSignHost!==!1;if(!A.Host&&!A.host&&a.Bucket&&a.Region&&he&&(A.Host=a.Bucket+".cos."+a.Region+".myqcloud.com"),!r)throw new Error("missing param SecretId");if(!n)throw new Error("missing param SecretKey");var J=Math.round(ve(a.SystemClockOffset)/1e3)-1,ke=J,De=a.Expires||a.expires;De===void 0?ke+=900:ke+=De*1||0;var Me="sha1",Be=r,Fe=o||J+";"+ke,qe=o||J+";"+ke,Ve=X(A,!0).join(";").toLowerCase(),We=X(E,!0).join(";").toLowerCase(),ze=x.HmacSHA1(qe,n).toString(),Ge=[f,de,Ue.obj2str(E,!0),Ue.obj2str(A,!0),""].join(` `),Xe=["sha1",Fe,x.SHA1(Ge).toString(),""].join(` `),nt=x.HmacSHA1(Xe,ze).toString(),et=["q-sign-algorithm="+Me,"q-ak="+Be,"q-sign-time="+Fe,"q-key-time="+qe,"q-header-list="+Ve,"q-url-param-list="+We,"q-signature="+nt].join("&");return et},Q=function(a,r,n){var o=r/8,f=a.slice(n,n+o);return new Uint8Array(f).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[r](f)[0]},se=function(a,r,n,o){var f=a.slice(r,n),E="";return new Uint8Array(f).forEach(function(A){E+=String.fromCharCode(A)}),o&&(E=decodeURIComponent(escape(E))),E},B=function(a){for(var r={},n=se(a),o={records:[]};a.byteLength;){var f=Q(a,32,0),E=Q(a,32,4),A=f-E-16,G=0,de;for(a=a.slice(12);GparseInt(o[f])?1:-1;return 0},a=function(n){if(!n)return!1;var o=(n.match(/Chrome\/([.\d]+)/)||[])[1],f=(n.match(/QBCore\/([.\d]+)/)||[])[1],E=(n.match(/QQBrowser\/([.\d]+)/)||[])[1],A=o&&oe(o,"53.0.2785.116")<0&&f&&oe(f,"3.53.991.400")<0&&E&&oe(E,"9.0.2524.400")<=0||!1;return A};return a(typeof navigator!="undefined"&&navigator.userAgent)}(),H=function(a,r,n,o,f){var E;if(a.slice?E=a.slice(r,n):a.mozSlice?E=a.mozSlice(r,n):a.webkitSlice&&(E=a.webkitSlice(r,n)),o&&L){var A=new FileReader;A.onload=function(G){E=null,f(new Blob([A.result]))},A.readAsArrayBuffer(E)}else f(E)},P=function(a,r,n,o){n=n||v,a?typeof r=="string"?n(Ue.md5(r,!0)):Blob&&r instanceof Blob?Ue.getFileMd5(r,function(f,E){n(E)},o):n():n()},F=1024*1024,b=function(a,r,n){var o=a.size,f=0,E=c.getCtx(),A=function G(de){if(de>=o){var he=E.digest("hex");r(null,he);return}var J=Math.min(o,de+F);Ue.fileSlice(a,de,J,!1,function(ke){p(ke,function(De){ke=null,E=E.update(De,!0),f+=De.length,De=null,n&&n({loaded:f,total:o,percent:Math.round(f/o*1e4)/1e4}),G(de+F)})})};A(0)};function U(oe){return ee(oe,function(a){return R(a)==="object"&&a!==null?U(a):a})}function z(oe,a,r){return oe&&a in oe?oe[a]:r}function q(oe,a){return ie(a,function(r,n){oe[n]=a[n]}),oe}function $(oe){return oe instanceof Array}function re(oe,a){for(var r=!1,n=0;n-1,G=!E||typeof E=="string"&&E.indexOf("{Region}")>-1;if(a.indexOf("Bucket")>-1||a==="deleteMultipleObject"||a==="multipartList"||a==="listObjectVersions"){if(A&&!n)return"Bucket";if(G&&!o)return"Region"}else if(a.indexOf("Object")>-1||a.indexOf("multipart")>-1||a==="sliceUploadFile"||a==="abortUploadTask"){if(A&&!n)return"Bucket";if(G&&!o)return"Region";if(!f)return"Key"}return!1},te=function(a,r){if(r=q({},r),a!=="getAuth"&&a!=="getV4Auth"&&a!=="getObjectUrl"){var n=r.Headers||{};if(r&&R(r)==="object"){(function(){for(var f in r)r.hasOwnProperty(f)&&f.indexOf("x-cos-")>-1&&(n[f]=r[f])})();var o={"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"};Ue.each(o,function(f,E){r[f]!==void 0&&(n[E]=r[f])}),r.Headers=W(n)}}return r},pe=function(a,r){return function(n,o){var f=this;typeof n=="function"&&(o=n,n={}),n=te(a,n);var E;if(f.options.EnableTracker)if(n.calledBySdk==="sliceUploadFile")E=n.tracker&&n.tracker.generateSubTracker({apiName:a});else if(["uploadFile","uploadFiles"].includes(a))E=null;else{var A=-1;n.Body&&(A=typeof n.Body=="string"?n.Body.length:n.Body.size||n.Body.byteLength||-1),E=new w({bucket:n.Bucket,region:n.Region,apiName:a,fileKey:n.Key,fileSize:A,deepTracker:f.options.DeepTracker,customId:f.options.CustomId,delay:f.options.TrackerDelay})}n.tracker=E;var G=function(Be){return Be&&Be.headers&&(Be.headers["x-cos-request-id"]&&(Be.RequestId=Be.headers["x-cos-request-id"]),Be.headers["x-ci-request-id"]&&(Be.RequestId=Be.headers["x-ci-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},de=function(Be,Fe){E&&E.formatResult(Be,Fe),o&&o(G(Be),G(Fe))},he=function(){if(a!=="getService"&&a!=="abortUploadTask"){var Be=Y.call(f,a,n);if(Be)return"missing param "+Be;if(n.Region){if(f.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(n.Region))return"Region format error."}else{if(n.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(n.Region))return"Region format error."}!f.options.CompatibilityMode&&n.Region.indexOf("-")===-1&&n.Region!=="yfb"&&n.Region!=="default"&&n.Region!=="accelerate"&&console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(n.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(n.Bucket))if(n.AppId)n.Bucket=n.Bucket+"-"+n.AppId;else if(f.options.AppId)n.Bucket=n.Bucket+"-"+f.options.AppId;else return'Bucket should format as "test-1250000000".';n.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete n.AppId)}!f.options.UseRawKey&&n.Key&&n.Key.substr(0,1)==="/"&&(n.Key=n.Key.substr(1))}},J=he(),ke=["getAuth","getObjectUrl"].includes(a);if(typeof Promise=="function"&&!ke&&!o)return new Promise(function(Me,Be){if(o=function(qe,Ve){qe?Be(qe):Me(Ve)},J)return de(Ue.error(new Error(J)));r.call(f,n,de)});if(J)return de(Ue.error(new Error(J)));var De=r.call(f,n,de);if(ke)return De}},me=function(a,r){var n=this,o=0,f=0,E=Date.now(),A,G;function de(){if(G=0,r&&typeof r=="function"){A=Date.now();var he=Math.max(0,Math.round((f-o)/((A-E)/1e3)*100)/100)||0,J;f===0&&a===0?J=1:J=Math.floor(f/a*100)/100||0,E=A,o=f;try{r({loaded:f,total:a,speed:he,percent:J})}catch(ke){}}}return function(he,J){if(he&&(f=he.loaded,a=he.total),J)clearTimeout(G),de();else{if(G)return;G=setTimeout(de,n.options.ProgressInterval)}}},ge=function(a,r,n){var o;if(typeof r.Body=="string"?r.Body=new Blob([r.Body],{type:"text/plain"}):r.Body instanceof ArrayBuffer&&(r.Body=new Blob([r.Body])),r.Body&&(r.Body instanceof Blob||r.Body.toString()==="[object File]"||r.Body.toString()==="[object Blob]"))o=r.Body.size;else{n(Ue.error(new Error("params body format error, Only allow File|Blob|String.")));return}r.ContentLength=o,n(null,o)},ve=function(a){return Date.now()+(a||0)},Ce=function(a,r){var n=a;return a.message=a.message||null,typeof r=="string"?(a.error=r,a.message=r):R(r)==="object"&&r!==null&&(q(a,r),(r.code||r.name)&&(a.code=r.code||r.name),r.message&&(a.message=r.message),r.stack&&(a.stack=r.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(a,"name",{writable:!0,enumerable:!1}),Object.defineProperty(a,"message",{enumerable:!0})),a.name=r&&r.name||a.name||a.code||"Error",a.code||(a.code=a.name),a.error||(a.error=U(n)),a},Te=function(){return(typeof globalThis=="undefined"?"undefined":R(globalThis))==="object"&&(globalThis.constructor.name==="DedicatedWorkerGlobalScope"||globalThis.FileReaderSync)},Ee=function(){return(typeof window=="undefined"?"undefined":R(window))!=="object"&&(typeof h=="undefined"?"undefined":R(h))==="object"&&!0&&!Te()},we=function(a){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(a)},Ae=function(){if((typeof navigator=="undefined"?"undefined":R(navigator))!=="object")return!1;var oe=navigator.userAgent,a=!!oe.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return a}(),Pe=function(){return(typeof navigator=="undefined"?"undefined":R(navigator))!=="object"?!1:/\sQQ/i.test(navigator.userAgent)}(),je=function(a,r){var n=I.encode(a);return r&&(n=n.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),n},Ue={noop:v,formatParams:te,apiWrapper:pe,xml2json:_,json2xml:N,md5:c,clearKey:W,fileSlice:H,getBodyMd5:P,getFileMd5:b,b64:ae,extend:q,isArray:$,isInArray:re,makeArray:ce,each:ie,map:ee,filter:le,clone:U,attr:z,uuid:ye,camSafeUrlEncode:K,throttleOnProgress:me,getFileSize:ge,getSkewTime:ve,error:Ce,obj2str:V,getAuth:ne,parseSelectPayload:B,getSourceParams:S,isBrowser:!0,isNode:Ee,isCIHost:we,isIOS_QQ:Ae&&Pe,encodeBase64:je};g.exports=Ue}).call(this,s("./node_modules/process/browser.js"))}})})})(cosJsSdkV5);const COS=getDefaultExportFromCjs(cosJsSdkV5.exports),ossSwitch="tencent",tencentBucket="daya-online-1303457149",getUploadSign=g=>ct(void 0,null,function*(){const{bucketName:y,filename:s,postData:h}=g,R=ossSwitch;let c=y,x=s,_={};return c=tencentBucket,x="MECMP/"+s,_={key:"MECMP/"+h.key},service.post("/cbs-app/open/getUploadSign?pluginName="+R,{postData:_,pluginName:R,bucketName:c,filename:x})}),onFileUpload=({file:g,action:y,data:s,onProgress:h,onFinish:R,onError:c})=>{new COS({Domain:"https://oss.dayaedu.com",Protocol:"https",getAuthorization:(_,N)=>ct(void 0,null,function*(){N({Authorization:s.signature})})}).uploadFile({Bucket:tencentBucket,Region:"ap-nanjing",Key:`MECMP/${s.name}`,Body:s.file.file,SliceSize:1024*1024*500,onProgress:function(_){h({percent:Math.ceil((_.percent||0)*100)})}}).then(_=>{var N;((N=_.Location)==null?void 0:N.indexOf("http"))>=0?g.url=_.Location:g.url="https://"+_.Location,R()}).catch(_=>{console.log(_,"error"),c()})},onOnlyFileUpload=(g,y)=>ct(void 0,null,function*(){{let s="",h=null;if(yield new COS({Domain:"https://oss.dayaedu.com",getAuthorization:(c,x)=>ct(void 0,null,function*(){x({Authorization:y.signature})})}).uploadFile({Bucket:tencentBucket,Region:"ap-nanjing",Key:`MECMP/${y.name}`,Body:y.file,SliceSize:1024*1024*500}).then(c=>{var x;((x=c.Location)==null?void 0:x.indexOf("http"))>=0?s=c.Location:s="https://"+c.Location}).catch(c=>{h=c}),s)return s;throw new Error(h)}});export{onOnlyFileUpload as a,getUploadSign as g,onFileUpload as o};