import{bj as Q,bk as w,bs as y,m as x,o as C,w as $,bm as i,bn as B,af as r,at as S,ah as s,d as a,am as q,V as d,u as c,E as u,aj as T,an as V,ai as b,ao as M,ag as p}from"./index.14cbc3e2.js";import{Q as N}from"./QChip.ece4defb.js";import{Q as j}from"./QToolbar.5456f6d3.js";import{Q as E}from"./QImg.ebfc0c11.js";import{Q as F}from"./QScrollArea.9c23a946.js";import{Q as R}from"./QPage.91f292ed.js";import"./QLinearProgress.49ce6557.js";import"./use-dialog-plugin-component.3669c11d.js";import{b as h}from"./route-block.7fdbc26a.js";import"./TouchPan.d6f7fc58.js";import"./touch.e73d5e06.js";const A=b("br",null,null,-1),D={class:"q-gutter-md"},I={key:0},O={key:1},P={__name:"[id]",setup(z){const m=Q(),_=w(),f=y(),e=x({loading:!1,search:null,selected:[],file:{}});C(()=>{l()}),$(()=>e.search,()=>{l()});async function k(){m.loading.show(),await i.deleteMany("medias",{where:{id:{in:e.selected}}}).catch().then(n=>{e.selected=[]}),l(),m.loading.hide()}async function l(){e.loading=!0,e.search,e.file=await i.findOne("medias",{where:{id:f.params.id}}).then(n=>n).catch(n=>null),e.loading=!1}function g(){i.download(e.file.filedisk)}return(n,t)=>{const v=B("van-skeleton");return r(),S(R,{padding:""},{default:s(()=>[a(j,null,{default:s(()=>[a(q,{class:"text-bold"},{default:s(()=>[a(d,{round:"",flat:"",onClick:t[0]||(t[0]=o=>c(_).back()),icon:"mdi-arrow-left"}),u(" File library "),A,a(N,null,{default:s(()=>{var o;return[u(T((o=c(f).params)==null?void 0:o.id),1)]}),_:1})]),_:1}),a(V),b("div",D,[a(d,{color:"red",outline:"",onClick:t[1]||(t[1]=o=>k()),"fab-mini":"",icon:"las la-trash"}),a(d,{class:"bg-white text-primary",onClick:t[2]||(t[2]=o=>g()),color:"black","fab-mini":"",icon:"las la-download"})])]),_:1}),a(M,{spaced:"",inset:"",dark:""}),a(F,{style:{height:"75vh"},class:"q-pt-lg q-mx-md overflow-scroll rounded-borders"},{default:s(()=>{var o;return[e.loading?(r(),p("div",I,[a(v,{row:15})])):(r(),p("div",O,[a(E,{style:{"max-height":"70vh"},fit:"contain",src:c(i).assets((o=e==null?void 0:e.file)==null?void 0:o.filedisk)},null,8,["src"])]))]}),_:1})]),_:1})}}};typeof h=="function"&&h(P);export{P as default};
