oss-file-upload.d2b5f9e0.js 195 KB

123456789101112
  1. 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.1121c4e8.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<U;b++)F[P.charAt(b)]=b;return F}(x),N=String.fromCharCode,I=function(F){if(F.length<2){var b=F.charCodeAt(0);return b<128?F:b<2048?N(192|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;o<f;o++)for(var E in n=arguments[o])Object.prototype.hasOwnProperty.call(n,E)&&(r[E]=n[E]);return r},_.apply(this,arguments)};function N(a,r,n,o){return new(n||(n=Promise))(function(f,E){function A(he){try{de(o.next(he))}catch(J){E(J)}}function G(he){try{de(o.throw(he))}catch(J){E(J)}}function de(he){var J;he.done?f(he.value):(J=he.value,J instanceof n?J:new n(function(ke){ke(J)})).then(A,G)}de((o=o.apply(a,r||[])).next())})}function I(a,r){var n,o,f,E,A={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return E={next:G(0),throw:G(1),return:G(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function G(de){return function(he){return function(J){if(n)throw new TypeError("Generator is already executing.");for(;A;)try{if(n=1,o&&(f=2&J[0]?o.return:J[0]?o.throw||((f=o.return)&&f.call(o),0):o.next)&&!(f=f.call(o,J[1])).done)return f;switch(o=0,f&&(J=[2&J[0],f.value]),J[0]){case 0:case 1:f=J;break;case 4:return A.label++,{value:J[1],done:!1};case 5:A.label++,o=J[1],J=[0];continue;case 7:J=A.ops.pop(),A.trys.pop();continue;default:if(f=A.trys,!((f=f.length>0&&f[f.length-1])||J[0]!==6&&J[0]!==2)){A=0;continue}if(J[0]===3&&(!f||J[1]>f[0]&&J[1]<f[3])){A.label=J[1];break}if(J[0]===6&&A.label<f[1]){A.label=f[1],f=J;break}if(f&&A.label<f[2]){A.label=f[2],A.ops.push(J);break}f[2]&&A.ops.pop(),A.trys.pop();continue}J=r.call(a,A)}catch(ke){J=[6,ke],o=0}finally{n=f=0}if(5&J[0])throw J[1];return{value:J[0]?J[1]:void 0,done:!0}}([de,he])}}}var w="__BEACON_",K="__BEACON_deviceId",X="last_report_time",V="sending_event_ids",M="beacon_config",j="beacon_config_request_time",ne=function(){function a(){var r=this;this.emit=function(n,o){if(r){var f,E=r.__EventsList[n];if(E!=null&&E.length){E=E.slice();for(var A=0;A<E.length;A++){f=E[A];try{var G=f.callback.apply(r,[o]);if(f.type===1&&r.remove(n,f.callback),G===!1)break}catch(de){throw de}}}return r}},this.__EventsList={}}return a.prototype.indexOf=function(r,n){for(var o=0;o<r.length;o++)if(r[o].callback===n)return o;return-1},a.prototype.on=function(r,n,o){if(o===void 0&&(o=0),this){var f=this.__EventsList[r];if(f||(f=this.__EventsList[r]=[]),this.indexOf(f,n)===-1){var E={name:r,type:o||0,callback:n};return f.push(E),this}return this}},a.prototype.one=function(r,n){this.on(r,n,1)},a.prototype.remove=function(r,n){if(this){var o=this.__EventsList[r];if(!o)return null;if(!n){try{delete this.__EventsList[r]}catch(E){}return null}if(o.length){var f=this.indexOf(o,n);o.splice(f,1)}return this}},a}();function Q(a,r){for(var n={},o=0,f=Object.keys(a);o<f.length;o++){var E=f[o],A=a[E];if(typeof A=="string")n[se(E)]=se(A);else{if(r)throw new Error("value mast be string !!!!");n[se(String(E))]=se(String(A))}}return n}function se(a){if(typeof a!="string")return a;try{return a.replace(new RegExp("\\|","g"),"%7C").replace(new RegExp("\\&","g"),"%26").replace(new RegExp("\\=","g"),"%3D").replace(new RegExp("\\+","g"),"%2B")}catch(r){return""}}function B(a){return String(a.A99)+String(a.A100)}var S=function(){},v=function(){function a(r){var n=this;this.lifeCycle=new ne,this.uploadJobQueue=[],this.additionalParams={},this.delayTime=0,this._normalLogPipeline=function(o){if(!o||!o.reduce||!o.length)throw new TypeError("createPipeline \u65B9\u6CD5\u9700\u8981\u4F20\u5165\u81F3\u5C11\u6709\u4E00\u4E2A pipe \u7684\u6570\u7EC4");return o.length===1?function(f,E){o[0](f,E||S)}:o.reduce(function(f,E){return function(A,G){return G===void 0&&(G=S),f(A,function(de){return E==null?void 0:E(de,G)})}})}([function(o){n.send({url:n.strategy.getUploadUrl(),data:o,method:"post",contentType:"application/json;charset=UTF-8"},function(){var f=n.config.onReportSuccess;typeof f=="function"&&f(JSON.stringify(o.events))},function(){var f=n.config.onReportFail;typeof f=="function"&&f(JSON.stringify(o.events))})}]),function(o,f){if(!o)throw f instanceof Error?f:new Error(f)}(Boolean(r.appkey),"appkey must be initial"),this.config=_({},r)}return a.prototype.onUserAction=function(r,n){this.preReport(r,n,!1)},a.prototype.onDirectUserAction=function(r,n){this.preReport(r,n,!0)},a.prototype.preReport=function(r,n,o){r?this.strategy.isEventUpOnOff()&&(this.strategy.isBlackEvent(r)||this.strategy.isSampleEvent(r)||this.onReport(r,n,o)):this.errorReport.reportError("602"," no eventCode")},a.prototype.addAdditionalParams=function(r){for(var n=0,o=Object.keys(r);n<o.length;n++){var f=o[n];this.additionalParams[f]=r[f]}},a.prototype.setChannelId=function(r){this.commonInfo.channelID=String(r)},a.prototype.setOpenId=function(r){this.commonInfo.openid=String(r)},a.prototype.setUnionid=function(r){this.commonInfo.unid=String(r)},a.prototype.getDeviceId=function(){return this.commonInfo.deviceId},a.prototype.getCommonInfo=function(){return this.commonInfo},a.prototype.removeSendingId=function(r){try{var n=JSON.parse(this.storage.getItem(V)),o=n.indexOf(r);o!=-1&&(n.splice(o,1),this.storage.setItem(V,JSON.stringify(n)))}catch(f){}},a}(),W=function(){function a(r,n,o,f){this.requestParams={},this.network=f,this.requestParams.attaid="00400014144",this.requestParams.token="6478159937",this.requestParams.product_id=r.appkey,this.requestParams.platform=o,this.requestParams.uin=n.deviceId,this.requestParams.model="",this.requestParams.os=o,this.requestParams.app_version=r.appVersion,this.requestParams.sdk_version=n.sdkVersion,this.requestParams.error_stack="",this.uploadUrl=r.isOversea?"https://htrace.wetvinfo.com/kv":"https://h.trace.qq.com/kv"}return a.prototype.reportError=function(r,n){this.requestParams._dc=Math.random(),this.requestParams.error_msg=n,this.requestParams.error_code=r,this.network.get(this.uploadUrl,{params:this.requestParams}).catch(function(o){})},a}(),p=function(){function a(r,n,o,f,E){this.strategy={isEventUpOnOff:!0,httpsUploadUrl:"https://otheve.beacon.qq.com/analytics/v2_upload",requestInterval:30,blacklist:[],samplelist:[]},this.realSample={},this.appkey="",this.needQueryConfig=!0,this.appkey=n.appkey,this.storage=f,this.needQueryConfig=r;try{var A=JSON.parse(this.storage.getItem(M));A&&this.processData(A)}catch(G){}n.isOversea&&(this.strategy.httpsUploadUrl="https://svibeacon.onezapp.com/analytics/v2_upload"),!n.isOversea&&this.needRequestConfig()&&this.requestConfig(n.appVersion,o,E)}return a.prototype.requestConfig=function(r,n,o){var f=this;this.storage.setItem(j,Date.now().toString()),o.post("https://oth.str.beacon.qq.com/trpc.beacon.configserver.BeaconConfigService/QueryConfig",{platformId:typeof wx=="undefined"?"3":"4",mainAppKey:this.appkey,appVersion:r,sdkVersion:n.sdkVersion,osVersion:n.userAgent,model:"",packageName:"",params:{A3:n.deviceId}}).then(function(E){if(E.data.ret==0)try{var A=JSON.parse(E.data.beaconConfig);A&&(f.processData(A),f.storage.setItem(M,E.data.beaconConfig))}catch(G){}else f.processData(null),f.storage.setItem(M,"")}).catch(function(E){})},a.prototype.processData=function(r){var n,o,f,E,A;this.strategy.isEventUpOnOff=(n=r==null?void 0:r.isEventUpOnOff)!==null&&n!==void 0?n:this.strategy.isEventUpOnOff,this.strategy.httpsUploadUrl=(o=r==null?void 0:r.httpsUploadUrl)!==null&&o!==void 0?o:this.strategy.httpsUploadUrl,this.strategy.requestInterval=(f=r==null?void 0:r.requestInterval)!==null&&f!==void 0?f:this.strategy.requestInterval,this.strategy.blacklist=(E=r==null?void 0:r.blacklist)!==null&&E!==void 0?E:this.strategy.blacklist,this.strategy.samplelist=(A=r==null?void 0:r.samplelist)!==null&&A!==void 0?A:this.strategy.samplelist;for(var G=0,de=this.strategy.samplelist;G<de.length;G++){var he=de[G].split(",");he.length==2&&(this.realSample[he[0]]=he[1])}},a.prototype.needRequestConfig=function(){if(!this.needQueryConfig)return!1;var r=Number(this.storage.getItem(j));return Date.now()-r>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]<Math.floor(Math.random()*Math.floor(1e4))},a}(),L="session_storage_key",H=function(){function a(r,n,o){this.getSessionStackDepth=0,this.beacon=o,this.storage=r,this.duration=n,this.appkey=o.config.appkey}return a.prototype.getSession=function(){this.getSessionStackDepth+=1;var r=this.storage.getItem(L);if(!r)return this.createSession();var n="",o=0;try{var f=JSON.parse(r)||{sessionId:void 0,sessionStart:void 0};if(!f.sessionId||!f.sessionStart)return this.createSession();var E=Number(this.storage.getItem(X));if(Date.now()-E>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;o<f;o++)for(var E in n=arguments[o])Object.prototype.hasOwnProperty.call(n,E)&&(r[E]=n[E]);return r}).apply(this,arguments)},U,z=function(){function a(r,n){n===void 0&&(n={}),this.reportOptions={},this.config=r,this.reportOptions=n}return a.canUseDB=function(){return!!(window!=null&&window.indexedDB)},a.prototype.openDB=function(){var r=this;return new Promise(function(n,o){if(!a.canUseDB())return o({message:"\u5F53\u524D\u4E0D\u652F\u6301 indexeddb"});var f=r.config,E=f.name,A=f.version,G=f.stores,de=indexedDB.open(E,A);de.onsuccess=function(){r.db=de.result,n(),b({result:1,func:"open",params:JSON.stringify(r.config)},r.reportOptions)},de.onerror=function(he){var J,ke;o(he),b({result:0,func:"open",params:JSON.stringify(r.config),error_msg:(ke=(J=he.target)===null||J===void 0?void 0:J.error)===null||ke===void 0?void 0:ke.message},r.reportOptions)},de.onupgradeneeded=function(){r.db=de.result;try{G==null||G.forEach(function(he){r.createStore(he)})}catch(he){b({result:0,func:"open",params:JSON.stringify(r.config),error_msg:he.message},r.reportOptions),o(he)}}})},a.prototype.useStore=function(r){return this.storeName=r,this},a.prototype.deleteDB=function(){var r=this;return this.closeDB(),new Promise(function(n,o){var f=indexedDB.deleteDatabase(r.config.name);f.onsuccess=function(){return n()},f.onerror=o})},a.prototype.closeDB=function(){var r;(r=this.db)===null||r===void 0||r.close(),this.db=null},a.prototype.getStoreCount=function(){var r=this;return new Promise(function(n,o){var f=r.getStore("readonly").count();f.onsuccess=function(){return n(f.result)},f.onerror=o})},a.prototype.clearStore=function(){var r=this;return new Promise(function(n,o){var f=r.getStore("readwrite").clear();f.onsuccess=function(){return n()},f.onerror=o})},a.prototype.add=function(r,n){var o=this;return new Promise(function(f,E){var A=o.getStore("readwrite").add(r,n);A.onsuccess=function(){f(A.result)},A.onerror=E})},a.prototype.put=function(r,n){var o=this;return new Promise(function(f,E){var A=o.getStore("readwrite").put(r,n);A.onsuccess=function(){f(A.result)},A.onerror=E})},a.prototype.getStoreAllData=function(){var r=this;return new Promise(function(n,o){var f=r.getStore("readonly").openCursor(),E=[];f.onsuccess=function(){var A;if(!((A=f.result)===null||A===void 0)&&A.value){var G=f.result.value;E.push(G),f.result.continue()}else n(E)},f.onerror=o})},a.prototype.getDataRangeByIndex=function(r,n,o,f,E){var A=this;return new Promise(function(G,de){var he=A.getStore().index(r),J=IDBKeyRange.bound(n,o,f,E),ke=[],De=he.openCursor(J);De.onsuccess=function(){var Me;!((Me=De==null?void 0:De.result)===null||Me===void 0)&&Me.value?(ke.push(De==null?void 0:De.result.value),De==null||De.result.continue()):G(ke)},De.onerror=de})},a.prototype.removeDataByIndex=function(r,n,o,f,E){var A=this;return new Promise(function(G,de){var he=A.getStore("readwrite").index(r),J=IDBKeyRange.bound(n,o,f,E),ke=he.openCursor(J),De=0;ke.onsuccess=function(Me){var Be=Me.target.result;Be?(De+=1,Be.delete(),Be.continue()):G(De)},ke.onerror=de})},a.prototype.createStore=function(r){var n=r.name,o=r.indexes,f=o===void 0?[]:o,E=r.options;if(this.db){this.db.objectStoreNames.contains(n)&&this.db.deleteObjectStore(n);var A=this.db.createObjectStore(n,E);f.forEach(function(G){A.createIndex(G.indexName,G.keyPath,G.options)})}},a.prototype.getStore=function(r){var n;return r===void 0&&(r="readonly"),(n=this.db)===null||n===void 0?void 0:n.transaction(this.storeName,r).objectStore(this.storeName)},a}(),q="event_table_v3",$="eventId",re=function(){function a(r){this.isReady=!1,this.taskQueue=Promise.resolve(),this.db=new z({name:"Beacon_"+r+"_V3",version:1,stores:[{name:q,options:{keyPath:$},indexes:[{indexName:$,keyPath:$,options:{unique:!0}}]}]}),this.open()}return a.prototype.getCount=function(){var r=this;return this.readyExec(function(){return r.db.getStoreCount()})},a.prototype.setItem=function(r,n){var o=this;return this.readyExec(function(){return o.db.add({eventId:r,value:n})})},a.prototype.getItem=function(r){return N(this,void 0,void 0,function(){var n=this;return I(this,function(o){return[2,this.readyExec(function(){return n.db.getDataRangeByIndex($,r,r)})]})})},a.prototype.removeItem=function(r){var n=this;return this.readyExec(function(){return n.db.removeDataByIndex($,r,r)})},a.prototype.updateItem=function(r,n){var o=this;return this.readyExec(function(){return o.db.put({eventId:r,value:n})})},a.prototype.iterate=function(r){var n=this;return this.readyExec(function(){return n.db.getStoreAllData().then(function(o){o.forEach(function(f){r(f.value)})})})},a.prototype.open=function(){return N(this,void 0,void 0,function(){var r=this;return I(this,function(n){switch(n.label){case 0:return this.taskQueue=this.taskQueue.then(function(){return r.db.openDB()}),[4,this.taskQueue];case 1:return n.sent(),this.isReady=!0,this.db.useStore(q),[2]}})})},a.prototype.readyExec=function(r){return this.isReady?r():(this.taskQueue=this.taskQueue.then(function(){return r()}),this.taskQueue)},a}(),ce=function(){function a(r){this.keyObject={},this.storage=r}return a.prototype.getCount=function(){return this.storage.getStoreCount()},a.prototype.removeItem=function(r){this.storage.removeItem(r),delete this.keyObject[r]},a.prototype.setItem=function(r,n){var o=JSON.stringify(n);this.storage.setItem(r,o),this.keyObject[r]=n},a.prototype.iterate=function(r){for(var n=Object.keys(this.keyObject),o=0;o<n.length;o++){var f=this.storage.getItem(n[o]);r(JSON.parse(f))}},a}(),ie=function(){function a(r,n){var o=this;this.dbEventCount=0,P()>0||!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;o<f;o++)for(var E in n=arguments[o])Object.prototype.hasOwnProperty.call(n,E)&&(r[E]=n[E]);return r}).apply(this,arguments)};function le(a){try{return decodeURIComponent(a.replace(/\+/g," "))}catch(r){return null}}function ae(a,r){var n=[null,void 0,"",NaN].includes(a);if(r.isSkipEmpty&&n)return null;var o=!r.isSkipEmpty&&n?"":a;try{return r.encode?encodeURIComponent(o):o}catch(f){return null}}function ye(a,r){r===void 0&&(r={encode:!0,isSkipEmpty:!1});var n=a.url,o=a.query,f=o===void 0?{}:o,E=a.hash,A=n.split("#"),G=A[0],de=A[1],he=de===void 0?"":de,J=G.split("?")[0],ke=[],De=ae(E||he,r),Me=ee(ee({},function(Be){var Fe=Be.split("#"),qe=Fe[0],Ve=Fe[1],We=Ve===void 0?"":Ve,ze=qe.split("?"),Ge=ze[0],Xe=ze[1],nt=Xe===void 0?"":Xe,et=le(We),rt=Object.create(null);return nt.split("&").forEach(function(i){var l=i.split("="),k=l[0],D=l[1],fe=D===void 0?"":D,be=le(k),Ne=le(fe);be===null||Ne===null||be===""&&Ne===""||rt[be]||(rt[be]=Ne)}),{url:Ge,query:rt,hash:et}}(n).query),f);return Object.keys(Me).forEach(function(Be){var Fe=ae(Be,r),qe=ae(Me[Be],r);Fe!==null&&qe!==null&&ke.push(Fe+"="+qe)}),J+(ke.length?"?"+ke.join("&"):"")+(De?"#"+De:"")}function Y(a,r){return new Promise(function(n,o){if(r&&document.querySelectorAll("script[data-tag="+r+"]").length)return n();var f=document.createElement("script"),E=ee({type:"text/javascript",charset:"utf-8"},a);Object.keys(E).forEach(function(A){return function(G,de,he){if(G)return he===void 0?G.getAttribute(de):G.setAttribute(de,he)}(f,A,E[A])}),r&&(f.dataset.tag=r),f.onload=function(){return n()},f.onreadystatechange=function(){var A=f.readyState;["complete","loaded"].includes(A)&&(f.onreadystatechange=null,n())},f.onerror=o,document.body.appendChild(f)})}(function(a){a[a.equal=0]="equal",a[a.low=-1]="low",a[a.high=1]="high"})(U||(U={}));var te=function(){return(te=Object.assign||function(r){for(var n,o=1,f=arguments.length;o<f;o++)for(var E in n=arguments[o])Object.prototype.hasOwnProperty.call(n,E)&&(r[E]=n[E]);return r}).apply(this,arguments)};function pe(a,r,n,o){return new(n||(n=Promise))(function(f,E){function A(he){try{de(o.next(he))}catch(J){E(J)}}function G(he){try{de(o.throw(he))}catch(J){E(J)}}function de(he){var J;he.done?f(he.value):(J=he.value,J instanceof n?J:new n(function(ke){ke(J)})).then(A,G)}de((o=o.apply(a,r||[])).next())})}function me(a,r){var n,o,f,E,A={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return E={next:G(0),throw:G(1),return:G(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function G(de){return function(he){return function(J){if(n)throw new TypeError("Generator is already executing.");for(;A;)try{if(n=1,o&&(f=2&J[0]?o.return:J[0]?o.throw||((f=o.return)&&f.call(o),0):o.next)&&!(f=f.call(o,J[1])).done)return f;switch(o=0,f&&(J=[2&J[0],f.value]),J[0]){case 0:case 1:f=J;break;case 4:return A.label++,{value:J[1],done:!1};case 5:A.label++,o=J[1],J=[0];continue;case 7:J=A.ops.pop(),A.trys.pop();continue;default:if(!((f=(f=A.trys).length>0&&f[f.length-1])||J[0]!==6&&J[0]!==2)){A=0;continue}if(J[0]===3&&(!f||J[1]>f[0]&&J[1]<f[3])){A.label=J[1];break}if(J[0]===6&&A.label<f[1]){A.label=f[1],f=J;break}if(f&&A.label<f[2]){A.label=f[2],A.ops.push(J);break}f[2]&&A.ops.pop(),A.trys.pop();continue}J=r.call(a,A)}catch(ke){J=[6,ke],o=0}finally{n=f=0}if(5&J[0])throw J[1];return{value:J[0]?J[1]:void 0,done:!0}}([de,he])}}}var ge=function(){function a(){this.interceptors=[]}return a.prototype.use=function(r,n){return this.interceptors.push({resolved:r,rejected:n}),this.interceptors.length-1},a.prototype.traverse=function(r,n){n===void 0&&(n=!1);var o=Promise.resolve(r);return(n?Array.prototype.reduceRight:Array.prototype.reduce).call(this.interceptors,function(f,E){if(E){var A=E.resolved,G=E.rejected;o=o.then(A,G)}return f},""),o},a.prototype.eject=function(r){this.interceptors[r]&&(this.interceptors[r]=null)},a}(),ve={defaults:{timeout:0,method:"GET",mode:"cors",redirect:"follow",credentials:"same-origin"},headers:{common:{Accept:"application/json, text/plain, */*"},POST:{"Content-Type":"application/x-www-form-urlencoded"},PUT:{"Content-Type":"application/x-www-form-urlencoded"},PATCH:{"Content-Type":"application/x-www-form-urlencoded"}},baseURL:"",polyfillUrl:"https://vm.gtimg.cn/comps/script/fetch.min.js",interceptors:{request:new ge,response:new ge}},Ce=/^([a-z][a-z\d+\-.]*:)?\/\//i,Te=Object.prototype.toString;function Ee(a){return pe(this,void 0,void 0,function(){var r;return me(this,function(n){switch(n.label){case 0:if(window.fetch)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Y({src:a})];case 2:return n.sent(),[3,4];case 3:throw r=n.sent(),new Error("\u52A0\u8F7D polyfill "+a+" \u5931\u8D25: "+r.message);case 4:return[2]}})})}function we(a){return["Accept","Content-Type"].forEach(function(r){return n=r,void((o=a.headers)&&Object.keys(o).forEach(function(f){f!==n&&f.toUpperCase()===n.toUpperCase()&&(o[n]=o[f],delete o[f])}));var n,o}),function(r){if(Te.call(r)!=="[object Object]")return!1;var n=Object.getPrototypeOf(r);return n===null||n===Object.prototype}(a.body)&&(a.body=JSON.stringify(a.body),a.headers&&(a.headers["Content-Type"]="application/json;charset=utf-8")),a}function Ae(a){return pe(this,void 0,void 0,function(){var r,n,o,f,E,A,G,de,he,J,ke,De,Me,Be,Fe,qe,Ve;return me(this,function(We){switch(We.label){case 0:return r=ve.baseURL,n=ve.defaults,o=ve.interceptors,[4,Ee(ve.polyfillUrl)];case 1:return We.sent(),(f=te(te({},n),a)).headers||(f.headers=function(ze){ze===void 0&&(ze="GET");var Ge=ve.headers[ze]||{};return te(te({},ve.headers.common),Ge)}(f.method)),we(f),[4,o.request.traverse(f,!0)];case 2:if((E=We.sent())instanceof Error)throw E;return E.url=function(ze,Ge){return!ze||Ce.test(Ge)?Ge:ze.replace(/\/+$/,"")+"/"+Ge.replace(/^\/+/,"")}(r,E.url),A=E.url,G=E.timeout,de=E.params,he=E.method,J=["GET","DELETE","OPTIONS","HEAD"].includes(he===void 0?"GET":he)&&!!de,ke=J?ye({url:A,query:de}):A,De=[],G&&!E.signal&&(Fe=new Promise(function(ze){Me=setTimeout(function(){ze(new Error("timeout"))},G)}),De.push(Fe),Be=new AbortController,E.signal=Be.signal),De.push(fetch(ke,E).catch(function(ze){return ze})),[4,Promise.race(De)];case 3:return qe=We.sent(),Me&&clearTimeout(Me),[4,o.response.traverse(qe)];case 4:if((Ve=We.sent())instanceof Error)throw Be==null||Be.abort(),Ve;return[2,Ve]}})})}var Pe=function(){function a(r){ve.interceptors.request.use(function(n){var o=n.url,f=n.method,E=n.body,A=E;if(r.onReportBeforeSend){var G=r.onReportBeforeSend({url:o,method:f,data:E?JSON.parse(E):null});A=G!=null&&G.data?JSON.stringify(G.data):null}return f!="GET"&&A?_(_({},n),{body:A}):n})}return a.prototype.get=function(r,n){return N(this,void 0,void 0,function(){var o,f;return I(this,function(E){switch(E.label){case 0:return[4,Ae(_({url:r},n))];case 1:return[4,(o=E.sent()).json()];case 2:return f=E.sent(),[2,Promise.resolve({data:f,status:o.status,statusText:o.statusText,headers:o.headers})]}})})},a.prototype.post=function(r,n,o){return N(this,void 0,void 0,function(){var f,E;return I(this,function(A){switch(A.label){case 0:return[4,Ae(_({url:r,body:n,method:"POST"},o))];case 1:return[4,(f=A.sent()).json()];case 2:return E=A.sent(),[2,Promise.resolve({data:E,status:f.status,statusText:f.statusText,headers:f.headers})]}})})},a}(),je=function(){function a(r){this.appkey=r}return a.prototype.getItem=function(r){try{return window.localStorage.getItem(this.getStoreKey(r))}catch(n){return""}},a.prototype.removeItem=function(r){try{window.localStorage.removeItem(this.getStoreKey(r))}catch(n){}},a.prototype.setItem=function(r,n){try{window.localStorage.setItem(this.getStoreKey(r),n)}catch(o){}},a.prototype.setSessionItem=function(r,n){try{window.sessionStorage.setItem(this.getStoreKey(r),n)}catch(o){}},a.prototype.getSessionItem=function(r){try{return window.sessionStorage.getItem(this.getStoreKey(r))}catch(n){return""}},a.prototype.getStoreKey=function(r){return w+this.appkey+"_"+r},a.prototype.createDeviceId=function(){try{var r=window.localStorage.getItem(K);return r||(r=function(n){for(var o="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz0123456789",f="",E=0;E<n;E++)f+=o.charAt(Math.floor(Math.random()*o.length));return f}(32),window.localStorage.setItem(K,r)),r}catch(n){return""}},a.prototype.clear=function(){try{for(var r=window.localStorage.length,n=0;n<r;n++){var o=window.localStorage.key(n);(o==null?void 0:o.substr(0,9))==w&&window.localStorage.removeItem(o)}}catch(f){}},a.prototype.getStoreCount=function(){var r=0;try{r=window.localStorage.length}catch(n){}return r},a}(),Ue="logid_start",oe="4.5.14-web";return function(a){function r(n){var o=a.call(this,n)||this;o.qimei36="",o.uselessCycleTaskNum=0,o.underWeakNet=!1,o.pauseSearching=!1,o.send=function(G,de,he){o.storage.setItem(X,Date.now().toString()),o.network.post(o.uploadUrl||o.strategy.getUploadUrl(),G.data).then(function(J){var ke;((ke=J==null?void 0:J.data)===null||ke===void 0?void 0:ke.result)==100?o.delayTime=1e3*J.data.delayTime:o.delayTime=0,de&&de(G.data),G.data.events.forEach(function(De){o.store.removeEvent(De).then(function(){o.removeSendingId(B(De.mapValue))})}),o.doCustomCycleTask()}).catch(function(J){var ke=G.data.events;o.errorReport.reportError(J.code?J.code.toString():"600",J.message),he&&he(G.data);var De=JSON.parse(o.storage.getItem(V));ke.forEach(function(Me){De&&De.indexOf(B(Me))!=-1&&o.store.insertEvent(Me,function(Be,Fe){Be&&o.errorReport.reportError("604","insertEvent fail!")}),o.removeSendingId(B(Me))}),o.monitorUploadFailed()})};var f,E,A=P();return o.isUnderIE8=A>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<S;L++)v[p+L>>>2]|=(W[L>>>2]>>>24-8*(L%4)&255)<<24-8*((p+L)%4);else if(65535<W.length)for(L=0;L<S;L+=4)v[p+L>>>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<S;W+=4)v.push(4294967296*x.random()|0);return new X.init(v,S)}}),V=N.enc={},M=V.Hex={stringify:function(S){var v=S.words;S=S.sigBytes;for(var W=[],p=0;p<S;p++){var L=v[p>>>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<v;p+=2)W[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<S;p++)W.push(String.fromCharCode(v[p>>>2]>>>24-8*(p%4)&255));return W.join("")},parse:function(S){for(var v=S.length,W=[],p=0;p<v;p++)W[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;P<S;P+=L)this._doProcessBlock(W,P);P=W.splice(0,S),v.sigBytes-=p}return new X.init(P,p)},clone:function(){var S=K.clone.call(this);return S._data=this._data.clone(),S},_minBufferSize:0});I.Hasher=Q.extend({cfg:K.extend(),init:function(S){this.cfg=this.cfg.extend(S),this.reset()},reset:function(){Q.reset.call(this),this._doReset()},update:function(S){return this._append(S),this._process(),this},finalize:function(S){return S&&this._append(S),this._doFinalize()},blockSize:16,_createHelper:function(S){return function(v,W){return new S.init(W).finalize(v)}},_createHmacHelper:function(S){return function(v,W){return new se.HMAC.init(S,W).finalize(v)}}});var se=N.algo={};return N}(Math);(function(){var x=c,w=x.lib,_=w.WordArray,N=w.Hasher,I=[],w=x.algo.SHA1=N.extend({_doReset:function(){this._hash=new _.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(X,V){for(var M=this._hash.words,j=M[0],ne=M[1],Q=M[2],se=M[3],B=M[4],S=0;80>S;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<K;Q++)j[Q]^=1549556828,ne[Q]^=909522486;V.sigBytes=M.sigBytes=X,this.reset()},reset:function(){var I=this._hasher;I.reset(),I.update(this._iKey)},update:function(I){return this._hasher.update(I),this},finalize:function(I){var w=this._hasher;return I=w.finalize(I),w.reset(),w.finalize(this._oKey.clone().concat(I))}})}(),function(){var x=c,_=x.lib,N=_.WordArray,I=x.enc;I.Base64={stringify:function(K){var X=K.words,V=K.sigBytes,M=this._map;K.clamp();for(var j=[],ne=0;ne<V;ne+=3)for(var Q=X[ne>>>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<V;v++)j.push(M.charAt(S>>>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<X;se++)if(se%4){var B=V.indexOf(K.charAt(se-1))<<se%4*2,S=V.indexOf(K.charAt(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?`
  2. `+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(Q),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(`
  3. `),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;L<Q[p].length;L++)Q[p].hasOwnProperty(L)&&W.push(j(p,ne(Q[p][L],0,B+1),null,B+1,N(Q[p][L]).length));else W.push(j(p,ne(Q[p],0,B+1),null,B+1));return M.prettyPrint&&W.length>0&&W.push(`
  4. `),W.join("");case"function":return Q();default:return M.escape?K(Q):""+Q}}(V,0,0)},w=function(V){var M=['<?xml version="1.0" encoding="UTF-8"'];return V&&M.push(' standalone="yes"'),M.push("?>"),M.join("")};function K(X){return(""+X).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").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="<!DOCTYPE "+V.docType+">")):M=w()),V=V||{};var ne=[M,V.prettyPrint&&j?`
  5. `:"",j,I(X,V)];return ne.join("").replace(/\n{2,}/g,`
  6. `).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<OUTPUT_TYPES.length;++s){var h=OUTPUT_TYPES[s];y[h]=createOutputMethod(h)}return y},nodeWrap=function nodeWrap(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function g(y){if(typeof y=="string")return crypto.createHash("md5").update(y,"utf8").digest("hex");if(y==null)throw ERROR;return y.constructor===ArrayBuffer&&(y=new Uint8Array(y)),Array.isArray(y)||ArrayBuffer.isView(y)||y.constructor===Buffer?crypto.createHash("md5").update(new Buffer(y)).digest("hex"):method(y)};return nodeMethod};function Md5(g){if(g)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var y=new ArrayBuffer(68);this.buffer8=new Uint8Array(y),this.blocks=new Uint32Array(y)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(g,y){if(!this.finalized){for(var s,h=0,R,c=g.length,x=this.blocks,_=this.buffer8;h<c;){if(this.hashed&&(this.hashed=!1,x[0]=x[16],x[16]=x[1]=x[2]=x[3]=x[4]=x[5]=x[6]=x[7]=x[8]=x[9]=x[10]=x[11]=x[12]=x[13]=x[14]=x[15]=0),ARRAY_BUFFER)for(R=this.start;h<c&&R<64;++h)s=g.charCodeAt(h),y||s<128?_[R++]=s:s<2048?(_[R++]=192|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<c&&R<64;++h)s=g.charCodeAt(h),y||s<128?x[R>>2]|=s<<SHIFT[R++&3]:s<2048?(x[R>>2]|=(192|s>>6)<<SHIFT[R++&3],x[R>>2]|=(128|s&63)<<SHIFT[R++&3]):s<55296||s>=57344?(x[R>>2]|=(224|s>>12)<<SHIFT[R++&3],x[R>>2]|=(128|s>>6&63)<<SHIFT[R++&3],x[R>>2]|=(128|s&63)<<SHIFT[R++&3]):(s=65536+((s&1023)<<10|g.charCodeAt(++h)&1023),x[R>>2]|=(240|s>>18)<<SHIFT[R++&3],x[R>>2]|=(128|s>>12&63)<<SHIFT[R++&3],x[R>>2]|=(128|s>>6&63)<<SHIFT[R++&3],x[R>>2]|=(128|s&63)<<SHIFT[R++&3]);this.lastByteIndex=R,this.bytes+=R-this.start,R>=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(`
  7. `).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<N.childNodes.length;se++)j=N.childNodes.item(se),j.nodeType===4?x.mergeCDATA&&(V+=j.nodeValue):j.nodeType===3?V+=j.nodeValue:j.nodeType===1&&(X===0&&(K={}),x.stripElemPrefix?ne=j.nodeName.replace(_,""):ne=j.nodeName,Q=R.parseXML(j),K.hasOwnProperty(ne)?(K[ne].constructor!==Array&&(K[ne]=[K[ne]]),K[ne].push(Q)):(K[ne]=Q,X++));return Object.keys(K).length||(K=V||""),K},this.xmlToString=function(N){try{var I=N.xml?N.xml:new XMLSerializer().serializeToString(N);return I}catch(w){return null}},this.stringToXML=function(N){try{var I=null;if(window.DOMParser){var w=new h;return I=w.parseFromString(N,"text/xml"),I}else return I=new ActiveXObject("Microsoft.XMLDOM"),I.async=!1,I.loadXML(N),I}catch(K){return null}},this}.call({}),c=function(_){return R.parseString(_)};g.exports=c},"./node_modules/@babel/runtime/helpers/classCallCheck.js":function(g,y){function s(h,R){if(!(h instanceof R))throw new TypeError("Cannot call a class as a function")}g.exports=s,g.exports.__esModule=!0,g.exports.default=g.exports},"./node_modules/@babel/runtime/helpers/createClass.js":function(g,y){function s(R,c){for(var x=0;x<c.length;x++){var _=c[x];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(R,_.key,_)}}function h(R,c,x){return c&&s(R.prototype,c),x&&s(R,x),Object.defineProperty(R,"prototype",{writable:!1}),R}g.exports=h,g.exports.__esModule=!0,g.exports.default=g.exports},"./node_modules/@babel/runtime/helpers/typeof.js":function(g,y){function s(h){return g.exports=s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},g.exports.__esModule=!0,g.exports.default=g.exports,s(h)}g.exports=s,g.exports.__esModule=!0,g.exports.default=g.exports},"./node_modules/@xmldom/xmldom/lib/conventions.js":function(g,y,s){function h(N,I,w){if(w===void 0&&(w=Array.prototype),N&&typeof w.find=="function")return w.find.call(N,I);for(var K=0;K<N.length;K++)if(Object.prototype.hasOwnProperty.call(N,K)){var X=N[K];if(I.call(void 0,X,K,N))return X}}function R(N,I){return I===void 0&&(I=Object),I&&typeof I.freeze=="function"?I.freeze(N):N}function c(N,I){if(N===null||typeof N!="object")throw new TypeError("target is not an object");for(var w in I)Object.prototype.hasOwnProperty.call(I,w)&&(N[w]=I[w]);return N}var x=R({HTML:"text/html",isHTML:function(N){return N===x.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),_=R({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(N){return N===_.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});y.assign=c,y.find=h,y.freeze=R,y.MIME_TYPE=x,y.NAMESPACE=_},"./node_modules/@xmldom/xmldom/lib/dom-parser.js":function(g,y,s){var h=s("./node_modules/@xmldom/xmldom/lib/conventions.js"),R=s("./node_modules/@xmldom/xmldom/lib/dom.js"),c=s("./node_modules/@xmldom/xmldom/lib/entities.js"),x=s("./node_modules/@xmldom/xmldom/lib/sax.js"),_=R.DOMImplementation,N=h.NAMESPACE,I=x.ParseError,w=x.XMLReader;function K(B){return B.replace(/\r[\n\u0085]/g,`
  8. `).replace(/[\r\u0085\u2028]/g,`
  9. `)}function X(B){this.options=B||{locator:{}}}X.prototype.parseFromString=function(B,S){var v=this.options,W=new w,p=v.domBuilder||new M,L=v.errorHandler,H=v.locator,P=v.xmlns||{},F=/\/x?html?$/.test(S),b=F?c.HTML_ENTITIES:c.XML_ENTITIES;H&&p.setDocumentLocator(H),W.errorHandler=V(L,p,H),W.domBuilder=v.domBuilder||p,F&&(P[""]=N.HTML),P.xml=P.xml||N.XML;var U=v.normalizeLineEndings||K;return B&&typeof B=="string"?W.parse(U(B),P,b):W.errorHandler.error("invalid doc source"),p.doc};function V(B,S,v){if(!B){if(S instanceof M)return S;B=S}var W={},p=B instanceof Function;v=v||{};function L(H){var P=B[H];!P&&p&&(P=B.length==2?function(F){B(H,F)}:B),W[H]=P&&function(F){P("[xmldom "+H+"] "+F+ne(v))}||function(){}}return L("warning"),L("error"),L("fatalError"),W}function M(){this.cdata=!1}function j(B,S){S.lineNumber=B.lineNumber,S.columnNumber=B.columnNumber}M.prototype={startDocument:function(){this.doc=new _().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(B,S,v,W){var p=this.doc,L=p.createElementNS(B,v||S),H=W.length;se(this,L),this.currentElement=L,this.locator&&j(this.locator,L);for(var P=0;P<H;P++){var B=W.getURI(P),F=W.getValue(P),v=W.getQName(P),b=p.createAttributeNS(B,v);this.locator&&j(W.getLocator(P),b),b.value=b.nodeValue=F,L.setAttributeNode(b)}},endElement:function(B,S,v){var W=this.currentElement;W.tagName,this.currentElement=W.parentNode},startPrefixMapping:function(B,S){},endPrefixMapping:function(B){},processingInstruction:function(B,S){var v=this.doc.createProcessingInstruction(B,S);this.locator&&j(this.locator,v),se(this,v)},ignorableWhitespace:function(B,S,v){},characters:function(B,S,v){if(B=Q.apply(this,arguments),B){if(this.cdata)var W=this.doc.createCDATASection(B);else var W=this.doc.createTextNode(B);this.currentElement?this.currentElement.appendChild(W):/^\s*$/.test(B)&&this.doc.appendChild(W),this.locator&&j(this.locator,W)}},skippedEntity:function(B){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(B){(this.locator=B)&&(B.lineNumber=0)},comment:function(B,S,v){B=Q.apply(this,arguments);var W=this.doc.createComment(B);this.locator&&j(this.locator,W),se(this,W)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(B,S,v){var W=this.doc.implementation;if(W&&W.createDocumentType){var p=W.createDocumentType(B,S,v);this.locator&&j(this.locator,p),se(this,p),this.doc.doctype=p}},warning:function(B){console.warn("[xmldom warning] "+B,ne(this.locator))},error:function(B){console.error("[xmldom error] "+B,ne(this.locator))},fatalError:function(B){throw new I(B,this.locator)}};function ne(B){if(B)return`
  10. @`+(B.systemId||"")+"#[line:"+B.lineNumber+",col:"+B.columnNumber+"]"}function Q(B,S,v){return typeof B=="string"?B.substr(S,v):B.length>=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<this.length;D++)Xe(this[D],k,i,l);return k.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};function re(i,l){this._node=i,this._refresh=l,ce(this)}function ce(i){var l=i._node._inc||i._node.ownerDocument._inc;if(i._inc!=l){var k=i._refresh(i._node);rt(i,"length",k.length),K(k,i),i._inc=l}}re.prototype.item=function(i){return ce(this),this[i]},X(re,$);function ie(){}function ee(i,l){for(var k=i.length;k--;)if(i[k]===l)return k}function le(i,l,k,D){if(D?l[ee(l,D)]=k:l[l.length++]=k,i){k.ownerElement=i;var fe=i.ownerDocument;fe&&(D&&ve(fe,i,D),ge(fe,i,k))}}function ae(i,l,k){var D=ee(l,k);if(D>=0){for(var fe=l.length-1;D<fe;)l[D]=l[++D];if(l.length=fe,i){var be=i.ownerDocument;be&&(ve(be,i,k),k.ownerElement=null)}}else throw new q(U,new Error(i.tagName+"@"+k))}ie.prototype={length:0,item:$.prototype.item,getNamedItem:function(i){for(var l=this.length;l--;){var k=this[l];if(k.nodeName==i)return k}},setNamedItem:function(i){var l=i.ownerElement;if(l&&l!=this._ownerElement)throw new q(z);var k=this.getNamedItem(i.nodeName);return le(this._ownerElement,this,i,k),k},setNamedItemNS:function(i){var l=i.ownerElement,k;if(l&&l!=this._ownerElement)throw new q(z);return k=this.getNamedItemNS(i.namespaceURI,i.localName),le(this._ownerElement,this,i,k),k},removeNamedItem:function(i){var l=this.getNamedItem(i);return ae(this._ownerElement,this,l),l},removeNamedItemNS:function(i,l){var k=this.getNamedItemNS(i,l);return ae(this._ownerElement,this,k),k},getNamedItemNS:function(i,l){for(var k=this.length;k--;){var D=this[k];if(D.localName==l&&D.namespaceURI==i)return D}return null}};function ye(){}ye.prototype={hasFeature:function(i,l){return!0},createDocument:function(i,l,k){var D=new me;if(D.implementation=this,D.childNodes=new $,D.doctype=k||null,k&&D.appendChild(k),l){var fe=D.createElementNS(i,l);D.appendChild(fe)}return D},createDocumentType:function(i,l,k){var D=new ke;return D.name=i,D.nodeName=i,D.publicId=l||"",D.systemId=k||"",D}};function Y(){}Y.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(i,l){return o(this,i,l)},replaceChild:function(i,l){o(this,i,l,n),l&&this.removeChild(l)},removeChild:function(i){return Te(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return et(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var l=i.nextSibling;l&&l.nodeType==ne&&i.nodeType==ne?(this.removeChild(l),i.appendData(l.data)):(i.normalize(),i=l)}},isSupported:function(i,l){return this.ownerDocument.implementation.hasFeature(i,l)},hasAttributes:function(){return this.attributes.length>0},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=="<"&&"&lt;"||i==">"&&"&gt;"||i=="&"&&"&amp;"||i=='"'&&"&quot;"||"&#"+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)<D.indexOf(k))throw new q(b,"Doctype can only be inserted before an element");if(!k&&Ne)throw new q(b,"Doctype can not be appended since element is present")}}function n(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&&!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)<D.indexOf(k))throw new q(b,"Doctype can only be inserted before an element")}}function o(i,l,k,D){a(i,l,k),i.nodeType===Y.DOCUMENT_NODE&&(D||r)(i,l,k);var fe=l.parentNode;if(fe&&fe.removeChild(l),l.nodeType===L){var be=l.firstChild;if(be==null)return l;var Ne=l.lastChild}else be=Ne=l;var ue=k?k.previousSibling:i.lastChild;be.previousSibling=ue,Ne.nextSibling=k,ue?ue.nextSibling=be:i.firstChild=be,k==null?i.lastChild=Ne:k.previousSibling=Ne;do be.parentNode=i;while(be!==Ne&&(be=be.nextSibling));return Ce(i.ownerDocument||i,i),l.nodeType==L&&(l.firstChild=l.lastChild=null),l}function f(i,l){return l.parentNode&&l.parentNode.removeChild(l),l.parentNode=i,l.previousSibling=i.lastChild,l.nextSibling=null,l.previousSibling?l.previousSibling.nextSibling=l:i.firstChild=l,i.lastChild=l,Ce(i.ownerDocument,i,l),l}me.prototype={nodeName:"#document",nodeType:W,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,l){if(i.nodeType==L){for(var k=i.firstChild;k;){var D=k.nextSibling;this.insertBefore(k,l),k=D}return i}return o(this,i,l),i.ownerDocument=this,this.documentElement===null&&i.nodeType===M&&(this.documentElement=i),i},removeChild:function(i){return this.documentElement==i&&(this.documentElement=null),Te(this,i)},replaceChild:function(i,l){o(this,i,l,n),i.ownerDocument=this,l&&this.removeChild(l),Pe(i)&&(this.documentElement=i)},importNode:function(i,l){return nt(this,i,l)},getElementById:function(i){var l=null;return pe(this.documentElement,function(k){if(k.nodeType==M&&k.getAttribute("id")==i)return l=k,!0}),l},getElementsByClassName:function(i){var l=I(i);return new re(this,function(k){var D=[];return l.length>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<be.length;$e++)if(be.item($e).name==="xmlns"){Je=be.item($e).value;break}if(!Je)for(var e=fe.length-1;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<Ne;t++){var u=be.item(t);u.prefix=="xmlns"?fe.push({prefix:u.localName,namespace:u.value}):u.nodeName=="xmlns"&&fe.push({prefix:"",namespace:u.value})}for(var t=0;t<Ne;t++){var u=be.item(t);if(ze(u,k,fe)){var C=u.prefix||"",m=u.namespaceURI;Ge(l,C?"xmlns:"+C:"xmlns",m),fe.push({prefix:C,namespace:m})}Xe(u,l,k,D,fe)}if(ue===Qe&&ze(i,k,fe)){var C=i.prefix||"",m=i.namespaceURI;Ge(l,C?"xmlns:"+C:"xmlns",m),fe.push({prefix:C,namespace:m})}if(T||k&&!/^(?:meta|link|img|br|hr|input)$/i.test(ue)){if(l.push(">"),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("</",Qe,">")}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("<![CDATA[",i.data,"]]>");case v:return l.push("<!--",i.data,"-->");case p:var O=i.publicId,Z=i.systemId;if(l.push("<!DOCTYPE ",i.name),O)l.push(" PUBLIC ",O),Z&&Z!="."&&l.push(" ",Z),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("<?",i.target," ",i.data,"?>");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<Qe;Je++)D.setAttributeNode(et(i,Ne.item(Je),!0));break;case j:k=!0}if(k)for(var $e=l.firstChild;$e;)D.appendChild(et(i,$e,k)),$e=$e.nextSibling;return D}function rt(i,l,k){i[l]=k}try{if(Object.defineProperty){let i=function(l){switch(l.nodeType){case M:case L:var k=[];for(l=l.firstChild;l;)l.nodeType!==7&&l.nodeType!==8&&k.push(i(l)),l=l.nextSibling;return k.join("");default:return l.nodeValue}};Object.defineProperty(re.prototype,"length",{get:function(){return ce(this),this.$$length}}),Object.defineProperty(Y.prototype,"textContent",{get:function(){return i(this)},set:function(l){switch(this.nodeType){case M:case L:for(;this.firstChild;)this.removeChild(this.firstChild);(l||String(l))&&this.appendChild(this.ownerDocument.createTextNode(l));break;default:this.data=l,this.value=l,this.nodeValue=l}}}),rt=function(l,k,D){l["$$"+k]=D}}}catch(i){}y.DocumentType=ke,y.DOMException=q,y.DOMImplementation=ye,y.Element=E,y.Node=Y,y.NodeList=$,y.XMLSerializer=Ve},"./node_modules/@xmldom/xmldom/lib/entities.js":function(g,y,s){var h=s("./node_modules/@xmldom/xmldom/lib/conventions.js").freeze;y.XML_ENTITIES=h({amp:"&",apos:"'",gt:">",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(/\s</)&&(Te=Te.replace(/[\s<].*/,""),$.error("end tag name: "+Te+" maybe not complete"),a=ge+1+Te.length);var we=Ee.localNSMap,Ae=Ee.tagName==Te,Pe=Ae||Ee.tagName&&Ee.tagName.toLowerCase()==Te.toLowerCase();if(Pe){if(q.endElement(Ee.uri,Ee.localName,Te),we)for(var je in we)Object.prototype.hasOwnProperty.call(we,je)&&q.endPrefixMapping(je);Ae||$.fatalError("end tag name: "+Te+" is not match the current start tagName:"+Ee.tagName)}else te.push(Ee);a++;break;case"?":Y&&ee(ge),a=H(b,ge,q);break;case"!":Y&&ee(ge),a=L(b,ge,q,$);break;default:Y&&ee(ge);var Ue=new P,oe=te[te.length-1].currentNSMap,a=B(b,ge,Ue,oe,ce,$),r=Ue.length;if(!Ue.closed&&W(b,a,Ue.tagName,pe)&&(Ue.closed=!0,z.nbsp||$.warning("unclosed xml attribute")),Y&&r){for(var n=se(Y,{}),o=0;o<r;o++){var f=Ue[o];ee(f.offset),f.locator=se(Y,{})}q.locator=n,S(Ue,q,oe)&&te.push(Ue),q.locator=Y}else S(Ue,q,oe)&&te.push(Ue);h.isHTML(Ue.uri)&&!Ue.closed?a=v(b,a,Ue.tagName,ce,q):a++}}catch(E){if(E instanceof j)throw E;$.error("element parse error: "+E),a=-1}a>me?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"&&le;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("</"+z+">",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("</"+z+">"),$<U&&($=b.lastIndexOf("</"+z)),q[z]=$),$<U}function p(b,U){for(var z in b)Object.prototype.hasOwnProperty.call(b,z)&&(U[z]=b[z])}function L(b,U,z,q){var $=b.charAt(U+2);switch($){case"-":if(b.charAt(U+3)==="-"){var re=b.indexOf("-->",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=[];++X<se;)K&&K[X].run();X=-1,se=I.length}K=null,w=!1,N(Q)}}s.nextTick=function(Q){var se=new Array(arguments.length-1);if(arguments.length>1)for(var B=1;B<arguments.length;B++)se[B-1]=arguments[B];I.push(new j(Q,se)),I.length===1&&!w&&_(M)};function j(Q,se){this.fun=Q,this.array=se}j.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function ne(){}s.on=ne,s.addListener=ne,s.once=ne,s.off=ne,s.removeListener=ne,s.removeAllListeners=ne,s.emit=ne,s.prependListener=ne,s.prependOnceListener=ne,s.listeners=function(Q){return[]},s.binding=function(Q){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(Q){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},"./node_modules/webpack/buildin/amd-options.js":function(g,y){(function(s){g.exports=s}).call(this,{})},"./node_modules/webpack/buildin/global.js":function(g,y){var s;s=function(){return this}();try{s=s||new Function("return this")()}catch(h){typeof window=="object"&&(s=window)}g.exports=s},"./node_modules/webpack/buildin/module.js":function(g,y){g.exports=function(s){return s.webpackPolyfill||(s.deprecate=function(){},s.paths=[],s.children||(s.children=[]),Object.defineProperty(s,"loaded",{enumerable:!0,get:function(){return s.l}}),Object.defineProperty(s,"id",{enumerable:!0,get:function(){return s.i}}),s.webpackPolyfill=1),s}},"./package.json":function(g){g.exports=JSON.parse('{"name":"cos-js-sdk-v5","version":"1.4.20","description":"JavaScript SDK for [\u817E\u8BAF\u4E91\u5BF9\u8C61\u5B58\u50A8](https://cloud.tencent.com/product/cos)","main":"dist/cos-js-sdk-v5.js","types":"index.d.ts","scripts":{"prettier":"prettier --write src demo/demo.js test/test.js server/sts.js index.d.ts","server":"node server/sts.js","dev":"cross-env NODE_ENV=development webpack -w --mode=development","build":"cross-env NODE_ENV=production webpack --mode=production","cos-auth.min.js":"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m","test":"jest --runInBand --coverage"},"repository":{"type":"git","url":"git+https://github.com/tencentyun/cos-js-sdk-v5.git"},"keywords":[],"author":"carsonxu","license":"ISC","bugs":{"url":"https://github.com/tencentyun/cos-js-sdk-v5/issues"},"homepage":"https://github.com/tencentyun/cos-js-sdk-v5#readme","dependencies":{"@xmldom/xmldom":"^0.8.6"},"devDependencies":{"@babel/core":"7.17.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^5.2.0","express":"^4.16.4","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","request":"^2.87.0","terser-webpack-plugin":"4.2.3","uglifyjs":"^2.4.11","webpack":"4.46.0","webpack-cli":"4.10.0"}}')},"./src/advance.js":function(g,y,s){var h=s("./node_modules/@babel/runtime/helpers/typeof.js"),R=s("./src/session.js"),c=s("./src/async.js"),x=s("./src/event.js").EventProxy,_=s("./src/util.js"),N=s("./src/tracker.js");function I(p,L){var H=this,P=new x,F=p.TaskId,b=p.Bucket,U=p.Region,z=p.Key,q=p.Body,$=p.ChunkSize||p.SliceSize||H.options.ChunkSize,re=p.AsyncLimit,ce=p.StorageClass,ie=p.ServerSideEncryption,ee,le,ae=p.onHashProgress,ye=p.tracker;ye&&ye.setParams({chunkSize:$}),P.on("error",function(Y){if(!!H._isRunningTask(F))return Y.UploadId=p.UploadData.UploadId||"",L(Y)}),P.on("upload_complete",function(Y){var te=_.extend({UploadId:p.UploadData.UploadId||""},Y);L(null,te)}),P.on("upload_slice_complete",function(Y){var te={};_.each(p.Headers,function(pe,me){var ge=me.toLowerCase();(ge.indexOf("x-cos-meta-")===0||ge==="pic-operations")&&(te[me]=pe)}),j.call(H,{Bucket:b,Region:U,Key:z,UploadId:Y.UploadId,SliceList:Y.SliceList,Headers:te,tracker:ye},function(pe,me){if(!!H._isRunningTask(F)){if(R.removeUsing(Y.UploadId),pe)return le(null,!0),P.emit("error",pe);R.removeUploadId.call(H,Y.UploadId),le({loaded:ee,total:ee},!0),P.emit("upload_complete",me)}})}),P.on("get_upload_data_finish",function(Y){var te=R.getFileId(q,p.ChunkSize,b,z);te&&R.saveUploadId.call(H,te,Y.UploadId,H.options.UploadIdCacheLimit),R.setUsing(Y.UploadId),le(null,!0),V.call(H,{TaskId:F,Bucket:b,Region:U,Key:z,Body:q,FileSize:ee,SliceSize:$,AsyncLimit:re,ServerSideEncryption:ie,UploadData:Y,Headers:p.Headers,onProgress:le,tracker:ye},function(pe,me){if(!!H._isRunningTask(F)){if(pe)return le(null,!0),P.emit("error",pe);P.emit("upload_slice_complete",me)}})}),P.on("get_file_size_finish",function(){if(le=_.throttleOnProgress.call(H,ee,p.onProgress),p.UploadData.UploadId)P.emit("get_upload_data_finish",p.UploadData);else{var Y=_.extend({TaskId:F,Bucket:b,Region:U,Key:z,Headers:p.Headers,StorageClass:ce,Body:q,FileSize:ee,SliceSize:$,onHashProgress:ae,tracker:ye},p);w.call(H,Y,function(te,pe){if(!!H._isRunningTask(F)){if(te)return P.emit("error",te);p.UploadData.UploadId=pe.UploadId,p.UploadData.PartList=pe.PartList,P.emit("get_upload_data_finish",p.UploadData)}})}}),ee=p.ContentLength,delete p.ContentLength,!p.Headers&&(p.Headers={}),_.each(p.Headers,function(Y,te){te.toLowerCase()==="content-length"&&delete p.Headers[te]}),function(){for(var Y=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],te=1024*1024,pe=0;pe<Y.length&&(te=Y[pe]*1024*1024,!(ee/te<=H.options.MaxPartNumber));pe++);p.ChunkSize=p.SliceSize=$=Math.max($,te)}(),ee===0?(p.Body="",p.ContentLength=0,p.SkipTask=!0,H.putObject(p,L)):P.emit("get_file_size_finish")}function w(p,L){var H=p.TaskId,P=p.Bucket,F=p.Region,b=p.Key,U=p.StorageClass,z=this,q={},$=p.FileSize,re=p.SliceSize,ce=Math.ceil($/re),ie=0,ee=_.throttleOnProgress.call(z,$,p.onHashProgress),le=function(te,pe){var me=re*(te-1),ge=Math.min(me+re,$),ve=ge-me;q[te]?pe(null,{PartNumber:te,ETag:q[te],Size:ve}):_.fileSlice(p.Body,me,ge,!1,function(Ce){_.getFileMd5(Ce,function(Te,Ee){if(Te)return pe(_.error(Te));var we='"'+Ee+'"';q[te]=we,ie+=ve,ee({loaded:ie,total:$}),pe(null,{PartNumber:te,ETag:we,Size:ve})})})},ae=function(te,pe){var me=te.length;if(me===0)return pe(null,!0);if(me>ce)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<me){var Ee=te[Te];le(Ee.PartNumber,function(we,Ae){Ae&&Ae.ETag===Ee.ETag&&Ae.Size===Ee.Size?Ce(Te+1):pe(null,!1)})}else pe(null,!0)};ve(0)},ye=new x;ye.on("error",function(Y){if(!!z._isRunningTask(H))return L(Y)}),ye.on("upload_id_available",function(Y){var te={},pe=[];_.each(Y.PartList,function(ve){te[ve.PartNumber]=ve});for(var me=1;me<=ce;me++){var ge=te[me];ge?(ge.PartNumber=me,ge.Uploaded=!0):ge={PartNumber:me,ETag:null,Uploaded:!1},pe.push(ge)}Y.PartList=pe,L(null,Y)}),ye.on("no_available_upload_id",function(){if(!!z._isRunningTask(H)){var Y=_.extend({Bucket:P,Region:F,Key:b,Query:_.clone(p.Query),StorageClass:U,Body:p.Body,calledBySdk:"sliceUploadFile",tracker:p.tracker},p),te=_.clone(p.Headers);delete te["x-cos-mime-limit"],Y.Headers=te,z.multipartInit(Y,function(pe,me){if(!!z._isRunningTask(H)){if(pe)return ye.emit("error",pe);var ge=me.UploadId;if(!ge)return L(_.error(new Error("no such upload id")));ye.emit("upload_id_available",{UploadId:ge,PartList:[]})}})}}),ye.on("has_and_check_upload_id",function(Y){Y=Y.reverse(),c.eachLimit(Y,1,function(te,pe){if(!!z._isRunningTask(H)){if(R.using[te]){pe();return}X.call(z,{Bucket:P,Region:F,Key:b,UploadId:te,tracker:p.tracker},function(me,ge){if(!!z._isRunningTask(H)){if(me)return R.removeUsing(te),ye.emit("error",me);var ve=ge.PartList;ve.forEach(function(Ce){Ce.PartNumber*=1,Ce.Size*=1,Ce.ETag=Ce.ETag||""}),ae(ve,function(Ce,Te){if(!!z._isRunningTask(H)){if(Ce)return ye.emit("error",Ce);Te?pe({UploadId:te,PartList:ve}):pe()}})}})}},function(te){!z._isRunningTask(H)||(ee(null,!0),te&&te.UploadId?ye.emit("upload_id_available",te):ye.emit("no_available_upload_id"))})}),ye.on("seek_local_avail_upload_id",function(Y){var te=R.getFileId(p.Body,p.ChunkSize,P,b),pe=R.getUploadIdList.call(z,te);if(!te||!pe){ye.emit("has_and_check_upload_id",Y);return}var me=function ge(ve){if(ve>=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;ee<le;ee++){var ae=$[ee];ae.task&&(ae.error?ie.push(ae.task):ce.push(ae.task))}return L(null,{successList:ce,errorList:ie})})}function se(p,L){var H=this,P=p.SliceSize===void 0?H.options.SliceSize:p.SliceSize,F=[],b=p.Body,U=b.size||b.length||0,z={TaskId:""};if(H.options.EnableTracker){var q=H.options.UseAccelerate||typeof H.options.Domain=="string"&&H.options.Domain.includes("accelerate.");p.tracker=new N({bucket:p.Bucket,region:p.Region,apiName:"uploadFile",fileKey:p.Key,fileSize:U,accelerate:q,deepTracker:H.options.DeepTracker,customId:H.options.CustomId,delay:H.options.TrackerDelay})}_.each(p,function(le,ae){h(le)!=="object"&&typeof le!="function"&&(z[ae]=le)});var $=p.onTaskReady,re=function(ae){z.TaskId=ae,$&&$(ae)};p.onTaskReady=re;var ce=U>P?"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;we<Te.length&&(Ee=Te[we]*1024*1024,!(te/Ee<=P.options.MaxPartNumber));we++);p.ChunkSize=ee=Math.max(ee,Ee),ye=Math.ceil(te/ee);for(var Ae=[],Pe=1;Pe<=ye;Pe++){var je=(Pe-1)*ee,Ue=Pe*ee<te?Pe*ee-1:te-1,oe={PartNumber:Pe,start:je,end:Ue,CopySourceRange:"bytes="+je+"-"+Ue};Ae.push(oe)}p.PartList=Ae}(),p.Headers["x-cos-metadata-directive"]==="Replaced"?ve=p.Headers:ve=ge,ve["x-cos-storage-class"]=p.Headers["x-cos-storage-class"]||ge["x-cos-storage-class"],ve=_.clearKey(ve),ge["x-cos-storage-class"]==="ARCHIVE"||ge["x-cos-storage-class"]==="DEEP_ARCHIVE"){var Ce=ge["x-cos-restore"];if(!Ce||Ce==='ongoing-request="true"'){L(_.error(new Error("Unrestored archive object is not allowed to be copied")));return}}delete ve["x-cos-copy-source"],delete ve["x-cos-metadata-directive"],delete ve["x-cos-copy-source-If-Modified-Since"],delete ve["x-cos-copy-source-If-Unmodified-Since"],delete ve["x-cos-copy-source-If-Match"],delete ve["x-cos-copy-source-If-None-Match"],H.emit("get_chunk_size_finish")}),P.headObject({Bucket:$,Region:re,Key:ce},function(Ce,Te){if(Ce){Ce.statusCode&&Ce.statusCode===404?L(_.error(Ce,{ErrorStatus:ce+" Not Exist"})):L(Ce);return}if(te=p.FileSize=Te.headers["content-length"],te===void 0||!te){L(_.error(new Error('get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.\uFF08 \u83B7\u53D6Content-Length\u5931\u8D25\uFF0C\u8BF7\u5728CORS ExposeHeader\u8BBE\u7F6E\u4E2D\u6DFB\u52A0Content-Length\uFF0C\u8BF7\u53C2\u8003\u6587\u6863\uFF1Ahttps://cloud.tencent.com/document/product/436/13318 \uFF09')));return}if(pe=_.throttleOnProgress.call(P,te,p.onProgress),te<=ie)p.Headers["x-cos-metadata-directive"]||(p.Headers["x-cos-metadata-directive"]="Copy"),P.putObjectCopy(p,function(we,Ae){if(we)return pe(null,!0),L(we);pe({loaded:te,total:te},!0),L(we,Ae)});else{var Ee=Te.headers;me=Ee,ge={"Cache-Control":Ee["cache-control"],"Content-Disposition":Ee["content-disposition"],"Content-Encoding":Ee["content-encoding"],"Content-Type":Ee["content-type"],Expires:Ee.expires,"x-cos-storage-class":Ee["x-cos-storage-class"]},_.each(Ee,function(we,Ae){var Pe="x-cos-meta-";Ae.indexOf(Pe)===0&&Ae.length>Pe.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;)K+=1,X+=1,N(x[K-1],function(M){M?(I(M),I=function(){}):(w+=1,X-=1,w>=x.length?I():V())})})()},h=function(x,_,N){var I=function w(K){_(function(X,V){X&&K<x?w(K+1):N(X,V)})};x<1?N():I(1)},R={eachLimit:s,retry:h};g.exports=R},"./src/base.js":function(g,y,s){var h=s("./node_modules/@babel/runtime/helpers/typeof.js"),R=s("./lib/request.js"),c=s("./src/util.js");function x(e,d){typeof e=="function"&&(d=e,e={});var t=this.options.Protocol||(c.isBrowser&&(typeof location=="undefined"?"undefined":h(location))==="object"&&location.protocol==="http:"?"http:":"https:"),u=this.options.ServiceDomain,C=e.AppId||this.options.appId,m=e.Region;u?(u=u.replace(/\{\{AppId\}\}/gi,C||"").replace(/\{\{Region\}\}/gi,m||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(u)||(u=t+"//"+u),u.slice(-1)==="/"&&(u=u.slice(0,-1))):m?u=t+"//cos."+m+".myqcloud.com":u=t+"//service.cos.myqcloud.com";var T="",O=m?"cos."+m+".myqcloud.com":"service.cos.myqcloud.com",Z=u.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");O===Z&&(T=O),ue.call(this,{Action:"name/cos:GetService",url:u,method:"GET",headers:e.Headers,SignHost:T},function(Oe,xe){if(Oe)return d(Oe);var Se=xe&&xe.ListAllMyBucketsResult&&xe.ListAllMyBucketsResult.Buckets&&xe.ListAllMyBucketsResult.Buckets.Bucket||[];Se=c.isArray(Se)?Se:[Se];var Re=xe&&xe.ListAllMyBucketsResult&&xe.ListAllMyBucketsResult.Owner||{};d(null,{Buckets:Se,Owner:Re,statusCode:xe.statusCode,headers:xe.headers})})}function _(e,d){var t=this,u="";if(e.BucketAZConfig){var C={BucketAZConfig:e.BucketAZConfig};u=c.json2xml({CreateBucketConfiguration:C})}ue.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:u},function(m,T){if(m)return d(m);var O=D({protocol:t.options.Protocol,domain:t.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});d(null,{Location:O,statusCode:T.statusCode,headers:T.headers})})}function N(e,d){ue.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD"},d)}function I(e,d){var t={};t.prefix=e.Prefix||"",t.delimiter=e.Delimiter,t.marker=e.Marker,t["max-keys"]=e.MaxKeys,t["encoding-type"]=e.EncodingType,ue.call(this,{Action:"name/cos:GetBucket",ResourceKey:t.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:t},function(u,C){if(u)return d(u);var m=C.ListBucketResult||{},T=m.Contents||[],O=m.CommonPrefixes||[];T=c.isArray(T)?T:[T],O=c.isArray(O)?O:[O];var Z=c.clone(m);c.extend(Z,{Contents:T,CommonPrefixes:O,statusCode:C.statusCode,headers:C.headers}),d(null,Z)})}function w(e,d){ue.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE"},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 K(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:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:t,action:"acl",body:u},function(T,O){if(T)return d(T);d(null,{statusCode:O.statusCode,headers:O.headers})})}function X(e,d){ue.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl"},function(t,u){if(t)return d(t);var C=u.AccessControlPolicy||{},m=C.Owner||{},T=C.AccessControlList.Grant||[];T=c.isArray(T)?T:[T];var O=l(C);u.headers&&u.headers["x-cos-acl"]&&(O.ACL=u.headers["x-cos-acl"]),O=c.extend(O,{Owner:m,Grants:T,statusCode:u.statusCode,headers:u.headers}),d(null,O)})}function V(e,d){var t=e.CORSConfiguration||{},u=t.CORSRules||e.CORSRules||[];u=c.clone(c.isArray(u)?u:[u]),c.each(u,function(O){c.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(Z){var Oe=Z+"s",xe=O[Oe]||O[Z]||[];delete O[Oe],O[Z]=c.isArray(xe)?xe:[xe]})});var C={CORSRule:u};e.ResponseVary&&(C.ResponseVary=e.ResponseVary);var m=c.json2xml({CORSConfiguration:C}),T=e.Headers;T["Content-Type"]="application/xml",T["Content-MD5"]=c.b64(c.md5(m)),ue.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:m,action:"cors",headers:T},function(O,Z){if(O)return d(O);d(null,{statusCode:Z.statusCode,headers:Z.headers})})}function M(e,d){ue.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors"},function(t,u){if(t){if(t.statusCode===404&&t.error&&t.error.Code==="NoSuchCORSConfiguration"){var C={CORSRules:[],statusCode:t.statusCode};t.headers&&(C.headers=t.headers),d(null,C)}else d(t);return}var m=u.CORSConfiguration||{},T=m.CORSRules||m.CORSRule||[];T=c.clone(c.isArray(T)?T:[T]);var O=m.ResponseVary;c.each(T,function(Z){c.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(Oe){var xe=Oe+"s",Se=Z[xe]||Z[Oe]||[];delete Z[Oe],Z[xe]=c.isArray(Se)?Se:[Se]})}),d(null,{CORSRules:T,ResponseVary:O,statusCode:u.statusCode,headers:u.headers})})}function j(e,d){ue.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors"},function(t,u){if(t&&t.statusCode===204)return d(null,{statusCode:t.statusCode});if(t)return d(t);d(null,{statusCode:u.statusCode||t.statusCode,headers:u.headers})})}function ne(e,d){ue.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location"},d)}function Q(e,d){var t=e.Policy;try{typeof t=="string"&&(t=JSON.parse(t))}catch(m){}if(!t||typeof t=="string")return d(c.error(new Error("Policy format error")));var u=JSON.stringify(t);t.version||(t.version="2.0");var C=e.Headers;C["Content-Type"]="application/json",C["Content-MD5"]=c.b64(c.md5(u)),ue.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:u,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 se(e,d){ue.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0},function(t,u){if(t)return t.statusCode&&t.statusCode===403?d(c.error(t,{ErrorStatus:"Access Denied"})):t.statusCode&&t.statusCode===405?d(c.error(t,{ErrorStatus:"Method Not Allowed"})):t.statusCode&&t.statusCode===404?d(c.error(t,{ErrorStatus:"Policy Not Found"})):d(t);var C={};try{C=JSON.parse(u.body)}catch(m){}d(null,{Policy:C,statusCode:u.statusCode,headers:u.headers})})}function B(e,d){ue.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy"},function(t,u){if(t&&t.statusCode===204)return d(null,{statusCode:t.statusCode});if(t)return d(t);d(null,{statusCode:u.statusCode||t.statusCode,headers:u.headers})})}function S(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:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:C,action:"tagging",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 v(e,d){ue.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging"},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 W(e,d){ue.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging"},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 p(e,d){var t=e.LifecycleConfiguration||{},u=t.Rules||e.Rules||[];u=c.clone(u);var C=c.json2xml({LifecycleConfiguration:{Rule:u}}),m=e.Headers;m["Content-Type"]="application/xml",m["Content-MD5"]=c.b64(c.md5(C)),ue.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:C,action:"lifecycle",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 L(e,d){ue.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle"},function(t,u){if(t){if(t.statusCode===404&&t.error&&t.error.Code==="NoSuchLifecycleConfiguration"){var C={Rules:[],statusCode:t.statusCode};t.headers&&(C.headers=t.headers),d(null,C)}else d(t);return}var m=[];try{m=u.LifecycleConfiguration.Rule||[]}catch(T){}m=c.clone(c.isArray(m)?m:[m]),d(null,{Rules:m,statusCode:u.statusCode,headers:u.headers})})}function H(e,d){ue.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle"},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 P(e,d){if(!e.VersioningConfiguration){d(c.error(new Error("missing param VersioningConfiguration")));return}var t=e.VersioningConfiguration||{},u=c.json2xml({VersioningConfiguration:t}),C=e.Headers;C["Content-Type"]="application/xml",C["Content-MD5"]=c.b64(c.md5(u)),ue.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:u,action:"versioning",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 F(e,d){ue.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning"},function(t,u){t||!u.VersioningConfiguration&&(u.VersioningConfiguration={}),d(t,u)})}function b(e,d){var t=c.clone(e.ReplicationConfiguration),u=c.json2xml({ReplicationConfiguration:t});u=u.replace(/<(\/?)Rules>/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<O;T++)C[T].ETag&&C[T].ETag.indexOf('"')===0||(C[T].ETag='"'+C[T].ETag+'"');var Z=c.json2xml({CompleteMultipartUpload:{Part:C}});Z=Z.replace(/\n\s*/g,"");var Oe=e.Headers;Oe["Content-Type"]="application/xml",Oe["Content-MD5"]=c.b64(c.md5(Z)),ue.call(this,{Action:"name/cos:CompleteMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{uploadId:u},body:Z,headers:Oe,tracker:m},function(xe,Se){if(xe)return m&&m.parent&&m.parent.setParams({errorNode:"multipartComplete"}),d(xe);var 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}),Le=Se.CompleteMultipartUploadResult||{};Le.ProcessResults&&Le&&Le.ProcessResults&&(Le.UploadResult={OriginalInfo:{Key:Le.Key,Location:Re,ETag:Le.ETag,ImageInfo:Le.ImageInfo},ProcessResults:Le.ProcessResults},delete Le.ImageInfo,delete Le.ProcessResults);var Ye=c.extend(Le,{Location:Re,statusCode:Se.statusCode,headers:Se.headers});d(null,Ye)})}function ze(e,d){var t={};t.delimiter=e.Delimiter,t["encoding-type"]=e.EncodingType,t.prefix=e.Prefix||"",t["max-uploads"]=e.MaxUploads,t["key-marker"]=e.KeyMarker,t["upload-id-marker"]=e.UploadIdMarker,t=c.clearKey(t);var u=e.tracker;u&&u.setParams({signStartTime:new Date().getTime()}),ue.call(this,{Action:"name/cos:ListMultipartUploads",ResourceKey:t.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:t,action:"uploads",tracker:u},function(C,m){if(C)return u&&u.parent&&u.parent.setParams({errorNode:"multipartList"}),d(C);if(m&&m.ListMultipartUploadsResult){var T=m.ListMultipartUploadsResult.Upload||[];T=c.isArray(T)?T:[T],m.ListMultipartUploadsResult.Upload=T}var O=c.clone(m.ListMultipartUploadsResult||{});c.extend(O,{statusCode:m.statusCode,headers:m.headers}),d(null,O)})}function Ge(e,d){var t={},u=e.tracker;t.uploadId=e.UploadId,t["encoding-type"]=e.EncodingType,t["max-parts"]=e.MaxParts,t["part-number-marker"]=e.PartNumberMarker,ue.call(this,{Action:"name/cos:ListParts",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:t},function(C,m){if(C)return u&&u.parent&&u.parent.setParams({errorNode:"multipartListPart"}),d(C);var T=m.ListPartsResult||{},O=T.Part||[];O=c.isArray(O)?O:[O],T.Part=O;var Z=c.clone(T);c.extend(Z,{statusCode:m.statusCode,headers:m.headers}),d(null,Z)})}function Xe(e,d){var t={};t.uploadId=e.UploadId,ue.call(this,{Action:"name/cos:AbortMultipartUpload",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:t},function(u,C){if(u)return d(u);d(null,{statusCode:C.statusCode,headers:C.headers})})}function nt(e,d){ue.call(this,{method:e.Method,Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:e.Action,headers:e.Headers,qs:e.Query,body:e.Body,Url:e.Url,rawBody:e.RawBody,DataType:e.DataType},function(t,u){if(t)return d(t);u&&u.body&&(u.Body=u.body,delete u.body),d(t,u)})}function et(e,d){var t=e.Headers;!t["Cache-Control"]&&!t["cache-control"]&&(t["Cache-Control"]=""),!t["Content-Type"]&&!t["content-type"]&&(t["Content-Type"]=e.Body&&e.Body.type||""),ue.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers},function(u,C){if(u)return d(u);d(null,C)})}function rt(e){var d=this;return c.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,UseRawKey:d.options.UseRawKey,SystemClockOffset:d.options.SystemClockOffset})}function i(e,d){var t=this,u=e.UseAccelerate===void 0?t.options.UseAccelerate:e.UseAccelerate,C=D({ForcePathStyle:t.options.ForcePathStyle,protocol:e.Protocol||t.options.Protocol,domain:e.Domain||t.options.Domain,bucket:e.Bucket,region:u?"accelerate":e.Region,object:e.Key}),m="";e.Query&&(m+=c.obj2str(e.Query)),e.QueryString&&(m+=(m?"&":"")+e.QueryString);var T=C;if(e.Sign!==void 0&&!e.Sign)return m&&(T+="?"+m),d(null,{Url:T}),T;var O=fe.call(this,{Bucket:e.Bucket,Region:e.Region,UseAccelerate:e.UseAccelerate,Url:C}),Z=be.call(this,{Action:(e.Method||"").toUpperCase()==="PUT"?"name/cos:PutObject":"name/cos:GetObject",Bucket:e.Bucket||"",Region:e.Region||"",Method:e.Method||"get",Key:e.Key,Expires:e.Expires,Headers:e.Headers,Query:e.Query,SignHost:O,ForceSignHost:e.ForceSignHost===!1?!1:t.options.ForceSignHost},function(Oe,xe){if(!!d){if(Oe){d(Oe);return}var Se=function(Ye){var it=Ye.match(/q-url-param-list.*?(?=&)/g)[0],ot="q-url-param-list="+encodeURIComponent(it.replace(/q-url-param-list=/,"")).toLowerCase(),Ze=new RegExp(it,"g"),st=Ye.replace(Ze,ot);return st},Re=C;Re+="?"+(xe.Authorization.indexOf("q-signature")>-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<d.length;)C=d[u].trim(),t[C]?d.splice(u,1):(t[C]=!0,d[u]=C,u++);return d.join(",")}function D(e){var d=e.region||"",t=e.bucket||"",u=t.substr(0,t.lastIndexOf("-")),C=t.substr(t.lastIndexOf("-")+1),m=e.domain,T=e.object;typeof m=="function"&&(m=m({Bucket:t,Region:d})),["http","https"].includes(e.protocol)&&(e.protocol=e.protocol+":");var O=e.protocol||(c.isBrowser&&(typeof location=="undefined"?"undefined":h(location))==="object"&&location.protocol==="http:"?"http:":"https:");m||(["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(d)>-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.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<w.length;K++)w[K](I)}},h=function(){s(this)};g.exports.init=s,g.exports.EventProxy=h},"./src/session.js":function(g,y,s){var h=s("./src/util.js"),R="cos_sdk_upload_cache",c=30*24*3600,x,_,N=function(){try{var M=JSON.parse(localStorage.getItem(R))}catch(j){}M||(M=[]),x=M},I=function(){try{x.length?localStorage.setItem(R,JSON.stringify(x)):localStorage.removeItem(R)}catch(M){}},w=function(){if(!x){N.call(this);for(var M=!1,j=Math.round(Date.now()/1e3),ne=x.length-1;ne>=0;ne--){var Q=x[ne][2];(!Q||Q+c<j)&&(x.splice(ne,1),M=!0)}M&&I()}},K=function(){_||(_=setTimeout(function(){I(),_=null},400))},X={using:{},setUsing:function(M){X.using[M]=!0},removeUsing:function(M){delete X.using[M]},getFileId:function(M,j,ne,Q){return M.name&&M.size&&M.lastModifiedDate&&j?h.md5([M.name,M.size,M.lastModifiedDate,j,ne,Q].join("::")):null},getCopyFileId:function(M,j,ne,Q,se){var B=j["content-length"],S=j.etag||"",v=j["last-modified"];return M&&ne?h.md5([M,B,S,v,ne,Q,se].join("::")):null},getUploadIdList:function(M){if(!M)return null;w.call(this);for(var j=[],ne=0;ne<x.length;ne++)x[ne][0]===M&&j.push(x[ne][1]);return j.length?j:null},saveUploadId:function(M,j,ne){if(w.call(this),!!M){for(var Q=x.length-1;Q>=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;v<V&&v<w.length&&w.length>I.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<w.length}};g.exports.transferToTaskMethod=x,g.exports.init=_},"./src/tracker.js":function(g,y,s){var h=s("./node_modules/@babel/runtime/helpers/classCallCheck.js"),R=s("./node_modules/@babel/runtime/helpers/createClass.js"),c=s("./node_modules/@babel/runtime/helpers/typeof.js"),x=s("./package.json"),_=null,N=function(S){if(!_){var v=s("./lib/beacon.min.js");_=new v({appkey:"0AND0VEVB24UBGDU",versionCode:x.version,channelID:"js_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:S,sessionDuration:60*1e3})}return _},I={getUid:function(){var S=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return S()+S()+"-"+S()+"-"+S()+"-"+S()+"-"+S()+S()+S()},getNetType:function(){if((typeof navigator=="undefined"?"undefined":c(navigator))==="object"){var S=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(S==null?void 0:S.type)||(S==null?void 0:S.effectiveType)||"unknown"}return"unknown"},getOsType:function(){if((typeof navigator=="undefined"?"undefined":c(navigator))!=="object")return"unknown os";var S=navigator.userAgent.toLowerCase(),v=/macintosh|mac os x/i.test(navigator.userAgent);return S.indexOf("win32")>=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<A.length;n++)o=A[n],f=a[o]===void 0||a[o]===null?"":""+a[o],o=r?K(o).toLowerCase():K(o),f=K(f)||"",E.push(o+"="+f);return E.join("&")},M=["cache-control","content-disposition","content-encoding","content-length","content-md5","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding"],j=function(a){var r={};for(var n in a){var o=n.toLowerCase();(o.indexOf("x-cos-")>-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(`
  11. `),Xe=["sha1",Fe,x.SHA1(Ge).toString(),""].join(`
  12. `),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);G<E;){var he=Q(a,8,G),J=se(a,G+1,G+1+he),ke=Q(a,16,G+he+2),De=se(a,G+he+4,G+he+4+ke);r[J]=De,G+=he+4+ke}if(r[":event-type"]==="Records")de=se(a,G,G+A,!0),o.records.push(de);else if(r[":event-type"]==="Stats")de=se(a,G,G+A,!0),o.stats=Ue.xml2json(de).Stats;else if(r[":event-type"]==="error"){var Me=r[":error-code"],Be=r[":error-message"],Fe=new Error(Be);Fe.message=Be,Fe.name=Fe.code=Me,o.error=Fe}a=a.slice(G+A+4)}return{payload:o.records.join(""),body:n}},S=function(a){var r=this.options.CopySourceParser;if(r)return r(a);var n=a.match(/^([^.]+-\d+)\.cos(v6|-cdc|-cdz|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return n?{Bucket:n[1],Region:n[3],Key:n[7]}:null},v=function(){},W=function(a){var r={};for(var n in a)a.hasOwnProperty(n)&&a[n]!==void 0&&a[n]!==null&&(r[n]=a[n]);return r},p=function(a,r){var n,o=new FileReader;FileReader.prototype.readAsBinaryString?(n=FileReader.prototype.readAsBinaryString,o.onload=function(){r(this.result)}):FileReader.prototype.readAsArrayBuffer?n=function(E){var A="",G=new FileReader;G.onload=function(de){for(var he=new Uint8Array(G.result),J=he.byteLength,ke=0;ke<J;ke++)A+=String.fromCharCode(he[ke]);r(A)},G.readAsArrayBuffer(E)}:console.error("FileReader not support readAsBinaryString"),n.call(o,a)},L=function(){var oe=function(n,o){n=n.split("."),o=o.split(".");for(var f=0;f<o.length;f++)if(n[f]!==o[f])return parseInt(n[f])>parseInt(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<oe.length;n++)if(a===oe[n]){r=!0;break}return r}function ce(oe){return $(oe)?oe:[oe]}function ie(oe,a){for(var r in oe)oe.hasOwnProperty(r)&&a(oe[r],r)}function ee(oe,a){var r=$(oe)?[]:{};for(var n in oe)oe.hasOwnProperty(n)&&(r[n]=a(oe[n],n));return r}function le(oe,a){var r=$(oe),n=r?[]:{};for(var o in oe)oe.hasOwnProperty(o)&&a(oe[o],o)&&(r?n.push(oe[o]):n[o]=oe[o]);return n}var ae=function(a){var r,n,o,f="";for(r=0,n=a.length/2;r<n;r++)o=parseInt(a[r*2]+a[r*2+1],16),f+=String.fromCharCode(o);return btoa(f)},ye=function(){var a=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},Y=function(a,r){var n=r.Bucket,o=r.Region,f=r.Key,E=this.options.Domain,A=!E||typeof E=="string"&&E.indexOf("{Bucket}")>-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};