var v=(d,p,l)=>new Promise((f,t)=>{var _=o=>{try{m(l.next(o))}catch(e){t(e)}},x=o=>{try{m(l.throw(o))}catch(e){t(e)}},m=o=>o.done?f(o.value):Promise.resolve(o.value).then(_,x);m((l=l.apply(d,p)).next())});import{D as y,be as V,bb as I,bc as k,C as N}from"./base.b65bdcd1.js";import{E,a as U}from"./form-item.5db46a7d.js";/* empty css               *//* empty css              */import{N as C,r as g,G as S,Z as R,I as q,a as z,f as M,m as r,j as s,e as n,u as a,O as B,h as F,at as j,Q as D,R as G}from"./index.965ac11d.js";import{_ as L}from"./zfile-basic.8b129fdf.js";import{i as O,a as Q}from"./install.f1fa4e8e.js";import{_ as T}from"./plugin-vue_export-helper.21dcd24c.js";import{E as Z}from"./index.22cf9654.js";import{r as $}from"./CheckBadgeIcon.b1bb4ad5.js";import{E as w}from"./request.2ccc188b.js";import"./_Uint8Array.4350f927.js";import"./_initCloneObject.7947104d.js";import"./event.776e7e11.js";const A=d=>(D("data-v-0697a817"),d=d(),G(),d),H={class:"h-full min-h-screen bg-gray-100 text-gray-900 flex justify-center items-center"},J={class:"h-full lg:h-auto max-w-screen-lg bg-white shadow-xl sm:rounded-xl flex flex-1"},K=A(()=>r("div",{class:"flex-1 bg-gray-50 text-center hidden lg:flex rounded-l-xl"},[r("div",{class:"m-12 xl:m-16 w-full bg-contain bg-center bg-no-repeat zfile-install-logo"})],-1)),P={class:"w-full lg:w-1/2 xl:w-1/2 mt-10 p-6 sm:p-12"},W={class:"mt-0 flex flex-col items-center"},X={class:"text-2xl mt-0 xl:text-3xl font-extrabold box animate__animated animate__fadeInDown"},Y={class:"w-full flex-1"},ee=j('<div class="my-12 relative" data-v-0697a817><div class="absolute inset-0 flex items-center" aria-hidden="true" data-v-0697a817><div class="w-full border-t text-gray-600" data-v-0697a817></div></div><div class="relative flex justify-center text-sm" data-v-0697a817><span class="px-2 bg-white text-sm leading-none text-gray-600 tracking-wide font-medium" data-v-0697a817>\u7CFB\u7EDF\u521D\u59CB\u5316</span></div></div>',1),ae={__name:"index",setup(d){let p=C(),l=g(!1),f=g(),t=S({siteName:"",username:"",password:"",domain:""}),_=g({siteName:[{required:!0,message:"\u8BF7\u8F93\u5165\u7AD9\u70B9\u540D\u79F0",trigger:["change","blur"]}],username:[{required:!0,message:"\u8BF7\u8F93\u5165\u7BA1\u7406\u5458\u8D26\u53F7",trigger:["change","blur"]}],password:[{required:!0,message:"\u8BF7\u8F93\u5165\u7BA1\u7406\u5458\u5BC6\u7801",trigger:["change","blur"]}],domain:[{required:!0,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u57DF\u540D\uFF0C\u9700\u4EE5 http:// \u6216 https:// \u5F00\u5934",trigger:"change"}]});const x=o=>{window.open(o)},m=()=>v(this,null,function*(){yield f.value.validate(o=>{o?(l.value=!0,Q(t).then(e=>{w({message:"\u521D\u59CB\u5316\u6210\u529F",type:e.code===0?"success":"error",duration:1500,onClose(){p.push("/")}})}).finally(()=>{l.value=!1})):w.warning("\u8BF7\u6B63\u786E\u8F93\u5165\u521D\u59CB\u5316\u503C!")})});return R(()=>{const o=q();t.domain=o.zfileConfig.baseUrl||window.location.origin,O().then(e=>{e.data&&p.push("/")})}),(o,e)=>{const c=Z,u=E,b=y,h=U;return z(),M("div",H,[r("div",J,[K,r("div",P,[r("div",W,[r("h1",X,[r("img",{class:"w-16 cursor-pointer",onClick:e[0]||(e[0]=i=>x("https://github.com/zhaojun1998/zfile")),src:L})]),r("div",Y,[ee,s(h,{onSubmit:e[5]||(e[5]=F(()=>{},["prevent"])),ref_key:"installFormRef",ref:f,rules:a(_),model:a(t),class:"zfile-install-form",size:"large"},{default:n(()=>[s(u,{class:"box animate__animated animate__fadeInUp",prop:"siteName"},{default:n(()=>[s(c,{placeholder:"\u7AD9\u70B9\u540D\u79F0","prefix-icon":a(V),modelValue:a(t).siteName,"onUpdate:modelValue":e[1]||(e[1]=i=>a(t).siteName=i)},null,8,["prefix-icon","modelValue"])]),_:1}),s(u,{class:"box animate__animated animate__fadeInUp",prop:"username"},{default:n(()=>[s(c,{placeholder:"\u7BA1\u7406\u5458\u8D26\u53F7","prefix-icon":a(I),modelValue:a(t).username,"onUpdate:modelValue":e[2]||(e[2]=i=>a(t).username=i),modelModifiers:{trim:!0}},null,8,["prefix-icon","modelValue"])]),_:1}),s(u,{class:"box animate__animated animate__fadeInUp",prop:"password"},{default:n(()=>[s(c,{placeholder:"\u7BA1\u7406\u5458\u5BC6\u7801",type:"password","show-password":"","prefix-icon":a(k),modelValue:a(t).password,"onUpdate:modelValue":e[3]||(e[3]=i=>a(t).password=i),modelModifiers:{trim:!0}},null,8,["prefix-icon","modelValue"])]),_:1}),s(u,{class:"box animate__animated animate__fadeInUp",prop:"domain"},{default:n(()=>[s(c,{placeholder:"\u7AD9\u70B9\u5730\u5740/\u57DF\u540D","prefix-icon":a(N),modelValue:a(t).domain,"onUpdate:modelValue":e[4]||(e[4]=i=>a(t).domain=i),modelModifiers:{trim:!0}},null,8,["prefix-icon","modelValue"])]),_:1}),s(u,null,{default:n(()=>[s(b,{"native-type":"submit",loading:a(l),class:"w-full",type:"primary",icon:a($),onClick:m},{default:n(()=>[B(" \u7CFB\u7EDF\u521D\u59CB\u5316 ")]),_:1},8,["loading","icon"])]),_:1})]),_:1},8,["rules","model"])])])])])])}}};var ge=T(ae,[["__scopeId","data-v-0697a817"]]);export{ge as default};
