import{j as createNamespace,d as defineComponent,ag as makeRequiredProp,t as numericProp,O as reactive,ah as useTouch,i as ref,E as computed,w as watch,ai as useEventListener,g as createVNode,aj as preventDefault,ak as clamp,a9 as Loading,al as LONG_PRESS_START_TIME,v as truthProp,q as makeArrayProp,am as makeNumericProp,x as unknownProp,n as makeStringProp,an as useExpose,o as onMounted,ao as windowWidth,ap as windowHeight,y as nextTick,m as mergeProps,p as pick,P as Popup,Y as useRect,aq as HAPTICS_FEEDBACK,I as Icon,ar as callInterceptor,z as inBrowser,A as extend,as as mountComponent,at as usePopupState,D as withInstall,au as toArray,av as isFunction,H as getSizeStyle,aw as isDef,l as onBeforeUnmount,ad as useCustomFieldValue,ax as withDirectives,ay as vShow,az as isPromise,U as commonjsGlobal,a8 as getDefaultExportFromCjs,a as request,M as postMessage,f as showToast,aa as closeToast,a4 as showLoadingToast,af as getOssUploadUrl,F as Fragment}from"./index-e362c2e8.js";import{c as SwipeItem,b as Swipe}from"./index-f57b4c5f.js";import{I as Image}from"./index-85ccd873.js";const getDistance=r=>Math.sqrt((r[0].clientX-r[1].clientX)**2+(r[0].clientY-r[1].clientY)**2),bem$2=createNamespace("image-preview")[1];var stdin_default$3=defineComponent({props:{src:String,show:Boolean,active:Number,minZoom:makeRequiredProp(numericProp),maxZoom:makeRequiredProp(numericProp),rootWidth:makeRequiredProp(Number),rootHeight:makeRequiredProp(Number),disableZoom:Boolean},emits:["scale","close","longPress"],setup(r,{emit:p,slots:s}){const u=reactive({scale:1,moveX:0,moveY:0,moving:!1,zooming:!1,imageRatio:0,displayWidth:0,displayHeight:0}),x=useTouch(),l=ref(),T=computed(()=>{const{rootWidth:w,rootHeight:D}=r,A=D/w;return u.imageRatio>A}),U=computed(()=>{const{scale:w,moveX:D,moveY:A,moving:N,zooming:G}=u,W={transitionDuration:G||N?"0s":".3s"};if(w!==1){const Z=D/w,ie=A/w;W.transform=`scale(${w}, ${w}) translate(${Z}px, ${ie}px)`}return W}),K=computed(()=>{if(u.imageRatio){const{rootWidth:w,rootHeight:D}=r,A=T.value?D/u.imageRatio:w;return Math.max(0,(u.scale*A-w)/2)}return 0}),O=computed(()=>{if(u.imageRatio){const{rootWidth:w,rootHeight:D}=r,A=T.value?D:w*u.imageRatio;return Math.max(0,(u.scale*A-D)/2)}return 0}),I=w=>{w=clamp(w,+r.minZoom,+r.maxZoom+1),w!==u.scale&&(u.scale=w,p("scale",{scale:w,index:r.active}))},z=()=>{I(1),u.moveX=0,u.moveY=0},q=()=>{const w=u.scale>1?1:2;I(w),u.moveX=0,u.moveY=0};let X,F,L,$,Y,ee,B,m=!1;const C=w=>{const{touches:D}=w;if(X=D.length,X===2&&r.disableZoom)return;const{offsetX:A}=x;x.start(w),F=u.moveX,L=u.moveY,B=Date.now(),m=!1,u.moving=X===1&&u.scale!==1,u.zooming=X===2&&!A.value,u.zooming&&($=u.scale,Y=getDistance(w.touches))},V=w=>{const{touches:D}=w;if(x.move(w),u.moving){const{deltaX:A,deltaY:N}=x,G=A.value+F,W=N.value+L;if((G>K.value||G<-K.value)&&!m&&x.isHorizontal()){u.moving=!1;return}m=!0,preventDefault(w,!0),u.moveX=clamp(G,-K.value,K.value),u.moveY=clamp(W,-O.value,O.value)}if(u.zooming&&(preventDefault(w,!0),D.length===2)){const A=getDistance(D),N=$*A/Y;I(N)}},y=()=>{if(X>1)return;const{offsetX:w,offsetY:D}=x,A=Date.now()-B,N=250,G=5;w.value{p("close"),ee=null},N):A>LONG_PRESS_START_TIME&&p("longPress"))},M=w=>{let D=!1;if((u.moving||u.zooming)&&(D=!0,u.moving&&F===u.moveX&&L===u.moveY&&(D=!1),!w.touches.length)){u.zooming&&(u.moveX=clamp(u.moveX,-K.value,K.value),u.moveY=clamp(u.moveY,-O.value,O.value),u.zooming=!1),u.moving=!1,F=0,L=0,$=1,u.scale<1&&z();const A=+r.maxZoom;u.scale>A&&(u.scale=A)}preventDefault(w,D),y(),x.reset()},j=w=>{const{naturalWidth:D,naturalHeight:A}=w.target;u.imageRatio=A/D};return watch(()=>r.active,z),watch(()=>r.show,w=>{w||z()}),useEventListener("touchmove",V,{target:computed(()=>{var w;return(w=l.value)==null?void 0:w.$el})}),()=>{const w={loading:()=>createVNode(Loading,{type:"spinner"},null)};return createVNode(SwipeItem,{ref:l,class:bem$2("swipe-item"),onTouchstartPassive:C,onTouchend:M,onTouchcancel:M},{default:()=>[s.image?createVNode("div",{class:bem$2("image-wrap")},[s.image({src:r.src})]):createVNode(Image,{src:r.src,fit:"contain",class:bem$2("image",{vertical:T.value}),style:U.value,onLoad:j},w)]})}}});const[name$1,bem$1]=createNamespace("image-preview"),popupProps=["show","teleport","transition","overlayStyle","closeOnPopstate"],imagePreviewProps={show:Boolean,loop:truthProp,images:makeArrayProp(),minZoom:makeNumericProp(1/3),maxZoom:makeNumericProp(3),overlay:truthProp,closeable:Boolean,showIndex:truthProp,className:unknownProp,closeIcon:makeStringProp("clear"),transition:String,beforeClose:Function,overlayClass:unknownProp,overlayStyle:Object,swipeDuration:makeNumericProp(300),startPosition:makeNumericProp(0),showIndicators:Boolean,closeOnPopstate:truthProp,closeIconPosition:makeStringProp("top-right"),teleport:[String,Object]};var stdin_default$2=defineComponent({name:name$1,props:imagePreviewProps,emits:["scale","close","closed","change","longPress","update:show"],setup(r,{emit:p,slots:s}){const u=ref(),x=reactive({active:0,rootWidth:0,rootHeight:0,disableZoom:!1}),l=()=>{if(u.value){const ee=useRect(u.value.$el);x.rootWidth=ee.width,x.rootHeight=ee.height,u.value.resize()}},T=ee=>p("scale",ee),U=ee=>p("update:show",ee),K=()=>{callInterceptor(r.beforeClose,{args:[x.active],done:()=>U(!1)})},O=ee=>{ee!==x.active&&(x.active=ee,p("change",ee))},I=()=>{if(r.showIndex)return createVNode("div",{class:bem$1("index")},[s.index?s.index({index:x.active}):`${x.active+1} / ${r.images.length}`])},z=()=>{if(s.cover)return createVNode("div",{class:bem$1("cover")},[s.cover()])},q=()=>{x.disableZoom=!0},X=()=>{x.disableZoom=!1},F=()=>createVNode(Swipe,{ref:u,lazyRender:!0,loop:r.loop,class:bem$1("swipe"),duration:r.swipeDuration,initialSwipe:r.startPosition,showIndicators:r.showIndicators,indicatorColor:"white",onChange:O,onDragEnd:X,onDragStart:q},{default:()=>[r.images.map((ee,B)=>createVNode(stdin_default$3,{src:ee,show:r.show,active:x.active,maxZoom:r.maxZoom,minZoom:r.minZoom,rootWidth:x.rootWidth,rootHeight:x.rootHeight,disableZoom:x.disableZoom,onScale:T,onClose:K,onLongPress:()=>p("longPress",{index:B})},{image:s.image}))]}),L=()=>{if(r.closeable)return createVNode(Icon,{role:"button",name:r.closeIcon,class:[bem$1("close-icon",r.closeIconPosition),HAPTICS_FEEDBACK],onClick:K},null)},$=()=>p("closed"),Y=(ee,B)=>{var m;return(m=u.value)==null?void 0:m.swipeTo(ee,B)};return useExpose({swipeTo:Y}),onMounted(l),watch([windowWidth,windowHeight],l),watch(()=>r.startPosition,ee=>O(+ee)),watch(()=>r.show,ee=>{const{images:B,startPosition:m}=r;ee?(O(+m),nextTick(()=>{l(),Y(+m,{immediate:!0})})):p("close",{index:x.active,url:B[x.active]})}),()=>createVNode(Popup,mergeProps({class:[bem$1(),r.className],overlayClass:[bem$1("overlay"),r.overlayClass],onClosed:$,"onUpdate:show":U},pick(r,popupProps)),{default:()=>[L(),F(),I(),z()]})}});let instance;const defaultConfig={loop:!0,images:[],maxZoom:3,minZoom:1/3,onScale:void 0,onClose:void 0,onChange:void 0,teleport:"body",className:"",showIndex:!0,closeable:!1,closeIcon:"clear",transition:void 0,beforeClose:void 0,overlayStyle:void 0,overlayClass:void 0,startPosition:0,swipeDuration:300,showIndicators:!1,closeOnPopstate:!0,closeIconPosition:"top-right"};function initInstance(){({instance}=mountComponent({setup(){const{state:r,toggle:p}=usePopupState(),s=()=>{r.images=[]};return()=>createVNode(stdin_default$2,mergeProps(r,{onClosed:s,"onUpdate:show":p}),null)}}))}const showImagePreview=(r,p=0)=>{if(inBrowser)return instance||initInstance(),r=Array.isArray(r)?{images:r,startPosition:p}:r,instance.open(extend({},defaultConfig,r)),instance};withInstall(stdin_default$2);const[name,bem,t]=createNamespace("uploader");function readFileContent(r,p){return new Promise(s=>{if(p==="file"){s();return}const u=new FileReader;u.onload=x=>{s(x.target.result)},p==="dataUrl"?u.readAsDataURL(r):p==="text"&&u.readAsText(r)})}function isOversize(r,p){return toArray(r).some(s=>s.file?isFunction(p)?p(s.file):s.file.size>+p:!1)}function filterFiles(r,p){const s=[],u=[];return r.forEach(x=>{isOversize(x,p)?u.push(x):s.push(x)}),{valid:s,invalid:u}}const IMAGE_REGEXP=/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i,isImageUrl=r=>IMAGE_REGEXP.test(r);function isImageFile(r){return r.isImage?!0:r.file&&r.file.type?r.file.type.indexOf("image")===0:r.url?isImageUrl(r.url):typeof r.content=="string"?r.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(r,{emit:p,slots:s}){const u=()=>{const{status:O,message:I}=r.item;if(O==="uploading"||O==="failed"){const z=O==="failed"?createVNode(Icon,{name:"close",class:bem("mask-icon")},null):createVNode(Loading,{class:bem("loading")},null),q=isDef(I)&&I!=="";return createVNode("div",{class:bem("mask")},[z,q&&createVNode("div",{class:bem("mask-message")},[I])])}},x=O=>{const{name:I,item:z,index:q,beforeDelete:X}=r;O.stopPropagation(),callInterceptor(X,{args:[z,{name:I,index:q}],done:()=>p("delete")})},l=()=>p("preview"),T=()=>{if(r.deletable&&r.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:x},[O?O():createVNode(Icon,{name:"cross",class:bem("preview-delete-icon")},null)])}},U=()=>{if(s["preview-cover"]){const{index:O,item:I}=r;return createVNode("div",{class:bem("preview-cover")},[s["preview-cover"](extend({index:O},I))])}},K=()=>{const{item:O,lazyLoad:I,imageFit:z,previewSize:q}=r;return isImageFile(O)?createVNode(Image,{fit:z,src:O.content||O.url,class:bem("preview-image"),width:Array.isArray(q)?q[0]:q,height:Array.isArray(q)?q[1]:q,lazyLoad:I,onClick:l},{default:U}):createVNode("div",{class:bem("file"),style:getSizeStyle(r.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]),U()])};return()=>createVNode("div",{class:bem("preview")},[K(),u(),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(r,{emit:p,slots:s}){const u=ref(),x=[],l=(m=r.modelValue.length)=>({name:r.name,index:m}),T=()=>{u.value&&(u.value.value="")},U=m=>{if(T(),isOversize(m,r.maxSize))if(Array.isArray(m)){const C=filterFiles(m,r.maxSize);if(m=C.valid,p("oversize",C.invalid,l()),!m.length)return}else{p("oversize",m,l());return}m=reactive(m),p("update:modelValue",[...r.modelValue,...toArray(m)]),r.afterRead&&r.afterRead(m,l())},K=m=>{const{maxCount:C,modelValue:V,resultType:y}=r;if(Array.isArray(m)){const M=+C-V.length;m.length>M&&(m=m.slice(0,M)),Promise.all(m.map(j=>readFileContent(j,y))).then(j=>{const w=m.map((D,A)=>{const N={file:D,status:"",message:""};return j[A]&&(N.content=j[A]),N});U(w)})}else readFileContent(m,y).then(M=>{const j={file:m,status:"",message:""};M&&(j.content=M),U(j)})},O=m=>{const{files:C}=m.target;if(r.disabled||!C||!C.length)return;const V=C.length===1?C[0]:[].slice.call(C);if(r.beforeRead){const y=r.beforeRead(V,l());if(!y){T();return}if(isPromise(y)){y.then(M=>{K(M||V)}).catch(T);return}}K(V)};let I;const z=()=>p("closePreview"),q=m=>{if(r.previewFullImage){const C=r.modelValue.filter(isImageFile),V=C.map(y=>(y.file&&!y.url&&y.status!=="failed"&&(y.url=URL.createObjectURL(y.file),x.push(y.url)),y.url)).filter(Boolean);I=showImagePreview(extend({images:V,startPosition:C.indexOf(m),onClose:z},r.previewOptions))}},X=()=>{I&&I.close()},F=(m,C)=>{const V=r.modelValue.slice(0);V.splice(C,1),p("update:modelValue",V),p("delete",m,l(C))},L=(m,C)=>{const V=["imageFit","deletable","previewSize","beforeDelete"],y=extend(pick(r,V),pick(m,V,!0));return createVNode(stdin_default$1,mergeProps({item:m,index:C,onClick:()=>p("clickPreview",m,l(C)),onDelete:()=>F(m,C),onPreview:()=>q(m)},pick(r,["name","lazyLoad"]),y),pick(s,["preview-cover","preview-delete"]))},$=()=>{if(r.previewImage)return r.modelValue.map(L)},Y=m=>p("clickUpload",m),ee=()=>{if(r.modelValue.length>=+r.maxCount)return;const m=r.readonly?null:createVNode("input",{ref:u,type:"file",class:bem("input"),accept:r.accept,capture:r.capture,multiple:r.multiple,disabled:r.disabled,onChange:O},null);return s.default?createVNode("div",{class:bem("input-wrapper"),onClick:Y},[s.default(),m]):withDirectives(createVNode("div",{class:bem("upload",{readonly:r.readonly}),style:getSizeStyle(r.previewSize),onClick:Y},[createVNode(Icon,{name:r.uploadIcon,class:bem("upload-icon")},null),r.uploadText&&createVNode("span",{class:bem("upload-text")},[r.uploadText]),m]),[[vShow,r.showUpload]])},B=()=>{u.value&&!r.disabled&&u.value.click()};return onBeforeUnmount(()=>{x.forEach(m=>URL.revokeObjectURL(m))}),useExpose({chooseFile:B,closeImagePreview:X}),useCustomFieldValue(()=>r.modelValue),()=>createVNode("div",{class:bem()},[createVNode("div",{class:bem("wrapper",{disabled:r.disabled})},[$(),ee()])])}});const Uploader=withInstall(stdin_default),singleImgClose="_singleImgClose_1ti1e_25",uploader="_uploader_1ti1e_1",previewImg="_previewImg_1ti1e_36",uploadImg="_uploadImg_1ti1e_42",styles={"uploader-section":"_uploader-section_1ti1e_1","img-close":"_img-close_1ti1e_9",singleImgClose,uploader,default:"_default_1ti1e_31",previewImg,uploadImg},iconUploader="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAACYCAMAAAAvHNATAAABOFBMVEUAAADa2tr39/f////a2tr39/fa2trZ2dnV1dX5+fn5+fnp6en29vbZ2dn4+Pjo6OjZ2dk9PT2ZmZmXl5f29vbx8fHk5OTh4eHq6urOzs66urrBwcH19fW1tbXz8/Ps7Oza2trm5uaysrJERETe3t6vr6/g4ODV1dW+vr6cnJzc3Nwly7zv7++np6fQ0NDKyspA0sHJycnFxcU50L8pzL2dnZ3w8PDu7u40z78gyru4uLirq6tKSkovzb5iYmJZWVnGxsY80cCurq6qqqqfn59paWnX19dF1MJBQUHT09Nz3dBp2s/MzMzDw8MbyLqjo6OhoaGSkpJa1spL1MWMjIyHh4dwcHBSUlJMTExi2M3w9vbb8u/U1NR7e3tycnJR1cfn9fON4th839J/f3/M7uvG7um76+eX5Nt5K7d4AAAADnRSTlMA8s8Gx2xszwbyx8cbGz8Ohn8AAAbPSURBVHja7NppU9pQFMbx2M2uT3IwgYzVACUuBWqxOIBWiejgOqgoirtVu3z/b9AT9aqg1vEGhjtTfu/Om8x/kniPCpqmvX71ose4EgOLiykKwBLDMNiwmCwAUTHEwWJiariEDcARgwsWuX2JtBjCYEnD1/Pi1XONfeg1XP0aWFoMFoABMUTBomIa8JvFkAZ7+BKmGOyGSzh+sxjyYLbui7vxZ+/5fvXG0lCMiWfPtZexPBT0UntrQkHpd9obqCjeo0FJuqENKPkoOczQoaBuWDesyf8T5qQVDQPUDUvaUJKiK8nJKRqmG92wJ4eFo1CQsgdsN6wb1m7RiKJhKi9xZcNyDpSk6EqyXUXDVF7iaQdtcrBycrYPGW0+YFcWFzN/VAw7WcxkVjoWZk4d1xMNisO4tJXJlFY7FRbdoTs2rsNK2U6Fmfd0TS+IsFK2Y2FTHLJt6PZtA7iymM0WZMNMJ1BYusxduOPH6dkKK2ULhczqHjuVODUChFnVBBHF0Mzc43OC3y/umpmZmEilJiclbpz8X0lWmXw2mh3c6VpL4ck0yKpxlXd+nkOz/a3mrrUtPJFlS4eFuavPxH1+bXJZKctdjNNSJwdo0sYl/omoaOJfshy1CQnBwj4TVdHAHf94aMEXH+13gcJEKkhY0oaUPn6SuJEPecQSR8tAdJdoKYkCv18Bwgy9FWGzuyTUHJfYLGZSkx0Pm1ry71axXCe248wfH4dMzPDPY4fDlhNEu0MWgEN/edaudiWfE6udDSsTeWFcMKtctgzf79Ra4aCjYeP8rhu3f+E4utqZP/chKae3IqzWsMqXiRIWAgsYJp7kKG7UiUZwqVIbgYRWhXlEC2A3nRVcsBLkQZLUJ7x3w8Zwo0j09XqfTkOSBglNYcdE38GubxMNBw3TjVaErTfs8yEiD2qEhfnc/wIx8HIKtSLMtgKHocoH2bwJX9LjJZCXCGvLyZ8rElF5aCRZ2faX5jeoEoYwlwlLg1AnDLnaEl0qjkGlMCCysePVi9sVE4qFNQgeFpMOCxFV8YgI0S4kSYfNEZXxiH6iIuTIh7kkFtGDInVxVyVoeg5yjrisXO172DYvzUQYkjTIsj163CDk5MMapNlH9Ih6BTKC/5/fnQv1PWx91kGAMLP7VcBu2N927m1HaSgK47jnRI1fycrebem5pBzaCMZJCglzY6AhMcHAA/j+z+HqLq1F0QqKbpXfRaedi85/kk73TBlWyy3sj9M2TIaahun8Yv3tXwHP4klNw3R+sR5a4jBTy/eyaHuDvYVdK0xM3uArYwOl2DVxlt4k/HVhNMSXgmIvwN5QgsbMUYzYadTfUlbMoLyjGF3C0eVhG/qAkk8BGg4V+31OVpamKVHKyEclon4rrNPlYSsyenesKO4qngrj7Yws3pWpw9uAlr85LCEfE2qTx2FbGvN2Qe6FYYvgojCxIhNz27bvaGxXxFHYKF0L8AfaXhgGXBQ2oxUUP/fQaMLkWypM2IY5ILMJc03FobHJwo6L/wfD7s0DG6VFTgMEUspFOpA1UYZFWeaStaa1DWyJyEUTdsz9FYu4oMZSHQ+Jwxw6FqD+lJWMuRIy2oT4HLbst406wuSPXWO7twc9MJdcDvvouu4udRteGZYliUsW3ro1u3WN1a51gw1oIDiMBfkSjfbFP6VcSXm/MqbZ1cPgSlRh7yn5RtgUSp/3673x9cNYFTZMP44Pko6wtzSYNLIrh9n0md8RNqGWN1cOe23VHOpXYdPpdF+GpffKrglbpwt5EF09rNEjX4BtfcXAxK8ZUCStUBt1hnnBT4bJSPVs0vsAihRo88zPt7EPR2FdfjJsQtO+FHe0kqi4uYR03peL6ZIPl7mNyoDM88Ks8GfC5HZH+ZqcABWxX/Em98smeg2YNBQoxbTGeWH4HsOqjGhtNYw6TBHje6I33tGX9AuuydSPwzveMjGg6JwwGX4/zKET/HYYE+8LmiZQlhSqWxbHe+kAvN0Vc7WG+egIO2sRz/onRHVYQ/KlJsCMao2P1Orjk1S/gW84bzidnx12oe0GLaaJkkgMFRqVSXFcxgoTzAvREm7N7rBEy+djf/0fvF1uYX+ctmGvY03DdH7Or21Y4EFLuj61jnQN0/g5fyihIW1vsLewW9gX/p8wnddKbcNi7YYVlrRdxF/HmobpvIhDS9rex25h/1LYwxga4iGiT0bQkPfywbOelmvSUx7tm0A3arTvg1eP8K0hxwswoyb4YH7ukOMQzG5O0T77/KtTLA7DkC0ehsweP33x3Do5FtoEi+ojUVa2x0J7p8dCz3FyLHR9Crs+MMqw+iADM1vjoz8BuFyFexahL+UAAAAASUVORK5CYII=",iconVideoDefault="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgAAAHICAMAAAD9f4rYAAAAolBMVEUjJyz///8oLDH9/f1AQ0j6+vorLzQ6PkL09PXy8vKztbewsbNydHdpbG8mKi/4+PjAwsOnqatZXGBTVlpKTVJDR0u7vL7l5uaZmp24ubvY2dnKy8yQkpXe3t+trrCeoKLv7/DT09R9gIN3en1bXmJHS08zNzuSlJbV1teJi455e35hZGhfYmU1OT7p6erg4eLQ0dKgoqSDhYjNzs81OD2pq62phkQlAAAHZElEQVR42uzBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGD27myrbSAGA7Dk3YnjJt4SskEWIBBoC6Xv/2qNxw3lgtPG0dhO5/zfC/hCZzySRh4DAAAAAAAAAAAAAAAAAAAAAAAAAAAAQKf87fr+etQbzna72bA3ur5fb32C/4n3NO+vAv5EsOrPnzyCy2cl85nLf+XO5olFcMG8aPiFT/JlGGFhXqrtMuBP2GFo8yeC5Zbg4viTMX/kLorJJsmcZ08t1WcnSzaTYuHyR+MJ0p/L4ozcj/FZRnlMn4rzaPkx4u7IIbgUt32bj256j84/w/7Yu+Eju39LcAmcq/cwusXAopNYg8J9D+UVVmX3rPl7nvp9fUc13K2/v+ewc5QjHdt/44pdpFRbWthc+bYn6I5/dQxjL6OzZL1jKK+QwHZmEB7zlZzOlh8zpXBA0AXrhSvTlETSKVdesFN2wFmxErzGJBS/BqyskL4KyF6rPZ808Ht4vXbjgZUgIk2igJUHghZdszLNSZt8yso1QVviPisjizSyRqz0Y4JWeMOqHRORZlHVJBripLIV3g8uhQlpl4Rc+oFItiCu1uPXjBqQfa3WJN6uzetzaeFQI5wFl/oEDavy1d0bNeR5h9y1DQ/VenyjxrwtUE82b1Dtjw41yKn2SfR4GuSEKl/NqFFZ9RT0XRtjrVT9mFDDElVPrnAW0pQXLkXUuIhLLwSNGHBpRC0YYZtsjq+2rqlFLbCmapvE9EcT1HxOkFMr8kDN8RBot6+/Qcq3SczWaWepuccetaanpiSRueo2Vy9Wn1rjq5frnEArR5V2r9SiV1W0oi2g15XKWGNqUTxFvqPdrV3OIafUqlQ9FN9q6dQ/5ZDQkKeazFFrI6eW5eqx2CX1GQlKD3EJMiLQxHfLlZFR67JySbpo1Oky4YOCOlDwwYRAjzEfpNSBlA/GBFo8qe/KqRPq63Tcx6PHkg/WVMd+eZ2SDms+WBJo4AVlxnFHNWxsZvvnHcndlXlWgMlzHaL6nbIFl242unqDEYHcsPbUhcW//bjVM18yJBCzvpSLy6odSMWdeNLH35RnIDiWlEvqd3Us/mM80NHdSQik7vng8bxAKoVPEo98cE8gNeMDRxBIDh5iOp/DBzMCIc9VvZWzA6lMU2FfyUUBoqWts5QFUhWVsn7EE4GGoatIFEhhURlhCEvbKX0uCaS0qMwxJ6DDqtyhYkkgpUVlXO7SKwKZstG6IEkgpUWlavgFBCK+qgS1BFIpnDNPlzEmILNVR/SiQIqLygnOJDWdB25EgRQXlZvqPBTEDbpEFEhxUZmgSafpWp1MFEhxUZnh4h1NE62OKJDiotLBdKumEeFnUSDFReVzdZAG4vEAT3cglXFKp/EwJKDnEMsm7YFUbnw6jY2DLLEdM4dNBLLOcXXIzDsCBBLwajUFkh1DoPwwRFMNgRkaAv+GFh2gaW4qHGMZAgfLhtA+6uFj1KMWDF8BxiGNpG9AeYYB5TPgkwHARzxGwmd1psCHroa4iE/PsUXiMgjA9SyGEVyYNMOFSRek2yvMClxhhksFAdd8GmmLi3cNgauwDYHL6Q2B30WYAj9wMQR+qWQK/OTMEPjtoCnwI1BD4Ne8psDPsg2B39ebYs+tHihFXNoTKNrznSCnVuQBMp2m+KHKXC1qgaUy1hDNuV/s3OtyqjAQB/D9k6Dcb4KKihbrqdrT2tr6/s92JmDHfnBObwTozP5egA+ZJJvdZbXw0VrGLIbiE9Pi2NY16UE5EtPDKAEgTEizJASAkiNWbaQNAHZKWqX1VzgVoJEP5SBJI3ngC1K/PZTiRNqcCih7YlqtoOy0reRpBx6r0woXSiFJC1mAi5DtCCIoh5Q0SA9QooCYdoNXKHZCjUtsKK/cWd6KQQQl9KhhXggl4nVsSeCiEhvUICNGxeVztT0rVGYZNSabgePV9u1RsTxqiGeB349d8G1UnCE1YOigYnM+p3WyRMV6CeiHghcLlZLzqx0wjg1M0VFGM9SOXO/owuV4FW5G35a5go/Vrg1z1IST0rekjkAt576OLv19Qk2MR/Rlo7FA7Yn75TpmLEKcPa/v6Avu1s84Cxd8O3ZP5gJnZu4b9CmGn5s4EzkHq/3wxxV4c+PcS/qAvHdu8Ea4/L9Vf8jYxMVk6WUBXRVk3nKCCzPm3dgvw+kE75nFeHqbpPJxUBVMHmWa3E7HhYn3JlMOVXtos7RwhbBtgSusJc/P6auBF4X4lDDyuOrYa0aynZv4L3O+Tfi58RsMHhZuaeEKq3QXD7wVf5fhZr1dxU403+3mkROvtusNhzaMMcYY+8ceHAgAAAAAAPm/NoKqqqqqqqqqqqqqqqqqqgp7cCAAAAAAAOT/2giqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkp7cEgAAAAAIOj/a2dYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF4BjB5ee44lPcgAAAAASUVORK5CYII=";var cosJsSdkV5Exports={},cosJsSdkV5={get exports(){return cosJsSdkV5Exports},set exports(r){cosJsSdkV5Exports=r}};(function(module,exports){(function(p,s){module.exports=s()})(commonjsGlobal,function(){return function(r){var p={};function s(u){if(p[u])return p[u].exports;var x=p[u]={i:u,l:!1,exports:{}};return r[u].call(x.exports,x,x.exports,s),x.l=!0,x.exports}return s.m=r,s.c=p,s.d=function(u,x,l){s.o(u,x)||Object.defineProperty(u,x,{enumerable:!0,get:l})},s.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},s.t=function(u,x){if(x&1&&(u=s(u)),x&8||x&4&&typeof u=="object"&&u&&u.__esModule)return u;var l=Object.create(null);if(s.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:u}),x&2&&typeof u!="string")for(var T in u)s.d(l,T,function(U){return u[U]}.bind(null,T));return l},s.n=function(u){var x=u&&u.__esModule?function(){return u.default}:function(){return u};return s.d(x,"a",x),x},s.o=function(u,x){return Object.prototype.hasOwnProperty.call(u,x)},s.p="/dist/",s(s.s="./index.js")}({"./index.js":function(r,p,s){var u=s("./src/cos.js");r.exports=u},"./lib/base64.js":function(r,p){var s=function(u){u=u||{};var x=u.Base64,l="2.1.9",T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U=function(w){for(var D={},A=0,N=w.length;A>>6)+K(128|A&63):K(224|A>>>12&15)+K(128|A>>>6&63)+K(128|A&63)}else{var A=65536+(D.charCodeAt(0)-55296)*1024+(D.charCodeAt(1)-56320);return K(240|A>>>18&7)+K(128|A>>>12&63)+K(128|A>>>6&63)+K(128|A&63)}},I=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,z=function(D){return D.replace(I,O)},q=function(D){var A=[0,2,1][D.length%3],N=D.charCodeAt(0)<<16|(D.length>1?D.charCodeAt(1):0)<<8|(D.length>2?D.charCodeAt(2):0),G=[T.charAt(N>>>18),T.charAt(N>>>12&63),A>=2?"=":T.charAt(N>>>6&63),A>=1?"=":T.charAt(N&63)];return G.join("")},X=u.btoa?function(w){return u.btoa(w)}:function(w){return w.replace(/[\s\S]{1,3}/g,q)},F=function(w){return X(z(w))},L=function(D,A){return A?F(String(D)).replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,""):F(String(D))},$=function(D){return L(D,!0)},Y=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),ee=function(D){switch(D.length){case 4:var A=(7&D.charCodeAt(0))<<18|(63&D.charCodeAt(1))<<12|(63&D.charCodeAt(2))<<6|63&D.charCodeAt(3),N=A-65536;return K((N>>>10)+55296)+K((N&1023)+56320);case 3:return K((15&D.charCodeAt(0))<<12|(63&D.charCodeAt(1))<<6|63&D.charCodeAt(2));default:return K((31&D.charCodeAt(0))<<6|63&D.charCodeAt(1))}},B=function(D){return D.replace(Y,ee)},m=function(D){var A=D.length,N=A%4,G=(A>0?U[D.charAt(0)]<<18:0)|(A>1?U[D.charAt(1)]<<12:0)|(A>2?U[D.charAt(2)]<<6:0)|(A>3?U[D.charAt(3)]:0),W=[K(G>>>16),K(G>>>8&255),K(G&255)];return W.length-=[0,0,2,1][N],W.join("")},C=u.atob?function(w){return u.atob(w)}:function(w){return w.replace(/[\s\S]{1,4}/g,m)},V=function(w){return B(C(w))},y=function(D){return V(String(D).replace(/[-_]/g,function(A){return A=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},M=function(){var D=u.Base64;return u.Base64=x,D},j={VERSION:l,atob:C,btoa:X,fromBase64:y,toBase64:L,utob:z,encode:L,encodeURI:$,btou:B,decode:y,noConflict:M};return j}();r.exports=s},"./lib/beacon.min.js":function(r,p,s){var u,x,l=s("./node_modules/@babel/runtime/helpers/typeof.js");(function(T,U){l(p)=="object"&&typeof r<"u"?r.exports=U():(u=U,x=typeof u=="function"?u.call(p,s,p,r):u,x!==void 0&&(r.exports=x))})(this,function(){var T=function(i,o){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,v){a.__proto__=v}||function(a,v){for(var R in v)Object.prototype.hasOwnProperty.call(v,R)&&(a[R]=v[R])},T(i,o)},U=function(){return U=Object.assign||function(i){for(var o,a=1,v=arguments.length;a0&&v[v.length-1])||Q[0]!==6&&Q[0]!==2)){P=0;continue}if(Q[0]===3&&(!v||Q[1]>v[0]&&Q[1]"u"?"3":"4",mainAppKey:this.appkey,appVersion:i,sdkVersion:o.sdkVersion,osVersion:o.userAgent,model:"",packageName:"",params:{A3:o.deviceId}}).then(function(R){if(R.data.ret==0)try{var P=JSON.parse(R.data.beaconConfig);P&&(v.processData(P),v.storage.setItem(F,R.data.beaconConfig))}catch(J){}else v.processData(null),v.storage.setItem(F,"")}).catch(function(R){})},d.prototype.processData=function(i){var o,a,v,R,P;this.strategy.isEventUpOnOff=(o=i==null?void 0:i.isEventUpOnOff)!==null&&o!==void 0?o:this.strategy.isEventUpOnOff,this.strategy.httpsUploadUrl=(a=i==null?void 0:i.httpsUploadUrl)!==null&&a!==void 0?a:this.strategy.httpsUploadUrl,this.strategy.requestInterval=(v=i==null?void 0:i.requestInterval)!==null&&v!==void 0?v:this.strategy.requestInterval,this.strategy.blacklist=(R=i==null?void 0:i.blacklist)!==null&&R!==void 0?R:this.strategy.blacklist,this.strategy.samplelist=(P=i==null?void 0:i.samplelist)!==null&&P!==void 0?P:this.strategy.samplelist;for(var J=0,fe=this.strategy.samplelist;J60*this.strategy.requestInterval*1e3},d.prototype.getUploadUrl=function(){return this.strategy.httpsUploadUrl+"?appkey="+this.appkey},d.prototype.isBlackEvent=function(i){return this.strategy.blacklist.indexOf(i)!=-1},d.prototype.isEventUpOnOff=function(){return this.strategy.isEventUpOnOff},d.prototype.isSampleEvent=function(i){return!!Object.prototype.hasOwnProperty.call(this.realSample,i)&&this.realSample[i]this.duration)return this.createSession();o=v.sessionId,a=v.sessionStart,this.getSessionStackDepth=0}catch(P){}return{sessionId:o,sessionStart:a}},d.prototype.createSession=function(){var i=Date.now(),o={sessionId:this.appkey+"_"+i.toString(),sessionStart:i};this.storage.setItem(M,JSON.stringify(o)),this.storage.setItem(q,i.toString());var a="is_new_user",v=this.storage.getItem(a);return this.getSessionStackDepth<=1&&this.beacon.onDirectUserAction("rqd_applaunched",{A21:v?"N":"Y"}),this.storage.setItem(a,JSON.stringify(!1)),o},d}();function w(){var d=navigator.userAgent,i=d.indexOf("compatible")>-1&&d.indexOf("MSIE")>-1,o=d.indexOf("Edge")>-1&&!i,a=d.indexOf("Trident")>-1&&d.indexOf("rv:11.0")>-1;if(i){new RegExp("MSIE (\\d+\\.\\d+);").test(d);var v=parseFloat(RegExp.$1);return v==7?7:v==8?8:v==9?9:v==10?10:6}return o?-2:a?11:-1}function D(d,i){var o,a;return(o="https://tun-cos-1258344701.file.myqcloud.com/fp.js",a===void 0&&(a=Date.now()+"-"+Math.random()),new Promise(function(v,R){if(document.getElementById(a))v(void 0);else{var P=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,P.removeChild(J),R(fe)},J.src=o,J.id=a,P.appendChild(J)}})).then(function(){new Fingerprint().getQimei36(d,i)}).catch(function(v){}),""}var A=function(){return(A=Object.assign||function(i){for(var o,a=1,v=arguments.length;a0||!window.indexedDB||/X5Lite/.test(navigator.userAgent)?(this.store=new le(o),this.dbEventCount=this.store.getCount()):(this.store=new ie(i),this.getCount().then(function(v){a.dbEventCount=v}).catch(function(v){}))}return d.prototype.getCount=function(){return K(this,void 0,void 0,function(){return O(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.store.getCount()];case 1:return[2,i.sent()];case 2:return i.sent(),[2,Promise.reject()];case 3:return[2]}})})},d.prototype.insertEvent=function(i,o){return K(this,void 0,void 0,function(){var a,v;return O(this,function(R){switch(R.label){case 0:if(this.dbEventCount>=1e4)return[2,Promise.reject()];a=B(i.mapValue),R.label=1;case 1:return R.trys.push([1,3,,4]),this.dbEventCount++,[4,this.store.setItem(a,i)];case 2:return[2,R.sent()];case 3:return v=R.sent(),o&&o(v,i),this.dbEventCount--,[2,Promise.reject()];case 4:return[2]}})})},d.prototype.getEvents=function(){return K(this,void 0,void 0,function(){var i;return O(this,function(o){switch(o.label){case 0:i=[],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.store.iterate(function(a){i.push(a)})];case 2:return o.sent(),[2,Promise.all(i)];case 3:return o.sent(),[2,Promise.all(i)];case 4:return[2]}})})},d.prototype.removeEvent=function(i){return K(this,void 0,void 0,function(){var o;return O(this,function(a){switch(a.label){case 0:o=B(i.mapValue),a.label=1;case 1:return a.trys.push([1,3,,4]),this.dbEventCount--,[4,this.store.removeItem(o)];case 2:return[2,a.sent()];case 3:return a.sent(),this.dbEventCount++,[2,Promise.reject()];case 4:return[2]}})})},d}(),oe=function(){return(oe=Object.assign||function(i){for(var o,a=1,v=arguments.length;a0&&v[v.length-1])||Q[0]!==6&&Q[0]!==2)){P=0;continue}if(Q[0]===3&&(!v||Q[1]>v[0]&&Q[1]0&&P<8,a.isUnderIE8||(a.isUnderIE=P>0,o.needInitQimei&&D(o.appkey,function(J){a.qimei36=J.q36}),a.network=new _e(o),a.storage=new je(o.appkey),a.initCommonInfo(o),a.store=new ae(o.appkey,a.storage),a.errorReport=new V(a.config,a.commonInfo,"web",a.network),a.strategy=new y(o.needQueryConfig==null||o.needQueryConfig,a.config,a.commonInfo,a.storage,a.network),a.logidStartTime=a.storage.getItem(Ue),a.logidStartTime||(a.logidStartTime=Date.now().toString(),a.storage.setItem(Ue,a.logidStartTime)),v=a.logidStartTime,R=Date.now()-Number.parseFloat(v),Math.floor(R/864e5)>=365&&a.storage.clear(),a.initSession(o),a.onDirectUserAction("rqd_js_init",{}),setTimeout(function(){return a.lifeCycle.emit("init")},0),a.initDelayTime=o.delay?o.delay:1e3,a.cycleTask(a.initDelayTime)),a}return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function v(){this.constructor=o}T(o,a),o.prototype=a===null?Object.create(a):(v.prototype=a.prototype,new v)}(i,d),i.prototype.initSession=function(o){var a=18e5;o.sessionDuration&&o.sessionDuration>3e4&&(a=o.sessionDuration),this.beaconSession=new j(this.storage,a,this)},i.prototype.initCommonInfo=function(o){var a=Number(this.storage.getItem(q));try{var v=JSON.parse(this.storage.getItem(X));(Date.now()-a>3e4||!v)&&this.storage.setItem(X,JSON.stringify([]))}catch(P){}o.uploadUrl&&(this.uploadUrl=o.uploadUrl+"?appkey="+o.appkey);var R=[window.screen.width,window.screen.height];window.devicePixelRatio&&R.push(window.devicePixelRatio),this.commonInfo={deviceId:this.storage.createDeviceId(),language:navigator&&navigator.language||"zh_CN",query:window.location.search,userAgent:navigator.userAgent,pixel:R.join("*"),channelID:o.channelID?String(o.channelID):"",openid:o.openid?String(o.openid):"",unid:o.unionid?String(o.unionid):"",sdkVersion:se},this.config.appVersion=o.versionCode?String(o.versionCode):"",this.config.strictMode=o.strictMode},i.prototype.cycleTask=function(o){var a=this;this.intervalID=window.setInterval(function(){a.pauseSearching||a.store.getEvents().then(function(v){v.length==0&&(a.pauseSearching=!0);var R=[],P=JSON.parse(a.storage.getItem(X));P||(P=[]),v&&v.forEach(function(J){var fe=B(J.mapValue);P.indexOf(fe)==-1&&(R.push(J),P.push(fe))}),R.length!=0&&(a.storage.setItem(X,JSON.stringify(P)),a._normalLogPipeline(a.assembleData(R)))}).catch(function(v){})},o)},i.prototype.onReport=function(o,a,v){var R=this;if(this.isUnderIE8)this.errorReport.reportError("601","UnderIE8");else{this.pauseSearching=!1;var P=this.generateData(o,a,v);if(v&&this.delayTime==0&&!this.underWeakNet)this._normalLogPipeline(this.assembleData(P));else{var J=P.shift();J&&this.store.insertEvent(J,function(fe){fe&&R.errorReport.reportError("604","insertEvent fail!")}).catch(function(fe){R._normalLogPipeline(R.assembleData(P))})}}},i.prototype.onSendBeacon=function(o,a){if(this.isUnderIE)this.errorReport.reportError("605","UnderIE");else{this.pauseSearching=!1;var v=this.assembleData(this.generateData(o,a,!0));typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.uploadUrl||this.strategy.getUploadUrl(),JSON.stringify(v))}},i.prototype.generateData=function(o,a,v){var R=[],P="4.5.14-web_"+(v?"direct_log_id":"normal_log_id"),J=Number(this.storage.getItem(P));return J=J||1,a=U(U({},a),{A99:v?"Y":"N",A100:J.toString(),A72:se,A88:this.logidStartTime}),J++,this.storage.setItem(P,J.toString()),R.push({eventCode:o,eventTime:Date.now().toString(),mapValue:Y(a,this.config.strictMode)}),R},i.prototype.assembleData=function(o){var a=this.beaconSession.getSession();return{appVersion:this.config.appVersion?ee(this.config.appVersion):"",sdkId:"js",sdkVersion:se,mainAppKey:this.config.appkey,platformId:3,common:Y(U(U({},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:a.sessionId,A101:this.commonInfo.userAgent,A102:window.location.href,A104:document.referrer,A119:this.commonInfo.query,A153:this.qimei36}),!1),events:o}},i.prototype.monitorUploadFailed=function(){this.uselessCycleTaskNum++,this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(6e4),this.underWeakNet=!0)},i.prototype.doCustomCycleTask=function(){this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(this.initDelayTime)),this.uselessCycleTaskNum=0,this.underWeakNet=!1},i}(C)})},"./lib/crypto.js":function(r,p,s){(function(u){var x=s("./node_modules/@babel/runtime/helpers/typeof.js"),l=l||function(T,U){var K={},O=K.lib={},I=function(){},z=O.Base={extend:function(m){I.prototype=this;var C=new I;return m&&C.mixIn(m),C.hasOwnProperty("init")||(C.init=function(){C.$super.init.apply(this,arguments)}),C.init.prototype=C,C.$super=this,C},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var C in m)m.hasOwnProperty(C)&&(this[C]=m[C]);m.hasOwnProperty("toString")&&(this.toString=m.toString)},clone:function(){return this.init.prototype.extend(this)}},q=O.WordArray=z.extend({init:function(m,C){m=this.words=m||[],this.sigBytes=C!=U?C:4*m.length},toString:function(m){return(m||F).stringify(this)},concat:function(m){var C=this.words,V=m.words,y=this.sigBytes;if(m=m.sigBytes,this.clamp(),y%4)for(var M=0;M>>2]|=(V[M>>>2]>>>24-8*(M%4)&255)<<24-8*((y+M)%4);else if(65535>>2]=V[M>>>2];else C.push.apply(C,V);return this.sigBytes+=m,this},clamp:function(){var m=this.words,C=this.sigBytes;m[C>>>2]&=4294967295<<32-8*(C%4),m.length=T.ceil(C/4)},clone:function(){var m=z.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var C=[],V=0;V>>2]>>>24-8*(y%4)&255;V.push((M>>>4).toString(16)),V.push((M&15).toString(16))}return V.join("")},parse:function(m){for(var C=m.length,V=[],y=0;y>>3]|=parseInt(m.substr(y,2),16)<<24-4*(y%8);return new q.init(V,C/2)}},L=X.Latin1={stringify:function(m){var C=m.words;m=m.sigBytes;for(var V=[],y=0;y>>2]>>>24-8*(y%4)&255));return V.join("")},parse:function(m){for(var C=m.length,V=[],y=0;y>>2]|=(m.charCodeAt(y)&255)<<24-8*(y%4);return new q.init(V,C)}},$=X.Utf8={stringify:function(m){try{return decodeURIComponent(escape(L.stringify(m)))}catch(C){throw Error("Malformed UTF-8 data")}},parse:function(m){return L.parse(unescape(encodeURIComponent(m)))}},Y=O.BufferedBlockAlgorithm=z.extend({reset:function(){this._data=new q.init,this._nDataBytes=0},_append:function(m){typeof m=="string"&&(m=$.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes},_process:function(m){var C=this._data,V=C.words,y=C.sigBytes,M=this.blockSize,j=y/(4*M),j=m?T.ceil(j):T.max((j|0)-this._minBufferSize,0);if(m=j*M,y=T.min(4*m,y),m){for(var w=0;wm;m++){if(16>m)O[m]=q[X+m]|0;else{var C=O[m-3]^O[m-8]^O[m-14]^O[m-16];O[m]=C<<1|C>>>31}C=(L<<5|L>>>27)+B+O[m],C=20>m?C+(($&Y|~$&ee)+1518500249):40>m?C+(($^Y^ee)+1859775393):60>m?C+(($&Y|$&ee|Y&ee)-1894007588):C+(($^Y^ee)-899497514),B=ee,ee=Y,Y=$<<30|$>>>2,$=L,L=C}F[0]=F[0]+L|0,F[1]=F[1]+$|0,F[2]=F[2]+Y|0,F[3]=F[3]+ee|0,F[4]=F[4]+B|0},_doFinalize:function(){var q=this._data,X=q.words,F=8*this._nDataBytes,L=8*q.sigBytes;return X[L>>>5]|=128<<24-L%32,X[(L+64>>>9<<4)+14]=Math.floor(F/4294967296),X[(L+64>>>9<<4)+15]=F,q.sigBytes=4*X.length,this._process(),this._hash},clone:function(){var q=K.clone.call(this);return q._hash=this._hash.clone(),q}});T.SHA1=K._createHelper(I),T.HmacSHA1=K._createHmacHelper(I)})(),function(){var T=l,U=T.enc.Utf8;T.algo.HMAC=T.lib.Base.extend({init:function(O,I){O=this._hasher=new O.init,typeof I=="string"&&(I=U.parse(I));var z=O.blockSize,q=4*z;I.sigBytes>q&&(I=O.finalize(I)),I.clamp();for(var X=this._oKey=I.clone(),F=this._iKey=I.clone(),L=X.words,$=F.words,Y=0;Y>>2]>>>24-$%4*8&255,ee=q[$+1>>>2]>>>24-($+1)%4*8&255,B=q[$+2>>>2]>>>24-($+2)%4*8&255,m=Y<<16|ee<<8|B,C=0;C<4&&$+C*.75>>6*(3-C)&63));var V=F.charAt(64);if(V)for(;L.length%4;)L.push(V);return L.join("")},parse:function(z){var q=z.length,X=this._map,F=X.charAt(64);if(F){var L=z.indexOf(F);L!=-1&&(q=L)}for(var $=[],Y=0,ee=0;ee>>6-ee%4*2;$[Y>>>2]|=(B|m)<<24-Y%4*8,Y++}return K.create($,Y)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),x(u)==="object"?u.exports=l:window.CryptoJS=l}).call(this,s("./node_modules/webpack/buildin/module.js")(r))},"./lib/json2xml.js":function(r,p,s){var u=s("./node_modules/@babel/runtime/helpers/typeof.js"),x="a-zA-Z_À-ÖØ-öø-ÿͰ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�",l="-.0-9·̀-ͯ‿⁀",T=new RegExp("^([^"+x+"])|^((x|X)(m|M)(l|L))|([^"+x+l+"])","g"),U=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,K=function(X){var F=[];if(X instanceof Object)for(var L in X)X.hasOwnProperty(L)&&F.push(L);return F},O=function(X,F){var L=function(Y,ee,B,m,C){var V=F.indent!==void 0?F.indent:" ",y=F.prettyPrint?`
`+new Array(m).join(V):"";F.removeIllegalNameCharacters&&(Y=Y.replace(T,"_"));var M=[y,"<",Y,B||""];return ee&&ee.length>0?(M.push(">"),M.push(ee),C&&M.push(y),M.push(""),M.push(Y),M.push(">")):M.push("/>"),M.join("")};return function $(Y,ee,B){var m=u(Y);switch((Array.isArray?Array.isArray(Y):Y instanceof Array)?m="array":Y instanceof Date&&(m="date"),m){case"array":var C=[];return Y.map(function(j){C.push($(j,1,B+1))}),F.prettyPrint&&C.push(`
`),C.join("");case"date":return Y.toJSON?Y.toJSON():Y+"";case"object":var V=[];for(var y in Y)if(Y.hasOwnProperty(y))if(Y[y]instanceof Array)for(var M=0;M0&&V.push(`
`),V.join("");case"function":return Y();default:return F.escape?z(Y):""+Y}}(X,0,0)},I=function(X){var F=['"),F.join("")};function z(q){return(""+q).replace(/&/g,"&").replace(/
/g,">").replace(/'/g,"'").replace(/"/g,""").replace(U,"")}r.exports=function(q,X){if(X||(X={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),typeof q=="string")try{q=JSON.parse(q.toString())}catch(Y){return!1}var F="",L="";X&&(u(X)=="object"?(X.xmlHeader&&(F=I(!!X.xmlHeader.standalone)),typeof X.docType<"u"&&(L="")):F=I()),X=X||{};var $=[F,X.prettyPrint&&L?`
`:"",L,O(q,X)];return $.join("").replace(/\n{2,}/g,`
`).replace(/\s+$/g,"")}},"./lib/md5.js":function(module,exports,__webpack_require__){(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");(function(){var ERROR="input is invalid type",WINDOW=(typeof window>"u"?"undefined":_typeof(window))==="object",root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&(typeof self>"u"?"undefined":_typeof(self))==="object",NODE_JS=!root.JS_MD5_NO_NODE_JS&&(typeof process>"u"?"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<"u",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(r){return Object.prototype.toString.call(r)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return _typeof(r)==="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});var createOutputMethod=function(p){return function(s,u){return new Md5(!0).update(s,u)[p]()}},createMethod=function(){var p=createOutputMethod("hex");NODE_JS&&(p=nodeWrap(p)),p.getCtx=p.create=function(){return new Md5},p.update=function(x){return p.create().update(x)};for(var s=0;s>6,U[x++]=128|s&63):s<55296||s>=57344?(U[x++]=224|s>>12,U[x++]=128|s>>6&63,U[x++]=128|s&63):(s=65536+((s&1023)<<10|r.charCodeAt(++u)&1023),U[x++]=240|s>>18,U[x++]=128|s>>12&63,U[x++]=128|s>>6&63,U[x++]=128|s&63);else for(x=this.start;u>2]|=s<>2]|=(192|s>>6)<>2]|=(128|s&63)<=57344?(T[x>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|s&63)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|s&63)<=64?(this.start=x-64,this.hash(),this.hashed=!0):this.start=x}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 r=this.blocks,p=this.lastByteIndex;r[p>>2]|=EXTRA[p&3],p>=56&&(this.hashed||this.hash(),r[0]=r[16],r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),r[14]=this.bytes<<3,r[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var r,p,s,u,x,l,T=this.blocks;this.first?(r=T[0]-680876937,r=(r<<7|r>>>25)-271733879<<0,u=(-1732584194^r&2004318071)+T[1]-117830708,u=(u<<12|u>>>20)+r<<0,s=(-271733879^u&(r^-271733879))+T[2]-1126478375,s=(s<<17|s>>>15)+u<<0,p=(r^s&(u^r))+T[3]-1316259209,p=(p<<22|p>>>10)+s<<0):(r=this.h0,p=this.h1,s=this.h2,u=this.h3,r+=(u^p&(s^u))+T[0]-680876936,r=(r<<7|r>>>25)+p<<0,u+=(s^r&(p^s))+T[1]-389564586,u=(u<<12|u>>>20)+r<<0,s+=(p^u&(r^p))+T[2]+606105819,s=(s<<17|s>>>15)+u<<0,p+=(r^s&(u^r))+T[3]-1044525330,p=(p<<22|p>>>10)+s<<0),r+=(u^p&(s^u))+T[4]-176418897,r=(r<<7|r>>>25)+p<<0,u+=(s^r&(p^s))+T[5]+1200080426,u=(u<<12|u>>>20)+r<<0,s+=(p^u&(r^p))+T[6]-1473231341,s=(s<<17|s>>>15)+u<<0,p+=(r^s&(u^r))+T[7]-45705983,p=(p<<22|p>>>10)+s<<0,r+=(u^p&(s^u))+T[8]+1770035416,r=(r<<7|r>>>25)+p<<0,u+=(s^r&(p^s))+T[9]-1958414417,u=(u<<12|u>>>20)+r<<0,s+=(p^u&(r^p))+T[10]-42063,s=(s<<17|s>>>15)+u<<0,p+=(r^s&(u^r))+T[11]-1990404162,p=(p<<22|p>>>10)+s<<0,r+=(u^p&(s^u))+T[12]+1804603682,r=(r<<7|r>>>25)+p<<0,u+=(s^r&(p^s))+T[13]-40341101,u=(u<<12|u>>>20)+r<<0,s+=(p^u&(r^p))+T[14]-1502002290,s=(s<<17|s>>>15)+u<<0,p+=(r^s&(u^r))+T[15]+1236535329,p=(p<<22|p>>>10)+s<<0,r+=(s^u&(p^s))+T[1]-165796510,r=(r<<5|r>>>27)+p<<0,u+=(p^s&(r^p))+T[6]-1069501632,u=(u<<9|u>>>23)+r<<0,s+=(r^p&(u^r))+T[11]+643717713,s=(s<<14|s>>>18)+u<<0,p+=(u^r&(s^u))+T[0]-373897302,p=(p<<20|p>>>12)+s<<0,r+=(s^u&(p^s))+T[5]-701558691,r=(r<<5|r>>>27)+p<<0,u+=(p^s&(r^p))+T[10]+38016083,u=(u<<9|u>>>23)+r<<0,s+=(r^p&(u^r))+T[15]-660478335,s=(s<<14|s>>>18)+u<<0,p+=(u^r&(s^u))+T[4]-405537848,p=(p<<20|p>>>12)+s<<0,r+=(s^u&(p^s))+T[9]+568446438,r=(r<<5|r>>>27)+p<<0,u+=(p^s&(r^p))+T[14]-1019803690,u=(u<<9|u>>>23)+r<<0,s+=(r^p&(u^r))+T[3]-187363961,s=(s<<14|s>>>18)+u<<0,p+=(u^r&(s^u))+T[8]+1163531501,p=(p<<20|p>>>12)+s<<0,r+=(s^u&(p^s))+T[13]-1444681467,r=(r<<5|r>>>27)+p<<0,u+=(p^s&(r^p))+T[2]-51403784,u=(u<<9|u>>>23)+r<<0,s+=(r^p&(u^r))+T[7]+1735328473,s=(s<<14|s>>>18)+u<<0,p+=(u^r&(s^u))+T[12]-1926607734,p=(p<<20|p>>>12)+s<<0,x=p^s,r+=(x^u)+T[5]-378558,r=(r<<4|r>>>28)+p<<0,u+=(x^r)+T[8]-2022574463,u=(u<<11|u>>>21)+r<<0,l=u^r,s+=(l^p)+T[11]+1839030562,s=(s<<16|s>>>16)+u<<0,p+=(l^s)+T[14]-35309556,p=(p<<23|p>>>9)+s<<0,x=p^s,r+=(x^u)+T[1]-1530992060,r=(r<<4|r>>>28)+p<<0,u+=(x^r)+T[4]+1272893353,u=(u<<11|u>>>21)+r<<0,l=u^r,s+=(l^p)+T[7]-155497632,s=(s<<16|s>>>16)+u<<0,p+=(l^s)+T[10]-1094730640,p=(p<<23|p>>>9)+s<<0,x=p^s,r+=(x^u)+T[13]+681279174,r=(r<<4|r>>>28)+p<<0,u+=(x^r)+T[0]-358537222,u=(u<<11|u>>>21)+r<<0,l=u^r,s+=(l^p)+T[3]-722521979,s=(s<<16|s>>>16)+u<<0,p+=(l^s)+T[6]+76029189,p=(p<<23|p>>>9)+s<<0,x=p^s,r+=(x^u)+T[9]-640364487,r=(r<<4|r>>>28)+p<<0,u+=(x^r)+T[12]-421815835,u=(u<<11|u>>>21)+r<<0,l=u^r,s+=(l^p)+T[15]+530742520,s=(s<<16|s>>>16)+u<<0,p+=(l^s)+T[2]-995338651,p=(p<<23|p>>>9)+s<<0,r+=(s^(p|~u))+T[0]-198630844,r=(r<<6|r>>>26)+p<<0,u+=(p^(r|~s))+T[7]+1126891415,u=(u<<10|u>>>22)+r<<0,s+=(r^(u|~p))+T[14]-1416354905,s=(s<<15|s>>>17)+u<<0,p+=(u^(s|~r))+T[5]-57434055,p=(p<<21|p>>>11)+s<<0,r+=(s^(p|~u))+T[12]+1700485571,r=(r<<6|r>>>26)+p<<0,u+=(p^(r|~s))+T[3]-1894986606,u=(u<<10|u>>>22)+r<<0,s+=(r^(u|~p))+T[10]-1051523,s=(s<<15|s>>>17)+u<<0,p+=(u^(s|~r))+T[1]-2054922799,p=(p<<21|p>>>11)+s<<0,r+=(s^(p|~u))+T[8]+1873313359,r=(r<<6|r>>>26)+p<<0,u+=(p^(r|~s))+T[15]-30611744,u=(u<<10|u>>>22)+r<<0,s+=(r^(u|~p))+T[6]-1560198380,s=(s<<15|s>>>17)+u<<0,p+=(u^(s|~r))+T[13]+1309151649,p=(p<<21|p>>>11)+s<<0,r+=(s^(p|~u))+T[4]-145523070,r=(r<<6|r>>>26)+p<<0,u+=(p^(r|~s))+T[11]-1120210379,u=(u<<10|u>>>22)+r<<0,s+=(r^(u|~p))+T[2]+718787259,s=(s<<15|s>>>17)+u<<0,p+=(u^(s|~r))+T[9]-343485551,p=(p<<21|p>>>11)+s<<0,this.first?(this.h0=r+1732584193<<0,this.h1=p-271733879<<0,this.h2=s-1732584194<<0,this.h3=u+271733878<<0,this.first=!1):(this.h0=this.h0+r<<0,this.h1=this.h1+p<<0,this.h2=this.h2+s<<0,this.h3=this.h3+u<<0)},Md5.prototype.hex=function(){this.finalize();var r=this.h0,p=this.h1,s=this.h2,u=this.h3;return HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[p>>4&15]+HEX_CHARS[p&15]+HEX_CHARS[p>>12&15]+HEX_CHARS[p>>8&15]+HEX_CHARS[p>>20&15]+HEX_CHARS[p>>16&15]+HEX_CHARS[p>>28&15]+HEX_CHARS[p>>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[u>>4&15]+HEX_CHARS[u&15]+HEX_CHARS[u>>12&15]+HEX_CHARS[u>>8&15]+HEX_CHARS[u>>20&15]+HEX_CHARS[u>>16&15]+HEX_CHARS[u>>28&15]+HEX_CHARS[u>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(r){if(r==="hex")return this.hex();this.finalize();var p=this.h0,s=this.h1,u=this.h2,x=this.h3,l=[p&255,p>>8&255,p>>16&255,p>>24&255,s&255,s>>8&255,s>>16&255,s>>24&255,u&255,u>>8&255,u>>16&255,u>>24&255,x&255,x>>8&255,x>>16&255,x>>24&255];return l},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var r=new ArrayBuffer(16),p=new Uint32Array(r);return p[0]=this.h0,p[1]=this.h1,p[2]=this.h2,p[3]=this.h3,r},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var r,p,s,u="",x=this.array(),l=0;l<15;)r=x[l++],p=x[l++],s=x[l++],u+=BASE64_ENCODE_CHAR[r>>>2]+BASE64_ENCODE_CHAR[(r<<4|p>>>4)&63]+BASE64_ENCODE_CHAR[(p<<2|s>>>6)&63]+BASE64_ENCODE_CHAR[s&63];return r=x[l],u+=BASE64_ENCODE_CHAR[r>>>2]+BASE64_ENCODE_CHAR[r<<4&63]+"==",u};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(r,p,s){var u=s("./node_modules/@babel/runtime/helpers/typeof.js"),x=function(I){switch(u(I)){case"string":return I;case"boolean":return I?"true":"false";case"number":return isFinite(I)?I:"";default:return""}},l=function(I,z,q,X){return z=z||"&",q=q||"=",I===null&&(I=void 0),u(I)==="object"?Object.keys(I).map(function(F){var L=encodeURIComponent(x(F))+q;return Array.isArray(I[F])?I[F].map(function($){return L+encodeURIComponent(x($))}).join(z):L+encodeURIComponent(x(I[F]))}).filter(Boolean).join(z):X?encodeURIComponent(x(X))+q+encodeURIComponent(x(I)):""},T=function(I,z,q){var X={};return z.getAllResponseHeaders().trim().split(`
`).forEach(function(F){if(F){var L=F.indexOf(":"),$=F.substr(0,L).trim().toLowerCase(),Y=F.substr(L+1).trim();X[$]=Y}}),{error:I,statusCode:z.status,statusMessage:z.statusText,headers:X,body:q}},U=function(I,z){return!z&&z==="text"?I.responseText:I.response},K=function(I,z){var q=(I.method||"GET").toUpperCase(),X=I.url;if(I.qs){var F=l(I.qs);F&&(X+=(X.indexOf("?")===-1?"?":"&")+F)}var L=new XMLHttpRequest;if(L.open(q,X,!0),L.responseType=I.dataType||"text",I.xhrFields)for(var $ in I.xhrFields)L[$]=I.xhrFields[$];var Y=I.headers;if(Y)for(var ee in Y)Y.hasOwnProperty(ee)&&ee.toLowerCase()!=="content-length"&&ee.toLowerCase()!=="user-agent"&&ee.toLowerCase()!=="origin"&&ee.toLowerCase()!=="host"&&L.setRequestHeader(ee,Y[ee]);return I.onProgress&&L.upload&&(L.upload.onprogress=I.onProgress),I.onDownloadProgress&&(L.onprogress=I.onDownloadProgress),I.timeout&&(L.timeout=I.timeout),L.ontimeout=function(B){var m=new Error("timeout");z(T(m,L))},L.onload=function(){z(T(null,L,U(L,I.dataType)))},L.onerror=function(B){var m=U(L,I.dataType);if(m)z(T(null,L,m));else{var C=L.statusText;!C&&L.status===0&&(C=new Error("CORS blocked or network error")),z(T(C,L,m))}},L.send(I.body||""),L};r.exports=K},"./lib/xml2json.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/index.js").DOMParser,x=function(){this.version="1.3.5";var T={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},U=new RegExp(/(?!xmlns)^.*:/);return this.grokType=function(K){return/^\s*$/.test(K)?null:/^(?:true|false)$/i.test(K)?K.toLowerCase()==="true":isFinite(K)?parseFloat(K):K},this.parseString=function(K,O){if(K){var I=this.stringToXML(K);return I.getElementsByTagName("parsererror").length?null:this.parseXML(I,O)}else return null},this.parseXML=function(K,O){for(var I in O)T[I]=O[I];var z={},q=0,X="",F=K.childNodes.length;if(F)for(var L,$,Y,ee=0;ee=m+C||m?new java.lang.String(B,m,C)+"":B}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(B){F.prototype[B]=function(){return null}});function ee(B,m){B.currentElement?B.currentElement.appendChild(m):B.doc.appendChild(m)}p.__DOMHandler=F,p.normalizeLineEndings=z,p.DOMParser=q},"./node_modules/@xmldom/xmldom/lib/dom.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/conventions.js"),x=u.find,l=u.NAMESPACE;function T(c){return c!==""}function U(c){return c?c.split(/[\t\n\f\r ]+/).filter(T):[]}function K(c,h){return c.hasOwnProperty(h)||(c[h]=!0),c}function O(c){if(!c)return[];var h=U(c);return Object.keys(h.reduce(K,{}))}function I(c){return function(h){return c&&c.indexOf(h)!==-1}}function z(c,h){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(h[b]=c[b])}function q(c,h){var b=c.prototype;if(!(b instanceof h)){let H=function(){};H.prototype=h.prototype,H=new H,z(b,H),c.prototype=b=H}b.constructor!=c&&(typeof c!="function"&&console.error("unknown Class:"+c),b.constructor=c)}var X={},F=X.ELEMENT_NODE=1,L=X.ATTRIBUTE_NODE=2,$=X.TEXT_NODE=3,Y=X.CDATA_SECTION_NODE=4,ee=X.ENTITY_REFERENCE_NODE=5,B=X.ENTITY_NODE=6,m=X.PROCESSING_INSTRUCTION_NODE=7,C=X.COMMENT_NODE=8,V=X.DOCUMENT_NODE=9,y=X.DOCUMENT_TYPE_NODE=10,M=X.DOCUMENT_FRAGMENT_NODE=11,j=X.NOTATION_NODE=12,w={},D={};w.INDEX_SIZE_ERR=(D[1]="Index size error",1),w.DOMSTRING_SIZE_ERR=(D[2]="DOMString size error",2);var A=w.HIERARCHY_REQUEST_ERR=(D[3]="Hierarchy request error",3);w.WRONG_DOCUMENT_ERR=(D[4]="Wrong document",4),w.INVALID_CHARACTER_ERR=(D[5]="Invalid character",5),w.NO_DATA_ALLOWED_ERR=(D[6]="No data allowed",6),w.NO_MODIFICATION_ALLOWED_ERR=(D[7]="No modification allowed",7);var N=w.NOT_FOUND_ERR=(D[8]="Not found",8);w.NOT_SUPPORTED_ERR=(D[9]="Not supported",9);var G=w.INUSE_ATTRIBUTE_ERR=(D[10]="Attribute in use",10);w.INVALID_STATE_ERR=(D[11]="Invalid state",11),w.SYNTAX_ERR=(D[12]="Syntax error",12),w.INVALID_MODIFICATION_ERR=(D[13]="Invalid modification",13),w.NAMESPACE_ERR=(D[14]="Invalid namespace",14),w.INVALID_ACCESS_ERR=(D[15]="Invalid access",15);function W(c,h){if(h instanceof Error)var b=h;else b=this,Error.call(this,D[c]),this.message=D[c],Error.captureStackTrace&&Error.captureStackTrace(this,W);return b.code=c,h&&(this.message=this.message+": "+h),b}W.prototype=Error.prototype,z(w,W);function Z(){}Z.prototype={length:0,item:function(c){return this[c]||null},toString:function(c,h){for(var b=[],H=0;H=0){for(var he=h.length-1;H0},lookupPrefix:function(c){for(var h=this;h;){var b=h._nsMap;if(b){for(var H in b)if(Object.prototype.hasOwnProperty.call(b,H)&&b[H]===c)return H}h=h.nodeType==L?h.ownerDocument:h.parentNode}return null},lookupNamespaceURI:function(c){for(var h=this;h;){var b=h._nsMap;if(b&&Object.prototype.hasOwnProperty.call(b,c))return b[c];h=h.nodeType==L?h.ownerDocument:h.parentNode}return null},isDefaultNamespace:function(c){var h=this.lookupPrefix(c);return h==null}};function re(c){return c=="<"&&"<"||c==">"&&">"||c=="&"&&"&"||c=='"'&&"""||""+c.charCodeAt()+";"}z(X,te),z(X,te.prototype);function pe(c,h){if(h(c))return!0;if(c=c.firstChild)do if(pe(c,h))return!0;while(c=c.nextSibling)}function Ce(){this.ownerDocument=this}function ve(c,h,b){c&&c._inc++;var H=b.namespaceURI;H===l.XMLNS&&(h._nsMap[b.prefix?b.localName:""]=b.value)}function ye(c,h,b,H){c&&c._inc++;var he=b.namespaceURI;he===l.XMLNS&&delete h._nsMap[b.prefix?b.localName:""]}function Se(c,h,b){if(c&&c._inc){c._inc++;var H=h.childNodes;if(b)H[H.length++]=b;else{for(var he=h.firstChild,Re=0;he;)H[Re++]=he,he=he.nextSibling;H.length=Re,delete H[H.length]}}}function xe(c,h){var b=h.previousSibling,H=h.nextSibling;return b?b.nextSibling=H:c.firstChild=H,H?H.previousSibling=b:c.lastChild=b,h.parentNode=null,h.previousSibling=null,h.nextSibling=null,Se(c.ownerDocument,c),h}function Ee(c){return c&&(c.nodeType===te.DOCUMENT_NODE||c.nodeType===te.DOCUMENT_FRAGMENT_NODE||c.nodeType===te.ELEMENT_NODE)}function Ie(c){return c&&(_e(c)||je(c)||we(c)||c.nodeType===te.DOCUMENT_FRAGMENT_NODE||c.nodeType===te.COMMENT_NODE||c.nodeType===te.PROCESSING_INSTRUCTION_NODE)}function we(c){return c&&c.nodeType===te.DOCUMENT_TYPE_NODE}function _e(c){return c&&c.nodeType===te.ELEMENT_NODE}function je(c){return c&&c.nodeType===te.TEXT_NODE}function Ue(c,h){var b=c.childNodes||[];if(x(b,_e)||we(h))return!1;var H=x(b,we);return!(h&&H&&b.indexOf(H)>b.indexOf(h))}function se(c,h){var b=c.childNodes||[];function H(Re){return _e(Re)&&Re!==h}if(x(b,H))return!1;var he=x(b,we);return!(h&&he&&b.indexOf(he)>b.indexOf(h))}function d(c,h,b){if(!Ee(c))throw new W(A,"Unexpected parent node type "+c.nodeType);if(b&&b.parentNode!==c)throw new W(N,"child not in parent");if(!Ie(h)||we(h)&&c.nodeType!==te.DOCUMENT_NODE)throw new W(A,"Unexpected node type "+h.nodeType+" for parent node type "+c.nodeType)}function i(c,h,b){var H=c.childNodes||[],he=h.childNodes||[];if(h.nodeType===te.DOCUMENT_FRAGMENT_NODE){var Re=he.filter(_e);if(Re.length>1||x(he,je))throw new W(A,"More than one element or text in fragment");if(Re.length===1&&!Ue(c,b))throw new W(A,"Element in fragment can not be inserted before doctype")}if(_e(h)&&!Ue(c,b))throw new W(A,"Only one element can be added and only after doctype");if(we(h)){if(x(H,we))throw new W(A,"Only one doctype is allowed");var Me=x(H,_e);if(b&&H.indexOf(Me)1||x(he,je))throw new W(A,"More than one element or text in fragment");if(Re.length===1&&!se(c,b))throw new W(A,"Element in fragment can not be inserted before doctype")}if(_e(h)&&!se(c,b))throw new W(A,"Only one element can be added and only after doctype");if(we(h)){if(x(H,function(Je){return we(Je)&&Je!==b}))throw new W(A,"Only one doctype is allowed");var Me=x(H,_e);if(b&&H.indexOf(Me)0&&pe(b.documentElement,function(he){if(he!==b&&he.nodeType===F){var Re=he.getAttribute("class");if(Re){var Me=c===Re;if(!Me){var ce=O(Re);Me=h.every(I(ce))}Me&&H.push(he)}}}),H})},createElement:function(c){var h=new R;h.ownerDocument=this,h.nodeName=c,h.tagName=c,h.localName=c,h.childNodes=new Z;var b=h.attributes=new ae;return b._ownerElement=h,h},createDocumentFragment:function(){var c=new Le;return c.ownerDocument=this,c.childNodes=new Z,c},createTextNode:function(c){var h=new fe;return h.ownerDocument=this,h.appendData(c),h},createComment:function(c){var h=new ge;return h.ownerDocument=this,h.appendData(c),h},createCDATASection:function(c){var h=new Q;return h.ownerDocument=this,h.appendData(c),h},createProcessingInstruction:function(c,h){var b=new Ve;return b.ownerDocument=this,b.tagName=b.target=c,b.nodeValue=b.data=h,b},createAttribute:function(c){var h=new P;return h.ownerDocument=this,h.name=c,h.nodeName=c,h.localName=c,h.specified=!0,h},createEntityReference:function(c){var h=new Be;return h.ownerDocument=this,h.nodeName=c,h},createElementNS:function(c,h){var b=new R,H=h.split(":"),he=b.attributes=new ae;return b.childNodes=new Z,b.ownerDocument=this,b.nodeName=h,b.tagName=h,b.namespaceURI=c,H.length==2?(b.prefix=H[0],b.localName=H[1]):b.localName=h,he._ownerElement=b,b},createAttributeNS:function(c,h){var b=new P,H=h.split(":");return b.ownerDocument=this,b.nodeName=h,b.name=h,b.namespaceURI=c,b.specified=!0,H.length==2?(b.prefix=H[0],b.localName=H[1]):b.localName=h,b}},q(Ce,te);function R(){this._nsMap={}}R.prototype={nodeType:F,hasAttribute:function(c){return this.getAttributeNode(c)!=null},getAttribute:function(c){var h=this.getAttributeNode(c);return h&&h.value||""},getAttributeNode:function(c){return this.attributes.getNamedItem(c)},setAttribute:function(c,h){var b=this.ownerDocument.createAttribute(c);b.value=b.nodeValue=""+h,this.setAttributeNode(b)},removeAttribute:function(c){var h=this.getAttributeNode(c);h&&this.removeAttributeNode(h)},appendChild:function(c){return c.nodeType===M?this.insertBefore(c,null):v(this,c)},setAttributeNode:function(c){return this.attributes.setNamedItem(c)},setAttributeNodeNS:function(c){return this.attributes.setNamedItemNS(c)},removeAttributeNode:function(c){return this.attributes.removeNamedItem(c.nodeName)},removeAttributeNS:function(c,h){var b=this.getAttributeNodeNS(c,h);b&&this.removeAttributeNode(b)},hasAttributeNS:function(c,h){return this.getAttributeNodeNS(c,h)!=null},getAttributeNS:function(c,h){var b=this.getAttributeNodeNS(c,h);return b&&b.value||""},setAttributeNS:function(c,h,b){var H=this.ownerDocument.createAttributeNS(c,h);H.value=H.nodeValue=""+b,this.setAttributeNode(H)},getAttributeNodeNS:function(c,h){return this.attributes.getNamedItemNS(c,h)},getElementsByTagName:function(c){return new ie(this,function(h){var b=[];return pe(h,function(H){H!==h&&H.nodeType==F&&(c==="*"||H.tagName==c)&&b.push(H)}),b})},getElementsByTagNameNS:function(c,h){return new ie(this,function(b){var H=[];return pe(b,function(he){he!==b&&he.nodeType===F&&(c==="*"||he.namespaceURI===c)&&(h==="*"||he.localName==h)&&H.push(he)}),H})}},Ce.prototype.getElementsByTagName=R.prototype.getElementsByTagName,Ce.prototype.getElementsByTagNameNS=R.prototype.getElementsByTagNameNS,q(R,te);function P(){}P.prototype.nodeType=L,q(P,te);function J(){}J.prototype={data:"",substringData:function(c,h){return this.data.substring(c,c+h)},appendData:function(c){c=this.data+c,this.nodeValue=this.data=c,this.length=c.length},insertData:function(c,h){this.replaceData(c,0,h)},appendChild:function(c){throw new Error(D[A])},deleteData:function(c,h){this.replaceData(c,h,"")},replaceData:function(c,h,b){var H=this.data.substring(0,c),he=this.data.substring(c+h);b=H+b+he,this.nodeValue=this.data=b,this.length=b.length}},q(J,te);function fe(){}fe.prototype={nodeName:"#text",nodeType:$,splitText:function(c){var h=this.data,b=h.substring(c);h=h.substring(0,c),this.data=this.nodeValue=h,this.length=h.length;var H=this.ownerDocument.createTextNode(b);return this.parentNode&&this.parentNode.insertBefore(H,this.nextSibling),H}},q(fe,J);function ge(){}ge.prototype={nodeName:"#comment",nodeType:C},q(ge,J);function Q(){}Q.prototype={nodeName:"#cdata-section",nodeType:Y},q(Q,J);function Te(){}Te.prototype.nodeType=y,q(Te,te);function Ne(){}Ne.prototype.nodeType=j,q(Ne,te);function Fe(){}Fe.prototype.nodeType=B,q(Fe,te);function Be(){}Be.prototype.nodeType=ee,q(Be,te);function Le(){}Le.prototype.nodeName="#document-fragment",Le.prototype.nodeType=M,q(Le,te);function Ve(){}Ve.prototype.nodeType=m,q(Ve,te);function Ge(){}Ge.prototype.serializeToString=function(c,h,b){return We.call(c,h,b)},te.prototype.toString=We;function We(c,h){var b=[],H=this.nodeType==9&&this.documentElement||this,he=H.prefix,Re=H.namespaceURI;if(Re&&he==null){var he=H.lookupPrefix(Re);if(he==null)var Me=[{namespace:Re,prefix:null}]}return Ye(this,b,c,h,Me),b.join("")}function qe(c,h,b){var H=c.prefix||"",he=c.namespaceURI;if(!he||H==="xml"&&he===l.XML||he===l.XMLNS)return!1;for(var Re=b.length;Re--;){var Me=b[Re];if(Me.prefix===H)return Me.namespace!==he}return!0}function Xe(c,h,b){c.push(" ",h,'="',b.replace(/[<>&"\t\n\r]/g,re),'"')}function Ye(c,h,b,H,he){if(he||(he=[]),H)if(c=H(c),c){if(typeof c=="string"){h.push(c);return}}else return;switch(c.nodeType){case F:var Re=c.attributes,Me=Re.length,E=c.firstChild,ce=c.tagName;b=l.isHTML(c.namespaceURI)||b;var Je=ce;if(!b&&!c.prefix&&c.namespaceURI){for(var Qe,Ze=0;Ze=0;e--){var g=he[e];if(g.prefix===""&&g.namespace===c.namespaceURI){Qe=g.namespace;break}}if(Qe!==c.namespaceURI)for(var e=he.length-1;e>=0;e--){var g=he[e];if(g.namespace===c.namespaceURI){g.prefix&&(Je=g.prefix+":"+ce);break}}}h.push("<",Je);for(var n=0;n"),b&&/^script$/i.test(ce))for(;E;)E.data?h.push(E.data):Ye(E,h,b,H,he.slice()),E=E.nextSibling;else for(;E;)Ye(E,h,b,H,he.slice()),E=E.nextSibling;h.push("",Je,">")}else h.push("/>");return;case V:case M:for(var E=c.firstChild;E;)Ye(E,h,b,H,he.slice()),E=E.nextSibling;return;case L:return Xe(h,c.name,c.value);case $:return h.push(c.data.replace(/[<&>]/g,re));case Y:return h.push("");case C:return h.push("");case y:var _=c.publicId,ne=c.systemId;if(h.push("");else if(ne&&ne!=".")h.push(" SYSTEM ",ne,">");else{var Oe=c.internalSubset;Oe&&h.push(" [",Oe,"]"),h.push(">")}return;case m:return h.push("",c.target," ",c.data,"?>");case ee:return h.push("&",c.nodeName,";");default:h.push("??",c.nodeName)}}function ot(c,h,b){var H;switch(h.nodeType){case F:H=h.cloneNode(!1),H.ownerDocument=c;case M:break;case L:b=!0;break}if(H||(H=h.cloneNode(!1)),H.ownerDocument=c,H.parentNode=null,b)for(var he=h.firstChild;he;)H.appendChild(ot(c,he,b)),he=he.nextSibling;return H}function tt(c,h,b){var H=new h.constructor;for(var he in h)if(Object.prototype.hasOwnProperty.call(h,he)){var Re=h[he];typeof Re!="object"&&Re!=H[he]&&(H[he]=Re)}switch(h.childNodes&&(H.childNodes=new Z),H.ownerDocument=c,H.nodeType){case F:var Me=h.attributes,ce=H.attributes=new ae,Je=Me.length;ce._ownerElement=H;for(var Qe=0;Qe",lt:"<",quot:'"'}),p.HTML_ENTITIES=u({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),p.entityMap=p.HTML_ENTITIES},"./node_modules/@xmldom/xmldom/lib/index.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/dom.js");p.DOMImplementation=u.DOMImplementation,p.XMLSerializer=u.XMLSerializer,p.DOMParser=s("./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser},"./node_modules/@xmldom/xmldom/lib/sax.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/conventions.js").NAMESPACE,x=/[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]/,l=new RegExp("[\\-\\.0-9"+x.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),T=new RegExp("^"+x.source+l.source+"*(?::"+x.source+l.source+"*)?$"),U=0,K=1,O=2,I=3,z=4,q=5,X=6,F=7;function L(A,N){this.message=A,this.locator=N,Error.captureStackTrace&&Error.captureStackTrace(this,L)}L.prototype=new Error,L.prototype.name=L.name;function $(){}$.prototype={parse:function(A,N,G){var W=this.domBuilder;W.startDocument(),y(N,N={}),Y(A,N,G,W,this.errorHandler),W.endDocument()}};function Y(A,N,G,W,Z){function ie(R){if(R>65535){R-=65536;var P=55296+(R>>10),J=56320+(R&1023);return String.fromCharCode(P,J)}else return String.fromCharCode(R)}function le(R){var P=R.slice(1,-1);return Object.hasOwnProperty.call(G,P)?G[P]:P.charAt(0)==="#"?ie(parseInt(P.substr(1).replace("x","0x"))):(Z.error("entity not found:"+R),R)}function ae(R){if(R>Ce){var P=A.substring(Ce,R).replace(/?\w+;/g,le);te&&oe(Ce),W.characters(P,0,R-Ce),Ce=R}}function oe(R,P){for(;R>=ue&&(P=me.exec(A));)de=P.index,ue=de+P[0].length,te.lineNumber++;te.columnNumber=R-de+1}for(var de=0,ue=0,me=/.*(?:\r\n?|\n)|.*$/g,te=W.locator,re=[{currentNSMap:N}],pe={},Ce=0;;){try{var ve=A.indexOf("<",Ce);if(ve<0){if(!A.substr(Ce).match(/^\s*$/)){var ye=W.doc,Se=ye.createTextNode(A.substr(Ce));ye.appendChild(Se),W.currentElement=Se}return}switch(ve>Ce&&ae(ve),A.charAt(ve+1)){case"/":var d=A.indexOf(">",ve+3),xe=A.substring(ve+2,d).replace(/[ \t\n\r]+$/g,""),Ee=re.pop();d<0?(xe=A.substring(ve+2).replace(/[\s<].*/,""),Z.error("end tag name: "+xe+" is not complete:"+Ee.tagName),d=ve+1+xe.length):xe.match(/\s)&&(xe=xe.replace(/[\s<].*/,""),Z.error("end tag name: "+xe+" maybe not complete"),d=ve+1+xe.length);var Ie=Ee.localNSMap,we=Ee.tagName==xe,_e=we||Ee.tagName&&Ee.tagName.toLowerCase()==xe.toLowerCase();if(_e){if(W.endElement(Ee.uri,Ee.localName,xe),Ie)for(var je in Ie)Object.prototype.hasOwnProperty.call(Ie,je)&&W.endPrefixMapping(je);we||Z.fatalError("end tag name: "+xe+" is not match the current start tagName:"+Ee.tagName)}else re.push(Ee);d++;break;case"?":te&&oe(ve),d=j(A,ve,W);break;case"!":te&&oe(ve),d=M(A,ve,W,Z);break;default:te&&oe(ve);var Ue=new w,se=re[re.length-1].currentNSMap,d=B(A,ve,Ue,se,le,Z),i=Ue.length;if(!Ue.closed&&V(A,d,Ue.tagName,pe)&&(Ue.closed=!0,G.nbsp||Z.warning("unclosed xml attribute")),te&&i){for(var o=ee(te,{}),a=0;aCe?Ce=d:ae(Math.max(ve,Ce)+1)}}function ee(A,N){return N.lineNumber=A.lineNumber,N.columnNumber=A.columnNumber,N}function B(A,N,G,W,Z,ie){function le(te,re,pe){G.attributeNames.hasOwnProperty(te)&&ie.fatalError("Attribute "+te+" redefined"),G.addValue(te,re.replace(/[\t\n\r]/g," ").replace(/?\w+;/g,Z),pe)}for(var ae,oe,de=++N,ue=U;;){var me=A.charAt(de);switch(me){case"=":if(ue===K)ae=A.slice(N,de),ue=I;else if(ue===O)ue=I;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ue===I||ue===K)if(ue===K&&(ie.warning('attribute value must after "="'),ae=A.slice(N,de)),N=de+1,de=A.indexOf(me,N),de>0)oe=A.slice(N,de),le(ae,oe,N-1),ue=q;else throw new Error("attribute value no end '"+me+"' match");else if(ue==z)oe=A.slice(N,de),le(ae,oe,N),ie.warning('attribute "'+ae+'" missed start quot('+me+")!!"),N=de+1,ue=q;else throw new Error('attribute value must after "="');break;case"/":switch(ue){case U:G.setTagName(A.slice(N,de));case q:case X:case F:ue=F,G.closed=!0;case z:case K:case O:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return ie.error("unexpected end of input"),ue==U&&G.setTagName(A.slice(N,de)),de;case">":switch(ue){case U:G.setTagName(A.slice(N,de));case q:case X:case F:break;case z:case K:oe=A.slice(N,de),oe.slice(-1)==="/"&&(G.closed=!0,oe=oe.slice(0,-1));case O:ue===O&&(oe=ae),ue==z?(ie.warning('attribute "'+oe+'" missed quot(")!'),le(ae,oe,N)):((!u.isHTML(W[""])||!oe.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+oe+'" missed value!! "'+oe+'" instead!!'),le(oe,oe,N));break;case I:throw new Error("attribute value missed!!")}return de;case"":me=" ";default:if(me<=" ")switch(ue){case U:G.setTagName(A.slice(N,de)),ue=X;break;case K:ae=A.slice(N,de),ue=O;break;case z:var oe=A.slice(N,de);ie.warning('attribute "'+oe+'" missed quot(")!!'),le(ae,oe,N);case q:ue=X;break}else switch(ue){case O:G.tagName,(!u.isHTML(W[""])||!ae.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+ae+'" missed value!! "'+ae+'" instead2!!'),le(ae,ae,N),N=de,ue=K;break;case q:ie.warning('attribute space is required"'+ae+'"!!');case X:ue=K,N=de;break;case I:ue=z,N=de;break;case F:throw new Error("elements closed character '/' and '>' must be connected to")}}de++}}function m(A,N,G){for(var W=A.tagName,Z=null,me=A.length;me--;){var ie=A[me],le=ie.qName,ae=ie.value,te=le.indexOf(":");if(te>0)var oe=ie.prefix=le.slice(0,te),de=le.slice(te+1),ue=oe==="xmlns"&&de;else de=le,oe=null,ue=le==="xmlns"&&"";ie.localName=de,ue!==!1&&(Z==null&&(Z={},y(G,G={})),G[ue]=Z[ue]=ae,ie.uri=u.XMLNS,N.startPrefixMapping(ue,ae))}for(var me=A.length;me--;){ie=A[me];var oe=ie.prefix;oe&&(oe==="xml"&&(ie.uri=u.XML),oe!=="xmlns"&&(ie.uri=G[oe||""]))}var te=W.indexOf(":");te>0?(oe=A.prefix=W.slice(0,te),de=A.localName=W.slice(te+1)):(oe=null,de=A.localName=W);var re=A.uri=G[oe||""];if(N.startElement(re,de,W,A),A.closed){if(N.endElement(re,de,W),Z)for(oe in Z)Object.prototype.hasOwnProperty.call(Z,oe)&&N.endPrefixMapping(oe)}else return A.currentNSMap=G,A.localNSMap=Z,!0}function C(A,N,G,W,Z){if(/^(?:script|textarea)$/i.test(G)){var ie=A.indexOf(""+G+">",N),le=A.substring(N+1,ie);if(/[&<]/.test(le))return/^script$/i.test(G)?(Z.characters(le,0,le.length),ie):(le=le.replace(/?\w+;/g,W),Z.characters(le,0,le.length),ie)}return N+1}function V(A,N,G,W){var Z=W[G];return Z==null&&(Z=A.lastIndexOf(""+G+">"),Z",N+4);return ie>N?(G.comment(A,N+4,ie-N-4),ie+3):(W.error("Unclosed comment"),-1)}else return-1;default:if(A.substr(N+3,6)=="CDATA["){var ie=A.indexOf("]]>",N+9);return G.startCDATA(),G.characters(A,N+9,ie-N-9),G.endCDATA(),ie+3}var le=D(A,N),ae=le.length;if(ae>1&&/!doctype/i.test(le[0][0])){var oe=le[1][0],de=!1,ue=!1;ae>3&&(/^public$/i.test(le[2][0])?(de=le[3][0],ue=ae>4&&le[4][0]):/^system$/i.test(le[2][0])&&(ue=le[3][0]));var me=le[ae-1];return G.startDTD(oe,de,ue),G.endDTD(),me.index+me[0].length}}return-1}function j(A,N,G){var W=A.indexOf("?>",N);if(W){var Z=A.substring(N,W).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Z?(Z[0].length,G.processingInstruction(Z[1],Z[2]),W+2):-1}return-1}function w(){this.attributeNames={}}w.prototype={setTagName:function(A){if(!T.test(A))throw new Error("invalid tagName:"+A);this.tagName=A},addValue:function(A,N,G){if(!T.test(A))throw new Error("invalid attribute:"+A);this.attributeNames[A]=this.length,this[this.length++]={qName:A,value:N,offset:G}},length:0,getLocalName:function(A){return this[A].localName},getLocator:function(A){return this[A].locator},getQName:function(A){return this[A].qName},getURI:function(A){return this[A].uri},getValue:function(A){return this[A].value}};function D(A,N){var G,W=[],Z=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Z.lastIndex=N,Z.exec(A);G=Z.exec(A);)if(W.push(G),G[1])return W}p.XMLReader=$,p.ParseError=L},"./node_modules/process/browser.js":function(r,p){var s=r.exports={},u,x;function l(){throw new Error("setTimeout has not been defined")}function T(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?u=setTimeout:u=l}catch(Y){u=l}try{typeof clearTimeout=="function"?x=clearTimeout:x=T}catch(Y){x=T}})();function U(Y){if(u===setTimeout)return setTimeout(Y,0);if((u===l||!u)&&setTimeout)return u=setTimeout,setTimeout(Y,0);try{return u(Y,0)}catch(ee){try{return u.call(null,Y,0)}catch(B){return u.call(this,Y,0)}}}function K(Y){if(x===clearTimeout)return clearTimeout(Y);if((x===T||!x)&&clearTimeout)return x=clearTimeout,clearTimeout(Y);try{return x(Y)}catch(ee){try{return x.call(null,Y)}catch(B){return x.call(this,Y)}}}var O=[],I=!1,z,q=-1;function X(){!I||!z||(I=!1,z.length?O=z.concat(O):q=-1,O.length&&F())}function F(){if(!I){var Y=U(X);I=!0;for(var ee=O.length;ee;){for(z=O,O=[];++q1)for(var B=1;Ble)return pe(null,!1);if(Ce>1){var ve=Math.max(re[0].Size,re[1].Size);if(ve!==ie)return pe(null,!1)}var ye=function Se(xe){if(xe=pe.length){me.emit("has_and_check_upload_id",te);return}var Se=pe[ye];if(!U.isInArray(te,Se)){x.removeUploadId.call(G,Se),ve(ye+1);return}if(x.using[Se]){ve(ye+1);return}q.call(G,{Bucket:w,Region:D,Key:A,UploadId:Se,tracker:y.tracker},function(xe,Ee){G._isRunningTask(j)&&(xe?(x.removeUploadId.call(G,Se),ve(ye+1)):me.emit("upload_id_available",{UploadId:Se,PartList:Ee.PartList}))})};Ce(0)}),me.on("get_remote_upload_id_list",function(){z.call(G,{Bucket:w,Region:D,Key:A,tracker:y.tracker},function(te,re){if(G._isRunningTask(j)){if(te)return me.emit("error",te);var pe=U.filter(re.UploadList,function(ye){return ye.Key===A&&(!N||ye.StorageClass.toUpperCase()===N.toUpperCase())}).reverse().map(function(ye){return ye.UploadId||ye.UploadID});if(pe.length)me.emit("seek_local_avail_upload_id",pe);else{var Ce=x.getFileId(y.Body,y.ChunkSize,w,A),ve;Ce&&(ve=x.getUploadIdList.call(G,Ce))&&U.each(ve,function(ye){x.removeUploadId.call(G,ye)}),me.emit("no_available_upload_id")}}})}),me.emit("get_remote_upload_id_list")}function z(y,M){var j=this,w=[],D={Bucket:y.Bucket,Region:y.Region,Prefix:y.Key,calledBySdk:y.calledBySdk||"sliceUploadFile",tracker:y.tracker},A=function N(){j.multipartList(D,function(G,W){if(G)return M(G);w.push.apply(w,W.Upload||[]),W.IsTruncated==="true"?(D.KeyMarker=W.NextKeyMarker,D.UploadIdMarker=W.NextUploadIdMarker,N()):M(null,{UploadList:w})})};A()}function q(y,M){var j=this,w=[],D={Bucket:y.Bucket,Region:y.Region,Key:y.Key,UploadId:y.UploadId,calledBySdk:"sliceUploadFile",tracker:y.tracker},A=function N(){j.multipartListPart(D,function(G,W){if(G)return M(G);w.push.apply(w,W.Part||[]),W.IsTruncated==="true"?(D.PartNumberMarker=W.NextPartNumberMarker,N()):M(null,{PartList:w})})};A()}function X(y,M){var j=this,w=y.TaskId,D=y.Bucket,A=y.Region,N=y.Key,G=y.UploadData,W=y.FileSize,Z=y.SliceSize,ie=Math.min(y.AsyncLimit||j.options.ChunkParallelLimit||1,256),le=y.Body,ae=Math.ceil(W/Z),oe=0,de=y.ServerSideEncryption,ue=y.Headers,me=U.filter(G.PartList,function(re){return re.Uploaded&&(oe+=re.PartNumber>=ae&&W%Z||Z),!re.Uploaded}),te=y.onProgress;l.eachLimit(me,ie,function(re,pe){if(j._isRunningTask(w)){var Ce=re.PartNumber,ve=Math.min(W,re.PartNumber*Z)-(re.PartNumber-1)*Z,ye=0;F.call(j,{TaskId:w,Bucket:D,Region:A,Key:N,SliceSize:Z,FileSize:W,PartNumber:Ce,ServerSideEncryption:de,Body:le,UploadData:G,Headers:ue,onProgress:function(xe){oe+=xe.loaded-ye,ye=xe.loaded,te({loaded:oe,total:W})},tracker:y.tracker},function(Se,xe){j._isRunningTask(w)&&(!Se&&!xe.ETag&&(Se='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败,请在CORS ExposeHeader设置中添加ETag,请参考文档:https://cloud.tencent.com/document/product/436/13318 )'),Se?oe-=ye:(oe+=ve-ye,re.ETag=xe.ETag),te({loaded:oe,total:W}),pe(Se||null,xe))})}},function(re){if(j._isRunningTask(w)){if(re)return M(re);M(null,{UploadId:G.UploadId,SliceList:G.PartList})}})}function F(y,M){var j=this,w=y.TaskId,D=y.Bucket,A=y.Region,N=y.Key,G=y.FileSize,W=y.Body,Z=y.PartNumber*1,ie=y.SliceSize,le=y.ServerSideEncryption,ae=y.UploadData,oe=y.Headers||{},de=j.options.ChunkRetryTimes+1,ue=ie*(Z-1),me=ie,te=ue+ie;te>G&&(te=G,me=te-ue);var re=["x-cos-traffic-limit","x-cos-mime-limit"],pe={};U.each(oe,function(ve,ye){re.indexOf(ye)>-1&&(pe[ye]=ve)});var Ce=ae.PartList[Z-1];l.retry(de,function(ve){j._isRunningTask(w)&&U.fileSlice(W,ue,te,!0,function(ye){j.multipartUpload({TaskId:w,Bucket:D,Region:A,Key:N,ContentLength:me,PartNumber:Z,UploadId:ae.UploadId,ServerSideEncryption:le,Body:ye,Headers:pe,onProgress:y.onProgress,calledBySdk:"sliceUploadFile",tracker:y.tracker},function(Se,xe){if(j._isRunningTask(w))return Se?ve(Se):(Ce.Uploaded=!0,ve(null,xe))})})},function(ve,ye){if(j._isRunningTask(w))return M(ve,ye)})}function L(y,M){var j=y.Bucket,w=y.Region,D=y.Key,A=y.UploadId,N=y.SliceList,G=this,W=this.options.ChunkRetryTimes+1,Z=y.Headers,ie=N.map(function(le){return{PartNumber:le.PartNumber,ETag:le.ETag}});l.retry(W,function(le){G.multipartComplete({Bucket:j,Region:w,Key:D,UploadId:A,Parts:ie,Headers:Z,calledBySdk:"sliceUploadFile",tracker:y.tracker},le)},function(le,ae){M(le,ae)})}function $(y,M){var j=y.Bucket,w=y.Region,D=y.Key,A=y.UploadId,N=y.Level||"task",G=y.AsyncLimit,W=this,Z=new T;if(Z.on("error",function(ie){return M(ie)}),Z.on("get_abort_array",function(ie){Y.call(W,{Bucket:j,Region:w,Key:D,Headers:y.Headers,AsyncLimit:G,AbortArray:ie},M)}),N==="bucket")z.call(W,{Bucket:j,Region:w,calledBySdk:"abortUploadTask"},function(ie,le){if(ie)return M(ie);Z.emit("get_abort_array",le.UploadList||[])});else if(N==="file"){if(!D)return M(U.error(new Error("abort_upload_task_no_key")));z.call(W,{Bucket:j,Region:w,Key:D,calledBySdk:"abortUploadTask"},function(ie,le){if(ie)return M(ie);Z.emit("get_abort_array",le.UploadList||[])})}else if(N==="task"){if(!A)return M(U.error(new Error("abort_upload_task_no_id")));if(!D)return M(U.error(new Error("abort_upload_task_no_key")));Z.emit("get_abort_array",[{Key:D,UploadId:A}])}else return M(U.error(new Error("abort_unknown_level")))}function Y(y,M){var j=y.Bucket,w=y.Region,D=y.Key,A=y.AbortArray,N=y.AsyncLimit||1,G=this,W=0,Z=new Array(A.length);l.eachLimit(A,N,function(ie,le){var ae=W;if(D&&D!==ie.Key){Z[ae]={error:{KeyNotMatch:!0}},le(null);return}var oe=ie.UploadId||ie.UploadID;G.multipartAbort({Bucket:j,Region:w,Key:ie.Key,Headers:y.Headers,UploadId:oe},function(de){var ue={Bucket:j,Region:w,Key:ie.Key,UploadId:oe};Z[ae]={error:de,task:ue},le(null)}),W++},function(ie){if(ie)return M(ie);for(var le=[],ae=[],oe=0,de=Z.length;oew?"sliceUploadFile":"putObject",ae=y.onFileFinish,oe=function(ue,me){y.tracker&&y.tracker.formatResult(ue,me),ae&&ae(ue,me,G),M&&M(ue,me)};D.push({api:le,params:y,callback:oe}),j._addTasks(D)}function B(y,M){var j=this,w=y.SliceSize===void 0?j.options.SliceSize:y.SliceSize,D=0,A=0,N=U.throttleOnProgress.call(j,A,y.onProgress),G=y.files.length,W=y.onFileFinish,Z=Array(G),ie=function(oe,de,ue){N(null,!0),W&&W(oe,de,ue),Z[ue.Index]={options:ue,error:oe,data:de},--G<=0&&M&&M(null,{files:Z})},le=[];U.each(y.files,function(ae,oe){(function(){var de=ae.Body,ue=de.size||de.length||0,me={Index:oe,TaskId:""};if(!j.options.UseRawKey&&ae.Key&&ae.Key.substr(0,1)==="/"&&(ae.Key=ae.Key.substr(1)),D+=ue,j.options.EnableTracker){var te=j.options.UseAccelerate||typeof j.options.Domain=="string"&&j.options.Domain.includes("accelerate.");ae.tracker=new K({bucket:ae.Bucket,region:ae.Region,apiName:"uploadFiles",fileKey:ae.Key,fileSize:ue,accelerate:te,deepTracker:j.options.DeepTracker,customId:j.options.CustomId,delay:j.options.TrackerDelay})}U.each(ae,function(Ie,we){u(Ie)!=="object"&&typeof Ie!="function"&&(me[we]=Ie)});var re=ae.onTaskReady,pe=function(we){me.TaskId=we,re&&re(we)};ae.onTaskReady=pe;var Ce=0,ve=ae.onProgress,ye=function(we){A=A-Ce+we.loaded,Ce=we.loaded,ve&&ve(we),N({loaded:A,total:D})};ae.onProgress=ye;var Se=ue>w?"sliceUploadFile":"putObject",xe=ae.onFileFinish,Ee=function(we,_e){ae.tracker&&ae.tracker.formatResult(we,_e),xe&&xe(we,_e),ie&&ie(we,_e,me)};le.push({api:Se,params:ae,callback:Ee})})()}),j._addTasks(le)}function m(y,M){var j=new T,w=this,D=y.Bucket,A=y.Region,N=y.Key,G=y.CopySource,W=U.getSourceParams.call(this,G);if(!W){M(U.error(new Error("CopySource format error")));return}var Z=W.Bucket,ie=W.Region,le=decodeURIComponent(W.Key),ae=y.CopySliceSize===void 0?w.options.CopySliceSize:y.CopySliceSize;ae=Math.max(0,ae);var oe=y.CopyChunkSize||this.options.CopyChunkSize,de=this.options.CopyChunkParallelLimit,ue=this.options.ChunkRetryTimes+1,me=0,te=0,re,pe,Ce={},ve={},ye={};j.on("copy_slice_complete",function(Se){U.each(y.Headers,function(Ee,Ie){Ie.toLowerCase().indexOf("x-cos-meta-")});var xe=U.map(Se.PartList,function(Ee){return{PartNumber:Ee.PartNumber,ETag:Ee.ETag}});l.retry(ue,function(Ee){w.multipartComplete({Bucket:D,Region:A,Key:N,UploadId:Se.UploadId,Parts:xe,calledBySdk:"sliceCopyFile"},Ee)},function(Ee,Ie){if(x.removeUsing(Se.UploadId),Ee)return pe(null,!0),M(Ee);x.removeUploadId(Se.UploadId),pe({loaded:re,total:re},!0),M(null,Ie)})}),j.on("get_copy_data_finish",function(Se){var xe=x.getCopyFileId(G,Ce,oe,D,N);xe&&x.saveUploadId(xe,Se.UploadId,w.options.UploadIdCacheLimit),x.setUsing(Se.UploadId);var Ee=U.filter(Se.PartList,function(Ie){return Ie.Uploaded&&(te+=Ie.PartNumber>=me&&re%oe||oe),!Ie.Uploaded});l.eachLimit(Ee,de,function(Ie,we){var _e=Ie.PartNumber,je=Ie.CopySourceRange,Ue=Ie.end-Ie.start;l.retry(ue,function(se){C.call(w,{Bucket:D,Region:A,Key:N,CopySource:G,UploadId:Se.UploadId,PartNumber:_e,CopySourceRange:je},se)},function(se,d){if(se)return we(se);te+=Ue,pe({loaded:te,total:re}),Ie.ETag=d.ETag,we(se||null,d)})},function(Ie){if(Ie)return x.removeUsing(Se.UploadId),pe(null,!0),M(Ie);j.emit("copy_slice_complete",Se)})}),j.on("get_chunk_size_finish",function(){var Se=function(){w.multipartInit({Bucket:D,Region:A,Key:N,Headers:ye},function(_e,je){if(_e)return M(_e);y.UploadId=je.UploadId,j.emit("get_copy_data_finish",{UploadId:y.UploadId,PartList:y.PartList})})},xe=x.getCopyFileId(G,Ce,oe,D,N),Ee=x.getUploadIdList(xe);if(!xe||!Ee)return Se();var Ie=function we(_e){if(_e>=Ee.length)return Se();var je=Ee[_e];if(x.using[je])return we(_e+1);q.call(w,{Bucket:D,Region:A,Key:N,UploadId:je},function(Ue,se){if(Ue)x.removeUploadId(je),we(_e+1);else{if(x.using[je])return we(_e+1);var d={},i=0;U.each(se.PartList,function(o){var a=parseInt(o.Size),v=i+a-1;d[o.PartNumber+"|"+i+"|"+v]=o.ETag,i+=a}),U.each(y.PartList,function(o){var a=d[o.PartNumber+"|"+o.start+"|"+o.end];a&&(o.ETag=a,o.Uploaded=!0)}),j.emit("get_copy_data_finish",{UploadId:je,PartList:y.PartList})}})};Ie(0)}),j.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,Ie=0;Ie_e.length&&(ve[we]=Ie)}),j.emit("get_file_size_finish")}})}function C(y,M){var j=y.TaskId,w=y.Bucket,D=y.Region,A=y.Key,N=y.CopySource,G=y.UploadId,W=y.PartNumber*1,Z=y.CopySourceRange,ie=this.options.ChunkRetryTimes+1,le=this;l.retry(ie,function(ae){le.uploadPartCopy({TaskId:j,Bucket:w,Region:D,Key:A,CopySource:N,UploadId:G,PartNumber:W,CopySourceRange:Z},function(oe,de){ae(oe||null,de)})},function(ae,oe){return M(ae,oe)})}var V={sliceUploadFile:O,abortUploadTask:$,uploadFile:ee,uploadFiles:B,sliceCopyFile:m};r.exports.init=function(y,M){M.transferToTaskMethod(V,"sliceUploadFile"),U.each(V,function(j,w){y.prototype[w]=U.apiWrapper(w,j)})}},"./src/async.js":function(r,p){var s=function(T,U,K,O){if(O=O||function(){},!T.length||U<=0)return O();var I=0,z=0,q=0;(function X(){if(I>=T.length)return O();for(;q=T.length?O():X())})})()},u=function(T,U,K){var O=function I(z){U(function(q,X){q&&z"u"?"undefined":u(location))==="object"&&location.protocol==="http:"?"http:":"https:"),f=this.options.ServiceDomain,k=e.AppId||this.options.appId,S=e.Region;f?(f=f.replace(/\{\{AppId\}\}/gi,k||"").replace(/\{\{Region\}\}/gi,S||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(f)||(f=n+"//"+f),f.slice(-1)==="/"&&(f=f.slice(0,-1))):S?f=n+"//cos."+S+".myqcloud.com":f=n+"//service.cos.myqcloud.com";var E="",_=S?"cos."+S+".myqcloud.com":"service.cos.myqcloud.com",ne=f.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");_===ne&&(E=_),ce.call(this,{Action:"name/cos:GetService",url:f,method:"GET",headers:e.Headers,SignHost:E},function(Oe,Ae){if(Oe)return g(Oe);var ke=Ae&&Ae.ListAllMyBucketsResult&&Ae.ListAllMyBucketsResult.Buckets&&Ae.ListAllMyBucketsResult.Buckets.Bucket||[];ke=l.isArray(ke)?ke:[ke];var be=Ae&&Ae.ListAllMyBucketsResult&&Ae.ListAllMyBucketsResult.Owner||{};g(null,{Buckets:ke,Owner:be,statusCode:Ae.statusCode,headers:Ae.headers})})}function U(e,g){var n=this,f="";if(e.BucketAZConfig){var k={BucketAZConfig:e.BucketAZConfig};f=l.json2xml({CreateBucketConfiguration:k})}ce.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:f},function(S,E){if(S)return g(S);var _=H({protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});g(null,{Location:_,statusCode:E.statusCode,headers:E.headers})})}function K(e,g){ce.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD"},g)}function O(e,g){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(f,k){if(f)return g(f);var S=k.ListBucketResult||{},E=S.Contents||[],_=S.CommonPrefixes||[];E=l.isArray(E)?E:[E],_=l.isArray(_)?_:[_];var ne=l.clone(S);l.extend(ne,{Contents:E,CommonPrefixes:_,statusCode:k.statusCode,headers:k.headers}),g(null,ne)})}function I(e,g){ce.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function z(e,g){var n=e.Headers,f="";if(e.AccessControlPolicy){var k=l.clone(e.AccessControlPolicy||{}),S=k.Grants||k.Grant;S=l.isArray(S)?S:[S],delete k.Grant,delete k.Grants,k.AccessControlList={Grant:S},f=l.json2xml({AccessControlPolicy:k}),n["Content-Type"]="application/xml",n["Content-MD5"]=l.b64(l.md5(f))}l.each(n,function(E,_){_.indexOf("x-cos-grant-")===0&&(n[_]=b(n[_]))}),ce.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:n,action:"acl",body:f},function(E,_){if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function q(e,g){ce.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl"},function(n,f){if(n)return g(n);var k=f.AccessControlPolicy||{},S=k.Owner||{},E=k.AccessControlList.Grant||[];E=l.isArray(E)?E:[E];var _=h(k);f.headers&&f.headers["x-cos-acl"]&&(_.ACL=f.headers["x-cos-acl"]),_=l.extend(_,{Owner:S,Grants:E,statusCode:f.statusCode,headers:f.headers}),g(null,_)})}function X(e,g){var n=e.CORSConfiguration||{},f=n.CORSRules||e.CORSRules||[];f=l.clone(l.isArray(f)?f:[f]),l.each(f,function(_){l.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(ne){var Oe=ne+"s",Ae=_[Oe]||_[ne]||[];delete _[Oe],_[ne]=l.isArray(Ae)?Ae:[Ae]})});var k={CORSRule:f};e.ResponseVary&&(k.ResponseVary=e.ResponseVary);var S=l.json2xml({CORSConfiguration:k}),E=e.Headers;E["Content-Type"]="application/xml",E["Content-MD5"]=l.b64(l.md5(S)),ce.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:S,action:"cors",headers:E},function(_,ne){if(_)return g(_);g(null,{statusCode:ne.statusCode,headers:ne.headers})})}function F(e,g){ce.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors"},function(n,f){if(n){if(n.statusCode===404&&n.error&&n.error.Code==="NoSuchCORSConfiguration"){var k={CORSRules:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=f.CORSConfiguration||{},E=S.CORSRules||S.CORSRule||[];E=l.clone(l.isArray(E)?E:[E]);var _=S.ResponseVary;l.each(E,function(ne){l.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(Oe){var Ae=Oe+"s",ke=ne[Ae]||ne[Oe]||[];delete ne[Oe],ne[Ae]=l.isArray(ke)?ke:[ke]})}),g(null,{CORSRules:E,ResponseVary:_,statusCode:f.statusCode,headers:f.headers})})}function L(e,g){ce.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode||n.statusCode,headers:f.headers})})}function $(e,g){ce.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location"},g)}function Y(e,g){var n=e.Policy;try{typeof n=="string"&&(n=JSON.parse(n))}catch(S){}if(!n||typeof n=="string")return g(l.error(new Error("Policy format error")));var f=JSON.stringify(n);n.version||(n.version="2.0");var k=e.Headers;k["Content-Type"]="application/json",k["Content-MD5"]=l.b64(l.md5(f)),ce.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:f,headers:k},function(S,E){if(S&&S.statusCode===204)return g(null,{statusCode:S.statusCode});if(S)return g(S);g(null,{statusCode:E.statusCode,headers:E.headers})})}function ee(e,g){ce.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0},function(n,f){if(n)return n.statusCode&&n.statusCode===403?g(l.error(n,{ErrorStatus:"Access Denied"})):n.statusCode&&n.statusCode===405?g(l.error(n,{ErrorStatus:"Method Not Allowed"})):n.statusCode&&n.statusCode===404?g(l.error(n,{ErrorStatus:"Policy Not Found"})):g(n);var k={};try{k=JSON.parse(f.body)}catch(S){}g(null,{Policy:k,statusCode:f.statusCode,headers:f.headers})})}function B(e,g){ce.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode||n.statusCode,headers:f.headers})})}function m(e,g){var n=e.Tagging||{},f=n.TagSet||n.Tags||e.Tags||[];f=l.clone(l.isArray(f)?f:[f]);var k=l.json2xml({Tagging:{TagSet:{Tag:f}}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"tagging",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function C(e,g){ce.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging"},function(n,f){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),g(null,k)}else g(n);return}var S=[];try{S=f.Tagging.TagSet.Tag||[]}catch(E){}S=l.clone(l.isArray(S)?S:[S]),g(null,{Tags:S,statusCode:f.statusCode,headers:f.headers})})}function V(e,g){ce.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function y(e,g){var n=e.LifecycleConfiguration||{},f=n.Rules||e.Rules||[];f=l.clone(f);var k=l.json2xml({LifecycleConfiguration:{Rule:f}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"lifecycle",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function M(e,g){ce.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle"},function(n,f){if(n){if(n.statusCode===404&&n.error&&n.error.Code==="NoSuchLifecycleConfiguration"){var k={Rules:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=[];try{S=f.LifecycleConfiguration.Rule||[]}catch(E){}S=l.clone(l.isArray(S)?S:[S]),g(null,{Rules:S,statusCode:f.statusCode,headers:f.headers})})}function j(e,g){ce.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function w(e,g){if(!e.VersioningConfiguration){g(l.error(new Error("missing param VersioningConfiguration")));return}var n=e.VersioningConfiguration||{},f=l.json2xml({VersioningConfiguration:n}),k=e.Headers;k["Content-Type"]="application/xml",k["Content-MD5"]=l.b64(l.md5(f)),ce.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:f,action:"versioning",headers:k},function(S,E){if(S&&S.statusCode===204)return g(null,{statusCode:S.statusCode});if(S)return g(S);g(null,{statusCode:E.statusCode,headers:E.headers})})}function D(e,g){ce.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning"},function(n,f){n||!f.VersioningConfiguration&&(f.VersioningConfiguration={}),g(n,f)})}function A(e,g){var n=l.clone(e.ReplicationConfiguration),f=l.json2xml({ReplicationConfiguration:n});f=f.replace(/<(\/?)Rules>/gi,"<$1Rule>"),f=f.replace(/<(\/?)Tags>/gi,"<$1Tag>");var k=e.Headers;k["Content-Type"]="application/xml",k["Content-MD5"]=l.b64(l.md5(f)),ce.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:f,action:"replication",headers:k},function(S,E){if(S&&S.statusCode===204)return g(null,{statusCode:S.statusCode});if(S)return g(S);g(null,{statusCode:E.statusCode,headers:E.headers})})}function N(e,g){ce.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(n,f){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),g(null,k)}else g(n);return}!f.ReplicationConfiguration&&(f.ReplicationConfiguration={}),f.ReplicationConfiguration.Rule&&(f.ReplicationConfiguration.Rules=l.makeArray(f.ReplicationConfiguration.Rule),delete f.ReplicationConfiguration.Rule),g(n,f)})}function G(e,g){ce.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function W(e,g){if(!e.WebsiteConfiguration){g(l.error(new Error("missing param WebsiteConfiguration")));return}var n=l.clone(e.WebsiteConfiguration||{}),f=n.RoutingRules||n.RoutingRule||[];f=l.isArray(f)?f:[f],delete n.RoutingRule,delete n.RoutingRules,f.length&&(n.RoutingRules={RoutingRule:f});var k=l.json2xml({WebsiteConfiguration:n}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"website",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function Z(e,g){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,f){if(n){if(n.statusCode===404&&n.error.Code==="NoSuchWebsiteConfiguration"){var k={WebsiteConfiguration:{},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=f.WebsiteConfiguration||{};if(S.RoutingRules){var E=l.clone(S.RoutingRules.RoutingRule||[]);E=l.makeArray(E),S.RoutingRules=E}g(null,{WebsiteConfiguration:S,statusCode:f.statusCode,headers:f.headers})})}function ie(e,g){ce.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function le(e,g){if(!e.RefererConfiguration){g(l.error(new Error("missing param RefererConfiguration")));return}var n=l.clone(e.RefererConfiguration||{}),f=n.DomainList||{},k=f.Domains||f.Domain||[];k=l.isArray(k)?k:[k],k.length&&(n.DomainList={Domain:k});var S=l.json2xml({RefererConfiguration:n}),E=e.Headers;E["Content-Type"]="application/xml",E["Content-MD5"]=l.b64(l.md5(S)),ce.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:S,action:"referer",headers:E},function(_,ne){if(_&&_.statusCode===204)return g(null,{statusCode:_.statusCode});if(_)return g(_);g(null,{statusCode:ne.statusCode,headers:ne.headers})})}function ae(e,g){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,f){if(n){if(n.statusCode===404&&n.error.Code==="NoSuchRefererConfiguration"){var k={WebsiteConfiguration:{},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=f.RefererConfiguration||{};if(S.DomainList){var E=l.makeArray(S.DomainList.Domain||[]);S.DomainList={Domains:E}}g(null,{RefererConfiguration:S,statusCode:f.statusCode,headers:f.headers})})}function oe(e,g){var n=e.DomainConfiguration||{},f=n.DomainRule||e.DomainRule||[];f=l.clone(f);var k=l.json2xml({DomainConfiguration:{DomainRule:f}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"domain",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function de(e,g){ce.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(n,f){if(n)return g(n);var k=[];try{k=f.DomainConfiguration.DomainRule||[]}catch(S){}k=l.clone(l.isArray(k)?k:[k]),g(null,{DomainRule:k,statusCode:f.statusCode,headers:f.headers})})}function ue(e,g){ce.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function me(e,g){var n=e.OriginConfiguration||{},f=n.OriginRule||e.OriginRule||[];f=l.clone(f);var k=l.json2xml({OriginConfiguration:{OriginRule:f}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"origin",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function te(e,g){ce.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(n,f){if(n)return g(n);var k=[];try{k=f.OriginConfiguration.OriginRule||[]}catch(S){}k=l.clone(l.isArray(k)?k:[k]),g(null,{OriginRule:k,statusCode:f.statusCode,headers:f.headers})})}function re(e,g){ce.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function pe(e,g){var n=l.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),f=e.Headers;f["Content-Type"]="application/xml",f["Content-MD5"]=l.b64(l.md5(n)),ce.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:f},function(k,S){if(k&&k.statusCode===204)return g(null,{statusCode:k.statusCode});if(k)return g(k);g(null,{statusCode:S.statusCode,headers:S.headers})})}function Ce(e,g){ce.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(n,f){if(n)return g(n);g(null,{BucketLoggingStatus:f.BucketLoggingStatus,statusCode:f.statusCode,headers:f.headers})})}function ve(e,g,n){var f=l.clone(g.InventoryConfiguration);if(f.OptionalFields){var k=f.OptionalFields||[];f.OptionalFields={Field:k}}if(f.Destination&&f.Destination.COSBucketDestination&&f.Destination.COSBucketDestination.Encryption){var S=f.Destination.COSBucketDestination.Encryption;Object.keys(S).indexOf("SSECOS")>-1&&(S["SSE-COS"]=S.SSECOS,delete S.SSECOS)}var E=l.json2xml({InventoryConfiguration:f}),_=g.Headers;_["Content-Type"]="application/xml",_["Content-MD5"]=l.b64(l.md5(E));var ne=e==="PUT"?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";ce.call(this,{Action:ne,method:e,Bucket:g.Bucket,Region:g.Region,body:E,action:"inventory",qs:{id:g.Id},headers:_},function(Oe,Ae){if(Oe&&Oe.statusCode===204)return n(null,{statusCode:Oe.statusCode});if(Oe)return n(Oe);n(null,{statusCode:Ae.statusCode,headers:Ae.headers})})}function ye(e,g){return ve.call(this,"PUT",e,g)}function Se(e,g){return ve.call(this,"POST",e,g)}function xe(e,g){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,f){if(n)return g(n);var k=f.InventoryConfiguration;if(k&&k.OptionalFields&&k.OptionalFields.Field){var S=k.OptionalFields.Field;l.isArray(S)||(S=[S]),k.OptionalFields=S}if(k.Destination&&k.Destination.COSBucketDestination&&k.Destination.COSBucketDestination.Encryption){var E=k.Destination.COSBucketDestination.Encryption;Object.keys(E).indexOf("SSE-COS")>-1&&(E.SSECOS=E["SSE-COS"],delete E["SSE-COS"])}g(null,{InventoryConfiguration:k,statusCode:f.statusCode,headers:f.headers})})}function Ee(e,g){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,f){if(n)return g(n);var k=f.ListInventoryConfigurationResult,S=k.InventoryConfiguration||[];S=l.isArray(S)?S:[S],delete k.InventoryConfiguration,l.each(S,function(E){if(E&&E.OptionalFields&&E.OptionalFields.Field){var _=E.OptionalFields.Field;l.isArray(_)||(_=[_]),E.OptionalFields=_}if(E.Destination&&E.Destination.COSBucketDestination&&E.Destination.COSBucketDestination.Encryption){var ne=E.Destination.COSBucketDestination.Encryption;Object.keys(ne).indexOf("SSE-COS")>-1&&(ne.SSECOS=ne["SSE-COS"],delete ne["SSE-COS"])}}),k.InventoryConfigurations=S,l.extend(k,{statusCode:f.statusCode,headers:f.headers}),g(null,k)})}function Ie(e,g){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,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function we(e,g){if(!e.AccelerateConfiguration){g(l.error(new Error("missing param AccelerateConfiguration")));return}var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},f=l.json2xml(n),k={};k["Content-Type"]="application/xml",k["Content-MD5"]=l.b64(l.md5(f)),ce.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:f,action:"accelerate",headers:k},function(S,E){if(S)return g(S);g(null,{statusCode:E.statusCode,headers:E.headers})})}function _e(e,g){ce.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(n,f){n||!f.AccelerateConfiguration&&(f.AccelerateConfiguration={}),g(n,f)})}function je(e,g){var n=e.ServerSideEncryptionConfiguration||{},f=n.Rule||n.Rules||[],k=l.json2xml({ServerSideEncryptionConfiguration:{Rule:f}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"encryption",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function Ue(e,g){ce.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(n,f){if(n){if(n.statusCode===404&&n.code==="NoSuchEncryptionConfiguration"){var k={EncryptionConfiguration:{Rules:[]},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=l.makeArray(f.EncryptionConfiguration&&f.EncryptionConfiguration.Rule||[]);f.EncryptionConfiguration={Rules:S},g(n,f)})}function se(e,g){ce.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function d(e,g){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,f){if(n){var k=n.statusCode;return e.Headers["If-Modified-Since"]&&k&&k===304?g(null,{NotModified:!0,statusCode:k}):g(n)}f.ETag=l.attr(f.headers,"etag",""),g(null,f)})}function i(e,g){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(f,k){if(f)return g(f);var S=k.ListVersionsResult||{},E=S.DeleteMarker||[];E=l.isArray(E)?E:[E];var _=S.Version||[];_=l.isArray(_)?_:[_];var ne=l.clone(S);delete ne.DeleteMarker,delete ne.Version,l.extend(ne,{DeleteMarkers:E,Versions:_,statusCode:k.statusCode,headers:k.headers}),g(null,ne)})}function o(e,g){var n=e.Query||{},f=e.QueryString||"",k=l.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:f,rawBody:!0,onDownloadProgress:k,tracker:S},function(E,_){if(k(null,!0),E){var ne=E.statusCode;return e.Headers["If-Modified-Since"]&&ne&&ne===304?g(null,{NotModified:!0}):g(E)}g(null,{Body:_.body,ETag:l.attr(_.headers,"etag",""),statusCode:_.statusCode,headers:_.headers})})}function a(e,g){var n=this,f=e.ContentLength,k=l.throttleOnProgress.call(n,f,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 E=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5,_=e.tracker;E&&_&&_.setParams({md5StartTime:new Date().getTime()}),l.getBodyMd5(E,e.Body,function(ne){ne&&(_&&_.setParams({md5EndTime:new Date().getTime()}),n.options.UploadCheckContentMd5&&(S["Content-MD5"]=l.b64(ne)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(S["x-cos-meta-md5"]=ne)),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:_},function(Oe,Ae){if(Oe)return k(null,!0),g(Oe);k({loaded:f,total:f},!0);var ke=H({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),Ae.Location=ke,Ae.ETag=l.attr(Ae.headers,"etag",""),g(null,Ae)})},e.onHashProgress)}function v(e,g){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,f){if(n){var k=n.statusCode;return k&&k===404?g(null,{BucketNotFound:!0,statusCode:k}):g(n)}g(null,{statusCode:f.statusCode,headers:f.headers})})}function R(e,g){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(f,k){if(f)return g(f);var S=k.AccessControlPolicy||{},E=S.Owner||{},_=S.AccessControlList&&S.AccessControlList.Grant||[];_=l.isArray(_)?_:[_];var ne=h(S);delete ne.GrantWrite,k.headers&&k.headers["x-cos-acl"]&&(ne.ACL=k.headers["x-cos-acl"]),ne=l.extend(ne,{Owner:E,Grants:_,statusCode:k.statusCode,headers:k.headers}),g(null,ne)})}function P(e,g){var n=e.Headers,f="";if(e.AccessControlPolicy){var k=l.clone(e.AccessControlPolicy||{}),S=k.Grants||k.Grant;S=l.isArray(S)?S:[S],delete k.Grant,delete k.Grants,k.AccessControlList={Grant:S},f=l.json2xml({AccessControlPolicy:k}),n["Content-Type"]="application/xml",n["Content-MD5"]=l.b64(l.md5(f))}l.each(n,function(E,_){_.indexOf("x-cos-grant-")===0&&(n[_]=b(n[_]))}),ce.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:f},function(E,_){if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function J(e,g){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(f,k){if(f)return f.statusCode&&f.statusCode===403?g(null,{OptionsForbidden:!0,statusCode:f.statusCode}):g(f);var S=k.headers||{};g(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,g){var n=this,f=e.Headers;!f["Cache-Control"]&&!f["cache-control"]&&(f["Cache-Control"]="");var k=e.CopySource||"",S=l.getSourceParams.call(this,k);if(!S){g(l.error(new Error("CopySource format error")));return}var E=S.Bucket,_=S.Region,ne=decodeURIComponent(S.Key);ce.call(this,{Scope:[{action:"name/cos:GetObject",bucket:E,region:_,prefix:ne},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(Oe,Ae){if(Oe)return g(Oe);var ke=l.clone(Ae.CopyObjectResult||{}),be=H({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});l.extend(ke,{Location:be,statusCode:Ae.statusCode,headers:Ae.headers}),g(null,ke)})}function ge(e,g){var n=e.CopySource||"",f=l.getSourceParams.call(this,n);if(!f){g(l.error(new Error("CopySource format error")));return}var k=f.Bucket,S=f.Region,E=decodeURIComponent(f.Key);ce.call(this,{Scope:[{action:"name/cos:GetObject",bucket:k,region:S,prefix:E},{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(_,ne){if(_)return g(_);var Oe=l.clone(ne.CopyPartResult||{});l.extend(Oe,{statusCode:ne.statusCode,headers:ne.headers}),g(null,Oe)})}function Q(e,g){var n=e.Objects||[],f=e.Quiet;n=l.isArray(n)?n:[n];var k=l.json2xml({Delete:{Object:n,Quiet:f||!1}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k));var E=l.map(n,function(_){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:_.Key}});ce.call(this,{Scope:E,method:"POST",Bucket:e.Bucket,Region:e.Region,body:k,action:"delete",headers:S},function(_,ne){if(_)return g(_);var Oe=ne.DeleteResult||{},Ae=Oe.Deleted||[],ke=Oe.Error||[];Ae=l.isArray(Ae)?Ae:[Ae],ke=l.isArray(ke)?ke:[ke];var be=l.clone(Oe);l.extend(be,{Error:ke,Deleted:Ae,statusCode:ne.statusCode,headers:ne.headers}),g(null,be)})}function Te(e,g){var n=e.Headers;if(!e.RestoreRequest){g(l.error(new Error("missing param RestoreRequest")));return}var f=e.RestoreRequest||{},k=l.json2xml({RestoreRequest:f});n["Content-Type"]="application/xml",n["Content-MD5"]=l.b64(l.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},g)}function Ne(e,g){var n=e.Tagging||{},f=n.TagSet||n.Tags||e.Tags||[];f=l.clone(l.isArray(f)?f:[f]);var k=l.json2xml({Tagging:{TagSet:{Tag:f}}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.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(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function Fe(e,g){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,f){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),g(null,k)}else g(n);return}var S=[];try{S=f.Tagging.TagSet.Tag||[]}catch(E){}S=l.clone(l.isArray(S)?S:[S]),g(null,{Tags:S,statusCode:f.statusCode,headers:f.headers})})}function Be(e,g){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,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function Le(e,g){var n=e.SelectType;if(!n)return g(l.error(new Error("missing param SelectType")));var f=e.SelectRequest||{},k=l.json2xml({SelectRequest:f}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.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(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);var ne=l.parseSelectPayload(_.body);g(null,{statusCode:_.statusCode,headers:_.headers,Body:ne.body,Payload:ne.payload})})}function Ve(e,g){var n=this,f=e.Headers,k=e.tracker;!f["Cache-Control"]&&!f["cache-control"]&&(f["Cache-Control"]=""),!f["Content-Type"]&&!f["content-type"]&&(f["Content-Type"]=e.Body&&e.Body.type||"");var S=e.Body&&(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5);S&&k&&k.setParams({md5StartTime:new Date().getTime()}),l.getBodyMd5(S,e.Body,function(E){E&&(e.Headers["x-cos-meta-md5"]=E),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(_,ne){if(_)return k&&k.parent&&k.parent.setParams({errorNode:"multipartInit"}),g(_);if(ne=l.clone(ne||{}),ne&&ne.InitiateMultipartUploadResult)return g(null,l.extend(ne.InitiateMultipartUploadResult,{statusCode:ne.statusCode,headers:ne.headers}));g(null,ne)})},e.onHashProgress)}function Ge(e,g){var n=this;l.getFileSize("multipartUpload",e,function(){var f=e.tracker,k=n.options.UploadCheckContentMd5;k&&f&&f.setParams({md5StartTime:new Date().getTime()}),l.getBodyMd5(k,e.Body,function(S){S&&(e.Headers["Content-MD5"]=l.b64(S)),k&&f&&f.setParams({md5EndTime:new Date().getTime()}),f&&f.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:f},function(E,_){if(E)return f&&f.parent&&f.parent.setParams({errorNode:"multipartUpload"}),g(E);g(null,{ETag:l.attr(_.headers,"etag",""),statusCode:_.statusCode,headers:_.headers})})})})}function We(e,g){for(var n=this,f=e.UploadId,k=e.Parts,S=e.tracker,E=0,_=k.length;E<_;E++)k[E].ETag&&k[E].ETag.indexOf('"')===0||(k[E].ETag='"'+k[E].ETag+'"');var ne=l.json2xml({CompleteMultipartUpload:{Part:k}});ne=ne.replace(/\n\s*/g,"");var Oe=e.Headers;Oe["Content-Type"]="application/xml",Oe["Content-MD5"]=l.b64(l.md5(ne)),ce.call(this,{Action:"name/cos:CompleteMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{uploadId:f},body:ne,headers:Oe,tracker:S},function(Ae,ke){if(Ae)return S&&S.parent&&S.parent.setParams({errorNode:"multipartComplete"}),g(Ae);var be=H({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 $e=l.extend(He,{Location:be,statusCode:ke.statusCode,headers:ke.headers});g(null,$e)})}function qe(e,g){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=l.clearKey(n);var f=e.tracker;f&&f.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:f},function(k,S){if(k)return f&&f.parent&&f.parent.setParams({errorNode:"multipartList"}),g(k);if(S&&S.ListMultipartUploadsResult){var E=S.ListMultipartUploadsResult.Upload||[];E=l.isArray(E)?E:[E],S.ListMultipartUploadsResult.Upload=E}var _=l.clone(S.ListMultipartUploadsResult||{});l.extend(_,{statusCode:S.statusCode,headers:S.headers}),g(null,_)})}function Xe(e,g){var n={},f=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 f&&f.parent&&f.parent.setParams({errorNode:"multipartListPart"}),g(k);var E=S.ListPartsResult||{},_=E.Part||[];_=l.isArray(_)?_:[_],E.Part=_;var ne=l.clone(E);l.extend(ne,{statusCode:S.statusCode,headers:S.headers}),g(null,ne)})}function Ye(e,g){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(f,k){if(f)return g(f);g(null,{statusCode:k.statusCode,headers:k.headers})})}function ot(e,g){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,f){if(n)return g(n);f&&f.body&&(f.Body=f.body,delete f.body),g(n,f)})}function tt(e,g){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(f,k){if(f)return g(f);g(null,k)})}function rt(e){var g=this;return l.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:g.options.UseRawKey,SystemClockOffset:g.options.SystemClockOffset})}function c(e,g){var n=this,f=e.UseAccelerate===void 0?n.options.UseAccelerate:e.UseAccelerate,k=H({ForcePathStyle:n.options.ForcePathStyle,protocol:e.Protocol||n.options.Protocol,domain:e.Domain||n.options.Domain,bucket:e.Bucket,region:f?"accelerate":e.Region,object:e.Key}),S="";e.Query&&(S+=l.obj2str(e.Query)),e.QueryString&&(S+=(S?"&":"")+e.QueryString);var E=k;if(e.Sign!==void 0&&!e.Sign)return S&&(E+="?"+S),g(null,{Url:E}),E;var _=he.call(this,{Bucket:e.Bucket,Region:e.Region,UseAccelerate:e.UseAccelerate,Url:k}),ne=Re.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:_,ForceSignHost:e.ForceSignHost===!1?!1:n.options.ForceSignHost},function(Oe,Ae){if(g){if(Oe){g(Oe);return}var ke=function($e){var st=$e.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=$e.replace(et,it);return at},be=k;be+="?"+(Ae.Authorization.indexOf("q-signature")>-1?ke(Ae.Authorization):"sign="+encodeURIComponent(Ae.Authorization)),Ae.SecurityToken&&(be+="&x-cos-security-token="+Ae.SecurityToken),Ae.ClientIP&&(be+="&clientIP="+Ae.ClientIP),Ae.ClientUA&&(be+="&clientUA="+Ae.ClientUA),Ae.Token&&(be+="&token="+Ae.Token),S&&(be+="&"+S),setTimeout(function(){g(null,{Url:be})})}});return ne?(E+="?"+ne.Authorization+(ne.SecurityToken?"&x-cos-security-token="+ne.SecurityToken:""),S&&(E+="&"+S)):S&&(E+="?"+S),E}function h(e){var g={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},f=e&&e.AccessControlList||{},k=f.Grant;k&&(k=l.isArray(k)?k:[k]);var S={READ:0,WRITE:0,FULL_CONTROL:0};return k&&k.length&&l.each(k,function(E){E.Grantee.ID==="qcs::cam::anyone:anyone"||E.Grantee.URI==="http://cam.qcloud.com/groups/global/AllUsers"?S[E.Permission]=1:E.Grantee.ID!==e.Owner.ID&&g[n[E.Permission]].push('id="'+E.Grantee.ID+'"')}),S.FULL_CONTROL||S.WRITE&&S.READ?g.ACL="public-read-write":S.READ?g.ACL="public-read":g.ACL="private",l.each(n,function(E){g[E]=b(g[E].join(","))}),g}function b(e){var g=e.split(","),n={},f,k;for(f=0;f"u"?"undefined":u(location))==="object"&&location.protocol==="http:"?"http:":"https:");S||(["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(g)>-1?S="{Region}.myqcloud.com":S="cos.{Region}.myqcloud.com",e.ForcePathStyle||(S="{Bucket}."+S)),S=S.replace(/\{\{AppId\}\}/gi,k).replace(/\{\{Bucket\}\}/gi,f).replace(/\{\{Region\}\}/gi,g).replace(/\{\{.*?\}\}/gi,""),S=S.replace(/\{AppId\}/gi,k).replace(/\{BucketName\}/gi,f).replace(/\{Bucket\}/gi,n).replace(/\{Region\}/gi,g).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(S)||(S=_+"//"+S),S.slice(-1)==="/"&&(S=S.slice(0,-1));var ne=S;return e.ForcePathStyle&&(ne+="/"+n),ne+="/",E&&(ne+=l.camSafeUrlEncode(E).replace(/%2F/g,"/")),e.isLocation&&(ne=ne.replace(/^https?:\/\//,"")),ne}var he=function(g){if(!g.Bucket||!g.Region)return"";var n=g.UseAccelerate===void 0?this.options.UseAccelerate:g.UseAccelerate,f=g.Url||H({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:g.Bucket,region:n?"accelerate":g.Region}),k=f.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 Re(e,g){var n=l.clone(e.Headers),f="";l.each(n,function(De,Pe){(De===""||["content-type","cache-control","expires"].indexOf(Pe.toLowerCase())>-1)&&delete n[Pe],Pe.toLowerCase()==="host"&&(f=De)});var k=e.ForceSignHost!==!1;!f&&e.SignHost&&k&&(n.Host=e.SignHost);var S=!1,E=function(Pe,ze){S||(S=!0,ze&&ze.XCosSecurityToken&&!ze.SecurityToken&&(ze=l.clone(ze),ze.SecurityToken=ze.XCosSecurityToken,delete ze.XCosSecurityToken),g&&g(Pe,ze))},_=this,ne=e.Bucket||"",Oe=e.Region||"",Ae=e.Key||"";_.options.ForcePathStyle&&ne&&(Ae=ne+"/"+Ae);var ke="/"+Ae,be={},He=e.Scope;if(!He){var $e=e.Action||"",st=e.ResourceKey||e.Key||"";He=e.Scope||[{action:$e,bucket:ne,region:Oe,prefix:st}]}var it=l.md5(JSON.stringify(He));_._StsCache=_._StsCache||[],function(){var De,Pe;for(De=_._StsCache.length-1;De>=0;De--){Pe=_._StsCache[De];var ze=Math.round(l.getSkewTime(_.options.SystemClockOffset)/1e3)+30;if(Pe.StartTime&&ze=Pe.ExpiredTime){_._StsCache.splice(De,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 ze=l.getAuth({SecretId:be.TmpSecretId,SecretKey:be.TmpSecretKey,Method:e.Method,Pathname:ke,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:_.options.UseRawKey,SystemClockOffset:_.options.SystemClockOffset,KeyTime:Pe,ForceSignHost:k}),Ke={Authorization:ze,SecurityToken:be.SecurityToken||be.XCosSecurityToken||"",Token:be.Token||"",ClientIP:be.ClientIP||"",ClientUA:be.ClientUA||""};E(null,Ke)},at=function(Pe){if(Pe.Authorization){var ze=!1,Ke=Pe.Authorization;if(Ke)if(Ke.indexOf(" ")>-1)ze=!1;else if(Ke.indexOf("q-sign-algorithm=")>-1&&Ke.indexOf("q-ak=")>-1&&Ke.indexOf("q-sign-time=")>-1&&Ke.indexOf("q-key-time=")>-1&&Ke.indexOf("q-url-param-list=")>-1)ze=!0;else try{Ke=atob(Ke),Ke.indexOf("a=")>-1&&Ke.indexOf("k=")>-1&&Ke.indexOf("t=")>-1&&Ke.indexOf("r=")>-1&&Ke.indexOf("b=")>-1&&(ze=!0)}catch(nt){}if(!ze)return l.error(new Error("getAuthorization callback params format error"))}else{if(!Pe.TmpSecretId)return l.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!Pe.TmpSecretKey)return l.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!Pe.SecurityToken&&!Pe.XCosSecurityToken)return l.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!Pe.ExpiredTime)return l.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(Pe.ExpiredTime&&Pe.ExpiredTime.toString().length!==10)return l.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(Pe.StartTime&&Pe.StartTime.toString().length!==10)return l.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(be.ExpiredTime&&be.ExpiredTime-l.getSkewTime(_.options.SystemClockOffset)/1e3>60)et();else if(_.options.getAuthorization)_.options.getAuthorization.call(_,{Bucket:ne,Region:Oe,Method:e.Method,Key:Ae,Pathname:ke,Query:e.Query,Headers:n,Scope:He,SystemClockOffset:_.options.SystemClockOffset,ForceSignHost:k},function(De){typeof De=="string"&&(De={Authorization:De});var Pe=at(De);if(Pe)return E(Pe);De.Authorization?E(null,De):(be=De||{},be.Scope=He,be.ScopeKey=it,_._StsCache.push(be),et())});else if(_.options.getSTS)_.options.getSTS.call(_,{Bucket:ne,Region:Oe},function(De){be=De||{},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 E(Pe);_._StsCache.push(be),et()});else return function(){var De=l.getAuth({SecretId:e.SecretId||_.options.SecretId,SecretKey:e.SecretKey||_.options.SecretKey,Method:e.Method,Pathname:ke,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:_.options.UseRawKey,SystemClockOffset:_.options.SystemClockOffset,ForceSignHost:k}),Pe={Authorization:De,SecurityToken:_.options.SecurityToken||_.options.XCosSecurityToken};return E(null,Pe),Pe}();return""}function Me(e){var g=!1,n=!1,f=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&&f){var E=Date.parse(f);this.options.CorrectClockSkew&&Math.abs(l.getSkewTime(this.options.SystemClockOffset)-E)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=E-Date.now(),g=!0)}else Math.floor(e.statusCode/100)===5&&(g=!0);return g}function ce(e,g){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=l.clearKey(e.qs),e.headers&&(e.headers=l.clearKey(e.headers)),e.qs&&(e.qs=l.clearKey(e.qs));var f=l.clone(e.qs);e.action&&(f[e.action]="");var k=e.url||e.Url,S=e.SignHost||he.call(this,{Bucket:e.Bucket,Region:e.Region,Url:k}),E=e.tracker,_=function ne(Oe){var Ae=n.options.SystemClockOffset;E&&E.setParams({signStartTime:new Date().getTime(),retryTimes:Oe-1}),Re.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:f,Headers:e.headers,SignHost:S,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:n.options.ForceSignHost},function(ke,be){if(ke){g(ke);return}E&&E.setParams({signEndTime:new Date().getTime(),httpStartTime:new Date().getTime()}),e.AuthData=be,Je.call(n,e,function(He,$e){E&&E.setParams({httpEndTime:new Date().getTime()}),He&&Oe<2&&(Ae!==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"]),ne(Oe+1)):g(He,$e)})})};_(1)}function Je(e,g){var n=this,f=e.TaskId;if(!(f&&!n._isRunningTask(f))){var k=e.Bucket,S=e.Region,E=e.Key,_=e.method||"GET",ne=e.Url||e.url,Oe=e.body,Ae=e.rawBody;n.options.UseAccelerate&&(S="accelerate"),ne=ne||H({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:k,region:S,object:E}),e.action&&(ne=ne+"?"+(l.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(ne.indexOf("?")>-1?ne=ne+"&"+e.qsStr:ne=ne+"?"+e.qsStr);var ke={method:_,url:ne,headers:e.headers,qs:e.qs,body:Oe},be="x-cos-security-token";if(l.isCIHost(ne)&&(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=l.clearKey(ke.headers)),ke=l.clearKey(ke),e.onProgress&&typeof e.onProgress=="function"){var He=Oe&&(Oe.size||Oe.length)||0;ke.onProgress=function(De){if(!(f&&!n._isRunningTask(f))){var Pe=De?De.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 $e=ke.url.includes("accelerate."),st=ke.qs?Object.keys(ke.qs).map(function(De){return"".concat(De,"=").concat(ke.qs[De])}).join("&"):"",it=st?ke.url+"?"+st:ke.url;e.tracker&&e.tracker.setParams({reqUrl:it,accelerate:$e?"Y":"N"}),e.tracker&&e.tracker.parent&&e.tracker.parent.setParams({reqUrl:it,accelerate:$e?"Y":"N"});var et=(n.options.Request||x)(ke,function(De){if(!(De&&De.error==="abort")){var Pe={options:ke,error:De&&De.error,statusCode:De&&De.statusCode||0,statusMessage:De&&De.statusMessage||"",headers:De&&De.headers||{},body:De&&De.body};n.emit("after-receive",Pe);var ze=Pe.error,Ke=Pe.body,nt={statusCode:Pe.statusCode,statusMessage:Pe.statusMessage,headers:Pe.headers},pt,ut=function(ft,gt){if(f&&n.off("inner-kill-task",at),!pt){pt=!0;var ht={};nt&&nt.statusCode&&(ht.statusCode=nt.statusCode),nt&&nt.headers&&(ht.headers=nt.headers),ft?(ft=l.extend(ft||{},ht),g(ft,null)):(gt=l.extend(gt||{},ht),g(null,gt)),et=null}};if(ze)return ut(l.error(ze));var lt=nt.statusCode,vt=Math.floor(lt/100)===2;if(Ae&&vt)return ut(null,{body:Ke});var ct;try{ct=Ke&&Ke.indexOf("<")>-1&&Ke.indexOf(">")>-1&&l.xml2json(Ke)||{}}catch(yt){ct={}}var dt=ct&&ct.Error;vt?ut(null,ct):dt?ut(l.error(new Error(dt.Message),{code:dt.Code,error:dt})):lt?ut(l.error(new Error(nt.statusMessage),{code:""+lt})):lt&&ut(l.error(new Error("statusCode error")))}}),at=function De(Pe){Pe.TaskId===f&&(et&&et.abort&&et.abort(),n.off("inner-kill-task",De))};f&&n.on("inner-kill-task",at)}}var Qe={getService:T,putBucket:U,headBucket:K,getBucket:O,deleteBucket:I,putBucketAcl:z,getBucketAcl:q,putBucketCors:X,getBucketCors:F,deleteBucketCors:L,getBucketLocation:$,getBucketPolicy:ee,putBucketPolicy:Y,deleteBucketPolicy:B,putBucketTagging:m,getBucketTagging:C,deleteBucketTagging:V,putBucketLifecycle:y,getBucketLifecycle:M,deleteBucketLifecycle:j,putBucketVersioning:w,getBucketVersioning:D,putBucketReplication:A,getBucketReplication:N,deleteBucketReplication:G,putBucketWebsite:W,getBucketWebsite:Z,deleteBucketWebsite:ie,putBucketReferer:le,getBucketReferer:ae,putBucketDomain:oe,getBucketDomain:de,deleteBucketDomain:ue,putBucketOrigin:me,getBucketOrigin:te,deleteBucketOrigin:re,putBucketLogging:pe,getBucketLogging:Ce,putBucketInventory:ye,postBucketInventory:Se,getBucketInventory:xe,listBucketInventory:Ee,deleteBucketInventory:Ie,putBucketAccelerate:we,getBucketAccelerate:_e,putBucketEncryption:je,getBucketEncryption:Ue,deleteBucketEncryption:se,getObject:o,headObject:d,listObjectVersions:i,putObject:a,deleteObject:v,getObjectAcl:R,putObjectAcl:P,optionsObject:J,putObjectCopy:fe,deleteMultipleObject:Q,restoreObject:Te,putObjectTagging:Ne,getObjectTagging:Fe,deleteObjectTagging:Be,selectObjectContent:Le,appendObject:tt,uploadPartCopy:ge,multipartInit:Ve,multipartUpload:Ge,multipartComplete:We,multipartList:qe,multipartListPart:Xe,multipartAbort:Ye,request:ot,getObjectUrl:c,getAuth:rt};function Ze(e,g,n){l.each(["Cors","Acl"],function(f){if(e.slice(-f.length)===f){var k=e.slice(0,-f.length)+f.toUpperCase(),S=l.apiWrapper(e,g),E=!1;n[k]=function(){!E&&console.warn("warning: cos."+k+" has been deprecated. Please Use cos."+e+" instead."),E=!0,S.apply(this,arguments)}}})}r.exports.init=function(e,g){g.transferToTaskMethod(Qe,"putObject"),l.each(Qe,function(n,f){e.prototype[f]=l.apiWrapper(f,n),Ze(f,n,e.prototype)})}},"./src/cos.js":function(r,p,s){var u=s("./src/util.js"),x=s("./src/event.js"),l=s("./src/task.js"),T=s("./src/base.js"),U=s("./src/advance.js"),K=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:""},I=function(q){this.options=u.extend(u.clone(O),q||{}),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格式错误,请检查"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey格式错误,请检查"),console.error("error: SecretKey format is incorrect. Please check")),u.isNode()&&(console.warn("warning: cos-js-sdk-v5 不支持 nodejs 环境使用,请改用 cos-nodejs-sdk-v5,参考文档: https://cloud.tencent.com/document/product/436/8629"),console.warn("warning: cos-js-sdk-v5 does not support nodejs environment. Please use cos-nodejs-sdk-v5 instead. See: https://cloud.tencent.com/document/product/436/8629")),x.init(this),l.init(this)};T.init(I,l),U.init(I,l),I.util={md5:u.md5,xml2json:u.xml2json,json2xml:u.json2xml,encodeBase64:u.encodeBase64},I.getAuthorization=u.getAuth,I.version=K.version,r.exports=I},"./src/event.js":function(r,p){var s=function(l){var T={},U=function(O){return!T[O]&&(T[O]=[]),T[O]};l.on=function(K,O){K==="task-list-update"&&console.warn('warning: Event "'+K+'" has been deprecated. Please use "list-update" instead.'),U(K).push(O)},l.off=function(K,O){for(var I=U(K),z=I.length-1;z>=0;z--)O===I[z]&&I.splice(z,1)},l.emit=function(K,O){for(var I=U(K).map(function(q){return q}),z=0;z=0;$--){var Y=T[$][2];(!Y||Y+l=0;Y--){var ee=T[Y];ee[0]===F&&ee[1]===L&&T.splice(Y,1)}T.unshift([F,L,Math.round(Date.now()/1e3)]),T.length>$&&T.splice($),z()}},removeUploadId:function(F){I.call(this),delete q.using[F];for(var L=T.length-1;L>=0;L--)T[L][1]===F&&T.splice(L,1);z()}};r.exports=q},"./src/task.js":function(r,p,s){var u=s("./src/session.js"),x=s("./src/util.js"),l={},T=function(O,I){l[I]=O[I],O[I]=function(z,q){z.SkipTask?l[I].call(this,z,q):this._addTask(I,z,q)}},U=function(O){var I=[],z={},q=0,X=0,F=function(C){var V={id:C.id,Bucket:C.Bucket,Region:C.Region,Key:C.Key,FilePath:C.FilePath,state:C.state,loaded:C.loaded,size:C.size,speed:C.speed,percent:C.percent,hashPercent:C.hashPercent,error:C.error};return C.FilePath&&(V.FilePath=C.FilePath),C._custom&&(V._custom=C._custom),V},L=function(){var m,C=function(){m=0,O.emit("task-list-update",{list:x.map(I,F)}),O.emit("list-update",{list:x.map(I,F)})};return function(){m||(m=setTimeout(C))}}(),$=function(){if(!(I.length<=O.options.UploadQueueSize)){for(var C=0;CO.options.UploadQueueSize;){var V=I[C].state==="waiting"||I[C].state==="checking"||I[C].state==="uploading";!I[C]||!V?(z[I[C].id]&&delete z[I[C].id],I.splice(C,1),X--):C++}L()}},Y=function m(){if(!(q>=O.options.FileParallelLimit)){for(;I[X]&&I[X].state!=="waiting";)X++;if(!(X>=I.length)){var C=I[X];X++,q++,C.state="checking",C.params.onTaskStart&&C.params.onTaskStart(F(C)),!C.params.UploadData&&(C.params.UploadData={});var V=x.formatParams(C.api,C.params);l[C.api].call(O,V,function(y,M){O._isRunningTask(C.id)&&((C.state==="checking"||C.state==="uploading")&&(C.state=y?"error":"success",y&&(C.error=y),q--,L(),m(),C.callback&&C.callback(y,M),C.state==="success"&&(C.params&&(delete C.params.UploadData,delete C.params.Body,delete C.params),delete C.callback)),$())}),L(),setTimeout(m)}}},ee=function(C,V){var y=z[C];if(y){var M=y&&y.state==="waiting",j=y&&(y.state==="checking"||y.state==="uploading");if(V==="canceled"&&y.state!=="canceled"||V==="paused"&&M||V==="paused"&&j){if(V==="paused"&&y.params.Body&&typeof y.params.Body.pipe=="function"){console.error("stream not support pause");return}y.state=V,O.emit("inner-kill-task",{TaskId:C,toState:V});try{var w=y&&y.params&&y.params.UploadData.UploadId}catch(D){}V==="canceled"&&w&&u.removeUsing(w),L(),j&&(q--,Y()),V==="canceled"&&(y.params&&(delete y.params.UploadData,delete y.params.Body,delete y.params),delete y.callback)}$()}};O._addTasks=function(m){x.each(m,function(C){O._addTask(C.api,C.params,C.callback,!0)}),L()};var B=!0;O._addTask=function(m,C,V,y){C=x.formatParams(m,C);var M=x.uuid();C.TaskId=M,C.onTaskReady&&C.onTaskReady(M),C.TaskReady&&(C.TaskReady(M),B&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),B=!1);var j={params:C,callback:V,api:m,index:I.length,id:M,Bucket:C.Bucket,Region:C.Region,Key:C.Key,FilePath:C.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:C._custom},w=C.onHashProgress;C.onHashProgress=function(A){O._isRunningTask(j.id)&&(j.hashPercent=A.percent,w&&w(A),L())};var D=C.onProgress;return C.onProgress=function(A){O._isRunningTask(j.id)&&(j.state==="checking"&&(j.state="uploading"),j.loaded=A.loaded,j.speed=A.speed,j.percent=A.percent,D&&D(A),L())},x.getFileSize(m,C,function(A,N){if(A)return V(x.error(A));z[M]=j,I.push(j),j.size=N,!y&&L(),Y(),$()}),M},O._isRunningTask=function(m){var C=z[m];return!!(C&&(C.state==="checking"||C.state==="uploading"))},O.getTaskList=function(){return x.map(I,F)},O.cancelTask=function(m){ee(m,"canceled")},O.pauseTask=function(m){ee(m,"paused")},O.restartTask=function(m){var C=z[m];C&&(C.state==="paused"||C.state==="error")&&(C.state="waiting",L(),X=Math.min(X,C.index),Y())},O.isUploadRunning=function(){return q||X"u"?"undefined":l(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>"u"?"undefined":l(navigator))!=="object")return"unknown os";var m=navigator.userAgent.toLowerCase(),C=/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":C?"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>"u"?"undefined":l(navigator))==="object"&&navigator.userAgent.match(m))},isAndroid:function(){var m=/(Android|Adr|Linux)/i;return!!((typeof navigator>"u"?"undefined":l(navigator))==="object"&&navigator.userAgent.match(m))},isIOS:function(){var m=/(iPhone|iPod|iPad|iOS)/i;return!!((typeof navigator>"u"?"undefined":l(navigator))==="object"&&navigator.userAgent.match(m))},isOtherMobile:function(){return isMobile&&!isAndroid&&!isIOS},getDeviceName:function(){if((typeof navigator>"u"?"undefined":l(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 C=m.match(/maxthon\/([\d.]+)/),V=C&&C[1]||"";return"傲游浏览器 ".concat(V).trim()}if(m.indexOf("qqbrowser")>=0){var y=m.match(/qqbrowser\/([\d.]+)/),M=y&&y[1]||"";return"QQ浏览器 ".concat(M).trim()}if(m.indexOf("se 2.x")>=0)return"搜狗浏览器";if(m.indexOf("wxwork")>=0)return"微信内置浏览器";if(m.indexOf("msie")>=0){var j=m.match(/msie ([\d.]+)/),w=j&&j[1]||"";return"IE ".concat(w).trim()}if(m.indexOf("firefox")>=0){var D=m.match(/firefox\/([\d.]+)/),A=D&&D[1]||"";return"Firefox ".concat(A).trim()}if(m.indexOf("chrome")>=0){var N=m.match(/chrome\/([\d.]+)/),G=N&&N[1]||"";return"Chrome ".concat(G).trim()}if(m.indexOf("opera")>=0){var W=m.match(/opera.([\d.]+)/),Z=W&&W[1]||"";return"Opera ".concat(Z).trim()}if(m.indexOf("safari")>=0){var ie=m.match(/version\/([\d.]+)/),le=ie&&ie[1]||"";return"Safari ".concat(le).trim()}if(m.indexOf("edge")>=0){var ae=m.match(/edge\/([\d.]+)/),oe=ae&&ae[1]||"";return"edge ".concat(oe).trim()}return m.substr(0,200)}},I={isMobile:O.isMobile(),isBrowser:!O.isMobile(),mobileOsType:O.isAndroid()?"android":O.isIOS?"ios":"other_mobile",pcOsType:O.getOsType()},z={deviceType:I.isMobile?"mobile":I.isBrowser?"browser":"unknown",devicePlatform:I.isMobile?I.mobileOsType:I.pcOsType,deviceName:O.getDeviceName()},q=["multipartInit","multipartUpload","multipartComplete","multipartList","multipartListPart","multipartAbort"],X=["putObject","postObject","appendObject","sliceUploadFile","uploadFile","uploadFiles"].concat(q),F=["getObject"];function L(B){return X.includes(B)?"cos_upload":F.includes(B)?"cos_download":"base_service"}function $(B){return B.replace(/([A-Z])/g,"_$1").toLowerCase()}function Y(B){var m={},C=["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"],V=["tracePlatform","cossdkVersion","region","bucket","appid","networkType","host","accelerate","requestPath","partNumber","size","name","result","tookTime","errorRequestId","retryTimes","reqUrl","customId","deviceType","devicePlatform","deviceName"],y=B.result==="Success"?V:C;for(var M in B)if(y.includes(M)){var j=$(M);m[j]=B[M]}return m}var ee=function(){function B(m){u(this,B);var C=m.parent,V=m.traceId,y=m.bucket,M=m.region,j=m.apiName,w=m.fileKey,D=m.fileSize,A=m.accelerate,N=m.customId,G=m.delay,W=m.deepTracker,Z=y&&y.substr(y.lastIndexOf("-")+1)||"";this.parent=C,this.deepTracker=W,this.delay=G,this.params={cossdkVersion:T.version,region:M,networkType:"",host:"",accelerate:A?"Y":"N",requestPath:w||"",size:D||-1,httpMd5:0,httpSign:0,httpFull:0,name:j||"",result:"",tookTime:0,errorNode:"",errorCode:"",errorMessage:"",errorRequestId:"",errorStatusCode:0,errorServiceName:"",tracePlatform:"cos-js-sdk-v5",traceId:V||O.getUid(),bucket:y,appid:Z,partNumber:0,retryTimes:0,reqUrl:"",customId:N||"",deviceType:z.deviceType,devicePlatform:z.devicePlatform,deviceName:z.deviceName,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:new Date().getTime(),endTime:0},this.beacon=K(G)}return x(B,[{key:"formatResult",value:function(C,V){var y,M,j,w,D,A,N=new Date().getTime(),G=N-this.params.startTime,W=O.getNetType(),Z=C?(C==null?void 0:C.code)||(C==null||(y=C.error)===null||y===void 0?void 0:y.code)||(C==null||(M=C.error)===null||M===void 0?void 0:M.Code):"",ie=C?(C==null?void 0:C.message)||(C==null||(j=C.error)===null||j===void 0?void 0:j.message)||(C==null||(w=C.error)===null||w===void 0?void 0:w.Message):"",le=C?(C==null?void 0:C.resource)||(C==null||(D=C.error)===null||D===void 0?void 0:D.resource)||(C==null||(A=C.error)===null||A===void 0?void 0:A.Resource):"",ae=C?C==null?void 0:C.statusCode:V.statusCode,oe=C?(C==null?void 0:C.headers)&&(C==null?void 0:C.headers["x-cos-request-id"]):(V==null?void 0:V.headers)&&(V==null?void 0:V.headers["x-cos-request-id"]),de=C?oe?"Server":"Client":"";if(Object.assign(this.params,{tookTime:G,networkType:W,httpMd5:this.params.md5EndTime-this.params.md5StartTime,httpSign:this.params.signEndTime-this.params.signStartTime,httpFull:this.params.httpEndTime-this.params.httpStartTime,result:C?"Fail":"Success",errorType:de,errorCode:Z,errorStatusCode:ae,errorMessage:ie,errorServiceName:le,errorRequestId:oe}),C&&(!Z||!ie)&&(this.params.fullError=C?JSON.stringify(C):""),this.params.name==="getObject"&&(this.params.size=V?V.headers&&V.headers["content-length"]:-1),this.params.reqUrl)try{var ue=/^http(s)?:\/\/(.*?)\//.exec(this.params.reqUrl);this.params.host=ue[2]}catch(me){this.params.host=this.params.reqUrl}this.sendEvents()}},{key:"setParams",value:function(C){Object.assign(this.params,C)}},{key:"sendEvents",value:function(){if(!(q.includes(this.params.name)&&!this.deepTracker)){var C=L(this.params.name),V=Y(this.params);this.beacon||(this.beacon=K(this.delay||5e3)),this.delay===0?this.beacon&&this.beacon.onDirectUserAction(C,V):this.beacon&&this.beacon.onUserAction(C,V)}}},{key:"generateSubTracker",value:function(C){return Object.assign(C,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay}),new B(C)}}]),B}();r.exports=ee},"./src/util.js":function(r,p,s){(function(u){var x=s("./node_modules/@babel/runtime/helpers/typeof.js"),l=s("./lib/md5.js"),T=s("./lib/crypto.js"),U=s("./lib/xml2json.js"),K=s("./lib/json2xml.js"),O=s("./lib/base64.js"),I=s("./src/tracker.js");function z(se){return encodeURIComponent(se).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function q(se,d){var i=[];for(var o in se)se.hasOwnProperty(o)&&i.push(d?z(o).toLowerCase():o);return i.sort(function(a,v){return a=a.toLowerCase(),v=v.toLowerCase(),a===v?0:a>v?1:-1})}var X=function(d,i){var o,a,v,R=[],P=q(d);for(o=0;o-1||F.indexOf(a)>-1)&&(i[o]=d[o])}return i},$=function(d){d=d||{};var i=d.SecretId,o=d.SecretKey,a=d.KeyTime,v=(d.method||d.Method||"get").toLowerCase(),R=N(d.Query||d.params||{}),P=L(N(d.Headers||d.headers||{})),J=d.Key||"",fe;d.UseRawKey?fe=d.Pathname||d.pathname||"/"+J:(fe=d.Pathname||d.pathname||J,fe.indexOf("/")!==0&&(fe="/"+fe));var ge=d.ForceSignHost!==!1;if(!P.Host&&!P.host&&d.Bucket&&d.Region&&ge&&(P.Host=d.Bucket+".cos."+d.Region+".myqcloud.com"),!i)throw new Error("missing param SecretId");if(!o)throw new Error("missing param SecretKey");var Q=Math.round(ye(d.SystemClockOffset)/1e3)-1,Te=Q,Ne=d.Expires||d.expires;Ne===void 0?Te+=900:Te+=Ne*1||0;var Fe="sha1",Be=i,Le=a||Q+";"+Te,Ve=a||Q+";"+Te,Ge=q(P,!0).join(";").toLowerCase(),We=q(R,!0).join(";").toLowerCase(),qe=T.HmacSHA1(Ve,o).toString(),Xe=[v,fe,Ue.obj2str(R,!0),Ue.obj2str(P,!0),""].join(`
`),Ye=["sha1",Le,T.SHA1(Xe).toString(),""].join(`
`),ot=T.HmacSHA1(Ye,qe).toString(),tt=["q-sign-algorithm="+Fe,"q-ak="+Be,"q-sign-time="+Le,"q-key-time="+Ve,"q-header-list="+Ge,"q-url-param-list="+We,"q-signature="+ot].join("&");return tt},Y=function(d,i,o){var a=i/8,v=d.slice(o,o+a);return new Uint8Array(v).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[i](v)[0]},ee=function(d,i,o,a){var v=d.slice(i,o),R="";return new Uint8Array(v).forEach(function(P){R+=String.fromCharCode(P)}),a&&(R=decodeURIComponent(escape(R))),R},B=function(d){for(var i={},o=ee(d),a={records:[]};d.byteLength;){var v=Y(d,32,0),R=Y(d,32,4),P=v-R-16,J=0,fe;for(d=d.slice(12);JparseInt(a[v])?1:-1;return 0},d=function(o){if(!o)return!1;var a=(o.match(/Chrome\/([.\d]+)/)||[])[1],v=(o.match(/QBCore\/([.\d]+)/)||[])[1],R=(o.match(/QQBrowser\/([.\d]+)/)||[])[1],P=a&&se(a,"53.0.2785.116")<0&&v&&se(v,"3.53.991.400")<0&&R&&se(R,"9.0.2524.400")<=0||!1;return P};return d(typeof navigator<"u"&&navigator.userAgent)}(),j=function(d,i,o,a,v){var R;if(d.slice?R=d.slice(i,o):d.mozSlice?R=d.mozSlice(i,o):d.webkitSlice&&(R=d.webkitSlice(i,o)),a&&M){var P=new FileReader;P.onload=function(J){R=null,v(new Blob([P.result]))},P.readAsArrayBuffer(R)}else v(R)},w=function(d,i,o,a){o=o||C,d?typeof i=="string"?o(Ue.md5(i,!0)):Blob&&i instanceof Blob?Ue.getFileMd5(i,function(v,R){o(R)},a):o():o()},D=1024*1024,A=function(d,i,o){var a=d.size,v=0,R=l.getCtx(),P=function J(fe){if(fe>=a){var ge=R.digest("hex");i(null,ge);return}var Q=Math.min(a,fe+D);Ue.fileSlice(d,fe,Q,!1,function(Te){y(Te,function(Ne){Te=null,R=R.update(Ne,!0),v+=Ne.length,Ne=null,o&&o({loaded:v,total:a,percent:Math.round(v/a*1e4)/1e4}),J(fe+D)})})};P(0)};function N(se){return oe(se,function(d){return x(d)==="object"&&d!==null?N(d):d})}function G(se,d,i){return se&&d in se?se[d]:i}function W(se,d){return ae(d,function(i,o){se[o]=d[o]}),se}function Z(se){return se instanceof Array}function ie(se,d){for(var i=!1,o=0;o-1,J=!R||typeof R=="string"&&R.indexOf("{Region}")>-1;if(d.indexOf("Bucket")>-1||d==="deleteMultipleObject"||d==="multipartList"||d==="listObjectVersions"){if(P&&!o)return"Bucket";if(J&&!a)return"Region"}else if(d.indexOf("Object")>-1||d.indexOf("multipart")>-1||d==="sliceUploadFile"||d==="abortUploadTask"){if(P&&!o)return"Bucket";if(J&&!a)return"Region";if(!v)return"Key"}return!1},re=function(d,i){if(i=W({},i),d!=="getAuth"&&d!=="getV4Auth"&&d!=="getObjectUrl"){var o=i.Headers||{};if(i&&x(i)==="object"){(function(){for(var v in i)i.hasOwnProperty(v)&&v.indexOf("x-cos-")>-1&&(o[v]=i[v])})();var a={"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(a,function(v,R){i[v]!==void 0&&(o[R]=i[v])}),i.Headers=V(o)}}return i},pe=function(d,i){return function(o,a){var v=this;typeof o=="function"&&(a=o,o={}),o=re(d,o);var R;if(v.options.EnableTracker)if(o.calledBySdk==="sliceUploadFile")R=o.tracker&&o.tracker.generateSubTracker({apiName:d});else if(["uploadFile","uploadFiles"].includes(d))R=null;else{var P=-1;o.Body&&(P=typeof o.Body=="string"?o.Body.length:o.Body.size||o.Body.byteLength||-1),R=new I({bucket:o.Bucket,region:o.Region,apiName:d,fileKey:o.Key,fileSize:P,deepTracker:v.options.DeepTracker,customId:v.options.CustomId,delay:v.options.TrackerDelay})}o.tracker=R;var J=function(Be){return Be&&Be.headers&&(Be.headers["x-cos-request-id"]&&(Be.RequestId=Be.headers["x-cos-request-id"]),Be.headers["x-ci-request-id"]&&(Be.RequestId=Be.headers["x-ci-request-id"]),Be.headers["x-cos-version-id"]&&(Be.VersionId=Be.headers["x-cos-version-id"]),Be.headers["x-cos-delete-marker"]&&(Be.DeleteMarker=Be.headers["x-cos-delete-marker"])),Be},fe=function(Be,Le){R&&R.formatResult(Be,Le),a&&a(J(Be),J(Le))},ge=function(){if(d!=="getService"&&d!=="abortUploadTask"){var Be=te.call(v,d,o);if(Be)return"missing param "+Be;if(o.Region){if(v.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(o.Region))return"Region format error."}else{if(o.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(o.Region))return"Region format error."}!v.options.CompatibilityMode&&o.Region.indexOf("-")===-1&&o.Region!=="yfb"&&o.Region!=="default"&&o.Region!=="accelerate"&&console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(o.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(o.Bucket))if(o.AppId)o.Bucket=o.Bucket+"-"+o.AppId;else if(v.options.AppId)o.Bucket=o.Bucket+"-"+v.options.AppId;else return'Bucket should format as "test-1250000000".';o.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete o.AppId)}!v.options.UseRawKey&&o.Key&&o.Key.substr(0,1)==="/"&&(o.Key=o.Key.substr(1))}},Q=ge(),Te=["getAuth","getObjectUrl"].includes(d);if(typeof Promise=="function"&&!Te&&!a)return new Promise(function(Fe,Be){if(a=function(Ve,Ge){Ve?Be(Ve):Fe(Ge)},Q)return fe(Ue.error(new Error(Q)));i.call(v,o,fe)});if(Q)return fe(Ue.error(new Error(Q)));var Ne=i.call(v,o,fe);if(Te)return Ne}},Ce=function(d,i){var o=this,a=0,v=0,R=Date.now(),P,J;function fe(){if(J=0,i&&typeof i=="function"){P=Date.now();var ge=Math.max(0,Math.round((v-a)/((P-R)/1e3)*100)/100)||0,Q;v===0&&d===0?Q=1:Q=Math.floor(v/d*100)/100||0,R=P,a=v;try{i({loaded:v,total:d,speed:ge,percent:Q})}catch(Te){}}}return function(ge,Q){if(ge&&(v=ge.loaded,d=ge.total),Q)clearTimeout(J),fe();else{if(J)return;J=setTimeout(fe,o.options.ProgressInterval)}}},ve=function(d,i,o){var a;if(typeof i.Body=="string"?i.Body=new Blob([i.Body],{type:"text/plain"}):i.Body instanceof ArrayBuffer&&(i.Body=new Blob([i.Body])),i.Body&&(i.Body instanceof Blob||i.Body.toString()==="[object File]"||i.Body.toString()==="[object Blob]"))a=i.Body.size;else{o(Ue.error(new Error("params body format error, Only allow File|Blob|String.")));return}i.ContentLength=a,o(null,a)},ye=function(d){return Date.now()+(d||0)},Se=function(d,i){var o=d;return d.message=d.message||null,typeof i=="string"?(d.error=i,d.message=i):x(i)==="object"&&i!==null&&(W(d,i),(i.code||i.name)&&(d.code=i.code||i.name),i.message&&(d.message=i.message),i.stack&&(d.stack=i.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(d,"name",{writable:!0,enumerable:!1}),Object.defineProperty(d,"message",{enumerable:!0})),d.name=i&&i.name||d.name||d.code||"Error",d.code||(d.code=d.name),d.error||(d.error=N(o)),d},xe=function(){return(typeof globalThis>"u"?"undefined":x(globalThis))==="object"&&(globalThis.constructor.name==="DedicatedWorkerGlobalScope"||globalThis.FileReaderSync)},Ee=function(){return(typeof window>"u"?"undefined":x(window))!=="object"&&(typeof u>"u"?"undefined":x(u))==="object"&&!0&&!xe()},Ie=function(d){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(d)},we=function(){if((typeof navigator>"u"?"undefined":x(navigator))!=="object")return!1;var se=navigator.userAgent,d=!!se.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return d}(),_e=function(){return(typeof navigator>"u"?"undefined":x(navigator))!=="object"?!1:/\sQQ/i.test(navigator.userAgent)}(),je=function(d,i){var o=O.encode(d);return i&&(o=o.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),o},Ue={noop:C,formatParams:re,apiWrapper:pe,xml2json:U,json2xml:K,md5:l,clearKey:V,fileSlice:j,getBodyMd5:w,getFileMd5:A,b64:ue,extend:W,isArray:Z,isInArray:ie,makeArray:le,each:ae,map:oe,filter:de,clone:N,attr:G,uuid:me,camSafeUrlEncode:z,throttleOnProgress:Ce,getFileSize:ve,getSkewTime:ye,error:Se,obj2str:X,getAuth:$,parseSelectPayload:B,getSourceParams:m,isBrowser:!0,isNode:Ee,isCIHost:Ie,isIOS_QQ:we&&_e,encodeBase64:je};r.exports=Ue}).call(this,s("./node_modules/process/browser.js"))}})})})(cosJsSdkV5);const COS=getDefaultExportFromCjs(cosJsSdkV5Exports),ossSwitch="tencent",tencentBucket="daya-online-1303457149",getUploadSign=async r=>{const{bucketName:p,filename:s,postData:u}=r,x=ossSwitch;let l=p,T=s,U={};return l=tencentBucket,T="gym/"+s,U={key:"gym/"+u.key},request.post("/api-web/getUploadSign",{data:{postData:U,pluginName:x,bucketName:l,filename:T},params:{pluginName:x}})},onOnlyFileUpload=async(r,p)=>{{let s="",u=null;if(console.log(p,"params"),await new COS({Domain:"https://oss.dayaedu.com",getAuthorization:async(l,T)=>{T({Authorization:p.signature})}}).uploadFile({Bucket:tencentBucket,Region:"ap-nanjing",Key:`gym/${p.name}`,Body:p.file,SliceSize:1024*1024*500}).then(l=>{var T;((T=l.Location)==null?void 0:T.indexOf("http"))>=0?s=l.Location:s="https://"+l.Location}).catch(l=>{u=l}),s)return s;throw new Error(u)}},MUploader=defineComponent({name:"col-upload",props:{modelValue:{type:Array,default:()=>[]},deletable:{type:Boolean,default:!0},maxCount:{type:Number,default:1},native:{type:Boolean,default:!1},uploadSize:{type:Number,default:5},uploadType:{type:String,default:"IMAGE"},accept:{type:String,default:"image/*"},bucket:{type:String,default:"gyt"},path:{type:String,default:""},uploadIcon:{type:String,default:iconUploader},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},position:{type:String,default:"outside"}},emits:["uploadChange","update:modelValue"],methods:{nativeUpload(){if(this.disabled)return;const r=this.uploadType==="VIDEO"?"video":"img";let p=1;this.maxCount>1?p=this.maxCount-this.modelValue.length:p=this.maxCount,postMessage({api:"chooseFile",content:{type:r,max:p,bucket:this.bucket,path:this.path}},s=>{if(console.log(s,"fileUrl"),this.maxCount>1){const u=s.fileUrl;console.log(u,"files"),this.$emit("update:modelValue",[...this.modelValue,...u.split(",")]),this.$emit("uploadChange",[...this.modelValue,...u.split(",")])}else this.$emit("update:modelValue",[s.fileUrl]),this.$emit("uploadChange",[s.fileUrl])})},beforeRead(r){return console.log(r,"beforeRead"),r.size/1024/1024x==p);u>-1&&(s.splice(u,1),this.$emit("update:modelValue",s),this.$emit("uploadChange")),r.stopPropagation()},async getFile(r){try{await this.uploadFile(r)}catch(p){}},async uploadFile(r){try{const p=r.name||"",s=this.path?this.path+"/"+(p&&p.replace(/ /gi,"_")):p&&p.replace(/ /gi,"_"),u=new Date().getTime()+s;console.log(r);const{data:x}=await getUploadSign({filename:u,bucketName:this.bucket,postData:{filename:u,acl:"public-read",key:u,unknowValueField:[]}});showLoadingToast({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0});const l={policy:x.policy,signature:x.signature,key:u,KSSAccessKeyId:x.kssAccessKeyId,acl:"public-read",name:u,file:r},T=await onOnlyFileUpload(getOssUploadUrl(this.bucket),l);closeToast(),this.maxCount>1?(this.$emit("update:modelValue",[...this.modelValue,T]),this.$emit("uploadChange",[...this.modelValue,T])):(this.$emit("update:modelValue",[T]),this.$emit("uploadChange",[T]))}catch(p){console.log(p,"uploadFile")}}},render(){return useCustomFieldValue(()=>this.modelValue),createVNode("div",{class:styles["uploader-section"]},[this.modelValue.length>0&&this.maxCount>1&&this.modelValue.map(r=>createVNode("div",{class:["van-uploader",styles.uploader,styles[this.size]]},[this.deletable&&!this.disabled&&createVNode(Icon,{name:"cross",onClick:p=>this.onClose(p,r),class:styles["img-close"]},null),createVNode("div",{class:["van-uploader__upload"]},[this.uploadType==="IMAGE"?createVNode(Image,{src:r,class:styles.previewImg,fit:"cover"},null):createVNode("video",{ref:"videoUpload",style:{backgroundColor:"#F8F8F8"},class:styles.previewImg,poster:iconVideoDefault,src:r+"#t=1,4"},null)])])),this.native?this.maxCount>1?this.modelValue.length0?createVNode("div",{class:["van-uploader__upload"]},[this.modelValue.map(r=>createVNode(Fragment,null,[this.deletable&&!this.disabled&&createVNode(Icon,{name:"cross",onClick:p=>this.onClose(p,r),class:[styles["img-close"],styles.singleImgClose]},null),this.uploadType==="IMAGE"?createVNode(Image,{fit:"cover",position:"center",class:styles.uploadImg,src:r},null):createVNode("video",{ref:"videoUpload",class:styles.uploadImg,style:{backgroundColor:"#F8F8F8"},poster:iconVideoDefault,src:r+"#t=1,4"},null)]))]):createVNode(Icon,{name:this.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]):this.maxCount>1?this.modelValue.length[this.modelValue.length>0?createVNode("div",{class:["van-uploader__upload"]},[this.modelValue.map(r=>createVNode(Fragment,null,[this.deletable&&!this.disabled&&createVNode(Icon,{name:"cross",onClick:p=>this.onClose(p,r),class:[styles["img-close"],styles.singleImgClose]},null),this.uploadType==="IMAGE"?createVNode(Image,{fit:"cover",position:"center",class:styles.uploadImg,src:r},null):createVNode("video",{ref:"videoUpload",class:styles.uploadImg,style:{backgroundColor:"#F8F8F8"},poster:iconVideoDefault,src:r+"#t=1,4"},null)]))]):createVNode(Icon,{name:this.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]}),this.$slots.default&&this.$slots.default()])}});export{MUploader as M,Uploader as U,iconUploader as a,getUploadSign as g,iconVideoDefault as i,onOnlyFileUpload as o,styles as s};