oss-file-upload.e630303f.js 200 KB

123456789101112
  1. import{t as createNamespace,a2 as toArray,M as isFunction,d as defineComponent,z as numericProp,aB as makeRequiredProp,c as createVNode,a5 as Icon,L as Loading,bB as getSizeStyle,a1 as isDef,aR as callInterceptor,N as extend,w as makeNumericProp,u as makeStringProp,v as truthProp,av as makeArrayProp,R as ref,ab as onBeforeUnmount,W as useExpose,b4 as useCustomFieldValue,ac as withDirectives,ay as vShow,K as isPromise,am as pick,E as mergeProps,r as reactive,D as withInstall,ao as commonjsGlobal,bC as getDefaultExportFromCjs,m as request}from"./index.332c7f08.js";import"./index.ee7951f5.js";import{I as Image}from"./index.96a8db5e.js";import{s as showImagePreview}from"./function-call.3db51140.js";const[name,bem,t]=createNamespace("uploader");function readFileContent(l,C){return new Promise(s=>{if(C==="file"){s();return}const g=new FileReader;g.onload=R=>{s(R.target.result)},C==="dataUrl"?g.readAsDataURL(l):C==="text"&&g.readAsText(l)})}function isOversize(l,C){return toArray(l).some(s=>s.file?isFunction(C)?C(s.file):s.file.size>C:!1)}function filterFiles(l,C){const s=[],g=[];return l.forEach(R=>{isOversize(R,C)?g.push(R):s.push(R)}),{valid:s,invalid:g}}const IMAGE_REGEXP=/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i,isImageUrl=l=>IMAGE_REGEXP.test(l);function isImageFile(l){return l.isImage?!0:l.file&&l.file.type?l.file.type.indexOf("image")===0:l.url?isImageUrl(l.url):typeof l.content=="string"?l.content.indexOf("data:image")===0:!1}var stdin_default$1=defineComponent({props:{name:numericProp,item:makeRequiredProp(Object),index:Number,imageFit:String,lazyLoad:Boolean,deletable:Boolean,previewSize:[Number,String,Array],beforeDelete:Function},emits:["delete","preview"],setup(l,{emit:C,slots:s}){const g=()=>{const{status:O,message:A}=l.item;if(O==="uploading"||O==="failed"){const K=O==="failed"?createVNode(Icon,{name:"close",class:bem("mask-icon")},null):createVNode(Loading,{class:bem("loading")},null),V=isDef(A)&&A!=="";return createVNode("div",{class:bem("mask")},[K,V&&createVNode("div",{class:bem("mask-message")},[A])])}},R=O=>{const{name:A,item:K,index:V,beforeDelete:W}=l;O.stopPropagation(),callInterceptor(W,{args:[K,{name:A,index:V}],done:()=>C("delete")})},d=()=>C("preview"),T=()=>{if(l.deletable&&l.item.status!=="uploading"){const O=s["preview-delete"];return createVNode("div",{role:"button",class:bem("preview-delete",{shadow:!O}),tabindex:0,"aria-label":t("delete"),onClick:R},[O?O():createVNode(Icon,{name:"cross",class:bem("preview-delete-icon")},null)])}},N=()=>{if(s["preview-cover"]){const{index:O,item:A}=l;return createVNode("div",{class:bem("preview-cover")},[s["preview-cover"](extend({index:O},A))])}},q=()=>{const{item:O,lazyLoad:A,imageFit:K,previewSize:V}=l;return isImageFile(O)?createVNode(Image,{fit:K,src:O.content||O.url,class:bem("preview-image"),width:Array.isArray(V)?V[0]:V,height:Array.isArray(V)?V[1]:V,lazyLoad:A,onClick:d},{default:N}):createVNode("div",{class:bem("file"),style:getSizeStyle(l.previewSize)},[createVNode(Icon,{class:bem("file-icon"),name:"description"},null),createVNode("div",{class:[bem("file-name"),"van-ellipsis"]},[O.file?O.file.name:O.url]),N()])};return()=>createVNode("div",{class:bem("preview")},[q(),g(),T()])}});const uploaderProps={name:makeNumericProp(""),accept:makeStringProp("image/*"),capture:String,multiple:Boolean,disabled:Boolean,readonly:Boolean,lazyLoad:Boolean,maxCount:makeNumericProp(1/0),imageFit:makeStringProp("cover"),resultType:makeStringProp("dataUrl"),uploadIcon:makeStringProp("photograph"),uploadText:String,deletable:truthProp,afterRead:Function,showUpload:truthProp,modelValue:makeArrayProp(),beforeRead:Function,beforeDelete:Function,previewSize:[Number,String,Array],previewImage:truthProp,previewOptions:Object,previewFullImage:truthProp,maxSize:{type:[Number,String,Function],default:1/0}};var stdin_default=defineComponent({name,props:uploaderProps,emits:["delete","oversize","clickUpload","closePreview","clickPreview","update:modelValue"],setup(l,{emit:C,slots:s}){const g=ref(),R=[],d=(m=l.modelValue.length)=>({name:l.name,index:m}),T=()=>{g.value&&(g.value.value="")},N=m=>{if(T(),isOversize(m,l.maxSize))if(Array.isArray(m)){const y=filterFiles(m,l.maxSize);if(m=y.valid,C("oversize",y.invalid,d()),!m.length)return}else{C("oversize",m,d());return}m=reactive(m),C("update:modelValue",[...l.modelValue,...toArray(m)]),l.afterRead&&l.afterRead(m,d())},q=m=>{const{maxCount:y,modelValue:z,resultType:p}=l;if(Array.isArray(m)){const D=+y-z.length;m.length>D&&(m=m.slice(0,D)),Promise.all(m.map(F=>readFileContent(F,p))).then(F=>{const _=m.map((L,b)=>{const U={file:L,status:"",message:""};return F[b]&&(U.content=F[b]),U});N(_)})}else readFileContent(m,p).then(D=>{const F={file:m,status:"",message:""};D&&(F.content=D),N(F)})},O=m=>{const{files:y}=m.target;if(l.disabled||!y||!y.length)return;const z=y.length===1?y[0]:[].slice.call(y);if(l.beforeRead){const p=l.beforeRead(z,d());if(!p){T();return}if(isPromise(p)){p.then(D=>{q(D||z)}).catch(T);return}}q(z)};let A;const K=()=>C("closePreview"),V=m=>{if(l.previewFullImage){const y=l.modelValue.filter(isImageFile),z=y.map(p=>(p.file&&!p.url&&p.status!=="failed"&&(p.url=URL.createObjectURL(p.file),R.push(p.url)),p.url)).filter(Boolean);A=showImagePreview(extend({images:z,startPosition:y.indexOf(m),onClose:K},l.previewOptions))}},W=()=>{A&&A.close()},j=(m,y)=>{const z=l.modelValue.slice(0);z.splice(y,1),C("update:modelValue",z),C("delete",m,d(y))},H=(m,y)=>{const z=["imageFit","deletable","previewSize","beforeDelete"],p=extend(pick(l,z),pick(m,z,!0));return createVNode(stdin_default$1,mergeProps({item:m,index:y,onClick:()=>C("clickPreview",m,d(y)),onDelete:()=>j(m,y),onPreview:()=>V(m)},pick(l,["name","lazyLoad"]),p),pick(s,["preview-cover","preview-delete"]))},ne=()=>{if(l.previewImage)return l.modelValue.map(H)},Q=m=>C("clickUpload",m),ae=()=>{if(l.modelValue.length>=l.maxCount)return;const m=l.readonly?null:createVNode("input",{ref:g,type:"file",class:bem("input"),accept:l.accept,capture:l.capture,multiple:l.multiple,disabled:l.disabled,onChange:O},null);return s.default?createVNode("div",{class:bem("input-wrapper"),onClick:Q},[s.default(),m]):withDirectives(createVNode("div",{class:bem("upload",{readonly:l.readonly}),style:getSizeStyle(l.previewSize),onClick:Q},[createVNode(Icon,{name:l.uploadIcon,class:bem("upload-icon")},null),l.uploadText&&createVNode("span",{class:bem("upload-text")},[l.uploadText]),m]),[[vShow,l.showUpload]])},I=()=>{g.value&&!l.disabled&&g.value.click()};return onBeforeUnmount(()=>{R.forEach(m=>URL.revokeObjectURL(m))}),useExpose({chooseFile:I,closeImagePreview:W}),useCustomFieldValue(()=>l.modelValue),()=>createVNode("div",{class:bem()},[createVNode("div",{class:bem("wrapper",{disabled:l.disabled})},[ne(),ae()])])}});const Uploader=withInstall(stdin_default);var cosJsSdkV5={exports:{}};(function(module,exports){(function(C,s){module.exports=s()})(commonjsGlobal,function(){return function(l){var C={};function s(g){if(C[g])return C[g].exports;var R=C[g]={i:g,l:!1,exports:{}};return l[g].call(R.exports,R,R.exports,s),R.l=!0,R.exports}return s.m=l,s.c=C,s.d=function(g,R,d){s.o(g,R)||Object.defineProperty(g,R,{enumerable:!0,get:d})},s.r=function(g){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})},s.t=function(g,R){if(R&1&&(g=s(g)),R&8||R&4&&typeof g=="object"&&g&&g.__esModule)return g;var d=Object.create(null);if(s.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:g}),R&2&&typeof g!="string")for(var T in g)s.d(d,T,function(N){return g[N]}.bind(null,T));return d},s.n=function(g){var R=g&&g.__esModule?function(){return g.default}:function(){return g};return s.d(R,"a",R),R},s.o=function(g,R){return Object.prototype.hasOwnProperty.call(g,R)},s.p="/dist/",s(s.s="./index.js")}({"./index.js":function(l,C,s){var g=s("./src/cos.js");l.exports=g},"./lib/base64.js":function(l,C){var s=function(g){g=g||{};var R=g.Base64,d="2.1.9",T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=function(_){for(var L={},b=0,U=_.length;b<U;b++)L[_.charAt(b)]=b;return L}(T),q=String.fromCharCode,O=function(L){if(L.length<2){var b=L.charCodeAt(0);return b<128?L:b<2048?q(192|b>>>6)+q(128|b&63):q(224|b>>>12&15)+q(128|b>>>6&63)+q(128|b&63)}else{var b=65536+(L.charCodeAt(0)-55296)*1024+(L.charCodeAt(1)-56320);return q(240|b>>>18&7)+q(128|b>>>12&63)+q(128|b>>>6&63)+q(128|b&63)}},A=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,K=function(L){return L.replace(A,O)},V=function(L){var b=[0,2,1][L.length%3],U=L.charCodeAt(0)<<16|(L.length>1?L.charCodeAt(1):0)<<8|(L.length>2?L.charCodeAt(2):0),G=[T.charAt(U>>>18),T.charAt(U>>>12&63),b>=2?"=":T.charAt(U>>>6&63),b>=1?"=":T.charAt(U&63)];return G.join("")},W=g.btoa?function(_){return g.btoa(_)}:function(_){return _.replace(/[\s\S]{1,3}/g,V)},j=function(_){return W(K(_))},H=function(L,b){return b?j(String(L)).replace(/[+\/]/g,function(U){return U=="+"?"-":"_"}).replace(/=/g,""):j(String(L))},ne=function(L){return H(L,!0)},Q=new RegExp(["[\xC0-\xDF][\x80-\xBF]","[\xE0-\xEF][\x80-\xBF]{2}","[\xF0-\xF7][\x80-\xBF]{3}"].join("|"),"g"),ae=function(L){switch(L.length){case 4:var b=(7&L.charCodeAt(0))<<18|(63&L.charCodeAt(1))<<12|(63&L.charCodeAt(2))<<6|63&L.charCodeAt(3),U=b-65536;return q((U>>>10)+55296)+q((U&1023)+56320);case 3:return q((15&L.charCodeAt(0))<<12|(63&L.charCodeAt(1))<<6|63&L.charCodeAt(2));default:return q((31&L.charCodeAt(0))<<6|63&L.charCodeAt(1))}},I=function(L){return L.replace(Q,ae)},m=function(L){var b=L.length,U=b%4,G=(b>0?N[L.charAt(0)]<<18:0)|(b>1?N[L.charAt(1)]<<12:0)|(b>2?N[L.charAt(2)]<<6:0)|(b>3?N[L.charAt(3)]:0),X=[q(G>>>16),q(G>>>8&255),q(G&255)];return X.length-=[0,0,2,1][U],X.join("")},y=g.atob?function(_){return g.atob(_)}:function(_){return _.replace(/[\s\S]{1,4}/g,m)},z=function(_){return I(y(_))},p=function(L){return z(String(L).replace(/[-_]/g,function(b){return b=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},D=function(){var L=g.Base64;return g.Base64=R,L},F={VERSION:d,atob:y,btoa:W,fromBase64:p,toBase64:H,utob:K,encode:H,encodeURI:ne,btou:I,decode:p,noConflict:D};return F}();l.exports=s},"./lib/beacon.min.js":function(l,C,s){var g,R,d=s("./node_modules/@babel/runtime/helpers/typeof.js");(function(T,N){d(C)=="object"&&typeof l!="undefined"?l.exports=N():(g=N,R=typeof g=="function"?g.call(C,s,C,l):g,R!==void 0&&(l.exports=R))})(this,function(){var T=function(o,r){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,v){i.__proto__=v}||function(i,v){for(var w in v)Object.prototype.hasOwnProperty.call(v,w)&&(i[w]=v[w])},T(o,r)},N=function(){return N=Object.assign||function(o){for(var r,i=1,v=arguments.length;i<v;i++)for(var w in r=arguments[i])Object.prototype.hasOwnProperty.call(r,w)&&(o[w]=r[w]);return o},N.apply(this,arguments)};function q(u,o,r,i){return new(r||(r=Promise))(function(v,w){function B(ge){try{fe(i.next(ge))}catch($){w($)}}function J(ge){try{fe(i.throw(ge))}catch($){w($)}}function fe(ge){var $;ge.done?v(ge.value):($=ge.value,$ instanceof r?$:new r(function(Re){Re($)})).then(B,J)}fe((i=i.apply(u,o||[])).next())})}function O(u,o){var r,i,v,w,B={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return w={next:J(0),throw:J(1),return:J(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function J(fe){return function(ge){return function($){if(r)throw new TypeError("Generator is already executing.");for(;B;)try{if(r=1,i&&(v=2&$[0]?i.return:$[0]?i.throw||((v=i.return)&&v.call(i),0):i.next)&&!(v=v.call(i,$[1])).done)return v;switch(i=0,v&&($=[2&$[0],v.value]),$[0]){case 0:case 1:v=$;break;case 4:return B.label++,{value:$[1],done:!1};case 5:B.label++,i=$[1],$=[0];continue;case 7:$=B.ops.pop(),B.trys.pop();continue;default:if(v=B.trys,!((v=v.length>0&&v[v.length-1])||$[0]!==6&&$[0]!==2)){B=0;continue}if($[0]===3&&(!v||$[1]>v[0]&&$[1]<v[3])){B.label=$[1];break}if($[0]===6&&B.label<v[1]){B.label=v[1],v=$;break}if(v&&B.label<v[2]){B.label=v[2],B.ops.push($);break}v[2]&&B.ops.pop(),B.trys.pop();continue}$=o.call(u,B)}catch(Re){$=[6,Re],i=0}finally{r=v=0}if(5&$[0])throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}([fe,ge])}}}var A="__BEACON_",K="__BEACON_deviceId",V="last_report_time",W="sending_event_ids",j="beacon_config",H="beacon_config_request_time",ne=function(){function u(){var o=this;this.emit=function(r,i){if(o){var v,w=o.__EventsList[r];if(w!=null&&w.length){w=w.slice();for(var B=0;B<w.length;B++){v=w[B];try{var J=v.callback.apply(o,[i]);if(v.type===1&&o.remove(r,v.callback),J===!1)break}catch(fe){throw fe}}}return o}},this.__EventsList={}}return u.prototype.indexOf=function(o,r){for(var i=0;i<o.length;i++)if(o[i].callback===r)return i;return-1},u.prototype.on=function(o,r,i){if(i===void 0&&(i=0),this){var v=this.__EventsList[o];if(v||(v=this.__EventsList[o]=[]),this.indexOf(v,r)===-1){var w={name:o,type:i||0,callback:r};return v.push(w),this}return this}},u.prototype.one=function(o,r){this.on(o,r,1)},u.prototype.remove=function(o,r){if(this){var i=this.__EventsList[o];if(!i)return null;if(!r){try{delete this.__EventsList[o]}catch{}return null}if(i.length){var v=this.indexOf(i,r);i.splice(v,1)}return this}},u}();function Q(u,o){for(var r={},i=0,v=Object.keys(u);i<v.length;i++){var w=v[i],B=u[w];if(typeof B=="string")r[ae(w)]=ae(B);else{if(o)throw new Error("value mast be string !!!!");r[ae(String(w))]=ae(String(B))}}return r}function ae(u){if(typeof u!="string")return u;try{return u.replace(new RegExp("\\|","g"),"%7C").replace(new RegExp("\\&","g"),"%26").replace(new RegExp("\\=","g"),"%3D").replace(new RegExp("\\+","g"),"%2B")}catch{return""}}function I(u){return String(u.A99)+String(u.A100)}var m=function(){},y=function(){function u(o){var r=this;this.lifeCycle=new ne,this.uploadJobQueue=[],this.additionalParams={},this.delayTime=0,this._normalLogPipeline=function(i){if(!i||!i.reduce||!i.length)throw new TypeError("createPipeline \u65B9\u6CD5\u9700\u8981\u4F20\u5165\u81F3\u5C11\u6709\u4E00\u4E2A pipe \u7684\u6570\u7EC4");return i.length===1?function(v,w){i[0](v,w||m)}:i.reduce(function(v,w){return function(B,J){return J===void 0&&(J=m),v(B,function(fe){return w==null?void 0:w(fe,J)})}})}([function(i){r.send({url:r.strategy.getUploadUrl(),data:i,method:"post",contentType:"application/json;charset=UTF-8"},function(){var v=r.config.onReportSuccess;typeof v=="function"&&v(JSON.stringify(i.events))},function(){var v=r.config.onReportFail;typeof v=="function"&&v(JSON.stringify(i.events))})}]),function(i,v){if(!i)throw v instanceof Error?v:new Error(v)}(Boolean(o.appkey),"appkey must be initial"),this.config=N({},o)}return u.prototype.onUserAction=function(o,r){this.preReport(o,r,!1)},u.prototype.onDirectUserAction=function(o,r){this.preReport(o,r,!0)},u.prototype.preReport=function(o,r,i){o?this.strategy.isEventUpOnOff()&&(this.strategy.isBlackEvent(o)||this.strategy.isSampleEvent(o)||this.onReport(o,r,i)):this.errorReport.reportError("602"," no eventCode")},u.prototype.addAdditionalParams=function(o){for(var r=0,i=Object.keys(o);r<i.length;r++){var v=i[r];this.additionalParams[v]=o[v]}},u.prototype.setChannelId=function(o){this.commonInfo.channelID=String(o)},u.prototype.setOpenId=function(o){this.commonInfo.openid=String(o)},u.prototype.setUnionid=function(o){this.commonInfo.unid=String(o)},u.prototype.getDeviceId=function(){return this.commonInfo.deviceId},u.prototype.getCommonInfo=function(){return this.commonInfo},u.prototype.removeSendingId=function(o){try{var r=JSON.parse(this.storage.getItem(W)),i=r.indexOf(o);i!=-1&&(r.splice(i,1),this.storage.setItem(W,JSON.stringify(r)))}catch{}},u}(),z=function(){function u(o,r,i,v){this.requestParams={},this.network=v,this.requestParams.attaid="00400014144",this.requestParams.token="6478159937",this.requestParams.product_id=o.appkey,this.requestParams.platform=i,this.requestParams.uin=r.deviceId,this.requestParams.model="",this.requestParams.os=i,this.requestParams.app_version=o.appVersion,this.requestParams.sdk_version=r.sdkVersion,this.requestParams.error_stack="",this.uploadUrl=o.isOversea?"https://htrace.wetvinfo.com/kv":"https://h.trace.qq.com/kv"}return u.prototype.reportError=function(o,r){this.requestParams._dc=Math.random(),this.requestParams.error_msg=r,this.requestParams.error_code=o,this.network.get(this.uploadUrl,{params:this.requestParams}).catch(function(i){})},u}(),p=function(){function u(o,r,i,v,w){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=r.appkey,this.storage=v,this.needQueryConfig=o;try{var B=JSON.parse(this.storage.getItem(j));B&&this.processData(B)}catch{}r.isOversea&&(this.strategy.httpsUploadUrl="https://svibeacon.onezapp.com/analytics/v2_upload"),!r.isOversea&&this.needRequestConfig()&&this.requestConfig(r.appVersion,i,w)}return u.prototype.requestConfig=function(o,r,i){var v=this;this.storage.setItem(H,Date.now().toString()),i.post("https://oth.str.beacon.qq.com/trpc.beacon.configserver.BeaconConfigService/QueryConfig",{platformId:typeof wx=="undefined"?"3":"4",mainAppKey:this.appkey,appVersion:o,sdkVersion:r.sdkVersion,osVersion:r.userAgent,model:"",packageName:"",params:{A3:r.deviceId}}).then(function(w){if(w.data.ret==0)try{var B=JSON.parse(w.data.beaconConfig);B&&(v.processData(B),v.storage.setItem(j,w.data.beaconConfig))}catch{}else v.processData(null),v.storage.setItem(j,"")}).catch(function(w){})},u.prototype.processData=function(o){var r,i,v,w,B;this.strategy.isEventUpOnOff=(r=o==null?void 0:o.isEventUpOnOff)!==null&&r!==void 0?r:this.strategy.isEventUpOnOff,this.strategy.httpsUploadUrl=(i=o==null?void 0:o.httpsUploadUrl)!==null&&i!==void 0?i:this.strategy.httpsUploadUrl,this.strategy.requestInterval=(v=o==null?void 0:o.requestInterval)!==null&&v!==void 0?v:this.strategy.requestInterval,this.strategy.blacklist=(w=o==null?void 0:o.blacklist)!==null&&w!==void 0?w:this.strategy.blacklist,this.strategy.samplelist=(B=o==null?void 0:o.samplelist)!==null&&B!==void 0?B:this.strategy.samplelist;for(var J=0,fe=this.strategy.samplelist;J<fe.length;J++){var ge=fe[J].split(",");ge.length==2&&(this.realSample[ge[0]]=ge[1])}},u.prototype.needRequestConfig=function(){if(!this.needQueryConfig)return!1;var o=Number(this.storage.getItem(H));return Date.now()-o>60*this.strategy.requestInterval*1e3},u.prototype.getUploadUrl=function(){return this.strategy.httpsUploadUrl+"?appkey="+this.appkey},u.prototype.isBlackEvent=function(o){return this.strategy.blacklist.indexOf(o)!=-1},u.prototype.isEventUpOnOff=function(){return this.strategy.isEventUpOnOff},u.prototype.isSampleEvent=function(o){return!!Object.prototype.hasOwnProperty.call(this.realSample,o)&&this.realSample[o]<Math.floor(Math.random()*Math.floor(1e4))},u}(),D="session_storage_key",F=function(){function u(o,r,i){this.getSessionStackDepth=0,this.beacon=i,this.storage=o,this.duration=r,this.appkey=i.config.appkey}return u.prototype.getSession=function(){this.getSessionStackDepth+=1;var o=this.storage.getItem(D);if(!o)return this.createSession();var r="",i=0;try{var v=JSON.parse(o)||{sessionId:void 0,sessionStart:void 0};if(!v.sessionId||!v.sessionStart)return this.createSession();var w=Number(this.storage.getItem(V));if(Date.now()-w>this.duration)return this.createSession();r=v.sessionId,i=v.sessionStart,this.getSessionStackDepth=0}catch{}return{sessionId:r,sessionStart:i}},u.prototype.createSession=function(){var o=Date.now(),r={sessionId:this.appkey+"_"+o.toString(),sessionStart:o};this.storage.setItem(D,JSON.stringify(r)),this.storage.setItem(V,o.toString());var i="is_new_user",v=this.storage.getItem(i);return this.getSessionStackDepth<=1&&this.beacon.onDirectUserAction("rqd_applaunched",{A21:v?"N":"Y"}),this.storage.setItem(i,JSON.stringify(!1)),r},u}();function _(){var u=navigator.userAgent,o=u.indexOf("compatible")>-1&&u.indexOf("MSIE")>-1,r=u.indexOf("Edge")>-1&&!o,i=u.indexOf("Trident")>-1&&u.indexOf("rv:11.0")>-1;if(o){new RegExp("MSIE (\\d+\\.\\d+);").test(u);var v=parseFloat(RegExp.$1);return v==7?7:v==8?8:v==9?9:v==10?10:6}return r?-2:i?11:-1}function L(u,o){var r,i;return(r="https://tun-cos-1258344701.file.myqcloud.com/fp.js",i===void 0&&(i=Date.now()+"-"+Math.random()),new Promise(function(v,w){if(document.getElementById(i))v(void 0);else{var B=document.getElementsByTagName("head")[0],J=document.createElement("script");J.onload=function(){return function(){J.onload=null,v(void 0)}},J.onerror=function(fe){J.onerror=null,B.removeChild(J),w(fe)},J.src=r,J.id=i,B.appendChild(J)}})).then(function(){new Fingerprint().getQimei36(u,o)}).catch(function(v){}),""}var b=function(){return(b=Object.assign||function(o){for(var r,i=1,v=arguments.length;i<v;i++)for(var w in r=arguments[i])Object.prototype.hasOwnProperty.call(r,w)&&(o[w]=r[w]);return o}).apply(this,arguments)},U,G=function(){function u(o,r){r===void 0&&(r={}),this.reportOptions={},this.config=o,this.reportOptions=r}return u.canUseDB=function(){return!!(window!=null&&window.indexedDB)},u.prototype.openDB=function(){var o=this;return new Promise(function(r,i){if(!u.canUseDB())return i({message:"\u5F53\u524D\u4E0D\u652F\u6301 indexeddb"});var v=o.config,w=v.name,B=v.version,J=v.stores,fe=indexedDB.open(w,B);fe.onsuccess=function(){o.db=fe.result,r(),b({result:1,func:"open",params:JSON.stringify(o.config)},o.reportOptions)},fe.onerror=function(ge){var $,Re;i(ge),b({result:0,func:"open",params:JSON.stringify(o.config),error_msg:(Re=($=ge.target)===null||$===void 0?void 0:$.error)===null||Re===void 0?void 0:Re.message},o.reportOptions)},fe.onupgradeneeded=function(){o.db=fe.result;try{J==null||J.forEach(function(ge){o.createStore(ge)})}catch(ge){b({result:0,func:"open",params:JSON.stringify(o.config),error_msg:ge.message},o.reportOptions),i(ge)}}})},u.prototype.useStore=function(o){return this.storeName=o,this},u.prototype.deleteDB=function(){var o=this;return this.closeDB(),new Promise(function(r,i){var v=indexedDB.deleteDatabase(o.config.name);v.onsuccess=function(){return r()},v.onerror=i})},u.prototype.closeDB=function(){var o;(o=this.db)===null||o===void 0||o.close(),this.db=null},u.prototype.getStoreCount=function(){var o=this;return new Promise(function(r,i){var v=o.getStore("readonly").count();v.onsuccess=function(){return r(v.result)},v.onerror=i})},u.prototype.clearStore=function(){var o=this;return new Promise(function(r,i){var v=o.getStore("readwrite").clear();v.onsuccess=function(){return r()},v.onerror=i})},u.prototype.add=function(o,r){var i=this;return new Promise(function(v,w){var B=i.getStore("readwrite").add(o,r);B.onsuccess=function(){v(B.result)},B.onerror=w})},u.prototype.put=function(o,r){var i=this;return new Promise(function(v,w){var B=i.getStore("readwrite").put(o,r);B.onsuccess=function(){v(B.result)},B.onerror=w})},u.prototype.getStoreAllData=function(){var o=this;return new Promise(function(r,i){var v=o.getStore("readonly").openCursor(),w=[];v.onsuccess=function(){var B;if(!((B=v.result)===null||B===void 0)&&B.value){var J=v.result.value;w.push(J),v.result.continue()}else r(w)},v.onerror=i})},u.prototype.getDataRangeByIndex=function(o,r,i,v,w){var B=this;return new Promise(function(J,fe){var ge=B.getStore().index(o),$=IDBKeyRange.bound(r,i,v,w),Re=[],Ne=ge.openCursor($);Ne.onsuccess=function(){var Fe;!((Fe=Ne==null?void 0:Ne.result)===null||Fe===void 0)&&Fe.value?(Re.push(Ne==null?void 0:Ne.result.value),Ne==null||Ne.result.continue()):J(Re)},Ne.onerror=fe})},u.prototype.removeDataByIndex=function(o,r,i,v,w){var B=this;return new Promise(function(J,fe){var ge=B.getStore("readwrite").index(o),$=IDBKeyRange.bound(r,i,v,w),Re=ge.openCursor($),Ne=0;Re.onsuccess=function(Fe){var Ie=Fe.target.result;Ie?(Ne+=1,Ie.delete(),Ie.continue()):J(Ne)},Re.onerror=fe})},u.prototype.createStore=function(o){var r=o.name,i=o.indexes,v=i===void 0?[]:i,w=o.options;if(this.db){this.db.objectStoreNames.contains(r)&&this.db.deleteObjectStore(r);var B=this.db.createObjectStore(r,w);v.forEach(function(J){B.createIndex(J.indexName,J.keyPath,J.options)})}},u.prototype.getStore=function(o){var r;return o===void 0&&(o="readonly"),(r=this.db)===null||r===void 0?void 0:r.transaction(this.storeName,o).objectStore(this.storeName)},u}(),X="event_table_v3",Y="eventId",oe=function(){function u(o){this.isReady=!1,this.taskQueue=Promise.resolve(),this.db=new G({name:"Beacon_"+o+"_V3",version:1,stores:[{name:X,options:{keyPath:Y},indexes:[{indexName:Y,keyPath:Y,options:{unique:!0}}]}]}),this.open()}return u.prototype.getCount=function(){var o=this;return this.readyExec(function(){return o.db.getStoreCount()})},u.prototype.setItem=function(o,r){var i=this;return this.readyExec(function(){return i.db.add({eventId:o,value:r})})},u.prototype.getItem=function(o){return q(this,void 0,void 0,function(){var r=this;return O(this,function(i){return[2,this.readyExec(function(){return r.db.getDataRangeByIndex(Y,o,o)})]})})},u.prototype.removeItem=function(o){var r=this;return this.readyExec(function(){return r.db.removeDataByIndex(Y,o,o)})},u.prototype.updateItem=function(o,r){var i=this;return this.readyExec(function(){return i.db.put({eventId:o,value:r})})},u.prototype.iterate=function(o){var r=this;return this.readyExec(function(){return r.db.getStoreAllData().then(function(i){i.forEach(function(v){o(v.value)})})})},u.prototype.open=function(){return q(this,void 0,void 0,function(){var o=this;return O(this,function(r){switch(r.label){case 0:return this.taskQueue=this.taskQueue.then(function(){return o.db.openDB()}),[4,this.taskQueue];case 1:return r.sent(),this.isReady=!0,this.db.useStore(X),[2]}})})},u.prototype.readyExec=function(o){return this.isReady?o():(this.taskQueue=this.taskQueue.then(function(){return o()}),this.taskQueue)},u}(),le=function(){function u(o){this.keyObject={},this.storage=o}return u.prototype.getCount=function(){return this.storage.getStoreCount()},u.prototype.removeItem=function(o){this.storage.removeItem(o),delete this.keyObject[o]},u.prototype.setItem=function(o,r){var i=JSON.stringify(r);this.storage.setItem(o,i),this.keyObject[o]=r},u.prototype.iterate=function(o){for(var r=Object.keys(this.keyObject),i=0;i<r.length;i++){var v=this.storage.getItem(r[i]);o(JSON.parse(v))}},u}(),se=function(){function u(o,r){var i=this;this.dbEventCount=0,_()>0||!window.indexedDB||/X5Lite/.test(navigator.userAgent)?(this.store=new le(r),this.dbEventCount=this.store.getCount()):(this.store=new oe(o),this.getCount().then(function(v){i.dbEventCount=v}).catch(function(v){}))}return u.prototype.getCount=function(){return q(this,void 0,void 0,function(){return O(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.store.getCount()];case 1:return[2,o.sent()];case 2:return o.sent(),[2,Promise.reject()];case 3:return[2]}})})},u.prototype.insertEvent=function(o,r){return q(this,void 0,void 0,function(){var i,v;return O(this,function(w){switch(w.label){case 0:if(this.dbEventCount>=1e4)return[2,Promise.reject()];i=I(o.mapValue),w.label=1;case 1:return w.trys.push([1,3,,4]),this.dbEventCount++,[4,this.store.setItem(i,o)];case 2:return[2,w.sent()];case 3:return v=w.sent(),r&&r(v,o),this.dbEventCount--,[2,Promise.reject()];case 4:return[2]}})})},u.prototype.getEvents=function(){return q(this,void 0,void 0,function(){var o;return O(this,function(r){switch(r.label){case 0:o=[],r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.store.iterate(function(i){o.push(i)})];case 2:return r.sent(),[2,Promise.all(o)];case 3:return r.sent(),[2,Promise.all(o)];case 4:return[2]}})})},u.prototype.removeEvent=function(o){return q(this,void 0,void 0,function(){var r;return O(this,function(i){switch(i.label){case 0:r=I(o.mapValue),i.label=1;case 1:return i.trys.push([1,3,,4]),this.dbEventCount--,[4,this.store.removeItem(r)];case 2:return[2,i.sent()];case 3:return i.sent(),this.dbEventCount++,[2,Promise.reject()];case 4:return[2]}})})},u}(),te=function(){return(te=Object.assign||function(o){for(var r,i=1,v=arguments.length;i<v;i++)for(var w in r=arguments[i])Object.prototype.hasOwnProperty.call(r,w)&&(o[w]=r[w]);return o}).apply(this,arguments)};function de(u){try{return decodeURIComponent(u.replace(/\+/g," "))}catch{return null}}function ue(u,o){var r=[null,void 0,"",NaN].includes(u);if(o.isSkipEmpty&&r)return null;var i=!o.isSkipEmpty&&r?"":u;try{return o.encode?encodeURIComponent(i):i}catch{return null}}function me(u,o){o===void 0&&(o={encode:!0,isSkipEmpty:!1});var r=u.url,i=u.query,v=i===void 0?{}:i,w=u.hash,B=r.split("#"),J=B[0],fe=B[1],ge=fe===void 0?"":fe,$=J.split("?")[0],Re=[],Ne=ue(w||ge,o),Fe=te(te({},function(Ie){var je=Ie.split("#"),Ve=je[0],Ge=je[1],Xe=Ge===void 0?"":Ge,qe=Ve.split("?"),We=qe[0],Qe=qe[1],rt=Qe===void 0?"":Qe,tt=de(Xe),ot=Object.create(null);return rt.split("&").forEach(function(a){var f=a.split("="),E=f[0],M=f[1],he=M===void 0?"":M,we=de(E),Me=de(he);we===null||Me===null||we===""&&Me===""||ot[we]||(ot[we]=Me)}),{url:We,query:ot,hash:tt}}(r).query),v);return Object.keys(Fe).forEach(function(Ie){var je=ue(Ie,o),Ve=ue(Fe[Ie],o);je!==null&&Ve!==null&&Re.push(je+"="+Ve)}),$+(Re.length?"?"+Re.join("&"):"")+(Ne?"#"+Ne:"")}function Z(u,o){return new Promise(function(r,i){if(o&&document.querySelectorAll("script[data-tag="+o+"]").length)return r();var v=document.createElement("script"),w=te({type:"text/javascript",charset:"utf-8"},u);Object.keys(w).forEach(function(B){return function(J,fe,ge){if(J)return ge===void 0?J.getAttribute(fe):J.setAttribute(fe,ge)}(v,B,w[B])}),o&&(v.dataset.tag=o),v.onload=function(){return r()},v.onreadystatechange=function(){var B=v.readyState;["complete","loaded"].includes(B)&&(v.onreadystatechange=null,r())},v.onerror=i,document.body.appendChild(v)})}(function(u){u[u.equal=0]="equal",u[u.low=-1]="low",u[u.high=1]="high"})(U||(U={}));var re=function(){return(re=Object.assign||function(o){for(var r,i=1,v=arguments.length;i<v;i++)for(var w in r=arguments[i])Object.prototype.hasOwnProperty.call(r,w)&&(o[w]=r[w]);return o}).apply(this,arguments)};function ve(u,o,r,i){return new(r||(r=Promise))(function(v,w){function B(ge){try{fe(i.next(ge))}catch($){w($)}}function J(ge){try{fe(i.throw(ge))}catch($){w($)}}function fe(ge){var $;ge.done?v(ge.value):($=ge.value,$ instanceof r?$:new r(function(Re){Re($)})).then(B,J)}fe((i=i.apply(u,o||[])).next())})}function Ce(u,o){var r,i,v,w,B={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return w={next:J(0),throw:J(1),return:J(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function J(fe){return function(ge){return function($){if(r)throw new TypeError("Generator is already executing.");for(;B;)try{if(r=1,i&&(v=2&$[0]?i.return:$[0]?i.throw||((v=i.return)&&v.call(i),0):i.next)&&!(v=v.call(i,$[1])).done)return v;switch(i=0,v&&($=[2&$[0],v.value]),$[0]){case 0:case 1:v=$;break;case 4:return B.label++,{value:$[1],done:!1};case 5:B.label++,i=$[1],$=[0];continue;case 7:$=B.ops.pop(),B.trys.pop();continue;default:if(!((v=(v=B.trys).length>0&&v[v.length-1])||$[0]!==6&&$[0]!==2)){B=0;continue}if($[0]===3&&(!v||$[1]>v[0]&&$[1]<v[3])){B.label=$[1];break}if($[0]===6&&B.label<v[1]){B.label=v[1],v=$;break}if(v&&B.label<v[2]){B.label=v[2],B.ops.push($);break}v[2]&&B.ops.pop(),B.trys.pop();continue}$=o.call(u,B)}catch(Re){$=[6,Re],i=0}finally{r=v=0}if(5&$[0])throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}([fe,ge])}}}var pe=function(){function u(){this.interceptors=[]}return u.prototype.use=function(o,r){return this.interceptors.push({resolved:o,rejected:r}),this.interceptors.length-1},u.prototype.traverse=function(o,r){r===void 0&&(r=!1);var i=Promise.resolve(o);return(r?Array.prototype.reduceRight:Array.prototype.reduce).call(this.interceptors,function(v,w){if(w){var B=w.resolved,J=w.rejected;i=i.then(B,J)}return v},""),i},u.prototype.eject=function(o){this.interceptors[o]&&(this.interceptors[o]=null)},u}(),ye={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 pe,response:new pe}},Se=/^([a-z][a-z\d+\-.]*:)?\/\//i,xe=Object.prototype.toString;function Ee(u){return ve(this,void 0,void 0,function(){var o;return Ce(this,function(r){switch(r.label){case 0:if(window.fetch)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Z({src:u})];case 2:return r.sent(),[3,4];case 3:throw o=r.sent(),new Error("\u52A0\u8F7D polyfill "+u+" \u5931\u8D25: "+o.message);case 4:return[2]}})})}function Oe(u){return["Accept","Content-Type"].forEach(function(o){return r=o,void((i=u.headers)&&Object.keys(i).forEach(function(v){v!==r&&v.toUpperCase()===r.toUpperCase()&&(i[r]=i[v],delete i[v])}));var r,i}),function(o){if(xe.call(o)!=="[object Object]")return!1;var r=Object.getPrototypeOf(o);return r===null||r===Object.prototype}(u.body)&&(u.body=JSON.stringify(u.body),u.headers&&(u.headers["Content-Type"]="application/json;charset=utf-8")),u}function Ae(u){return ve(this,void 0,void 0,function(){var o,r,i,v,w,B,J,fe,ge,$,Re,Ne,Fe,Ie,je,Ve,Ge;return Ce(this,function(Xe){switch(Xe.label){case 0:return o=ye.baseURL,r=ye.defaults,i=ye.interceptors,[4,Ee(ye.polyfillUrl)];case 1:return Xe.sent(),(v=re(re({},r),u)).headers||(v.headers=function(qe){qe===void 0&&(qe="GET");var We=ye.headers[qe]||{};return re(re({},ye.headers.common),We)}(v.method)),Oe(v),[4,i.request.traverse(v,!0)];case 2:if((w=Xe.sent())instanceof Error)throw w;return w.url=function(qe,We){return!qe||Se.test(We)?We:qe.replace(/\/+$/,"")+"/"+We.replace(/^\/+/,"")}(o,w.url),B=w.url,J=w.timeout,fe=w.params,ge=w.method,$=["GET","DELETE","OPTIONS","HEAD"].includes(ge===void 0?"GET":ge)&&!!fe,Re=$?me({url:B,query:fe}):B,Ne=[],J&&!w.signal&&(je=new Promise(function(qe){Fe=setTimeout(function(){qe(new Error("timeout"))},J)}),Ne.push(je),Ie=new AbortController,w.signal=Ie.signal),Ne.push(fetch(Re,w).catch(function(qe){return qe})),[4,Promise.race(Ne)];case 3:return Ve=Xe.sent(),Fe&&clearTimeout(Fe),[4,i.response.traverse(Ve)];case 4:if((Ge=Xe.sent())instanceof Error)throw Ie==null||Ie.abort(),Ge;return[2,Ge]}})})}var De=function(){function u(o){ye.interceptors.request.use(function(r){var i=r.url,v=r.method,w=r.body,B=w;if(o.onReportBeforeSend){var J=o.onReportBeforeSend({url:i,method:v,data:w?JSON.parse(w):null});B=J!=null&&J.data?JSON.stringify(J.data):null}return v!="GET"&&B?N(N({},r),{body:B}):r})}return u.prototype.get=function(o,r){return q(this,void 0,void 0,function(){var i,v;return O(this,function(w){switch(w.label){case 0:return[4,Ae(N({url:o},r))];case 1:return[4,(i=w.sent()).json()];case 2:return v=w.sent(),[2,Promise.resolve({data:v,status:i.status,statusText:i.statusText,headers:i.headers})]}})})},u.prototype.post=function(o,r,i){return q(this,void 0,void 0,function(){var v,w;return O(this,function(B){switch(B.label){case 0:return[4,Ae(N({url:o,body:r,method:"POST"},i))];case 1:return[4,(v=B.sent()).json()];case 2:return w=B.sent(),[2,Promise.resolve({data:w,status:v.status,statusText:v.statusText,headers:v.headers})]}})})},u}(),Le=function(){function u(o){this.appkey=o}return u.prototype.getItem=function(o){try{return window.localStorage.getItem(this.getStoreKey(o))}catch{return""}},u.prototype.removeItem=function(o){try{window.localStorage.removeItem(this.getStoreKey(o))}catch{}},u.prototype.setItem=function(o,r){try{window.localStorage.setItem(this.getStoreKey(o),r)}catch{}},u.prototype.setSessionItem=function(o,r){try{window.sessionStorage.setItem(this.getStoreKey(o),r)}catch{}},u.prototype.getSessionItem=function(o){try{return window.sessionStorage.getItem(this.getStoreKey(o))}catch{return""}},u.prototype.getStoreKey=function(o){return A+this.appkey+"_"+o},u.prototype.createDeviceId=function(){try{var o=window.localStorage.getItem(K);return o||(o=function(r){for(var i="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz0123456789",v="",w=0;w<r;w++)v+=i.charAt(Math.floor(Math.random()*i.length));return v}(32),window.localStorage.setItem(K,o)),o}catch{return""}},u.prototype.clear=function(){try{for(var o=window.localStorage.length,r=0;r<o;r++){var i=window.localStorage.key(r);(i==null?void 0:i.substr(0,9))==A&&window.localStorage.removeItem(i)}}catch{}},u.prototype.getStoreCount=function(){var o=0;try{o=window.localStorage.length}catch{}return o},u}(),Ue="logid_start",ie="4.5.14-web";return function(u){function o(r){var i=u.call(this,r)||this;i.qimei36="",i.uselessCycleTaskNum=0,i.underWeakNet=!1,i.pauseSearching=!1,i.send=function(J,fe,ge){i.storage.setItem(V,Date.now().toString()),i.network.post(i.uploadUrl||i.strategy.getUploadUrl(),J.data).then(function($){var Re;((Re=$==null?void 0:$.data)===null||Re===void 0?void 0:Re.result)==100?i.delayTime=1e3*$.data.delayTime:i.delayTime=0,fe&&fe(J.data),J.data.events.forEach(function(Ne){i.store.removeEvent(Ne).then(function(){i.removeSendingId(I(Ne.mapValue))})}),i.doCustomCycleTask()}).catch(function($){var Re=J.data.events;i.errorReport.reportError($.code?$.code.toString():"600",$.message),ge&&ge(J.data);var Ne=JSON.parse(i.storage.getItem(W));Re.forEach(function(Fe){Ne&&Ne.indexOf(I(Fe))!=-1&&i.store.insertEvent(Fe,function(Ie,je){Ie&&i.errorReport.reportError("604","insertEvent fail!")}),i.removeSendingId(I(Fe))}),i.monitorUploadFailed()})};var v,w,B=_();return i.isUnderIE8=B>0&&B<8,i.isUnderIE8||(i.isUnderIE=B>0,r.needInitQimei&&L(r.appkey,function(J){i.qimei36=J.q36}),i.network=new De(r),i.storage=new Le(r.appkey),i.initCommonInfo(r),i.store=new se(r.appkey,i.storage),i.errorReport=new z(i.config,i.commonInfo,"web",i.network),i.strategy=new p(r.needQueryConfig==null||r.needQueryConfig,i.config,i.commonInfo,i.storage,i.network),i.logidStartTime=i.storage.getItem(Ue),i.logidStartTime||(i.logidStartTime=Date.now().toString(),i.storage.setItem(Ue,i.logidStartTime)),v=i.logidStartTime,w=Date.now()-Number.parseFloat(v),Math.floor(w/864e5)>=365&&i.storage.clear(),i.initSession(r),i.onDirectUserAction("rqd_js_init",{}),setTimeout(function(){return i.lifeCycle.emit("init")},0),i.initDelayTime=r.delay?r.delay:1e3,i.cycleTask(i.initDelayTime)),i}return function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function v(){this.constructor=r}T(r,i),r.prototype=i===null?Object.create(i):(v.prototype=i.prototype,new v)}(o,u),o.prototype.initSession=function(r){var i=18e5;r.sessionDuration&&r.sessionDuration>3e4&&(i=r.sessionDuration),this.beaconSession=new F(this.storage,i,this)},o.prototype.initCommonInfo=function(r){var i=Number(this.storage.getItem(V));try{var v=JSON.parse(this.storage.getItem(W));(Date.now()-i>3e4||!v)&&this.storage.setItem(W,JSON.stringify([]))}catch{}r.uploadUrl&&(this.uploadUrl=r.uploadUrl+"?appkey="+r.appkey);var w=[window.screen.width,window.screen.height];window.devicePixelRatio&&w.push(window.devicePixelRatio),this.commonInfo={deviceId:this.storage.createDeviceId(),language:navigator&&navigator.language||"zh_CN",query:window.location.search,userAgent:navigator.userAgent,pixel:w.join("*"),channelID:r.channelID?String(r.channelID):"",openid:r.openid?String(r.openid):"",unid:r.unionid?String(r.unionid):"",sdkVersion:ie},this.config.appVersion=r.versionCode?String(r.versionCode):"",this.config.strictMode=r.strictMode},o.prototype.cycleTask=function(r){var i=this;this.intervalID=window.setInterval(function(){i.pauseSearching||i.store.getEvents().then(function(v){v.length==0&&(i.pauseSearching=!0);var w=[],B=JSON.parse(i.storage.getItem(W));B||(B=[]),v&&v.forEach(function(J){var fe=I(J.mapValue);B.indexOf(fe)==-1&&(w.push(J),B.push(fe))}),w.length!=0&&(i.storage.setItem(W,JSON.stringify(B)),i._normalLogPipeline(i.assembleData(w)))}).catch(function(v){})},r)},o.prototype.onReport=function(r,i,v){var w=this;if(this.isUnderIE8)this.errorReport.reportError("601","UnderIE8");else{this.pauseSearching=!1;var B=this.generateData(r,i,v);if(v&&this.delayTime==0&&!this.underWeakNet)this._normalLogPipeline(this.assembleData(B));else{var J=B.shift();J&&this.store.insertEvent(J,function(fe){fe&&w.errorReport.reportError("604","insertEvent fail!")}).catch(function(fe){w._normalLogPipeline(w.assembleData(B))})}}},o.prototype.onSendBeacon=function(r,i){if(this.isUnderIE)this.errorReport.reportError("605","UnderIE");else{this.pauseSearching=!1;var v=this.assembleData(this.generateData(r,i,!0));typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.uploadUrl||this.strategy.getUploadUrl(),JSON.stringify(v))}},o.prototype.generateData=function(r,i,v){var w=[],B="4.5.14-web_"+(v?"direct_log_id":"normal_log_id"),J=Number(this.storage.getItem(B));return J=J||1,i=N(N({},i),{A99:v?"Y":"N",A100:J.toString(),A72:ie,A88:this.logidStartTime}),J++,this.storage.setItem(B,J.toString()),w.push({eventCode:r,eventTime:Date.now().toString(),mapValue:Q(i,this.config.strictMode)}),w},o.prototype.assembleData=function(r){var i=this.beaconSession.getSession();return{appVersion:this.config.appVersion?ae(this.config.appVersion):"",sdkId:"js",sdkVersion:ie,mainAppKey:this.config.appkey,platformId:3,common:Q(N(N({},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:i.sessionId,A101:this.commonInfo.userAgent,A102:window.location.href,A104:document.referrer,A119:this.commonInfo.query,A153:this.qimei36}),!1),events:r}},o.prototype.monitorUploadFailed=function(){this.uselessCycleTaskNum++,this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(6e4),this.underWeakNet=!0)},o.prototype.doCustomCycleTask=function(){this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(this.initDelayTime)),this.uselessCycleTaskNum=0,this.underWeakNet=!1},o}(y)})},"./lib/crypto.js":function(l,C,s){(function(g){var R=s("./node_modules/@babel/runtime/helpers/typeof.js"),d=d||function(T,N){var q={},O=q.lib={},A=function(){},K=O.Base={extend:function(m){A.prototype=this;var y=new A;return m&&y.mixIn(m),y.hasOwnProperty("init")||(y.init=function(){y.$super.init.apply(this,arguments)}),y.init.prototype=y,y.$super=this,y},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var y in m)m.hasOwnProperty(y)&&(this[y]=m[y]);m.hasOwnProperty("toString")&&(this.toString=m.toString)},clone:function(){return this.init.prototype.extend(this)}},V=O.WordArray=K.extend({init:function(m,y){m=this.words=m||[],this.sigBytes=y!=N?y:4*m.length},toString:function(m){return(m||j).stringify(this)},concat:function(m){var y=this.words,z=m.words,p=this.sigBytes;if(m=m.sigBytes,this.clamp(),p%4)for(var D=0;D<m;D++)y[p+D>>>2]|=(z[D>>>2]>>>24-8*(D%4)&255)<<24-8*((p+D)%4);else if(65535<z.length)for(D=0;D<m;D+=4)y[p+D>>>2]=z[D>>>2];else y.push.apply(y,z);return this.sigBytes+=m,this},clamp:function(){var m=this.words,y=this.sigBytes;m[y>>>2]&=4294967295<<32-8*(y%4),m.length=T.ceil(y/4)},clone:function(){var m=K.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var y=[],z=0;z<m;z+=4)y.push(4294967296*T.random()|0);return new V.init(y,m)}}),W=q.enc={},j=W.Hex={stringify:function(m){var y=m.words;m=m.sigBytes;for(var z=[],p=0;p<m;p++){var D=y[p>>>2]>>>24-8*(p%4)&255;z.push((D>>>4).toString(16)),z.push((D&15).toString(16))}return z.join("")},parse:function(m){for(var y=m.length,z=[],p=0;p<y;p+=2)z[p>>>3]|=parseInt(m.substr(p,2),16)<<24-4*(p%8);return new V.init(z,y/2)}},H=W.Latin1={stringify:function(m){var y=m.words;m=m.sigBytes;for(var z=[],p=0;p<m;p++)z.push(String.fromCharCode(y[p>>>2]>>>24-8*(p%4)&255));return z.join("")},parse:function(m){for(var y=m.length,z=[],p=0;p<y;p++)z[p>>>2]|=(m.charCodeAt(p)&255)<<24-8*(p%4);return new V.init(z,y)}},ne=W.Utf8={stringify:function(m){try{return decodeURIComponent(escape(H.stringify(m)))}catch{throw Error("Malformed UTF-8 data")}},parse:function(m){return H.parse(unescape(encodeURIComponent(m)))}},Q=O.BufferedBlockAlgorithm=K.extend({reset:function(){this._data=new V.init,this._nDataBytes=0},_append:function(m){typeof m=="string"&&(m=ne.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes},_process:function(m){var y=this._data,z=y.words,p=y.sigBytes,D=this.blockSize,F=p/(4*D),F=m?T.ceil(F):T.max((F|0)-this._minBufferSize,0);if(m=F*D,p=T.min(4*m,p),m){for(var _=0;_<m;_+=D)this._doProcessBlock(z,_);_=z.splice(0,m),y.sigBytes-=p}return new V.init(_,p)},clone:function(){var m=K.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});O.Hasher=Q.extend({cfg:K.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset()},reset:function(){Q.reset.call(this),this._doReset()},update:function(m){return this._append(m),this._process(),this},finalize:function(m){return m&&this._append(m),this._doFinalize()},blockSize:16,_createHelper:function(m){return function(y,z){return new m.init(z).finalize(y)}},_createHmacHelper:function(m){return function(y,z){return new ae.HMAC.init(m,z).finalize(y)}}});var ae=q.algo={};return q}(Math);(function(){var T=d,A=T.lib,N=A.WordArray,q=A.Hasher,O=[],A=T.algo.SHA1=q.extend({_doReset:function(){this._hash=new N.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(V,W){for(var j=this._hash.words,H=j[0],ne=j[1],Q=j[2],ae=j[3],I=j[4],m=0;80>m;m++){if(16>m)O[m]=V[W+m]|0;else{var y=O[m-3]^O[m-8]^O[m-14]^O[m-16];O[m]=y<<1|y>>>31}y=(H<<5|H>>>27)+I+O[m],y=20>m?y+((ne&Q|~ne&ae)+1518500249):40>m?y+((ne^Q^ae)+1859775393):60>m?y+((ne&Q|ne&ae|Q&ae)-1894007588):y+((ne^Q^ae)-899497514),I=ae,ae=Q,Q=ne<<30|ne>>>2,ne=H,H=y}j[0]=j[0]+H|0,j[1]=j[1]+ne|0,j[2]=j[2]+Q|0,j[3]=j[3]+ae|0,j[4]=j[4]+I|0},_doFinalize:function(){var V=this._data,W=V.words,j=8*this._nDataBytes,H=8*V.sigBytes;return W[H>>>5]|=128<<24-H%32,W[(H+64>>>9<<4)+14]=Math.floor(j/4294967296),W[(H+64>>>9<<4)+15]=j,V.sigBytes=4*W.length,this._process(),this._hash},clone:function(){var V=q.clone.call(this);return V._hash=this._hash.clone(),V}});T.SHA1=q._createHelper(A),T.HmacSHA1=q._createHmacHelper(A)})(),function(){var T=d,N=T.enc.Utf8;T.algo.HMAC=T.lib.Base.extend({init:function(O,A){O=this._hasher=new O.init,typeof A=="string"&&(A=N.parse(A));var K=O.blockSize,V=4*K;A.sigBytes>V&&(A=O.finalize(A)),A.clamp();for(var W=this._oKey=A.clone(),j=this._iKey=A.clone(),H=W.words,ne=j.words,Q=0;Q<K;Q++)H[Q]^=1549556828,ne[Q]^=909522486;W.sigBytes=j.sigBytes=V,this.reset()},reset:function(){var O=this._hasher;O.reset(),O.update(this._iKey)},update:function(O){return this._hasher.update(O),this},finalize:function(O){var A=this._hasher;return O=A.finalize(O),A.reset(),A.finalize(this._oKey.clone().concat(O))}})}(),function(){var T=d,N=T.lib,q=N.WordArray,O=T.enc;O.Base64={stringify:function(K){var V=K.words,W=K.sigBytes,j=this._map;K.clamp();for(var H=[],ne=0;ne<W;ne+=3)for(var Q=V[ne>>>2]>>>24-ne%4*8&255,ae=V[ne+1>>>2]>>>24-(ne+1)%4*8&255,I=V[ne+2>>>2]>>>24-(ne+2)%4*8&255,m=Q<<16|ae<<8|I,y=0;y<4&&ne+y*.75<W;y++)H.push(j.charAt(m>>>6*(3-y)&63));var z=j.charAt(64);if(z)for(;H.length%4;)H.push(z);return H.join("")},parse:function(K){var V=K.length,W=this._map,j=W.charAt(64);if(j){var H=K.indexOf(j);H!=-1&&(V=H)}for(var ne=[],Q=0,ae=0;ae<V;ae++)if(ae%4){var I=W.indexOf(K.charAt(ae-1))<<ae%4*2,m=W.indexOf(K.charAt(ae))>>>6-ae%4*2;ne[Q>>>2]|=(I|m)<<24-Q%4*8,Q++}return q.create(ne,Q)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),R(g)==="object"?g.exports=d:window.CryptoJS=d}).call(this,s("./node_modules/webpack/buildin/module.js")(l))},"./lib/json2xml.js":function(l,C,s){var g=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",d="-.0-9\xB7\u0300-\u036F\u203F\u2040",T=new RegExp("^([^"+R+"])|^((x|X)(m|M)(l|L))|([^"+R+d+"])","g"),N=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,q=function(W){var j=[];if(W instanceof Object)for(var H in W)W.hasOwnProperty(H)&&j.push(H);return j},O=function(W,j){var H=function(Q,ae,I,m,y){var z=j.indent!==void 0?j.indent:" ",p=j.prettyPrint?`
  2. `+new Array(m).join(z):"";j.removeIllegalNameCharacters&&(Q=Q.replace(T,"_"));var D=[p,"<",Q,I||""];return ae&&ae.length>0?(D.push(">"),D.push(ae),y&&D.push(p),D.push("</"),D.push(Q),D.push(">")):D.push("/>"),D.join("")};return function ne(Q,ae,I){var m=g(Q);switch((Array.isArray?Array.isArray(Q):Q instanceof Array)?m="array":Q instanceof Date&&(m="date"),m){case"array":var y=[];return Q.map(function(F){y.push(ne(F,1,I+1))}),j.prettyPrint&&y.push(`
  3. `),y.join("");case"date":return Q.toJSON?Q.toJSON():Q+"";case"object":var z=[];for(var p in Q)if(Q.hasOwnProperty(p))if(Q[p]instanceof Array)for(var D=0;D<Q[p].length;D++)Q[p].hasOwnProperty(D)&&z.push(H(p,ne(Q[p][D],0,I+1),null,I+1,q(Q[p][D]).length));else z.push(H(p,ne(Q[p],0,I+1),null,I+1));return j.prettyPrint&&z.length>0&&z.push(`
  4. `),z.join("");case"function":return Q();default:return j.escape?K(Q):""+Q}}(W,0,0)},A=function(W){var j=['<?xml version="1.0" encoding="UTF-8"'];return W&&j.push(' standalone="yes"'),j.push("?>"),j.join("")};function K(V){return(""+V).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(N,"")}l.exports=function(V,W){if(W||(W={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),typeof V=="string")try{V=JSON.parse(V.toString())}catch{return!1}var j="",H="";W&&(g(W)=="object"?(W.xmlHeader&&(j=A(!!W.xmlHeader.standalone)),typeof W.docType!="undefined"&&(H="<!DOCTYPE "+W.docType+">")):j=A()),W=W||{};var ne=[j,W.prettyPrint&&H?`
  5. `:"",H,O(V,W)];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(l){return Object.prototype.toString.call(l)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(l){return _typeof(l)==="object"&&l.buffer&&l.buffer.constructor===ArrayBuffer});var createOutputMethod=function(C){return function(s,g){return new Md5(!0).update(s,g)[C]()}},createMethod=function(){var C=createOutputMethod("hex");NODE_JS&&(C=nodeWrap(C)),C.getCtx=C.create=function(){return new Md5},C.update=function(R){return C.create().update(R)};for(var s=0;s<OUTPUT_TYPES.length;++s){var g=OUTPUT_TYPES[s];C[g]=createOutputMethod(g)}return C},nodeWrap=function nodeWrap(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function l(C){if(typeof C=="string")return crypto.createHash("md5").update(C,"utf8").digest("hex");if(C==null)throw ERROR;return C.constructor===ArrayBuffer&&(C=new Uint8Array(C)),Array.isArray(C)||ArrayBuffer.isView(C)||C.constructor===Buffer?crypto.createHash("md5").update(new Buffer(C)).digest("hex"):method(C)};return nodeMethod};function Md5(l){if(l)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 C=new ArrayBuffer(68);this.buffer8=new Uint8Array(C),this.blocks=new Uint32Array(C)}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(l,C){if(!this.finalized){for(var s,g=0,R,d=l.length,T=this.blocks,N=this.buffer8;g<d;){if(this.hashed&&(this.hashed=!1,T[0]=T[16],T[16]=T[1]=T[2]=T[3]=T[4]=T[5]=T[6]=T[7]=T[8]=T[9]=T[10]=T[11]=T[12]=T[13]=T[14]=T[15]=0),ARRAY_BUFFER)for(R=this.start;g<d&&R<64;++g)s=l.charCodeAt(g),C||s<128?N[R++]=s:s<2048?(N[R++]=192|s>>6,N[R++]=128|s&63):s<55296||s>=57344?(N[R++]=224|s>>12,N[R++]=128|s>>6&63,N[R++]=128|s&63):(s=65536+((s&1023)<<10|l.charCodeAt(++g)&1023),N[R++]=240|s>>18,N[R++]=128|s>>12&63,N[R++]=128|s>>6&63,N[R++]=128|s&63);else for(R=this.start;g<d&&R<64;++g)s=l.charCodeAt(g),C||s<128?T[R>>2]|=s<<SHIFT[R++&3]:s<2048?(T[R>>2]|=(192|s>>6)<<SHIFT[R++&3],T[R>>2]|=(128|s&63)<<SHIFT[R++&3]):s<55296||s>=57344?(T[R>>2]|=(224|s>>12)<<SHIFT[R++&3],T[R>>2]|=(128|s>>6&63)<<SHIFT[R++&3],T[R>>2]|=(128|s&63)<<SHIFT[R++&3]):(s=65536+((s&1023)<<10|l.charCodeAt(++g)&1023),T[R>>2]|=(240|s>>18)<<SHIFT[R++&3],T[R>>2]|=(128|s>>12&63)<<SHIFT[R++&3],T[R>>2]|=(128|s>>6&63)<<SHIFT[R++&3],T[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 l=this.blocks,C=this.lastByteIndex;l[C>>2]|=EXTRA[C&3],C>=56&&(this.hashed||this.hash(),l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),l[14]=this.bytes<<3,l[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var l,C,s,g,R,d,T=this.blocks;this.first?(l=T[0]-680876937,l=(l<<7|l>>>25)-271733879<<0,g=(-1732584194^l&2004318071)+T[1]-117830708,g=(g<<12|g>>>20)+l<<0,s=(-271733879^g&(l^-271733879))+T[2]-1126478375,s=(s<<17|s>>>15)+g<<0,C=(l^s&(g^l))+T[3]-1316259209,C=(C<<22|C>>>10)+s<<0):(l=this.h0,C=this.h1,s=this.h2,g=this.h3,l+=(g^C&(s^g))+T[0]-680876936,l=(l<<7|l>>>25)+C<<0,g+=(s^l&(C^s))+T[1]-389564586,g=(g<<12|g>>>20)+l<<0,s+=(C^g&(l^C))+T[2]+606105819,s=(s<<17|s>>>15)+g<<0,C+=(l^s&(g^l))+T[3]-1044525330,C=(C<<22|C>>>10)+s<<0),l+=(g^C&(s^g))+T[4]-176418897,l=(l<<7|l>>>25)+C<<0,g+=(s^l&(C^s))+T[5]+1200080426,g=(g<<12|g>>>20)+l<<0,s+=(C^g&(l^C))+T[6]-1473231341,s=(s<<17|s>>>15)+g<<0,C+=(l^s&(g^l))+T[7]-45705983,C=(C<<22|C>>>10)+s<<0,l+=(g^C&(s^g))+T[8]+1770035416,l=(l<<7|l>>>25)+C<<0,g+=(s^l&(C^s))+T[9]-1958414417,g=(g<<12|g>>>20)+l<<0,s+=(C^g&(l^C))+T[10]-42063,s=(s<<17|s>>>15)+g<<0,C+=(l^s&(g^l))+T[11]-1990404162,C=(C<<22|C>>>10)+s<<0,l+=(g^C&(s^g))+T[12]+1804603682,l=(l<<7|l>>>25)+C<<0,g+=(s^l&(C^s))+T[13]-40341101,g=(g<<12|g>>>20)+l<<0,s+=(C^g&(l^C))+T[14]-1502002290,s=(s<<17|s>>>15)+g<<0,C+=(l^s&(g^l))+T[15]+1236535329,C=(C<<22|C>>>10)+s<<0,l+=(s^g&(C^s))+T[1]-165796510,l=(l<<5|l>>>27)+C<<0,g+=(C^s&(l^C))+T[6]-1069501632,g=(g<<9|g>>>23)+l<<0,s+=(l^C&(g^l))+T[11]+643717713,s=(s<<14|s>>>18)+g<<0,C+=(g^l&(s^g))+T[0]-373897302,C=(C<<20|C>>>12)+s<<0,l+=(s^g&(C^s))+T[5]-701558691,l=(l<<5|l>>>27)+C<<0,g+=(C^s&(l^C))+T[10]+38016083,g=(g<<9|g>>>23)+l<<0,s+=(l^C&(g^l))+T[15]-660478335,s=(s<<14|s>>>18)+g<<0,C+=(g^l&(s^g))+T[4]-405537848,C=(C<<20|C>>>12)+s<<0,l+=(s^g&(C^s))+T[9]+568446438,l=(l<<5|l>>>27)+C<<0,g+=(C^s&(l^C))+T[14]-1019803690,g=(g<<9|g>>>23)+l<<0,s+=(l^C&(g^l))+T[3]-187363961,s=(s<<14|s>>>18)+g<<0,C+=(g^l&(s^g))+T[8]+1163531501,C=(C<<20|C>>>12)+s<<0,l+=(s^g&(C^s))+T[13]-1444681467,l=(l<<5|l>>>27)+C<<0,g+=(C^s&(l^C))+T[2]-51403784,g=(g<<9|g>>>23)+l<<0,s+=(l^C&(g^l))+T[7]+1735328473,s=(s<<14|s>>>18)+g<<0,C+=(g^l&(s^g))+T[12]-1926607734,C=(C<<20|C>>>12)+s<<0,R=C^s,l+=(R^g)+T[5]-378558,l=(l<<4|l>>>28)+C<<0,g+=(R^l)+T[8]-2022574463,g=(g<<11|g>>>21)+l<<0,d=g^l,s+=(d^C)+T[11]+1839030562,s=(s<<16|s>>>16)+g<<0,C+=(d^s)+T[14]-35309556,C=(C<<23|C>>>9)+s<<0,R=C^s,l+=(R^g)+T[1]-1530992060,l=(l<<4|l>>>28)+C<<0,g+=(R^l)+T[4]+1272893353,g=(g<<11|g>>>21)+l<<0,d=g^l,s+=(d^C)+T[7]-155497632,s=(s<<16|s>>>16)+g<<0,C+=(d^s)+T[10]-1094730640,C=(C<<23|C>>>9)+s<<0,R=C^s,l+=(R^g)+T[13]+681279174,l=(l<<4|l>>>28)+C<<0,g+=(R^l)+T[0]-358537222,g=(g<<11|g>>>21)+l<<0,d=g^l,s+=(d^C)+T[3]-722521979,s=(s<<16|s>>>16)+g<<0,C+=(d^s)+T[6]+76029189,C=(C<<23|C>>>9)+s<<0,R=C^s,l+=(R^g)+T[9]-640364487,l=(l<<4|l>>>28)+C<<0,g+=(R^l)+T[12]-421815835,g=(g<<11|g>>>21)+l<<0,d=g^l,s+=(d^C)+T[15]+530742520,s=(s<<16|s>>>16)+g<<0,C+=(d^s)+T[2]-995338651,C=(C<<23|C>>>9)+s<<0,l+=(s^(C|~g))+T[0]-198630844,l=(l<<6|l>>>26)+C<<0,g+=(C^(l|~s))+T[7]+1126891415,g=(g<<10|g>>>22)+l<<0,s+=(l^(g|~C))+T[14]-1416354905,s=(s<<15|s>>>17)+g<<0,C+=(g^(s|~l))+T[5]-57434055,C=(C<<21|C>>>11)+s<<0,l+=(s^(C|~g))+T[12]+1700485571,l=(l<<6|l>>>26)+C<<0,g+=(C^(l|~s))+T[3]-1894986606,g=(g<<10|g>>>22)+l<<0,s+=(l^(g|~C))+T[10]-1051523,s=(s<<15|s>>>17)+g<<0,C+=(g^(s|~l))+T[1]-2054922799,C=(C<<21|C>>>11)+s<<0,l+=(s^(C|~g))+T[8]+1873313359,l=(l<<6|l>>>26)+C<<0,g+=(C^(l|~s))+T[15]-30611744,g=(g<<10|g>>>22)+l<<0,s+=(l^(g|~C))+T[6]-1560198380,s=(s<<15|s>>>17)+g<<0,C+=(g^(s|~l))+T[13]+1309151649,C=(C<<21|C>>>11)+s<<0,l+=(s^(C|~g))+T[4]-145523070,l=(l<<6|l>>>26)+C<<0,g+=(C^(l|~s))+T[11]-1120210379,g=(g<<10|g>>>22)+l<<0,s+=(l^(g|~C))+T[2]+718787259,s=(s<<15|s>>>17)+g<<0,C+=(g^(s|~l))+T[9]-343485551,C=(C<<21|C>>>11)+s<<0,this.first?(this.h0=l+1732584193<<0,this.h1=C-271733879<<0,this.h2=s-1732584194<<0,this.h3=g+271733878<<0,this.first=!1):(this.h0=this.h0+l<<0,this.h1=this.h1+C<<0,this.h2=this.h2+s<<0,this.h3=this.h3+g<<0)},Md5.prototype.hex=function(){this.finalize();var l=this.h0,C=this.h1,s=this.h2,g=this.h3;return HEX_CHARS[l>>4&15]+HEX_CHARS[l&15]+HEX_CHARS[l>>12&15]+HEX_CHARS[l>>8&15]+HEX_CHARS[l>>20&15]+HEX_CHARS[l>>16&15]+HEX_CHARS[l>>28&15]+HEX_CHARS[l>>24&15]+HEX_CHARS[C>>4&15]+HEX_CHARS[C&15]+HEX_CHARS[C>>12&15]+HEX_CHARS[C>>8&15]+HEX_CHARS[C>>20&15]+HEX_CHARS[C>>16&15]+HEX_CHARS[C>>28&15]+HEX_CHARS[C>>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[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]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(l){if(l==="hex")return this.hex();this.finalize();var C=this.h0,s=this.h1,g=this.h2,R=this.h3,d=[C&255,C>>8&255,C>>16&255,C>>24&255,s&255,s>>8&255,s>>16&255,s>>24&255,g&255,g>>8&255,g>>16&255,g>>24&255,R&255,R>>8&255,R>>16&255,R>>24&255];return d},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var l=new ArrayBuffer(16),C=new Uint32Array(l);return C[0]=this.h0,C[1]=this.h1,C[2]=this.h2,C[3]=this.h3,l},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var l,C,s,g="",R=this.array(),d=0;d<15;)l=R[d++],C=R[d++],s=R[d++],g+=BASE64_ENCODE_CHAR[l>>>2]+BASE64_ENCODE_CHAR[(l<<4|C>>>4)&63]+BASE64_ENCODE_CHAR[(C<<2|s>>>6)&63]+BASE64_ENCODE_CHAR[s&63];return l=R[d],g+=BASE64_ENCODE_CHAR[l>>>2]+BASE64_ENCODE_CHAR[l<<4&63]+"==",g};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(l,C,s){var g=s("./node_modules/@babel/runtime/helpers/typeof.js"),R=function(A){switch(g(A)){case"string":return A;case"boolean":return A?"true":"false";case"number":return isFinite(A)?A:"";default:return""}},d=function(A,K,V,W){return K=K||"&",V=V||"=",A===null&&(A=void 0),g(A)==="object"?Object.keys(A).map(function(j){var H=encodeURIComponent(R(j))+V;return Array.isArray(A[j])?A[j].map(function(ne){return H+encodeURIComponent(R(ne))}).join(K):H+encodeURIComponent(R(A[j]))}).filter(Boolean).join(K):W?encodeURIComponent(R(W))+V+encodeURIComponent(R(A)):""},T=function(A,K,V){var W={};return K.getAllResponseHeaders().trim().split(`
  7. `).forEach(function(j){if(j){var H=j.indexOf(":"),ne=j.substr(0,H).trim().toLowerCase(),Q=j.substr(H+1).trim();W[ne]=Q}}),{error:A,statusCode:K.status,statusMessage:K.statusText,headers:W,body:V}},N=function(A,K){return!K&&K==="text"?A.responseText:A.response},q=function(A,K){var V=(A.method||"GET").toUpperCase(),W=A.url;if(A.qs){var j=d(A.qs);j&&(W+=(W.indexOf("?")===-1?"?":"&")+j)}var H=new XMLHttpRequest;if(H.open(V,W,!0),H.responseType=A.dataType||"text",A.xhrFields)for(var ne in A.xhrFields)H[ne]=A.xhrFields[ne];var Q=A.headers;if(Q)for(var ae in Q)Q.hasOwnProperty(ae)&&ae.toLowerCase()!=="content-length"&&ae.toLowerCase()!=="user-agent"&&ae.toLowerCase()!=="origin"&&ae.toLowerCase()!=="host"&&H.setRequestHeader(ae,Q[ae]);return A.onProgress&&H.upload&&(H.upload.onprogress=A.onProgress),A.onDownloadProgress&&(H.onprogress=A.onDownloadProgress),A.timeout&&(H.timeout=A.timeout),H.ontimeout=function(I){var m=new Error("timeout");K(T(m,H))},H.onload=function(){K(T(null,H,N(H,A.dataType)))},H.onerror=function(I){var m=N(H,A.dataType);if(m)K(T(null,H,m));else{var y=H.statusText;!y&&H.status===0&&(y=new Error("CORS blocked or network error")),K(T(y,H,m))}},H.send(A.body||""),H};l.exports=q},"./lib/xml2json.js":function(l,C,s){var g=s("./node_modules/@xmldom/xmldom/lib/index.js").DOMParser,R=function(){this.version="1.3.5";var T={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},N=new RegExp(/(?!xmlns)^.*:/);return this.grokType=function(q){return/^\s*$/.test(q)?null:/^(?:true|false)$/i.test(q)?q.toLowerCase()==="true":isFinite(q)?parseFloat(q):q},this.parseString=function(q,O){if(q){var A=this.stringToXML(q);return A.getElementsByTagName("parsererror").length?null:this.parseXML(A,O)}else return null},this.parseXML=function(q,O){for(var A in O)T[A]=O[A];var K={},V=0,W="",j=q.childNodes.length;if(j)for(var H,ne,Q,ae=0;ae<q.childNodes.length;ae++)H=q.childNodes.item(ae),H.nodeType===4?T.mergeCDATA&&(W+=H.nodeValue):H.nodeType===3?W+=H.nodeValue:H.nodeType===1&&(V===0&&(K={}),T.stripElemPrefix?ne=H.nodeName.replace(N,""):ne=H.nodeName,Q=R.parseXML(H),K.hasOwnProperty(ne)?(K[ne].constructor!==Array&&(K[ne]=[K[ne]]),K[ne].push(Q)):(K[ne]=Q,V++));return Object.keys(K).length||(K=W||""),K},this.xmlToString=function(q){try{var O=q.xml?q.xml:new XMLSerializer().serializeToString(q);return O}catch{return null}},this.stringToXML=function(q){try{var O=null;if(window.DOMParser){var A=new g;return O=A.parseFromString(q,"text/xml"),O}else return O=new ActiveXObject("Microsoft.XMLDOM"),O.async=!1,O.loadXML(q),O}catch{return null}},this}.call({}),d=function(N){return R.parseString(N)};l.exports=d},"./node_modules/@babel/runtime/helpers/classCallCheck.js":function(l,C){function s(g,R){if(!(g instanceof R))throw new TypeError("Cannot call a class as a function")}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports},"./node_modules/@babel/runtime/helpers/createClass.js":function(l,C){function s(R,d){for(var T=0;T<d.length;T++){var N=d[T];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(R,N.key,N)}}function g(R,d,T){return d&&s(R.prototype,d),T&&s(R,T),Object.defineProperty(R,"prototype",{writable:!1}),R}l.exports=g,l.exports.__esModule=!0,l.exports.default=l.exports},"./node_modules/@babel/runtime/helpers/typeof.js":function(l,C){function s(g){return l.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},l.exports.__esModule=!0,l.exports.default=l.exports,s(g)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports},"./node_modules/@xmldom/xmldom/lib/conventions.js":function(l,C,s){function g(q,O,A){if(A===void 0&&(A=Array.prototype),q&&typeof A.find=="function")return A.find.call(q,O);for(var K=0;K<q.length;K++)if(Object.prototype.hasOwnProperty.call(q,K)){var V=q[K];if(O.call(void 0,V,K,q))return V}}function R(q,O){return O===void 0&&(O=Object),O&&typeof O.freeze=="function"?O.freeze(q):q}function d(q,O){if(q===null||typeof q!="object")throw new TypeError("target is not an object");for(var A in O)Object.prototype.hasOwnProperty.call(O,A)&&(q[A]=O[A]);return q}var T=R({HTML:"text/html",isHTML:function(q){return q===T.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),N=R({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(q){return q===N.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});C.assign=d,C.find=g,C.freeze=R,C.MIME_TYPE=T,C.NAMESPACE=N},"./node_modules/@xmldom/xmldom/lib/dom-parser.js":function(l,C,s){var g=s("./node_modules/@xmldom/xmldom/lib/conventions.js"),R=s("./node_modules/@xmldom/xmldom/lib/dom.js"),d=s("./node_modules/@xmldom/xmldom/lib/entities.js"),T=s("./node_modules/@xmldom/xmldom/lib/sax.js"),N=R.DOMImplementation,q=g.NAMESPACE,O=T.ParseError,A=T.XMLReader;function K(I){return I.replace(/\r[\n\u0085]/g,`
  8. `).replace(/[\r\u0085\u2028]/g,`
  9. `)}function V(I){this.options=I||{locator:{}}}V.prototype.parseFromString=function(I,m){var y=this.options,z=new A,p=y.domBuilder||new j,D=y.errorHandler,F=y.locator,_=y.xmlns||{},L=/\/x?html?$/.test(m),b=L?d.HTML_ENTITIES:d.XML_ENTITIES;F&&p.setDocumentLocator(F),z.errorHandler=W(D,p,F),z.domBuilder=y.domBuilder||p,L&&(_[""]=q.HTML),_.xml=_.xml||q.XML;var U=y.normalizeLineEndings||K;return I&&typeof I=="string"?z.parse(U(I),_,b):z.errorHandler.error("invalid doc source"),p.doc};function W(I,m,y){if(!I){if(m instanceof j)return m;I=m}var z={},p=I instanceof Function;y=y||{};function D(F){var _=I[F];!_&&p&&(_=I.length==2?function(L){I(F,L)}:I),z[F]=_&&function(L){_("[xmldom "+F+"] "+L+ne(y))}||function(){}}return D("warning"),D("error"),D("fatalError"),z}function j(){this.cdata=!1}function H(I,m){m.lineNumber=I.lineNumber,m.columnNumber=I.columnNumber}j.prototype={startDocument:function(){this.doc=new N().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(I,m,y,z){var p=this.doc,D=p.createElementNS(I,y||m),F=z.length;ae(this,D),this.currentElement=D,this.locator&&H(this.locator,D);for(var _=0;_<F;_++){var I=z.getURI(_),L=z.getValue(_),y=z.getQName(_),b=p.createAttributeNS(I,y);this.locator&&H(z.getLocator(_),b),b.value=b.nodeValue=L,D.setAttributeNode(b)}},endElement:function(I,m,y){var z=this.currentElement;z.tagName,this.currentElement=z.parentNode},startPrefixMapping:function(I,m){},endPrefixMapping:function(I){},processingInstruction:function(I,m){var y=this.doc.createProcessingInstruction(I,m);this.locator&&H(this.locator,y),ae(this,y)},ignorableWhitespace:function(I,m,y){},characters:function(I,m,y){if(I=Q.apply(this,arguments),I){if(this.cdata)var z=this.doc.createCDATASection(I);else var z=this.doc.createTextNode(I);this.currentElement?this.currentElement.appendChild(z):/^\s*$/.test(I)&&this.doc.appendChild(z),this.locator&&H(this.locator,z)}},skippedEntity:function(I){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(I){(this.locator=I)&&(I.lineNumber=0)},comment:function(I,m,y){I=Q.apply(this,arguments);var z=this.doc.createComment(I);this.locator&&H(this.locator,z),ae(this,z)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(I,m,y){var z=this.doc.implementation;if(z&&z.createDocumentType){var p=z.createDocumentType(I,m,y);this.locator&&H(this.locator,p),ae(this,p),this.doc.doctype=p}},warning:function(I){console.warn("[xmldom warning] "+I,ne(this.locator))},error:function(I){console.error("[xmldom error] "+I,ne(this.locator))},fatalError:function(I){throw new O(I,this.locator)}};function ne(I){if(I)return`
  10. @`+(I.systemId||"")+"#[line:"+I.lineNumber+",col:"+I.columnNumber+"]"}function Q(I,m,y){return typeof I=="string"?I.substr(m,y):I.length>=m+y||m?new java.lang.String(I,m,y)+"":I}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(I){j.prototype[I]=function(){return null}});function ae(I,m){I.currentElement?I.currentElement.appendChild(m):I.doc.appendChild(m)}C.__DOMHandler=j,C.normalizeLineEndings=K,C.DOMParser=V},"./node_modules/@xmldom/xmldom/lib/dom.js":function(l,C,s){var g=s("./node_modules/@xmldom/xmldom/lib/conventions.js"),R=g.find,d=g.NAMESPACE;function T(a){return a!==""}function N(a){return a?a.split(/[\t\n\f\r ]+/).filter(T):[]}function q(a,f){return a.hasOwnProperty(f)||(a[f]=!0),a}function O(a){if(!a)return[];var f=N(a);return Object.keys(f.reduce(q,{}))}function A(a){return function(f){return a&&a.indexOf(f)!==-1}}function K(a,f){for(var E in a)Object.prototype.hasOwnProperty.call(a,E)&&(f[E]=a[E])}function V(a,f){var E=a.prototype;if(!(E instanceof f)){let M=function(){};M.prototype=f.prototype,M=new M,K(E,M),a.prototype=E=M}E.constructor!=a&&(typeof a!="function"&&console.error("unknown Class:"+a),E.constructor=a)}var W={},j=W.ELEMENT_NODE=1,H=W.ATTRIBUTE_NODE=2,ne=W.TEXT_NODE=3,Q=W.CDATA_SECTION_NODE=4,ae=W.ENTITY_REFERENCE_NODE=5,I=W.ENTITY_NODE=6,m=W.PROCESSING_INSTRUCTION_NODE=7,y=W.COMMENT_NODE=8,z=W.DOCUMENT_NODE=9,p=W.DOCUMENT_TYPE_NODE=10,D=W.DOCUMENT_FRAGMENT_NODE=11,F=W.NOTATION_NODE=12,_={},L={};_.INDEX_SIZE_ERR=(L[1]="Index size error",1),_.DOMSTRING_SIZE_ERR=(L[2]="DOMString size error",2);var b=_.HIERARCHY_REQUEST_ERR=(L[3]="Hierarchy request error",3);_.WRONG_DOCUMENT_ERR=(L[4]="Wrong document",4),_.INVALID_CHARACTER_ERR=(L[5]="Invalid character",5),_.NO_DATA_ALLOWED_ERR=(L[6]="No data allowed",6),_.NO_MODIFICATION_ALLOWED_ERR=(L[7]="No modification allowed",7);var U=_.NOT_FOUND_ERR=(L[8]="Not found",8);_.NOT_SUPPORTED_ERR=(L[9]="Not supported",9);var G=_.INUSE_ATTRIBUTE_ERR=(L[10]="Attribute in use",10);_.INVALID_STATE_ERR=(L[11]="Invalid state",11),_.SYNTAX_ERR=(L[12]="Syntax error",12),_.INVALID_MODIFICATION_ERR=(L[13]="Invalid modification",13),_.NAMESPACE_ERR=(L[14]="Invalid namespace",14),_.INVALID_ACCESS_ERR=(L[15]="Invalid access",15);function X(a,f){if(f instanceof Error)var E=f;else E=this,Error.call(this,L[a]),this.message=L[a],Error.captureStackTrace&&Error.captureStackTrace(this,X);return E.code=a,f&&(this.message=this.message+": "+f),E}X.prototype=Error.prototype,K(_,X);function Y(){}Y.prototype={length:0,item:function(a){return this[a]||null},toString:function(a,f){for(var E=[],M=0;M<this.length;M++)Qe(this[M],E,a,f);return E.join("")},filter:function(a){return Array.prototype.filter.call(this,a)},indexOf:function(a){return Array.prototype.indexOf.call(this,a)}};function oe(a,f){this._node=a,this._refresh=f,le(this)}function le(a){var f=a._node._inc||a._node.ownerDocument._inc;if(a._inc!=f){var E=a._refresh(a._node);ot(a,"length",E.length),K(E,a),a._inc=f}}oe.prototype.item=function(a){return le(this),this[a]},V(oe,Y);function se(){}function te(a,f){for(var E=a.length;E--;)if(a[E]===f)return E}function de(a,f,E,M){if(M?f[te(f,M)]=E:f[f.length++]=E,a){E.ownerElement=a;var he=a.ownerDocument;he&&(M&&ye(he,a,M),pe(he,a,E))}}function ue(a,f,E){var M=te(f,E);if(M>=0){for(var he=f.length-1;M<he;)f[M]=f[++M];if(f.length=he,a){var we=a.ownerDocument;we&&(ye(we,a,E),E.ownerElement=null)}}else throw new X(U,new Error(a.tagName+"@"+E))}se.prototype={length:0,item:Y.prototype.item,getNamedItem:function(a){for(var f=this.length;f--;){var E=this[f];if(E.nodeName==a)return E}},setNamedItem:function(a){var f=a.ownerElement;if(f&&f!=this._ownerElement)throw new X(G);var E=this.getNamedItem(a.nodeName);return de(this._ownerElement,this,a,E),E},setNamedItemNS:function(a){var f=a.ownerElement,E;if(f&&f!=this._ownerElement)throw new X(G);return E=this.getNamedItemNS(a.namespaceURI,a.localName),de(this._ownerElement,this,a,E),E},removeNamedItem:function(a){var f=this.getNamedItem(a);return ue(this._ownerElement,this,f),f},removeNamedItemNS:function(a,f){var E=this.getNamedItemNS(a,f);return ue(this._ownerElement,this,E),E},getNamedItemNS:function(a,f){for(var E=this.length;E--;){var M=this[E];if(M.localName==f&&M.namespaceURI==a)return M}return null}};function me(){}me.prototype={hasFeature:function(a,f){return!0},createDocument:function(a,f,E){var M=new Ce;if(M.implementation=this,M.childNodes=new Y,M.doctype=E||null,E&&M.appendChild(E),f){var he=M.createElementNS(a,f);M.appendChild(he)}return M},createDocumentType:function(a,f,E){var M=new Re;return M.name=a,M.nodeName=a,M.publicId=f||"",M.systemId=E||"",M}};function Z(){}Z.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(a,f){return i(this,a,f)},replaceChild:function(a,f){i(this,a,f,r),f&&this.removeChild(f)},removeChild:function(a){return xe(this,a)},appendChild:function(a){return this.insertBefore(a,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(a){return tt(this.ownerDocument||this,this,a)},normalize:function(){for(var a=this.firstChild;a;){var f=a.nextSibling;f&&f.nodeType==ne&&a.nodeType==ne?(this.removeChild(f),a.appendData(f.data)):(a.normalize(),a=f)}},isSupported:function(a,f){return this.ownerDocument.implementation.hasFeature(a,f)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(a){for(var f=this;f;){var E=f._nsMap;if(E){for(var M in E)if(Object.prototype.hasOwnProperty.call(E,M)&&E[M]===a)return M}f=f.nodeType==H?f.ownerDocument:f.parentNode}return null},lookupNamespaceURI:function(a){for(var f=this;f;){var E=f._nsMap;if(E&&Object.prototype.hasOwnProperty.call(E,a))return E[a];f=f.nodeType==H?f.ownerDocument:f.parentNode}return null},isDefaultNamespace:function(a){var f=this.lookupPrefix(a);return f==null}};function re(a){return a=="<"&&"&lt;"||a==">"&&"&gt;"||a=="&"&&"&amp;"||a=='"'&&"&quot;"||"&#"+a.charCodeAt()+";"}K(W,Z),K(W,Z.prototype);function ve(a,f){if(f(a))return!0;if(a=a.firstChild)do if(ve(a,f))return!0;while(a=a.nextSibling)}function Ce(){this.ownerDocument=this}function pe(a,f,E){a&&a._inc++;var M=E.namespaceURI;M===d.XMLNS&&(f._nsMap[E.prefix?E.localName:""]=E.value)}function ye(a,f,E,M){a&&a._inc++;var he=E.namespaceURI;he===d.XMLNS&&delete f._nsMap[E.prefix?E.localName:""]}function Se(a,f,E){if(a&&a._inc){a._inc++;var M=f.childNodes;if(E)M[M.length++]=E;else{for(var he=f.firstChild,we=0;he;)M[we++]=he,he=he.nextSibling;M.length=we,delete M[M.length]}}}function xe(a,f){var E=f.previousSibling,M=f.nextSibling;return E?E.nextSibling=M:a.firstChild=M,M?M.previousSibling=E:a.lastChild=E,f.parentNode=null,f.previousSibling=null,f.nextSibling=null,Se(a.ownerDocument,a),f}function Ee(a){return a&&(a.nodeType===Z.DOCUMENT_NODE||a.nodeType===Z.DOCUMENT_FRAGMENT_NODE||a.nodeType===Z.ELEMENT_NODE)}function Oe(a){return a&&(De(a)||Le(a)||Ae(a)||a.nodeType===Z.DOCUMENT_FRAGMENT_NODE||a.nodeType===Z.COMMENT_NODE||a.nodeType===Z.PROCESSING_INSTRUCTION_NODE)}function Ae(a){return a&&a.nodeType===Z.DOCUMENT_TYPE_NODE}function De(a){return a&&a.nodeType===Z.ELEMENT_NODE}function Le(a){return a&&a.nodeType===Z.TEXT_NODE}function Ue(a,f){var E=a.childNodes||[];if(R(E,De)||Ae(f))return!1;var M=R(E,Ae);return!(f&&M&&E.indexOf(M)>E.indexOf(f))}function ie(a,f){var E=a.childNodes||[];function M(we){return De(we)&&we!==f}if(R(E,M))return!1;var he=R(E,Ae);return!(f&&he&&E.indexOf(he)>E.indexOf(f))}function u(a,f,E){if(!Ee(a))throw new X(b,"Unexpected parent node type "+a.nodeType);if(E&&E.parentNode!==a)throw new X(U,"child not in parent");if(!Oe(f)||Ae(f)&&a.nodeType!==Z.DOCUMENT_NODE)throw new X(b,"Unexpected node type "+f.nodeType+" for parent node type "+a.nodeType)}function o(a,f,E){var M=a.childNodes||[],he=f.childNodes||[];if(f.nodeType===Z.DOCUMENT_FRAGMENT_NODE){var we=he.filter(De);if(we.length>1||R(he,Le))throw new X(b,"More than one element or text in fragment");if(we.length===1&&!Ue(a,E))throw new X(b,"Element in fragment can not be inserted before doctype")}if(De(f)&&!Ue(a,E))throw new X(b,"Only one element can be added and only after doctype");if(Ae(f)){if(R(M,Ae))throw new X(b,"Only one doctype is allowed");var Me=R(M,De);if(E&&M.indexOf(Me)<M.indexOf(E))throw new X(b,"Doctype can only be inserted before an element");if(!E&&Me)throw new X(b,"Doctype can not be appended since element is present")}}function r(a,f,E){var M=a.childNodes||[],he=f.childNodes||[];if(f.nodeType===Z.DOCUMENT_FRAGMENT_NODE){var we=he.filter(De);if(we.length>1||R(he,Le))throw new X(b,"More than one element or text in fragment");if(we.length===1&&!ie(a,E))throw new X(b,"Element in fragment can not be inserted before doctype")}if(De(f)&&!ie(a,E))throw new X(b,"Only one element can be added and only after doctype");if(Ae(f)){if(R(M,function(Je){return Ae(Je)&&Je!==E}))throw new X(b,"Only one doctype is allowed");var Me=R(M,De);if(E&&M.indexOf(Me)<M.indexOf(E))throw new X(b,"Doctype can only be inserted before an element")}}function i(a,f,E,M){u(a,f,E),a.nodeType===Z.DOCUMENT_NODE&&(M||o)(a,f,E);var he=f.parentNode;if(he&&he.removeChild(f),f.nodeType===D){var we=f.firstChild;if(we==null)return f;var Me=f.lastChild}else we=Me=f;var ce=E?E.previousSibling:a.lastChild;we.previousSibling=ce,Me.nextSibling=E,ce?ce.nextSibling=we:a.firstChild=we,E==null?a.lastChild=Me:E.previousSibling=Me;do we.parentNode=a;while(we!==Me&&(we=we.nextSibling));return Se(a.ownerDocument||a,a),f.nodeType==D&&(f.firstChild=f.lastChild=null),f}function v(a,f){return f.parentNode&&f.parentNode.removeChild(f),f.parentNode=a,f.previousSibling=a.lastChild,f.nextSibling=null,f.previousSibling?f.previousSibling.nextSibling=f:a.firstChild=f,a.lastChild=f,Se(a.ownerDocument,a,f),f}Ce.prototype={nodeName:"#document",nodeType:z,doctype:null,documentElement:null,_inc:1,insertBefore:function(a,f){if(a.nodeType==D){for(var E=a.firstChild;E;){var M=E.nextSibling;this.insertBefore(E,f),E=M}return a}return i(this,a,f),a.ownerDocument=this,this.documentElement===null&&a.nodeType===j&&(this.documentElement=a),a},removeChild:function(a){return this.documentElement==a&&(this.documentElement=null),xe(this,a)},replaceChild:function(a,f){i(this,a,f,r),a.ownerDocument=this,f&&this.removeChild(f),De(a)&&(this.documentElement=a)},importNode:function(a,f){return rt(this,a,f)},getElementById:function(a){var f=null;return ve(this.documentElement,function(E){if(E.nodeType==j&&E.getAttribute("id")==a)return f=E,!0}),f},getElementsByClassName:function(a){var f=O(a);return new oe(this,function(E){var M=[];return f.length>0&&ve(E.documentElement,function(he){if(he!==E&&he.nodeType===j){var we=he.getAttribute("class");if(we){var Me=a===we;if(!Me){var ce=O(we);Me=f.every(A(ce))}Me&&M.push(he)}}}),M})},createElement:function(a){var f=new w;f.ownerDocument=this,f.nodeName=a,f.tagName=a,f.localName=a,f.childNodes=new Y;var E=f.attributes=new se;return E._ownerElement=f,f},createDocumentFragment:function(){var a=new je;return a.ownerDocument=this,a.childNodes=new Y,a},createTextNode:function(a){var f=new fe;return f.ownerDocument=this,f.appendData(a),f},createComment:function(a){var f=new ge;return f.ownerDocument=this,f.appendData(a),f},createCDATASection:function(a){var f=new $;return f.ownerDocument=this,f.appendData(a),f},createProcessingInstruction:function(a,f){var E=new Ve;return E.ownerDocument=this,E.tagName=E.target=a,E.nodeValue=E.data=f,E},createAttribute:function(a){var f=new B;return f.ownerDocument=this,f.name=a,f.nodeName=a,f.localName=a,f.specified=!0,f},createEntityReference:function(a){var f=new Ie;return f.ownerDocument=this,f.nodeName=a,f},createElementNS:function(a,f){var E=new w,M=f.split(":"),he=E.attributes=new se;return E.childNodes=new Y,E.ownerDocument=this,E.nodeName=f,E.tagName=f,E.namespaceURI=a,M.length==2?(E.prefix=M[0],E.localName=M[1]):E.localName=f,he._ownerElement=E,E},createAttributeNS:function(a,f){var E=new B,M=f.split(":");return E.ownerDocument=this,E.nodeName=f,E.name=f,E.namespaceURI=a,E.specified=!0,M.length==2?(E.prefix=M[0],E.localName=M[1]):E.localName=f,E}},V(Ce,Z);function w(){this._nsMap={}}w.prototype={nodeType:j,hasAttribute:function(a){return this.getAttributeNode(a)!=null},getAttribute:function(a){var f=this.getAttributeNode(a);return f&&f.value||""},getAttributeNode:function(a){return this.attributes.getNamedItem(a)},setAttribute:function(a,f){var E=this.ownerDocument.createAttribute(a);E.value=E.nodeValue=""+f,this.setAttributeNode(E)},removeAttribute:function(a){var f=this.getAttributeNode(a);f&&this.removeAttributeNode(f)},appendChild:function(a){return a.nodeType===D?this.insertBefore(a,null):v(this,a)},setAttributeNode:function(a){return this.attributes.setNamedItem(a)},setAttributeNodeNS:function(a){return this.attributes.setNamedItemNS(a)},removeAttributeNode:function(a){return this.attributes.removeNamedItem(a.nodeName)},removeAttributeNS:function(a,f){var E=this.getAttributeNodeNS(a,f);E&&this.removeAttributeNode(E)},hasAttributeNS:function(a,f){return this.getAttributeNodeNS(a,f)!=null},getAttributeNS:function(a,f){var E=this.getAttributeNodeNS(a,f);return E&&E.value||""},setAttributeNS:function(a,f,E){var M=this.ownerDocument.createAttributeNS(a,f);M.value=M.nodeValue=""+E,this.setAttributeNode(M)},getAttributeNodeNS:function(a,f){return this.attributes.getNamedItemNS(a,f)},getElementsByTagName:function(a){return new oe(this,function(f){var E=[];return ve(f,function(M){M!==f&&M.nodeType==j&&(a==="*"||M.tagName==a)&&E.push(M)}),E})},getElementsByTagNameNS:function(a,f){return new oe(this,function(E){var M=[];return ve(E,function(he){he!==E&&he.nodeType===j&&(a==="*"||he.namespaceURI===a)&&(f==="*"||he.localName==f)&&M.push(he)}),M})}},Ce.prototype.getElementsByTagName=w.prototype.getElementsByTagName,Ce.prototype.getElementsByTagNameNS=w.prototype.getElementsByTagNameNS,V(w,Z);function B(){}B.prototype.nodeType=H,V(B,Z);function J(){}J.prototype={data:"",substringData:function(a,f){return this.data.substring(a,a+f)},appendData:function(a){a=this.data+a,this.nodeValue=this.data=a,this.length=a.length},insertData:function(a,f){this.replaceData(a,0,f)},appendChild:function(a){throw new Error(L[b])},deleteData:function(a,f){this.replaceData(a,f,"")},replaceData:function(a,f,E){var M=this.data.substring(0,a),he=this.data.substring(a+f);E=M+E+he,this.nodeValue=this.data=E,this.length=E.length}},V(J,Z);function fe(){}fe.prototype={nodeName:"#text",nodeType:ne,splitText:function(a){var f=this.data,E=f.substring(a);f=f.substring(0,a),this.data=this.nodeValue=f,this.length=f.length;var M=this.ownerDocument.createTextNode(E);return this.parentNode&&this.parentNode.insertBefore(M,this.nextSibling),M}},V(fe,J);function ge(){}ge.prototype={nodeName:"#comment",nodeType:y},V(ge,J);function $(){}$.prototype={nodeName:"#cdata-section",nodeType:Q},V($,J);function Re(){}Re.prototype.nodeType=p,V(Re,Z);function Ne(){}Ne.prototype.nodeType=F,V(Ne,Z);function Fe(){}Fe.prototype.nodeType=I,V(Fe,Z);function Ie(){}Ie.prototype.nodeType=ae,V(Ie,Z);function je(){}je.prototype.nodeName="#document-fragment",je.prototype.nodeType=D,V(je,Z);function Ve(){}Ve.prototype.nodeType=m,V(Ve,Z);function Ge(){}Ge.prototype.serializeToString=function(a,f,E){return Xe.call(a,f,E)},Z.prototype.toString=Xe;function Xe(a,f){var E=[],M=this.nodeType==9&&this.documentElement||this,he=M.prefix,we=M.namespaceURI;if(we&&he==null){var he=M.lookupPrefix(we);if(he==null)var Me=[{namespace:we,prefix:null}]}return Qe(this,E,a,f,Me),E.join("")}function qe(a,f,E){var M=a.prefix||"",he=a.namespaceURI;if(!he||M==="xml"&&he===d.XML||he===d.XMLNS)return!1;for(var we=E.length;we--;){var Me=E[we];if(Me.prefix===M)return Me.namespace!==he}return!0}function We(a,f,E){a.push(" ",f,'="',E.replace(/[<>&"\t\n\r]/g,re),'"')}function Qe(a,f,E,M,he){if(he||(he=[]),M)if(a=M(a),a){if(typeof a=="string"){f.push(a);return}}else return;switch(a.nodeType){case j:var we=a.attributes,Me=we.length,x=a.firstChild,ce=a.tagName;E=d.isHTML(a.namespaceURI)||E;var Je=ce;if(!E&&!a.prefix&&a.namespaceURI){for(var $e,Ye=0;Ye<we.length;Ye++)if(we.item(Ye).name==="xmlns"){$e=we.item(Ye).value;break}if(!$e)for(var e=he.length-1;e>=0;e--){var h=he[e];if(h.prefix===""&&h.namespace===a.namespaceURI){$e=h.namespace;break}}if($e!==a.namespaceURI)for(var e=he.length-1;e>=0;e--){var h=he[e];if(h.namespace===a.namespaceURI){h.prefix&&(Je=h.prefix+":"+ce);break}}}f.push("<",Je);for(var n=0;n<Me;n++){var c=we.item(n);c.prefix=="xmlns"?he.push({prefix:c.localName,namespace:c.value}):c.nodeName=="xmlns"&&he.push({prefix:"",namespace:c.value})}for(var n=0;n<Me;n++){var c=we.item(n);if(qe(c,E,he)){var k=c.prefix||"",S=c.namespaceURI;We(f,k?"xmlns:"+k:"xmlns",S),he.push({prefix:k,namespace:S})}Qe(c,f,E,M,he)}if(ce===Je&&qe(a,E,he)){var k=a.prefix||"",S=a.namespaceURI;We(f,k?"xmlns:"+k:"xmlns",S),he.push({prefix:k,namespace:S})}if(x||E&&!/^(?:meta|link|img|br|hr|input)$/i.test(ce)){if(f.push(">"),E&&/^script$/i.test(ce))for(;x;)x.data?f.push(x.data):Qe(x,f,E,M,he.slice()),x=x.nextSibling;else for(;x;)Qe(x,f,E,M,he.slice()),x=x.nextSibling;f.push("</",Je,">")}else f.push("/>");return;case z:case D:for(var x=a.firstChild;x;)Qe(x,f,E,M,he.slice()),x=x.nextSibling;return;case H:return We(f,a.name,a.value);case ne:return f.push(a.data.replace(/[<&>]/g,re));case Q:return f.push("<![CDATA[",a.data,"]]>");case y:return f.push("<!--",a.data,"-->");case p:var P=a.publicId,ee=a.systemId;if(f.push("<!DOCTYPE ",a.name),P)f.push(" PUBLIC ",P),ee&&ee!="."&&f.push(" ",ee),f.push(">");else if(ee&&ee!=".")f.push(" SYSTEM ",ee,">");else{var Be=a.internalSubset;Be&&f.push(" [",Be,"]"),f.push(">")}return;case m:return f.push("<?",a.target," ",a.data,"?>");case ae:return f.push("&",a.nodeName,";");default:f.push("??",a.nodeName)}}function rt(a,f,E){var M;switch(f.nodeType){case j:M=f.cloneNode(!1),M.ownerDocument=a;case D:break;case H:E=!0;break}if(M||(M=f.cloneNode(!1)),M.ownerDocument=a,M.parentNode=null,E)for(var he=f.firstChild;he;)M.appendChild(rt(a,he,E)),he=he.nextSibling;return M}function tt(a,f,E){var M=new f.constructor;for(var he in f)if(Object.prototype.hasOwnProperty.call(f,he)){var we=f[he];typeof we!="object"&&we!=M[he]&&(M[he]=we)}switch(f.childNodes&&(M.childNodes=new Y),M.ownerDocument=a,M.nodeType){case j:var Me=f.attributes,ce=M.attributes=new se,Je=Me.length;ce._ownerElement=M;for(var $e=0;$e<Je;$e++)M.setAttributeNode(tt(a,Me.item($e),!0));break;case H:E=!0}if(E)for(var Ye=f.firstChild;Ye;)M.appendChild(tt(a,Ye,E)),Ye=Ye.nextSibling;return M}function ot(a,f,E){a[f]=E}try{if(Object.defineProperty){let a=function(f){switch(f.nodeType){case j:case D:var E=[];for(f=f.firstChild;f;)f.nodeType!==7&&f.nodeType!==8&&E.push(a(f)),f=f.nextSibling;return E.join("");default:return f.nodeValue}};Object.defineProperty(oe.prototype,"length",{get:function(){return le(this),this.$$length}}),Object.defineProperty(Z.prototype,"textContent",{get:function(){return a(this)},set:function(f){switch(this.nodeType){case j:case D:for(;this.firstChild;)this.removeChild(this.firstChild);(f||String(f))&&this.appendChild(this.ownerDocument.createTextNode(f));break;default:this.data=f,this.value=f,this.nodeValue=f}}}),ot=function(f,E,M){f["$$"+E]=M}}}catch{}C.DocumentType=Re,C.DOMException=X,C.DOMImplementation=me,C.Element=w,C.Node=Z,C.NodeList=Y,C.XMLSerializer=Ge},"./node_modules/@xmldom/xmldom/lib/entities.js":function(l,C,s){var g=s("./node_modules/@xmldom/xmldom/lib/conventions.js").freeze;C.XML_ENTITIES=g({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),C.HTML_ENTITIES=g({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"}),C.entityMap=C.HTML_ENTITIES},"./node_modules/@xmldom/xmldom/lib/index.js":function(l,C,s){var g=s("./node_modules/@xmldom/xmldom/lib/dom.js");C.DOMImplementation=g.DOMImplementation,C.XMLSerializer=g.XMLSerializer,C.DOMParser=s("./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser},"./node_modules/@xmldom/xmldom/lib/sax.js":function(l,C,s){var g=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]/,d=new RegExp("[\\-\\.0-9"+R.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),T=new RegExp("^"+R.source+d.source+"*(?::"+R.source+d.source+"*)?$"),N=0,q=1,O=2,A=3,K=4,V=5,W=6,j=7;function H(b,U){this.message=b,this.locator=U,Error.captureStackTrace&&Error.captureStackTrace(this,H)}H.prototype=new Error,H.prototype.name=H.name;function ne(){}ne.prototype={parse:function(b,U,G){var X=this.domBuilder;X.startDocument(),p(U,U={}),Q(b,U,G,X,this.errorHandler),X.endDocument()}};function Q(b,U,G,X,Y){function oe(w){if(w>65535){w-=65536;var B=55296+(w>>10),J=56320+(w&1023);return String.fromCharCode(B,J)}else return String.fromCharCode(w)}function le(w){var B=w.slice(1,-1);return Object.hasOwnProperty.call(G,B)?G[B]:B.charAt(0)==="#"?oe(parseInt(B.substr(1).replace("x","0x"))):(Y.error("entity not found:"+w),w)}function se(w){if(w>Ce){var B=b.substring(Ce,w).replace(/&#?\w+;/g,le);Z&&te(Ce),X.characters(B,0,w-Ce),Ce=w}}function te(w,B){for(;w>=ue&&(B=me.exec(b));)de=B.index,ue=de+B[0].length,Z.lineNumber++;Z.columnNumber=w-de+1}for(var de=0,ue=0,me=/.*(?:\r\n?|\n)|.*$/g,Z=X.locator,re=[{currentNSMap:U}],ve={},Ce=0;;){try{var pe=b.indexOf("<",Ce);if(pe<0){if(!b.substr(Ce).match(/^\s*$/)){var ye=X.doc,Se=ye.createTextNode(b.substr(Ce));ye.appendChild(Se),X.currentElement=Se}return}switch(pe>Ce&&se(pe),b.charAt(pe+1)){case"/":var u=b.indexOf(">",pe+3),xe=b.substring(pe+2,u).replace(/[ \t\n\r]+$/g,""),Ee=re.pop();u<0?(xe=b.substring(pe+2).replace(/[\s<].*/,""),Y.error("end tag name: "+xe+" is not complete:"+Ee.tagName),u=pe+1+xe.length):xe.match(/\s</)&&(xe=xe.replace(/[\s<].*/,""),Y.error("end tag name: "+xe+" maybe not complete"),u=pe+1+xe.length);var Oe=Ee.localNSMap,Ae=Ee.tagName==xe,De=Ae||Ee.tagName&&Ee.tagName.toLowerCase()==xe.toLowerCase();if(De){if(X.endElement(Ee.uri,Ee.localName,xe),Oe)for(var Le in Oe)Object.prototype.hasOwnProperty.call(Oe,Le)&&X.endPrefixMapping(Le);Ae||Y.fatalError("end tag name: "+xe+" is not match the current start tagName:"+Ee.tagName)}else re.push(Ee);u++;break;case"?":Z&&te(pe),u=F(b,pe,X);break;case"!":Z&&te(pe),u=D(b,pe,X,Y);break;default:Z&&te(pe);var Ue=new _,ie=re[re.length-1].currentNSMap,u=I(b,pe,Ue,ie,le,Y),o=Ue.length;if(!Ue.closed&&z(b,u,Ue.tagName,ve)&&(Ue.closed=!0,G.nbsp||Y.warning("unclosed xml attribute")),Z&&o){for(var r=ae(Z,{}),i=0;i<o;i++){var v=Ue[i];te(v.offset),v.locator=ae(Z,{})}X.locator=r,m(Ue,X,ie)&&re.push(Ue),X.locator=Z}else m(Ue,X,ie)&&re.push(Ue);g.isHTML(Ue.uri)&&!Ue.closed?u=y(b,u,Ue.tagName,le,X):u++}}catch(w){if(w instanceof H)throw w;Y.error("element parse error: "+w),u=-1}u>Ce?Ce=u:se(Math.max(pe,Ce)+1)}}function ae(b,U){return U.lineNumber=b.lineNumber,U.columnNumber=b.columnNumber,U}function I(b,U,G,X,Y,oe){function le(Z,re,ve){G.attributeNames.hasOwnProperty(Z)&&oe.fatalError("Attribute "+Z+" redefined"),G.addValue(Z,re.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,Y),ve)}for(var se,te,de=++U,ue=N;;){var me=b.charAt(de);switch(me){case"=":if(ue===q)se=b.slice(U,de),ue=A;else if(ue===O)ue=A;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ue===A||ue===q)if(ue===q&&(oe.warning('attribute value must after "="'),se=b.slice(U,de)),U=de+1,de=b.indexOf(me,U),de>0)te=b.slice(U,de),le(se,te,U-1),ue=V;else throw new Error("attribute value no end '"+me+"' match");else if(ue==K)te=b.slice(U,de),le(se,te,U),oe.warning('attribute "'+se+'" missed start quot('+me+")!!"),U=de+1,ue=V;else throw new Error('attribute value must after "="');break;case"/":switch(ue){case N:G.setTagName(b.slice(U,de));case V:case W:case j:ue=j,G.closed=!0;case K:case q:case O:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return oe.error("unexpected end of input"),ue==N&&G.setTagName(b.slice(U,de)),de;case">":switch(ue){case N:G.setTagName(b.slice(U,de));case V:case W:case j:break;case K:case q:te=b.slice(U,de),te.slice(-1)==="/"&&(G.closed=!0,te=te.slice(0,-1));case O:ue===O&&(te=se),ue==K?(oe.warning('attribute "'+te+'" missed quot(")!'),le(se,te,U)):((!g.isHTML(X[""])||!te.match(/^(?:disabled|checked|selected)$/i))&&oe.warning('attribute "'+te+'" missed value!! "'+te+'" instead!!'),le(te,te,U));break;case A:throw new Error("attribute value missed!!")}return de;case"\x80":me=" ";default:if(me<=" ")switch(ue){case N:G.setTagName(b.slice(U,de)),ue=W;break;case q:se=b.slice(U,de),ue=O;break;case K:var te=b.slice(U,de);oe.warning('attribute "'+te+'" missed quot(")!!'),le(se,te,U);case V:ue=W;break}else switch(ue){case O:G.tagName,(!g.isHTML(X[""])||!se.match(/^(?:disabled|checked|selected)$/i))&&oe.warning('attribute "'+se+'" missed value!! "'+se+'" instead2!!'),le(se,se,U),U=de,ue=q;break;case V:oe.warning('attribute space is required"'+se+'"!!');case W:ue=q,U=de;break;case A:ue=K,U=de;break;case j:throw new Error("elements closed character '/' and '>' must be connected to")}}de++}}function m(b,U,G){for(var X=b.tagName,Y=null,me=b.length;me--;){var oe=b[me],le=oe.qName,se=oe.value,Z=le.indexOf(":");if(Z>0)var te=oe.prefix=le.slice(0,Z),de=le.slice(Z+1),ue=te==="xmlns"&&de;else de=le,te=null,ue=le==="xmlns"&&"";oe.localName=de,ue!==!1&&(Y==null&&(Y={},p(G,G={})),G[ue]=Y[ue]=se,oe.uri=g.XMLNS,U.startPrefixMapping(ue,se))}for(var me=b.length;me--;){oe=b[me];var te=oe.prefix;te&&(te==="xml"&&(oe.uri=g.XML),te!=="xmlns"&&(oe.uri=G[te||""]))}var Z=X.indexOf(":");Z>0?(te=b.prefix=X.slice(0,Z),de=b.localName=X.slice(Z+1)):(te=null,de=b.localName=X);var re=b.uri=G[te||""];if(U.startElement(re,de,X,b),b.closed){if(U.endElement(re,de,X),Y)for(te in Y)Object.prototype.hasOwnProperty.call(Y,te)&&U.endPrefixMapping(te)}else return b.currentNSMap=G,b.localNSMap=Y,!0}function y(b,U,G,X,Y){if(/^(?:script|textarea)$/i.test(G)){var oe=b.indexOf("</"+G+">",U),le=b.substring(U+1,oe);if(/[&<]/.test(le))return/^script$/i.test(G)?(Y.characters(le,0,le.length),oe):(le=le.replace(/&#?\w+;/g,X),Y.characters(le,0,le.length),oe)}return U+1}function z(b,U,G,X){var Y=X[G];return Y==null&&(Y=b.lastIndexOf("</"+G+">"),Y<U&&(Y=b.lastIndexOf("</"+G)),X[G]=Y),Y<U}function p(b,U){for(var G in b)Object.prototype.hasOwnProperty.call(b,G)&&(U[G]=b[G])}function D(b,U,G,X){var Y=b.charAt(U+2);switch(Y){case"-":if(b.charAt(U+3)==="-"){var oe=b.indexOf("-->",U+4);return oe>U?(G.comment(b,U+4,oe-U-4),oe+3):(X.error("Unclosed comment"),-1)}else return-1;default:if(b.substr(U+3,6)=="CDATA["){var oe=b.indexOf("]]>",U+9);return G.startCDATA(),G.characters(b,U+9,oe-U-9),G.endCDATA(),oe+3}var le=L(b,U),se=le.length;if(se>1&&/!doctype/i.test(le[0][0])){var te=le[1][0],de=!1,ue=!1;se>3&&(/^public$/i.test(le[2][0])?(de=le[3][0],ue=se>4&&le[4][0]):/^system$/i.test(le[2][0])&&(ue=le[3][0]));var me=le[se-1];return G.startDTD(te,de,ue),G.endDTD(),me.index+me[0].length}}return-1}function F(b,U,G){var X=b.indexOf("?>",U);if(X){var Y=b.substring(U,X).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Y?(Y[0].length,G.processingInstruction(Y[1],Y[2]),X+2):-1}return-1}function _(){this.attributeNames={}}_.prototype={setTagName:function(b){if(!T.test(b))throw new Error("invalid tagName:"+b);this.tagName=b},addValue:function(b,U,G){if(!T.test(b))throw new Error("invalid attribute:"+b);this.attributeNames[b]=this.length,this[this.length++]={qName:b,value:U,offset:G}},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 L(b,U){var G,X=[],Y=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Y.lastIndex=U,Y.exec(b);G=Y.exec(b);)if(X.push(G),G[1])return X}C.XMLReader=ne,C.ParseError=H},"./node_modules/process/browser.js":function(l,C){var s=l.exports={},g,R;function d(){throw new Error("setTimeout has not been defined")}function T(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?g=setTimeout:g=d}catch{g=d}try{typeof clearTimeout=="function"?R=clearTimeout:R=T}catch{R=T}})();function N(Q){if(g===setTimeout)return setTimeout(Q,0);if((g===d||!g)&&setTimeout)return g=setTimeout,setTimeout(Q,0);try{return g(Q,0)}catch{try{return g.call(null,Q,0)}catch{return g.call(this,Q,0)}}}function q(Q){if(R===clearTimeout)return clearTimeout(Q);if((R===T||!R)&&clearTimeout)return R=clearTimeout,clearTimeout(Q);try{return R(Q)}catch{try{return R.call(null,Q)}catch{return R.call(this,Q)}}}var O=[],A=!1,K,V=-1;function W(){!A||!K||(A=!1,K.length?O=K.concat(O):V=-1,O.length&&j())}function j(){if(!A){var Q=N(W);A=!0;for(var ae=O.length;ae;){for(K=O,O=[];++V<ae;)K&&K[V].run();V=-1,ae=O.length}K=null,A=!1,q(Q)}}s.nextTick=function(Q){var ae=new Array(arguments.length-1);if(arguments.length>1)for(var I=1;I<arguments.length;I++)ae[I-1]=arguments[I];O.push(new H(Q,ae)),O.length===1&&!A&&N(j)};function H(Q,ae){this.fun=Q,this.array=ae}H.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(l,C){(function(s){l.exports=s}).call(this,{})},"./node_modules/webpack/buildin/global.js":function(l,C){var s;s=function(){return this}();try{s=s||new Function("return this")()}catch{typeof window=="object"&&(s=window)}l.exports=s},"./node_modules/webpack/buildin/module.js":function(l,C){l.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(l){l.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(l,C,s){var g=s("./node_modules/@babel/runtime/helpers/typeof.js"),R=s("./src/session.js"),d=s("./src/async.js"),T=s("./src/event.js").EventProxy,N=s("./src/util.js"),q=s("./src/tracker.js");function O(p,D){var F=this,_=new T,L=p.TaskId,b=p.Bucket,U=p.Region,G=p.Key,X=p.Body,Y=p.ChunkSize||p.SliceSize||F.options.ChunkSize,oe=p.AsyncLimit,le=p.StorageClass,se=p.ServerSideEncryption,te,de,ue=p.onHashProgress,me=p.tracker;me&&me.setParams({chunkSize:Y}),_.on("error",function(Z){if(!!F._isRunningTask(L))return Z.UploadId=p.UploadData.UploadId||"",D(Z)}),_.on("upload_complete",function(Z){var re=N.extend({UploadId:p.UploadData.UploadId||""},Z);D(null,re)}),_.on("upload_slice_complete",function(Z){var re={};N.each(p.Headers,function(ve,Ce){var pe=Ce.toLowerCase();(pe.indexOf("x-cos-meta-")===0||pe==="pic-operations")&&(re[Ce]=ve)}),H.call(F,{Bucket:b,Region:U,Key:G,UploadId:Z.UploadId,SliceList:Z.SliceList,Headers:re,tracker:me},function(ve,Ce){if(!!F._isRunningTask(L)){if(R.removeUsing(Z.UploadId),ve)return de(null,!0),_.emit("error",ve);R.removeUploadId.call(F,Z.UploadId),de({loaded:te,total:te},!0),_.emit("upload_complete",Ce)}})}),_.on("get_upload_data_finish",function(Z){var re=R.getFileId(X,p.ChunkSize,b,G);re&&R.saveUploadId.call(F,re,Z.UploadId,F.options.UploadIdCacheLimit),R.setUsing(Z.UploadId),de(null,!0),W.call(F,{TaskId:L,Bucket:b,Region:U,Key:G,Body:X,FileSize:te,SliceSize:Y,AsyncLimit:oe,ServerSideEncryption:se,UploadData:Z,Headers:p.Headers,onProgress:de,tracker:me},function(ve,Ce){if(!!F._isRunningTask(L)){if(ve)return de(null,!0),_.emit("error",ve);_.emit("upload_slice_complete",Ce)}})}),_.on("get_file_size_finish",function(){if(de=N.throttleOnProgress.call(F,te,p.onProgress),p.UploadData.UploadId)_.emit("get_upload_data_finish",p.UploadData);else{var Z=N.extend({TaskId:L,Bucket:b,Region:U,Key:G,Headers:p.Headers,StorageClass:le,Body:X,FileSize:te,SliceSize:Y,onHashProgress:ue,tracker:me},p);A.call(F,Z,function(re,ve){if(!!F._isRunningTask(L)){if(re)return _.emit("error",re);p.UploadData.UploadId=ve.UploadId,p.UploadData.PartList=ve.PartList,_.emit("get_upload_data_finish",p.UploadData)}})}}),te=p.ContentLength,delete p.ContentLength,!p.Headers&&(p.Headers={}),N.each(p.Headers,function(Z,re){re.toLowerCase()==="content-length"&&delete p.Headers[re]}),function(){for(var Z=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],re=1024*1024,ve=0;ve<Z.length&&(re=Z[ve]*1024*1024,!(te/re<=F.options.MaxPartNumber));ve++);p.ChunkSize=p.SliceSize=Y=Math.max(Y,re)}(),te===0?(p.Body="",p.ContentLength=0,p.SkipTask=!0,F.putObject(p,D)):_.emit("get_file_size_finish")}function A(p,D){var F=p.TaskId,_=p.Bucket,L=p.Region,b=p.Key,U=p.StorageClass,G=this,X={},Y=p.FileSize,oe=p.SliceSize,le=Math.ceil(Y/oe),se=0,te=N.throttleOnProgress.call(G,Y,p.onHashProgress),de=function(re,ve){var Ce=oe*(re-1),pe=Math.min(Ce+oe,Y),ye=pe-Ce;X[re]?ve(null,{PartNumber:re,ETag:X[re],Size:ye}):N.fileSlice(p.Body,Ce,pe,!1,function(Se){N.getFileMd5(Se,function(xe,Ee){if(xe)return ve(N.error(xe));var Oe='"'+Ee+'"';X[re]=Oe,se+=ye,te({loaded:se,total:Y}),ve(null,{PartNumber:re,ETag:Oe,Size:ye})})})},ue=function(re,ve){var Ce=re.length;if(Ce===0)return ve(null,!0);if(Ce>le)return ve(null,!1);if(Ce>1){var pe=Math.max(re[0].Size,re[1].Size);if(pe!==oe)return ve(null,!1)}var ye=function Se(xe){if(xe<Ce){var Ee=re[xe];de(Ee.PartNumber,function(Oe,Ae){Ae&&Ae.ETag===Ee.ETag&&Ae.Size===Ee.Size?Se(xe+1):ve(null,!1)})}else ve(null,!0)};ye(0)},me=new T;me.on("error",function(Z){if(!!G._isRunningTask(F))return D(Z)}),me.on("upload_id_available",function(Z){var re={},ve=[];N.each(Z.PartList,function(ye){re[ye.PartNumber]=ye});for(var Ce=1;Ce<=le;Ce++){var pe=re[Ce];pe?(pe.PartNumber=Ce,pe.Uploaded=!0):pe={PartNumber:Ce,ETag:null,Uploaded:!1},ve.push(pe)}Z.PartList=ve,D(null,Z)}),me.on("no_available_upload_id",function(){if(!!G._isRunningTask(F)){var Z=N.extend({Bucket:_,Region:L,Key:b,Query:N.clone(p.Query),StorageClass:U,Body:p.Body,calledBySdk:"sliceUploadFile",tracker:p.tracker},p),re=N.clone(p.Headers);delete re["x-cos-mime-limit"],Z.Headers=re,G.multipartInit(Z,function(ve,Ce){if(!!G._isRunningTask(F)){if(ve)return me.emit("error",ve);var pe=Ce.UploadId;if(!pe)return D(N.error(new Error("no such upload id")));me.emit("upload_id_available",{UploadId:pe,PartList:[]})}})}}),me.on("has_and_check_upload_id",function(Z){Z=Z.reverse(),d.eachLimit(Z,1,function(re,ve){if(!!G._isRunningTask(F)){if(R.using[re]){ve();return}V.call(G,{Bucket:_,Region:L,Key:b,UploadId:re,tracker:p.tracker},function(Ce,pe){if(!!G._isRunningTask(F)){if(Ce)return R.removeUsing(re),me.emit("error",Ce);var ye=pe.PartList;ye.forEach(function(Se){Se.PartNumber*=1,Se.Size*=1,Se.ETag=Se.ETag||""}),ue(ye,function(Se,xe){if(!!G._isRunningTask(F)){if(Se)return me.emit("error",Se);xe?ve({UploadId:re,PartList:ye}):ve()}})}})}},function(re){!G._isRunningTask(F)||(te(null,!0),re&&re.UploadId?me.emit("upload_id_available",re):me.emit("no_available_upload_id"))})}),me.on("seek_local_avail_upload_id",function(Z){var re=R.getFileId(p.Body,p.ChunkSize,_,b),ve=R.getUploadIdList.call(G,re);if(!re||!ve){me.emit("has_and_check_upload_id",Z);return}var Ce=function pe(ye){if(ye>=ve.length){me.emit("has_and_check_upload_id",Z);return}var Se=ve[ye];if(!N.isInArray(Z,Se)){R.removeUploadId.call(G,Se),pe(ye+1);return}if(R.using[Se]){pe(ye+1);return}V.call(G,{Bucket:_,Region:L,Key:b,UploadId:Se,tracker:p.tracker},function(xe,Ee){!G._isRunningTask(F)||(xe?(R.removeUploadId.call(G,Se),pe(ye+1)):me.emit("upload_id_available",{UploadId:Se,PartList:Ee.PartList}))})};Ce(0)}),me.on("get_remote_upload_id_list",function(){K.call(G,{Bucket:_,Region:L,Key:b,tracker:p.tracker},function(Z,re){if(!!G._isRunningTask(F)){if(Z)return me.emit("error",Z);var ve=N.filter(re.UploadList,function(ye){return ye.Key===b&&(!U||ye.StorageClass.toUpperCase()===U.toUpperCase())}).reverse().map(function(ye){return ye.UploadId||ye.UploadID});if(ve.length)me.emit("seek_local_avail_upload_id",ve);else{var Ce=R.getFileId(p.Body,p.ChunkSize,_,b),pe;Ce&&(pe=R.getUploadIdList.call(G,Ce))&&N.each(pe,function(ye){R.removeUploadId.call(G,ye)}),me.emit("no_available_upload_id")}}})}),me.emit("get_remote_upload_id_list")}function K(p,D){var F=this,_=[],L={Bucket:p.Bucket,Region:p.Region,Prefix:p.Key,calledBySdk:p.calledBySdk||"sliceUploadFile",tracker:p.tracker},b=function U(){F.multipartList(L,function(G,X){if(G)return D(G);_.push.apply(_,X.Upload||[]),X.IsTruncated==="true"?(L.KeyMarker=X.NextKeyMarker,L.UploadIdMarker=X.NextUploadIdMarker,U()):D(null,{UploadList:_})})};b()}function V(p,D){var F=this,_=[],L={Bucket:p.Bucket,Region:p.Region,Key:p.Key,UploadId:p.UploadId,calledBySdk:"sliceUploadFile",tracker:p.tracker},b=function U(){F.multipartListPart(L,function(G,X){if(G)return D(G);_.push.apply(_,X.Part||[]),X.IsTruncated==="true"?(L.PartNumberMarker=X.NextPartNumberMarker,U()):D(null,{PartList:_})})};b()}function W(p,D){var F=this,_=p.TaskId,L=p.Bucket,b=p.Region,U=p.Key,G=p.UploadData,X=p.FileSize,Y=p.SliceSize,oe=Math.min(p.AsyncLimit||F.options.ChunkParallelLimit||1,256),le=p.Body,se=Math.ceil(X/Y),te=0,de=p.ServerSideEncryption,ue=p.Headers,me=N.filter(G.PartList,function(re){return re.Uploaded&&(te+=re.PartNumber>=se&&X%Y||Y),!re.Uploaded}),Z=p.onProgress;d.eachLimit(me,oe,function(re,ve){if(!!F._isRunningTask(_)){var Ce=re.PartNumber,pe=Math.min(X,re.PartNumber*Y)-(re.PartNumber-1)*Y,ye=0;j.call(F,{TaskId:_,Bucket:L,Region:b,Key:U,SliceSize:Y,FileSize:X,PartNumber:Ce,ServerSideEncryption:de,Body:le,UploadData:G,Headers:ue,onProgress:function(xe){te+=xe.loaded-ye,ye=xe.loaded,Z({loaded:te,total:X})},tracker:p.tracker},function(Se,xe){!F._isRunningTask(_)||(!Se&&!xe.ETag&&(Se='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 )'),Se?te-=ye:(te+=pe-ye,re.ETag=xe.ETag),Z({loaded:te,total:X}),ve(Se||null,xe))})}},function(re){if(!!F._isRunningTask(_)){if(re)return D(re);D(null,{UploadId:G.UploadId,SliceList:G.PartList})}})}function j(p,D){var F=this,_=p.TaskId,L=p.Bucket,b=p.Region,U=p.Key,G=p.FileSize,X=p.Body,Y=p.PartNumber*1,oe=p.SliceSize,le=p.ServerSideEncryption,se=p.UploadData,te=p.Headers||{},de=F.options.ChunkRetryTimes+1,ue=oe*(Y-1),me=oe,Z=ue+oe;Z>G&&(Z=G,me=Z-ue);var re=["x-cos-traffic-limit","x-cos-mime-limit"],ve={};N.each(te,function(pe,ye){re.indexOf(ye)>-1&&(ve[ye]=pe)});var Ce=se.PartList[Y-1];d.retry(de,function(pe){!F._isRunningTask(_)||N.fileSlice(X,ue,Z,!0,function(ye){F.multipartUpload({TaskId:_,Bucket:L,Region:b,Key:U,ContentLength:me,PartNumber:Y,UploadId:se.UploadId,ServerSideEncryption:le,Body:ye,Headers:ve,onProgress:p.onProgress,calledBySdk:"sliceUploadFile",tracker:p.tracker},function(Se,xe){if(!!F._isRunningTask(_))return Se?pe(Se):(Ce.Uploaded=!0,pe(null,xe))})})},function(pe,ye){if(!!F._isRunningTask(_))return D(pe,ye)})}function H(p,D){var F=p.Bucket,_=p.Region,L=p.Key,b=p.UploadId,U=p.SliceList,G=this,X=this.options.ChunkRetryTimes+1,Y=p.Headers,oe=U.map(function(le){return{PartNumber:le.PartNumber,ETag:le.ETag}});d.retry(X,function(le){G.multipartComplete({Bucket:F,Region:_,Key:L,UploadId:b,Parts:oe,Headers:Y,calledBySdk:"sliceUploadFile",tracker:p.tracker},le)},function(le,se){D(le,se)})}function ne(p,D){var F=p.Bucket,_=p.Region,L=p.Key,b=p.UploadId,U=p.Level||"task",G=p.AsyncLimit,X=this,Y=new T;if(Y.on("error",function(oe){return D(oe)}),Y.on("get_abort_array",function(oe){Q.call(X,{Bucket:F,Region:_,Key:L,Headers:p.Headers,AsyncLimit:G,AbortArray:oe},D)}),U==="bucket")K.call(X,{Bucket:F,Region:_,calledBySdk:"abortUploadTask"},function(oe,le){if(oe)return D(oe);Y.emit("get_abort_array",le.UploadList||[])});else if(U==="file"){if(!L)return D(N.error(new Error("abort_upload_task_no_key")));K.call(X,{Bucket:F,Region:_,Key:L,calledBySdk:"abortUploadTask"},function(oe,le){if(oe)return D(oe);Y.emit("get_abort_array",le.UploadList||[])})}else if(U==="task"){if(!b)return D(N.error(new Error("abort_upload_task_no_id")));if(!L)return D(N.error(new Error("abort_upload_task_no_key")));Y.emit("get_abort_array",[{Key:L,UploadId:b}])}else return D(N.error(new Error("abort_unknown_level")))}function Q(p,D){var F=p.Bucket,_=p.Region,L=p.Key,b=p.AbortArray,U=p.AsyncLimit||1,G=this,X=0,Y=new Array(b.length);d.eachLimit(b,U,function(oe,le){var se=X;if(L&&L!==oe.Key){Y[se]={error:{KeyNotMatch:!0}},le(null);return}var te=oe.UploadId||oe.UploadID;G.multipartAbort({Bucket:F,Region:_,Key:oe.Key,Headers:p.Headers,UploadId:te},function(de){var ue={Bucket:F,Region:_,Key:oe.Key,UploadId:te};Y[se]={error:de,task:ue},le(null)}),X++},function(oe){if(oe)return D(oe);for(var le=[],se=[],te=0,de=Y.length;te<de;te++){var ue=Y[te];ue.task&&(ue.error?se.push(ue.task):le.push(ue.task))}return D(null,{successList:le,errorList:se})})}function ae(p,D){var F=this,_=p.SliceSize===void 0?F.options.SliceSize:p.SliceSize,L=[],b=p.Body,U=b.size||b.length||0,G={TaskId:""};if(F.options.EnableTracker){var X=F.options.UseAccelerate||typeof F.options.Domain=="string"&&F.options.Domain.includes("accelerate.");p.tracker=new q({bucket:p.Bucket,region:p.Region,apiName:"uploadFile",fileKey:p.Key,fileSize:U,accelerate:X,deepTracker:F.options.DeepTracker,customId:F.options.CustomId,delay:F.options.TrackerDelay})}N.each(p,function(de,ue){g(de)!=="object"&&typeof de!="function"&&(G[ue]=de)});var Y=p.onTaskReady,oe=function(ue){G.TaskId=ue,Y&&Y(ue)};p.onTaskReady=oe;var le=U>_?"sliceUploadFile":"putObject",se=p.onFileFinish,te=function(ue,me){p.tracker&&p.tracker.formatResult(ue,me),se&&se(ue,me,G),D&&D(ue,me)};L.push({api:le,params:p,callback:te}),F._addTasks(L)}function I(p,D){var F=this,_=p.SliceSize===void 0?F.options.SliceSize:p.SliceSize,L=0,b=0,U=N.throttleOnProgress.call(F,b,p.onProgress),G=p.files.length,X=p.onFileFinish,Y=Array(G),oe=function(te,de,ue){U(null,!0),X&&X(te,de,ue),Y[ue.Index]={options:ue,error:te,data:de},--G<=0&&D&&D(null,{files:Y})},le=[];N.each(p.files,function(se,te){(function(){var de=se.Body,ue=de.size||de.length||0,me={Index:te,TaskId:""};if(!F.options.UseRawKey&&se.Key&&se.Key.substr(0,1)==="/"&&(se.Key=se.Key.substr(1)),L+=ue,F.options.EnableTracker){var Z=F.options.UseAccelerate||typeof F.options.Domain=="string"&&F.options.Domain.includes("accelerate.");se.tracker=new q({bucket:se.Bucket,region:se.Region,apiName:"uploadFiles",fileKey:se.Key,fileSize:ue,accelerate:Z,deepTracker:F.options.DeepTracker,customId:F.options.CustomId,delay:F.options.TrackerDelay})}N.each(se,function(Oe,Ae){g(Oe)!=="object"&&typeof Oe!="function"&&(me[Ae]=Oe)});var re=se.onTaskReady,ve=function(Ae){me.TaskId=Ae,re&&re(Ae)};se.onTaskReady=ve;var Ce=0,pe=se.onProgress,ye=function(Ae){b=b-Ce+Ae.loaded,Ce=Ae.loaded,pe&&pe(Ae),U({loaded:b,total:L})};se.onProgress=ye;var Se=ue>_?"sliceUploadFile":"putObject",xe=se.onFileFinish,Ee=function(Ae,De){se.tracker&&se.tracker.formatResult(Ae,De),xe&&xe(Ae,De),oe&&oe(Ae,De,me)};le.push({api:Se,params:se,callback:Ee})})()}),F._addTasks(le)}function m(p,D){var F=new T,_=this,L=p.Bucket,b=p.Region,U=p.Key,G=p.CopySource,X=N.getSourceParams.call(this,G);if(!X){D(N.error(new Error("CopySource format error")));return}var Y=X.Bucket,oe=X.Region,le=decodeURIComponent(X.Key),se=p.CopySliceSize===void 0?_.options.CopySliceSize:p.CopySliceSize;se=Math.max(0,se);var te=p.CopyChunkSize||this.options.CopyChunkSize,de=this.options.CopyChunkParallelLimit,ue=this.options.ChunkRetryTimes+1,me=0,Z=0,re,ve,Ce={},pe={},ye={};F.on("copy_slice_complete",function(Se){N.each(p.Headers,function(Ee,Oe){Oe.toLowerCase().indexOf("x-cos-meta-")});var xe=N.map(Se.PartList,function(Ee){return{PartNumber:Ee.PartNumber,ETag:Ee.ETag}});d.retry(ue,function(Ee){_.multipartComplete({Bucket:L,Region:b,Key:U,UploadId:Se.UploadId,Parts:xe,calledBySdk:"sliceCopyFile"},Ee)},function(Ee,Oe){if(R.removeUsing(Se.UploadId),Ee)return ve(null,!0),D(Ee);R.removeUploadId(Se.UploadId),ve({loaded:re,total:re},!0),D(null,Oe)})}),F.on("get_copy_data_finish",function(Se){var xe=R.getCopyFileId(G,Ce,te,L,U);xe&&R.saveUploadId(xe,Se.UploadId,_.options.UploadIdCacheLimit),R.setUsing(Se.UploadId);var Ee=N.filter(Se.PartList,function(Oe){return Oe.Uploaded&&(Z+=Oe.PartNumber>=me&&re%te||te),!Oe.Uploaded});d.eachLimit(Ee,de,function(Oe,Ae){var De=Oe.PartNumber,Le=Oe.CopySourceRange,Ue=Oe.end-Oe.start;d.retry(ue,function(ie){y.call(_,{Bucket:L,Region:b,Key:U,CopySource:G,UploadId:Se.UploadId,PartNumber:De,CopySourceRange:Le},ie)},function(ie,u){if(ie)return Ae(ie);Z+=Ue,ve({loaded:Z,total:re}),Oe.ETag=u.ETag,Ae(ie||null,u)})},function(Oe){if(Oe)return R.removeUsing(Se.UploadId),ve(null,!0),D(Oe);F.emit("copy_slice_complete",Se)})}),F.on("get_chunk_size_finish",function(){var Se=function(){_.multipartInit({Bucket:L,Region:b,Key:U,Headers:ye},function(De,Le){if(De)return D(De);p.UploadId=Le.UploadId,F.emit("get_copy_data_finish",{UploadId:p.UploadId,PartList:p.PartList})})},xe=R.getCopyFileId(G,Ce,te,L,U),Ee=R.getUploadIdList(xe);if(!xe||!Ee)return Se();var Oe=function Ae(De){if(De>=Ee.length)return Se();var Le=Ee[De];if(R.using[Le])return Ae(De+1);V.call(_,{Bucket:L,Region:b,Key:U,UploadId:Le},function(Ue,ie){if(Ue)R.removeUploadId(Le),Ae(De+1);else{if(R.using[Le])return Ae(De+1);var u={},o=0;N.each(ie.PartList,function(r){var i=parseInt(r.Size),v=o+i-1;u[r.PartNumber+"|"+o+"|"+v]=r.ETag,o+=i}),N.each(p.PartList,function(r){var i=u[r.PartNumber+"|"+r.start+"|"+r.end];i&&(r.ETag=i,r.Uploaded=!0)}),F.emit("get_copy_data_finish",{UploadId:Le,PartList:p.PartList})}})};Oe(0)}),F.on("get_file_size_finish",function(){if(function(){for(var xe=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],Ee=1024*1024,Oe=0;Oe<xe.length&&(Ee=xe[Oe]*1024*1024,!(re/Ee<=_.options.MaxPartNumber));Oe++);p.ChunkSize=te=Math.max(te,Ee),me=Math.ceil(re/te);for(var Ae=[],De=1;De<=me;De++){var Le=(De-1)*te,Ue=De*te<re?De*te-1:re-1,ie={PartNumber:De,start:Le,end:Ue,CopySourceRange:"bytes="+Le+"-"+Ue};Ae.push(ie)}p.PartList=Ae}(),p.Headers["x-cos-metadata-directive"]==="Replaced"?ye=p.Headers:ye=pe,ye["x-cos-storage-class"]=p.Headers["x-cos-storage-class"]||pe["x-cos-storage-class"],ye=N.clearKey(ye),pe["x-cos-storage-class"]==="ARCHIVE"||pe["x-cos-storage-class"]==="DEEP_ARCHIVE"){var Se=pe["x-cos-restore"];if(!Se||Se==='ongoing-request="true"'){D(N.error(new Error("Unrestored archive object is not allowed to be copied")));return}}delete ye["x-cos-copy-source"],delete ye["x-cos-metadata-directive"],delete ye["x-cos-copy-source-If-Modified-Since"],delete ye["x-cos-copy-source-If-Unmodified-Since"],delete ye["x-cos-copy-source-If-Match"],delete ye["x-cos-copy-source-If-None-Match"],F.emit("get_chunk_size_finish")}),_.headObject({Bucket:Y,Region:oe,Key:le},function(Se,xe){if(Se){Se.statusCode&&Se.statusCode===404?D(N.error(Se,{ErrorStatus:le+" Not Exist"})):D(Se);return}if(re=p.FileSize=xe.headers["content-length"],re===void 0||!re){D(N.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(ve=N.throttleOnProgress.call(_,re,p.onProgress),re<=se)p.Headers["x-cos-metadata-directive"]||(p.Headers["x-cos-metadata-directive"]="Copy"),_.putObjectCopy(p,function(Oe,Ae){if(Oe)return ve(null,!0),D(Oe);ve({loaded:re,total:re},!0),D(Oe,Ae)});else{var Ee=xe.headers;Ce=Ee,pe={"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"]},N.each(Ee,function(Oe,Ae){var De="x-cos-meta-";Ae.indexOf(De)===0&&Ae.length>De.length&&(pe[Ae]=Oe)}),F.emit("get_file_size_finish")}})}function y(p,D){var F=p.TaskId,_=p.Bucket,L=p.Region,b=p.Key,U=p.CopySource,G=p.UploadId,X=p.PartNumber*1,Y=p.CopySourceRange,oe=this.options.ChunkRetryTimes+1,le=this;d.retry(oe,function(se){le.uploadPartCopy({TaskId:F,Bucket:_,Region:L,Key:b,CopySource:U,UploadId:G,PartNumber:X,CopySourceRange:Y},function(te,de){se(te||null,de)})},function(se,te){return D(se,te)})}var z={sliceUploadFile:O,abortUploadTask:ne,uploadFile:ae,uploadFiles:I,sliceCopyFile:m};l.exports.init=function(p,D){D.transferToTaskMethod(z,"sliceUploadFile"),N.each(z,function(F,_){p.prototype[_]=N.apiWrapper(_,F)})}},"./src/async.js":function(l,C){var s=function(T,N,q,O){if(O=O||function(){},!T.length||N<=0)return O();var A=0,K=0,V=0;(function W(){if(A>=T.length)return O();for(;V<N&&K<T.length;)K+=1,V+=1,q(T[K-1],function(j){j?(O(j),O=function(){}):(A+=1,V-=1,A>=T.length?O():W())})})()},g=function(T,N,q){var O=function A(K){N(function(V,W){V&&K<T?A(K+1):q(V,W)})};T<1?q():O(1)},R={eachLimit:s,retry:g};l.exports=R},"./src/base.js":function(l,C,s){var g=s("./node_modules/@babel/runtime/helpers/typeof.js"),R=s("./lib/request.js"),d=s("./src/util.js");function T(e,h){typeof e=="function"&&(h=e,e={});var n=this.options.Protocol||(d.isBrowser&&(typeof location=="undefined"?"undefined":g(location))==="object"&&location.protocol==="http:"?"http:":"https:"),c=this.options.ServiceDomain,k=e.AppId||this.options.appId,S=e.Region;c?(c=c.replace(/\{\{AppId\}\}/gi,k||"").replace(/\{\{Region\}\}/gi,S||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(c)||(c=n+"//"+c),c.slice(-1)==="/"&&(c=c.slice(0,-1))):S?c=n+"//cos."+S+".myqcloud.com":c=n+"//service.cos.myqcloud.com";var x="",P=S?"cos."+S+".myqcloud.com":"service.cos.myqcloud.com",ee=c.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");P===ee&&(x=P),ce.call(this,{Action:"name/cos:GetService",url:c,method:"GET",headers:e.Headers,SignHost:x},function(Be,Te){if(Be)return h(Be);var ke=Te&&Te.ListAllMyBucketsResult&&Te.ListAllMyBucketsResult.Buckets&&Te.ListAllMyBucketsResult.Buckets.Bucket||[];ke=d.isArray(ke)?ke:[ke];var be=Te&&Te.ListAllMyBucketsResult&&Te.ListAllMyBucketsResult.Owner||{};h(null,{Buckets:ke,Owner:be,statusCode:Te.statusCode,headers:Te.headers})})}function N(e,h){var n=this,c="";if(e.BucketAZConfig){var k={BucketAZConfig:e.BucketAZConfig};c=d.json2xml({CreateBucketConfiguration:k})}ce.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:c},function(S,x){if(S)return h(S);var P=M({protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});h(null,{Location:P,statusCode:x.statusCode,headers:x.headers})})}function q(e,h){ce.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD"},h)}function O(e,h){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n.marker=e.Marker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,ce.call(this,{Action:"name/cos:GetBucket",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n},function(c,k){if(c)return h(c);var S=k.ListBucketResult||{},x=S.Contents||[],P=S.CommonPrefixes||[];x=d.isArray(x)?x:[x],P=d.isArray(P)?P:[P];var ee=d.clone(S);d.extend(ee,{Contents:x,CommonPrefixes:P,statusCode:k.statusCode,headers:k.headers}),h(null,ee)})}function A(e,h){ce.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function K(e,h){var n=e.Headers,c="";if(e.AccessControlPolicy){var k=d.clone(e.AccessControlPolicy||{}),S=k.Grants||k.Grant;S=d.isArray(S)?S:[S],delete k.Grant,delete k.Grants,k.AccessControlList={Grant:S},c=d.json2xml({AccessControlPolicy:k}),n["Content-Type"]="application/xml",n["Content-MD5"]=d.b64(d.md5(c))}d.each(n,function(x,P){P.indexOf("x-cos-grant-")===0&&(n[P]=E(n[P]))}),ce.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:n,action:"acl",body:c},function(x,P){if(x)return h(x);h(null,{statusCode:P.statusCode,headers:P.headers})})}function V(e,h){ce.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl"},function(n,c){if(n)return h(n);var k=c.AccessControlPolicy||{},S=k.Owner||{},x=k.AccessControlList.Grant||[];x=d.isArray(x)?x:[x];var P=f(k);c.headers&&c.headers["x-cos-acl"]&&(P.ACL=c.headers["x-cos-acl"]),P=d.extend(P,{Owner:S,Grants:x,statusCode:c.statusCode,headers:c.headers}),h(null,P)})}function W(e,h){var n=e.CORSConfiguration||{},c=n.CORSRules||e.CORSRules||[];c=d.clone(d.isArray(c)?c:[c]),d.each(c,function(P){d.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(ee){var Be=ee+"s",Te=P[Be]||P[ee]||[];delete P[Be],P[ee]=d.isArray(Te)?Te:[Te]})});var k={CORSRule:c};e.ResponseVary&&(k.ResponseVary=e.ResponseVary);var S=d.json2xml({CORSConfiguration:k}),x=e.Headers;x["Content-Type"]="application/xml",x["Content-MD5"]=d.b64(d.md5(S)),ce.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:S,action:"cors",headers:x},function(P,ee){if(P)return h(P);h(null,{statusCode:ee.statusCode,headers:ee.headers})})}function j(e,h){ce.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors"},function(n,c){if(n){if(n.statusCode===404&&n.error&&n.error.Code==="NoSuchCORSConfiguration"){var k={CORSRules:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),h(null,k)}else h(n);return}var S=c.CORSConfiguration||{},x=S.CORSRules||S.CORSRule||[];x=d.clone(d.isArray(x)?x:[x]);var P=S.ResponseVary;d.each(x,function(ee){d.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(Be){var Te=Be+"s",ke=ee[Te]||ee[Be]||[];delete ee[Be],ee[Te]=d.isArray(ke)?ke:[ke]})}),h(null,{CORSRules:x,ResponseVary:P,statusCode:c.statusCode,headers:c.headers})})}function H(e,h){ce.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode||n.statusCode,headers:c.headers})})}function ne(e,h){ce.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location"},h)}function Q(e,h){var n=e.Policy;try{typeof n=="string"&&(n=JSON.parse(n))}catch{}if(!n||typeof n=="string")return h(d.error(new Error("Policy format error")));var c=JSON.stringify(n);n.version||(n.version="2.0");var k=e.Headers;k["Content-Type"]="application/json",k["Content-MD5"]=d.b64(d.md5(c)),ce.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:c,headers:k},function(S,x){if(S&&S.statusCode===204)return h(null,{statusCode:S.statusCode});if(S)return h(S);h(null,{statusCode:x.statusCode,headers:x.headers})})}function ae(e,h){ce.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0},function(n,c){if(n)return n.statusCode&&n.statusCode===403?h(d.error(n,{ErrorStatus:"Access Denied"})):n.statusCode&&n.statusCode===405?h(d.error(n,{ErrorStatus:"Method Not Allowed"})):n.statusCode&&n.statusCode===404?h(d.error(n,{ErrorStatus:"Policy Not Found"})):h(n);var k={};try{k=JSON.parse(c.body)}catch{}h(null,{Policy:k,statusCode:c.statusCode,headers:c.headers})})}function I(e,h){ce.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode||n.statusCode,headers:c.headers})})}function m(e,h){var n=e.Tagging||{},c=n.TagSet||n.Tags||e.Tags||[];c=d.clone(d.isArray(c)?c:[c]);var k=d.json2xml({Tagging:{TagSet:{Tag:c}}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=d.b64(d.md5(k)),ce.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"tagging",headers:S},function(x,P){if(x&&x.statusCode===204)return h(null,{statusCode:x.statusCode});if(x)return h(x);h(null,{statusCode:P.statusCode,headers:P.headers})})}function y(e,h){ce.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging"},function(n,c){if(n){if(n.statusCode===404&&n.error&&(n.error==="Not Found"||n.error.Code==="NoSuchTagSet")){var k={Tags:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),h(null,k)}else h(n);return}var S=[];try{S=c.Tagging.TagSet.Tag||[]}catch{}S=d.clone(d.isArray(S)?S:[S]),h(null,{Tags:S,statusCode:c.statusCode,headers:c.headers})})}function z(e,h){ce.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function p(e,h){var n=e.LifecycleConfiguration||{},c=n.Rules||e.Rules||[];c=d.clone(c);var k=d.json2xml({LifecycleConfiguration:{Rule:c}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=d.b64(d.md5(k)),ce.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"lifecycle",headers:S},function(x,P){if(x&&x.statusCode===204)return h(null,{statusCode:x.statusCode});if(x)return h(x);h(null,{statusCode:P.statusCode,headers:P.headers})})}function D(e,h){ce.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle"},function(n,c){if(n){if(n.statusCode===404&&n.error&&n.error.Code==="NoSuchLifecycleConfiguration"){var k={Rules:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),h(null,k)}else h(n);return}var S=[];try{S=c.LifecycleConfiguration.Rule||[]}catch{}S=d.clone(d.isArray(S)?S:[S]),h(null,{Rules:S,statusCode:c.statusCode,headers:c.headers})})}function F(e,h){ce.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function _(e,h){if(!e.VersioningConfiguration){h(d.error(new Error("missing param VersioningConfiguration")));return}var n=e.VersioningConfiguration||{},c=d.json2xml({VersioningConfiguration:n}),k=e.Headers;k["Content-Type"]="application/xml",k["Content-MD5"]=d.b64(d.md5(c)),ce.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:c,action:"versioning",headers:k},function(S,x){if(S&&S.statusCode===204)return h(null,{statusCode:S.statusCode});if(S)return h(S);h(null,{statusCode:x.statusCode,headers:x.headers})})}function L(e,h){ce.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning"},function(n,c){n||!c.VersioningConfiguration&&(c.VersioningConfiguration={}),h(n,c)})}function b(e,h){var n=d.clone(e.ReplicationConfiguration),c=d.json2xml({ReplicationConfiguration:n});c=c.replace(/<(\/?)Rules>/gi,"<$1Rule>"),c=c.replace(/<(\/?)Tags>/gi,"<$1Tag>");var k=e.Headers;k["Content-Type"]="application/xml",k["Content-MD5"]=d.b64(d.md5(c)),ce.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:c,action:"replication",headers:k},function(S,x){if(S&&S.statusCode===204)return h(null,{statusCode:S.statusCode});if(S)return h(S);h(null,{statusCode:x.statusCode,headers:x.headers})})}function U(e,h){ce.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(n,c){if(n){if(n.statusCode===404&&n.error&&(n.error==="Not Found"||n.error.Code==="ReplicationConfigurationnotFoundError")){var k={ReplicationConfiguration:{Rules:[]},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),h(null,k)}else h(n);return}!c.ReplicationConfiguration&&(c.ReplicationConfiguration={}),c.ReplicationConfiguration.Rule&&(c.ReplicationConfiguration.Rules=d.makeArray(c.ReplicationConfiguration.Rule),delete c.ReplicationConfiguration.Rule),h(n,c)})}function G(e,h){ce.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function X(e,h){if(!e.WebsiteConfiguration){h(d.error(new Error("missing param WebsiteConfiguration")));return}var n=d.clone(e.WebsiteConfiguration||{}),c=n.RoutingRules||n.RoutingRule||[];c=d.isArray(c)?c:[c],delete n.RoutingRule,delete n.RoutingRules,c.length&&(n.RoutingRules={RoutingRule:c});var k=d.json2xml({WebsiteConfiguration:n}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=d.b64(d.md5(k)),ce.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"website",headers:S},function(x,P){if(x&&x.statusCode===204)return h(null,{statusCode:x.statusCode});if(x)return h(x);h(null,{statusCode:P.statusCode,headers:P.headers})})}function Y(e,h){ce.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(n,c){if(n){if(n.statusCode===404&&n.error.Code==="NoSuchWebsiteConfiguration"){var k={WebsiteConfiguration:{},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),h(null,k)}else h(n);return}var S=c.WebsiteConfiguration||{};if(S.RoutingRules){var x=d.clone(S.RoutingRules.RoutingRule||[]);x=d.makeArray(x),S.RoutingRules=x}h(null,{WebsiteConfiguration:S,statusCode:c.statusCode,headers:c.headers})})}function oe(e,h){ce.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function le(e,h){if(!e.RefererConfiguration){h(d.error(new Error("missing param RefererConfiguration")));return}var n=d.clone(e.RefererConfiguration||{}),c=n.DomainList||{},k=c.Domains||c.Domain||[];k=d.isArray(k)?k:[k],k.length&&(n.DomainList={Domain:k});var S=d.json2xml({RefererConfiguration:n}),x=e.Headers;x["Content-Type"]="application/xml",x["Content-MD5"]=d.b64(d.md5(S)),ce.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:S,action:"referer",headers:x},function(P,ee){if(P&&P.statusCode===204)return h(null,{statusCode:P.statusCode});if(P)return h(P);h(null,{statusCode:ee.statusCode,headers:ee.headers})})}function se(e,h){ce.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(n,c){if(n){if(n.statusCode===404&&n.error.Code==="NoSuchRefererConfiguration"){var k={WebsiteConfiguration:{},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),h(null,k)}else h(n);return}var S=c.RefererConfiguration||{};if(S.DomainList){var x=d.makeArray(S.DomainList.Domain||[]);S.DomainList={Domains:x}}h(null,{RefererConfiguration:S,statusCode:c.statusCode,headers:c.headers})})}function te(e,h){var n=e.DomainConfiguration||{},c=n.DomainRule||e.DomainRule||[];c=d.clone(c);var k=d.json2xml({DomainConfiguration:{DomainRule:c}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=d.b64(d.md5(k)),ce.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"domain",headers:S},function(x,P){if(x&&x.statusCode===204)return h(null,{statusCode:x.statusCode});if(x)return h(x);h(null,{statusCode:P.statusCode,headers:P.headers})})}function de(e,h){ce.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(n,c){if(n)return h(n);var k=[];try{k=c.DomainConfiguration.DomainRule||[]}catch{}k=d.clone(d.isArray(k)?k:[k]),h(null,{DomainRule:k,statusCode:c.statusCode,headers:c.headers})})}function ue(e,h){ce.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function me(e,h){var n=e.OriginConfiguration||{},c=n.OriginRule||e.OriginRule||[];c=d.clone(c);var k=d.json2xml({OriginConfiguration:{OriginRule:c}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=d.b64(d.md5(k)),ce.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"origin",headers:S},function(x,P){if(x&&x.statusCode===204)return h(null,{statusCode:x.statusCode});if(x)return h(x);h(null,{statusCode:P.statusCode,headers:P.headers})})}function Z(e,h){ce.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(n,c){if(n)return h(n);var k=[];try{k=c.OriginConfiguration.OriginRule||[]}catch{}k=d.clone(d.isArray(k)?k:[k]),h(null,{OriginRule:k,statusCode:c.statusCode,headers:c.headers})})}function re(e,h){ce.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function ve(e,h){var n=d.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),c=e.Headers;c["Content-Type"]="application/xml",c["Content-MD5"]=d.b64(d.md5(n)),ce.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:c},function(k,S){if(k&&k.statusCode===204)return h(null,{statusCode:k.statusCode});if(k)return h(k);h(null,{statusCode:S.statusCode,headers:S.headers})})}function Ce(e,h){ce.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(n,c){if(n)return h(n);h(null,{BucketLoggingStatus:c.BucketLoggingStatus,statusCode:c.statusCode,headers:c.headers})})}function pe(e,h,n){var c=d.clone(h.InventoryConfiguration);if(c.OptionalFields){var k=c.OptionalFields||[];c.OptionalFields={Field:k}}if(c.Destination&&c.Destination.COSBucketDestination&&c.Destination.COSBucketDestination.Encryption){var S=c.Destination.COSBucketDestination.Encryption;Object.keys(S).indexOf("SSECOS")>-1&&(S["SSE-COS"]=S.SSECOS,delete S.SSECOS)}var x=d.json2xml({InventoryConfiguration:c}),P=h.Headers;P["Content-Type"]="application/xml",P["Content-MD5"]=d.b64(d.md5(x));var ee=e==="PUT"?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";ce.call(this,{Action:ee,method:e,Bucket:h.Bucket,Region:h.Region,body:x,action:"inventory",qs:{id:h.Id},headers:P},function(Be,Te){if(Be&&Be.statusCode===204)return n(null,{statusCode:Be.statusCode});if(Be)return n(Be);n(null,{statusCode:Te.statusCode,headers:Te.headers})})}function ye(e,h){return pe.call(this,"PUT",e,h)}function Se(e,h){return pe.call(this,"POST",e,h)}function xe(e,h){ce.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(n,c){if(n)return h(n);var k=c.InventoryConfiguration;if(k&&k.OptionalFields&&k.OptionalFields.Field){var S=k.OptionalFields.Field;d.isArray(S)||(S=[S]),k.OptionalFields=S}if(k.Destination&&k.Destination.COSBucketDestination&&k.Destination.COSBucketDestination.Encryption){var x=k.Destination.COSBucketDestination.Encryption;Object.keys(x).indexOf("SSE-COS")>-1&&(x.SSECOS=x["SSE-COS"],delete x["SSE-COS"])}h(null,{InventoryConfiguration:k,statusCode:c.statusCode,headers:c.headers})})}function Ee(e,h){ce.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(n,c){if(n)return h(n);var k=c.ListInventoryConfigurationResult,S=k.InventoryConfiguration||[];S=d.isArray(S)?S:[S],delete k.InventoryConfiguration,d.each(S,function(x){if(x&&x.OptionalFields&&x.OptionalFields.Field){var P=x.OptionalFields.Field;d.isArray(P)||(P=[P]),x.OptionalFields=P}if(x.Destination&&x.Destination.COSBucketDestination&&x.Destination.COSBucketDestination.Encryption){var ee=x.Destination.COSBucketDestination.Encryption;Object.keys(ee).indexOf("SSE-COS")>-1&&(ee.SSECOS=ee["SSE-COS"],delete ee["SSE-COS"])}}),k.InventoryConfigurations=S,d.extend(k,{statusCode:c.statusCode,headers:c.headers}),h(null,k)})}function Oe(e,h){ce.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function Ae(e,h){if(!e.AccelerateConfiguration){h(d.error(new Error("missing param AccelerateConfiguration")));return}var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},c=d.json2xml(n),k={};k["Content-Type"]="application/xml",k["Content-MD5"]=d.b64(d.md5(c)),ce.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:c,action:"accelerate",headers:k},function(S,x){if(S)return h(S);h(null,{statusCode:x.statusCode,headers:x.headers})})}function De(e,h){ce.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(n,c){n||!c.AccelerateConfiguration&&(c.AccelerateConfiguration={}),h(n,c)})}function Le(e,h){var n=e.ServerSideEncryptionConfiguration||{},c=n.Rule||n.Rules||[],k=d.json2xml({ServerSideEncryptionConfiguration:{Rule:c}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=d.b64(d.md5(k)),ce.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"encryption",headers:S},function(x,P){if(x&&x.statusCode===204)return h(null,{statusCode:x.statusCode});if(x)return h(x);h(null,{statusCode:P.statusCode,headers:P.headers})})}function Ue(e,h){ce.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(n,c){if(n){if(n.statusCode===404&&n.code==="NoSuchEncryptionConfiguration"){var k={EncryptionConfiguration:{Rules:[]},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),h(null,k)}else h(n);return}var S=d.makeArray(c.EncryptionConfiguration&&c.EncryptionConfiguration.Rule||[]);c.EncryptionConfiguration={Rules:S},h(n,c)})}function ie(e,h){ce.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function u(e,h){ce.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,c){if(n){var k=n.statusCode;return e.Headers["If-Modified-Since"]&&k&&k===304?h(null,{NotModified:!0,statusCode:k}):h(n)}c.ETag=d.attr(c.headers,"etag",""),h(null,c)})}function o(e,h){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,ce.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(c,k){if(c)return h(c);var S=k.ListVersionsResult||{},x=S.DeleteMarker||[];x=d.isArray(x)?x:[x];var P=S.Version||[];P=d.isArray(P)?P:[P];var ee=d.clone(S);delete ee.DeleteMarker,delete ee.Version,d.extend(ee,{DeleteMarkers:x,Versions:P,statusCode:k.statusCode,headers:k.headers}),h(null,ee)})}function r(e,h){var n=e.Query||{},c=e.QueryString||"",k=d.throttleOnProgress.call(this,0,e.onProgress),S=e.tracker;S&&S.setParams({signStartTime:new Date().getTime()}),n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,ce.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:n,qsStr:c,rawBody:!0,onDownloadProgress:k,tracker:S},function(x,P){if(k(null,!0),x){var ee=x.statusCode;return e.Headers["If-Modified-Since"]&&ee&&ee===304?h(null,{NotModified:!0}):h(x)}h(null,{Body:P.body,ETag:d.attr(P.headers,"etag",""),statusCode:P.statusCode,headers:P.headers})})}function i(e,h){var n=this,c=e.ContentLength,k=d.throttleOnProgress.call(n,c,e.onProgress),S=e.Headers;!S["Cache-Control"]&&!S["cache-control"]&&(S["Cache-Control"]=""),!S["Content-Type"]&&!S["content-type"]&&(S["Content-Type"]=e.Body&&e.Body.type||"");var x=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5,P=e.tracker;x&&P&&P.setParams({md5StartTime:new Date().getTime()}),d.getBodyMd5(x,e.Body,function(ee){ee&&(P&&P.setParams({md5EndTime:new Date().getTime()}),n.options.UploadCheckContentMd5&&(S["Content-MD5"]=d.b64(ee)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(S["x-cos-meta-md5"]=ee)),e.ContentLength!==void 0&&(S["Content-Length"]=e.ContentLength),k(null,!0),ce.call(n,{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:k,tracker:P},function(Be,Te){if(Be)return k(null,!0),h(Be);k({loaded:c,total:c},!0);var ke=M({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});ke=ke.substr(ke.indexOf("://")+3),Te.Location=ke,Te.ETag=d.attr(Te.headers,"etag",""),h(null,Te)})},e.onHashProgress)}function v(e,h){ce.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(n,c){if(n){var k=n.statusCode;return k&&k===404?h(null,{BucketNotFound:!0,statusCode:k}):h(n)}h(null,{statusCode:c.statusCode,headers:c.headers})})}function w(e,h){var n={};e.VersionId&&(n.versionId=e.VersionId),ce.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,action:"acl"},function(c,k){if(c)return h(c);var S=k.AccessControlPolicy||{},x=S.Owner||{},P=S.AccessControlList&&S.AccessControlList.Grant||[];P=d.isArray(P)?P:[P];var ee=f(S);delete ee.GrantWrite,k.headers&&k.headers["x-cos-acl"]&&(ee.ACL=k.headers["x-cos-acl"]),ee=d.extend(ee,{Owner:x,Grants:P,statusCode:k.statusCode,headers:k.headers}),h(null,ee)})}function B(e,h){var n=e.Headers,c="";if(e.AccessControlPolicy){var k=d.clone(e.AccessControlPolicy||{}),S=k.Grants||k.Grant;S=d.isArray(S)?S:[S],delete k.Grant,delete k.Grants,k.AccessControlList={Grant:S},c=d.json2xml({AccessControlPolicy:k}),n["Content-Type"]="application/xml",n["Content-MD5"]=d.b64(d.md5(c))}d.each(n,function(x,P){P.indexOf("x-cos-grant-")===0&&(n[P]=E(n[P]))}),ce.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:c},function(x,P){if(x)return h(x);h(null,{statusCode:P.statusCode,headers:P.headers})})}function J(e,h){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,ce.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(c,k){if(c)return c.statusCode&&c.statusCode===403?h(null,{OptionsForbidden:!0,statusCode:c.statusCode}):h(c);var S=k.headers||{};h(null,{AccessControlAllowOrigin:S["access-control-allow-origin"],AccessControlAllowMethods:S["access-control-allow-methods"],AccessControlAllowHeaders:S["access-control-allow-headers"],AccessControlExposeHeaders:S["access-control-expose-headers"],AccessControlMaxAge:S["access-control-max-age"],statusCode:k.statusCode,headers:k.headers})})}function fe(e,h){var n=this,c=e.Headers;!c["Cache-Control"]&&!c["cache-control"]&&(c["Cache-Control"]="");var k=e.CopySource||"",S=d.getSourceParams.call(this,k);if(!S){h(d.error(new Error("CopySource format error")));return}var x=S.Bucket,P=S.Region,ee=decodeURIComponent(S.Key);ce.call(this,{Scope:[{action:"name/cos:GetObject",bucket:x,region:P,prefix:ee},{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(Be,Te){if(Be)return h(Be);var ke=d.clone(Te.CopyObjectResult||{}),be=M({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});d.extend(ke,{Location:be,statusCode:Te.statusCode,headers:Te.headers}),h(null,ke)})}function ge(e,h){var n=e.CopySource||"",c=d.getSourceParams.call(this,n);if(!c){h(d.error(new Error("CopySource format error")));return}var k=c.Bucket,S=c.Region,x=decodeURIComponent(c.Key);ce.call(this,{Scope:[{action:"name/cos:GetObject",bucket:k,region:S,prefix:x},{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(P,ee){if(P)return h(P);var Be=d.clone(ee.CopyPartResult||{});d.extend(Be,{statusCode:ee.statusCode,headers:ee.headers}),h(null,Be)})}function $(e,h){var n=e.Objects||[],c=e.Quiet;n=d.isArray(n)?n:[n];var k=d.json2xml({Delete:{Object:n,Quiet:c||!1}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=d.b64(d.md5(k));var x=d.map(n,function(P){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:P.Key}});ce.call(this,{Scope:x,method:"POST",Bucket:e.Bucket,Region:e.Region,body:k,action:"delete",headers:S},function(P,ee){if(P)return h(P);var Be=ee.DeleteResult||{},Te=Be.Deleted||[],ke=Be.Error||[];Te=d.isArray(Te)?Te:[Te],ke=d.isArray(ke)?ke:[ke];var be=d.clone(Be);d.extend(be,{Error:ke,Deleted:Te,statusCode:ee.statusCode,headers:ee.headers}),h(null,be)})}function Re(e,h){var n=e.Headers;if(!e.RestoreRequest){h(d.error(new Error("missing param RestoreRequest")));return}var c=e.RestoreRequest||{},k=d.json2xml({RestoreRequest:c});n["Content-Type"]="application/xml",n["Content-MD5"]=d.b64(d.md5(k)),ce.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:k,action:"restore",headers:n},h)}function Ne(e,h){var n=e.Tagging||{},c=n.TagSet||n.Tags||e.Tags||[];c=d.clone(d.isArray(c)?c:[c]);var k=d.json2xml({Tagging:{TagSet:{Tag:c}}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=d.b64(d.md5(k)),ce.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:k,action:"tagging",headers:S,VersionId:e.VersionId},function(x,P){if(x&&x.statusCode===204)return h(null,{statusCode:x.statusCode});if(x)return h(x);h(null,{statusCode:P.statusCode,headers:P.headers})})}function Fe(e,h){ce.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(n,c){if(n){if(n.statusCode===404&&n.error&&(n.error==="Not Found"||n.error.Code==="NoSuchTagSet")){var k={Tags:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),h(null,k)}else h(n);return}var S=[];try{S=c.Tagging.TagSet.Tag||[]}catch{}S=d.clone(d.isArray(S)?S:[S]),h(null,{Tags:S,statusCode:c.statusCode,headers:c.headers})})}function Ie(e,h){ce.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(n,c){if(n&&n.statusCode===204)return h(null,{statusCode:n.statusCode});if(n)return h(n);h(null,{statusCode:c.statusCode,headers:c.headers})})}function je(e,h){var n=e.SelectType;if(!n)return h(d.error(new Error("missing param SelectType")));var c=e.SelectRequest||{},k=d.json2xml({SelectRequest:c}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=d.b64(d.md5(k)),ce.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:k,DataType:"arraybuffer",rawBody:!0},function(x,P){if(x&&x.statusCode===204)return h(null,{statusCode:x.statusCode});if(x)return h(x);var ee=d.parseSelectPayload(P.body);h(null,{statusCode:P.statusCode,headers:P.headers,Body:ee.body,Payload:ee.payload})})}function Ve(e,h){var n=this,c=e.Headers,k=e.tracker;!c["Cache-Control"]&&!c["cache-control"]&&(c["Cache-Control"]=""),!c["Content-Type"]&&!c["content-type"]&&(c["Content-Type"]=e.Body&&e.Body.type||"");var S=e.Body&&(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5);S&&k&&k.setParams({md5StartTime:new Date().getTime()}),d.getBodyMd5(S,e.Body,function(x){x&&(e.Headers["x-cos-meta-md5"]=x),S&&k&&k.setParams({md5EndTime:new Date().getTime()}),ce.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:k},function(P,ee){if(P)return k&&k.parent&&k.parent.setParams({errorNode:"multipartInit"}),h(P);if(ee=d.clone(ee||{}),ee&&ee.InitiateMultipartUploadResult)return h(null,d.extend(ee.InitiateMultipartUploadResult,{statusCode:ee.statusCode,headers:ee.headers}));h(null,ee)})},e.onHashProgress)}function Ge(e,h){var n=this;d.getFileSize("multipartUpload",e,function(){var c=e.tracker,k=n.options.UploadCheckContentMd5;k&&c&&c.setParams({md5StartTime:new Date().getTime()}),d.getBodyMd5(k,e.Body,function(S){S&&(e.Headers["Content-MD5"]=d.b64(S)),k&&c&&c.setParams({md5EndTime:new Date().getTime()}),c&&c.setParams({partNumber:e.PartNumber}),ce.call(n,{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:c},function(x,P){if(x)return c&&c.parent&&c.parent.setParams({errorNode:"multipartUpload"}),h(x);h(null,{ETag:d.attr(P.headers,"etag",""),statusCode:P.statusCode,headers:P.headers})})})})}function Xe(e,h){for(var n=this,c=e.UploadId,k=e.Parts,S=e.tracker,x=0,P=k.length;x<P;x++)k[x].ETag&&k[x].ETag.indexOf('"')===0||(k[x].ETag='"'+k[x].ETag+'"');var ee=d.json2xml({CompleteMultipartUpload:{Part:k}});ee=ee.replace(/\n\s*/g,"");var Be=e.Headers;Be["Content-Type"]="application/xml",Be["Content-MD5"]=d.b64(d.md5(ee)),ce.call(this,{Action:"name/cos:CompleteMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{uploadId:c},body:ee,headers:Be,tracker:S},function(Te,ke){if(Te)return S&&S.parent&&S.parent.setParams({errorNode:"multipartComplete"}),h(Te);var be=M({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0}),He=ke.CompleteMultipartUploadResult||{};He.ProcessResults&&He&&He.ProcessResults&&(He.UploadResult={OriginalInfo:{Key:He.Key,Location:be,ETag:He.ETag,ImageInfo:He.ImageInfo},ProcessResults:He.ProcessResults},delete He.ImageInfo,delete He.ProcessResults);var Ze=d.extend(He,{Location:be,statusCode:ke.statusCode,headers:ke.headers});h(null,Ze)})}function qe(e,h){var n={};n.delimiter=e.Delimiter,n["encoding-type"]=e.EncodingType,n.prefix=e.Prefix||"",n["max-uploads"]=e.MaxUploads,n["key-marker"]=e.KeyMarker,n["upload-id-marker"]=e.UploadIdMarker,n=d.clearKey(n);var c=e.tracker;c&&c.setParams({signStartTime:new Date().getTime()}),ce.call(this,{Action:"name/cos:ListMultipartUploads",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"uploads",tracker:c},function(k,S){if(k)return c&&c.parent&&c.parent.setParams({errorNode:"multipartList"}),h(k);if(S&&S.ListMultipartUploadsResult){var x=S.ListMultipartUploadsResult.Upload||[];x=d.isArray(x)?x:[x],S.ListMultipartUploadsResult.Upload=x}var P=d.clone(S.ListMultipartUploadsResult||{});d.extend(P,{statusCode:S.statusCode,headers:S.headers}),h(null,P)})}function We(e,h){var n={},c=e.tracker;n.uploadId=e.UploadId,n["encoding-type"]=e.EncodingType,n["max-parts"]=e.MaxParts,n["part-number-marker"]=e.PartNumberMarker,ce.call(this,{Action:"name/cos:ListParts",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n},function(k,S){if(k)return c&&c.parent&&c.parent.setParams({errorNode:"multipartListPart"}),h(k);var x=S.ListPartsResult||{},P=x.Part||[];P=d.isArray(P)?P:[P],x.Part=P;var ee=d.clone(x);d.extend(ee,{statusCode:S.statusCode,headers:S.headers}),h(null,ee)})}function Qe(e,h){var n={};n.uploadId=e.UploadId,ce.call(this,{Action:"name/cos:AbortMultipartUpload",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n},function(c,k){if(c)return h(c);h(null,{statusCode:k.statusCode,headers:k.headers})})}function rt(e,h){ce.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(n,c){if(n)return h(n);c&&c.body&&(c.Body=c.body,delete c.body),h(n,c)})}function tt(e,h){var n=e.Headers;!n["Cache-Control"]&&!n["cache-control"]&&(n["Cache-Control"]=""),!n["Content-Type"]&&!n["content-type"]&&(n["Content-Type"]=e.Body&&e.Body.type||""),ce.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(c,k){if(c)return h(c);h(null,k)})}function ot(e){var h=this;return d.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:h.options.UseRawKey,SystemClockOffset:h.options.SystemClockOffset})}function a(e,h){var n=this,c=e.UseAccelerate===void 0?n.options.UseAccelerate:e.UseAccelerate,k=M({ForcePathStyle:n.options.ForcePathStyle,protocol:e.Protocol||n.options.Protocol,domain:e.Domain||n.options.Domain,bucket:e.Bucket,region:c?"accelerate":e.Region,object:e.Key}),S="";e.Query&&(S+=d.obj2str(e.Query)),e.QueryString&&(S+=(S?"&":"")+e.QueryString);var x=k;if(e.Sign!==void 0&&!e.Sign)return S&&(x+="?"+S),h(null,{Url:x}),x;var P=he.call(this,{Bucket:e.Bucket,Region:e.Region,UseAccelerate:e.UseAccelerate,Url:k}),ee=we.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:P,ForceSignHost:e.ForceSignHost===!1?!1:n.options.ForceSignHost},function(Be,Te){if(!!h){if(Be){h(Be);return}var ke=function(Ze){var st=Ze.match(/q-url-param-list.*?(?=&)/g)[0],it="q-url-param-list="+encodeURIComponent(st.replace(/q-url-param-list=/,"")).toLowerCase(),et=new RegExp(st,"g"),at=Ze.replace(et,it);return at},be=k;be+="?"+(Te.Authorization.indexOf("q-signature")>-1?ke(Te.Authorization):"sign="+encodeURIComponent(Te.Authorization)),Te.SecurityToken&&(be+="&x-cos-security-token="+Te.SecurityToken),Te.ClientIP&&(be+="&clientIP="+Te.ClientIP),Te.ClientUA&&(be+="&clientUA="+Te.ClientUA),Te.Token&&(be+="&token="+Te.Token),S&&(be+="&"+S),setTimeout(function(){h(null,{Url:be})})}});return ee?(x+="?"+ee.Authorization+(ee.SecurityToken?"&x-cos-security-token="+ee.SecurityToken:""),S&&(x+="&"+S)):S&&(x+="?"+S),x}function f(e){var h={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},c=e&&e.AccessControlList||{},k=c.Grant;k&&(k=d.isArray(k)?k:[k]);var S={READ:0,WRITE:0,FULL_CONTROL:0};return k&&k.length&&d.each(k,function(x){x.Grantee.ID==="qcs::cam::anyone:anyone"||x.Grantee.URI==="http://cam.qcloud.com/groups/global/AllUsers"?S[x.Permission]=1:x.Grantee.ID!==e.Owner.ID&&h[n[x.Permission]].push('id="'+x.Grantee.ID+'"')}),S.FULL_CONTROL||S.WRITE&&S.READ?h.ACL="public-read-write":S.READ?h.ACL="public-read":h.ACL="private",d.each(n,function(x){h[x]=E(h[x].join(","))}),h}function E(e){var h=e.split(","),n={},c,k;for(c=0;c<h.length;)k=h[c].trim(),n[k]?h.splice(c,1):(n[k]=!0,h[c]=k,c++);return h.join(",")}function M(e){var h=e.region||"",n=e.bucket||"",c=n.substr(0,n.lastIndexOf("-")),k=n.substr(n.lastIndexOf("-")+1),S=e.domain,x=e.object;typeof S=="function"&&(S=S({Bucket:n,Region:h})),["http","https"].includes(e.protocol)&&(e.protocol=e.protocol+":");var P=e.protocol||(d.isBrowser&&(typeof location=="undefined"?"undefined":g(location))==="object"&&location.protocol==="http:"?"http:":"https:");S||(["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(h)>-1?S="{Region}.myqcloud.com":S="cos.{Region}.myqcloud.com",e.ForcePathStyle||(S="{Bucket}."+S)),S=S.replace(/\{\{AppId\}\}/gi,k).replace(/\{\{Bucket\}\}/gi,c).replace(/\{\{Region\}\}/gi,h).replace(/\{\{.*?\}\}/gi,""),S=S.replace(/\{AppId\}/gi,k).replace(/\{BucketName\}/gi,c).replace(/\{Bucket\}/gi,n).replace(/\{Region\}/gi,h).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(S)||(S=P+"//"+S),S.slice(-1)==="/"&&(S=S.slice(0,-1));var ee=S;return e.ForcePathStyle&&(ee+="/"+n),ee+="/",x&&(ee+=d.camSafeUrlEncode(x).replace(/%2F/g,"/")),e.isLocation&&(ee=ee.replace(/^https?:\/\//,"")),ee}var he=function(h){if(!h.Bucket||!h.Region)return"";var n=h.UseAccelerate===void 0?this.options.UseAccelerate:h.UseAccelerate,c=h.Url||M({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:h.Bucket,region:n?"accelerate":h.Region}),k=c.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1"),S=new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$");return S.test(k)?k:""};function we(e,h){var n=d.clone(e.Headers),c="";d.each(n,function(_e,Pe){(_e===""||["content-type","cache-control","expires"].indexOf(Pe.toLowerCase())>-1)&&delete n[Pe],Pe.toLowerCase()==="host"&&(c=_e)});var k=e.ForceSignHost!==!1;!c&&e.SignHost&&k&&(n.Host=e.SignHost);var S=!1,x=function(Pe,Ke){S||(S=!0,Ke&&Ke.XCosSecurityToken&&!Ke.SecurityToken&&(Ke=d.clone(Ke),Ke.SecurityToken=Ke.XCosSecurityToken,delete Ke.XCosSecurityToken),h&&h(Pe,Ke))},P=this,ee=e.Bucket||"",Be=e.Region||"",Te=e.Key||"";P.options.ForcePathStyle&&ee&&(Te=ee+"/"+Te);var ke="/"+Te,be={},He=e.Scope;if(!He){var Ze=e.Action||"",st=e.ResourceKey||e.Key||"";He=e.Scope||[{action:Ze,bucket:ee,region:Be,prefix:st}]}var it=d.md5(JSON.stringify(He));P._StsCache=P._StsCache||[],function(){var _e,Pe;for(_e=P._StsCache.length-1;_e>=0;_e--){Pe=P._StsCache[_e];var Ke=Math.round(d.getSkewTime(P.options.SystemClockOffset)/1e3)+30;if(Pe.StartTime&&Ke<Pe.StartTime||Ke>=Pe.ExpiredTime){P._StsCache.splice(_e,1);continue}if(!Pe.ScopeLimit||Pe.ScopeLimit&&Pe.ScopeKey===it){be=Pe;break}}}();var et=function(){var Pe="";be.StartTime&&e.Expires?Pe=be.StartTime+";"+(be.StartTime+e.Expires*1):be.StartTime&&be.ExpiredTime&&(Pe=be.StartTime+";"+be.ExpiredTime);var Ke=d.getAuth({SecretId:be.TmpSecretId,SecretKey:be.TmpSecretKey,Method:e.Method,Pathname:ke,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:P.options.UseRawKey,SystemClockOffset:P.options.SystemClockOffset,KeyTime:Pe,ForceSignHost:k}),ze={Authorization:Ke,SecurityToken:be.SecurityToken||be.XCosSecurityToken||"",Token:be.Token||"",ClientIP:be.ClientIP||"",ClientUA:be.ClientUA||""};x(null,ze)},at=function(Pe){if(Pe.Authorization){var Ke=!1,ze=Pe.Authorization;if(ze)if(ze.indexOf(" ")>-1)Ke=!1;else if(ze.indexOf("q-sign-algorithm=")>-1&&ze.indexOf("q-ak=")>-1&&ze.indexOf("q-sign-time=")>-1&&ze.indexOf("q-key-time=")>-1&&ze.indexOf("q-url-param-list=")>-1)Ke=!0;else try{ze=atob(ze),ze.indexOf("a=")>-1&&ze.indexOf("k=")>-1&&ze.indexOf("t=")>-1&&ze.indexOf("r=")>-1&&ze.indexOf("b=")>-1&&(Ke=!0)}catch{}if(!Ke)return d.error(new Error("getAuthorization callback params format error"))}else{if(!Pe.TmpSecretId)return d.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!Pe.TmpSecretKey)return d.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!Pe.SecurityToken&&!Pe.XCosSecurityToken)return d.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!Pe.ExpiredTime)return d.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(Pe.ExpiredTime&&Pe.ExpiredTime.toString().length!==10)return d.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(Pe.StartTime&&Pe.StartTime.toString().length!==10)return d.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(be.ExpiredTime&&be.ExpiredTime-d.getSkewTime(P.options.SystemClockOffset)/1e3>60)et();else if(P.options.getAuthorization)P.options.getAuthorization.call(P,{Bucket:ee,Region:Be,Method:e.Method,Key:Te,Pathname:ke,Query:e.Query,Headers:n,Scope:He,SystemClockOffset:P.options.SystemClockOffset,ForceSignHost:k},function(_e){typeof _e=="string"&&(_e={Authorization:_e});var Pe=at(_e);if(Pe)return x(Pe);_e.Authorization?x(null,_e):(be=_e||{},be.Scope=He,be.ScopeKey=it,P._StsCache.push(be),et())});else if(P.options.getSTS)P.options.getSTS.call(P,{Bucket:ee,Region:Be},function(_e){be=_e||{},be.Scope=He,be.ScopeKey=it,be.TmpSecretId||(be.TmpSecretId=be.SecretId),be.TmpSecretKey||(be.TmpSecretKey=be.SecretKey);var Pe=at(be);if(Pe)return x(Pe);P._StsCache.push(be),et()});else return function(){var _e=d.getAuth({SecretId:e.SecretId||P.options.SecretId,SecretKey:e.SecretKey||P.options.SecretKey,Method:e.Method,Pathname:ke,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:P.options.UseRawKey,SystemClockOffset:P.options.SystemClockOffset,ForceSignHost:k}),Pe={Authorization:_e,SecurityToken:P.options.SecurityToken||P.options.XCosSecurityToken};return x(null,Pe),Pe}();return""}function Me(e){var h=!1,n=!1,c=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var k=e.error.Code,S=e.error.Message;(k==="RequestTimeTooSkewed"||k==="AccessDenied"&&S==="Request has expired")&&(n=!0)}catch{}if(e)if(n&&c){var x=Date.parse(c);this.options.CorrectClockSkew&&Math.abs(d.getSkewTime(this.options.SystemClockOffset)-x)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=x-Date.now(),h=!0)}else Math.floor(e.statusCode/100)===5&&(h=!0);return h}function ce(e,h){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=d.clearKey(e.qs),e.headers&&(e.headers=d.clearKey(e.headers)),e.qs&&(e.qs=d.clearKey(e.qs));var c=d.clone(e.qs);e.action&&(c[e.action]="");var k=e.url||e.Url,S=e.SignHost||he.call(this,{Bucket:e.Bucket,Region:e.Region,Url:k}),x=e.tracker,P=function ee(Be){var Te=n.options.SystemClockOffset;x&&x.setParams({signStartTime:new Date().getTime(),retryTimes:Be-1}),we.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:c,Headers:e.headers,SignHost:S,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:n.options.ForceSignHost},function(ke,be){if(ke){h(ke);return}x&&x.setParams({signEndTime:new Date().getTime(),httpStartTime:new Date().getTime()}),e.AuthData=be,Je.call(n,e,function(He,Ze){x&&x.setParams({httpEndTime:new Date().getTime()}),He&&Be<2&&(Te!==n.options.SystemClockOffset||Me.call(n,He))?(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"]),ee(Be+1)):h(He,Ze)})})};P(1)}function Je(e,h){var n=this,c=e.TaskId;if(!(c&&!n._isRunningTask(c))){var k=e.Bucket,S=e.Region,x=e.Key,P=e.method||"GET",ee=e.Url||e.url,Be=e.body,Te=e.rawBody;n.options.UseAccelerate&&(S="accelerate"),ee=ee||M({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:k,region:S,object:x}),e.action&&(ee=ee+"?"+(d.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(ee.indexOf("?")>-1?ee=ee+"&"+e.qsStr:ee=ee+"?"+e.qsStr);var ke={method:P,url:ee,headers:e.headers,qs:e.qs,body:Be},be="x-cos-security-token";if(d.isCIHost(ee)&&(be="x-ci-security-token"),ke.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(ke.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(ke.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(ke.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(ke.headers[be]=e.AuthData.SecurityToken),ke.headers&&(ke.headers=d.clearKey(ke.headers)),ke=d.clearKey(ke),e.onProgress&&typeof e.onProgress=="function"){var He=Be&&(Be.size||Be.length)||0;ke.onProgress=function(_e){if(!(c&&!n._isRunningTask(c))){var Pe=_e?_e.loaded:0;e.onProgress({loaded:Pe,total:He})}}}e.onDownloadProgress&&(ke.onDownloadProgress=e.onDownloadProgress),e.DataType&&(ke.dataType=e.DataType),this.options.Timeout&&(ke.timeout=this.options.Timeout),n.options.ForcePathStyle&&(ke.pathStyle=n.options.ForcePathStyle),n.emit("before-send",ke);var Ze=ke.url.includes("accelerate."),st=ke.qs?Object.keys(ke.qs).map(function(_e){return"".concat(_e,"=").concat(ke.qs[_e])}).join("&"):"",it=st?ke.url+"?"+st:ke.url;e.tracker&&e.tracker.setParams({reqUrl:it,accelerate:Ze?"Y":"N"}),e.tracker&&e.tracker.parent&&e.tracker.parent.setParams({reqUrl:it,accelerate:Ze?"Y":"N"});var et=(n.options.Request||R)(ke,function(_e){if(!(_e&&_e.error==="abort")){var Pe={options:ke,error:_e&&_e.error,statusCode:_e&&_e.statusCode||0,statusMessage:_e&&_e.statusMessage||"",headers:_e&&_e.headers||{},body:_e&&_e.body};n.emit("after-receive",Pe);var Ke=Pe.error,ze=Pe.body,nt={statusCode:Pe.statusCode,statusMessage:Pe.statusMessage,headers:Pe.headers},vt,ut=function(ft,gt){if(c&&n.off("inner-kill-task",at),!vt){vt=!0;var ht={};nt&&nt.statusCode&&(ht.statusCode=nt.statusCode),nt&&nt.headers&&(ht.headers=nt.headers),ft?(ft=d.extend(ft||{},ht),h(ft,null)):(gt=d.extend(gt||{},ht),h(null,gt)),et=null}};if(Ke)return ut(d.error(Ke));var lt=nt.statusCode,pt=Math.floor(lt/100)===2;if(Te&&pt)return ut(null,{body:ze});var ct;try{ct=ze&&ze.indexOf("<")>-1&&ze.indexOf(">")>-1&&d.xml2json(ze)||{}}catch{ct={}}var dt=ct&&ct.Error;pt?ut(null,ct):dt?ut(d.error(new Error(dt.Message),{code:dt.Code,error:dt})):lt?ut(d.error(new Error(nt.statusMessage),{code:""+lt})):lt&&ut(d.error(new Error("statusCode error")))}}),at=function _e(Pe){Pe.TaskId===c&&(et&&et.abort&&et.abort(),n.off("inner-kill-task",_e))};c&&n.on("inner-kill-task",at)}}var $e={getService:T,putBucket:N,headBucket:q,getBucket:O,deleteBucket:A,putBucketAcl:K,getBucketAcl:V,putBucketCors:W,getBucketCors:j,deleteBucketCors:H,getBucketLocation:ne,getBucketPolicy:ae,putBucketPolicy:Q,deleteBucketPolicy:I,putBucketTagging:m,getBucketTagging:y,deleteBucketTagging:z,putBucketLifecycle:p,getBucketLifecycle:D,deleteBucketLifecycle:F,putBucketVersioning:_,getBucketVersioning:L,putBucketReplication:b,getBucketReplication:U,deleteBucketReplication:G,putBucketWebsite:X,getBucketWebsite:Y,deleteBucketWebsite:oe,putBucketReferer:le,getBucketReferer:se,putBucketDomain:te,getBucketDomain:de,deleteBucketDomain:ue,putBucketOrigin:me,getBucketOrigin:Z,deleteBucketOrigin:re,putBucketLogging:ve,getBucketLogging:Ce,putBucketInventory:ye,postBucketInventory:Se,getBucketInventory:xe,listBucketInventory:Ee,deleteBucketInventory:Oe,putBucketAccelerate:Ae,getBucketAccelerate:De,putBucketEncryption:Le,getBucketEncryption:Ue,deleteBucketEncryption:ie,getObject:r,headObject:u,listObjectVersions:o,putObject:i,deleteObject:v,getObjectAcl:w,putObjectAcl:B,optionsObject:J,putObjectCopy:fe,deleteMultipleObject:$,restoreObject:Re,putObjectTagging:Ne,getObjectTagging:Fe,deleteObjectTagging:Ie,selectObjectContent:je,appendObject:tt,uploadPartCopy:ge,multipartInit:Ve,multipartUpload:Ge,multipartComplete:Xe,multipartList:qe,multipartListPart:We,multipartAbort:Qe,request:rt,getObjectUrl:a,getAuth:ot};function Ye(e,h,n){d.each(["Cors","Acl"],function(c){if(e.slice(-c.length)===c){var k=e.slice(0,-c.length)+c.toUpperCase(),S=d.apiWrapper(e,h),x=!1;n[k]=function(){!x&&console.warn("warning: cos."+k+" has been deprecated. Please Use cos."+e+" instead."),x=!0,S.apply(this,arguments)}}})}l.exports.init=function(e,h){h.transferToTaskMethod($e,"putObject"),d.each($e,function(n,c){e.prototype[c]=d.apiWrapper(c,n),Ye(c,n,e.prototype)})}},"./src/cos.js":function(l,C,s){var g=s("./src/util.js"),R=s("./src/event.js"),d=s("./src/task.js"),T=s("./src/base.js"),N=s("./src/advance.js"),q=s("./package.json"),O={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:""},A=function(V){this.options=g.extend(g.clone(O),V||{}),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")),g.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),d.init(this)};T.init(A,d),N.init(A,d),A.util={md5:g.md5,xml2json:g.xml2json,json2xml:g.json2xml,encodeBase64:g.encodeBase64},A.getAuthorization=g.getAuth,A.version=q.version,l.exports=A},"./src/event.js":function(l,C){var s=function(d){var T={},N=function(O){return!T[O]&&(T[O]=[]),T[O]};d.on=function(q,O){q==="task-list-update"&&console.warn('warning: Event "'+q+'" has been deprecated. Please use "list-update" instead.'),N(q).push(O)},d.off=function(q,O){for(var A=N(q),K=A.length-1;K>=0;K--)O===A[K]&&A.splice(K,1)},d.emit=function(q,O){for(var A=N(q).map(function(V){return V}),K=0;K<A.length;K++)A[K](O)}},g=function(){s(this)};l.exports.init=s,l.exports.EventProxy=g},"./src/session.js":function(l,C,s){var g=s("./src/util.js"),R="cos_sdk_upload_cache",d=30*24*3600,T,N,q=function(){try{var j=JSON.parse(localStorage.getItem(R))}catch{}j||(j=[]),T=j},O=function(){try{T.length?localStorage.setItem(R,JSON.stringify(T)):localStorage.removeItem(R)}catch{}},A=function(){if(!T){q.call(this);for(var j=!1,H=Math.round(Date.now()/1e3),ne=T.length-1;ne>=0;ne--){var Q=T[ne][2];(!Q||Q+d<H)&&(T.splice(ne,1),j=!0)}j&&O()}},K=function(){N||(N=setTimeout(function(){O(),N=null},400))},V={using:{},setUsing:function(j){V.using[j]=!0},removeUsing:function(j){delete V.using[j]},getFileId:function(j,H,ne,Q){return j.name&&j.size&&j.lastModifiedDate&&H?g.md5([j.name,j.size,j.lastModifiedDate,H,ne,Q].join("::")):null},getCopyFileId:function(j,H,ne,Q,ae){var I=H["content-length"],m=H.etag||"",y=H["last-modified"];return j&&ne?g.md5([j,I,m,y,ne,Q,ae].join("::")):null},getUploadIdList:function(j){if(!j)return null;A.call(this);for(var H=[],ne=0;ne<T.length;ne++)T[ne][0]===j&&H.push(T[ne][1]);return H.length?H:null},saveUploadId:function(j,H,ne){if(A.call(this),!!j){for(var Q=T.length-1;Q>=0;Q--){var ae=T[Q];ae[0]===j&&ae[1]===H&&T.splice(Q,1)}T.unshift([j,H,Math.round(Date.now()/1e3)]),T.length>ne&&T.splice(ne),K()}},removeUploadId:function(j){A.call(this),delete V.using[j];for(var H=T.length-1;H>=0;H--)T[H][1]===j&&T.splice(H,1);K()}};l.exports=V},"./src/task.js":function(l,C,s){var g=s("./src/session.js"),R=s("./src/util.js"),d={},T=function(O,A){d[A]=O[A],O[A]=function(K,V){K.SkipTask?d[A].call(this,K,V):this._addTask(A,K,V)}},N=function(O){var A=[],K={},V=0,W=0,j=function(y){var z={id:y.id,Bucket:y.Bucket,Region:y.Region,Key:y.Key,FilePath:y.FilePath,state:y.state,loaded:y.loaded,size:y.size,speed:y.speed,percent:y.percent,hashPercent:y.hashPercent,error:y.error};return y.FilePath&&(z.FilePath=y.FilePath),y._custom&&(z._custom=y._custom),z},H=function(){var m,y=function(){m=0,O.emit("task-list-update",{list:R.map(A,j)}),O.emit("list-update",{list:R.map(A,j)})};return function(){m||(m=setTimeout(y))}}(),ne=function(){if(!(A.length<=O.options.UploadQueueSize)){for(var y=0;y<W&&y<A.length&&A.length>O.options.UploadQueueSize;){var z=A[y].state==="waiting"||A[y].state==="checking"||A[y].state==="uploading";!A[y]||!z?(K[A[y].id]&&delete K[A[y].id],A.splice(y,1),W--):y++}H()}},Q=function m(){if(!(V>=O.options.FileParallelLimit)){for(;A[W]&&A[W].state!=="waiting";)W++;if(!(W>=A.length)){var y=A[W];W++,V++,y.state="checking",y.params.onTaskStart&&y.params.onTaskStart(j(y)),!y.params.UploadData&&(y.params.UploadData={});var z=R.formatParams(y.api,y.params);d[y.api].call(O,z,function(p,D){!O._isRunningTask(y.id)||((y.state==="checking"||y.state==="uploading")&&(y.state=p?"error":"success",p&&(y.error=p),V--,H(),m(),y.callback&&y.callback(p,D),y.state==="success"&&(y.params&&(delete y.params.UploadData,delete y.params.Body,delete y.params),delete y.callback)),ne())}),H(),setTimeout(m)}}},ae=function(y,z){var p=K[y];if(!!p){var D=p&&p.state==="waiting",F=p&&(p.state==="checking"||p.state==="uploading");if(z==="canceled"&&p.state!=="canceled"||z==="paused"&&D||z==="paused"&&F){if(z==="paused"&&p.params.Body&&typeof p.params.Body.pipe=="function"){console.error("stream not support pause");return}p.state=z,O.emit("inner-kill-task",{TaskId:y,toState:z});try{var _=p&&p.params&&p.params.UploadData.UploadId}catch{}z==="canceled"&&_&&g.removeUsing(_),H(),F&&(V--,Q()),z==="canceled"&&(p.params&&(delete p.params.UploadData,delete p.params.Body,delete p.params),delete p.callback)}ne()}};O._addTasks=function(m){R.each(m,function(y){O._addTask(y.api,y.params,y.callback,!0)}),H()};var I=!0;O._addTask=function(m,y,z,p){y=R.formatParams(m,y);var D=R.uuid();y.TaskId=D,y.onTaskReady&&y.onTaskReady(D),y.TaskReady&&(y.TaskReady(D),I&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),I=!1);var F={params:y,callback:z,api:m,index:A.length,id:D,Bucket:y.Bucket,Region:y.Region,Key:y.Key,FilePath:y.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:y._custom},_=y.onHashProgress;y.onHashProgress=function(b){!O._isRunningTask(F.id)||(F.hashPercent=b.percent,_&&_(b),H())};var L=y.onProgress;return y.onProgress=function(b){!O._isRunningTask(F.id)||(F.state==="checking"&&(F.state="uploading"),F.loaded=b.loaded,F.speed=b.speed,F.percent=b.percent,L&&L(b),H())},R.getFileSize(m,y,function(b,U){if(b)return z(R.error(b));K[D]=F,A.push(F),F.size=U,!p&&H(),Q(),ne()}),D},O._isRunningTask=function(m){var y=K[m];return!!(y&&(y.state==="checking"||y.state==="uploading"))},O.getTaskList=function(){return R.map(A,j)},O.cancelTask=function(m){ae(m,"canceled")},O.pauseTask=function(m){ae(m,"paused")},O.restartTask=function(m){var y=K[m];y&&(y.state==="paused"||y.state==="error")&&(y.state="waiting",H(),W=Math.min(W,y.index),Q())},O.isUploadRunning=function(){return V||W<A.length}};l.exports.transferToTaskMethod=T,l.exports.init=N},"./src/tracker.js":function(l,C,s){var g=s("./node_modules/@babel/runtime/helpers/classCallCheck.js"),R=s("./node_modules/@babel/runtime/helpers/createClass.js"),d=s("./node_modules/@babel/runtime/helpers/typeof.js"),T=s("./package.json"),N=null,q=function(m){if(!N){var y=s("./lib/beacon.min.js");N=new y({appkey:"0AND0VEVB24UBGDU",versionCode:T.version,channelID:"js_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:m,sessionDuration:60*1e3})}return N},O={getUid:function(){var m=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return m()+m()+"-"+m()+"-"+m()+"-"+m()+"-"+m()+m()+m()},getNetType:function(){if((typeof navigator=="undefined"?"undefined":d(navigator))==="object"){var m=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(m==null?void 0:m.type)||(m==null?void 0:m.effectiveType)||"unknown"}return"unknown"},getOsType:function(){if((typeof navigator=="undefined"?"undefined":d(navigator))!=="object")return"unknown os";var m=navigator.userAgent.toLowerCase(),y=/macintosh|mac os x/i.test(navigator.userAgent);return m.indexOf("win32")>=0||m.indexOf("wow32")>=0?"win32":m.indexOf("win64")>=0||m.indexOf("wow64")>=0?"win64":y?"mac":"unknown os"},isMobile:function(){var m=/(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":d(navigator))==="object"&&navigator.userAgent.match(m))},isAndroid:function(){var m=/(Android|Adr|Linux)/i;return!!((typeof navigator=="undefined"?"undefined":d(navigator))==="object"&&navigator.userAgent.match(m))},isIOS:function(){var m=/(iPhone|iPod|iPad|iOS)/i;return!!((typeof navigator=="undefined"?"undefined":d(navigator))==="object"&&navigator.userAgent.match(m))},isOtherMobile:function(){return isMobile&&!isAndroid&&!isIOS},getDeviceName:function(){if((typeof navigator=="undefined"?"undefined":d(navigator))!=="object")return"unknown device";var m=navigator.userAgent.toLowerCase();if(m.includes("app/tencent_wemeet"))return"tencent_wemeet";if(m.indexOf("maxthon")>=0){var y=m.match(/maxthon\/([\d.]+)/),z=y&&y[1]||"";return"\u50B2\u6E38\u6D4F\u89C8\u5668 ".concat(z).trim()}if(m.indexOf("qqbrowser")>=0){var p=m.match(/qqbrowser\/([\d.]+)/),D=p&&p[1]||"";return"QQ\u6D4F\u89C8\u5668 ".concat(D).trim()}if(m.indexOf("se 2.x")>=0)return"\u641C\u72D7\u6D4F\u89C8\u5668";if(m.indexOf("wxwork")>=0)return"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668";if(m.indexOf("msie")>=0){var F=m.match(/msie ([\d.]+)/),_=F&&F[1]||"";return"IE ".concat(_).trim()}if(m.indexOf("firefox")>=0){var L=m.match(/firefox\/([\d.]+)/),b=L&&L[1]||"";return"Firefox ".concat(b).trim()}if(m.indexOf("chrome")>=0){var U=m.match(/chrome\/([\d.]+)/),G=U&&U[1]||"";return"Chrome ".concat(G).trim()}if(m.indexOf("opera")>=0){var X=m.match(/opera.([\d.]+)/),Y=X&&X[1]||"";return"Opera ".concat(Y).trim()}if(m.indexOf("safari")>=0){var oe=m.match(/version\/([\d.]+)/),le=oe&&oe[1]||"";return"Safari ".concat(le).trim()}if(m.indexOf("edge")>=0){var se=m.match(/edge\/([\d.]+)/),te=se&&se[1]||"";return"edge ".concat(te).trim()}return m.substr(0,200)}},A={isMobile:O.isMobile(),isBrowser:!O.isMobile(),mobileOsType:O.isAndroid()?"android":O.isIOS?"ios":"other_mobile",pcOsType:O.getOsType()},K={deviceType:A.isMobile?"mobile":A.isBrowser?"browser":"unknown",devicePlatform:A.isMobile?A.mobileOsType:A.pcOsType,deviceName:O.getDeviceName()},V=["multipartInit","multipartUpload","multipartComplete","multipartList","multipartListPart","multipartAbort"],W=["putObject","postObject","appendObject","sliceUploadFile","uploadFile","uploadFiles"].concat(V),j=["getObject"];function H(I){return W.includes(I)?"cos_upload":j.includes(I)?"cos_download":"base_service"}function ne(I){return I.replace(/([A-Z])/g,"_$1").toLowerCase()}function Q(I){var m={},y=["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"],z=["tracePlatform","cossdkVersion","region","bucket","appid","networkType","host","accelerate","requestPath","partNumber","size","name","result","tookTime","errorRequestId","retryTimes","reqUrl","customId","deviceType","devicePlatform","deviceName"],p=I.result==="Success"?z:y;for(var D in I)if(!!p.includes(D)){var F=ne(D);m[F]=I[D]}return m}var ae=function(){function I(m){g(this,I);var y=m.parent,z=m.traceId,p=m.bucket,D=m.region,F=m.apiName,_=m.fileKey,L=m.fileSize,b=m.accelerate,U=m.customId,G=m.delay,X=m.deepTracker,Y=p&&p.substr(p.lastIndexOf("-")+1)||"";this.parent=y,this.deepTracker=X,this.delay=G,this.params={cossdkVersion:T.version,region:D,networkType:"",host:"",accelerate:b?"Y":"N",requestPath:_||"",size:L||-1,httpMd5:0,httpSign:0,httpFull:0,name:F||"",result:"",tookTime:0,errorNode:"",errorCode:"",errorMessage:"",errorRequestId:"",errorStatusCode:0,errorServiceName:"",tracePlatform:"cos-js-sdk-v5",traceId:z||O.getUid(),bucket:p,appid:Y,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=q(G)}return R(I,[{key:"formatResult",value:function(y,z){var p,D,F,_,L,b,U=new Date().getTime(),G=U-this.params.startTime,X=O.getNetType(),Y=y?(y==null?void 0:y.code)||(y==null||(p=y.error)===null||p===void 0?void 0:p.code)||(y==null||(D=y.error)===null||D===void 0?void 0:D.Code):"",oe=y?(y==null?void 0:y.message)||(y==null||(F=y.error)===null||F===void 0?void 0:F.message)||(y==null||(_=y.error)===null||_===void 0?void 0:_.Message):"",le=y?(y==null?void 0:y.resource)||(y==null||(L=y.error)===null||L===void 0?void 0:L.resource)||(y==null||(b=y.error)===null||b===void 0?void 0:b.Resource):"",se=y?y==null?void 0:y.statusCode:z.statusCode,te=y?(y==null?void 0:y.headers)&&(y==null?void 0:y.headers["x-cos-request-id"]):(z==null?void 0:z.headers)&&(z==null?void 0:z.headers["x-cos-request-id"]),de=y?te?"Server":"Client":"";if(Object.assign(this.params,{tookTime:G,networkType:X,httpMd5:this.params.md5EndTime-this.params.md5StartTime,httpSign:this.params.signEndTime-this.params.signStartTime,httpFull:this.params.httpEndTime-this.params.httpStartTime,result:y?"Fail":"Success",errorType:de,errorCode:Y,errorStatusCode:se,errorMessage:oe,errorServiceName:le,errorRequestId:te}),y&&(!Y||!oe)&&(this.params.fullError=y?JSON.stringify(y):""),this.params.name==="getObject"&&(this.params.size=z?z.headers&&z.headers["content-length"]:-1),this.params.reqUrl)try{var ue=/^http(s)?:\/\/(.*?)\//.exec(this.params.reqUrl);this.params.host=ue[2]}catch{this.params.host=this.params.reqUrl}this.sendEvents()}},{key:"setParams",value:function(y){Object.assign(this.params,y)}},{key:"sendEvents",value:function(){if(!(V.includes(this.params.name)&&!this.deepTracker)){var y=H(this.params.name),z=Q(this.params);this.beacon||(this.beacon=q(this.delay||5e3)),this.delay===0?this.beacon&&this.beacon.onDirectUserAction(y,z):this.beacon&&this.beacon.onUserAction(y,z)}}},{key:"generateSubTracker",value:function(y){return Object.assign(y,{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 I(y)}}]),I}();l.exports=ae},"./src/util.js":function(l,C,s){(function(g){var R=s("./node_modules/@babel/runtime/helpers/typeof.js"),d=s("./lib/md5.js"),T=s("./lib/crypto.js"),N=s("./lib/xml2json.js"),q=s("./lib/json2xml.js"),O=s("./lib/base64.js"),A=s("./src/tracker.js");function K(ie){return encodeURIComponent(ie).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function V(ie,u){var o=[];for(var r in ie)ie.hasOwnProperty(r)&&o.push(u?K(r).toLowerCase():r);return o.sort(function(i,v){return i=i.toLowerCase(),v=v.toLowerCase(),i===v?0:i>v?1:-1})}var W=function(u,o){var r,i,v,w=[],B=V(u);for(r=0;r<B.length;r++)i=B[r],v=u[i]===void 0||u[i]===null?"":""+u[i],i=o?K(i).toLowerCase():K(i),v=K(v)||"",w.push(i+"="+v);return w.join("&")},j=["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"],H=function(u){var o={};for(var r in u){var i=r.toLowerCase();(i.indexOf("x-cos-")>-1||j.indexOf(i)>-1)&&(o[r]=u[r])}return o},ne=function(u){u=u||{};var o=u.SecretId,r=u.SecretKey,i=u.KeyTime,v=(u.method||u.Method||"get").toLowerCase(),w=U(u.Query||u.params||{}),B=H(U(u.Headers||u.headers||{})),J=u.Key||"",fe;u.UseRawKey?fe=u.Pathname||u.pathname||"/"+J:(fe=u.Pathname||u.pathname||J,fe.indexOf("/")!==0&&(fe="/"+fe));var ge=u.ForceSignHost!==!1;if(!B.Host&&!B.host&&u.Bucket&&u.Region&&ge&&(B.Host=u.Bucket+".cos."+u.Region+".myqcloud.com"),!o)throw new Error("missing param SecretId");if(!r)throw new Error("missing param SecretKey");var $=Math.round(ye(u.SystemClockOffset)/1e3)-1,Re=$,Ne=u.Expires||u.expires;Ne===void 0?Re+=900:Re+=Ne*1||0;var Fe="sha1",Ie=o,je=i||$+";"+Re,Ve=i||$+";"+Re,Ge=V(B,!0).join(";").toLowerCase(),Xe=V(w,!0).join(";").toLowerCase(),qe=T.HmacSHA1(Ve,r).toString(),We=[v,fe,Ue.obj2str(w,!0),Ue.obj2str(B,!0),""].join(`
  11. `),Qe=["sha1",je,T.SHA1(We).toString(),""].join(`
  12. `),rt=T.HmacSHA1(Qe,qe).toString(),tt=["q-sign-algorithm="+Fe,"q-ak="+Ie,"q-sign-time="+je,"q-key-time="+Ve,"q-header-list="+Ge,"q-url-param-list="+Xe,"q-signature="+rt].join("&");return tt},Q=function(u,o,r){var i=o/8,v=u.slice(r,r+i);return new Uint8Array(v).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[o](v)[0]},ae=function(u,o,r,i){var v=u.slice(o,r),w="";return new Uint8Array(v).forEach(function(B){w+=String.fromCharCode(B)}),i&&(w=decodeURIComponent(escape(w))),w},I=function(u){for(var o={},r=ae(u),i={records:[]};u.byteLength;){var v=Q(u,32,0),w=Q(u,32,4),B=v-w-16,J=0,fe;for(u=u.slice(12);J<w;){var ge=Q(u,8,J),$=ae(u,J+1,J+1+ge),Re=Q(u,16,J+ge+2),Ne=ae(u,J+ge+4,J+ge+4+Re);o[$]=Ne,J+=ge+4+Re}if(o[":event-type"]==="Records")fe=ae(u,J,J+B,!0),i.records.push(fe);else if(o[":event-type"]==="Stats")fe=ae(u,J,J+B,!0),i.stats=Ue.xml2json(fe).Stats;else if(o[":event-type"]==="error"){var Fe=o[":error-code"],Ie=o[":error-message"],je=new Error(Ie);je.message=Ie,je.name=je.code=Fe,i.error=je}u=u.slice(J+B+4)}return{payload:i.records.join(""),body:r}},m=function(u){var o=this.options.CopySourceParser;if(o)return o(u);var r=u.match(/^([^.]+-\d+)\.cos(v6|-cdc|-cdz|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return r?{Bucket:r[1],Region:r[3],Key:r[7]}:null},y=function(){},z=function(u){var o={};for(var r in u)u.hasOwnProperty(r)&&u[r]!==void 0&&u[r]!==null&&(o[r]=u[r]);return o},p=function(u,o){var r,i=new FileReader;FileReader.prototype.readAsBinaryString?(r=FileReader.prototype.readAsBinaryString,i.onload=function(){o(this.result)}):FileReader.prototype.readAsArrayBuffer?r=function(w){var B="",J=new FileReader;J.onload=function(fe){for(var ge=new Uint8Array(J.result),$=ge.byteLength,Re=0;Re<$;Re++)B+=String.fromCharCode(ge[Re]);o(B)},J.readAsArrayBuffer(w)}:console.error("FileReader not support readAsBinaryString"),r.call(i,u)},D=function(){var ie=function(r,i){r=r.split("."),i=i.split(".");for(var v=0;v<i.length;v++)if(r[v]!==i[v])return parseInt(r[v])>parseInt(i[v])?1:-1;return 0},u=function(r){if(!r)return!1;var i=(r.match(/Chrome\/([.\d]+)/)||[])[1],v=(r.match(/QBCore\/([.\d]+)/)||[])[1],w=(r.match(/QQBrowser\/([.\d]+)/)||[])[1],B=i&&ie(i,"53.0.2785.116")<0&&v&&ie(v,"3.53.991.400")<0&&w&&ie(w,"9.0.2524.400")<=0||!1;return B};return u(typeof navigator!="undefined"&&navigator.userAgent)}(),F=function(u,o,r,i,v){var w;if(u.slice?w=u.slice(o,r):u.mozSlice?w=u.mozSlice(o,r):u.webkitSlice&&(w=u.webkitSlice(o,r)),i&&D){var B=new FileReader;B.onload=function(J){w=null,v(new Blob([B.result]))},B.readAsArrayBuffer(w)}else v(w)},_=function(u,o,r,i){r=r||y,u?typeof o=="string"?r(Ue.md5(o,!0)):Blob&&o instanceof Blob?Ue.getFileMd5(o,function(v,w){r(w)},i):r():r()},L=1024*1024,b=function(u,o,r){var i=u.size,v=0,w=d.getCtx(),B=function J(fe){if(fe>=i){var ge=w.digest("hex");o(null,ge);return}var $=Math.min(i,fe+L);Ue.fileSlice(u,fe,$,!1,function(Re){p(Re,function(Ne){Re=null,w=w.update(Ne,!0),v+=Ne.length,Ne=null,r&&r({loaded:v,total:i,percent:Math.round(v/i*1e4)/1e4}),J(fe+L)})})};B(0)};function U(ie){return te(ie,function(u){return R(u)==="object"&&u!==null?U(u):u})}function G(ie,u,o){return ie&&u in ie?ie[u]:o}function X(ie,u){return se(u,function(o,r){ie[r]=u[r]}),ie}function Y(ie){return ie instanceof Array}function oe(ie,u){for(var o=!1,r=0;r<ie.length;r++)if(u===ie[r]){o=!0;break}return o}function le(ie){return Y(ie)?ie:[ie]}function se(ie,u){for(var o in ie)ie.hasOwnProperty(o)&&u(ie[o],o)}function te(ie,u){var o=Y(ie)?[]:{};for(var r in ie)ie.hasOwnProperty(r)&&(o[r]=u(ie[r],r));return o}function de(ie,u){var o=Y(ie),r=o?[]:{};for(var i in ie)ie.hasOwnProperty(i)&&u(ie[i],i)&&(o?r.push(ie[i]):r[i]=ie[i]);return r}var ue=function(u){var o,r,i,v="";for(o=0,r=u.length/2;o<r;o++)i=parseInt(u[o*2]+u[o*2+1],16),v+=String.fromCharCode(i);return btoa(v)},me=function(){var u=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return u()+u()+"-"+u()+"-"+u()+"-"+u()+"-"+u()+u()+u()},Z=function(u,o){var r=o.Bucket,i=o.Region,v=o.Key,w=this.options.Domain,B=!w||typeof w=="string"&&w.indexOf("{Bucket}")>-1,J=!w||typeof w=="string"&&w.indexOf("{Region}")>-1;if(u.indexOf("Bucket")>-1||u==="deleteMultipleObject"||u==="multipartList"||u==="listObjectVersions"){if(B&&!r)return"Bucket";if(J&&!i)return"Region"}else if(u.indexOf("Object")>-1||u.indexOf("multipart")>-1||u==="sliceUploadFile"||u==="abortUploadTask"){if(B&&!r)return"Bucket";if(J&&!i)return"Region";if(!v)return"Key"}return!1},re=function(u,o){if(o=X({},o),u!=="getAuth"&&u!=="getV4Auth"&&u!=="getObjectUrl"){var r=o.Headers||{};if(o&&R(o)==="object"){(function(){for(var v in o)o.hasOwnProperty(v)&&v.indexOf("x-cos-")>-1&&(r[v]=o[v])})();var i={"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(i,function(v,w){o[v]!==void 0&&(r[w]=o[v])}),o.Headers=z(r)}}return o},ve=function(u,o){return function(r,i){var v=this;typeof r=="function"&&(i=r,r={}),r=re(u,r);var w;if(v.options.EnableTracker)if(r.calledBySdk==="sliceUploadFile")w=r.tracker&&r.tracker.generateSubTracker({apiName:u});else if(["uploadFile","uploadFiles"].includes(u))w=null;else{var B=-1;r.Body&&(B=typeof r.Body=="string"?r.Body.length:r.Body.size||r.Body.byteLength||-1),w=new A({bucket:r.Bucket,region:r.Region,apiName:u,fileKey:r.Key,fileSize:B,deepTracker:v.options.DeepTracker,customId:v.options.CustomId,delay:v.options.TrackerDelay})}r.tracker=w;var J=function(Ie){return Ie&&Ie.headers&&(Ie.headers["x-cos-request-id"]&&(Ie.RequestId=Ie.headers["x-cos-request-id"]),Ie.headers["x-ci-request-id"]&&(Ie.RequestId=Ie.headers["x-ci-request-id"]),Ie.headers["x-cos-version-id"]&&(Ie.VersionId=Ie.headers["x-cos-version-id"]),Ie.headers["x-cos-delete-marker"]&&(Ie.DeleteMarker=Ie.headers["x-cos-delete-marker"])),Ie},fe=function(Ie,je){w&&w.formatResult(Ie,je),i&&i(J(Ie),J(je))},ge=function(){if(u!=="getService"&&u!=="abortUploadTask"){var Ie=Z.call(v,u,r);if(Ie)return"missing param "+Ie;if(r.Region){if(v.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(r.Region))return"Region format error."}else{if(r.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(r.Region))return"Region format error."}!v.options.CompatibilityMode&&r.Region.indexOf("-")===-1&&r.Region!=="yfb"&&r.Region!=="default"&&r.Region!=="accelerate"&&console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(r.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(r.Bucket))if(r.AppId)r.Bucket=r.Bucket+"-"+r.AppId;else if(v.options.AppId)r.Bucket=r.Bucket+"-"+v.options.AppId;else return'Bucket should format as "test-1250000000".';r.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete r.AppId)}!v.options.UseRawKey&&r.Key&&r.Key.substr(0,1)==="/"&&(r.Key=r.Key.substr(1))}},$=ge(),Re=["getAuth","getObjectUrl"].includes(u);if(typeof Promise=="function"&&!Re&&!i)return new Promise(function(Fe,Ie){if(i=function(Ve,Ge){Ve?Ie(Ve):Fe(Ge)},$)return fe(Ue.error(new Error($)));o.call(v,r,fe)});if($)return fe(Ue.error(new Error($)));var Ne=o.call(v,r,fe);if(Re)return Ne}},Ce=function(u,o){var r=this,i=0,v=0,w=Date.now(),B,J;function fe(){if(J=0,o&&typeof o=="function"){B=Date.now();var ge=Math.max(0,Math.round((v-i)/((B-w)/1e3)*100)/100)||0,$;v===0&&u===0?$=1:$=Math.floor(v/u*100)/100||0,w=B,i=v;try{o({loaded:v,total:u,speed:ge,percent:$})}catch{}}}return function(ge,$){if(ge&&(v=ge.loaded,u=ge.total),$)clearTimeout(J),fe();else{if(J)return;J=setTimeout(fe,r.options.ProgressInterval)}}},pe=function(u,o,r){var i;if(typeof o.Body=="string"?o.Body=new Blob([o.Body],{type:"text/plain"}):o.Body instanceof ArrayBuffer&&(o.Body=new Blob([o.Body])),o.Body&&(o.Body instanceof Blob||o.Body.toString()==="[object File]"||o.Body.toString()==="[object Blob]"))i=o.Body.size;else{r(Ue.error(new Error("params body format error, Only allow File|Blob|String.")));return}o.ContentLength=i,r(null,i)},ye=function(u){return Date.now()+(u||0)},Se=function(u,o){var r=u;return u.message=u.message||null,typeof o=="string"?(u.error=o,u.message=o):R(o)==="object"&&o!==null&&(X(u,o),(o.code||o.name)&&(u.code=o.code||o.name),o.message&&(u.message=o.message),o.stack&&(u.stack=o.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(u,"name",{writable:!0,enumerable:!1}),Object.defineProperty(u,"message",{enumerable:!0})),u.name=o&&o.name||u.name||u.code||"Error",u.code||(u.code=u.name),u.error||(u.error=U(r)),u},xe=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 g=="undefined"?"undefined":R(g))==="object"&&!0&&!xe()},Oe=function(u){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(u)},Ae=function(){if((typeof navigator=="undefined"?"undefined":R(navigator))!=="object")return!1;var ie=navigator.userAgent,u=!!ie.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return u}(),De=function(){return(typeof navigator=="undefined"?"undefined":R(navigator))!=="object"?!1:/\sQQ/i.test(navigator.userAgent)}(),Le=function(u,o){var r=O.encode(u);return o&&(r=r.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),r},Ue={noop:y,formatParams:re,apiWrapper:ve,xml2json:N,json2xml:q,md5:d,clearKey:z,fileSlice:F,getBodyMd5:_,getFileMd5:b,b64:ue,extend:X,isArray:Y,isInArray:oe,makeArray:le,each:se,map:te,filter:de,clone:U,attr:G,uuid:me,camSafeUrlEncode:K,throttleOnProgress:Ce,getFileSize:pe,getSkewTime:ye,error:Se,obj2str:W,getAuth:ne,parseSelectPayload:I,getSourceParams:m,isBrowser:!0,isNode:Ee,isCIHost:Oe,isIOS_QQ:Ae&&De,encodeBase64:Le};l.exports=Ue}).call(this,s("./node_modules/process/browser.js"))}})})})(cosJsSdkV5);var COS=getDefaultExportFromCjs(cosJsSdkV5.exports);const ossSwitch="tencent",tencentBucket="daya-online-1303457149",getUploadSign=async l=>{const{bucketName:C,filename:s,postData:g}=l,R=ossSwitch;let d=C,T=s,N={};return d=tencentBucket,T="gyt/"+s,N={key:"gyt/"+g.key},request.post("/api-student/open/getUploadSign",{data:{postData:N,pluginName:R,bucketName:d,filename:T},params:{pluginName:R}})},onOnlyFileUpload=async(l,C)=>{{let s="",g=null;if(console.log(C,"params"),await new COS({Domain:"https://oss.dayaedu.com",getAuthorization:async(d,T)=>{T({Authorization:C.signature})}}).uploadFile({Bucket:tencentBucket,Region:"ap-nanjing",Key:`gyt/${C.name}`,Body:C.file,SliceSize:1024*1024*500}).then(d=>{var T;((T=d.Location)==null?void 0:T.indexOf("http"))>=0?s=d.Location:s="https://"+d.Location}).catch(d=>{g=d}),s)return s;throw new Error(g)}};export{Uploader as U,getUploadSign as g,onOnlyFileUpload as o};