import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../wayfinder'
/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
export const legacy = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: legacy.url(options),
    method: 'get',
})

legacy.definition = {
    methods: ["get","head","post","put","patch","delete","options"],
    url: '/portal',
} satisfies RouteDefinition<["get","head","post","put","patch","delete","options"]>

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacy.url = (options?: RouteQueryOptions) => {
    return legacy.definition.url + queryParams(options)
}

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacy.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: legacy.url(options),
    method: 'get',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacy.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: legacy.url(options),
    method: 'head',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacy.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: legacy.url(options),
    method: 'post',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacy.put = (options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: legacy.url(options),
    method: 'put',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacy.patch = (options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: legacy.url(options),
    method: 'patch',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacy.delete = (options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: legacy.url(options),
    method: 'delete',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacy.options = (options?: RouteQueryOptions): RouteDefinition<'options'> => ({
    url: legacy.url(options),
    method: 'options',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
const legacyForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: legacy.url(options),
    method: 'get',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacyForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: legacy.url(options),
    method: 'get',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacyForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: legacy.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacyForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: legacy.url(options),
    method: 'post',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacyForm.put = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: legacy.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PUT',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacyForm.patch = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: legacy.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacyForm.delete = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: legacy.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \Illuminate\Routing\RedirectController::__invoke
* @see vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php:19
* @route '/portal'
*/
legacyForm.options = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: legacy.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'OPTIONS',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

legacy.form = legacyForm

/**
* @see \App\Http\Controllers\PortalExplorerController::__invoke
* @see app/Http/Controllers/PortalExplorerController.php:19
* @route '/explorador-3d'
*/
export const explorer = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: explorer.url(options),
    method: 'get',
})

explorer.definition = {
    methods: ["get","head"],
    url: '/explorador-3d',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\PortalExplorerController::__invoke
* @see app/Http/Controllers/PortalExplorerController.php:19
* @route '/explorador-3d'
*/
explorer.url = (options?: RouteQueryOptions) => {
    return explorer.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\PortalExplorerController::__invoke
* @see app/Http/Controllers/PortalExplorerController.php:19
* @route '/explorador-3d'
*/
explorer.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: explorer.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PortalExplorerController::__invoke
* @see app/Http/Controllers/PortalExplorerController.php:19
* @route '/explorador-3d'
*/
explorer.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: explorer.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\PortalExplorerController::__invoke
* @see app/Http/Controllers/PortalExplorerController.php:19
* @route '/explorador-3d'
*/
const explorerForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: explorer.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PortalExplorerController::__invoke
* @see app/Http/Controllers/PortalExplorerController.php:19
* @route '/explorador-3d'
*/
explorerForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: explorer.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PortalExplorerController::__invoke
* @see app/Http/Controllers/PortalExplorerController.php:19
* @route '/explorador-3d'
*/
explorerForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: explorer.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

explorer.form = explorerForm

/**
* @see \App\Http\Controllers\PortalProjectController::__invoke
* @see app/Http/Controllers/PortalProjectController.php:16
* @route '/proyecto/{slug}'
*/
export const project = (args: { slug: string | number } | [slug: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: project.url(args, options),
    method: 'get',
})

project.definition = {
    methods: ["get","head"],
    url: '/proyecto/{slug}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\PortalProjectController::__invoke
* @see app/Http/Controllers/PortalProjectController.php:16
* @route '/proyecto/{slug}'
*/
project.url = (args: { slug: string | number } | [slug: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { slug: args }
    }

    if (Array.isArray(args)) {
        args = {
            slug: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        slug: args.slug,
    }

    return project.definition.url
            .replace('{slug}', parsedArgs.slug.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\PortalProjectController::__invoke
* @see app/Http/Controllers/PortalProjectController.php:16
* @route '/proyecto/{slug}'
*/
project.get = (args: { slug: string | number } | [slug: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: project.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PortalProjectController::__invoke
* @see app/Http/Controllers/PortalProjectController.php:16
* @route '/proyecto/{slug}'
*/
project.head = (args: { slug: string | number } | [slug: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: project.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\PortalProjectController::__invoke
* @see app/Http/Controllers/PortalProjectController.php:16
* @route '/proyecto/{slug}'
*/
const projectForm = (args: { slug: string | number } | [slug: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: project.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PortalProjectController::__invoke
* @see app/Http/Controllers/PortalProjectController.php:16
* @route '/proyecto/{slug}'
*/
projectForm.get = (args: { slug: string | number } | [slug: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: project.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PortalProjectController::__invoke
* @see app/Http/Controllers/PortalProjectController.php:16
* @route '/proyecto/{slug}'
*/
projectForm.head = (args: { slug: string | number } | [slug: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: project.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

project.form = projectForm

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
export const quote = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: quote.url(args, options),
    method: 'get',
})

quote.definition = {
    methods: ["get","head"],
    url: '/cotizacion/{token}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
quote.url = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { token: args }
    }

    if (Array.isArray(args)) {
        args = {
            token: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        token: args.token,
    }

    return quote.definition.url
            .replace('{token}', parsedArgs.token.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
quote.get = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: quote.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
quote.head = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: quote.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
const quoteForm = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: quote.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
quoteForm.get = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: quote.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
quoteForm.head = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: quote.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

quote.form = quoteForm

/**
* @see \App\Http\Controllers\PortalLeadController::lead
* @see app/Http/Controllers/PortalLeadController.php:21
* @route '/interes'
*/
export const lead = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: lead.url(options),
    method: 'post',
})

lead.definition = {
    methods: ["post"],
    url: '/interes',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\PortalLeadController::lead
* @see app/Http/Controllers/PortalLeadController.php:21
* @route '/interes'
*/
lead.url = (options?: RouteQueryOptions) => {
    return lead.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\PortalLeadController::lead
* @see app/Http/Controllers/PortalLeadController.php:21
* @route '/interes'
*/
lead.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: lead.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\PortalLeadController::lead
* @see app/Http/Controllers/PortalLeadController.php:21
* @route '/interes'
*/
const leadForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: lead.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\PortalLeadController::lead
* @see app/Http/Controllers/PortalLeadController.php:21
* @route '/interes'
*/
leadForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: lead.url(options),
    method: 'post',
})

lead.form = leadForm

const portal = {
    legacy: Object.assign(legacy, legacy),
    explorer: Object.assign(explorer, explorer),
    project: Object.assign(project, project),
    quote: Object.assign(quote, quote),
    lead: Object.assign(lead, lead),
}

export default portal