import { Collapse } from '@/components/collapse'; import { FormContainer } from '@/components/form-container'; import NumberInput from '@/components/originui/number-input'; import { SelectWithSearch } from '@/components/originui/select-with-search'; import { Button } from '@/components/ui/button'; import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage, } from '@/components/ui/form'; import { Input } from '@/components/ui/input'; import { Switch } from '@/components/ui/switch'; import { zodResolver } from '@hookform/resolvers/zod'; import Editor, { loader } from '@monaco-editor/react'; import { Plus } from 'lucide-react'; import { memo } from 'react'; import { useForm, useWatch } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { initialInvokeValues } from '../../constant'; import { useFormValues } from '../../hooks/use-form-values'; import { useWatchFormChange } from '../../hooks/use-watch-form-change'; import { INextOperatorForm } from '../../interface'; import { buildOutputList } from '../../utils/build-output-list'; import { FormWrapper } from '../components/form-wrapper'; import { Output } from '../components/output'; import { FormSchema, FormSchemaType } from './schema'; import { useEditVariableRecord } from './use-edit-variable'; import { VariableDialog } from './variable-dialog'; import { VariableTable } from './variable-table'; loader.config({ paths: { vs: '/vs' } }); enum Method { GET = 'GET', POST = 'POST', PUT = 'PUT', } const MethodOptions = [Method.GET, Method.POST, Method.PUT].map((x) => ({ label: x, value: x, })); interface TimeoutInputProps { value?: number; onChange?: (value: number | null) => void; } const TimeoutInput = ({ value, onChange }: TimeoutInputProps) => { const { t } = useTranslation(); return (