import{ref as e,inject as t,onMounted as i,nextTick as s,withDirectives as r,openBlock as n,createElementBlock as o,renderSlot as a,vShow as l,onBeforeUnmount as u,normalizeClass as p,createElementVNode as h,createTextVNode as d,getCurrentInstance as f,computed as c,watch as v,onUnmounted as g,normalizeStyle as m,toDisplayString as S,toRaw as y,resolveComponent as _,Fragment as b,renderList as k,createVNode as R,provide as F,withCtx as E}from"vue";function x(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var C={exports:{}},A=C.exports=function e(t,i,s){function r(o,a){if(!i[o]){if(!t[o]){if(!a&&x)return x(o);if(n)return n(o,!0);throw new Error("Cannot find module '"+o+"'")}var l=i[o]={exports:{}};t[o][0].call(l.exports,(function(e){var i=t[o][1][e];return r(i||e)}),l,l.exports,e,t,i,s)}return i[o].exports}for(var n=x,o=0;o-1?t=n.SUCCESS:this.uploader.opts.permanentErrors.indexOf(this.xhr.status)>-1||!e&&this.retries>=this.uploader.opts.maxChunkRetries?t=n.ERROR:(this.abort(),t=n.PENDING);var i=this.processedState;return i&&i.err&&(t=n.ERROR),t}return n.PENDING},message:function(){return this.xhr?this.xhr.responseText:""},progress:function(){if(this.pendingRetry)return 0;var e=this.status();return e===n.SUCCESS||e===n.ERROR?1:e===n.PENDING?0:this.total>0?this.loaded/this.total:0},sizeUploaded:function(){var e=this.endByte-this.startByte;return this.status()!==n.SUCCESS&&(e=this.progress()*e),e},prepareXhrRequest:function(e,t,i,r){var n=s.evalOpts(this.uploader.opts.query,this.file,this,t);n=s.extend(this.getParams(),n),n=this.uploader.opts.processParams(n,this.file,this,t);var o=s.evalOpts(this.uploader.opts.target,this.file,this,t),a=null;if("GET"===e||"octet"===i){var l=[];s.each(n,(function(e,t){l.push([encodeURIComponent(t),encodeURIComponent(e)].join("="))})),o=this.getTarget(o,l),a=r||null}else a=new FormData,s.each(n,(function(e,t){a.append(t,e)})),void 0!==r&&a.append(this.uploader.opts.fileParameterName,r,this.file.name);return this.xhr.open(e,o,!0),this.xhr.withCredentials=this.uploader.opts.withCredentials,s.each(s.evalOpts(this.uploader.opts.headers,this.file,this,t),(function(e,t){this.xhr.setRequestHeader(t,e)}),this),a}}),t.exports=r},{"./utils":5}],2:[function(e,t,i){var s=e("./utils").each,r={_eventData:null,on:function(e,t){this._eventData||(this._eventData={}),this._eventData[e]||(this._eventData[e]=[]);var i=!1;s(this._eventData[e],(function(e){if(e===t)return i=!0,!1})),i||this._eventData[e].push(t)},off:function(e,t){this._eventData||(this._eventData={}),this._eventData[e]&&this._eventData[e].length&&(t?s(this._eventData[e],(function(i,s){if(i===t)return this._eventData[e].splice(s,1),!1}),this):this._eventData[e]=[])},trigger:function(e){if(this._eventData||(this._eventData={}),!this._eventData[e])return!0;var t=this._eventData[e].slice.call(arguments,1),i=!1;return s(this._eventData[e],(function(e){i=!1===e.apply(this,t)||i}),this),!i}};t.exports=r},{"./utils":5}],3:[function(e,t,i){var s=e("./utils"),r=e("./event"),n=e("./file"),o=e("./chunk"),a="0.6.0",l="undefined"==typeof window,u=!l&&window.navigator.msPointerEnabled,p=function(){if(l)return!1;var e="slice",t=s.isDefined(window.File)&&s.isDefined(window.Blob)&&s.isDefined(window.FileList),i=null;return t&&(i=window.Blob.prototype,s.each(["slice","webkitSlice","mozSlice"],(function(t){if(i[t])return e=t,!1})),t=!!i[e]),t&&(d.sliceName=e),i=null,t}(),h=function(){if(l)return!1;var e=window.document.createElement("input");e.type="file";var t="webkitdirectory"in e||"directory"in e;return e=null,t}();function d(e){this.support=p,this.support&&(this.supportDirectory=h,s.defineNonEnumerable(this,"filePaths",{}),this.opts=s.extend({},d.defaults,e||{}),this.preventEvent=s.bind(this._preventEvent,this),n.call(this,this))}var f=function(e,t,i,s,r){r.readFinished(e.file[d.sliceName](i,s,t))};d.version=a,d.defaults={chunkSize:1048576,forceChunkSize:!1,simultaneousUploads:3,singleFile:!1,fileParameterName:"file",progressCallbacksInterval:500,speedSmoothingFactor:.1,query:{},headers:{},withCredentials:!1,preprocess:null,method:"multipart",testMethod:"GET",uploadMethod:"POST",prioritizeFirstAndLastChunk:!1,allowDuplicateUploads:!1,target:"/",testChunks:!0,generateUniqueIdentifier:null,maxChunkRetries:0,chunkRetryInterval:null,permanentErrors:[404,415,500,501],successStatuses:[200,201,202],onDropStopPropagation:!1,initFileFn:null,readFileFn:f,checkChunkUploadedByResponse:null,initialPaused:!1,processResponse:function(e,t){t(null,e)},processParams:function(e){return e}},d.utils=s,d.event=r,d.File=n,d.Chunk=o,d.prototype=s.extend({},n.prototype),s.extend(d.prototype,r),s.extend(d.prototype,{constructor:d,_trigger:function(e){var t=s.toArray(arguments),i=!this.trigger.apply(this,arguments);return"catchAll"!==e&&(t.unshift("catchAll"),i=!this.trigger.apply(this,t)||i),!i},_triggerAsync:function(){var e=arguments;s.nextTick((function(){this._trigger.apply(this,e)}),this)},addFiles:function(e,t){var i=[],r=this.fileList.length;s.each(e,(function(e){if((!u||u&&e.size>0)&&(e.size%4096!=0||"."!==e.name&&"."!==e.fileName)){var s=this.generateUniqueIdentifier(e);if(this.opts.allowDuplicateUploads||!this.getFromUniqueIdentifier(s)){var r=new n(this,e,this);r.uniqueIdentifier=s,this._trigger("fileAdded",r,t)?i.push(r):n.prototype.removeFile.call(this,r)}}}),this);var o=this.fileList.slice(r);this._trigger("filesAdded",i,o,t)?(s.each(i,(function(e){this.opts.singleFile&&this.files.length>0&&this.removeFile(this.files[0]),this.files.push(e)}),this),this._trigger("filesSubmitted",i,o,t)):s.each(o,(function(e){n.prototype.removeFile.call(this,e)}),this)},addFile:function(e,t){this.addFiles([e],t)},cancel:function(){for(var e=this.fileList.length-1;e>=0;e--)this.fileList[e].cancel()},removeFile:function(e){n.prototype.removeFile.call(this,e),this._trigger("fileRemoved",e)},generateUniqueIdentifier:function(e){var t=this.opts.generateUniqueIdentifier;if(s.isFunction(t))return t(e);var i=e.relativePath||e.webkitRelativePath||e.fileName||e.name;return e.size+"-"+i.replace(/[^0-9a-zA-Z_-]/gim,"")},getFromUniqueIdentifier:function(e){var t=!1;return s.each(this.files,(function(i){if(i.uniqueIdentifier===e)return t=i,!1})),t},uploadNextChunk:function(e){var t=!1,i=o.STATUS.PENDING,r=this.uploader.opts.checkChunkUploadedByResponse;if(this.opts.prioritizeFirstAndLastChunk&&(s.each(this.files,(function(e){if(!e.paused&&(!r||e._firstResponse||!e.isUploading()))return e.chunks.length&&e.chunks[0].status()===i?(e.chunks[0].send(),t=!0,!1):e.chunks.length>1&&e.chunks[e.chunks.length-1].status()===i?(e.chunks[e.chunks.length-1].send(),t=!0,!1):void 0})),t))return t;if(s.each(this.files,(function(e){if(!e.paused){if(r&&!e._firstResponse&&e.isUploading())return;s.each(e.chunks,(function(e){if(e.status()===i)return e.send(),t=!0,!1}))}if(t)return!1})),t)return!0;var n=!1;return s.each(this.files,(function(e){if(!e.isComplete())return n=!0,!1})),n||e||!this.files.length||this._triggerAsync("complete"),n},upload:function(e){var t=this._shouldUploadNext();if(!1!==t){!e&&this._trigger("uploadStart");for(var i=!1,s=1;s<=this.opts.simultaneousUploads-t&&((i=this.uploadNextChunk(!e)||i)||!e);s++);i||e||this._triggerAsync("complete")}},_shouldUploadNext:function(){var e=0,t=!0,i=this.opts.simultaneousUploads,r=o.STATUS.UPLOADING;return s.each(this.files,(function(n){return s.each(n.chunks,(function(s){if(s.status()===r&&++e>=i)return t=!1,!1})),t})),t&&e},assignBrowse:function(e,t,i,r){void 0===e.length&&(e=[e]),s.each(e,(function(e){var n;"INPUT"===e.tagName&&"file"===e.type?n=e:((n=document.createElement("input")).setAttribute("type","file"),s.extend(n.style,{visibility:"hidden",position:"absolute",width:"1px",height:"1px"}),e.appendChild(n),e.addEventListener("click",(function(t){"label"!==e.tagName.toLowerCase()&&n.click()}),!1)),this.opts.singleFile||i||n.setAttribute("multiple","multiple"),t&&n.setAttribute("webkitdirectory","webkitdirectory"),r&&s.each(r,(function(e,t){n.setAttribute(t,e)}));var o=this;n.addEventListener("change",(function(e){o._trigger(e.type,e),e.target.value&&(o.addFiles(e.target.files,e),e.target.value="")}),!1)}),this)},onDrop:function(e){this._trigger(e.type,e),this.opts.onDropStopPropagation&&e.stopPropagation(),e.preventDefault(),this._parseDataTransfer(e.dataTransfer,e)},_parseDataTransfer:function(e,t){e.items&&e.items[0]&&e.items[0].webkitGetAsEntry?this.webkitReadDataTransfer(e,t):this.addFiles(e.files,t)},webkitReadDataTransfer:function(e,t){var i=this,r=e.items.length,n=[];function o(e){e.readEntries((function(t){t.length?(r+=t.length,s.each(t,(function(e){if(e.isFile){var t=e.fullPath;e.file((function(e){a(e,t)}),l)}else e.isDirectory&&o(e.createReader())})),o(e)):u()}),l)}function a(e,t){e.relativePath=t.substring(1),n.push(e),u()}function l(e){throw e}function u(){0==--r&&i.addFiles(n,t)}s.each(e.items,(function(e){var t=e.webkitGetAsEntry();t?t.isFile?a(e.getAsFile(),t.fullPath):o(t.createReader()):u()}))},_assignHelper:function(e,t,i){void 0===e.length&&(e=[e]);var r=i?"removeEventListener":"addEventListener";s.each(e,(function(e){s.each(t,(function(t,i){e[r](i,t,!1)}),this)}),this)},_preventEvent:function(e){s.preventEvent(e),this._trigger(e.type,e)},assignDrop:function(e){this._onDrop=s.bind(this.onDrop,this),this._assignHelper(e,{dragover:this.preventEvent,dragenter:this.preventEvent,dragleave:this.preventEvent,drop:this._onDrop})},unAssignDrop:function(e){this._assignHelper(e,{dragover:this.preventEvent,dragenter:this.preventEvent,dragleave:this.preventEvent,drop:this._onDrop},!0),this._onDrop=null}}),t.exports=d},{"./chunk":1,"./event":2,"./file":4,"./utils":5}],4:[function(e,t,i){var s=e("./utils"),r=e("./chunk");function n(e,t,i){s.defineNonEnumerable(this,"uploader",e),this.isRoot=this.isFolder=e===this,s.defineNonEnumerable(this,"parent",i||null),s.defineNonEnumerable(this,"files",[]),s.defineNonEnumerable(this,"fileList",[]),s.defineNonEnumerable(this,"chunks",[]),s.defineNonEnumerable(this,"_errorFiles",[]),s.defineNonEnumerable(this,"file",null),this.id=s.uid(),this.isRoot||!t?this.file=null:s.isString(t)?(this.isFolder=!0,this.file=null,this.path=t,this.parent.path&&(t=t.substr(this.parent.path.length)),this.name="/"===t.charAt(t.length-1)?t.substr(0,t.length-1):t):(this.file=t,this.fileType=this.file.type,this.name=t.fileName||t.name,this.size=t.size,this.relativePath=t.relativePath||t.webkitRelativePath||this.name,this._parseFile()),this.paused=e.opts.initialPaused,this.error=!1,this.allError=!1,this.aborted=!1,this.completed=!1,this.averageSpeed=0,this.currentSpeed=0,this._lastProgressCallback=Date.now(),this._prevUploadedSize=0,this._prevProgress=0,this.bootstrap()}function o(e){var t=[],i=e.split("/"),s=i.length,r=1;if(i.splice(s-1,1),s--,i.length)for(;r<=s;)t.push(i.slice(0,r++).join("/")+"/");return t}s.extend(n.prototype,{_parseFile:function(){var e=o(this.relativePath);if(e.length){var t=this.uploader.filePaths;s.each(e,(function(i,s){var r=t[i];r||(r=new n(this.uploader,i,this.parent),t[i]=r,this._updateParentFileList(r)),this.parent=r,r.files.push(this),e[s+1]||r.fileList.push(this)}),this)}else this._updateParentFileList()},_updateParentFileList:function(e){e||(e=this);var t=this.parent;t&&t.fileList.push(e)},_eachAccess:function(e,t){this.isFolder?s.each(this.files,(function(t,i){return e.call(this,t,i)}),this):t.call(this,this)},bootstrap:function(){if(!this.isFolder){var e=this.uploader.opts;s.isFunction(e.initFileFn)&&e.initFileFn.call(this,this),this.abort(!0),this._resetError(),this._prevProgress=0;for(var t=e.forceChunkSize?Math.ceil:Math.floor,i=Math.max(t(this.size/e.chunkSize),1),n=0;n=this.uploader.opts.progressCallbacksInterval},_chunkEvent:function(e,t,i){var s=this.uploader,n=r.STATUS,o=this,a=this.getRoot(),l=function(){o._measureSpeed(),s._trigger("fileProgress",a,o,e),o._lastProgressCallback=Date.now()};switch(t){case n.PROGRESS:this._checkProgress()&&l();break;case n.ERROR:this._error(),this.abort(!0),s._trigger("fileError",a,this,i,e);break;case n.SUCCESS:if(this._updateUploadedChunks(i,e),this.error)return;clearTimeout(this._progeressId),this._progeressId=0;var u=Date.now()-this._lastProgressCallback;u0?e/t:this.isComplete()?1:0)}),(function(){if(this.error)i=1;else{if(1===this.chunks.length)return this._prevProgress=Math.max(this._prevProgress,this.chunks[0].progress()),void(i=this._prevProgress);var e=0;s.each(this.chunks,(function(t){e+=t.progress()*(t.endByte-t.startByte)}));var t=e/this.size;this._prevProgress=Math.max(this._prevProgress,t>.9999?1:t),i=this._prevProgress}})),i},getSize:function(){var e=0;return this._eachAccess((function(t){e+=t.size}),(function(){e+=this.size})),e},getFormatSize:function(){var e=this.getSize();return s.formatSize(e)},getRoot:function(){if(this.isRoot)return this;for(var e=this.parent;e;){if(e.parent===this.uploader)return e;e=e.parent}return this},sizeUploaded:function(){var e=0;return this._eachAccess((function(t){e+=t.sizeUploaded()}),(function(){s.each(this.chunks,(function(t){e+=t.sizeUploaded()}))})),e},timeRemaining:function(){var e=0,t=0,i=0;return this._eachAccess((function(r,n){r.paused||r.error||(t+=r.size-r.sizeUploaded(),i+=r.averageSpeed),n===this.files.length-1&&(e=s(t,i))}),(function(){if(this.paused||this.error)e=0;else{var t=this.size-this.sizeUploaded();e=s(t,this.averageSpeed)}})),e;function s(e,t){return e&&!t?Number.POSITIVE_INFINITY:e||t?Math.floor(e/t):0}},removeFile:function(e){if(e.isFolder)for(;e.files.length;){var t=e.files[e.files.length-1];this._removeFile(t)}this._removeFile(e)},_delFilePath:function(e){e.path&&this.filePaths&&delete this.filePaths[e.path],s.each(e.fileList,(function(e){this._delFilePath(e)}),this)},_removeFile:function(e){if(!e.isFolder){s.each(this.files,(function(t,i){if(t===e)return this.files.splice(i,1),!1}),this),e.abort();for(var t,i=e.parent;i&&i!==this;)t=i.parent,i._removeFile(e),i=t}e.parent===this&&s.each(this.fileList,(function(t,i){if(t===e)return this.fileList.splice(i,1),!1}),this),this.isRoot||!this.isFolder||this.files.length||(this.parent._removeFile(this),this.uploader._delFilePath(this)),e.parent=null},getType:function(){return this.isFolder?"folder":this.file.type&&this.file.type.split("/")[1]},getExtension:function(){return this.isFolder?"":this.name.substr(2+(~-this.name.lastIndexOf(".")>>>0)).toLowerCase()}}),t.exports=n},{"./chunk":1,"./utils":5}],5:[function(e,t,i){var s=Object.prototype,r=Array.prototype,n=s.toString,o=function(e){return"[object Function]"===n.call(e)},a=Array.isArray||function(e){return"[object Array]"===n.call(e)},l=function(e){return"[object Object]"===n.call(e)&&Object.getPrototypeOf(e)===s},u=0,p={uid:function(){return++u},noop:function(){},bind:function(e,t){return function(){return e.apply(t,arguments)}},preventEvent:function(e){e.preventDefault()},stop:function(e){e.preventDefault(),e.stopPropagation()},nextTick:function(e,t){setTimeout(p.bind(e,t),0)},toArray:function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=e.length),r.slice.call(e,t,i)},isPlainObject:l,isFunction:o,isArray:a,isObject:function(e){return Object(e)===e},isString:function(e){return"string"==typeof e},isUndefined:function(e){return void 0===e},isDefined:function(e){return void 0!==e},each:function(e,t,i){if(p.isDefined(e.length))for(var s=0,r=e.length;s * @link https://github.com/simple-uploader/Uploader * @license MIT */function P(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const U={name:"uploader-btn",props:{directory:{type:Boolean,default:!1},single:{type:Boolean,default:!1},attrs:{type:Object,default:()=>({})}},setup(r){const n=e(null),o=t("uploader").proxy.uploader,a=o.support;return i((()=>{s((()=>{o.assignBrowse(n.value,r.directory,r.single,r.attrs)}))})),{btn:n,support:a}}},w={class:"uploader-btn",ref:"btn"};U.render=function(e,t,i,s,u,p){return r((n(),o("label",w,[a(e.$slots,"default")],512)),[[l,s.support]])};const D={name:"uploader-drop",setup(){const r=t("uploader").proxy.uploader;let n=e(null),o=e("");const a=r.support,l=()=>{o="uploader-dragover"},p=()=>{o=""},h=()=>{o="uploader-droped"};return i((()=>{s((()=>{const e=n.value;r.assignDrop(e),r.on("dragenter",l),r.on("dragleave",p),r.on("drop",h)}))})),u((()=>{const e=n.value;r.off("dragenter",l),r.off("dragleave",p),r.off("drop",h),r.unAssignDrop(e)})),{drop:n,dropClass:o,support:a,onDragEnter:l,onDragLeave:p,onDrop:h}}};D.render=function(e,t,i,s,u,h){return r((n(),o("div",{class:p(["uploader-drop",s.dropClass]),ref:"drop"},[a(e.$slots,"default")],2)),[[l,s.support]])};const z={name:"uploader-unsupport",setup:()=>({support:t("uploader").proxy.uploader.support})},T={class:"uploader-unsupport"},N=h("p",null,[d(" Your browser, unfortunately, is not supported by Uploader.js. The library requires support for "),h("a",{href:"http://www.w3.org/TR/FileAPI/"},"the HTML5 File API"),d(" along with "),h("a",{href:"http://www.w3.org/TR/FileAPI/#normalization-of-params"},"file slicing"),d(". ")],-1);z.render=function(e,t,i,s,u,p){return r((n(),o("div",T,[a(e.$slots,"default",{},(()=>[N]))],512)),[[l,!s.support]])};const I=["fileProgress","fileSuccess","fileComplete","fileError"];const L={name:"uploader-file",props:{file:{type:Object,default:()=>({})},list:{type:Boolean,default:!1}},setup(t){const s=f();let r={},n=0;const o=e(null),a=e(!1),l=e(!1),u=e(0),p=e(0),h=e(!1),d=e(!1),m=e(0),S=e(""),_=e(0),b=e(0),k=e(0),R=e(""),F=e(""),E=e(""),x=c((()=>{let e=t.file.isFolder?"folder":"unknown";const i=t.file.uploader.opts.categoryMap||{image:["gif","jpg","jpeg","png","bmp","webp"],video:["mp4","m3u8","rmvb","avi","swf","3gp","mkv","flv"],audio:["mp3","wav","wma","ogg","aac","flac"],document:["doc","txt","docx","pages","epub","pdf","numbers","csv","xls","xlsx","keynote","ppt","pptx"]};return Object.keys(i).forEach((t=>{i[t].indexOf(F.value)>-1&&(e=t)})),e})),C=c((()=>{const e=Math.floor(100*b.value),t=`translateX(${Math.floor(e-100)}%)`;return{progress:`${e}%`,webkitTransform:t,mozTransform:t,msTransform:t,transform:t}})),P=c((()=>`${A.utils.formatSize(u.value)} / s`)),U=c((()=>{let e=l;return h.value?"success":e.value?"error":d.value?"uploading":a.value?"paused":"waiting"})),w=c((()=>{const e=t.file.uploader.fileStatusText;let i=U.value;return i="function"==typeof e?e(U.value,o.value):e[U.value],i||U})),D=c((()=>{const e=t.file;if(k.value===Number.POSITIVE_INFINITY||0===k.value)return"";let i=function(e){const t=Math.floor(e/31536e3);if(t)return t+" year"+o(t);const i=Math.floor((e%=31536e3)/86400);if(i)return i+" day"+o(i);const s=Math.floor((e%=86400)/3600);if(s)return s+" hour"+o(s);const r=Math.floor((e%=3600)/60);if(r)return r+" minute"+o(r);const n=e%60;return n+" second"+o(n);function o(e){return e>1?"s":""}}(k.value);const s=e.uploader.opts.parseTimeRemaining;return s&&(i=s(k.value,i)),i})),z=()=>{a.value=t.file.paused,l.value=t.file.error,d.value=t.file.isUploading()},T=e=>{let t=e;try{t=JSON.parse(e)}catch(i){}o.value=t},N=(e,i)=>{const r=i[0],n=i[1],o=t.list?r:n;if(y(t.file)===y(o)){if(t.list&&"fileSuccess"===e)return void T(i[2]);s.setupState[e](...i)}},L=()=>{b.value=t.file.progress(),u.value=t.file.averageSpeed,p.value=t.file.currentSpeed,k.value=t.file.timeRemaining(),_.value=t.file.sizeUploaded(),z()},O=(e,t,i)=>{e&&T(i),L(),l.value=!1,h.value=!0,d.value=!1};return v(U,((e,t)=>{t&&"uploading"===e&&"uploading"!==t?n=setTimeout((()=>{E.value="uploader-file-progressing"}),200):(clearTimeout(n),E.value="")})),i((()=>{a.value=t.file.paused,l.value=t.file.error,u.value=t.file.averageSpeed,p.value=t.file.currentSpeed,h.value=t.file.isComplete(),d.value=t.file.isUploading(),m.value=t.file.getSize(),S.value=t.file.getFormatSize(),_.value=t.file.sizeUploaded(),b.value=t.file.progress(),k.value=t.file.timeRemaining(),R.value=t.file.getType(),F.value=t.file.getExtension();I.forEach((e=>{t.file.uploader.on(e,(e=>(r[e]=(...t)=>{N(e,t)},r[e]))(e))}))})),g((()=>{I.forEach((e=>{t.file.uploader.off(e,r[e])})),r=null})),{response:o,paused:a,error:l,averageSpeed:u,currentSpeed:p,isComplete:h,isUploading:d,size:m,formatedSize:S,uploadedSize:_,progress:b,timeRemaining:k,type:R,extension:F,progressingClass:E,fileCategory:x,progressStyle:C,formatedAverageSpeed:P,status:U,statusText:w,formatedTimeRemaining:D,actionCheck:z,pause:()=>{t.file.pause(),z(),L()},resume:()=>{t.file.resume(),z()},remove:()=>{t.file.cancel()},retry:()=>{t.file.retry(),z()},processResponse:T,fileEventsHandler:N,fileProgress:L,fileSuccess:O,fileComplete:()=>{O()},fileError:(e,t,i)=>{L(),T(i),l.value=!0,h.value=!1,d.value=!1}}}},O=["status"],B={class:"uploader-file-info"},G={class:"uploader-file-name"},M=["icon"],j={class:"uploader-file-size"},q=h("div",{class:"uploader-file-meta"},null,-1),$={class:"uploader-file-status"},H={class:"uploader-file-actions"};L.render=function(e,t,i,s,u,f){return n(),o("div",{class:"uploader-file",status:s.status},[a(e.$slots,"default",{file:i.file,list:i.list,status:s.status,paused:s.paused,error:s.error,response:s.response,averageSpeed:s.averageSpeed,formatedAverageSpeed:s.formatedAverageSpeed,currentSpeed:s.currentSpeed,isComplete:s.isComplete,isUploading:s.isUploading,size:s.size,formatedSize:s.formatedSize,uploadedSize:s.uploadedSize,progress:s.progress,progressStyle:s.progressStyle,progressingClass:s.progressingClass,timeRemaining:s.timeRemaining,formatedTimeRemaining:s.formatedTimeRemaining,type:s.type,extension:s.extension,fileCategory:s.fileCategory},(()=>[h("div",{class:p(["uploader-file-progress",s.progressingClass]),style:m(s.progressStyle)},null,6),h("div",B,[h("div",G,[h("i",{class:"uploader-file-icon",icon:s.fileCategory},null,8,M),d(S(i.file.name),1)]),h("div",j,S(s.formatedSize),1),q,h("div",$,[r(h("span",null,S(s.statusText),513),[[l,"uploading"!==s.status]]),r(h("span",null,[h("span",null,S(s.progressStyle.progress)+" ",1),h("em",null,S(s.formatedAverageSpeed)+" ",1),h("i",null,S(s.formatedTimeRemaining),1)],512),[[l,"uploading"===s.status]])]),h("div",H,[h("span",{class:"uploader-file-pause",onClick:t[0]||(t[0]=(...e)=>s.pause&&s.pause(...e))}),h("span",{class:"uploader-file-resume",onClick:t[1]||(t[1]=(...e)=>s.resume&&s.resume(...e))},"️"),h("span",{class:"uploader-file-retry",onClick:t[2]||(t[2]=(...e)=>s.retry&&s.retry(...e))}),h("span",{class:"uploader-file-remove",onClick:t[3]||(t[3]=(...e)=>s.remove&&s.remove(...e))})])])]))],8,O)};const X={name:"uploader-list",components:{UploaderFile:L},setup(){const e=t("uploader").proxy;return{fileList:c((()=>e.fileList))}}},Y={class:"uploader-list"};X.render=function(e,t,i,s,r,l){const u=_("uploader-file");return n(),o("div",Y,[a(e.$slots,"default",{fileList:s.fileList},(()=>[h("ul",null,[(n(!0),o(b,null,k(s.fileList,(e=>(n(),o("li",{key:e.id},[R(u,{file:e,list:!0},null,8,["file"])])))),128))])]))])};const V={name:"uploader-files",components:{UploaderFile:L},setup(){const e=t("uploader").proxy;return{files:c((()=>e.files))}}},Z={class:"uploader-files"};V.render=function(e,t,i,s,r,l){const u=_("uploader-file");return n(),o("div",Z,[a(e.$slots,"default",{files:s.files},(()=>[h("ul",null,[(n(!0),o(b,null,k(s.files,(e=>(n(),o("li",{key:e.id},[R(u,{file:e},null,8,["file"])])))),128))])]))])};const J={name:"uploader",props:{options:{type:Object,default:()=>({})},autoStart:{type:Boolean,default:!0},fileStatusText:{type:[Object,Function],default:()=>({success:"success",error:"error",uploading:"uploading",paused:"paused",waiting:"waiting"})},onFileAdded:Function,onFilesAdded:Function},emits:["change","dragover","dragenter","dragleave","file-success","file-complete","file-progress","file-added","files-added","files-submitted","file-removed","file-retry","file-error","upload-start","complete"],setup(t,{emit:i}){const s=e(!1),r=e([]),n=e([]),o=f();let a=new A(t.options);const l=e=>{const s=e;if(t.onFileAdded){if(!1===t.onFileAdded(s)||s.ignored)return!1}else if(i(P("fileAdded"),s),s.ignored)return!1},u=(e,s)=>{if(t.onFilesAdded){if(!1===t.onFilesAdded(e,s)||e.ignored||s.ignored)return!1}else if(i(P("filesAdded"),e,s),e.ignored||s.ignored)return!1},p=()=>{r.value=[...a.files],n.value=[...a.fileList]},h=()=>{r.value=[...a.files],n.value=[...a.fileList],t.autoStart&&a.upload()},d=(...e)=>{const t=e[0],s={fileAdded:!0,filesAdded:!0,uploadStart:"uploadStart"}[t];if(s){if(!0===s)return;o.setupState[s](...e.slice(1))}e[0]=P(t),i(...e)};return t.options.initialPaused=!t.autoStart,a.fileStatusText=t.fileStatusText,a.on("catchAll",d),a.on("fileAdded",l),a.on("filesAdded",u),a.on("fileRemoved",p),a.on("filesSubmitted",h),g((()=>{a.off("catchAll",d),a.off("fileAdded",l),a.off("filesAdded",u),a.off("fileRemoved",p),a.off("filesSubmitted",h),a=null})),F("uploader",o),{uploader:a,started:s,files:r,fileList:n,uploadStart:()=>{s.value=!0},fileAdded:l,filesAdded:u,fileRemoved:p,filesSubmitted:h,allEvent:d}},components:{UploaderBtn:U,UploaderDrop:D,UploaderUnsupport:z,UploaderList:X,UploaderFiles:V,UploaderFile:L}},K={class:"uploader"},Q=h("p",null,"Drop files here to upload or",-1);J.render=function(e,t,i,s,r,l){const u=_("uploader-unsupport"),p=_("uploader-btn"),h=_("uploader-drop"),f=_("uploader-list");return n(),o("div",K,[a(e.$slots,"default",{files:s.files,fileList:s.fileList,started:s.started},(()=>[R(u),R(h,null,{default:E((()=>[Q,R(p,null,{default:E((()=>[d("select files")])),_:1}),R(p,{directory:!0},{default:E((()=>[d("select folder")])),_:1})])),_:1}),R(f)]))])};const W={version:"1.0.3",install:function(e,t){e.component(J.name,J),e.component(U.name,U),e.component(D.name,D),e.component(z.name,z),e.component(X.name,X),e.component(V.name,V),e.component(L.name,L)},Uploader:J,UploaderBtn:U,UploaderDrop:D,UploaderUnsupport:z,UploaderList:X,UploaderFiles:V,UploaderFile:L};export default W;