import{_ as e}from"./index.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{n as t,a9 as i}from"./page_layout.js?v=1763625242172";import{f as l,c as s,a as o,g as n}from"./index39.js?v=1763625242172";import{a as r}from"./public.js?v=1763625242172";import{k as m,P as f,i as p,r as u,e as d,R as v,a2 as _,a3 as c,U as w,X as y,V as j,j as C,a4 as b,aj as h}from"./vue.js?v=1763625242172";import{dU as g,dT as x,dP as $,au as P}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./soft2.js?v=1763625242172";import"./soft.js?v=1763625242172";import"./site.js?v=1763625242172";import"./file2.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1763625242172";const T={class:"p-20px"},z={class:"w-240px"},U=m({name:"PasteSingleConfirm",__name:"PasteSingleConfirm",setup(m,{expose:U}){const{t:F}=f(),S=p("fileStore"),{currentPath:k,fileList:M,fileCopyCache:H,copiedFile:L,waitForPaste:N}=S,R=u(!1),V=d({type:"rename",name:"",size:0,modifyTime:""}),X=e=>{const a=l(M.value,H.value);a.length&&("overwrite"===e?V.name=a[0].nm:"rename"===e&&(V.name=q(a[0].nm)))},q=e=>e.replace(/\.(?=[^.]+$)/," - copy.");function A(){R.value=!1}async function B(){await o(L.value.path,k.value+"/"+V.name),N.value=!1,n(S)}async function D(){if("rename"==V.type){return await s(k.value,V.name)?r({title:F("file.pasteConfirm.overwriteTitle"),content:F("file.pasteConfirm.overwriteMessage",[V.name]),onConfirm:async({hide:e})=>{await B(),e(),A()}}):(await B(),A()),!1}await B()}return U({open:function(){R.value=!0;const e=l(M.value,H.value);1==e.length&&(V.type="rename",V.name=q(e[0].nm),V.size=e[0].sz,V.modifyTime=i(e[0].mt))},close:A}),(l,s)=>{const o=g,n=x,r=$,m=P,f=a,p=e;return v(),_(p,{show:j(R),"onUpdate:show":s[2]||(s[2]=e=>h(R)?R.value=e:null),width:440,title:l.$t("file.pasteConfirm.title"),footer:!0,onConfirm:D},{default:c((()=>[w("div",T,[y(f,null,{default:c((()=>[y(r,{label:l.$t("file.pasteConfirm.operationType")},{default:c((()=>[y(n,{value:j(V).type,"onUpdate:value":[s[0]||(s[0]=e=>j(V).type=e),X]},{default:c((()=>[y(o,{value:"overwrite"},{default:c((()=>[C(b(l.$t("file.pasteConfirm.overwriteFile")),1)])),_:1}),y(o,{value:"rename"},{default:c((()=>[C(b(l.$t("file.pasteConfirm.renameFile")),1)])),_:1})])),_:1},8,["value"])])),_:1},8,["label"]),y(r,{label:l.$t("file.pasteConfirm.fileName")},{default:c((()=>[w("div",z,[y(m,{value:j(V).name,"onUpdate:value":s[1]||(s[1]=e=>j(V).name=e),disabled:"overwrite"==j(V).type,placeholder:""},null,8,["value","disabled"])])])),_:1},8,["label"]),y(r,{label:l.$t("file.pasteConfirm.size")},{default:c((()=>[w("span",null,b(j(t)(j(V).size)),1)])),_:1},8,["label"]),y(r,{label:l.$t("file.pasteConfirm.lastModified"),"show-feedback":!1},{default:c((()=>[w("span",null,b(j(i)(j(V).modifyTime)),1)])),_:1},8,["label"])])),_:1})])])),_:1},8,["show","title"])}}});export{U as default};
