import{j as t,al as d,R as p,aT as x,X as u}from"./vendor-mui-core-D7t4vMS5.js";import{r as o}from"./vendor-react-DX7tU9aY.js";import{b3 as g}from"./vendor-ux-Dl3wVbv_.js";import{a as h}from"./page-header-B0HpJClf.js";import{V as b}from"./index-Ca33rdd_.js";import{A as j}from"./config-fYkZxdEr.js";import{S as k}from"./step-actions-CArEuzNw.js";import{S}from"./layout-CydCBGqn.js";import"./vendor-utils-BzQg432x.js";import"./vendor-hooks-DAZ1H6Va.js";import"./vendor-arcblock-ivFYo5vP.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./section-ewv0pNWr.js";import"./required-11pmtzQr.js";import"./form-wrapper-EixE0Jkw.js";import"./form-text-input-Cs-LuCu0.js";import"./edit.svg-BGhTyO6h.js";import"./wait-connect-DOIonmAv.js";import"./get-safe-url-D4zRnTpF.js";import"./index-jIvFgWDS.js";import"./index-DBs9Ljax.js";import"./use-mobile-TAIHvgoJ.js";import"./content-layout-CanSZTqf.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};
