import{j as t,ak as d,Q as p,at as x,W as u}from"./vendor-mui-core-CKKG_1TN.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{b9 as g}from"./vendor-ux-DjXlxcvL.js";import{a as h}from"./page-header-BZv-tfgN.js";import{Y as b}from"./index-BEfIUbZC.js";import{A as j}from"./config-CoSaZVwp.js";import{S as k}from"./step-actions-Cb6B0FCJ.js";import{S}from"./layout-DRVZ4L0D.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./isURL-vNa-ZfGd.js";import"./section-CenHBXqj.js";import"./required-DHjZE3-Y.js";import"./form-wrapper-pwkkz4we.js";import"./form-text-input-BsCymY_c.js";import"./edit.svg-CTE5eATX.js";import"./wait-connect-TKbZWSFd.js";import"./get-safe-url-DxqVk96E.js";import"./index-_tncRnTu.js";import"./index-DBs9Ljax.js";import"./use-mobile-Bz2ML4Gk.js";import"./content-layout-Dtfb5X6M.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=b(),i=o.useMemo(()=>e?.meta?.requirements,[e]),n=o.useRef(null),[a,m]=o.useState(!1),f=async()=>{try{m(!0),(await n.current.onSubmit()||!i?.aigne)&&s()}catch(c){console.error("error",c)}finally{m(!1)}};return t.jsxs(C,{children:[t.jsx("div",{className:"header",children:t.jsx(h,{title:r("setting.aigne.config"),onClickBack:l})}),t.jsx(d,{className:"form-container",children:t.jsx(j,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,ref:n,source:"setup",forceValidate:i?.aigne})}),t.jsxs(k,{blocklet:e,children:[!i?.aigne&&t.jsx(p,{className:"bottom-button-skip",sx:{mr:1},onClick:()=>s(),children:r("setup.skip")}),t.jsx(p,{className:"start-now bottom-button",loading:a,variant:"contained",disabled:a,onClick:f,children:r("setup.continue")})]})]})}y.propTypes={onNext:u.func,onPrevious:u.func};const C=x(S)`
  height: 100%;
  overflow-y: auto;

  .form-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
  }
`;export{y as default};
