// Generated by alef. Do not edit by hand.
@file:Suppress(
    "ktlint:standard:trailing-comma-on-call-site",
    "ktlint:standard:trailing-comma-on-declaration-site",
    "ktlint:standard:spacing-between-declarations-with-comments",
    "ktlint:standard:spacing-between-declarations-with-annotations",
    "ktlint:standard:when-entry-bracing",
    "ktlint:standard:blank-line-between-when-conditions",
    "ktlint:standard:blank-line-before-declaration",
    "ktlint:standard:chain-method-continuation",
    "ktlint:standard:annotation",
    "ktlint:standard:max-line-length",
    "ktlint:standard:no-semi",
    "ktlint:standard:statement-wrapping",
    "MaxLineLength",
    "TooManyFunctions",
    "FunctionParameterNaming",
    "LongParameterList",
    "CyclomaticComplexMethod",
    "LongMethod",
)

package dev.kreuzberg

/**
 * Content for a single page/slide.
 *
 * When page extraction is enabled, documents are split into per-page content
 * with associated tables and images mapped to each page.
 *
 * # Performance
 *
 * Uses Arc-wrapped tables and images for memory efficiency:
 *
 * - `Vec<Arc<Table>>` enables zero-copy sharing of table data
 * - `Vec<Arc<ExtractedImage>>` enables zero-copy sharing of image data
 * - Maintains exact JSON compatibility via custom Serialize/Deserialize
 *
 * This reduces memory overhead for documents with shared tables/images
 * by avoiding redundant copies during serialization.
 */
data class PageContent(
    /** Page number (1-indexed) */
    val pageNumber: Int,
    /** Text content for this page */
    val content: String,
    /**
     * Tables found on this page (uses Arc for memory efficiency)
     *
     * Serializes as Vec<Table> for JSON compatibility while maintaining
     * Arc semantics in-memory for zero-copy sharing.
     */
    val tables: List<Table> = emptyList(),
    /**
     * Indices into `ExtractionResult.images` for images found on this page.
     *
     * Each value is a zero-based index into the top-level `images` collection.
     * Only populated when `extract_images = true` in the extraction config.
     */
    val imageIndices: List<Int> = emptyList(),
    /**
     * Hierarchy information for the page (when hierarchy extraction is enabled)
     *
     * Contains text hierarchy levels (H1-H6) extracted from the page content.
     */
    val hierarchy: PageHierarchy? = null,
    /**
     * Whether this page is blank (no meaningful text content)
     *
     * Determined during extraction based on text content analysis.
     * A page is blank if it has fewer than 3 non-whitespace characters
     * and contains no tables or images.
     */
    val isBlank: Boolean? = null,
    /**
     * Layout detection regions for this page (when layout detection is enabled).
     *
     * Contains detected layout regions with class, confidence, bounding box,
     * and area fraction. Only populated when layout detection is configured.
     */
    val layoutRegions: List<LayoutRegion>? = null,
    /**
     * Speaker notes for this slide (PPTX only).
     *
     * Contains the text from the slide's notes pane (`ppt/notesSlides/notesSlide{N}.xml`).
     * Only populated when the source is a PPTX file and notes are present.
     */
    val speakerNotes: String? = null,
    /**
     * Section name this slide belongs to (PPTX only).
     *
     * PowerPoint sections group slides into logical chapters (`<p:sectionLst>` in
     * `ppt/presentation.xml`). Only populated when the source is a PPTX file and
     * the slide belongs to a named section.
     */
    val sectionName: String? = null,
    /**
     * Sheet name for this page (XLSX/ODS only).
     *
     * Each spreadsheet sheet maps to one `PageContent` entry. This field carries the
     * sheet's display name as it appears in the workbook. `null` for all non-spreadsheet
     * formats and for sheets with an empty name.
     */
    val sheetName: String? = null,
)
