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 e,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.be232763.js";import{Q as N}from"./QChip.2457f813.js";import{Q as j}from"./QToolbar.43a05fe2.js";import{Q as E}from"./QImg.0dc9cac2.js";import{Q as F}from"./QScrollArea.eee9b08f.js";import{Q as R}from"./QPage.0cbc0a46.js";import"./QLinearProgress.7b5ceadd.js";import"./use-dialog-plugin-component.030f64f6.js";import{b as h}from"./route-block.7fdbc26a.js";import"./TouchPan.c91cc01d.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(),a=x({loading:!1,search:null,selected:[],file:{}});C(()=>{l()}),$(()=>a.search,()=>{l()});async function k(){m.loading.show(),await i.deleteMany("medias",{where:{id:{in:a.selected}}}).catch().then(n=>{a.selected=[]}),l(),m.loading.hide()}async function l(){a.loading=!0,a.search,a.file=await i.findOne("medias",{where:{id:f.params.id}}).then(n=>n).catch(n=>null),a.loading=!1}function g(){i.download(a.file.filedisk)}return(n,t)=>{const v=B("van-skeleton");return r(),S(R,{padding:""},{default:s(()=>[e(j,null,{default:s(()=>[e(q,{class:"text-bold"},{default:s(()=>[e(d,{round:"",flat:"",onClick:t[0]||(t[0]=o=>c(_).back()),icon:"mdi-arrow-left"}),u(" File library "),A,e(N,null,{default:s(()=>{var o;return[u(T((o=c(f).params)==null?void 0:o.id),1)]}),_:1})]),_:1}),e(V),b("div",D,[e(d,{color:"red",outline:"",onClick:t[1]||(t[1]=o=>k()),"fab-mini":"",icon:"las la-trash"}),e(d,{class:"bg-white text-primary",onClick:t[2]||(t[2]=o=>g()),color:"black","fab-mini":"",icon:"las la-download"})])]),_:1}),e(M,{spaced:"",inset:"",dark:""}),e(F,{style:{height:"75vh"},class:"q-pt-lg q-mx-md overflow-scroll rounded-borders"},{default:s(()=>[a.loading?(r(),p("div",I,[e(v,{row:15})])):(r(),p("div",O,[e(E,{style:{"max-height":"70vh"},fit:"contain",src:c(i).assets(a.file.filedisk)},null,8,["src"])]))]),_:1})]),_:1})}}};typeof h=="function"&&h(P);export{P as default};
