'use client'; import { jsx as _jsx } from "react/jsx-runtime"; import { useCallback, useContext } from 'react'; import { addBasePath } from '../add-base-path'; import { useMergedRef } from '../use-merged-ref'; import { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'; import { PrefetchKind } from '../components/router-reducer/router-reducer-types'; import { checkFormActionUrl, createFormSubmitDestinationUrl, DISALLOWED_FORM_PROPS, hasReactClientActionAttributes, hasUnsupportedSubmitterAttributes } from '../form-shared'; import { mountFormInstance, unmountPrefetchableInstance } from '../components/links'; export default function Form(param) { let { replace, scroll, prefetch: prefetchProp, ref: externalRef, ...props } = param; const router = useContext(AppRouterContext); const actionProp = props.action; const isNavigatingForm = typeof actionProp === 'string'; // Validate `action` if (process.env.NODE_ENV === 'development') { if (isNavigatingForm) { checkFormActionUrl(actionProp, 'action'); } } // Validate `prefetch` if (process.env.NODE_ENV === 'development') { if (!(prefetchProp === undefined || prefetchProp === false || prefetchProp === null)) { console.error('The `prefetch` prop of