import{_ as e}from"./index.js?v=1764233927359";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764233927359";import{i as l,bf as s,d as t}from"./page_layout.js?v=1764233927359";import{g as o}from"./index199.js?v=1764233927359";import{g as r}from"./index39.js?v=1764233927359";import{_ as i}from"./ShareDetail.vue_vue_type_script_setup_true_lang.js?v=1764233927359";import{dR as u,au as n,dT as p,dU as f,aC as d}from"./naive.js?v=1764233927359";import{k as m,i as _,av as v,r as c,c as h,R as j,V as x,W as w,a3 as y,S as M,U as b,j as g,a4 as k,ak as S,F as U,N as D}from"./vue.js?v=1764233927359";import"./common.js?v=1764233927359";import"./__commonjsHelpers__.js?v=1764233927359";import"./public.js?v=1764233927359";import"./soft2.js?v=1764233927359";import"./soft.js?v=1764233927359";import"./site.js?v=1764233927359";import"./file2.js?v=1764233927359";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1764233927359";const C={class:"p-20px"},R=m({__name:"Share",setup(m,{expose:R}){const{t:F}=l.global,L=_("fileStore"),{choosedKeys:N,fileList:W}=L,q=v("shareDetailRef"),H=c(!1),K=h(()=>"dir"==O.value.type?F("file.shareModal.setShareFolder",{name:O.value.nm}):F("file.shareModal.setShareFile",{name:O.value.nm})),O=c({}),T=c({filename:"",ps:"",password:"",expire:24});async function V(){var e;const{message:a}=await s.post("/files?action=create_download_url",D(T.value),{requestOptions:{loading:F("file.shareModal.creatingShareLink")}});t(a)&&(H.value=!1,null==(e=q.value)||e.open(a),r(L))}function z(){T.value.password=o(8)}return R({open:function(){H.value=!0;const e=W.value.find(e=>N.value[0]==e.nm);O.value=e,T.value.ps=O.value.nm,T.value.filename=O.value.path},close:function(){H.value=!1}}),(l,s)=>{const t=n,o=u,r=f,m=p,_=d,v=a,c=e;return x(),j(U,null,[w(c,{show:b(H),"onUpdate:show":s[3]||(s[3]=e=>S(H)?H.value=e:null),title:b(K),width:560,footer:!0,"confirm-text":b(F)("file.shareModal.create"),onConfirm:V},{default:y(()=>[M("div",C,[w(v,null,{default:y(()=>[w(o,{label:b(F)("file.shareModal.shareName")},{default:y(()=>[w(t,{value:b(T).ps,"onUpdate:value":s[0]||(s[0]=e=>b(T).ps=e)},null,8,["value"])]),_:1},8,["label"]),w(o,{label:b(F)("file.shareModal.expirationDate")},{default:y(()=>[w(m,{value:b(T).expire,"onUpdate:value":s[1]||(s[1]=e=>b(T).expire=e)},{default:y(()=>[w(r,{value:24},{default:y(()=>[g(k(b(F)("file.shareModal.aDay")),1)]),_:1}),w(r,{value:168},{default:y(()=>[g(k(b(F)("file.shareModal.aWeek")),1)]),_:1}),w(r,{value:1130800},{default:y(()=>[g(k(b(F)("file.shareModal.permanent")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),w(o,{label:b(F)("file.shareModal.extractionCode"),"show-feedback":!1},{default:y(()=>[w(t,{value:b(T).password,"onUpdate:value":s[2]||(s[2]=e=>b(T).password=e)},null,8,["value"]),w(_,{class:"ml-10px",type:"primary",onClick:z},{default:y(()=>[g(k(b(F)("file.shareModal.random")),1)]),_:1})]),_:1},8,["label"])]),_:1})])]),_:1},8,["show","title","confirm-text"]),w(i,{ref_key:"shareDetailRef",ref:q},null,512)],64)}}});export{R as default};
