!function(){function e(e,t,a,n,o,l,r){try{var i=e[l](r),u=i.value}catch(s){return void a(s)}i.done?t(u):Promise.resolve(u).then(n,o)}function t(t){return function(){var a=this,n=arguments;return new Promise((function(o,l){var r=t.apply(a,n);function i(t){e(r,o,l,i,u,"next",t)}function u(t){e(r,o,l,i,u,"throw",t)}i(void 0)}))}}function a(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a1?(e.$emit("update:modelValue",[].concat(a(e.modelValue),[t.fileUrl])),e.onUploadChange([].concat(a(e.modelValue),[t.fileUrl]))):(e.$emit("update:modelValue",[t.fileUrl]),e.onUploadChange([t.fileUrl]))}))}},beforeRead:function(e){return console.log(e,"beforeRead"),!!(e.size/1024/1024-1&&(a.splice(n,1),this.$emit("update:modelValue",a),this.onUploadChange()),e.stopPropagation()},getFile:function(e){var a=this;return t(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,a.uploadFile(e);case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})))()},uploadFile:function(e){var n=this;return t(regeneratorRuntime.mark((function t(){var o,l,s,c,d,p,g;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=e.name||"",l=n.path?n.path+"/"+(o&&o.replace(/ /gi,"_")):o&&o.replace(/ /gi,"_"),s=(new Date).getTime()+l,t.next=6,m({filename:s,bucketName:n.bucket,postData:{filename:s,acl:"public-read",key:s,unknowValueField:[]}});case 6:return c=t.sent,d=c.data,i({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0}),p={policy:d.policy,signature:d.signature,key:s,KSSAccessKeyId:d.kssAccessKeyId,acl:"public-read",name:s,file:e},t.next=12,f(u(n.bucket),p);case 12:g=t.sent,console.log(g,"uploadUrl"),r(),n.maxCount>1?(n.$emit("update:modelValue",[].concat(a(n.modelValue),[g])),n.onUploadChange([].concat(a(n.modelValue),[g]))):(n.$emit("update:modelValue",[g]),n.onUploadChange([g])),t.next=22;break;case 18:t.prev=18,t.t0=t.catch(0),console.log(t.t0,"uploadFile"),r();case 22:case"end":return t.stop()}}),t,null,[[0,18]])})))()}},render:function(){var e=this;return s((function(){return e.modelValue})),c("div",{class:b["uploader-section"]},[this.modelValue.length>0&&this.maxCount>1&&this.modelValue.map((function(t){return c("div",{class:[b.uploader,b[e.size]]},[e.deletable&&!e.disabled&&c(d,{name:"cross",onClick:function(a){return e.onClose(a,t)},class:b["img-close"]},null),c("div",{class:["van-uploader__upload"]},["IMAGE"===e.uploadType?c(h,{src:t,class:b.previewImg,fit:"cover"},null):c("video",{ref:"videoUpload",style:{backgroundColor:"#F8F8F8"},class:b.previewImg,src:t+"#t=1,4"},null)])])})),this.native?this.maxCount>1?c("div",{class:[b.uploader,b[this.size]],onClick:this.nativeUpload},[c(d,{name:this.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]):c("div",{class:[b.uploader,b[this.size]],onClick:this.nativeUpload},[this.modelValue.length>0?c("div",{class:["van-uploader__upload"]},[this.modelValue.map((function(t){return c(p,null,[e.deletable&&!e.disabled&&c(d,{name:"cross",onClick:function(a){return e.onClose(a,t)},class:[b["img-close"],b.singleImgClose]},null),"IMAGE"===e.uploadType?c(h,{fit:"cover",position:"center",class:b.uploadImg,src:t},null):c("video",{ref:"videoUpload",class:b.uploadImg,style:{backgroundColor:"#F8F8F8"},src:t+"#t=1,4"},null)])}))]):c(d,{name:this.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]):this.maxCount>1?c(g,{class:[b.uploader,b[this.size]],afterRead:this.afterRead,beforeRead:this.beforeRead,beforeDelete:this.beforeDelete,uploadIcon:this.uploadIcon,disabled:this.modelValue.length===this.maxCount||this.disabled,accept:this.accept},null):c(g,{class:[b.uploader,b[this.size]],afterRead:this.afterRead,beforeRead:this.beforeRead,beforeDelete:this.beforeDelete,uploadIcon:this.uploadIcon,accept:this.accept,disabled:this.disabled},{default:function(){return[e.modelValue.length>0?c("div",{class:["van-uploader__upload"]},[e.modelValue.map((function(t){return c(p,null,[e.deletable&&!e.disabled&&c(d,{name:"cross",onClick:function(a){return e.onClose(a,t)},class:[b["img-close"],b.singleImgClose]},null),"IMAGE"===e.uploadType?c(h,{fit:"cover",position:"center",class:b.uploadImg,src:t},null):c("video",{ref:"videoUpload",class:b.uploadImg,style:{backgroundColor:"#F8F8F8"},src:t+"#t=1,4"},null)])}))]):c(d,{name:e.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]}})])}}))}}}))}();