import{r,i as k,j as i,d as t,F as w}from"./react.6693569e.js";import{u as f,c as C,s as h}from"./index.ab3d776b.js";import"./index.f92af1bb.js";/* empty css               */import"./Header.1d32b19c.js";import{AppContext as x}from"./App.4008d6a0.js";import{N as y}from"./NoteModal.bf2c96db.js";import{S as B}from"./SignUp.3813bbbd.js";import{u as z}from"./ColorPicker.0ba20714.js";import{v as b,B as l,M as P,m as v}from"./antd.e57bc55d.js";import"./index.0a6cc9fb.js";/* empty css              *//* empty css              */import"./antd.5e666edb.js";import"./Cover.fc91526c.js";/* empty css               */import"./Login.e23338dc.js";import"./index.3c0c80dc.js";import"./index.67d5a99b.js";import"./RSA.f54b2b0a.js";/* empty css              */import"./size.d81ce6e6.js";import"./regular.2d81b23f.js";/* empty css               */const V="_signUpSettings_tk078_1",G="_board_tk078_9",M="_content_tk078_29",F="_item_tk078_33",T="_actionBar_tk078_36",U="_btnGroup_tk078_47",j="_tip_tk078_50",e={signUpSettings:V,board:G,content:M,item:F,actionBar:T,btnGroup:U,tip:j},I=({visible:s,onVisibleChange:c})=>{const{T:o}=f();return i(P,{title:o("settings.signup.main.button.preview"),visible:s,width:"80%",footer:null,onCancel:()=>c(!1),children:i("div",{style:{margin:"-24px"},children:i(B,{})})})},li=()=>{const{T:s}=f(),[c,o]=r.exports.useState(!1),[N,p]=r.exports.useState(!1),{setLoading:m}=r.exports.useContext(x),d=k(),[n,_]=r.exports.useState(void 0),g=z(()=>h.settingsStore.signup);r.exports.useEffect(()=>{_(C(g))},[g]);const u=async a=>{try{m(!0),await h.settingsStore.patchSettings({signup:a}),v.success(s("settings.signup.main.success"))}catch(S){console.error(S),v.error(s("settings.signup.main.error"))}finally{m(!1)}};return i("div",{className:e.signUpSettings,children:n&&t(w,{children:[t("div",{className:e.board,children:[i("span",{children:s("settings.signup.main.title1")}),t("div",{className:e.content,children:[t("div",{className:e.item,children:[t("div",{className:e.actionBar,children:[i("span",{children:s("settings.signup.main.enabled1")}),i(b,{checked:n.form.enabled,size:"small",onChange:a=>u({...n,form:{...n.form,enabled:a}})})]}),i("span",{className:e.tip,children:s("settings.signup.main.tip1")}),i("span",{className:e.tip,children:s("settings.signup.main.tip2")})]}),t("div",{className:e.item,children:[t("div",{className:e.actionBar,children:[i("span",{children:s("settings.signup.main.subTitle1")}),t("div",{className:e.btnGroup,children:[i(l,{type:"primary",size:"small",disabled:!n.form.enabled,onClick:()=>d.push("/settings/signup/form/edit"),children:s("settings.signup.main.button.edit")}),i(l,{size:"small",disabled:!n.form.enabled,onClick:()=>o(!0),children:s("settings.signup.main.button.preview")})]})]}),i("span",{className:e.tip,children:s("settings.signup.main.tip3")})]})]})]}),t("div",{className:e.board,children:[i("span",{children:s("settings.signup.main.title2")}),t("div",{className:e.content,children:[t("div",{className:e.item,children:[t("div",{className:e.actionBar,children:[i("span",{children:s("settings.signup.main.enabled2")}),i(b,{checked:n.note.enabled,size:"small",onChange:a=>u({...n,note:{...n.note,enabled:a}})})]}),i("span",{className:e.tip,children:s("settings.signup.main.tip4")})]}),t("div",{className:e.item,children:[t("div",{className:e.actionBar,children:[i("span",{children:s("settings.signup.main.subTitle2")}),t("div",{className:e.btnGroup,children:[i(l,{type:"primary",size:"small",disabled:!n.note.enabled,onClick:()=>d.push("/settings/signup/note/edit"),children:s("settings.signup.main.button.edit")}),i(l,{size:"small",disabled:!n.note.enabled,onClick:()=>p(!0),children:s("settings.signup.main.button.preview")})]})]}),i("span",{className:e.tip,children:s("settings.signup.main.tip5")})]})]})]}),i(I,{visible:c,onVisibleChange:a=>o(a)}),i(y,{visible:N,form:n.note.params,isPreview:!0,onVisibleChange:a=>p(a)})]})})};export{li as default};
