import{r,i as k,j as e,d as t,F as w}from"./react.6693569e.js";import{u as f,g as y,s as h}from"./index.b5b1089a.js";/* empty css               *//* empty css               */import"./Header.1aff183e.js";import{AppContext as C}from"./App.b28509be.js";import{N as x}from"./NoteModal.27594ba5.js";import{S as B}from"./Form.e3c93add.js";import{u as z}from"./ColorPicker.ae75796c.js";import{y as b,B as l,M as P,m as v}from"./antd.ef9542dc.js";import"./index.c566a457.js";import"./index.0a6cc9fb.js";/* empty css              *//* empty css              */import"./antd.5e666edb.js";import"./Cover.fc91526c.js";/* empty css               */import"./regular.2d81b23f.js";/* empty css               */import"./uno.aa306f28.js";import"./RSA.0dbe6c53.js";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",i={signUpSettings:V,board:G,content:M,item:F,actionBar:T,btnGroup:U,tip:j},I=({visible:s,onVisibleChange:c})=>{const{T:o}=f();return e(P,{title:o("settings.signup.main.button.preview"),visible:s,width:"80%",footer:null,onCancel:()=>c(!1),children:e("div",{style:{margin:"-24px"},children:e(B,{})})})},ae=()=>{const{T:s}=f(),[c,o]=r.exports.useState(!1),[N,p]=r.exports.useState(!1),{setLoading:m}=r.exports.useContext(C),d=k(),[n,_]=r.exports.useState(void 0),g=z(()=>h.settingsStore.signup);r.exports.useEffect(()=>{_(y(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 e("div",{className:i.signUpSettings,children:n&&t(w,{children:[t("div",{className:i.board,children:[e("span",{children:s("settings.signup.main.title1")}),t("div",{className:i.content,children:[t("div",{className:i.item,children:[t("div",{className:i.actionBar,children:[e("span",{children:s("settings.signup.main.enabled1")}),e(b,{checked:n.form.enabled,size:"small",onChange:a=>u({...n,form:{...n.form,enabled:a}})})]}),e("span",{className:i.tip,children:s("settings.signup.main.tip1")}),e("span",{className:i.tip,children:s("settings.signup.main.tip2")})]}),t("div",{className:i.item,children:[t("div",{className:i.actionBar,children:[e("span",{children:s("settings.signup.main.subTitle1")}),t("div",{className:i.btnGroup,children:[e(l,{type:"primary",size:"small",disabled:!n.form.enabled,onClick:()=>d.push("/settings/signup/form/edit"),children:s("settings.signup.main.button.edit")}),e(l,{size:"small",disabled:!n.form.enabled,onClick:()=>o(!0),children:s("settings.signup.main.button.preview")})]})]}),e("span",{className:i.tip,children:s("settings.signup.main.tip3")})]})]})]}),t("div",{className:i.board,children:[e("span",{children:s("settings.signup.main.title2")}),t("div",{className:i.content,children:[t("div",{className:i.item,children:[t("div",{className:i.actionBar,children:[e("span",{children:s("settings.signup.main.enabled2")}),e(b,{checked:n.note.enabled,size:"small",onChange:a=>u({...n,note:{...n.note,enabled:a}})})]}),e("span",{className:i.tip,children:s("settings.signup.main.tip4")})]}),t("div",{className:i.item,children:[t("div",{className:i.actionBar,children:[e("span",{children:s("settings.signup.main.subTitle2")}),t("div",{className:i.btnGroup,children:[e(l,{type:"primary",size:"small",disabled:!n.note.enabled,onClick:()=>d.push("/settings/signup/note/edit"),children:s("settings.signup.main.button.edit")}),e(l,{size:"small",disabled:!n.note.enabled,onClick:()=>p(!0),children:s("settings.signup.main.button.preview")})]})]}),e("span",{className:i.tip,children:s("settings.signup.main.tip5")})]})]})]}),e(I,{visible:c,onVisibleChange:a=>o(a)}),e(x,{visible:N,form:n.note.params,isPreview:!0,onVisibleChange:a=>p(a)})]})})};export{ae as default};
