import{a3 as $,w as B,l as L,x as N,h as V,as as A}from"./index-BTglIPU2.js?v=1773287522785";import{_ as T}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{c as d}from"./copy-D-wIKr0q.js?v=1773287522785";import{w as U}from"./FileIcon-eIHDRaxH.js?v=1773287522785";import{a1 as j,b as q,B as z}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as F,i as O,r as f,c as R,$ as _,a8 as h,a9 as t,_ as X,a0 as n,S as e,j as v,aa as w,ak as E,X as G}from"./vue-core-DJjvd5ZC.js?v=1773287522785";const H={class:"p-20px"},Z=F({__name:"ShareDetail",setup(I,{expose:k}){const{t:a}=$.global,x="".concat(window.location.origin,"/down/"),y=O("fileStore"),l=f(!1),o=f({filename:"",ps:"",token:"",expire:"",total:0,password:"",addtime:0,id:0});k({open(s){o.value={filename:s.filename,ps:s.ps,token:s.token,expire:B(s.expire),total:s.total,password:s.password,addtime:s.addtime,id:s.id},l.value=!0},close(){l.value=!1}});async function b(){return V({title:a("file.shareModal.cancelSharing"),content:a("file.shareModal.confirmStopSharing",{filename:o.value.filename}),async onConfirm(){await A.post("/files?action=remove_download_url",{id:o.value.id},{requestOptions:{loading:a("file.shareModal.deletingShare"),successMessage:!0}}),l.value=!1,U(y)}}),!1}const p=R(()=>"".concat(x).concat(o.value.token));function g(){d(p.value)}function C(){d(a("file.shareModal.linkAndCode",{link:p.value,code:o.value.password}))}return(s,r)=>{const c=q,i=j,M=L,u=z,S=T,D=N;return _(),h(D,{show:e(l),"onUpdate:show":r[1]||(r[1]=m=>G(l)?l.value=m:null),title:e(a)("file.shareModal.shareDetails",{name:e(o).ps}),width:560,footer:!0,"confirm-type":"error","confirm-text":e(a)("file.shareModal.closeSharingChain"),onConfirm:b},{default:t(()=>[X("div",H,[n(S,null,{default:t(()=>[n(i,{label:e(a)("file.shareModal.shareName")},{default:t(()=>[n(c,{value:e(o).ps,"onUpdate:value":r[0]||(r[0]=m=>e(o).ps=m)},null,8,["value"])]),_:1},8,["label"]),n(i,{label:e(a)("file.shareModal.shareChain")},{default:t(()=>[n(c,{class:"mr-10px",readonly:!0,value:e(p)},null,8,["value"]),n(u,{type:"primary",onClick:g},{icon:t(()=>[n(M,{name:"common-copy",size:"16"})]),_:1})]),_:1},8,["label"]),e(o).password?(_(),h(i,{key:0,label:e(a)("file.shareModal.extractionCode")},{default:t(()=>[n(c,{class:"mr-10px",value:"".concat(e(o).password),readonly:""},null,8,["value"]),n(u,{type:"primary",onClick:C},{default:t(()=>[v(w(e(a)("file.shareModal.copyLinkAndCode")),1)]),_:1})]),_:1},8,["label"])):E("",!0),n(i,{label:e(a)("file.shareModal.expirationDate"),"show-feedback":!1},{default:t(()=>[v(w(e(o).expire),1)]),_:1},8,["label"])]),_:1})])]),_:1},8,["show","title","confirm-text"])}}});export{Z as _};
