import{d as v,cy as C,bN as I,S as l,T as _,U as f,c,a1 as r,V as h,W as d,a2 as e,a0 as z,ad as F,b$ as B,cz as $,ai as x,Z as S}from"./index-93a218ca.js";import{u as R,a as V,k as E,F as T,d as A}from"./FileItem-9a94f7dd.js";import"./functionalCallableComp-685da399.js";/* empty css              */import"./index-f60e0de3.js";const N={class:"actions-panel actions"},U={key:0,class:"file-list"},L={class:"hint"},H=v({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(W){const{stackViewEl:w}=R().toRefs(),{itemSize:p,gridItems:k,cellWidth:b}=V(),n=E(),{selectdFiles:i}=C(n),u=I(),y=async t=>{const s=B(t);s&&n.addFiles(s.nodes)},D=async()=>{u.pushAction(async()=>{const t=await $.value.post("/zip",{paths:i.value.map(o=>o.fullpath)},{responseType:"blob"}),s=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=s,a.setAttribute("download",`iib_${new Date().toLocaleString()}.zip`),document.body.appendChild(a),a.click()})},g=t=>{i.value.splice(t,1)};return(t,s)=>{const a=x;return l(),_("div",{class:"container",ref_key:"stackViewEl",ref:w,onDrop:y},[f("div",N,[c(a,{onClick:s[0]||(s[0]=o=>e(n).selectdFiles=[])},{default:r(()=>[h(d(t.$t("clear")),1)]),_:1}),c(a,{onClick:D,type:"primary",loading:!e(u).isIdle},{default:r(()=>[h(d(t.$t("zipDownload")),1)]),_:1},8,["loading"])]),e(i).length?(l(),z(e(A),{key:1,ref:"scroller",class:"file-list",items:e(i).slice(),"item-size":e(p).first,"key-field":"fullpath","item-secondary-size":e(p).second,gridItems:e(k)},{default:r(({item:o,index:m})=>[c(T,{idx:m,file:o,"cell-width":e(b),"enable-close-icon":"",onCloseIconClick:j=>g(m),"full-screen-preview-image-url":e(F)(o),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","onCloseIconClick","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):(l(),_("div",U,[f("p",L,d(t.$t("batchDownloaDDragAndDropHint")),1)]))],544)}}});const J=S(H,[["__scopeId","data-v-aab31da2"]]);export{J as default};
