import{a3 as C,x as N,as as U,i as j}from"./index-BTglIPU2.js?v=1773287522785";import{_ as L}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{g as V}from"./index-DRk77PlU.js?v=1773287522785";import{w as $}from"./FileIcon-eIHDRaxH.js?v=1773287522785";import{_ as q}from"./ShareDetail.vue_vue_type_script_setup_true_lang-Vpbw-Uhg.js?v=1773287522785";import{a1 as O,b as T,a3 as E,a4 as K,B as P}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as W,i as X,al as Z,r as d,c as z,$ as A,Z as G,a0 as o,a9 as n,_ as H,S as e,j as p,aa as f,X as I,F as J,N as Q}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./soft-Cjyfamvm.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";const Y={class:"p-20px"},fe=W({__name:"Share",setup(ee,{expose:w}){const{t}=C.global,c=X("fileStore"),{choosedKeys:g,fileList:x}=c,v=Z("shareDetailRef"),r=d(!1),b=z(()=>i.value.type=="dir"?t("file.shareModal.setShareFolder",{name:i.value.nm}):t("file.shareModal.setShareFile",{name:i.value.nm})),i=d({}),l=d({filename:"",ps:"",password:"",expire:24});function M(){r.value=!0;const u=x.value.find(a=>g.value[0]==a.nm);i.value=u,l.value.ps=i.value.nm,l.value.filename=i.value.path}function S(){r.value=!1}w({open:M,close:S});async function k(){var a;const{message:u}=await U.post("/files?action=create_download_url",Q(l.value),{requestOptions:{loading:t("file.shareModal.creatingShareLink")}});j(u)&&(r.value=!1,(a=v.value)==null||a.open(u),$(c))}function y(){l.value.password=V(8)}return(u,a)=>{const h=T,_=O,m=K,D=E,R=P,F=L,B=N;return A(),G(J,null,[o(B,{show:e(r),"onUpdate:show":a[3]||(a[3]=s=>I(r)?r.value=s:null),title:e(b),width:560,footer:!0,"confirm-text":e(t)("file.shareModal.create"),onConfirm:k},{default:n(()=>[H("div",Y,[o(F,null,{default:n(()=>[o(_,{label:e(t)("file.shareModal.shareName")},{default:n(()=>[o(h,{value:e(l).ps,"onUpdate:value":a[0]||(a[0]=s=>e(l).ps=s)},null,8,["value"])]),_:1},8,["label"]),o(_,{label:e(t)("file.shareModal.expirationDate")},{default:n(()=>[o(D,{value:e(l).expire,"onUpdate:value":a[1]||(a[1]=s=>e(l).expire=s)},{default:n(()=>[o(m,{value:24},{default:n(()=>[p(f(e(t)("file.shareModal.aDay")),1)]),_:1}),o(m,{value:168},{default:n(()=>[p(f(e(t)("file.shareModal.aWeek")),1)]),_:1}),o(m,{value:1130800},{default:n(()=>[p(f(e(t)("file.shareModal.permanent")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),o(_,{label:e(t)("file.shareModal.extractionCode"),"show-feedback":!1},{default:n(()=>[o(h,{value:e(l).password,"onUpdate:value":a[2]||(a[2]=s=>e(l).password=s)},null,8,["value"]),o(R,{class:"ml-10px",type:"primary",onClick:y},{default:n(()=>[p(f(e(t)("file.shareModal.random")),1)]),_:1})]),_:1},8,["label"])]),_:1})])]),_:1},8,["show","title","confirm-text"]),o(q,{ref_key:"shareDetailRef",ref:v},null,512)],64)}}});export{fe as default};
