import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../wayfinder'
import impersonate from './impersonate'
import manualDirectReferrals from './manual-direct-referrals'
import manualBalance10fb2f from './manual-balance'
import consolidateBalance772100 from './consolidate-balance'
import withdrawal from './withdrawal'
/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
export const index = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

index.definition = {
    methods: ["get","head"],
    url: '/admin/usuarios',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
const indexForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
indexForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

index.form = indexForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
export const referrerSuggestions = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: referrerSuggestions.url(options),
    method: 'get',
})

referrerSuggestions.definition = {
    methods: ["get","head"],
    url: '/admin/usuarios/referidor-sugerencias',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestions.url = (options?: RouteQueryOptions) => {
    return referrerSuggestions.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestions.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: referrerSuggestions.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestions.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: referrerSuggestions.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
const referrerSuggestionsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: referrerSuggestions.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestionsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: referrerSuggestions.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestionsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: referrerSuggestions.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

referrerSuggestions.form = referrerSuggestionsForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
export const edit = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(args, options),
    method: 'get',
})

edit.definition = {
    methods: ["get","head"],
    url: '/admin/usuarios/{user}/editar',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
edit.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
edit.get = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
edit.head = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: edit.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
const editForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
editForm.get = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
editForm.head = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

edit.form = editForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
export const update = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: update.url(args, options),
    method: 'patch',
})

update.definition = {
    methods: ["patch"],
    url: '/admin/usuarios/{user}',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
update.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
update.patch = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: update.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
const updateForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
updateForm.patch = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

update.form = updateForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
export const manualBalance = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: manualBalance.url(args, options),
    method: 'post',
})

manualBalance.definition = {
    methods: ["post"],
    url: '/admin/usuarios/{user}/balance-manual',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
manualBalance.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
manualBalance.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: manualBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
const manualBalanceForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: manualBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
manualBalanceForm.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: manualBalance.url(args, options),
    method: 'post',
})

manualBalance.form = manualBalanceForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
export const consolidateBalance = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: consolidateBalance.url(args, options),
    method: 'post',
})

consolidateBalance.definition = {
    methods: ["post"],
    url: '/admin/usuarios/{user}/consolidar-balance',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
consolidateBalance.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
consolidateBalance.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: consolidateBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
const consolidateBalanceForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: consolidateBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
consolidateBalanceForm.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: consolidateBalance.url(args, options),
    method: 'post',
})

consolidateBalance.form = consolidateBalanceForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
export const manualReferralProgress = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: manualReferralProgress.url(args, options),
    method: 'post',
})

manualReferralProgress.definition = {
    methods: ["post"],
    url: '/admin/usuarios/{user}/referidos-progreso-manual',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
manualReferralProgress.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
manualReferralProgress.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: manualReferralProgress.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
const manualReferralProgressForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: manualReferralProgress.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::manualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
manualReferralProgressForm.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: manualReferralProgress.url(args, options),
    method: 'post',
})

manualReferralProgress.form = manualReferralProgressForm

const users = {
    index: Object.assign(index, index),
    referrerSuggestions: Object.assign(referrerSuggestions, referrerSuggestions),
    edit: Object.assign(edit, edit),
    impersonate: Object.assign(impersonate, impersonate),
    manualDirectReferrals: Object.assign(manualDirectReferrals, manualDirectReferrals),
    update: Object.assign(update, update),
    manualBalance: Object.assign(manualBalance, manualBalance10fb2f),
    consolidateBalance: Object.assign(consolidateBalance, consolidateBalance772100),
    withdrawal: Object.assign(withdrawal, withdrawal),
    manualReferralProgress: Object.assign(manualReferralProgress, manualReferralProgress),
}

export default users