import{r as e}from"./rolldown-runtime-BM3Ffeng.js";import{mt as t,ot as n}from"./element-plus-vendor-BF9PNysW.js";import{A as r,D as i,I as a,N as o,P as s,Pt as c,Xt as l,et as u,ht as d,k as f}from"./vue-vendor-DMUmTARL.js";import{Ei as p,Ro as m,Wt as h,_t as g,ar as _,jt as v,mn as y,pn as b}from"./icons-vendor-Db5MGAkr.js";import{t as x}from"./_plugin-vue_export-helper-CWyGVBf-.js";var S={class:`zf-storage-edit__footer absolute inset-x-0 bottom-0 z-20 flex flex-col gap-3 border-t border-border bg-surface px-6 py-4 lg:px-8`},C={key:0,class:`storage-edit-footer__result`},w={class:`storage-edit-footer__result-msg`},T={class:`storage-edit-footer__actions`},E={key:0,class:`storage-edit-footer__test`},D={key:0,class:`storage-edit-footer__badge storage-edit-footer__badge--ok`},O={key:1,class:`storage-edit-footer__badge storage-edit-footer__badge--err`},k=a({__name:`StorageEditFooter`,props:{loading:{type:Boolean},isFirstStep:{type:Boolean},isLastStep:{type:Boolean},isEditMode:{type:Boolean},showConnectionTest:{type:Boolean},connectionTestLoading:{type:Boolean},connectionTestState:{},connectionTestResult:{}},emits:[`prev`,`next`,`submit`,`testConnection`,`clearConnectionTest`],setup(e,{emit:a}){let x=a;return(a,k)=>{let A=n,j=t;return u(),r(`div`,S,[e.showConnectionTest&&e.connectionTestState===`failed`&&e.connectionTestResult?(u(),r(`div`,C,[s(c(_),{class:`storage-edit-footer__result-icon`}),i(`div`,w,l(e.connectionTestResult.message),1),i(`button`,{type:`button`,class:`storage-edit-footer__result-close`,title:`关闭`,onClick:k[0]||=e=>x(`clearConnectionTest`)},[s(c(m),{class:`h-4 w-4`})])])):f(``,!0),i(`div`,T,[e.showConnectionTest?(u(),r(`div`,E,[s(A,{type:`success`,icon:c(v),loading:e.connectionTestLoading,onClick:k[1]||=e=>x(`testConnection`)},{default:d(()=>[o(l(e.connectionTestState===`idle`?`测试连接`:`重新测试`),1)]),_:1},8,[`icon`,`loading`]),e.connectionTestState===`success`&&e.connectionTestResult?(u(),r(`span`,D,[s(c(y),{class:`h-4 w-4`}),o(` 连接成功 · `+l(e.connectionTestResult.costMs)+`ms `,1)])):e.connectionTestState===`failed`&&e.connectionTestResult?(u(),r(`span`,O,[s(c(b),{class:`h-4 w-4`}),o(` 连接失败 · `+l(e.connectionTestResult.costMs)+`ms `,1)])):f(``,!0)])):f(``,!0),s(A,{type:`primary`,icon:c(g),disabled:e.loading||e.isFirstStep,onClick:k[2]||=e=>x(`prev`)},{default:d(()=>[...k[5]||=[o(` 上一步 `,-1)]]),_:1},8,[`icon`,`disabled`]),s(A,{type:`primary`,disabled:e.loading||e.isLastStep,onClick:k[3]||=e=>x(`next`)},{default:d(()=>[k[6]||=o(` 下一步 `,-1),s(j,{class:`el-icon--right`},{default:d(()=>[s(c(p))]),_:1})]),_:1},8,[`disabled`]),s(A,{type:`primary`,icon:c(h),loading:e.loading,disabled:!(e.isLastStep||e.isEditMode),onClick:k[4]||=e=>x(`submit`)},{default:d(()=>[...k[7]||=[o(` 保存设置 `,-1)]]),_:1},8,[`icon`,`loading`,`disabled`])])])}}}),A=e({default:()=>j}),j=x(k,[[`__scopeId`,`data-v-004281a9`]]);export{A as n,j as t};