export const kanbanStaticStagesData = [
    { id: 'stage-1', name: 'Empty Stage' },
    { id: 'stage-2', name: 'Only one card' },
    { id: 'stage-3', name: '50 cards for paging' },
    { id: 'stage-4', name: 'Done - 100 cards', isDone: true },
];
export const kanbanStaticInitialCardsData = [
    // stage-1: 'Empty Stage' - no cards
    // stage-2: 'Only one card'
    { id: 'card-2-1', name: 'Only Card', stageId: 'stage-2' },
    // stage-3: '50 cards for paging'
    ...Array.from({ length: 10 }, (_, i) => ({
        id: `card-3-${i + 1}`,
        name: `Card ${i + 1}`,
        stageId: 'stage-3',
    })),
    // stage-4: 'Done - 100 cards'
    ...Array.from({ length: 10 }, (_, i) => ({
        id: `card-4-${i + 1}`,
        name: `Done Card ${i + 1}`,
        stageId: 'stage-4',
    })),
];
export const kanbanStaticLoadMoreCardsData = [
    // stage-1: 'Empty Stage' - no cards
    // stage-2: 'Only one card - no more cards'
    // stage-3: '50 cards for paging'
    ...Array.from({ length: 30 }, (_, i) => ({
        id: `card-3-${i + 1 + 10}`,
        name: `Card ${i + 1 + 10}`,
        stageId: 'stage-3',
    })),
    // stage-4: 'Done - 100 cards'
    ...Array.from({ length: 90 }, (_, i) => ({
        id: `card-4-${i + 1 + 10}`,
        name: `Done Card ${i + 1 + 10}`,
        stageId: 'stage-4',
    })),
];
export const getKanbanMockInitialData = async ({ ids, filters, search, }) => {
    // Prepare search terms if search is provided
    const searchTerms = search
        ? search
            .toLowerCase()
            .split(/\s+/)
            .filter((term) => term.length > 0)
        : null;
    // Get tag IDs from filters if provided
    const filterTagIds = filters?.tags?.map((tag) => tag.id) ?? null;
    return Object.fromEntries(ids.map((id) => {
        let items = kanbanStaticInitialCardsData
            .filter((card) => card.stageId === id)
            .slice(0, 10);
        if (searchTerms) {
            items = items.filter((card) => {
                const cardName = card.name.toLowerCase();
                return searchTerms.every((term) => cardName.includes(term));
            });
        }
        // Filter by tags - cards in mock data don't have tags, so if tags filter is applied, return empty
        if (filterTagIds && filterTagIds.length > 0) {
            items = items.filter((card) => {
                const cardTags = card.tagIds;
                if (!cardTags) {
                    return false;
                }
                return filterTagIds.some((tagId) => cardTags.includes(tagId));
            });
        }
        return [
            id,
            {
                items,
                total: items.length,
                cursor: kanbanStaticLoadMoreCardsData.filter((card) => card.stageId === id)
                    .length > 0
                    ? 'cursor'
                    : null,
                summaryData: {},
            },
        ];
    }));
};
export const getKanbanMockItems = async (query) => {
    const stageId = query.filters?.stageId;
    const filtered = stageId
        ? kanbanStaticLoadMoreCardsData.filter((card) => card.stageId === stageId)
        : null;
    return {
        items: filtered,
        total: filtered?.length ?? 0,
        cursor: null,
    };
};
export const getKanbanMockItemsCount = (stageId) => {
    const filtered = stageId
        ? kanbanStaticLoadMoreCardsData.filter((card) => card.stageId === stageId)
        : null;
    return filtered?.length ?? 0;
};
export const getKanbanMockStages = async () => {
    return {
        items: kanbanStaticStagesData,
        total: kanbanStaticStagesData?.length ?? 0,
        cursor: null,
    };
};
//# sourceMappingURL=kanbanStaticData.js.map