UNPKG

vimr

Version:

## 安装 ``` pnpm add vimr ``` ## 使用

2 lines (1 loc) 35.2 kB
(function(y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(y=typeof globalThis<"u"?globalThis:y||self,e(y.vimr={},y.Vue))})(this,function(y,e){"use strict";const Ut="";if(typeof window<"u"){let t=function(){var l=document.body,o=document.getElementById("__svg__icons__dom__");o||(o=document.createElementNS("http://www.w3.org/2000/svg","svg"),o.style.position="absolute",o.style.width="0",o.style.height="0",o.id="__svg__icons__dom__",o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("xmlns:link","http://www.w3.org/1999/xlink")),o.innerHTML='<symbol class="icon" viewBox="0 0 1024 1024" id="icon-file"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#4895FF" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M327 349h224.931q37 0 37 37t-37 37H327q-37 0-37-37t37-37ZM327 511h370q37 0 37 37t-37 37H327q-37 0-37-37t37-37ZM327 673h370q37 0 37 37t-37 37H327q-37 0-37-37t37-37Z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-folder"><path d="M92 810V213q0-30 30-30h780q30 0 30 30v597q0 30-30 30H122q-30 0-30-30Z" fill="#C49C30" /><path d="M92 753V170q0-30 30-30h212q30 0 30 30v583q0 30-30 30H122q-30 0-30-30Z" fill="#C49C30" /><path d="M146 784.764V272.235q0-30 30-30h672q30 0 30 30v512.529q0 30-30 30H176q-30 0-30-30Z" fill="#FFF" /><path d="M92 902V340q0-30 30-30h780q30 0 30 30v562q0 30-30 30H122q-30 0-30-30Z" fill="#FFCF4E" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-img"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#FFAB4E" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="m440.26 397.636 152.711 269.49c4.901 8.649 1.863 19.633-6.786 24.534a18 18 0 0 1-8.874 2.34H271.889c-9.941 0-18-8.059-18-18a18 18 0 0 1 2.34-8.874l152.71-269.49c4.902-8.649 15.886-11.687 24.535-6.786a18 18 0 0 1 6.786 6.786z" fill="#FFF" /><path d="m633.04 497.15 96.32 169.976c4.9 8.649 1.863 19.633-6.786 24.534a18 18 0 0 1-8.875 2.34H521.061c-9.942 0-18-8.059-18-18a18 18 0 0 1 2.34-8.874L601.72 497.15c4.9-8.649 15.885-11.687 24.534-6.786a18 18 0 0 1 6.786 6.786zM645 420a50 50 0 1 0 100 0 50 50 0 1 0-100 0Z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-jpg"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#60C267" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M306.76 444.2c21.12 0 25.92-2.88 25.92-24.64s-4.8-24-25.92-24c-20.8 0-25.92 2.24-25.92 24 0 21.76 5.12 24.64 25.92 24.64zM264.52 705c41.28 0 65.28-10.88 65.28-64.64V468.2h-46.4v170.24c0 24-3.2 31.68-24 31.68-5.12 0-11.2-.32-15.36-1.28v34.56c6.08.96 12.8 1.6 20.48 1.6zm209.92-240c-30.4 0-45.44 11.2-52.16 24v-20.8h-46.4V705h46.4v-86.08c6.72 15.36 20.48 25.28 52.16 25.28 56 0 68.8-40 68.8-89.6 0-55.04-12.8-89.6-68.8-89.6zm-14.72 144c-31.68 0-40-21.12-40-54.4 0-34.88 8.32-55.04 40-55.04 31.36 0 36.16 23.36 36.16 55.04 0 29.76-4.16 54.4-36.16 54.4zm234.56-140.8v22.08C687.56 473.96 673.8 465 642.12 465c-56 0-70.08 40.64-70.08 88 0 52.48 14.08 88 70.08 88 31.04 0 44.8-9.28 52.16-24.64v9.28c0 32.96-15.68 43.52-53.12 43.52-15.04 0-32-1.6-45.76-5.12v36.8c14.08 2.56 33.6 4.16 49.28 4.16 71.68 0 95.68-30.08 95.68-77.44V468.2h-46.08zm-38.4 138.88c-32 0-36.16-24.64-36.16-54.08 0-27.84 3.84-53.44 36.16-53.44 34.56 0 40.64 20.48 40.64 53.44 0 34.24-6.08 54.08-40.64 54.08z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-mov"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#C076E5" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M257 92h70v70h-70zm0 140h70v70h-70zm0 140h70v70h-70zm0 140h70v70h-70zm0 140h70v70h-70zm0 140h70v70h-70zM698 302h70v70h-70zm0 140h70v70h-70zm0 140h70v70h-70zm0 140h70v70h-70zm0 140h70v70h-70zM593.941 544.47l-138.743 95.568c-9.096 6.266-21.55 3.971-27.816-5.125a20 20 0 0 1-3.529-11.345V432.432c0-11.045 8.954-20 20-20a20 20 0 0 1 11.345 3.53l138.743 95.567c9.097 6.266 11.392 18.72 5.126 27.816a20 20 0 0 1-5.126 5.126z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-mp4"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#4895FF" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M393.76 465c-25.6 0-44.8 6.72-54.08 24.32C332 473 316.32 465 290.4 465c-24.32 0-39.36 7.36-48.64 22.72V468.2h-46.4V641h46.4V526.12c4.8-16.96 12.8-23.36 32-23.36 18.88 0 25.6 8.96 25.6 32.32V641h46.4V528.04c4.16-18.24 14.08-25.28 32.96-25.28 19.52 0 26.24 8.96 26.24 32.32V641h46.4V526.44c0-43.2-18.88-61.44-57.6-61.44zm196.92 0c-30.4 0-45.44 11.2-52.16 24v-20.8h-46.4V705h46.4v-86.08c6.72 15.36 20.48 25.28 52.16 25.28 56 0 68.8-40 68.8-89.6 0-55.04-12.8-89.6-68.8-89.6zm-14.72 144c-31.68 0-40-21.12-40-54.4 0-34.88 8.32-55.04 40-55.04 31.36 0 36.16 23.36 36.16 55.04 0 29.76-4.16 54.4-36.16 54.4zm268.92-54.72h-24.32V418.92h-54.08L677.2 548.2v45.44h98.88V641h44.48v-47.36h24.32v-39.36zm-128.32 0v-1.92l57.6-85.44h1.92v87.36h-59.52z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-music"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#FF6359" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="m619.815 356.754-94.728 353.53q-7.764 28.977-36.742 21.213-28.978-7.765-21.213-36.743l94.727-353.529q7.765-28.977 36.743-21.213 28.977 7.765 21.213 36.742Z" fill="#FFF" /><path d="M614.552 328.726c5.486 6.672 9.751 12.916 12.797 18.734 9.545 18.239-1.202 29.447 23.113 56.775 24.316 27.327 60.062 26.208 76.795 50.598 16.735 24.39 17.316 28.648 19.51 52.42 2.195 23.772-23.492 74.571-26.77 49.92-3.278-24.652-19.503-42.788-31.327-73.083-5.384-13.797-21.83-19.055-41.087-26.765-.7-.28-2.886-1.38-6.557-3.3a99.988 99.988 0 0 1-34.015-29.076l-39.3-53.024c-10.264-13.849-8.838-33.126 3.35-45.315 11.48-11.48 30.092-11.479 41.571 0a29.52 29.52 0 0 1 1.92 2.117zM270.399 649.323a130.822 87.5 15 1 0 252.728 67.718A130.822 87.5 15 1 0 270.4 649.323Z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-pdf"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#FF6359" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M234.64 641h48.64v-68.48h27.2c62.72 0 87.36-20.16 87.36-78.08 0-53.44-20.8-75.52-87.36-75.52h-75.84V641zm48.64-107.52v-76.16h20.8c32.64 0 44.16 9.6 44.16 38.08 0 29.44-11.2 38.08-44.16 38.08h-20.8zm154.24-114.56V641h76.16c65.28 0 108.16-25.28 108.16-111.04 0-92.48-42.88-111.04-108.16-111.04h-76.16zm48.64 180.48V459.88h24.96c40 0 60.48 12.8 60.48 70.08 0 54.08-19.52 69.44-60.48 69.44h-24.96zm315.2-138.24v-42.24H665.68V641h48.64v-86.4h80.64v-41.92h-80.64v-51.52z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-ppt"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#FF6359" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M391.269 705h75.544V598.642h42.245c97.412 0 135.681-31.311 135.681-121.268 0-82.999-32.305-117.292-135.681-117.292H391.269V705zm75.544-166.992V419.722h32.305c50.694 0 68.586 14.91 68.586 59.143 0 45.724-17.395 59.143-68.586 59.143h-32.305z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-txt"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#BEBEBE" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M638.17 362.94H385.82v65.17H475V703h73.99V428.11h89.18z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-unknown"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#BEBEBE" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M474.17 591.28h59.78v-11.27c0-16.66 5.88-25.97 35.77-48.02 33.32-24.99 44.1-42.63 44.1-88.2 0-68.6-33.32-86.73-113.68-86.73-29.4 0-55.86 3.43-73.99 8.82v60.76c17.15-5.39 39.69-8.33 59.78-8.33 39.69 0 51.94 6.37 51.94 35.77 0 20.58-4.41 29.89-25.97 47.04-28.91 24.99-37.73 40.18-37.73 68.11v22.05zm30.38 114.66c34.79 0 41.65-5.88 41.65-41.16 0-34.3-6.86-40.67-41.65-40.67-35.28 0-41.65 6.37-41.65 40.67 0 35.28 6.37 41.16 41.65 41.16z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-word"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#4895FF" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M361.81 703h93.1l53.41-215.6h2.94L563.69 703h93.1l77.91-340.06h-76.93l-49.98 251.37h-2.94l-49-218.54h-86.24l-51.94 218.54h-2.94l-49-251.37h-77.91z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-xlsx"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#60C267" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M495.93 707.9c93.59 0 130.83-35.77 130.83-102.41 0-63.21-17.64-88.69-98.98-108.29-49.98-11.76-57.82-19.6-57.82-41.65 0-28.91 16.17-36.26 54.88-36.26 28.42 0 67.62 6.86 84.28 12.25v-61.25c-18.13-6.37-48.51-12.25-87.22-12.25-78.89 0-124.46 27.44-124.46 99.47 0 60.76 21.07 81.34 93.59 98 51.94 12.74 61.74 22.05 61.74 48.02 0 30.38-14.7 40.67-59.78 40.67-34.3 0-74.97-5.88-96.04-13.72v65.17c21.07 5.88 59.29 12.25 98.98 12.25z" fill="#FFF" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-zip-rar"><path d="M862 902c0 16.569-13.431 30-30 30H192c-16.569 0-30-13.431-30-30V122c0-16.569 13.431-30 30-30h476l194 194v616z" fill="#7DB4FF" /><path d="M862 286H698c-16.569 0-30-13.431-30-30V92" fill="#FFF" fill-opacity=".296" /><path d="M289 92h70v70h-70zm70 70h70v70h-70zm-70 70h70v70h-70zm70 70h70v70h-70zm-70 70h70v70h-70zm0 96h140v110c0 16.569-13.431 30-30 30h-80c-16.569 0-30-13.431-30-30V468z" fill="#FFF" /></symbol>',l.insertBefore(o,l.lastChild)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}var B;const x=typeof window<"u",fe=t=>typeof t=="string",S=()=>{},me=x&&((B=window==null?void 0:window.navigator)==null?void 0:B.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function N(t){return typeof t=="function"?t():e.unref(t)}function he(t){return t}function z(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function O(t,l=!0){e.getCurrentInstance()?e.onMounted(t):l?t():e.nextTick(t)}function V(t){var l;const o=N(t);return(l=o==null?void 0:o.$el)!=null?l:o}const E=x?window:void 0;function w(...t){let l,o,n,c;if(fe(t[0])||Array.isArray(t[0])?([o,n,c]=t,l=E):[l,o,n,c]=t,!l)return S;Array.isArray(o)||(o=[o]),Array.isArray(n)||(n=[n]);const r=[],d=()=>{r.forEach(p=>p()),r.length=0},i=(p,_,u,f)=>(p.addEventListener(_,u,f),()=>p.removeEventListener(_,u,f)),a=e.watch(()=>[V(l),N(c)],([p,_])=>{d(),p&&r.push(...o.flatMap(u=>n.map(f=>i(p,u,f,_))))},{immediate:!0,flush:"post"}),s=()=>{a(),d()};return z(s),s}let P=!1;function _e(t,l,o={}){const{window:n=E,ignore:c=[],capture:r=!0,detectIframe:d=!1}=o;if(!n)return;me&&!P&&(P=!0,Array.from(n.document.body.children).forEach(u=>u.addEventListener("click",S)));let i=!0;const a=u=>c.some(f=>{if(typeof f=="string")return Array.from(n.document.querySelectorAll(f)).some(m=>m===u.target||u.composedPath().includes(m));{const m=V(f);return m&&(u.target===m||u.composedPath().includes(m))}}),p=[w(n,"click",u=>{const f=V(t);if(!(!f||f===u.target||u.composedPath().includes(f))){if(u.detail===0&&(i=!a(u)),!i){i=!0;return}l(u)}},{passive:!0,capture:r}),w(n,"pointerdown",u=>{const f=V(t);f&&(i=!u.composedPath().includes(f)&&!a(u))},{passive:!0}),d&&w(n,"blur",u=>{var f;const m=V(t);((f=n.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!(m!=null&&m.contains(n.document.activeElement))&&l(u)})].filter(Boolean);return()=>p.forEach(u=>u())}function ye(t,l=!1){const o=e.ref(),n=()=>o.value=Boolean(t());return n(),O(n,l),o}const R=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},H="__vueuse_ssr_handlers__";R[H]=R[H]||{};var L=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,we=(t,l)=>{var o={};for(var n in t)ve.call(t,n)&&l.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&L)for(var n of L(t))l.indexOf(n)<0&&ge.call(t,n)&&(o[n]=t[n]);return o};function ke(t,l,o={}){const n=o,{window:c=E}=n,r=we(n,["window"]);let d;const i=ye(()=>c&&"ResizeObserver"in c),a=()=>{d&&(d.disconnect(),d=void 0)},s=e.watch(()=>V(t),_=>{a(),i.value&&c&&_&&(d=new ResizeObserver(l),d.observe(_,r))},{immediate:!0,flush:"post"}),p=()=>{a(),s()};return z(p),{isSupported:i,stop:p}}function j(t,l={}){const{reset:o=!0,windowResize:n=!0,windowScroll:c=!0,immediate:r=!0}=l,d=e.ref(0),i=e.ref(0),a=e.ref(0),s=e.ref(0),p=e.ref(0),_=e.ref(0),u=e.ref(0),f=e.ref(0);function m(){const v=V(t);if(!v){o&&(d.value=0,i.value=0,a.value=0,s.value=0,p.value=0,_.value=0,u.value=0,f.value=0);return}const g=v.getBoundingClientRect();d.value=g.height,i.value=g.bottom,a.value=g.left,s.value=g.right,p.value=g.top,_.value=g.width,u.value=g.x,f.value=g.y}return ke(t,m),e.watch(()=>V(t),v=>!v&&m()),c&&w("scroll",m,{capture:!0,passive:!0}),n&&w("resize",m,{passive:!0}),O(()=>{r&&m()}),{height:d,bottom:i,left:a,right:s,top:p,width:_,x:u,y:f,update:m}}function be(t={}){const{type:l="page",touch:o=!0,resetOnTouchEnds:n=!1,initialValue:c={x:0,y:0},window:r=E,eventFilter:d}=t,i=e.ref(c.x),a=e.ref(c.y),s=e.ref(null),p=v=>{l==="page"?(i.value=v.pageX,a.value=v.pageY):l==="client"?(i.value=v.clientX,a.value=v.clientY):l==="movement"&&(i.value=v.movementX,a.value=v.movementY),s.value="mouse"},_=()=>{i.value=c.x,a.value=c.y},u=v=>{if(v.touches.length>0){const g=v.touches[0];l==="page"?(i.value=g.pageX,a.value=g.pageY):l==="client"&&(i.value=g.clientX,a.value=g.clientY),s.value="touch"}},f=v=>d===void 0?p(v):d(()=>p(v),{}),m=v=>d===void 0?u(v):d(()=>u(v),{});return r&&(w(r,"mousemove",f,{passive:!0}),w(r,"dragover",f,{passive:!0}),o&&l!=="movement"&&(w(r,"touchstart",m,{passive:!0}),w(r,"touchmove",m,{passive:!0}),n&&w(r,"touchend",_,{passive:!0}))),{x:i,y:a,sourceType:s}}var q;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(q||(q={}));var Fe=Object.defineProperty,U=Object.getOwnPropertySymbols,Ve=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,A=(t,l,o)=>l in t?Fe(t,l,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[l]=o,Ee=(t,l)=>{for(var o in l||(l={}))Ve.call(l,o)&&A(t,o,l[o]);if(U)for(var o of U(l))Ce.call(l,o)&&A(t,o,l[o]);return t};Ee({linear:he},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Ie=[(t=>(e.pushScopeId("data-v-e0e33196"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("i",{class:"i-ri-more-2-fill"},null,-1))],Me=e.defineComponent({__name:"UploadToggleButton",props:{right:null},setup(t){const l=t;return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vimr-upload-toggle-button",style:e.normalizeStyle({transform:`translate(${l.right??0}px,-50%)`})},Ie,4))}}),Zt="",b=(t,l)=>{const o=t.__vccOpts||t;for(const[n,c]of l)o[n]=c;return o},T=b(Me,[["__scopeId","data-v-e0e33196"]]);var W=(t=>(t.number="[object Number]",t.string="[object String]",t.boolean="[object Boolean]",t.null="[object Null]",t.undefined="[object Undefined]",t.object="[object Object]",t.array="[object Array]",t.date="[object Date]",t.regexp="[object RegExp]",t.set="[object Set]",t.map="[object Map]",t.file="[object File]",t.function="[object Function]",t))(W||{});function M(t){return Object.prototype.toString.call(t)===W.function}const Z={data:{type:Array,default:void 0},popupMenuOptions:{type:Array,default:void 0},popupMenuItemOptions:{type:Array,default:void 0},navigationOptions:{type:Array,default:void 0},title:{type:String,default:void 0},previewShow:{type:Boolean,default:void 0},uploadPanelShow:{type:Boolean,default:void 0}},Q=t=>(e.pushScopeId("data-v-86e42881"),t=t(),e.popScopeId(),t),$e={class:"vimr-wrap"},Be={class:"vimr-header"},xe={class:"vimr-title"},Se=Q(()=>e.createElementVNode("span",{class:"line-x"},null,-1)),Ne={key:0,class:"vimr-navigation"},ze=Q(()=>e.createElementVNode("span",{class:"line-x"},null,-1)),Oe={class:"vimr-body-content"},Pe=e.defineComponent({__name:"Wrap",props:Z,emits:["update:contextMenuItemClick","update:select","update:uploadPanelShow"],setup(t,{emit:l}){const o=t,n=e.ref(),c=e.ref(),{right:r,bottom:d}=j(n),{width:i,height:a}=j(c),s=()=>{l("update:uploadPanelShow",!o.uploadPanelShow)},{x:p,y:_}=be(),u=e.ref(p.value),f=e.ref(_.value),m=e.ref(!1),v=e.ref(o.popupMenuOptions),g=async()=>{u.value=p.value>r.value-i.value?r.value-i.value:p.value,f.value=_.value>d.value-a.value?d.value-a.value:_.value,m.value&&(m.value=!1,await e.nextTick(),await new Promise(h=>{setTimeout(()=>h(!0),100)})),m.value=!0},$=()=>{m.value=!1},I=e.ref(),Ot=async()=>{o.popupMenuOptions||console.warn("popupMenuOptions is not found"),v.value=o.popupMenuOptions,I.value=void 0,g()},Pt=()=>{$()},ue=h=>{o.popupMenuItemOptions||console.warn("popupMenuItemOptions is not found"),v.value=o.popupMenuItemOptions,I.value=h,g()},Rt=h=>{if(m.value){$();return}ue(h)},Ht=h=>{h.onClick&&M(h.onClick)&&h.onClick(h,I.value),l("update:contextMenuItemClick",{menu:h,data:e.toRaw(I.value)})},k=e.ref([]),Lt=h=>{if($(),k.value.includes(h.key)){k.value=[],l("update:select",{key:void 0,selectKeys:e.toRaw(k.value)});return}k.value=[h.key],l("update:select",{key:h.key,selectKeys:e.toRaw(k.value)})},jt=h=>{const C=k.value.findIndex(F=>F===h.key);if(C>-1){k.value.splice(C,1),l("update:select",{key:void 0,selectKeys:e.toRaw(k.value)});return}k.value.push(h.key),l("update:select",{key:h.key,selectKeys:e.toRaw(k.value)})};return(h,C)=>(e.openBlock(),e.createElementBlock("div",$e,[e.renderSlot(h.$slots,"header",{},()=>[e.createElementVNode("div",Be,[e.createElementVNode("div",xe,e.toDisplayString(o.title),1),Se,h.$slots.navigation?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(h.$slots,"navigation",{},()=>[e.createVNode(e.unref(pe),{options:o.navigationOptions},null,8,["options"])],!0)])):e.createCommentVNode("",!0),ze])],!0),e.createElementVNode("div",{ref_key:"vimrMainRef",ref:n,class:"vimr-main"},[e.renderSlot(h.$slots,"side",{},void 0,!0),e.createElementVNode("div",{class:"vimr-body",onContextmenu:C[0]||(C[0]=e.withModifiers(F=>Ot(),["prevent"])),onClick:Pt},[e.createElementVNode("div",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.data,F=>e.renderSlot(h.$slots,"default",e.normalizeProps(e.guardReactiveProps(F)),()=>[e.createVNode(e.unref(K),{data:F,selected:k.value.includes(F.key),onContextmenu:e.withModifiers(qt=>ue(F),["prevent","stop"]),onClick:e.withModifiers(qt=>Lt(F),["prevent","stop"]),onMoreIconClick:Rt,onSelectIconClick:jt},null,8,["data","selected","onContextmenu","onClick"])],!0)),256))])],32),e.renderSlot(h.$slots,"preview",{},void 0,!0),e.renderSlot(h.$slots,"uploadPanel",{},void 0,!0),e.renderSlot(h.$slots,"uploadTrigger",{},void 0,!0),e.createVNode(T,{right:o.uploadPanelShow?-400:0,onClick:e.withModifiers(s,["prevent","stop"])},null,8,["right","onClick"]),e.createVNode(e.unref(ee),{ref_key:"popupRef",ref:c,value:m.value,"onUpdate:value":C[1]||(C[1]=F=>m.value=F),options:v.value,x:u.value,y:f.value,"onUpdate:menuItemClick":Ht},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"popupMenu",{},void 0,!0)]),_:3},8,["value","options","x","y"])],512)]))}}),Qt="",Re=b(Pe,[["__scopeId","data-v-86e42881"]]),X={data:{type:Object,default:void 0},width:{type:Number,default:140},selected:{type:Boolean,default:void 0}},Y=t=>(e.pushScopeId("data-v-06e1441a"),t=t(),e.popScopeId(),t),He={class:"vimr-item-checkbox-wrap"},Le=["onClick"],je=[Y(()=>e.createElementVNode("span",{class:"i-ri-checkbox-blank-circle-fill vimr-item-checkbox-icon selected-icon"},null,-1))],qe=["onClick"],Ue=[Y(()=>e.createElementVNode("span",{class:"i-ri-more-fill vimr-item-checkbox-icon"},null,-1))],Ae={class:"vimr-item-text"},Te=e.defineComponent({__name:"Item",props:X,emits:["moreIconClick","selectIconClick"],setup(t,{emit:l}){const o=t,n={file:["file"],folder:["folder"],img:["image/gif","image/x-icon","image/jpeg","image/jpeg","image/png","image/wbmp"],jpg:["image/jpeg"],mp4:["video/mpeg4"],music:["audio/mp3"],pdf:["text/pdf"],ppt:["text/ppt"],txt:["text/txt"],word:["text/word"],xlsx:["text/xlsx"],"zip-rar":["zip-rar"],unknown:["unknown"]},c=e.computed(()=>{var a;let i="unknown";for(const s in n)o.data&&o.data.type&&n[s].includes((a=o.data)==null?void 0:a.type)&&(i=s);return i}),r=()=>{o.data&&l("moreIconClick",e.toRaw(o.data))},d=()=>{o.data&&l("selectIconClick",e.toRaw(o.data))};return(i,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({width:`${o.width}px`}),class:e.normalizeClass(["vimr-item-wrap",o.selected?"selected":""])},[e.createElementVNode("div",He,[e.createElementVNode("div",{class:"vimr-item-checkbox",onClick:e.withModifiers(d,["prevent","stop"])},je,8,Le),e.createElementVNode("div",{class:"vimr-item-checkbox",onClick:e.withModifiers(r,["prevent","stop"])},Ue,8,qe)]),e.renderSlot(i.$slots,"icon",e.normalizeProps(e.guardReactiveProps(o.data)),()=>[e.createVNode(e.unref(G),{type:e.unref(c),width:5,height:5},null,8,["type"])],!0),e.renderSlot(i.$slots,"default",{},()=>{var s;return[e.createElementVNode("div",Ae,e.toDisplayString((s=o.data)==null?void 0:s.label),1)]},!0)],6))}}),Kt="",K=b(Te,[["__scopeId","data-v-06e1441a"]]),We=["xlink:href","fill"],Ze=e.defineComponent({__name:"SvgIcon",props:{prefix:{default:"icon"},name:null,color:{default:"#333"},width:{default:1},height:{default:1}},setup(t){const l=t,o=e.computed(()=>`#${l.prefix}-${l.name}`);return(n,c)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({"aria-hidden":"true"},n.$attrs,{style:{width:`${l.width}em`,height:`${l.height}em`}}),[e.createElementVNode("use",{"xlink:href":e.unref(o),fill:l.color},null,8,We)],16))}}),D={type:{type:String,default:"unknown"},width:{type:Number,default:5},height:{type:Number,default:5}},Qe={class:"vimr-icon"},Xe=e.defineComponent({__name:"Icon",props:D,setup(t){const l=t;return(o,n)=>(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(Ze,{name:l.type,width:l.width,height:l.height},null,8,["name","width","height"])]))}}),Dt="",G=b(Xe,[["__scopeId","data-v-149273f1"]]),J={options:{type:Object,default:void 0},value:{type:Boolean,default:!1},x:{type:Number,default:0},y:{type:Number,default:0},width:{type:Number,default:140}},Ye=["onClick","onContextmenu"],Ke={class:"vimr-popup-menu-item"},De=e.defineComponent({__name:"PopupMenu",props:J,emits:["update:value","update:menuItemClick"],setup(t,{emit:l}){const o=t,n=e.ref(o.x),c=e.ref(o.y),r=e.ref(o.value),d=e.ref(o.options);e.watch(()=>o.value,a=>{r.value=a,a&&(n.value=o.x,c.value=o.y)}),e.watch(()=>o.options,a=>{d.value=a});const i=a=>{r.value=!1,l("update:value",r.value),l("update:menuItemClick",e.toRaw(a))};return(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:"vimr-popup-menu-wrap",style:e.normalizeStyle({transform:`translate(${n.value}px,${c.value}px)`,pointerEvents:r.value?"auto":"none"})},[e.renderSlot(a.$slots,"default",{},()=>[e.createElementVNode("div",{class:"vimr-popup-menu",style:e.normalizeStyle([{width:`${o.width}px`},r.value?{visibility:"visible",opacity:100,transform:"translateY(0)"}:{visibility:"hidden",opacity:0,transform:"translateY(-10PX)"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options,(p,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,onClick:u=>i(p),onContextmenu:e.withModifiers(u=>!1,["prevent"])},[e.createElementVNode("div",Ke,[p.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(p.icon)},null,2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(p.label),1)])],40,Ye))),128))],4)],!0)],4))}}),Gt="",ee=b(De,[["__scopeId","data-v-21d732b6"]]),te={options:{type:Object,default:void 0},show:{type:Boolean,default:void 0},blur:{type:Boolean,default:!0}},Ge=[(t=>(e.pushScopeId("data-v-bc5942a8"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("i",{class:"i-ri-close-fill"},null,-1))],Je=["onClick"],et=e.defineComponent({__name:"Preview",props:te,emits:["update:show"],setup(t,{emit:l}){const o=t;return(n,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"vimr"},{default:e.withCtx(()=>[o.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vimr-preview-wrap",[o.blur?"backdrop-blur-2xl":""]])},[e.createElementVNode("div",{class:"vimr-preview-close-icon",onClick:c[0]||(c[0]=e.withModifiers(r=>l("update:show",!1),["prevent","stop"]))},Ge),e.renderSlot(n.$slots,"default",{},()=>[e.createElementVNode("div",{class:"vimr-preview-content",onClick:e.withModifiers(r=>!1,["prevent","stop"])},null,8,Je)],!0)],2)):e.createCommentVNode("",!0)]),_:3}))}}),to="",tt=b(et,[["__scopeId","data-v-bc5942a8"]]),oe={show:{type:Boolean,default:void 0},blur:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},accept:{type:String,default:void 0},max:{type:Number,default:9},multiple:{type:Boolean,default:!0},name:{type:String,default:"file"},action:{type:String,default:void 0},headers:{type:Object,default:void 0},customRequest:{type:Function,default:void 0},data:{type:Object,default:void 0},defaultFileList:{type:Array,default:void 0},fileList:{type:Array,default:void 0}},le={fileList:{type:Array,default:void 0}},ne={disabled:{type:Boolean,default:!1},accept:{type:String,default:void 0},max:{type:Number,default:9},multiple:{type:Boolean,default:!0},name:{type:String,default:"file"},action:{type:String,default:void 0},headers:{type:Object,default:void 0},customRequest:{type:Function,default:void 0},data:{type:Object,default:void 0},defaultFileList:{type:Array,default:void 0},fileList:{type:Array,default:void 0}};let ie=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((l,o)=>(o&=63,o<36?l+=o.toString(36):o<62?l+=(o-26).toString(36).toUpperCase():o>62?l+="-":l+="_",l),"");const ot=t=>t.type.indexOf("image")===0,ae=(t,l,o)=>{const n=t.value.findIndex(c=>c.id===l);n>-1&&(t.value[n].status=o)},lt=(t,l,o)=>{const n=t.value.findIndex(c=>c.id===l);n>-1&&(t.value[n].percentage=o)},nt=({file:t,action:l,data:o,headers:n,name:c,onFinish:r,onError:d,onProgress:i})=>{if(!l)return;const a=new FormData;a.append(c??"file",t.file),o&&Object.keys(o).forEach(p=>{a.append(p,o[p])});const s=new XMLHttpRequest;s.open("post",l,!0),s.onload=()=>{s.status<200||s.status>=300?(console.error(new Error(s.statusText),s),d()):r(),s.onerror=()=>{console.error(new Error(s.statusText),s),d()},i&&s.upload&&(s.upload.onprogress=p=>{i({percent:p.loaded/p.total*100})}),n&&Object.keys(n).forEach(p=>{s.setRequestHeader(p,n[p])})},s.send(a)},it=t=>(e.pushScopeId("data-v-bca1d5ab"),t=t(),e.popScopeId(),t),at=["multiple","max","accept"],st=it(()=>e.createElementVNode("button",null,[e.createElementVNode("i",{class:"i-ri-add-line"})],-1)),ct=e.defineComponent({__name:"UploadTrigger",props:ne,emits:["click","update:fileList","finish","error","change"],setup(t,{emit:l}){const o=t,n=e.ref(),c=e.ref(),r=e.ref(o.defaultFileList??[]);e.watch(()=>o.fileList,i=>{r.value=i??[]});const d=()=>{l("click"),c.value.click()};return w(c,"change",i=>{const a=c.value?c.value.files:void 0;if(!a)return;const s=ie(6),p=Object.values(a).map(_=>{const u={id:ie(12),name:_.name,status:"pending",batchId:s,file:_,fullPath:URL.createObjectURL(_),percentage:0,type:_.type};let f=null;return o.customRequest&&M(o.customRequest)?f=o.customRequest:o.action?f=nt:console.error("props.action is required"),f&&f({file:u,data:o.data,headers:o.headers,action:o.action,name:o.name,onFinish:()=>{ae(r,u.id,"finished"),l("finish",u)},onError:()=>{ae(r,u.id,"error"),l("error",u)},onProgress:m=>{lt(r,u.id,m.percent)}}),u});r.value.push(...p),l("update:fileList",r.value),l("change",p)}),(i,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"uploadTriggerRef",ref:n,class:"vimr-upload-trigger",onClick:d},[e.createElementVNode("input",{ref_key:"uploadFileRef",ref:c,multiple:o.multiple,max:o.max,accept:o.accept,type:"file",class:"vimr-upload-file-input"},null,8,at),st],512))}}),oo="",se=b(ct,[["__scopeId","data-v-bca1d5ab"]]),ce=t=>(e.pushScopeId("data-v-37eac4f2"),t=t(),e.popScopeId(),t),rt={class:"vimr-upload-file-list-wrap"},dt={class:"vimr-upload-file-list-item-thumbnail"},pt=["src"],ut={class:"vimr-upload-file-list-item-content"},ft={class:"vimr-upload-file-list-item-content-header"},mt={class:"vimr-upload-file-list-item-tag"},ht={class:"vimr-upload-file-list-item-content-body"},_t={class:"vimr-upload-file-list-item-text-wrap"},yt={class:"vimr-upload-file-list-item-text"},vt={class:"vimr-upload-file-list-item-actions"},gt={class:"vimr-upload-file-list-item-actions-btns"},wt=["onClick"],kt=[ce(()=>e.createElementVNode("i",{class:"i-ri-close-fill"},null,-1))],bt=["onClick"],Ft=[ce(()=>e.createElementVNode("i",{class:"i-ri-refresh-line"},null,-1))],Vt={class:"vimr-upload-file-list-item-content-footer"},Ct=e.defineComponent({__name:"UploadList",props:le,emits:["retry","remove"],setup(t,{emit:l}){const o=t,n=e.ref();e.watch(()=>o.fileList,d=>{n.value=d??[],n.value.forEach(i=>{if(ot(i.file)&&!i.thumbnailUrl){const a=new FileReader;a.onload=s=>{var p;n.value.find(_=>_.id===i.id).thumbnailUrl=(p=s.target)==null?void 0:p.result},a.readAsDataURL(i.file)}})},{immediate:!0});const c=d=>{l("retry",d)},r=d=>{l("remove",d)};return(d,i)=>{var a;return e.openBlock(),e.createElementBlock("div",rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((a=n.value)==null?void 0:a.filter(s=>s.status!=="removed"),s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:"vimr-upload-file-list-item"},[e.createElementVNode("div",dt,[e.createElementVNode("img",{src:s.thumbnailUrl,alt:""},null,8,pt)]),e.createElementVNode("div",ut,[e.createElementVNode("div",ft,[e.createElementVNode("div",mt,e.toDisplayString(s.type),1)]),e.createElementVNode("div",ht,[e.createElementVNode("div",_t,[e.createElementVNode("div",yt,e.toDisplayString(s.name),1)]),e.createElementVNode("div",vt,[e.createElementVNode("div",gt,[s.status==="uploading"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vimr-upload-file-list-item-actions-btns-btn",onClick:p=>r(s)},kt,8,wt)):e.createCommentVNode("",!0),s.status==="error"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vimr-upload-file-list-item-actions-btns-btn",onClick:p=>c(s)},Ft,8,bt)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Vt,[e.createElementVNode("div",{class:"vimr-upload-file-list-item-content-footer-progress",style:e.normalizeStyle({width:`${s.status==="finished"||s.status==="error"?100:s.percentage??0}%`,backgroundColor:`${s.status==="finished"?"#10b981":s.status==="error"?"#ef4444":""}`})},null,4)])])]))),128))])}}}),io="",re=b(Ct,[["__scopeId","data-v-37eac4f2"]]),Et=[(t=>(e.pushScopeId("data-v-2f9a6904"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("i",{class:"i-ri-close-fill"},null,-1))],It=["onClick"],Mt={class:"vimr-upload-trigger-wrap"},$t=e.defineComponent({__name:"UploadPanel",props:oe,emits:["update:show","update:fileList","finish","error","change"],setup(t,{emit:l}){const o=t,n=e.ref();_e(n,d=>{d.target.className==="i-ri-more-2-fill"||d.target.className==="vimr-upload-panel-toggle-button"||l("update:show",!1)});const c=e.ref(o.defaultFileList??[]);e.watch(()=>o.fileList,d=>{c.value=d??[],l("update:fileList",d??[])});const r=d=>{c.value=d,l("update:fileList",e.toRaw(d))};return(d,i)=>(e.openBlock(),e.createBlock(e.Transition,{name:"vimr"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"uploadRef",ref:n,class:e.normalizeClass(["vimr-upload-panel-wrap",[d.blur?"backdrop-blur-2xl":""]])},[e.createElementVNode("div",{class:"vimr-upload-panel-close-icon",onClick:i[0]||(i[0]=e.withModifiers(a=>l("update:show",!1),["prevent","stop"]))},Et),e.createElementVNode("div",{class:"vimr-upload-panel-content",onClick:e.withModifiers(a=>!1,["prevent","stop"])},[e.createVNode(re,{"file-list":c.value},null,8,["file-list"])],8,It),e.createElementVNode("div",Mt,[e.createVNode(se,e.mergeProps({"file-list":c.value},o,{"onUpdate:fileList":r,onFinish:i[1]||(i[1]=a=>{l("finish",e.toRaw(a))}),onError:i[2]||(i[2]=a=>{l("error",e.toRaw(a))}),onChange:i[3]||(i[3]=a=>l("change",e.toRaw(a)))}),null,16,["file-list"])])],2),[[e.vShow,o.show]])]),_:1}))}}),co="",Bt=b($t,[["__scopeId","data-v-2f9a6904"]]),de={options:{type:Object,default:void 0},value:{type:String,default:void 0}},xt={class:"vimr-navigation-wrap"},St=["onClick"],Nt={class:"vimr-navigation-item-label"},zt=e.defineComponent({__name:"Navigation",props:de,emits:["update:value"],setup(t,{emit:l}){const o=t,n=e.ref(o.value),c=r=>{n.value=r.key,l("update:value",n.value),r.onClick&&M(r.onClick)&&r.onClick(r)};return e.watch(()=>o.value,r=>{n.value=r}),(r,d)=>(e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options,(i,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:e.normalizeClass(["vimr-navigation-item",i.key===n.value?"bg-black/10":""]),onClick:s=>c(i)},[i.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["vimr-navigation-item-icon",i.icon])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("span",Nt,e.toDisplayString(i.label),1)],10,St))),128))]))}}),ro="",pe=b(zt,[["__scopeId","data-v-2e25a5a3"]]);y.VIcon=G,y.VItem=K,y.VNavigation=pe,y.VPopupMenu=ee,y.VPreview=tt,y.VUploadList=re,y.VUploadPanel=Bt,y.VUploadToggleButton=T,y.VUploadTrigger=se,y.VWrap=Re,y.iconProps=D,y.itemProps=X,y.navigationProps=de,y.popupMenuProps=J,y.previewProps=te,y.uploadFileListProps=le,y.uploadPanelProps=oe,y.uploadTriggerProps=ne,y.wrapProps=Z,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});