All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.build.lib.index.mjs.map Maven / Gradle / Ivy

The newest version!
{"version":3,"file":"index.mjs","sources":["../../src/utils.ts","../../src/core/column.ts","../../src/core/headers.ts","../../src/features/ColumnSizing.ts","../../src/features/Expanding.ts","../../src/filterFns.ts","../../src/features/Filters.ts","../../src/aggregationFns.ts","../../src/features/Grouping.ts","../../src/features/Ordering.ts","../../src/features/Pagination.ts","../../src/features/Pinning.ts","../../src/features/RowSelection.ts","../../src/sortingFns.ts","../../src/features/Sorting.ts","../../src/features/Visibility.ts","../../src/core/table.ts","../../src/core/cell.ts","../../src/core/row.ts","../../src/columnHelper.ts","../../src/utils/getCoreRowModel.ts","../../src/utils/filterRowsUtils.ts","../../src/utils/getFilteredRowModel.ts","../../src/utils/getFacetedRowModel.ts","../../src/utils/getFacetedUniqueValues.ts","../../src/utils/getFacetedMinMaxValues.ts","../../src/utils/getSortedRowModel.ts","../../src/utils/getGroupedRowModel.ts","../../src/utils/getExpandedRowModel.ts","../../src/utils/getPaginationRowModel.ts"],"sourcesContent":["import { TableState, Updater } from './types'\n\nexport type PartialKeys = Omit & Partial>\nexport type RequiredKeys = Omit &\n  Required>\nexport type Overwrite = Omit<\n  T,\n  keyof U\n> &\n  U\n\nexport type UnionToIntersection = (\n  T extends any ? (x: T) => any : never\n) extends (x: infer R) => any\n  ? R\n  : never\n\nexport type IsAny = 1 extends 0 & T ? Y : N\nexport type IsKnown = unknown extends T ? N : Y\n\ntype ComputeRange<\n  N extends number,\n  Result extends Array = []\n> = Result['length'] extends N\n  ? Result\n  : ComputeRange\ntype Index40 = ComputeRange<40>[number]\n\n// Is this type a tuple?\ntype IsTuple = T extends readonly any[] & { length: infer Length }\n  ? Length extends Index40\n    ? T\n    : never\n  : never\n\n// If this type is a tuple, what indices are allowed?\ntype AllowedIndexes<\n  Tuple extends ReadonlyArray,\n  Keys extends number = never\n> = Tuple extends readonly []\n  ? Keys\n  : Tuple extends readonly [infer _, ...infer Tail]\n  ? AllowedIndexes\n  : Keys\n\nexport type DeepKeys = unknown extends T\n  ? keyof T\n  : object extends T\n  ? string\n  : T extends readonly any[] & IsTuple\n  ? AllowedIndexes | DeepKeysPrefix>\n  : T extends any[]\n  ? never & 'Dynamic length array indexing is not supported'\n  : T extends Date\n  ? never\n  : T extends object\n  ? (keyof T & string) | DeepKeysPrefix\n  : never\n\ntype DeepKeysPrefix = TPrefix extends keyof T & (number | string)\n  ? `${TPrefix}.${DeepKeys & string}`\n  : never\n\nexport type DeepValue = T extends Record\n  ? TProp extends `${infer TBranch}.${infer TDeepProp}`\n    ? DeepValue\n    : T[TProp & string]\n  : never\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport type Getter = () => NoInfer\n\n///\n\nexport function functionalUpdate(updater: Updater, input: T): T {\n  return typeof updater === 'function'\n    ? (updater as (input: T) => T)(input)\n    : updater\n}\n\nexport function noop() {\n  //\n}\n\nexport function makeStateUpdater(\n  key: K,\n  instance: unknown\n) {\n  return (updater: Updater) => {\n    ;(instance as any).setState((old: TTableState) => {\n      return {\n        ...old,\n        [key]: functionalUpdate(updater, (old as any)[key]),\n      }\n    })\n  }\n}\n\ntype AnyFunction = (...args: any) => any\n\nexport function isFunction(d: any): d is T {\n  return d instanceof Function\n}\n\nexport function isNumberArray(d: any): d is number[] {\n  return Array.isArray(d) && d.every(val => typeof val === 'number')\n}\n\nexport function flattenBy(\n  arr: TNode[],\n  getChildren: (item: TNode) => TNode[]\n) {\n  const flat: TNode[] = []\n\n  const recurse = (subArr: TNode[]) => {\n    subArr.forEach(item => {\n      flat.push(item)\n      const children = getChildren(item)\n      if (children?.length) {\n        recurse(children)\n      }\n    })\n  }\n\n  recurse(arr)\n\n  return flat\n}\n\nexport function memo(\n  getDeps: () => [...TDeps],\n  fn: (...args: NoInfer<[...TDeps]>) => TResult,\n  opts: {\n    key: any\n    debug?: () => any\n    onChange?: (result: TResult) => void\n  }\n): () => TResult {\n  let deps: any[] = []\n  let result: TResult | undefined\n\n  return () => {\n    let depTime: number\n    if (opts.key && opts.debug) depTime = Date.now()\n\n    const newDeps = getDeps()\n\n    const depsChanged =\n      newDeps.length !== deps.length ||\n      newDeps.some((dep: any, index: number) => deps[index] !== dep)\n\n    if (!depsChanged) {\n      return result!\n    }\n\n    deps = newDeps\n\n    let resultTime: number\n    if (opts.key && opts.debug) resultTime = Date.now()\n\n    result = fn(...newDeps)\n    opts?.onChange?.(result)\n\n    if (opts.key && opts.debug) {\n      if (opts?.debug()) {\n        const depEndTime = Math.round((Date.now() - depTime!) * 100) / 100\n        const resultEndTime = Math.round((Date.now() - resultTime!) * 100) / 100\n        const resultFpsPercentage = resultEndTime / 16\n\n        const pad = (str: number | string, num: number) => {\n          str = String(str)\n          while (str.length < num) {\n            str = ' ' + str\n          }\n          return str\n        }\n\n        console.info(\n          `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,\n          `\n            font-size: .6rem;\n            font-weight: bold;\n            color: hsl(${Math.max(\n              0,\n              Math.min(120 - 120 * resultFpsPercentage, 120)\n            )}deg 100% 31%);`,\n          opts?.key\n        )\n      }\n    }\n\n    return result!\n  }\n}\n","import {\n  Column,\n  Table,\n  AccessorFn,\n  ColumnDef,\n  RowData,\n  ColumnDefResolved,\n} from '../types'\nimport { memo } from '../utils'\n\nexport interface CoreColumn {\n  id: string\n  depth: number\n  accessorFn?: AccessorFn\n  columnDef: ColumnDef\n  columns: Column[]\n  parent?: Column\n  getFlatColumns: () => Column[]\n  getLeafColumns: () => Column[]\n}\n\nexport function createColumn(\n  table: Table,\n  columnDef: ColumnDef,\n  depth: number,\n  parent?: Column\n): Column {\n  const defaultColumn = table._getDefaultColumnDef()\n\n  const resolvedColumnDef = {\n    ...defaultColumn,\n    ...columnDef,\n  } as ColumnDefResolved\n\n  const accessorKey = resolvedColumnDef.accessorKey\n\n  let id =\n    resolvedColumnDef.id ??\n    (accessorKey ? accessorKey.replace('.', '_') : undefined) ??\n    (typeof resolvedColumnDef.header === 'string'\n      ? resolvedColumnDef.header\n      : undefined)\n\n  let accessorFn: AccessorFn | undefined\n\n  if (resolvedColumnDef.accessorFn) {\n    accessorFn = resolvedColumnDef.accessorFn\n  } else if (accessorKey) {\n    // Support deep accessor keys\n    if (accessorKey.includes('.')) {\n      accessorFn = (originalRow: TData) => {\n        let result = originalRow as Record\n\n        for (const key of accessorKey.split('.')) {\n          result = result?.[key]\n          if (process.env.NODE_ENV !== 'production' && result === undefined) {\n            console.warn(\n              `\"${key}\" in deeply nested key \"${accessorKey}\" returned undefined.`\n            )\n          }\n        }\n\n        return result\n      }\n    } else {\n      accessorFn = (originalRow: TData) =>\n        (originalRow as any)[resolvedColumnDef.accessorKey]\n    }\n  }\n\n  if (!id) {\n    if (process.env.NODE_ENV !== 'production') {\n      throw new Error(\n        resolvedColumnDef.accessorFn\n          ? `Columns require an id when using an accessorFn`\n          : `Columns require an id when using a non-string header`\n      )\n    }\n    throw new Error()\n  }\n\n  let column: CoreColumn = {\n    id: `${String(id)}`,\n    accessorFn,\n    parent: parent as any,\n    depth,\n    columnDef: resolvedColumnDef as ColumnDef,\n    columns: [],\n    getFlatColumns: memo(\n      () => [true],\n      () => {\n        return [\n          column as Column,\n          ...column.columns?.flatMap(d => d.getFlatColumns()),\n        ]\n      },\n      {\n        key: process.env.NODE_ENV === 'production' && 'column.getFlatColumns',\n        debug: () => table.options.debugAll ?? table.options.debugColumns,\n      }\n    ),\n    getLeafColumns: memo(\n      () => [table._getOrderColumnsFn()],\n      orderColumns => {\n        if (column.columns?.length) {\n          let leafColumns = column.columns.flatMap(column =>\n            column.getLeafColumns()\n          )\n\n          return orderColumns(leafColumns)\n        }\n\n        return [column as Column]\n      },\n      {\n        key: process.env.NODE_ENV === 'production' && 'column.getLeafColumns',\n        debug: () => table.options.debugAll ?? table.options.debugColumns,\n      }\n    ),\n  }\n\n  column = table._features.reduce((obj, feature) => {\n    return Object.assign(obj, feature.createColumn?.(column, table))\n  }, column)\n\n  // Yes, we have to convert table to uknown, because we know more than the compiler here.\n  return column as Column\n}\n","import { RowData, Column, Header, HeaderGroup, Table } from '../types'\nimport { memo } from '../utils'\nimport { TableFeature } from './table'\n\nexport interface CoreHeaderGroup {\n  id: string\n  depth: number\n  headers: Header[]\n}\n\nexport interface HeaderContext {\n  table: Table\n  header: Header\n  column: Column\n}\n\nexport interface CoreHeader {\n  id: string\n  index: number\n  depth: number\n  column: Column\n  headerGroup: HeaderGroup\n  subHeaders: Header[]\n  colSpan: number\n  rowSpan: number\n  getLeafHeaders: () => Header[]\n  isPlaceholder: boolean\n  placeholderId?: string\n  getContext: () => HeaderContext\n}\n\nexport interface HeadersInstance {\n  getHeaderGroups: () => HeaderGroup[]\n  getLeftHeaderGroups: () => HeaderGroup[]\n  getCenterHeaderGroups: () => HeaderGroup[]\n  getRightHeaderGroups: () => HeaderGroup[]\n\n  getFooterGroups: () => HeaderGroup[]\n  getLeftFooterGroups: () => HeaderGroup[]\n  getCenterFooterGroups: () => HeaderGroup[]\n  getRightFooterGroups: () => HeaderGroup[]\n\n  getFlatHeaders: () => Header[]\n  getLeftFlatHeaders: () => Header[]\n  getCenterFlatHeaders: () => Header[]\n  getRightFlatHeaders: () => Header[]\n\n  getLeafHeaders: () => Header[]\n  getLeftLeafHeaders: () => Header[]\n  getCenterLeafHeaders: () => Header[]\n  getRightLeafHeaders: () => Header[]\n}\n\n//\n\nfunction createHeader(\n  table: Table,\n  column: Column,\n  options: {\n    id?: string\n    isPlaceholder?: boolean\n    placeholderId?: string\n    index: number\n    depth: number\n  }\n): Header {\n  const id = options.id ?? column.id\n\n  let header: CoreHeader = {\n    id,\n    column,\n    index: options.index,\n    isPlaceholder: !!options.isPlaceholder,\n    placeholderId: options.placeholderId,\n    depth: options.depth,\n    subHeaders: [],\n    colSpan: 0,\n    rowSpan: 0,\n    headerGroup: null!,\n    getLeafHeaders: (): Header[] => {\n      const leafHeaders: Header[] = []\n\n      const recurseHeader = (h: CoreHeader) => {\n        if (h.subHeaders && h.subHeaders.length) {\n          h.subHeaders.map(recurseHeader)\n        }\n        leafHeaders.push(h as Header)\n      }\n\n      recurseHeader(header)\n\n      return leafHeaders\n    },\n    getContext: () => ({\n      table,\n      header: header as Header,\n      column,\n    }),\n  }\n\n  table._features.forEach(feature => {\n    Object.assign(header, feature.createHeader?.(header, table))\n  })\n\n  return header as Header\n}\n\nexport const Headers: TableFeature = {\n  createTable: (\n    table: Table\n  ): HeadersInstance => {\n    return {\n      // Header Groups\n\n      getHeaderGroups: memo(\n        () => [\n          table.getAllColumns(),\n          table.getVisibleLeafColumns(),\n          table.getState().columnPinning.left,\n          table.getState().columnPinning.right,\n        ],\n        (allColumns, leafColumns, left, right) => {\n          const leftColumns =\n            left\n              ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n              .filter(Boolean) ?? []\n\n          const rightColumns =\n            right\n              ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n              .filter(Boolean) ?? []\n\n          const centerColumns = leafColumns.filter(\n            column => !left?.includes(column.id) && !right?.includes(column.id)\n          )\n\n          const headerGroups = buildHeaderGroups(\n            allColumns,\n            [...leftColumns, ...centerColumns, ...rightColumns],\n            table\n          )\n\n          return headerGroups\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getHeaderGroups',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getCenterHeaderGroups: memo(\n        () => [\n          table.getAllColumns(),\n          table.getVisibleLeafColumns(),\n          table.getState().columnPinning.left,\n          table.getState().columnPinning.right,\n        ],\n        (allColumns, leafColumns, left, right) => {\n          leafColumns = leafColumns.filter(\n            column => !left?.includes(column.id) && !right?.includes(column.id)\n          )\n          return buildHeaderGroups(allColumns, leafColumns, table, 'center')\n        },\n        {\n          key:\n            process.env.NODE_ENV === 'development' && 'getCenterHeaderGroups',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getLeftHeaderGroups: memo(\n        () => [\n          table.getAllColumns(),\n          table.getVisibleLeafColumns(),\n          table.getState().columnPinning.left,\n        ],\n        (allColumns, leafColumns, left) => {\n          const orderedLeafColumns =\n            left\n              ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n              .filter(Boolean) ?? []\n\n          return buildHeaderGroups(\n            allColumns,\n            orderedLeafColumns,\n            table,\n            'left'\n          )\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getLeftHeaderGroups',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getRightHeaderGroups: memo(\n        () => [\n          table.getAllColumns(),\n          table.getVisibleLeafColumns(),\n          table.getState().columnPinning.right,\n        ],\n        (allColumns, leafColumns, right) => {\n          const orderedLeafColumns =\n            right\n              ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n              .filter(Boolean) ?? []\n\n          return buildHeaderGroups(\n            allColumns,\n            orderedLeafColumns,\n            table,\n            'right'\n          )\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getRightHeaderGroups',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      // Footer Groups\n\n      getFooterGroups: memo(\n        () => [table.getHeaderGroups()],\n        headerGroups => {\n          return [...headerGroups].reverse()\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getFooterGroups',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getLeftFooterGroups: memo(\n        () => [table.getLeftHeaderGroups()],\n        headerGroups => {\n          return [...headerGroups].reverse()\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getLeftFooterGroups',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getCenterFooterGroups: memo(\n        () => [table.getCenterHeaderGroups()],\n        headerGroups => {\n          return [...headerGroups].reverse()\n        },\n        {\n          key:\n            process.env.NODE_ENV === 'development' && 'getCenterFooterGroups',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getRightFooterGroups: memo(\n        () => [table.getRightHeaderGroups()],\n        headerGroups => {\n          return [...headerGroups].reverse()\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getRightFooterGroups',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      // Flat Headers\n\n      getFlatHeaders: memo(\n        () => [table.getHeaderGroups()],\n        headerGroups => {\n          return headerGroups\n            .map(headerGroup => {\n              return headerGroup.headers\n            })\n            .flat()\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getFlatHeaders',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getLeftFlatHeaders: memo(\n        () => [table.getLeftHeaderGroups()],\n        left => {\n          return left\n            .map(headerGroup => {\n              return headerGroup.headers\n            })\n            .flat()\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getLeftFlatHeaders',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getCenterFlatHeaders: memo(\n        () => [table.getCenterHeaderGroups()],\n        left => {\n          return left\n            .map(headerGroup => {\n              return headerGroup.headers\n            })\n            .flat()\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getCenterFlatHeaders',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getRightFlatHeaders: memo(\n        () => [table.getRightHeaderGroups()],\n        left => {\n          return left\n            .map(headerGroup => {\n              return headerGroup.headers\n            })\n            .flat()\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getRightFlatHeaders',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      // Leaf Headers\n\n      getCenterLeafHeaders: memo(\n        () => [table.getCenterFlatHeaders()],\n        flatHeaders => {\n          return flatHeaders.filter(header => !header.subHeaders?.length)\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getCenterLeafHeaders',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getLeftLeafHeaders: memo(\n        () => [table.getLeftFlatHeaders()],\n        flatHeaders => {\n          return flatHeaders.filter(header => !header.subHeaders?.length)\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getLeftLeafHeaders',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getRightLeafHeaders: memo(\n        () => [table.getRightFlatHeaders()],\n        flatHeaders => {\n          return flatHeaders.filter(header => !header.subHeaders?.length)\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getRightLeafHeaders',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n\n      getLeafHeaders: memo(\n        () => [\n          table.getLeftHeaderGroups(),\n          table.getCenterHeaderGroups(),\n          table.getRightHeaderGroups(),\n        ],\n        (left, center, right) => {\n          return [\n            ...(left[0]?.headers ?? []),\n            ...(center[0]?.headers ?? []),\n            ...(right[0]?.headers ?? []),\n          ]\n            .map(header => {\n              return header.getLeafHeaders()\n            })\n            .flat()\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getLeafHeaders',\n          debug: () => table.options.debugAll ?? table.options.debugHeaders,\n        }\n      ),\n    }\n  },\n}\n\nexport function buildHeaderGroups(\n  allColumns: Column[],\n  columnsToGroup: Column[],\n  table: Table,\n  headerFamily?: 'center' | 'left' | 'right'\n) {\n  // Find the max depth of the columns:\n  // build the leaf column row\n  // build each buffer row going up\n  //    placeholder for non-existent level\n  //    real column for existing level\n\n  let maxDepth = 0\n\n  const findMaxDepth = (columns: Column[], depth = 1) => {\n    maxDepth = Math.max(maxDepth, depth)\n\n    columns\n      .filter(column => column.getIsVisible())\n      .forEach(column => {\n        if (column.columns?.length) {\n          findMaxDepth(column.columns, depth + 1)\n        }\n      }, 0)\n  }\n\n  findMaxDepth(allColumns)\n\n  let headerGroups: HeaderGroup[] = []\n\n  const createHeaderGroup = (\n    headersToGroup: Header[],\n    depth: number\n  ) => {\n    // The header group we are creating\n    const headerGroup: HeaderGroup = {\n      depth,\n      id: [headerFamily, `${depth}`].filter(Boolean).join('_'),\n      headers: [],\n    }\n\n    // The parent columns we're going to scan next\n    const pendingParentHeaders: Header[] = []\n\n    // Scan each column for parents\n    headersToGroup.forEach(headerToGroup => {\n      // What is the latest (last) parent column?\n\n      const latestPendingParentHeader = [...pendingParentHeaders].reverse()[0]\n\n      const isLeafHeader = headerToGroup.column.depth === headerGroup.depth\n\n      let column: Column\n      let isPlaceholder = false\n\n      if (isLeafHeader && headerToGroup.column.parent) {\n        // The parent header is new\n        column = headerToGroup.column.parent\n      } else {\n        // The parent header is repeated\n        column = headerToGroup.column\n        isPlaceholder = true\n      }\n\n      if (\n        latestPendingParentHeader &&\n        latestPendingParentHeader?.column === column\n      ) {\n        // This column is repeated. Add it as a sub header to the next batch\n        latestPendingParentHeader.subHeaders.push(headerToGroup)\n      } else {\n        // This is a new header. Let's create it\n        const header = createHeader(table, column, {\n          id: [headerFamily, depth, column.id, headerToGroup?.id]\n            .filter(Boolean)\n            .join('_'),\n          isPlaceholder,\n          placeholderId: isPlaceholder\n            ? `${pendingParentHeaders.filter(d => d.column === column).length}`\n            : undefined,\n          depth,\n          index: pendingParentHeaders.length,\n        })\n\n        // Add the headerToGroup as a subHeader of the new header\n        header.subHeaders.push(headerToGroup)\n        // Add the new header to the pendingParentHeaders to get grouped\n        // in the next batch\n        pendingParentHeaders.push(header)\n      }\n\n      headerGroup.headers.push(headerToGroup)\n      headerToGroup.headerGroup = headerGroup\n    })\n\n    headerGroups.push(headerGroup)\n\n    if (depth > 0) {\n      createHeaderGroup(pendingParentHeaders, depth - 1)\n    }\n  }\n\n  const bottomHeaders = columnsToGroup.map((column, index) =>\n    createHeader(table, column, {\n      depth: maxDepth,\n      index,\n    })\n  )\n\n  createHeaderGroup(bottomHeaders, maxDepth - 1)\n\n  headerGroups.reverse()\n\n  // headerGroups = headerGroups.filter(headerGroup => {\n  //   return !headerGroup.headers.every(header => header.isPlaceholder)\n  // })\n\n  const recurseHeadersForSpans = (\n    headers: Header[]\n  ): { colSpan: number; rowSpan: number }[] => {\n    const filteredHeaders = headers.filter(header =>\n      header.column.getIsVisible()\n    )\n\n    return filteredHeaders.map(header => {\n      let colSpan = 0\n      let rowSpan = 0\n      let childRowSpans = [0]\n\n      if (header.subHeaders && header.subHeaders.length) {\n        childRowSpans = []\n\n        recurseHeadersForSpans(header.subHeaders).forEach(\n          ({ colSpan: childColSpan, rowSpan: childRowSpan }) => {\n            colSpan += childColSpan\n            childRowSpans.push(childRowSpan)\n          }\n        )\n      } else {\n        colSpan = 1\n      }\n\n      const minChildRowSpan = Math.min(...childRowSpans)\n      rowSpan = rowSpan + minChildRowSpan\n\n      header.colSpan = colSpan\n      header.rowSpan = rowSpan\n\n      return { colSpan, rowSpan }\n    })\n  }\n\n  recurseHeadersForSpans(headerGroups[0]?.headers ?? [])\n\n  return headerGroups\n}\n","import { TableFeature } from '../core/table'\nimport { RowData, Column, Header, OnChangeFn, Table, Updater } from '../types'\nimport { makeStateUpdater } from '../utils'\nimport { ColumnPinningPosition } from './Pinning'\n\n//\n\nexport interface ColumnSizingTableState {\n  columnSizing: ColumnSizingState\n  columnSizingInfo: ColumnSizingInfoState\n}\n\nexport type ColumnSizingState = Record\n\nexport interface ColumnSizingInfoState {\n  startOffset: null | number\n  startSize: null | number\n  deltaOffset: null | number\n  deltaPercentage: null | number\n  isResizingColumn: false | string\n  columnSizingStart: [string, number][]\n}\n\nexport type ColumnResizeMode = 'onChange' | 'onEnd'\n\nexport interface ColumnSizingOptions {\n  enableColumnResizing?: boolean\n  columnResizeMode?: ColumnResizeMode\n  onColumnSizingChange?: OnChangeFn\n  onColumnSizingInfoChange?: OnChangeFn\n}\n\nexport interface ColumnSizingDefaultOptions {\n  columnResizeMode: ColumnResizeMode\n  onColumnSizingChange: OnChangeFn\n  onColumnSizingInfoChange: OnChangeFn\n}\n\nexport interface ColumnSizingInstance {\n  setColumnSizing: (updater: Updater) => void\n  setColumnSizingInfo: (updater: Updater) => void\n  resetColumnSizing: (defaultState?: boolean) => void\n  resetHeaderSizeInfo: (defaultState?: boolean) => void\n  getTotalSize: () => number\n  getLeftTotalSize: () => number\n  getCenterTotalSize: () => number\n  getRightTotalSize: () => number\n}\n\nexport interface ColumnSizingColumnDef {\n  enableResizing?: boolean\n  size?: number\n  minSize?: number\n  maxSize?: number\n}\n\nexport interface ColumnSizingColumn {\n  getSize: () => number\n  getStart: (position?: ColumnPinningPosition) => number\n  getCanResize: () => boolean\n  getIsResizing: () => boolean\n  resetSize: () => void\n}\n\nexport interface ColumnSizingHeader {\n  getSize: () => number\n  getStart: (position?: ColumnPinningPosition) => number\n  getResizeHandler: () => (event: unknown) => void\n}\n\n//\n\nexport const defaultColumnSizing = {\n  size: 150,\n  minSize: 20,\n  maxSize: Number.MAX_SAFE_INTEGER,\n}\n\nconst getDefaultColumnSizingInfoState = (): ColumnSizingInfoState => ({\n  startOffset: null,\n  startSize: null,\n  deltaOffset: null,\n  deltaPercentage: null,\n  isResizingColumn: false,\n  columnSizingStart: [],\n})\n\nexport const ColumnSizing: TableFeature = {\n  getDefaultColumnDef: (): ColumnSizingColumnDef => {\n    return defaultColumnSizing\n  },\n  getInitialState: (state): ColumnSizingTableState => {\n    return {\n      columnSizing: {},\n      columnSizingInfo: getDefaultColumnSizingInfoState(),\n      ...state,\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): ColumnSizingDefaultOptions => {\n    return {\n      columnResizeMode: 'onEnd',\n      onColumnSizingChange: makeStateUpdater('columnSizing', table),\n      onColumnSizingInfoChange: makeStateUpdater('columnSizingInfo', table),\n    }\n  },\n\n  createColumn: (\n    column: Column,\n    table: Table\n  ): ColumnSizingColumn => {\n    return {\n      getSize: () => {\n        const columnSize = table.getState().columnSizing[column.id]\n\n        return Math.min(\n          Math.max(\n            column.columnDef.minSize ?? defaultColumnSizing.minSize,\n            columnSize ?? column.columnDef.size ?? defaultColumnSizing.size\n          ),\n          column.columnDef.maxSize ?? defaultColumnSizing.maxSize\n        )\n      },\n      getStart: position => {\n        const columns = !position\n          ? table.getVisibleLeafColumns()\n          : position === 'left'\n          ? table.getLeftVisibleLeafColumns()\n          : table.getRightVisibleLeafColumns()\n\n        const index = columns.findIndex(d => d.id === column.id)\n\n        if (index > 0) {\n          const prevSiblingColumn = columns[index - 1]!\n\n          return (\n            prevSiblingColumn.getStart(position) + prevSiblingColumn.getSize()\n          )\n        }\n\n        return 0\n      },\n      resetSize: () => {\n        table.setColumnSizing(({ [column.id]: _, ...rest }) => {\n          return rest\n        })\n      },\n      getCanResize: () => {\n        return (\n          (column.columnDef.enableResizing ?? true) &&\n          (table.options.enableColumnResizing ?? true)\n        )\n      },\n      getIsResizing: () => {\n        return table.getState().columnSizingInfo.isResizingColumn === column.id\n      },\n    }\n  },\n\n  createHeader: (\n    header: Header,\n    table: Table\n  ): ColumnSizingHeader => {\n    return {\n      getSize: () => {\n        let sum = 0\n\n        const recurse = (header: Header) => {\n          if (header.subHeaders.length) {\n            header.subHeaders.forEach(recurse)\n          } else {\n            sum += header.column.getSize() ?? 0\n          }\n        }\n\n        recurse(header)\n\n        return sum\n      },\n      getStart: () => {\n        if (header.index > 0) {\n          const prevSiblingHeader =\n            header.headerGroup.headers[header.index - 1]!\n          return prevSiblingHeader.getStart() + prevSiblingHeader.getSize()\n        }\n\n        return 0\n      },\n      getResizeHandler: () => {\n        const column = table.getColumn(header.column.id)\n        const canResize = column?.getCanResize()\n\n        return (e: unknown) => {\n          if (!column || !canResize) {\n            return\n          }\n\n          ;(e as any).persist?.()\n\n          if (isTouchStartEvent(e)) {\n            // lets not respond to multiple touches (e.g. 2 or 3 fingers)\n            if (e.touches && e.touches.length > 1) {\n              return\n            }\n          }\n\n          const startSize = header.getSize()\n\n          const columnSizingStart: [string, number][] = header\n            ? header\n                .getLeafHeaders()\n                .map(d => [d.column.id, d.column.getSize()])\n            : [[column.id, column.getSize()]]\n\n          const clientX = isTouchStartEvent(e)\n            ? Math.round(e.touches[0]!.clientX)\n            : (e as MouseEvent).clientX\n\n          const newColumnSizing: ColumnSizingState = {}\n\n          const updateOffset = (\n            eventType: 'move' | 'end',\n            clientXPos?: number\n          ) => {\n            if (typeof clientXPos !== 'number') {\n              return\n            }\n\n            table.setColumnSizingInfo(old => {\n              const deltaOffset = clientXPos - (old?.startOffset ?? 0)\n              const deltaPercentage = Math.max(\n                deltaOffset / (old?.startSize ?? 0),\n                -0.999999\n              )\n\n              old.columnSizingStart.forEach(([columnId, headerSize]) => {\n                newColumnSizing[columnId] =\n                  Math.round(\n                    Math.max(headerSize + headerSize * deltaPercentage, 0) * 100\n                  ) / 100\n              })\n\n              return {\n                ...old,\n                deltaOffset,\n                deltaPercentage,\n              }\n            })\n\n            if (\n              table.options.columnResizeMode === 'onChange' ||\n              eventType === 'end'\n            ) {\n              table.setColumnSizing(old => ({\n                ...old,\n                ...newColumnSizing,\n              }))\n            }\n          }\n\n          const onMove = (clientXPos?: number) =>\n            updateOffset('move', clientXPos)\n\n          const onEnd = (clientXPos?: number) => {\n            updateOffset('end', clientXPos)\n\n            table.setColumnSizingInfo(old => ({\n              ...old,\n              isResizingColumn: false,\n              startOffset: null,\n              startSize: null,\n              deltaOffset: null,\n              deltaPercentage: null,\n              columnSizingStart: [],\n            }))\n          }\n\n          const mouseEvents = {\n            moveHandler: (e: MouseEvent) => onMove(e.clientX),\n            upHandler: (e: MouseEvent) => {\n              document.removeEventListener('mousemove', mouseEvents.moveHandler)\n              document.removeEventListener('mouseup', mouseEvents.upHandler)\n              onEnd(e.clientX)\n            },\n          }\n\n          const touchEvents = {\n            moveHandler: (e: TouchEvent) => {\n              if (e.cancelable) {\n                e.preventDefault()\n                e.stopPropagation()\n              }\n              onMove(e.touches[0]!.clientX)\n              return false\n            },\n            upHandler: (e: TouchEvent) => {\n              document.removeEventListener('touchmove', touchEvents.moveHandler)\n              document.removeEventListener('touchend', touchEvents.upHandler)\n              if (e.cancelable) {\n                e.preventDefault()\n                e.stopPropagation()\n              }\n              onEnd(e.touches[0]?.clientX)\n            },\n          }\n\n          const passiveIfSupported = passiveEventSupported()\n            ? { passive: false }\n            : false\n\n          if (isTouchStartEvent(e)) {\n            document.addEventListener(\n              'touchmove',\n              touchEvents.moveHandler,\n              passiveIfSupported\n            )\n            document.addEventListener(\n              'touchend',\n              touchEvents.upHandler,\n              passiveIfSupported\n            )\n          } else {\n            document.addEventListener(\n              'mousemove',\n              mouseEvents.moveHandler,\n              passiveIfSupported\n            )\n            document.addEventListener(\n              'mouseup',\n              mouseEvents.upHandler,\n              passiveIfSupported\n            )\n          }\n\n          table.setColumnSizingInfo(old => ({\n            ...old,\n            startOffset: clientX,\n            startSize,\n            deltaOffset: 0,\n            deltaPercentage: 0,\n            columnSizingStart,\n            isResizingColumn: column.id,\n          }))\n        }\n      },\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): ColumnSizingInstance => {\n    return {\n      setColumnSizing: updater => table.options.onColumnSizingChange?.(updater),\n      setColumnSizingInfo: updater =>\n        table.options.onColumnSizingInfoChange?.(updater),\n      resetColumnSizing: defaultState => {\n        table.setColumnSizing(\n          defaultState ? {} : table.initialState.columnSizing ?? {}\n        )\n      },\n      resetHeaderSizeInfo: defaultState => {\n        table.setColumnSizingInfo(\n          defaultState\n            ? getDefaultColumnSizingInfoState()\n            : table.initialState.columnSizingInfo ??\n                getDefaultColumnSizingInfoState()\n        )\n      },\n      getTotalSize: () =>\n        table.getHeaderGroups()[0]?.headers.reduce((sum, header) => {\n          return sum + header.getSize()\n        }, 0) ?? 0,\n      getLeftTotalSize: () =>\n        table.getLeftHeaderGroups()[0]?.headers.reduce((sum, header) => {\n          return sum + header.getSize()\n        }, 0) ?? 0,\n      getCenterTotalSize: () =>\n        table.getCenterHeaderGroups()[0]?.headers.reduce((sum, header) => {\n          return sum + header.getSize()\n        }, 0) ?? 0,\n      getRightTotalSize: () =>\n        table.getRightHeaderGroups()[0]?.headers.reduce((sum, header) => {\n          return sum + header.getSize()\n        }, 0) ?? 0,\n    }\n  },\n}\n\nlet passiveSupported: boolean | null = null\nexport function passiveEventSupported() {\n  if (typeof passiveSupported === 'boolean') return passiveSupported\n\n  let supported = false\n  try {\n    const options = {\n      get passive() {\n        supported = true\n        return false\n      },\n    }\n\n    const noop = () => {}\n\n    window.addEventListener('test', noop, options)\n    window.removeEventListener('test', noop)\n  } catch (err) {\n    supported = false\n  }\n  passiveSupported = supported\n  return passiveSupported\n}\n\nfunction isTouchStartEvent(e: unknown): e is TouchEvent {\n  return (e as TouchEvent).type === 'touchstart'\n}\n","import { RowModel } from '..'\nimport { TableFeature } from '../core/table'\nimport { OnChangeFn, Table, Row, Updater, RowData } from '../types'\nimport { makeStateUpdater } from '../utils'\n\nexport type ExpandedStateList = Record\nexport type ExpandedState = true | Record\nexport interface ExpandedTableState {\n  expanded: ExpandedState\n}\n\nexport interface ExpandedRow {\n  toggleExpanded: (expanded?: boolean) => void\n  getIsExpanded: () => boolean\n  getCanExpand: () => boolean\n  getToggleExpandedHandler: () => () => void\n}\n\nexport interface ExpandedOptions {\n  manualExpanding?: boolean\n  onExpandedChange?: OnChangeFn\n  autoResetExpanded?: boolean\n  enableExpanding?: boolean\n  getExpandedRowModel?: (table: Table) => () => RowModel\n  getIsRowExpanded?: (row: Row) => boolean\n  getRowCanExpand?: (row: Row) => boolean\n  paginateExpandedRows?: boolean\n}\n\nexport interface ExpandedInstance {\n  _autoResetExpanded: () => void\n  setExpanded: (updater: Updater) => void\n  toggleAllRowsExpanded: (expanded?: boolean) => void\n  resetExpanded: (defaultState?: boolean) => void\n  getCanSomeRowsExpand: () => boolean\n  getToggleAllRowsExpandedHandler: () => (event: unknown) => void\n  getIsSomeRowsExpanded: () => boolean\n  getIsAllRowsExpanded: () => boolean\n  getExpandedDepth: () => number\n  getExpandedRowModel: () => RowModel\n  _getExpandedRowModel?: () => RowModel\n  getPreExpandedRowModel: () => RowModel\n}\n\n//\n\nexport const Expanding: TableFeature = {\n  getInitialState: (state): ExpandedTableState => {\n    return {\n      expanded: {},\n      ...state,\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): ExpandedOptions => {\n    return {\n      onExpandedChange: makeStateUpdater('expanded', table),\n      paginateExpandedRows: true,\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): ExpandedInstance => {\n    let registered = false\n    let queued = false\n\n    return {\n      _autoResetExpanded: () => {\n        if (!registered) {\n          table._queue(() => {\n            registered = true\n          })\n          return\n        }\n\n        if (\n          table.options.autoResetAll ??\n          table.options.autoResetExpanded ??\n          !table.options.manualExpanding\n        ) {\n          if (queued) return\n          queued = true\n          table._queue(() => {\n            table.resetExpanded()\n            queued = false\n          })\n        }\n      },\n      setExpanded: updater => table.options.onExpandedChange?.(updater),\n      toggleAllRowsExpanded: expanded => {\n        if (expanded ?? !table.getIsAllRowsExpanded()) {\n          table.setExpanded(true)\n        } else {\n          table.setExpanded({})\n        }\n      },\n      resetExpanded: defaultState => {\n        table.setExpanded(\n          defaultState ? {} : table.initialState?.expanded ?? {}\n        )\n      },\n      getCanSomeRowsExpand: () => {\n        return table\n          .getPrePaginationRowModel()\n          .flatRows.some(row => row.getCanExpand())\n      },\n      getToggleAllRowsExpandedHandler: () => {\n        return (e: unknown) => {\n          ;(e as any).persist?.()\n          table.toggleAllRowsExpanded()\n        }\n      },\n      getIsSomeRowsExpanded: () => {\n        const expanded = table.getState().expanded\n        return expanded === true || Object.values(expanded).some(Boolean)\n      },\n      getIsAllRowsExpanded: () => {\n        const expanded = table.getState().expanded\n\n        // If expanded is true, save some cycles and return true\n        if (typeof expanded === 'boolean') {\n          return expanded === true\n        }\n\n        if (!Object.keys(expanded).length) {\n          return false\n        }\n\n        // If any row is not expanded, return false\n        if (table.getRowModel().flatRows.some(row => !row.getIsExpanded())) {\n          return false\n        }\n\n        // They must all be expanded :shrug:\n        return true\n      },\n      getExpandedDepth: () => {\n        let maxDepth = 0\n\n        const rowIds =\n          table.getState().expanded === true\n            ? Object.keys(table.getRowModel().rowsById)\n            : Object.keys(table.getState().expanded)\n\n        rowIds.forEach(id => {\n          const splitId = id.split('.')\n          maxDepth = Math.max(maxDepth, splitId.length)\n        })\n\n        return maxDepth\n      },\n      getPreExpandedRowModel: () => table.getSortedRowModel(),\n      getExpandedRowModel: () => {\n        if (!table._getExpandedRowModel && table.options.getExpandedRowModel) {\n          table._getExpandedRowModel = table.options.getExpandedRowModel(table)\n        }\n\n        if (table.options.manualExpanding || !table._getExpandedRowModel) {\n          return table.getPreExpandedRowModel()\n        }\n\n        return table._getExpandedRowModel()\n      },\n    }\n  },\n\n  createRow: (\n    row: Row,\n    table: Table\n  ): ExpandedRow => {\n    return {\n      toggleExpanded: expanded => {\n        table.setExpanded(old => {\n          const exists = old === true ? true : !!old?.[row.id]\n\n          let oldExpanded: ExpandedStateList = {}\n\n          if (old === true) {\n            Object.keys(table.getRowModel().rowsById).forEach(rowId => {\n              oldExpanded[rowId] = true\n            })\n          } else {\n            oldExpanded = old\n          }\n\n          expanded = expanded ?? !exists\n\n          if (!exists && expanded) {\n            return {\n              ...oldExpanded,\n              [row.id]: true,\n            }\n          }\n\n          if (exists && !expanded) {\n            const { [row.id]: _, ...rest } = oldExpanded\n            return rest\n          }\n\n          return old\n        })\n      },\n      getIsExpanded: () => {\n        const expanded = table.getState().expanded\n\n        return !!(\n          table.options.getIsRowExpanded?.(row) ??\n          (expanded === true || expanded?.[row.id])\n        )\n      },\n      getCanExpand: () => {\n        return (\n          table.options.getRowCanExpand?.(row) ??\n          ((table.options.enableExpanding ?? true) && !!row.subRows?.length)\n        )\n      },\n      getToggleExpandedHandler: () => {\n        const canExpand = row.getCanExpand()\n\n        return () => {\n          if (!canExpand) return\n          row.toggleExpanded()\n        }\n      },\n    }\n  },\n}\n","import { FilterFn } from './features/Filters'\n\nconst includesString: FilterFn = (\n  row,\n  columnId: string,\n  filterValue: string\n) => {\n  const search = filterValue.toLowerCase()\n  return Boolean(\n    row\n      .getValue(columnId)\n      ?.toString()\n      ?.toLowerCase()\n      ?.includes(search)\n  )\n}\n\nincludesString.autoRemove = (val: any) => testFalsey(val)\n\nconst includesStringSensitive: FilterFn = (\n  row,\n  columnId: string,\n  filterValue: string\n) => {\n  return Boolean(\n    row.getValue(columnId)?.toString()?.includes(filterValue)\n  )\n}\n\nincludesStringSensitive.autoRemove = (val: any) => testFalsey(val)\n\nconst equalsString: FilterFn = (\n  row,\n  columnId: string,\n  filterValue: string\n) => {\n  return (\n    row.getValue(columnId)?.toString()?.toLowerCase() ===\n    filterValue?.toLowerCase()\n  )\n}\n\nequalsString.autoRemove = (val: any) => testFalsey(val)\n\nconst arrIncludes: FilterFn = (\n  row,\n  columnId: string,\n  filterValue: unknown\n) => {\n  return row.getValue(columnId)?.includes(filterValue)\n}\n\narrIncludes.autoRemove = (val: any) => testFalsey(val) || !val?.length\n\nconst arrIncludesAll: FilterFn = (\n  row,\n  columnId: string,\n  filterValue: unknown[]\n) => {\n  return !filterValue.some(\n    val => !row.getValue(columnId)?.includes(val)\n  )\n}\n\narrIncludesAll.autoRemove = (val: any) => testFalsey(val) || !val?.length\n\nconst arrIncludesSome: FilterFn = (\n  row,\n  columnId: string,\n  filterValue: unknown[]\n) => {\n  return filterValue.some(val =>\n    row.getValue(columnId)?.includes(val)\n  )\n}\n\narrIncludesSome.autoRemove = (val: any) => testFalsey(val) || !val?.length\n\nconst equals: FilterFn = (row, columnId: string, filterValue: unknown) => {\n  return row.getValue(columnId) === filterValue\n}\n\nequals.autoRemove = (val: any) => testFalsey(val)\n\nconst weakEquals: FilterFn = (\n  row,\n  columnId: string,\n  filterValue: unknown\n) => {\n  return row.getValue(columnId) == filterValue\n}\n\nweakEquals.autoRemove = (val: any) => testFalsey(val)\n\nconst inNumberRange: FilterFn = (\n  row,\n  columnId: string,\n  filterValue: [number, number]\n) => {\n  let [min, max] = filterValue\n\n  const rowValue = row.getValue(columnId)\n  return rowValue >= min && rowValue <= max\n}\n\ninNumberRange.resolveFilterValue = (val: [any, any]) => {\n  let [unsafeMin, unsafeMax] = val\n\n  let parsedMin =\n    typeof unsafeMin !== 'number' ? parseFloat(unsafeMin as string) : unsafeMin\n  let parsedMax =\n    typeof unsafeMax !== 'number' ? parseFloat(unsafeMax as string) : unsafeMax\n\n  let min =\n    unsafeMin === null || Number.isNaN(parsedMin) ? -Infinity : parsedMin\n  let max = unsafeMax === null || Number.isNaN(parsedMax) ? Infinity : parsedMax\n\n  if (min > max) {\n    const temp = min\n    min = max\n    max = temp\n  }\n\n  return [min, max] as const\n}\n\ninNumberRange.autoRemove = (val: any) =>\n  testFalsey(val) || (testFalsey(val[0]) && testFalsey(val[1]))\n\n// Export\n\nexport const filterFns = {\n  includesString,\n  includesStringSensitive,\n  equalsString,\n  arrIncludes,\n  arrIncludesAll,\n  arrIncludesSome,\n  equals,\n  weakEquals,\n  inNumberRange,\n}\n\nexport type BuiltInFilterFn = keyof typeof filterFns\n\n// Utils\n\nfunction testFalsey(val: any) {\n  return val === undefined || val === null || val === ''\n}\n","import { RowModel } from '..'\nimport { TableFeature } from '../core/table'\nimport { BuiltInFilterFn, filterFns } from '../filterFns'\nimport {\n  Column,\n  OnChangeFn,\n  Table,\n  Row,\n  Updater,\n  RowData,\n  FilterMeta,\n  FilterFns,\n} from '../types'\nimport { functionalUpdate, isFunction, makeStateUpdater } from '../utils'\n\nexport interface FiltersTableState {\n  columnFilters: ColumnFiltersState\n  globalFilter: any\n}\n\nexport type ColumnFiltersState = ColumnFilter[]\n\nexport interface ColumnFilter {\n  id: string\n  value: unknown\n}\n\nexport interface ResolvedColumnFilter {\n  id: string\n  resolvedValue: unknown\n  filterFn: FilterFn\n}\n\nexport interface FilterFn {\n  (\n    row: Row,\n    columnId: string,\n    filterValue: any,\n    addMeta: (meta: FilterMeta) => void\n  ): boolean\n\n  resolveFilterValue?: TransformFilterValueFn\n  autoRemove?: ColumnFilterAutoRemoveTestFn\n}\n\nexport type TransformFilterValueFn = (\n  value: any,\n  column?: Column\n) => unknown\n\nexport type ColumnFilterAutoRemoveTestFn = (\n  value: any,\n  column?: Column\n) => boolean\n\nexport type CustomFilterFns = Record<\n  string,\n  FilterFn\n>\n\nexport type FilterFnOption =\n  | 'auto'\n  | BuiltInFilterFn\n  | keyof FilterFns\n  | FilterFn\n\nexport interface FiltersColumnDef {\n  filterFn?: FilterFnOption\n  enableColumnFilter?: boolean\n  enableGlobalFilter?: boolean\n}\n\nexport interface FiltersColumn {\n  getAutoFilterFn: () => FilterFn | undefined\n  getFilterFn: () => FilterFn | undefined\n  setFilterValue: (updater: Updater) => void\n  getCanFilter: () => boolean\n  getCanGlobalFilter: () => boolean\n  getFacetedRowModel: () => RowModel\n  _getFacetedRowModel?: () => RowModel\n  getIsFiltered: () => boolean\n  getFilterValue: () => unknown\n  getFilterIndex: () => number\n  getFacetedUniqueValues: () => Map\n  _getFacetedUniqueValues?: () => Map\n  getFacetedMinMaxValues: () => undefined | [number, number]\n  _getFacetedMinMaxValues?: () => undefined | [number, number]\n}\n\nexport interface FiltersRow {\n  columnFilters: Record\n  columnFiltersMeta: Record\n}\n\ninterface FiltersOptionsBase {\n  enableFilters?: boolean\n  manualFiltering?: boolean\n  filterFromLeafRows?: boolean\n  maxLeafRowFilterDepth?: number\n  getFilteredRowModel?: (table: Table) => () => RowModel\n\n  // Column\n  onColumnFiltersChange?: OnChangeFn\n  enableColumnFilters?: boolean\n\n  // Global\n  globalFilterFn?: FilterFnOption\n  onGlobalFilterChange?: OnChangeFn\n  enableGlobalFilter?: boolean\n  getColumnCanGlobalFilter?: (column: Column) => boolean\n\n  // Faceting\n  getFacetedRowModel?: (\n    table: Table,\n    columnId: string\n  ) => () => RowModel\n  getFacetedUniqueValues?: (\n    table: Table,\n    columnId: string\n  ) => () => Map\n  getFacetedMinMaxValues?: (\n    table: Table,\n    columnId: string\n  ) => () => undefined | [number, number]\n}\n\ntype ResolvedFilterFns = keyof FilterFns extends never\n  ? {\n      filterFns?: Record>\n    }\n  : {\n      filterFns: Record>\n    }\n\nexport interface FiltersOptions\n  extends FiltersOptionsBase,\n    ResolvedFilterFns {}\n\nexport interface FiltersInstance {\n  setColumnFilters: (updater: Updater) => void\n\n  resetColumnFilters: (defaultState?: boolean) => void\n\n  // Column Filters\n  getPreFilteredRowModel: () => RowModel\n  getFilteredRowModel: () => RowModel\n  _getFilteredRowModel?: () => RowModel\n\n  // Global Filters\n  setGlobalFilter: (updater: Updater) => void\n  resetGlobalFilter: (defaultState?: boolean) => void\n  getGlobalAutoFilterFn: () => FilterFn | undefined\n  getGlobalFilterFn: () => FilterFn | undefined\n  getGlobalFacetedRowModel: () => RowModel\n  _getGlobalFacetedRowModel?: () => RowModel\n  getGlobalFacetedUniqueValues: () => Map\n  _getGlobalFacetedUniqueValues?: () => Map\n  getGlobalFacetedMinMaxValues: () => undefined | [number, number]\n  _getGlobalFacetedMinMaxValues?: () => undefined | [number, number]\n}\n\n//\n\nexport const Filters: TableFeature = {\n  getDefaultColumnDef: (): FiltersColumnDef => {\n    return {\n      filterFn: 'auto',\n    }\n  },\n\n  getInitialState: (state): FiltersTableState => {\n    return {\n      columnFilters: [],\n      globalFilter: undefined,\n      // filtersProgress: 1,\n      // facetProgress: {},\n      ...state,\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): FiltersOptions => {\n    return {\n      onColumnFiltersChange: makeStateUpdater('columnFilters', table),\n      onGlobalFilterChange: makeStateUpdater('globalFilter', table),\n      filterFromLeafRows: false,\n      maxLeafRowFilterDepth: 100,\n      globalFilterFn: 'auto',\n      getColumnCanGlobalFilter: column => {\n        const value = table\n          .getCoreRowModel()\n          .flatRows[0]?._getAllCellsByColumnId()\n          [column.id]?.getValue()\n\n        return typeof value === 'string' || typeof value === 'number'\n      },\n    } as FiltersOptions\n  },\n\n  createColumn: (\n    column: Column,\n    table: Table\n  ): FiltersColumn => {\n    return {\n      getAutoFilterFn: () => {\n        const firstRow = table.getCoreRowModel().flatRows[0]\n\n        const value = firstRow?.getValue(column.id)\n\n        if (typeof value === 'string') {\n          return filterFns.includesString\n        }\n\n        if (typeof value === 'number') {\n          return filterFns.inNumberRange\n        }\n\n        if (typeof value === 'boolean') {\n          return filterFns.equals\n        }\n\n        if (value !== null && typeof value === 'object') {\n          return filterFns.equals\n        }\n\n        if (Array.isArray(value)) {\n          return filterFns.arrIncludes\n        }\n\n        return filterFns.weakEquals\n      },\n      getFilterFn: () => {\n        return isFunction(column.columnDef.filterFn)\n          ? column.columnDef.filterFn\n          : column.columnDef.filterFn === 'auto'\n          ? column.getAutoFilterFn()\n          // @ts-ignore \n          : table.options.filterFns?.[column.columnDef.filterFn as string] ??\n            filterFns[column.columnDef.filterFn as BuiltInFilterFn]\n      },\n      getCanFilter: () => {\n        return (\n          (column.columnDef.enableColumnFilter ?? true) &&\n          (table.options.enableColumnFilters ?? true) &&\n          (table.options.enableFilters ?? true) &&\n          !!column.accessorFn\n        )\n      },\n\n      getCanGlobalFilter: () => {\n        return (\n          (column.columnDef.enableGlobalFilter ?? true) &&\n          (table.options.enableGlobalFilter ?? true) &&\n          (table.options.enableFilters ?? true) &&\n          (table.options.getColumnCanGlobalFilter?.(column) ?? true) &&\n          !!column.accessorFn\n        )\n      },\n\n      getIsFiltered: () => column.getFilterIndex() > -1,\n\n      getFilterValue: () =>\n        table.getState().columnFilters?.find(d => d.id === column.id)?.value,\n\n      getFilterIndex: () =>\n        table.getState().columnFilters?.findIndex(d => d.id === column.id) ??\n        -1,\n\n      setFilterValue: value => {\n        table.setColumnFilters(old => {\n          const filterFn = column.getFilterFn()\n          const previousfilter = old?.find(d => d.id === column.id)\n\n          const newFilter = functionalUpdate(\n            value,\n            previousfilter ? previousfilter.value : undefined\n          )\n\n          //\n          if (\n            shouldAutoRemoveFilter(\n              filterFn as FilterFn,\n              newFilter,\n              column\n            )\n          ) {\n            return old?.filter(d => d.id !== column.id) ?? []\n          }\n\n          const newFilterObj = { id: column.id, value: newFilter }\n\n          if (previousfilter) {\n            return (\n              old?.map(d => {\n                if (d.id === column.id) {\n                  return newFilterObj\n                }\n                return d\n              }) ?? []\n            )\n          }\n\n          if (old?.length) {\n            return [...old, newFilterObj]\n          }\n\n          return [newFilterObj]\n        })\n      },\n      _getFacetedRowModel:\n        table.options.getFacetedRowModel &&\n        table.options.getFacetedRowModel(table, column.id),\n      getFacetedRowModel: () => {\n        if (!column._getFacetedRowModel) {\n          return table.getPreFilteredRowModel()\n        }\n\n        return column._getFacetedRowModel()\n      },\n      _getFacetedUniqueValues:\n        table.options.getFacetedUniqueValues &&\n        table.options.getFacetedUniqueValues(table, column.id),\n      getFacetedUniqueValues: () => {\n        if (!column._getFacetedUniqueValues) {\n          return new Map()\n        }\n\n        return column._getFacetedUniqueValues()\n      },\n      _getFacetedMinMaxValues:\n        table.options.getFacetedMinMaxValues &&\n        table.options.getFacetedMinMaxValues(table, column.id),\n      getFacetedMinMaxValues: () => {\n        if (!column._getFacetedMinMaxValues) {\n          return undefined\n        }\n\n        return column._getFacetedMinMaxValues()\n      },\n      // () => [column.getFacetedRowModel()],\n      // facetedRowModel => getRowModelMinMaxValues(facetedRowModel, column.id),\n    }\n  },\n\n  createRow: (\n    row: Row,\n    table: Table\n  ): FiltersRow => {\n    return {\n      columnFilters: {},\n      columnFiltersMeta: {},\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): FiltersInstance => {\n    return {\n      getGlobalAutoFilterFn: () => {\n        return filterFns.includesString\n      },\n\n      getGlobalFilterFn: () => {\n        const { globalFilterFn: globalFilterFn } = table.options\n\n        return isFunction(globalFilterFn)\n          ? globalFilterFn\n          : globalFilterFn === 'auto'\n          ? table.getGlobalAutoFilterFn()\n          // @ts-ignore\n          : table.options.filterFns?.[globalFilterFn as string] ??\n            filterFns[globalFilterFn as BuiltInFilterFn]\n      },\n\n      setColumnFilters: (updater: Updater) => {\n        const leafColumns = table.getAllLeafColumns()\n\n        const updateFn = (old: ColumnFiltersState) => {\n          return functionalUpdate(updater, old)?.filter(filter => {\n            const column = leafColumns.find(d => d.id === filter.id)\n\n            if (column) {\n              const filterFn = column.getFilterFn()\n\n              if (shouldAutoRemoveFilter(filterFn, filter.value, column)) {\n                return false\n              }\n            }\n\n            return true\n          })\n        }\n\n        table.options.onColumnFiltersChange?.(updateFn)\n      },\n\n      setGlobalFilter: updater => {\n        table.options.onGlobalFilterChange?.(updater)\n      },\n\n      resetGlobalFilter: defaultState => {\n        table.setGlobalFilter(\n          defaultState ? undefined : table.initialState.globalFilter\n        )\n      },\n\n      resetColumnFilters: defaultState => {\n        table.setColumnFilters(\n          defaultState ? [] : table.initialState?.columnFilters ?? []\n        )\n      },\n\n      getPreFilteredRowModel: () => table.getCoreRowModel(),\n      getFilteredRowModel: () => {\n        if (!table._getFilteredRowModel && table.options.getFilteredRowModel) {\n          table._getFilteredRowModel = table.options.getFilteredRowModel(table)\n        }\n\n        if (table.options.manualFiltering || !table._getFilteredRowModel) {\n          return table.getPreFilteredRowModel()\n        }\n\n        return table._getFilteredRowModel()\n      },\n\n      _getGlobalFacetedRowModel:\n        table.options.getFacetedRowModel &&\n        table.options.getFacetedRowModel(table, '__global__'),\n\n      getGlobalFacetedRowModel: () => {\n        if (table.options.manualFiltering || !table._getGlobalFacetedRowModel) {\n          return table.getPreFilteredRowModel()\n        }\n\n        return table._getGlobalFacetedRowModel()\n      },\n\n      _getGlobalFacetedUniqueValues:\n        table.options.getFacetedUniqueValues &&\n        table.options.getFacetedUniqueValues(table, '__global__'),\n      getGlobalFacetedUniqueValues: () => {\n        if (!table._getGlobalFacetedUniqueValues) {\n          return new Map()\n        }\n\n        return table._getGlobalFacetedUniqueValues()\n      },\n\n      _getGlobalFacetedMinMaxValues:\n        table.options.getFacetedMinMaxValues &&\n        table.options.getFacetedMinMaxValues(table, '__global__'),\n      getGlobalFacetedMinMaxValues: () => {\n        if (!table._getGlobalFacetedMinMaxValues) {\n          return\n        }\n\n        return table._getGlobalFacetedMinMaxValues()\n      },\n    }\n  },\n}\n\nexport function shouldAutoRemoveFilter(\n  filterFn?: FilterFn,\n  value?: any,\n  column?: Column\n) {\n  return (\n    (filterFn && filterFn.autoRemove\n      ? filterFn.autoRemove(value, column)\n      : false) ||\n    typeof value === 'undefined' ||\n    (typeof value === 'string' && !value)\n  )\n}\n","import { AggregationFn } from './features/Grouping'\nimport { isNumberArray } from './utils'\n\nconst sum: AggregationFn = (columnId, _leafRows, childRows) => {\n  // It's faster to just add the aggregations together instead of\n  // process leaf nodes individually\n  return childRows.reduce((sum, next) => {\n    const nextValue = next.getValue(columnId)\n    return sum + (typeof nextValue === 'number' ? nextValue : 0)\n  }, 0)\n}\n\nconst min: AggregationFn = (columnId, _leafRows, childRows) => {\n  let min: number | undefined\n\n  childRows.forEach(row => {\n    const value = row.getValue(columnId)\n\n    if (\n      value != null &&\n      (min! > value || (min === undefined && value >= value))\n    ) {\n      min = value\n    }\n  })\n\n  return min\n}\n\nconst max: AggregationFn = (columnId, _leafRows, childRows) => {\n  let max: number | undefined\n\n  childRows.forEach(row => {\n    const value = row.getValue(columnId)\n    if (\n      value != null &&\n      (max! < value || (max === undefined && value >= value))\n    ) {\n      max = value\n    }\n  })\n\n  return max\n}\n\nconst extent: AggregationFn = (columnId, _leafRows, childRows) => {\n  let min: number | undefined\n  let max: number | undefined\n\n  childRows.forEach(row => {\n    const value = row.getValue(columnId)\n    if (value != null) {\n      if (min === undefined) {\n        if (value >= value) min = max = value\n      } else {\n        if (min > value) min = value\n        if (max! < value) max = value\n      }\n    }\n  })\n\n  return [min, max]\n}\n\nconst mean: AggregationFn = (columnId, leafRows) => {\n  let count = 0\n  let sum = 0\n\n  leafRows.forEach(row => {\n    let value = row.getValue(columnId)\n    if (value != null && (value = +value) >= value) {\n      ++count, (sum += value)\n    }\n  })\n\n  if (count) return sum / count\n\n  return\n}\n\nconst median: AggregationFn = (columnId, leafRows) => {\n  if (!leafRows.length) {\n    return\n  }\n\n  const values = leafRows.map(row => row.getValue(columnId))\n  if (!isNumberArray(values)) {\n    return\n  }\n  if (values.length === 1) {\n    return values[0]\n  }\n\n  const mid = Math.floor(values.length / 2)\n  const nums = values.sort((a, b) => a - b)\n  return values.length % 2 !== 0 ? nums[mid] : (nums[mid - 1]! + nums[mid]!) / 2\n}\n\nconst unique: AggregationFn = (columnId, leafRows) => {\n  return Array.from(new Set(leafRows.map(d => d.getValue(columnId))).values())\n}\n\nconst uniqueCount: AggregationFn = (columnId, leafRows) => {\n  return new Set(leafRows.map(d => d.getValue(columnId))).size\n}\n\nconst count: AggregationFn = (_columnId, leafRows) => {\n  return leafRows.length\n}\n\nexport const aggregationFns = {\n  sum,\n  min,\n  max,\n  extent,\n  mean,\n  median,\n  unique,\n  uniqueCount,\n  count,\n}\n\nexport type BuiltInAggregationFn = keyof typeof aggregationFns\n","import { RowModel } from '..'\nimport { BuiltInAggregationFn, aggregationFns } from '../aggregationFns'\nimport { TableFeature } from '../core/table'\nimport {\n  Cell,\n  Column,\n  OnChangeFn,\n  Table,\n  Row,\n  Updater,\n  ColumnDefTemplate,\n  RowData,\n  AggregationFns,\n} from '../types'\nimport { isFunction, makeStateUpdater } from '../utils'\n\nexport type GroupingState = string[]\n\nexport interface GroupingTableState {\n  grouping: GroupingState\n}\n\nexport type AggregationFn = (\n  columnId: string,\n  leafRows: Row[],\n  childRows: Row[]\n) => any\n\nexport type CustomAggregationFns = Record>\n\nexport type AggregationFnOption =\n  | 'auto'\n  | keyof AggregationFns\n  | BuiltInAggregationFn\n  | AggregationFn\n\nexport interface GroupingColumnDef {\n  aggregationFn?: AggregationFnOption\n  aggregatedCell?: ColumnDefTemplate<\n    ReturnType['getContext']>\n  >\n  enableGrouping?: boolean\n  getGroupingValue?: (row: TData) => any\n}\n\nexport interface GroupingColumn {\n  getCanGroup: () => boolean\n  getIsGrouped: () => boolean\n  getGroupedIndex: () => number\n  toggleGrouping: () => void\n  getToggleGroupingHandler: () => () => void\n  getAutoAggregationFn: () => AggregationFn | undefined\n  getAggregationFn: () => AggregationFn | undefined\n}\n\nexport interface GroupingRow {\n  groupingColumnId?: string\n  groupingValue?: unknown\n  getIsGrouped: () => boolean\n  getGroupingValue: (columnId: string) => unknown\n  _groupingValuesCache: Record\n}\n\nexport interface GroupingCell {\n  getIsGrouped: () => boolean\n  getIsPlaceholder: () => boolean\n  getIsAggregated: () => boolean\n}\n\nexport interface ColumnDefaultOptions {\n  // Column\n  onGroupingChange: OnChangeFn\n  enableGrouping: boolean\n}\n\ninterface GroupingOptionsBase {\n  manualGrouping?: boolean\n  onGroupingChange?: OnChangeFn\n  enableGrouping?: boolean\n  getGroupedRowModel?: (table: Table) => () => RowModel\n  groupedColumnMode?: false | 'reorder' | 'remove'\n}\n\ntype ResolvedAggregationFns = keyof AggregationFns extends never\n  ? {\n      aggregationFns?: Record>\n    }\n  : {\n      aggregationFns: Record>\n    }\n\nexport interface GroupingOptions\n  extends GroupingOptionsBase,\n    ResolvedAggregationFns {}\n\nexport type GroupingColumnMode = false | 'reorder' | 'remove'\n\nexport interface GroupingInstance {\n  setGrouping: (updater: Updater) => void\n  resetGrouping: (defaultState?: boolean) => void\n  getPreGroupedRowModel: () => RowModel\n  getGroupedRowModel: () => RowModel\n  _getGroupedRowModel?: () => RowModel\n}\n\n//\n\nexport const Grouping: TableFeature = {\n  getDefaultColumnDef: (): GroupingColumnDef<\n    TData,\n    unknown\n  > => {\n    return {\n      aggregatedCell: props => (props.getValue() as any)?.toString?.() ?? null,\n      aggregationFn: 'auto',\n    }\n  },\n\n  getInitialState: (state): GroupingTableState => {\n    return {\n      grouping: [],\n      ...state,\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): GroupingOptions => {\n    return {\n      onGroupingChange: makeStateUpdater('grouping', table),\n      groupedColumnMode: 'reorder',\n    }\n  },\n\n  createColumn: (\n    column: Column,\n    table: Table\n  ): GroupingColumn => {\n    return {\n      toggleGrouping: () => {\n        table.setGrouping(old => {\n          // Find any existing grouping for this column\n          if (old?.includes(column.id)) {\n            return old.filter(d => d !== column.id)\n          }\n\n          return [...(old ?? []), column.id]\n        })\n      },\n\n      getCanGroup: () => {\n        return (\n          column.columnDef.enableGrouping ??\n          true ??\n          table.options.enableGrouping ??\n          true ??\n          !!column.accessorFn\n        )\n      },\n\n      getIsGrouped: () => {\n        return table.getState().grouping?.includes(column.id)\n      },\n\n      getGroupedIndex: () => table.getState().grouping?.indexOf(column.id),\n\n      getToggleGroupingHandler: () => {\n        const canGroup = column.getCanGroup()\n\n        return () => {\n          if (!canGroup) return\n          column.toggleGrouping()\n        }\n      },\n      getAutoAggregationFn: () => {\n        const firstRow = table.getCoreRowModel().flatRows[0]\n\n        const value = firstRow?.getValue(column.id)\n\n        if (typeof value === 'number') {\n          return aggregationFns.sum\n        }\n\n        if (Object.prototype.toString.call(value) === '[object Date]') {\n          return aggregationFns.extent\n        }\n      },\n      getAggregationFn: () => {\n        if (!column) {\n          throw new Error()\n        }\n\n        return isFunction(column.columnDef.aggregationFn)\n          ? column.columnDef.aggregationFn\n          : column.columnDef.aggregationFn === 'auto'\n          ? column.getAutoAggregationFn()\n          : table.options.aggregationFns?.[\n              column.columnDef.aggregationFn as string\n            ] ??\n            aggregationFns[\n              column.columnDef.aggregationFn as BuiltInAggregationFn\n            ]\n      },\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): GroupingInstance => {\n    return {\n      setGrouping: updater => table.options.onGroupingChange?.(updater),\n\n      resetGrouping: defaultState => {\n        table.setGrouping(\n          defaultState ? [] : table.initialState?.grouping ?? []\n        )\n      },\n\n      getPreGroupedRowModel: () => table.getFilteredRowModel(),\n      getGroupedRowModel: () => {\n        if (!table._getGroupedRowModel && table.options.getGroupedRowModel) {\n          table._getGroupedRowModel = table.options.getGroupedRowModel(table)\n        }\n\n        if (table.options.manualGrouping || !table._getGroupedRowModel) {\n          return table.getPreGroupedRowModel()\n        }\n\n        return table._getGroupedRowModel()\n      },\n    }\n  },\n\n  createRow: (\n    row: Row,\n    table: Table\n  ): GroupingRow => {\n    return {\n      getIsGrouped: () => !!row.groupingColumnId,\n      getGroupingValue: columnId => {\n        if (row._groupingValuesCache.hasOwnProperty(columnId)) {\n          return row._groupingValuesCache[columnId]\n        }\n\n        const column = table.getColumn(columnId)\n\n        if (!column?.columnDef.getGroupingValue) {\n          return row.getValue(columnId)\n        }\n\n        row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(\n          row.original\n        )\n\n        return row._groupingValuesCache[columnId]\n      },\n      _groupingValuesCache: {},\n    }\n  },\n\n  createCell: (\n    cell: Cell,\n    column: Column,\n    row: Row,\n    table: Table\n  ): GroupingCell => {\n    const getRenderValue = () =>\n      cell.getValue() ?? table.options.renderFallbackValue\n\n    return {\n      getIsGrouped: () =>\n        column.getIsGrouped() && column.id === row.groupingColumnId,\n      getIsPlaceholder: () => !cell.getIsGrouped() && column.getIsGrouped(),\n      getIsAggregated: () =>\n        !cell.getIsGrouped() &&\n        !cell.getIsPlaceholder() &&\n        !!row.subRows?.length,\n    }\n  },\n}\n\nexport function orderColumns(\n  leafColumns: Column[],\n  grouping: string[],\n  groupedColumnMode?: GroupingColumnMode\n) {\n  if (!grouping?.length || !groupedColumnMode) {\n    return leafColumns\n  }\n\n  const nonGroupingColumns = leafColumns.filter(\n    col => !grouping.includes(col.id)\n  )\n\n  if (groupedColumnMode === 'remove') {\n    return nonGroupingColumns\n  }\n\n  const groupingColumns = grouping\n    .map(g => leafColumns.find(col => col.id === g)!)\n    .filter(Boolean)\n\n  return [...groupingColumns, ...nonGroupingColumns]\n}\n","import { makeStateUpdater, memo } from '../utils'\n\nimport { Table, OnChangeFn, Updater, Column, RowData } from '../types'\n\nimport { orderColumns } from './Grouping'\nimport { TableFeature } from '../core/table'\n\nexport interface ColumnOrderTableState {\n  columnOrder: ColumnOrderState\n}\n\nexport type ColumnOrderState = string[]\n\nexport interface ColumnOrderOptions {\n  onColumnOrderChange?: OnChangeFn\n}\n\nexport interface ColumnOrderDefaultOptions {\n  onColumnOrderChange: OnChangeFn\n}\n\nexport interface ColumnOrderInstance {\n  setColumnOrder: (updater: Updater) => void\n  resetColumnOrder: (defaultState?: boolean) => void\n  _getOrderColumnsFn: () => (\n    columns: Column[]\n  ) => Column[]\n}\n\n//\n\nexport const Ordering: TableFeature = {\n  getInitialState: (state): ColumnOrderTableState => {\n    return {\n      columnOrder: [],\n      ...state,\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): ColumnOrderDefaultOptions => {\n    return {\n      onColumnOrderChange: makeStateUpdater('columnOrder', table),\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): ColumnOrderInstance => {\n    return {\n      setColumnOrder: updater => table.options.onColumnOrderChange?.(updater),\n      resetColumnOrder: defaultState => {\n        table.setColumnOrder(\n          defaultState ? [] : table.initialState.columnOrder ?? []\n        )\n      },\n      _getOrderColumnsFn: memo(\n        () => [\n          table.getState().columnOrder,\n          table.getState().grouping,\n          table.options.groupedColumnMode,\n        ],\n        (columnOrder, grouping, groupedColumnMode) => columns => {\n          // Sort grouped columns to the start of the column list\n          // before the headers are built\n          let orderedColumns: Column[] = []\n\n          // If there is no order, return the normal columns\n          if (!columnOrder?.length) {\n            orderedColumns = columns\n          } else {\n            const columnOrderCopy = [...columnOrder]\n\n            // If there is an order, make a copy of the columns\n            const columnsCopy = [...columns]\n\n            // And make a new ordered array of the columns\n\n            // Loop over the columns and place them in order into the new array\n            while (columnsCopy.length && columnOrderCopy.length) {\n              const targetColumnId = columnOrderCopy.shift()\n              const foundIndex = columnsCopy.findIndex(\n                d => d.id === targetColumnId\n              )\n              if (foundIndex > -1) {\n                orderedColumns.push(columnsCopy.splice(foundIndex, 1)[0]!)\n              }\n            }\n\n            // If there are any columns left, add them to the end\n            orderedColumns = [...orderedColumns, ...columnsCopy]\n          }\n\n          return orderColumns(orderedColumns, grouping, groupedColumnMode)\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getOrderColumnsFn',\n          // debug: () => table.options.debugAll ?? table.options.debugTable,\n        }\n      ),\n    }\n  },\n}\n","import { TableFeature } from '../core/table'\nimport { OnChangeFn, Table, RowModel, Updater, RowData } from '../types'\nimport { functionalUpdate, makeStateUpdater, memo } from '../utils'\n\nexport interface PaginationState {\n  pageIndex: number\n  pageSize: number\n}\n\nexport interface PaginationTableState {\n  pagination: PaginationState\n}\n\nexport interface PaginationInitialTableState {\n  pagination?: Partial\n}\n\nexport interface PaginationOptions {\n  pageCount?: number\n  manualPagination?: boolean\n  onPaginationChange?: OnChangeFn\n  autoResetPageIndex?: boolean\n  getPaginationRowModel?: (table: Table) => () => RowModel\n}\n\nexport interface PaginationDefaultOptions {\n  onPaginationChange: OnChangeFn\n}\n\nexport interface PaginationInstance {\n  _autoResetPageIndex: () => void\n  setPagination: (updater: Updater) => void\n  resetPagination: (defaultState?: boolean) => void\n  setPageIndex: (updater: Updater) => void\n  resetPageIndex: (defaultState?: boolean) => void\n  setPageSize: (updater: Updater) => void\n  resetPageSize: (defaultState?: boolean) => void\n  setPageCount: (updater: Updater) => void\n  getPageOptions: () => number[]\n  getCanPreviousPage: () => boolean\n  getCanNextPage: () => boolean\n  previousPage: () => void\n  nextPage: () => void\n  getPrePaginationRowModel: () => RowModel\n  getPaginationRowModel: () => RowModel\n  _getPaginationRowModel?: () => RowModel\n  getPageCount: () => number\n}\n\n//\n\nconst defaultPageIndex = 0\nconst defaultPageSize = 10\n\nconst getDefaultPaginationState = (): PaginationState => ({\n  pageIndex: defaultPageIndex,\n  pageSize: defaultPageSize,\n})\n\nexport const Pagination: TableFeature = {\n  getInitialState: (state): PaginationTableState => {\n    return {\n      ...state,\n      pagination: {\n        ...getDefaultPaginationState(),\n        ...state?.pagination,\n      },\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): PaginationDefaultOptions => {\n    return {\n      onPaginationChange: makeStateUpdater('pagination', table),\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): PaginationInstance => {\n    let registered = false\n    let queued = false\n\n    return {\n      _autoResetPageIndex: () => {\n        if (!registered) {\n          table._queue(() => {\n            registered = true\n          })\n          return\n        }\n\n        if (\n          table.options.autoResetAll ??\n          table.options.autoResetPageIndex ??\n          !table.options.manualPagination\n        ) {\n          if (queued) return\n          queued = true\n          table._queue(() => {\n            table.resetPageIndex()\n            queued = false\n          })\n        }\n      },\n      setPagination: updater => {\n        const safeUpdater: Updater = old => {\n          let newState = functionalUpdate(updater, old)\n\n          return newState\n        }\n\n        return table.options.onPaginationChange?.(safeUpdater)\n      },\n      resetPagination: defaultState => {\n        table.setPagination(\n          defaultState\n            ? getDefaultPaginationState()\n            : table.initialState.pagination ?? getDefaultPaginationState()\n        )\n      },\n      setPageIndex: updater => {\n        table.setPagination(old => {\n          let pageIndex = functionalUpdate(updater, old.pageIndex)\n\n          const maxPageIndex =\n            typeof table.options.pageCount === 'undefined' ||\n            table.options.pageCount === -1\n              ? Number.MAX_SAFE_INTEGER\n              : table.options.pageCount - 1\n\n          pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex))\n\n          return {\n            ...old,\n            pageIndex,\n          }\n        })\n      },\n      resetPageIndex: defaultState => {\n        table.setPageIndex(\n          defaultState\n            ? defaultPageIndex\n            : table.initialState?.pagination?.pageIndex ?? defaultPageIndex\n        )\n      },\n      resetPageSize: defaultState => {\n        table.setPageSize(\n          defaultState\n            ? defaultPageSize\n            : table.initialState?.pagination?.pageSize ?? defaultPageSize\n        )\n      },\n      setPageSize: updater => {\n        table.setPagination(old => {\n          const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize))\n          const topRowIndex = old.pageSize * old.pageIndex!\n          const pageIndex = Math.floor(topRowIndex / pageSize)\n\n          return {\n            ...old,\n            pageIndex,\n            pageSize,\n          }\n        })\n      },\n      setPageCount: updater =>\n        table.setPagination(old => {\n          let newPageCount = functionalUpdate(\n            updater,\n            table.options.pageCount ?? -1\n          )\n\n          if (typeof newPageCount === 'number') {\n            newPageCount = Math.max(-1, newPageCount)\n          }\n\n          return {\n            ...old,\n            pageCount: newPageCount,\n          }\n        }),\n\n      getPageOptions: memo(\n        () => [table.getPageCount()],\n        pageCount => {\n          let pageOptions: number[] = []\n          if (pageCount && pageCount > 0) {\n            pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i)\n          }\n          return pageOptions\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getPageOptions',\n          debug: () => table.options.debugAll ?? table.options.debugTable,\n        }\n      ),\n\n      getCanPreviousPage: () => table.getState().pagination.pageIndex > 0,\n\n      getCanNextPage: () => {\n        const { pageIndex } = table.getState().pagination\n\n        const pageCount = table.getPageCount()\n\n        if (pageCount === -1) {\n          return true\n        }\n\n        if (pageCount === 0) {\n          return false\n        }\n\n        return pageIndex < pageCount - 1\n      },\n\n      previousPage: () => {\n        return table.setPageIndex(old => old - 1)\n      },\n\n      nextPage: () => {\n        return table.setPageIndex(old => {\n          return old + 1\n        })\n      },\n\n      getPrePaginationRowModel: () => table.getExpandedRowModel(),\n      getPaginationRowModel: () => {\n        if (\n          !table._getPaginationRowModel &&\n          table.options.getPaginationRowModel\n        ) {\n          table._getPaginationRowModel =\n            table.options.getPaginationRowModel(table)\n        }\n\n        if (table.options.manualPagination || !table._getPaginationRowModel) {\n          return table.getPrePaginationRowModel()\n        }\n\n        return table._getPaginationRowModel()\n      },\n\n      getPageCount: () => {\n        return (\n          table.options.pageCount ??\n          Math.ceil(\n            table.getPrePaginationRowModel().rows.length /\n              table.getState().pagination.pageSize\n          )\n        )\n      },\n    }\n  },\n}\n","import { TableFeature } from '../core/table'\nimport {\n  OnChangeFn,\n  Updater,\n  Table,\n  Column,\n  Row,\n  Cell,\n  RowData,\n} from '../types'\nimport { makeStateUpdater, memo } from '../utils'\n\nexport type ColumnPinningPosition = false | 'left' | 'right'\n\nexport interface ColumnPinningState {\n  left?: string[]\n  right?: string[]\n}\n\nexport interface ColumnPinningTableState {\n  columnPinning: ColumnPinningState\n}\n\nexport interface ColumnPinningOptions {\n  onColumnPinningChange?: OnChangeFn\n  enablePinning?: boolean\n}\n\nexport interface ColumnPinningDefaultOptions {\n  onColumnPinningChange: OnChangeFn\n}\n\nexport interface ColumnPinningColumnDef {\n  enablePinning?: boolean\n}\n\nexport interface ColumnPinningColumn {\n  getCanPin: () => boolean\n  getPinnedIndex: () => number\n  getIsPinned: () => ColumnPinningPosition\n  pin: (position: ColumnPinningPosition) => void\n}\n\nexport interface ColumnPinningRow {\n  getLeftVisibleCells: () => Cell[]\n  getCenterVisibleCells: () => Cell[]\n  getRightVisibleCells: () => Cell[]\n}\n\nexport interface ColumnPinningInstance {\n  setColumnPinning: (updater: Updater) => void\n  resetColumnPinning: (defaultState?: boolean) => void\n  getIsSomeColumnsPinned: (position?: ColumnPinningPosition) => boolean\n  getLeftLeafColumns: () => Column[]\n  getRightLeafColumns: () => Column[]\n  getCenterLeafColumns: () => Column[]\n}\n\n//\n\nconst getDefaultPinningState = (): ColumnPinningState => ({\n  left: [],\n  right: [],\n})\n\nexport const Pinning: TableFeature = {\n  getInitialState: (state): ColumnPinningTableState => {\n    return {\n      columnPinning: getDefaultPinningState(),\n      ...state,\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): ColumnPinningDefaultOptions => {\n    return {\n      onColumnPinningChange: makeStateUpdater('columnPinning', table),\n    }\n  },\n\n  createColumn: (\n    column: Column,\n    table: Table\n  ): ColumnPinningColumn => {\n    return {\n      pin: position => {\n        const columnIds = column\n          .getLeafColumns()\n          .map(d => d.id)\n          .filter(Boolean) as string[]\n\n        table.setColumnPinning(old => {\n          if (position === 'right') {\n            return {\n              left: (old?.left ?? []).filter(d => !columnIds?.includes(d)),\n              right: [\n                ...(old?.right ?? []).filter(d => !columnIds?.includes(d)),\n                ...columnIds,\n              ],\n            }\n          }\n\n          if (position === 'left') {\n            return {\n              left: [\n                ...(old?.left ?? []).filter(d => !columnIds?.includes(d)),\n                ...columnIds,\n              ],\n              right: (old?.right ?? []).filter(d => !columnIds?.includes(d)),\n            }\n          }\n\n          return {\n            left: (old?.left ?? []).filter(d => !columnIds?.includes(d)),\n            right: (old?.right ?? []).filter(d => !columnIds?.includes(d)),\n          }\n        })\n      },\n\n      getCanPin: () => {\n        const leafColumns = column.getLeafColumns()\n\n        return leafColumns.some(\n          d =>\n            (d.columnDef.enablePinning ?? true) &&\n            (table.options.enablePinning ?? true)\n        )\n      },\n\n      getIsPinned: () => {\n        const leafColumnIds = column.getLeafColumns().map(d => d.id)\n\n        const { left, right } = table.getState().columnPinning\n\n        const isLeft = leafColumnIds.some(d => left?.includes(d))\n        const isRight = leafColumnIds.some(d => right?.includes(d))\n\n        return isLeft ? 'left' : isRight ? 'right' : false\n      },\n\n      getPinnedIndex: () => {\n        const position = column.getIsPinned()\n\n        return position\n          ? table.getState().columnPinning?.[position]?.indexOf(column.id) ?? -1\n          : 0\n      },\n    }\n  },\n\n  createRow: (\n    row: Row,\n    table: Table\n  ): ColumnPinningRow => {\n    return {\n      getCenterVisibleCells: memo(\n        () => [\n          row._getAllVisibleCells(),\n          table.getState().columnPinning.left,\n          table.getState().columnPinning.right,\n        ],\n        (allCells, left, right) => {\n          const leftAndRight: string[] = [...(left ?? []), ...(right ?? [])]\n\n          return allCells.filter(d => !leftAndRight.includes(d.column.id))\n        },\n        {\n          key:\n            process.env.NODE_ENV === 'production' &&\n            'row.getCenterVisibleCells',\n          debug: () => table.options.debugAll ?? table.options.debugRows,\n        }\n      ),\n      getLeftVisibleCells: memo(\n        () => [\n          row._getAllVisibleCells(),\n          table.getState().columnPinning.left,\n          ,\n        ],\n        (allCells, left) => {\n          const cells = (left ?? [])\n            .map(\n              columnId => allCells.find(cell => cell.column.id === columnId)!\n            )\n            .filter(Boolean)\n            .map(d => ({ ...d, position: 'left' } as Cell))\n\n          return cells\n        },\n        {\n          key:\n            process.env.NODE_ENV === 'production' && 'row.getLeftVisibleCells',\n          debug: () => table.options.debugAll ?? table.options.debugRows,\n        }\n      ),\n      getRightVisibleCells: memo(\n        () => [row._getAllVisibleCells(), table.getState().columnPinning.right],\n        (allCells, right) => {\n          const cells = (right ?? [])\n            .map(\n              columnId => allCells.find(cell => cell.column.id === columnId)!\n            )\n            .filter(Boolean)\n            .map(d => ({ ...d, position: 'right' } as Cell))\n\n          return cells\n        },\n        {\n          key:\n            process.env.NODE_ENV === 'production' && 'row.getRightVisibleCells',\n          debug: () => table.options.debugAll ?? table.options.debugRows,\n        }\n      ),\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): ColumnPinningInstance => {\n    return {\n      setColumnPinning: updater =>\n        table.options.onColumnPinningChange?.(updater),\n\n      resetColumnPinning: defaultState =>\n        table.setColumnPinning(\n          defaultState\n            ? getDefaultPinningState()\n            : table.initialState?.columnPinning ?? getDefaultPinningState()\n        ),\n\n      getIsSomeColumnsPinned: position => {\n        const pinningState = table.getState().columnPinning\n\n        if (!position) {\n          return Boolean(\n            pinningState.left?.length || pinningState.right?.length\n          )\n        }\n        return Boolean(pinningState[position]?.length)\n      },\n\n      getLeftLeafColumns: memo(\n        () => [table.getAllLeafColumns(), table.getState().columnPinning.left],\n        (allColumns, left) => {\n          return (left ?? [])\n            .map(columnId => allColumns.find(column => column.id === columnId)!)\n            .filter(Boolean)\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getLeftLeafColumns',\n          debug: () => table.options.debugAll ?? table.options.debugColumns,\n        }\n      ),\n\n      getRightLeafColumns: memo(\n        () => [table.getAllLeafColumns(), table.getState().columnPinning.right],\n        (allColumns, right) => {\n          return (right ?? [])\n            .map(columnId => allColumns.find(column => column.id === columnId)!)\n            .filter(Boolean)\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getRightLeafColumns',\n          debug: () => table.options.debugAll ?? table.options.debugColumns,\n        }\n      ),\n\n      getCenterLeafColumns: memo(\n        () => [\n          table.getAllLeafColumns(),\n          table.getState().columnPinning.left,\n          table.getState().columnPinning.right,\n        ],\n        (allColumns, left, right) => {\n          const leftAndRight: string[] = [...(left ?? []), ...(right ?? [])]\n\n          return allColumns.filter(d => !leftAndRight.includes(d.id))\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getCenterLeafColumns',\n          debug: () => table.options.debugAll ?? table.options.debugColumns,\n        }\n      ),\n    }\n  },\n}\n","import { TableFeature } from '../core/table'\nimport { OnChangeFn, Table, Row, RowModel, Updater, RowData } from '../types'\nimport { makeStateUpdater, memo } from '../utils'\n\nexport type RowSelectionState = Record\n\nexport interface RowSelectionTableState {\n  rowSelection: RowSelectionState\n}\n\nexport interface RowSelectionOptions {\n  enableRowSelection?: boolean | ((row: Row) => boolean)\n  enableMultiRowSelection?: boolean | ((row: Row) => boolean)\n  enableSubRowSelection?: boolean | ((row: Row) => boolean)\n  onRowSelectionChange?: OnChangeFn\n  // enableGroupingRowSelection?:\n  //   | boolean\n  //   | ((\n  //       row: Row\n  //     ) => boolean)\n  // isAdditiveSelectEvent?: (e: unknown) => boolean\n  // isInclusiveSelectEvent?: (e: unknown) => boolean\n  // selectRowsFn?: (\n  //   table: Table,\n  //   rowModel: RowModel\n  // ) => RowModel\n}\n\nexport interface RowSelectionRow {\n  getIsSelected: () => boolean\n  getIsSomeSelected: () => boolean\n  getIsAllSubRowsSelected: () => boolean\n  getCanSelect: () => boolean\n  getCanMultiSelect: () => boolean\n  getCanSelectSubRows: () => boolean\n  toggleSelected: (value?: boolean) => void\n  getToggleSelectedHandler: () => (event: unknown) => void\n}\n\nexport interface RowSelectionInstance {\n  getToggleAllRowsSelectedHandler: () => (event: unknown) => void\n  getToggleAllPageRowsSelectedHandler: () => (event: unknown) => void\n  setRowSelection: (updater: Updater) => void\n  resetRowSelection: (defaultState?: boolean) => void\n  getIsAllRowsSelected: () => boolean\n  getIsAllPageRowsSelected: () => boolean\n  getIsSomeRowsSelected: () => boolean\n  getIsSomePageRowsSelected: () => boolean\n  toggleAllRowsSelected: (value?: boolean) => void\n  toggleAllPageRowsSelected: (value?: boolean) => void\n  getPreSelectedRowModel: () => RowModel\n  getSelectedRowModel: () => RowModel\n  getFilteredSelectedRowModel: () => RowModel\n  getGroupedSelectedRowModel: () => RowModel\n}\n\n//\n\nexport const RowSelection: TableFeature = {\n  getInitialState: (state): RowSelectionTableState => {\n    return {\n      rowSelection: {},\n      ...state,\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): RowSelectionOptions => {\n    return {\n      onRowSelectionChange: makeStateUpdater('rowSelection', table),\n      enableRowSelection: true,\n      enableMultiRowSelection: true,\n      enableSubRowSelection: true,\n      // enableGroupingRowSelection: false,\n      // isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,\n      // isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): RowSelectionInstance => {\n    return {\n      setRowSelection: updater => table.options.onRowSelectionChange?.(updater),\n      resetRowSelection: defaultState =>\n        table.setRowSelection(\n          defaultState ? {} : table.initialState.rowSelection ?? {}\n        ),\n      toggleAllRowsSelected: value => {\n        table.setRowSelection(old => {\n          value =\n            typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected()\n\n          const rowSelection = { ...old }\n\n          const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows\n\n          // We don't use `mutateRowIsSelected` here for performance reasons.\n          // All of the rows are flat already, so it wouldn't be worth it\n          if (value) {\n            preGroupedFlatRows.forEach(row => {\n              if (!row.getCanSelect()) {\n                return\n              }\n              rowSelection[row.id] = true\n            })\n          } else {\n            preGroupedFlatRows.forEach(row => {\n              delete rowSelection[row.id]\n            })\n          }\n\n          return rowSelection\n        })\n      },\n      toggleAllPageRowsSelected: value =>\n        table.setRowSelection(old => {\n          const resolvedValue =\n            typeof value !== 'undefined'\n              ? value\n              : !table.getIsAllPageRowsSelected()\n\n          const rowSelection: RowSelectionState = { ...old }\n\n          table.getRowModel().rows.forEach(row => {\n            mutateRowIsSelected(rowSelection, row.id, resolvedValue, table)\n          })\n\n          return rowSelection\n        }),\n\n      // addRowSelectionRange: rowId => {\n      //   const {\n      //     rows,\n      //     rowsById,\n      //     options: { selectGroupingRows, selectSubRows },\n      //   } = table\n\n      //   const findSelectedRow = (rows: Row[]) => {\n      //     let found\n      //     rows.find(d => {\n      //       if (d.getIsSelected()) {\n      //         found = d\n      //         return true\n      //       }\n      //       const subFound = findSelectedRow(d.subRows || [])\n      //       if (subFound) {\n      //         found = subFound\n      //         return true\n      //       }\n      //       return false\n      //     })\n      //     return found\n      //   }\n\n      //   const firstRow = findSelectedRow(rows) || rows[0]\n      //   const lastRow = rowsById[rowId]\n\n      //   let include = false\n      //   const selectedRowIds = {}\n\n      //   const addRow = (row: Row) => {\n      //     mutateRowIsSelected(selectedRowIds, row.id, true, {\n      //       rowsById,\n      //       selectGroupingRows: selectGroupingRows!,\n      //       selectSubRows: selectSubRows!,\n      //     })\n      //   }\n\n      //   table.rows.forEach(row => {\n      //     const isFirstRow = row.id === firstRow.id\n      //     const isLastRow = row.id === lastRow.id\n\n      //     if (isFirstRow || isLastRow) {\n      //       if (!include) {\n      //         include = true\n      //       } else if (include) {\n      //         addRow(row)\n      //         include = false\n      //       }\n      //     }\n\n      //     if (include) {\n      //       addRow(row)\n      //     }\n      //   })\n\n      //   table.setRowSelection(selectedRowIds)\n      // },\n      getPreSelectedRowModel: () => table.getCoreRowModel(),\n      getSelectedRowModel: memo(\n        () => [table.getState().rowSelection, table.getCoreRowModel()],\n        (rowSelection, rowModel) => {\n          if (!Object.keys(rowSelection).length) {\n            return {\n              rows: [],\n              flatRows: [],\n              rowsById: {},\n            }\n          }\n\n          return selectRowsFn(table, rowModel)\n        },\n        {\n          key: process.env.NODE_ENV === 'development' && 'getSelectedRowModel',\n          debug: () => table.options.debugAll ?? table.options.debugTable,\n        }\n      ),\n\n      getFilteredSelectedRowModel: memo(\n        () => [table.getState().rowSelection, table.getFilteredRowModel()],\n        (rowSelection, rowModel) => {\n          if (!Object.keys(rowSelection).length) {\n            return {\n              rows: [],\n              flatRows: [],\n              rowsById: {},\n            }\n          }\n\n          return selectRowsFn(table, rowModel)\n        },\n        {\n          key:\n            process.env.NODE_ENV === 'production' &&\n            'getFilteredSelectedRowModel',\n          debug: () => table.options.debugAll ?? table.options.debugTable,\n        }\n      ),\n\n      getGroupedSelectedRowModel: memo(\n        () => [table.getState().rowSelection, table.getSortedRowModel()],\n        (rowSelection, rowModel) => {\n          if (!Object.keys(rowSelection).length) {\n            return {\n              rows: [],\n              flatRows: [],\n              rowsById: {},\n            }\n          }\n\n          return selectRowsFn(table, rowModel)\n        },\n        {\n          key:\n            process.env.NODE_ENV === 'production' &&\n            'getGroupedSelectedRowModel',\n          debug: () => table.options.debugAll ?? table.options.debugTable,\n        }\n      ),\n\n      ///\n\n      // getGroupingRowCanSelect: rowId => {\n      //   const row = table.getRow(rowId)\n\n      //   if (!row) {\n      //     throw new Error()\n      //   }\n\n      //   if (typeof table.options.enableGroupingRowSelection === 'function') {\n      //     return table.options.enableGroupingRowSelection(row)\n      //   }\n\n      //   return table.options.enableGroupingRowSelection ?? false\n      // },\n\n      getIsAllRowsSelected: () => {\n        const preGroupedFlatRows = table.getFilteredRowModel().flatRows\n        const { rowSelection } = table.getState()\n\n        let isAllRowsSelected = Boolean(\n          preGroupedFlatRows.length && Object.keys(rowSelection).length\n        )\n\n        if (isAllRowsSelected) {\n          if (\n            preGroupedFlatRows.some(\n              row => row.getCanSelect() && !rowSelection[row.id]\n            )\n          ) {\n            isAllRowsSelected = false\n          }\n        }\n\n        return isAllRowsSelected\n      },\n\n      getIsAllPageRowsSelected: () => {\n        const paginationFlatRows = table\n          .getPaginationRowModel()\n          .flatRows.filter(row => row.getCanSelect())\n        const { rowSelection } = table.getState()\n\n        let isAllPageRowsSelected = !!paginationFlatRows.length\n\n        if (\n          isAllPageRowsSelected &&\n          paginationFlatRows.some(row => !rowSelection[row.id])\n        ) {\n          isAllPageRowsSelected = false\n        }\n\n        return isAllPageRowsSelected\n      },\n\n      getIsSomeRowsSelected: () => {\n        const totalSelected = Object.keys(\n          table.getState().rowSelection ?? {}\n        ).length\n        return (\n          totalSelected > 0 &&\n          totalSelected < table.getFilteredRowModel().flatRows.length\n        )\n      },\n\n      getIsSomePageRowsSelected: () => {\n        const paginationFlatRows = table.getPaginationRowModel().flatRows\n        return table.getIsAllPageRowsSelected()\n          ? false\n          : paginationFlatRows\n              .filter(row => row.getCanSelect())\n              .some(d => d.getIsSelected() || d.getIsSomeSelected())\n      },\n\n      getToggleAllRowsSelectedHandler: () => {\n        return (e: unknown) => {\n          table.toggleAllRowsSelected(\n            ((e as MouseEvent).target as HTMLInputElement).checked\n          )\n        }\n      },\n\n      getToggleAllPageRowsSelectedHandler: () => {\n        return (e: unknown) => {\n          table.toggleAllPageRowsSelected(\n            ((e as MouseEvent).target as HTMLInputElement).checked\n          )\n        }\n      },\n    }\n  },\n\n  createRow: (\n    row: Row,\n    table: Table\n  ): RowSelectionRow => {\n    return {\n      toggleSelected: value => {\n        const isSelected = row.getIsSelected()\n\n        table.setRowSelection(old => {\n          value = typeof value !== 'undefined' ? value : !isSelected\n\n          if (isSelected === value) {\n            return old\n          }\n\n          const selectedRowIds = { ...old }\n\n          mutateRowIsSelected(selectedRowIds, row.id, value, table)\n\n          return selectedRowIds\n        })\n      },\n      getIsSelected: () => {\n        const { rowSelection } = table.getState()\n        return isRowSelected(row, rowSelection)\n      },\n\n      getIsSomeSelected: () => {\n        const { rowSelection } = table.getState()\n        return isSubRowSelected(row, rowSelection, table) === 'some'\n      },\n\n      getIsAllSubRowsSelected: () => {\n        const { rowSelection } = table.getState()\n        return isSubRowSelected(row, rowSelection, table) === 'all'\n      },\n\n      getCanSelect: () => {\n        if (typeof table.options.enableRowSelection === 'function') {\n          return table.options.enableRowSelection(row)\n        }\n\n        return table.options.enableRowSelection ?? true\n      },\n\n      getCanSelectSubRows: () => {\n        if (typeof table.options.enableSubRowSelection === 'function') {\n          return table.options.enableSubRowSelection(row)\n        }\n\n        return table.options.enableSubRowSelection ?? true\n      },\n\n      getCanMultiSelect: () => {\n        if (typeof table.options.enableMultiRowSelection === 'function') {\n          return table.options.enableMultiRowSelection(row)\n        }\n\n        return table.options.enableMultiRowSelection ?? true\n      },\n      getToggleSelectedHandler: () => {\n        const canSelect = row.getCanSelect()\n\n        return (e: unknown) => {\n          if (!canSelect) return\n          row.toggleSelected(\n            ((e as MouseEvent).target as HTMLInputElement)?.checked\n          )\n        }\n      },\n    }\n  },\n}\n\nconst mutateRowIsSelected = (\n  selectedRowIds: Record,\n  id: string,\n  value: boolean,\n  table: Table\n) => {\n  const row = table.getRow(id)\n\n  // const isGrouped = row.getIsGrouped()\n\n  // if ( // TODO: enforce grouping row selection rules\n  //   !isGrouped ||\n  //   (isGrouped && table.options.enableGroupingRowSelection)\n  // ) {\n  if (value) {\n    if (!row.getCanMultiSelect()) {\n      Object.keys(selectedRowIds).forEach(key => delete selectedRowIds[key])\n    }\n    if (row.getCanSelect()) {\n      selectedRowIds[id] = true\n    }\n  } else {\n    delete selectedRowIds[id]\n  }\n  // }\n\n  if (row.subRows?.length && row.getCanSelectSubRows()) {\n    row.subRows.forEach(row =>\n      mutateRowIsSelected(selectedRowIds, row.id, value, table)\n    )\n  }\n}\n\nexport function selectRowsFn(\n  table: Table,\n  rowModel: RowModel\n): RowModel {\n  const rowSelection = table.getState().rowSelection\n\n  const newSelectedFlatRows: Row[] = []\n  const newSelectedRowsById: Record> = {}\n\n  // Filters top level and nested rows\n  const recurseRows = (rows: Row[], depth = 0): Row[] => {\n    return rows\n      .map(row => {\n        const isSelected = isRowSelected(row, rowSelection)\n\n        if (isSelected) {\n          newSelectedFlatRows.push(row)\n          newSelectedRowsById[row.id] = row\n        }\n\n        if (row.subRows?.length) {\n          row = {\n            ...row,\n            subRows: recurseRows(row.subRows, depth + 1),\n          }\n        }\n\n        if (isSelected) {\n          return row\n        }\n      })\n      .filter(Boolean) as Row[]\n  }\n\n  return {\n    rows: recurseRows(rowModel.rows),\n    flatRows: newSelectedFlatRows,\n    rowsById: newSelectedRowsById,\n  }\n}\n\nexport function isRowSelected(\n  row: Row,\n  selection: Record\n): boolean {\n  return selection[row.id] ?? false\n}\n\nexport function isSubRowSelected(\n  row: Row,\n  selection: Record,\n  table: Table\n): boolean | 'some' | 'all' {\n  if (row.subRows && row.subRows.length) {\n    let allChildrenSelected = true\n    let someSelected = false\n\n    row.subRows.forEach(subRow => {\n      // Bail out early if we know both of these\n      if (someSelected && !allChildrenSelected) {\n        return\n      }\n\n      if (isRowSelected(subRow, selection)) {\n        someSelected = true\n      } else {\n        allChildrenSelected = false\n      }\n    })\n\n    return allChildrenSelected ? 'all' : someSelected ? 'some' : false\n  }\n\n  return false\n}\n","import { SortingFn } from './features/Sorting'\n\nexport const reSplitAlphaNumeric = /([0-9]+)/gm\n\nconst alphanumeric: SortingFn = (rowA, rowB, columnId) => {\n  return compareAlphanumeric(\n    toString(rowA.getValue(columnId)).toLowerCase(),\n    toString(rowB.getValue(columnId)).toLowerCase()\n  )\n}\n\nconst alphanumericCaseSensitive: SortingFn = (rowA, rowB, columnId) => {\n  return compareAlphanumeric(\n    toString(rowA.getValue(columnId)),\n    toString(rowB.getValue(columnId))\n  )\n}\n\n// The text filter is more basic (less numeric support)\n// but is much faster\nconst text: SortingFn = (rowA, rowB, columnId) => {\n  return compareBasic(\n    toString(rowA.getValue(columnId)).toLowerCase(),\n    toString(rowB.getValue(columnId)).toLowerCase()\n  )\n}\n\n// The text filter is more basic (less numeric support)\n// but is much faster\nconst textCaseSensitive: SortingFn = (rowA, rowB, columnId) => {\n  return compareBasic(\n    toString(rowA.getValue(columnId)),\n    toString(rowB.getValue(columnId))\n  )\n}\n\nconst datetime: SortingFn = (rowA, rowB, columnId) => {\n  const a = rowA.getValue(columnId)\n  const b = rowB.getValue(columnId)\n\n  // Can handle nullish values\n  // Use > and < because == (and ===) doesn't work with\n  // Date objects (would require calling getTime()).\n  return a > b ? 1 : a < b ? -1 : 0\n}\n\nconst basic: SortingFn = (rowA, rowB, columnId) => {\n  return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId))\n}\n\n// Utils\n\nfunction compareBasic(a: any, b: any) {\n  return a === b ? 0 : a > b ? 1 : -1\n}\n\nfunction toString(a: any) {\n  if (typeof a === 'number') {\n    if (isNaN(a) || a === Infinity || a === -Infinity) {\n      return ''\n    }\n    return String(a)\n  }\n  if (typeof a === 'string') {\n    return a\n  }\n  return ''\n}\n\n// Mixed sorting is slow, but very inclusive of many edge cases.\n// It handles numbers, mixed alphanumeric combinations, and even\n// null, undefined, and Infinity\nfunction compareAlphanumeric(aStr: string, bStr: string) {\n  // Split on number groups, but keep the delimiter\n  // Then remove falsey split values\n  const a = aStr.split(reSplitAlphaNumeric).filter(Boolean)\n  const b = bStr.split(reSplitAlphaNumeric).filter(Boolean)\n\n  // While\n  while (a.length && b.length) {\n    const aa = a.shift()!\n    const bb = b.shift()!\n\n    const an = parseInt(aa, 10)\n    const bn = parseInt(bb, 10)\n\n    const combo = [an, bn].sort()\n\n    // Both are string\n    if (isNaN(combo[0]!)) {\n      if (aa > bb) {\n        return 1\n      }\n      if (bb > aa) {\n        return -1\n      }\n      continue\n    }\n\n    // One is a string, one is a number\n    if (isNaN(combo[1]!)) {\n      return isNaN(an) ? -1 : 1\n    }\n\n    // Both are numbers\n    if (an > bn) {\n      return 1\n    }\n    if (bn > an) {\n      return -1\n    }\n  }\n\n  return a.length - b.length\n}\n\n// Exports\n\nexport const sortingFns = {\n  alphanumeric,\n  alphanumericCaseSensitive,\n  text,\n  textCaseSensitive,\n  datetime,\n  basic,\n}\n\nexport type BuiltInSortingFn = keyof typeof sortingFns\n","import { RowModel } from '..'\nimport { TableFeature } from '../core/table'\nimport {\n  BuiltInSortingFn,\n  reSplitAlphaNumeric,\n  sortingFns,\n} from '../sortingFns'\n\nimport {\n  Column,\n  OnChangeFn,\n  Table,\n  Row,\n  Updater,\n  RowData,\n  SortingFns,\n} from '../types'\n\nimport { isFunction, makeStateUpdater } from '../utils'\n\nexport type SortDirection = 'asc' | 'desc'\n\nexport interface ColumnSort {\n  id: string\n  desc: boolean\n}\n\nexport type SortingState = ColumnSort[]\n\nexport interface SortingTableState {\n  sorting: SortingState\n}\n\nexport interface SortingFn {\n  (rowA: Row, rowB: Row, columnId: string): number\n}\n\nexport type CustomSortingFns = Record<\n  string,\n  SortingFn\n>\n\nexport type SortingFnOption =\n  | 'auto'\n  | keyof SortingFns\n  | BuiltInSortingFn\n  | SortingFn\n\nexport interface SortingColumnDef {\n  sortingFn?: SortingFnOption\n  sortDescFirst?: boolean\n  enableSorting?: boolean\n  enableMultiSort?: boolean\n  invertSorting?: boolean\n  sortUndefined?: false | -1 | 1\n}\n\nexport interface SortingColumn {\n  getAutoSortingFn: () => SortingFn\n  getAutoSortDir: () => SortDirection\n  getSortingFn: () => SortingFn\n  getFirstSortDir: () => SortDirection\n  getNextSortingOrder: () => SortDirection | false\n  getCanSort: () => boolean\n  getCanMultiSort: () => boolean\n  getSortIndex: () => number\n  getIsSorted: () => false | SortDirection\n  clearSorting: () => void\n  toggleSorting: (desc?: boolean, isMulti?: boolean) => void\n  getToggleSortingHandler: () => undefined | ((event: unknown) => void)\n}\n\ninterface SortingOptionsBase {\n  manualSorting?: boolean\n  onSortingChange?: OnChangeFn\n  enableSorting?: boolean\n  enableSortingRemoval?: boolean\n  enableMultiRemove?: boolean\n  enableMultiSort?: boolean\n  sortDescFirst?: boolean\n  getSortedRowModel?: (table: Table) => () => RowModel\n  maxMultiSortColCount?: number\n  isMultiSortEvent?: (e: unknown) => boolean\n}\n\ntype ResolvedSortingFns = keyof SortingFns extends never\n  ? {\n      sortingFns?: Record>\n    }\n  : {\n      sortingFns: Record>\n    }\n\nexport interface SortingOptions\n  extends SortingOptionsBase,\n    ResolvedSortingFns {}\n\nexport interface SortingInstance {\n  setSorting: (updater: Updater) => void\n  resetSorting: (defaultState?: boolean) => void\n  getPreSortedRowModel: () => RowModel\n  getSortedRowModel: () => RowModel\n  _getSortedRowModel?: () => RowModel\n}\n\n//\n\nexport const Sorting: TableFeature = {\n  getInitialState: (state): SortingTableState => {\n    return {\n      sorting: [],\n      ...state,\n    }\n  },\n\n  getDefaultColumnDef: (): SortingColumnDef => {\n    return {\n      sortingFn: 'auto',\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): SortingOptions => {\n    return {\n      onSortingChange: makeStateUpdater('sorting', table),\n      isMultiSortEvent: (e: unknown) => {\n        return (e as MouseEvent).shiftKey\n      },\n    }\n  },\n\n  createColumn: (\n    column: Column,\n    table: Table\n  ): SortingColumn => {\n    return {\n      getAutoSortingFn: () => {\n        const firstRows = table.getFilteredRowModel().flatRows.slice(10)\n\n        let isString = false\n\n        for (const row of firstRows) {\n          const value = row?.getValue(column.id)\n\n          if (Object.prototype.toString.call(value) === '[object Date]') {\n            return sortingFns.datetime\n          }\n\n          if (typeof value === 'string') {\n            isString = true\n\n            if (value.split(reSplitAlphaNumeric).length > 1) {\n              return sortingFns.alphanumeric\n            }\n          }\n        }\n\n        if (isString) {\n          return sortingFns.text\n        }\n\n        return sortingFns.basic\n      },\n      getAutoSortDir: () => {\n        const firstRow = table.getFilteredRowModel().flatRows[0]\n\n        const value = firstRow?.getValue(column.id)\n\n        if (typeof value === 'string') {\n          return 'asc'\n        }\n\n        return 'desc'\n      },\n      getSortingFn: () => {\n        if (!column) {\n          throw new Error()\n        }\n\n        return isFunction(column.columnDef.sortingFn)\n          ? column.columnDef.sortingFn\n          : column.columnDef.sortingFn === 'auto'\n          ? column.getAutoSortingFn()\n          : table.options.sortingFns?.[column.columnDef.sortingFn as string] ??\n            sortingFns[column.columnDef.sortingFn as BuiltInSortingFn]\n      },\n      toggleSorting: (desc, multi) => {\n        // if (column.columns.length) {\n        //   column.columns.forEach((c, i) => {\n        //     if (c.id) {\n        //       table.toggleColumnSorting(c.id, undefined, multi || !!i)\n        //     }\n        //   })\n        //   return\n        // }\n\n        // this needs to be outside of table.setSorting to be in sync with rerender\n        const nextSortingOrder = column.getNextSortingOrder()\n        const hasManualValue = typeof desc !== 'undefined' && desc !== null\n\n        table.setSorting(old => {\n          // Find any existing sorting for this column\n          const existingSorting = old?.find(d => d.id === column.id)\n          const existingIndex = old?.findIndex(d => d.id === column.id)\n\n          let newSorting: SortingState = []\n\n          // What should we do with this sort action?\n          let sortAction: 'add' | 'remove' | 'toggle' | 'replace'\n          let nextDesc = hasManualValue ? desc : nextSortingOrder === 'desc'\n\n          // Multi-mode\n          if (old?.length && column.getCanMultiSort() && multi) {\n            if (existingSorting) {\n              sortAction = 'toggle'\n            } else {\n              sortAction = 'add'\n            }\n          } else {\n            // Normal mode\n            if (old?.length && existingIndex !== old.length - 1) {\n              sortAction = 'replace'\n            } else if (existingSorting) {\n              sortAction = 'toggle'\n            } else {\n              sortAction = 'replace'\n            }\n          }\n\n          // Handle toggle states that will remove the sorting\n          if (sortAction === 'toggle') {\n            // If we are \"actually\" toggling (not a manual set value), should we remove the sorting?\n            if (!hasManualValue) {\n              // Is our intention to remove?\n              if (!nextSortingOrder) {\n                sortAction = 'remove'\n              }\n            }\n          }\n\n          if (sortAction === 'add') {\n            newSorting = [\n              ...old,\n              {\n                id: column.id,\n                desc: nextDesc,\n              },\n            ]\n            // Take latest n columns\n            newSorting.splice(\n              0,\n              newSorting.length -\n                (table.options.maxMultiSortColCount ?? Number.MAX_SAFE_INTEGER)\n            )\n          } else if (sortAction === 'toggle') {\n            // This flips (or sets) the\n            newSorting = old.map(d => {\n              if (d.id === column.id) {\n                return {\n                  ...d,\n                  desc: nextDesc,\n                }\n              }\n              return d\n            })\n          } else if (sortAction === 'remove') {\n            newSorting = old.filter(d => d.id !== column.id)\n          } else {\n            newSorting = [\n              {\n                id: column.id,\n                desc: nextDesc,\n              },\n            ]\n          }\n\n          return newSorting\n        })\n      },\n\n      getFirstSortDir: () => {\n        const sortDescFirst =\n          column.columnDef.sortDescFirst ??\n          table.options.sortDescFirst ??\n          column.getAutoSortDir() === 'desc'\n        return sortDescFirst ? 'desc' : 'asc'\n      },\n\n      getNextSortingOrder: (multi?: boolean) => {\n        const firstSortDirection = column.getFirstSortDir()\n        const isSorted = column.getIsSorted()\n\n        if (!isSorted) {\n          return firstSortDirection\n        }\n\n        if (\n          isSorted !== firstSortDirection &&\n          (table.options.enableSortingRemoval ?? true) && // If enableSortRemove, enable in general\n          (multi ? table.options.enableMultiRemove ?? true : true) // If multi, don't allow if enableMultiRemove))\n        ) {\n          return false\n        }\n        return isSorted === 'desc' ? 'asc' : 'desc'\n      },\n\n      getCanSort: () => {\n        return (\n          (column.columnDef.enableSorting ?? true) &&\n          (table.options.enableSorting ?? true) &&\n          !!column.accessorFn\n        )\n      },\n\n      getCanMultiSort: () => {\n        return (\n          column.columnDef.enableMultiSort ??\n          table.options.enableMultiSort ??\n          !!column.accessorFn\n        )\n      },\n\n      getIsSorted: () => {\n        const columnSort = table\n          .getState()\n          .sorting?.find(d => d.id === column.id)\n\n        return !columnSort ? false : columnSort.desc ? 'desc' : 'asc'\n      },\n\n      getSortIndex: () =>\n        table.getState().sorting?.findIndex(d => d.id === column.id) ?? -1,\n\n      clearSorting: () => {\n        //clear sorting for just 1 column\n        table.setSorting(old =>\n          old?.length ? old.filter(d => d.id !== column.id) : []\n        )\n      },\n\n      getToggleSortingHandler: () => {\n        const canSort = column.getCanSort()\n\n        return (e: unknown) => {\n          if (!canSort) return\n          ;(e as any).persist?.()\n          column.toggleSorting?.(\n            undefined,\n            column.getCanMultiSort()\n              ? table.options.isMultiSortEvent?.(e)\n              : false\n          )\n        }\n      },\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): SortingInstance => {\n    return {\n      setSorting: updater => table.options.onSortingChange?.(updater),\n      resetSorting: defaultState => {\n        table.setSorting(defaultState ? [] : table.initialState?.sorting ?? [])\n      },\n      getPreSortedRowModel: () => table.getGroupedRowModel(),\n      getSortedRowModel: () => {\n        if (!table._getSortedRowModel && table.options.getSortedRowModel) {\n          table._getSortedRowModel = table.options.getSortedRowModel(table)\n        }\n\n        if (table.options.manualSorting || !table._getSortedRowModel) {\n          return table.getPreSortedRowModel()\n        }\n\n        return table._getSortedRowModel()\n      },\n    }\n  },\n}\n","import { TableFeature } from '../core/table'\nimport {\n  Cell,\n  Column,\n  OnChangeFn,\n  Table,\n  Updater,\n  Row,\n  RowData,\n} from '../types'\nimport { makeStateUpdater, memo } from '../utils'\n\nexport type VisibilityState = Record\n\nexport interface VisibilityTableState {\n  columnVisibility: VisibilityState\n}\n\nexport interface VisibilityOptions {\n  onColumnVisibilityChange?: OnChangeFn\n  enableHiding?: boolean\n}\n\nexport interface VisibilityDefaultOptions {\n  onColumnVisibilityChange: OnChangeFn\n}\n\nexport interface VisibilityInstance {\n  getVisibleFlatColumns: () => Column[]\n  getVisibleLeafColumns: () => Column[]\n  getLeftVisibleLeafColumns: () => Column[]\n  getRightVisibleLeafColumns: () => Column[]\n  getCenterVisibleLeafColumns: () => Column[]\n  setColumnVisibility: (updater: Updater) => void\n  resetColumnVisibility: (defaultState?: boolean) => void\n  toggleAllColumnsVisible: (value?: boolean) => void\n  getIsAllColumnsVisible: () => boolean\n  getIsSomeColumnsVisible: () => boolean\n  getToggleAllColumnsVisibilityHandler: () => (event: unknown) => void\n}\n\nexport interface VisibilityColumnDef {\n  enableHiding?: boolean\n}\n\nexport interface VisibilityRow {\n  _getAllVisibleCells: () => Cell[]\n  getVisibleCells: () => Cell[]\n}\n\nexport interface VisibilityColumn {\n  getCanHide: () => boolean\n  getIsVisible: () => boolean\n  toggleVisibility: (value?: boolean) => void\n  getToggleVisibilityHandler: () => (event: unknown) => void\n}\n\n//\n\nexport const Visibility: TableFeature = {\n  getInitialState: (state): VisibilityTableState => {\n    return {\n      columnVisibility: {},\n      ...state,\n    }\n  },\n\n  getDefaultOptions: (\n    table: Table\n  ): VisibilityDefaultOptions => {\n    return {\n      onColumnVisibilityChange: makeStateUpdater('columnVisibility', table),\n    }\n  },\n\n  createColumn: (\n    column: Column,\n    table: Table\n  ): VisibilityColumn => {\n    return {\n      toggleVisibility: value => {\n        if (column.getCanHide()) {\n          table.setColumnVisibility(old => ({\n            ...old,\n            [column.id]: value ?? !column.getIsVisible(),\n          }))\n        }\n      },\n      getIsVisible: () => {\n        return table.getState().columnVisibility?.[column.id] ?? true\n      },\n\n      getCanHide: () => {\n        return (\n          (column.columnDef.enableHiding ?? true) &&\n          (table.options.enableHiding ?? true)\n        )\n      },\n      getToggleVisibilityHandler: () => {\n        return (e: unknown) => {\n          column.toggleVisibility?.(\n            ((e as MouseEvent).target as HTMLInputElement).checked\n          )\n        }\n      },\n    }\n  },\n\n  createRow: (\n    row: Row,\n    table: Table\n  ): VisibilityRow => {\n    return {\n      _getAllVisibleCells: memo(\n        () => [row.getAllCells(), table.getState().columnVisibility],\n        cells => {\n          return cells.filter(cell => cell.column.getIsVisible())\n        },\n        {\n          key:\n            process.env.NODE_ENV === 'production' && 'row._getAllVisibleCells',\n          debug: () => table.options.debugAll ?? table.options.debugRows,\n        }\n      ),\n      getVisibleCells: memo(\n        () => [\n          row.getLeftVisibleCells(),\n          row.getCenterVisibleCells(),\n          row.getRightVisibleCells(),\n        ],\n        (left, center, right) => [...left, ...center, ...right],\n        {\n          key: process.env.NODE_ENV === 'development' && 'row.getVisibleCells',\n          debug: () => table.options.debugAll ?? table.options.debugRows,\n        }\n      ),\n    }\n  },\n\n  createTable: (\n    table: Table\n  ): VisibilityInstance => {\n    const makeVisibleColumnsMethod = (\n      key: string,\n      getColumns: () => Column[]\n    ): (() => Column[]) => {\n      return memo(\n        () => [\n          getColumns(),\n          getColumns()\n            .filter(d => d.getIsVisible())\n            .map(d => d.id)\n            .join('_'),\n        ],\n        columns => {\n          return columns.filter(d => d.getIsVisible?.())\n        },\n        {\n          key,\n          debug: () => table.options.debugAll ?? table.options.debugColumns,\n        }\n      )\n    }\n\n    return {\n      getVisibleFlatColumns: makeVisibleColumnsMethod(\n        'getVisibleFlatColumns',\n        () => table.getAllFlatColumns()\n      ),\n      getVisibleLeafColumns: makeVisibleColumnsMethod(\n        'getVisibleLeafColumns',\n        () => table.getAllLeafColumns()\n      ),\n      getLeftVisibleLeafColumns: makeVisibleColumnsMethod(\n        'getLeftVisibleLeafColumns',\n        () => table.getLeftLeafColumns()\n      ),\n      getRightVisibleLeafColumns: makeVisibleColumnsMethod(\n        'getRightVisibleLeafColumns',\n        () => table.getRightLeafColumns()\n      ),\n      getCenterVisibleLeafColumns: makeVisibleColumnsMethod(\n        'getCenterVisibleLeafColumns',\n        () => table.getCenterLeafColumns()\n      ),\n\n      setColumnVisibility: updater =>\n        table.options.onColumnVisibilityChange?.(updater),\n\n      resetColumnVisibility: defaultState => {\n        table.setColumnVisibility(\n          defaultState ? {} : table.initialState.columnVisibility ?? {}\n        )\n      },\n\n      toggleAllColumnsVisible: value => {\n        value = value ?? !table.getIsAllColumnsVisible()\n\n        table.setColumnVisibility(\n          table.getAllLeafColumns().reduce(\n            (obj, column) => ({\n              ...obj,\n              [column.id]: !value ? !column.getCanHide?.() : value,\n            }),\n            {}\n          )\n        )\n      },\n\n      getIsAllColumnsVisible: () =>\n        !table.getAllLeafColumns().some(column => !column.getIsVisible?.()),\n\n      getIsSomeColumnsVisible: () =>\n        table.getAllLeafColumns().some(column => column.getIsVisible?.()),\n\n      getToggleAllColumnsVisibilityHandler: () => {\n        return (e: unknown) => {\n          table.toggleAllColumnsVisible(\n            ((e as MouseEvent).target as HTMLInputElement)?.checked\n          )\n        }\n      },\n    }\n  },\n}\n","import { functionalUpdate, memo, RequiredKeys } from '../utils'\n\nimport {\n  Updater,\n  TableOptionsResolved,\n  TableState,\n  Table,\n  InitialTableState,\n  Row,\n  Column,\n  RowModel,\n  ColumnDef,\n  TableOptions,\n  RowData,\n  TableMeta,\n  ColumnDefResolved,\n  GroupColumnDef,\n} from '../types'\n\n//\nimport { createColumn } from './column'\nimport { Headers } from './headers'\n//\n\nimport { ColumnSizing } from '../features/ColumnSizing'\nimport { Expanding } from '../features/Expanding'\nimport { Filters } from '../features/Filters'\nimport { Grouping } from '../features/Grouping'\nimport { Ordering } from '../features/Ordering'\nimport { Pagination } from '../features/Pagination'\nimport { Pinning } from '../features/Pinning'\nimport { RowSelection } from '../features/RowSelection'\nimport { Sorting } from '../features/Sorting'\nimport { Visibility } from '../features/Visibility'\n\nexport interface TableFeature {\n  getDefaultOptions?: (table: any) => any\n  getInitialState?: (initialState?: InitialTableState) => any\n  createTable?: (table: any) => any\n  getDefaultColumnDef?: () => any\n  createColumn?: (column: any, table: any) => any\n  createHeader?: (column: any, table: any) => any\n  createCell?: (cell: any, column: any, row: any, table: any) => any\n  createRow?: (row: any, table: any) => any\n}\n\nconst features = [\n  Headers,\n  Visibility,\n  Ordering,\n  Pinning,\n  Filters,\n  Sorting,\n  Grouping,\n  Expanding,\n  Pagination,\n  RowSelection,\n  ColumnSizing,\n] as const\n\n//\n\nexport interface CoreTableState {}\n\nexport interface CoreOptions {\n  data: TData[]\n  state: Partial\n  onStateChange: (updater: Updater) => void\n  debugAll?: boolean\n  debugTable?: boolean\n  debugHeaders?: boolean\n  debugColumns?: boolean\n  debugRows?: boolean\n  initialState?: InitialTableState\n  autoResetAll?: boolean\n  mergeOptions?: (\n    defaultOptions: TableOptions,\n    options: Partial>\n  ) => TableOptions\n  meta?: TableMeta\n  getCoreRowModel: (table: Table) => () => RowModel\n  getSubRows?: (originalRow: TData, index: number) => undefined | TData[]\n  getRowId?: (originalRow: TData, index: number, parent?: Row) => string\n  columns: ColumnDef[]\n  defaultColumn?: Partial>\n  renderFallbackValue: any\n}\n\nexport interface CoreInstance {\n  initialState: TableState\n  reset: () => void\n  options: RequiredKeys, 'state'>\n  setOptions: (newOptions: Updater>) => void\n  getState: () => TableState\n  setState: (updater: Updater) => void\n  _features: readonly TableFeature[]\n  _queue: (cb: () => void) => void\n  _getRowId: (_: TData, index: number, parent?: Row) => string\n  getCoreRowModel: () => RowModel\n  _getCoreRowModel?: () => RowModel\n  getRowModel: () => RowModel\n  getRow: (id: string) => Row\n  _getDefaultColumnDef: () => Partial>\n  _getColumnDefs: () => ColumnDef[]\n  _getAllFlatColumnsById: () => Record>\n  getAllColumns: () => Column[]\n  getAllFlatColumns: () => Column[]\n  getAllLeafColumns: () => Column[]\n  getColumn: (columnId: string) => Column | undefined\n}\n\nexport function createTable(\n  options: TableOptionsResolved\n): Table {\n  if (options.debugAll || options.debugTable) {\n    console.info('Creating Table Instance...')\n  }\n\n  let table = { _features: features } as unknown as Table\n\n  const defaultOptions = table._features.reduce((obj, feature) => {\n    return Object.assign(obj, feature.getDefaultOptions?.(table))\n  }, {}) as TableOptionsResolved\n\n  const mergeOptions = (options: TableOptionsResolved) => {\n    if (table.options.mergeOptions) {\n      return table.options.mergeOptions(defaultOptions, options)\n    }\n\n    return {\n      ...defaultOptions,\n      ...options,\n    }\n  }\n\n  const coreInitialState: CoreTableState = {}\n\n  let initialState = {\n    ...coreInitialState,\n    ...(options.initialState ?? {}),\n  } as TableState\n\n  table._features.forEach(feature => {\n    initialState = feature.getInitialState?.(initialState) ?? initialState\n  })\n\n  const queued: (() => void)[] = []\n  let queuedTimeout = false\n\n  const coreInstance: CoreInstance = {\n    _features: features,\n    options: {\n      ...defaultOptions,\n      ...options,\n    },\n    initialState,\n    _queue: cb => {\n      queued.push(cb)\n\n      if (!queuedTimeout) {\n        queuedTimeout = true\n\n        // Schedule a microtask to run the queued callbacks after\n        // the current call stack (render, etc) has finished.\n        Promise.resolve()\n          .then(() => {\n            while (queued.length) {\n              queued.shift()!()\n            }\n            queuedTimeout = false\n          })\n          .catch(error =>\n            setTimeout(() => {\n              throw error\n            })\n          )\n      }\n    },\n    reset: () => {\n      table.setState(table.initialState)\n    },\n    setOptions: updater => {\n      const newOptions = functionalUpdate(updater, table.options)\n      table.options = mergeOptions(newOptions) as RequiredKeys<\n        TableOptionsResolved,\n        'state'\n      >\n    },\n\n    getState: () => {\n      return table.options.state as TableState\n    },\n\n    setState: (updater: Updater) => {\n      table.options.onStateChange?.(updater)\n    },\n\n    _getRowId: (row: TData, index: number, parent?: Row) =>\n      table.options.getRowId?.(row, index, parent) ??\n      `${parent ? [parent.id, index].join('.') : index}`,\n\n    getCoreRowModel: () => {\n      if (!table._getCoreRowModel) {\n        table._getCoreRowModel = table.options.getCoreRowModel(table)\n      }\n\n      return table._getCoreRowModel!()\n    },\n\n    // The final calls start at the bottom of the model,\n    // expanded rows, which then work their way up\n\n    getRowModel: () => {\n      return table.getPaginationRowModel()\n    },\n    getRow: (id: string) => {\n      const row = table.getRowModel().rowsById[id]\n\n      if (!row) {\n        if (process.env.NODE_ENV !== 'production') {\n          throw new Error(`getRow expected an ID, but got ${id}`)\n        }\n        throw new Error()\n      }\n\n      return row\n    },\n    _getDefaultColumnDef: memo(\n      () => [table.options.defaultColumn],\n      defaultColumn => {\n        defaultColumn = (defaultColumn ?? {}) as Partial<\n          ColumnDef\n        >\n\n        return {\n          header: props => {\n            const resolvedColumnDef = props.header.column\n              .columnDef as ColumnDefResolved\n\n            if (resolvedColumnDef.accessorKey) {\n              return resolvedColumnDef.accessorKey\n            }\n\n            if (resolvedColumnDef.accessorFn) {\n              return resolvedColumnDef.id\n            }\n\n            return null\n          },\n          // footer: props => props.header.column.id,\n          cell: props => props.renderValue()?.toString?.() ?? null,\n          ...table._features.reduce((obj, feature) => {\n            return Object.assign(obj, feature.getDefaultColumnDef?.())\n          }, {}),\n          ...defaultColumn,\n        } as Partial>\n      },\n      {\n        debug: () => table.options.debugAll ?? table.options.debugColumns,\n        key: process.env.NODE_ENV === 'development' && 'getDefaultColumnDef',\n      }\n    ),\n\n    _getColumnDefs: () => table.options.columns,\n\n    getAllColumns: memo(\n      () => [table._getColumnDefs()],\n      columnDefs => {\n        const recurseColumns = (\n          columnDefs: ColumnDef[],\n          parent?: Column,\n          depth = 0\n        ): Column[] => {\n          return columnDefs.map(columnDef => {\n            const column = createColumn(table, columnDef, depth, parent)\n\n            const groupingColumnDef = columnDef as GroupColumnDef<\n              TData,\n              unknown\n            >\n\n            column.columns = groupingColumnDef.columns\n              ? recurseColumns(groupingColumnDef.columns, column, depth + 1)\n              : []\n\n            return column\n          })\n        }\n\n        return recurseColumns(columnDefs)\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getAllColumns',\n        debug: () => table.options.debugAll ?? table.options.debugColumns,\n      }\n    ),\n\n    getAllFlatColumns: memo(\n      () => [table.getAllColumns()],\n      allColumns => {\n        return allColumns.flatMap(column => {\n          return column.getFlatColumns()\n        })\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getAllFlatColumns',\n        debug: () => table.options.debugAll ?? table.options.debugColumns,\n      }\n    ),\n\n    _getAllFlatColumnsById: memo(\n      () => [table.getAllFlatColumns()],\n      flatColumns => {\n        return flatColumns.reduce((acc, column) => {\n          acc[column.id] = column\n          return acc\n        }, {} as Record>)\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getAllFlatColumnsById',\n        debug: () => table.options.debugAll ?? table.options.debugColumns,\n      }\n    ),\n\n    getAllLeafColumns: memo(\n      () => [table.getAllColumns(), table._getOrderColumnsFn()],\n      (allColumns, orderColumns) => {\n        let leafColumns = allColumns.flatMap(column => column.getLeafColumns())\n        return orderColumns(leafColumns)\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getAllLeafColumns',\n        debug: () => table.options.debugAll ?? table.options.debugColumns,\n      }\n    ),\n\n    getColumn: columnId => {\n      const column = table._getAllFlatColumnsById()[columnId]\n\n      if (process.env.NODE_ENV !== 'production' && !column) {\n        console.error(`[Table] Column with id '${columnId}' does not exist.`)\n      }\n\n      return column\n    },\n  }\n\n  Object.assign(table, coreInstance)\n\n  table._features.forEach(feature => {\n    return Object.assign(table, feature.createTable?.(table))\n  })\n\n  return table\n}\n","import { RowData, Cell, Column, Row, Table } from '../types'\nimport { Getter, memo } from '../utils'\n\nexport interface CellContext {\n  table: Table\n  column: Column\n  row: Row\n  cell: Cell\n  getValue: Getter\n  renderValue: Getter\n}\n\nexport interface CoreCell {\n  id: string\n  getValue: CellContext['getValue']\n  renderValue: CellContext['renderValue']\n  row: Row\n  column: Column\n  getContext: () => CellContext\n}\n\nexport function createCell(\n  table: Table,\n  row: Row,\n  column: Column,\n  columnId: string\n): Cell {\n  const getRenderValue = () =>\n    cell.getValue() ?? table.options.renderFallbackValue\n\n  const cell: CoreCell = {\n    id: `${row.id}_${column.id}`,\n    row,\n    column,\n    getValue: () => row.getValue(columnId),\n    renderValue: getRenderValue,\n    getContext: memo(\n      () => [table, column, row, cell],\n      (table, column, row, cell) => ({\n        table,\n        column,\n        row,\n        cell: cell as Cell,\n        getValue: cell.getValue,\n        renderValue: cell.renderValue,\n      }),\n      {\n        key: process.env.NODE_ENV === 'development' && 'cell.getContext',\n        debug: () => table.options.debugAll,\n      }\n    ),\n  }\n\n  table._features.forEach(feature => {\n    Object.assign(\n      cell,\n      feature.createCell?.(\n        cell as Cell,\n        column,\n        row as Row,\n        table\n      )\n    )\n  }, {})\n\n  return cell as Cell\n}\n","import { RowData, Cell, Row, Table } from '../types'\nimport { flattenBy, memo } from '../utils'\nimport { createCell } from './cell'\n\nexport interface CoreRow {\n  id: string\n  index: number\n  original: TData\n  depth: number\n  parentId?: string\n  _valuesCache: Record\n  _uniqueValuesCache: Record\n  getValue: (columnId: string) => TValue\n  getUniqueValues: (columnId: string) => TValue[]\n  renderValue: (columnId: string) => TValue\n  subRows: Row[]\n  getLeafRows: () => Row[]\n  originalSubRows?: TData[]\n  getAllCells: () => Cell[]\n  _getAllCellsByColumnId: () => Record>\n  getParentRow: () => Row | undefined\n  getParentRows: () => Row[]\n}\n\nexport const createRow = (\n  table: Table,\n  id: string,\n  original: TData,\n  rowIndex: number,\n  depth: number,\n  subRows?: Row[],\n  parentId?: string\n): Row => {\n  let row: CoreRow = {\n    id,\n    index: rowIndex,\n    original,\n    depth,\n    parentId,\n    _valuesCache: {},\n    _uniqueValuesCache: {},\n    getValue: columnId => {\n      if (row._valuesCache.hasOwnProperty(columnId)) {\n        return row._valuesCache[columnId]\n      }\n\n      const column = table.getColumn(columnId)\n\n      if (!column?.accessorFn) {\n        return undefined\n      }\n\n      row._valuesCache[columnId] = column.accessorFn(\n        row.original as TData,\n        rowIndex\n      )\n\n      return row._valuesCache[columnId] as any\n    },\n    getUniqueValues: columnId => {\n      if (row._uniqueValuesCache.hasOwnProperty(columnId)) {\n        return row._uniqueValuesCache[columnId]\n      }\n\n      const column = table.getColumn(columnId)\n\n      if (!column?.accessorFn) {\n        return undefined\n      }\n\n      if (!column.columnDef.getUniqueValues) {\n        row._uniqueValuesCache[columnId] = [row.getValue(columnId)]\n        return row._uniqueValuesCache[columnId]\n      }\n\n      row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(\n        row.original as TData,\n        rowIndex\n      )\n\n      return row._uniqueValuesCache[columnId] as any\n    },\n    renderValue: columnId =>\n      row.getValue(columnId) ?? table.options.renderFallbackValue,\n    subRows: subRows ?? [],\n    getLeafRows: () => flattenBy(row.subRows, d => d.subRows),\n    getParentRow: () => (row.parentId ? table.getRow(row.parentId) : undefined),\n    getParentRows: () => {\n      let parentRows: Row[] = []\n      let currentRow = row\n      while (true) {\n        const parentRow = currentRow.getParentRow()\n        if (!parentRow) break\n        parentRows.push(parentRow)\n        currentRow = parentRow\n      }\n      return parentRows.reverse()\n    },\n    getAllCells: memo(\n      () => [table.getAllLeafColumns()],\n      leafColumns => {\n        return leafColumns.map(column => {\n          return createCell(table, row as Row, column, column.id)\n        })\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'row.getAllCells',\n        debug: () => table.options.debugAll ?? table.options.debugRows,\n      }\n    ),\n\n    _getAllCellsByColumnId: memo(\n      () => [row.getAllCells()],\n      allCells => {\n        return allCells.reduce((acc, cell) => {\n          acc[cell.column.id] = cell\n          return acc\n        }, {} as Record>)\n      },\n      {\n        key:\n          process.env.NODE_ENV === 'production' && 'row.getAllCellsByColumnId',\n        debug: () => table.options.debugAll ?? table.options.debugRows,\n      }\n    ),\n  }\n\n  for (let i = 0; i < table._features.length; i++) {\n    const feature = table._features[i]\n    Object.assign(row, feature?.createRow?.(row, table))\n  }\n\n  return row as Row\n}\n","import {\n  AccessorFn,\n  ColumnDef,\n  DisplayColumnDef,\n  GroupColumnDef,\n  IdentifiedColumnDef,\n  RowData,\n} from './types'\nimport { DeepKeys, DeepValue, RequiredKeys } from './utils'\n\n// type Person = {\n//   firstName: string\n//   lastName: string\n//   age: number\n//   visits: number\n//   status: string\n//   progress: number\n//   createdAt: Date\n//   nested: {\n//     foo: [\n//       {\n//         bar: 'bar'\n//       }\n//     ]\n//     bar: { subBar: boolean }[]\n//     baz: {\n//       foo: 'foo'\n//       bar: {\n//         baz: 'baz'\n//       }\n//     }\n//   }\n// }\n\n// const test: DeepKeys = 'nested.foo.0.bar'\n// const test2: DeepKeys = 'nested.bar'\n\n// const helper = createColumnHelper()\n\n// helper.accessor('nested.foo', {\n//   cell: info => info.getValue(),\n// })\n\n// helper.accessor('nested.foo.0.bar', {\n//   cell: info => info.getValue(),\n// })\n\n// helper.accessor('nested.bar', {\n//   cell: info => info.getValue(),\n// })\n\nexport type ColumnHelper = {\n  accessor: <\n    TAccessor extends AccessorFn | DeepKeys,\n    TValue extends TAccessor extends AccessorFn\n      ? TReturn\n      : TAccessor extends DeepKeys\n      ? DeepValue\n      : never\n  >(\n    accessor: TAccessor,\n    column: TAccessor extends AccessorFn\n      ? DisplayColumnDef\n      : IdentifiedColumnDef\n  ) => ColumnDef\n  display: (column: DisplayColumnDef) => ColumnDef\n  group: (column: GroupColumnDef) => ColumnDef\n}\n\nexport function createColumnHelper<\n  TData extends RowData\n>(): ColumnHelper {\n  return {\n    accessor: (accessor, column) => {\n      return typeof accessor === 'function'\n        ? ({\n            ...column,\n            accessorFn: accessor,\n          } as any)\n        : {\n            ...column,\n            accessorKey: accessor,\n          }\n    },\n    display: column => column as ColumnDef,\n    group: column => column as ColumnDef,\n  }\n}\n","import { createRow } from '../core/row'\nimport { Table, Row, RowModel, RowData } from '../types'\nimport { memo } from '../utils'\n\nexport function getCoreRowModel(): (\n  table: Table\n) => () => RowModel {\n  return table =>\n    memo(\n      () => [table.options.data],\n      (\n        data\n      ): {\n        rows: Row[]\n        flatRows: Row[]\n        rowsById: Record>\n      } => {\n        const rowModel: RowModel = {\n          rows: [],\n          flatRows: [],\n          rowsById: {},\n        }\n\n        const accessRows = (\n          originalRows: TData[],\n          depth = 0,\n          parentRow?: Row\n        ): Row[] => {\n          const rows = [] as Row[]\n\n          for (let i = 0; i < originalRows.length; i++) {\n            // This could be an expensive check at scale, so we should move it somewhere else, but where?\n            // if (!id) {\n            //   if (process.env.NODE_ENV !== 'production') {\n            //     throw new Error(`getRowId expected an ID, but got ${id}`)\n            //   }\n            // }\n\n            // Make the row\n            const row = createRow(\n              table,\n              table._getRowId(originalRows[i]!, i, parentRow),\n              originalRows[i]!,\n              i,\n              depth,\n              undefined,\n              parentRow?.id\n            )\n\n            // Keep track of every row in a flat array\n            rowModel.flatRows.push(row)\n            // Also keep track of every row by its ID\n            rowModel.rowsById[row.id] = row\n            // Push table row into parent\n            rows.push(row)\n\n            // Get the original subrows\n            if (table.options.getSubRows) {\n              row.originalSubRows = table.options.getSubRows(\n                originalRows[i]!,\n                i\n              )\n\n              // Then recursively access them\n              if (row.originalSubRows?.length) {\n                row.subRows = accessRows(row.originalSubRows, depth + 1, row)\n              }\n            }\n          }\n\n          return rows\n        }\n\n        rowModel.rows = accessRows(data)\n\n        return rowModel\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getRowModel',\n        debug: () => table.options.debugAll ?? table.options.debugTable,\n        onChange: () => {\n          table._autoResetPageIndex()\n        },\n      }\n    )\n}\n","import { createRow } from '../core/row'\nimport { Row, RowModel, Table, RowData } from '../types'\n\nexport function filterRows(\n  rows: Row[],\n  filterRowImpl: (row: Row) => any,\n  table: Table\n) {\n  if (table.options.filterFromLeafRows) {\n    return filterRowModelFromLeafs(rows, filterRowImpl, table)\n  }\n\n  return filterRowModelFromRoot(rows, filterRowImpl, table)\n}\n\nexport function filterRowModelFromLeafs(\n  rowsToFilter: Row[],\n  filterRow: (row: Row) => Row[],\n  table: Table\n): RowModel {\n  const newFilteredFlatRows: Row[] = []\n  const newFilteredRowsById: Record> = {}\n  const maxDepth = table.options.maxLeafRowFilterDepth ?? 100\n\n  const recurseFilterRows = (rowsToFilter: Row[], depth = 0) => {\n    const rows: Row[] = []\n\n    // Filter from children up first\n    for (let i = 0; i < rowsToFilter.length; i++) {\n      let row = rowsToFilter[i]!\n\n      const newRow = createRow(\n        table,\n        row.id,\n        row.original,\n        row.index,\n        row.depth,\n        undefined,\n        row.parentId\n      )\n      newRow.columnFilters = row.columnFilters\n\n      if (row.subRows?.length && depth < maxDepth) {\n        newRow.subRows = recurseFilterRows(row.subRows, depth + 1)\n        row = newRow\n\n        if (filterRow(row) && !newRow.subRows.length) {\n          rows.push(row)\n          newFilteredRowsById[row.id] = row\n          newFilteredRowsById[i] = row\n          continue\n        }\n\n        if (filterRow(row) || newRow.subRows.length) {\n          rows.push(row)\n          newFilteredRowsById[row.id] = row\n          newFilteredRowsById[i] = row\n          continue\n        }\n      } else {\n        row = newRow\n        if (filterRow(row)) {\n          rows.push(row)\n          newFilteredRowsById[row.id] = row\n          newFilteredRowsById[i] = row\n        }\n      }\n    }\n\n    return rows\n  }\n\n  return {\n    rows: recurseFilterRows(rowsToFilter),\n    flatRows: newFilteredFlatRows,\n    rowsById: newFilteredRowsById,\n  }\n}\n\nexport function filterRowModelFromRoot(\n  rowsToFilter: Row[],\n  filterRow: (row: Row) => any,\n  table: Table\n): RowModel {\n  const newFilteredFlatRows: Row[] = []\n  const newFilteredRowsById: Record> = {}\n  const maxDepth = table.options.maxLeafRowFilterDepth ?? 100\n\n  // Filters top level and nested rows\n  const recurseFilterRows = (rowsToFilter: Row[], depth = 0) => {\n    // Filter from parents downward first\n\n    const rows: Row[] = []\n\n    // Apply the filter to any subRows\n    for (let i = 0; i < rowsToFilter.length; i++) {\n      let row = rowsToFilter[i]!\n\n      const pass = filterRow(row)\n\n      if (pass) {\n        if (row.subRows?.length && depth < maxDepth) {\n          const newRow = createRow(\n            table,\n            row.id,\n            row.original,\n            row.index,\n            row.depth,\n            undefined,\n            row.parentId\n          )\n          newRow.subRows = recurseFilterRows(row.subRows, depth + 1)\n          row = newRow\n        }\n\n        rows.push(row)\n        newFilteredFlatRows.push(row)\n        newFilteredRowsById[row.id] = row\n      }\n    }\n\n    return rows\n  }\n\n  return {\n    rows: recurseFilterRows(rowsToFilter),\n    flatRows: newFilteredFlatRows,\n    rowsById: newFilteredRowsById,\n  }\n}\n","import { ResolvedColumnFilter } from '../features/Filters'\nimport { Table, RowModel, Row, RowData } from '../types'\nimport { memo } from '../utils'\nimport { filterRows } from './filterRowsUtils'\n\nexport function getFilteredRowModel(): (\n  table: Table\n) => () => RowModel {\n  return table =>\n    memo(\n      () => [\n        table.getPreFilteredRowModel(),\n        table.getState().columnFilters,\n        table.getState().globalFilter,\n      ],\n      (rowModel, columnFilters, globalFilter) => {\n        if (\n          !rowModel.rows.length ||\n          (!columnFilters?.length && !globalFilter)\n        ) {\n          for (let i = 0; i < rowModel.flatRows.length; i++) {\n            rowModel.flatRows[i]!.columnFilters = {}\n            rowModel.flatRows[i]!.columnFiltersMeta = {}\n          }\n          return rowModel\n        }\n\n        const resolvedColumnFilters: ResolvedColumnFilter[] = []\n        const resolvedGlobalFilters: ResolvedColumnFilter[] = []\n\n        ;(columnFilters ?? []).forEach(d => {\n          const column = table.getColumn(d.id)\n\n          if (!column) {\n            return\n          }\n\n          const filterFn = column.getFilterFn()\n\n          if (!filterFn) {\n            if (process.env.NODE_ENV !== 'production') {\n              console.warn(\n                `Could not find a valid 'column.filterFn' for column with the ID: ${column.id}.`\n              )\n            }\n            return\n          }\n\n          resolvedColumnFilters.push({\n            id: d.id,\n            filterFn,\n            resolvedValue: filterFn.resolveFilterValue?.(d.value) ?? d.value,\n          })\n        })\n\n        const filterableIds = columnFilters.map(d => d.id)\n\n        const globalFilterFn = table.getGlobalFilterFn()\n\n        const globallyFilterableColumns = table\n          .getAllLeafColumns()\n          .filter(column => column.getCanGlobalFilter())\n\n        if (\n          globalFilter &&\n          globalFilterFn &&\n          globallyFilterableColumns.length\n        ) {\n          filterableIds.push('__global__')\n\n          globallyFilterableColumns.forEach(column => {\n            resolvedGlobalFilters.push({\n              id: column.id,\n              filterFn: globalFilterFn,\n              resolvedValue:\n                globalFilterFn.resolveFilterValue?.(globalFilter) ??\n                globalFilter,\n            })\n          })\n        }\n\n        let currentColumnFilter\n        let currentGlobalFilter\n\n        // Flag the prefiltered row model with each filter state\n        for (let j = 0; j < rowModel.flatRows.length; j++) {\n          const row = rowModel.flatRows[j]!\n\n          row.columnFilters = {}\n\n          if (resolvedColumnFilters.length) {\n            for (let i = 0; i < resolvedColumnFilters.length; i++) {\n              currentColumnFilter = resolvedColumnFilters[i]!\n              const id = currentColumnFilter.id\n\n              // Tag the row with the column filter state\n              row.columnFilters[id] = currentColumnFilter.filterFn(\n                row,\n                id,\n                currentColumnFilter.resolvedValue,\n                filterMeta => {\n                  row.columnFiltersMeta[id] = filterMeta\n                }\n              )\n            }\n          }\n\n          if (resolvedGlobalFilters.length) {\n            for (let i = 0; i < resolvedGlobalFilters.length; i++) {\n              currentGlobalFilter = resolvedGlobalFilters[i]!\n              const id = currentGlobalFilter.id\n              // Tag the row with the first truthy global filter state\n              if (\n                currentGlobalFilter.filterFn(\n                  row,\n                  id,\n                  currentGlobalFilter.resolvedValue,\n                  filterMeta => {\n                    row.columnFiltersMeta[id] = filterMeta\n                  }\n                )\n              ) {\n                row.columnFilters.__global__ = true\n                break\n              }\n            }\n\n            if (row.columnFilters.__global__ !== true) {\n              row.columnFilters.__global__ = false\n            }\n          }\n        }\n\n        const filterRowsImpl = (row: Row) => {\n          // Horizontally filter rows through each column\n          for (let i = 0; i < filterableIds.length; i++) {\n            if (row.columnFilters[filterableIds[i]!] === false) {\n              return false\n            }\n          }\n          return true\n        }\n\n        // Filter final rows using all of the active filters\n        return filterRows(rowModel.rows, filterRowsImpl, table)\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getFilteredRowModel',\n        debug: () => table.options.debugAll ?? table.options.debugTable,\n        onChange: () => {\n          table._autoResetPageIndex()\n        },\n      }\n    )\n}\n","import { Table, RowModel, Row, RowData } from '../types'\nimport { memo } from '../utils'\nimport { filterRows } from './filterRowsUtils'\n\nexport function getFacetedRowModel(): (\n  table: Table,\n  columnId: string\n) => () => RowModel {\n  return (table, columnId) =>\n    memo(\n      () => [\n        table.getPreFilteredRowModel(),\n        table.getState().columnFilters,\n        table.getState().globalFilter,\n        table.getFilteredRowModel(),\n      ],\n      (preRowModel, columnFilters, globalFilter) => {\n        if (\n          !preRowModel.rows.length ||\n          (!columnFilters?.length && !globalFilter)\n        ) {\n          return preRowModel\n        }\n\n        const filterableIds = [\n          ...columnFilters.map(d => d.id).filter(d => d !== columnId),\n          globalFilter ? '__global__' : undefined,\n        ].filter(Boolean) as string[]\n\n        const filterRowsImpl = (row: Row) => {\n          // Horizontally filter rows through each column\n          for (let i = 0; i < filterableIds.length; i++) {\n            if (row.columnFilters[filterableIds[i]!] === false) {\n              return false\n            }\n          }\n          return true\n        }\n\n        return filterRows(preRowModel.rows, filterRowsImpl, table)\n      },\n      {\n        key:\n          process.env.NODE_ENV === 'development' &&\n          'getFacetedRowModel_' + columnId,\n        debug: () => table.options.debugAll ?? table.options.debugTable,\n        onChange: () => {},\n      }\n    )\n}\n","import { Table, RowData } from '../types'\nimport { memo } from '../utils'\n\nexport function getFacetedUniqueValues(): (\n  table: Table,\n  columnId: string\n) => () => Map {\n  return (table, columnId) =>\n    memo(\n      () => [table.getColumn(columnId)?.getFacetedRowModel()],\n      facetedRowModel => {\n        if (!facetedRowModel) return new Map()\n\n        let facetedUniqueValues = new Map()\n\n        for (let i = 0; i < facetedRowModel.flatRows.length; i++) {\n          const values =\n            facetedRowModel.flatRows[i]!.getUniqueValues(columnId)\n\n          for (let j = 0; j < values.length; j++) {\n            const value = values[j]!\n\n            if (facetedUniqueValues.has(value)) {\n              facetedUniqueValues.set(\n                value,\n                (facetedUniqueValues.get(value) ?? 0) + 1\n              )\n            } else {\n              facetedUniqueValues.set(value, 1)\n            }\n          }\n        }\n\n        return facetedUniqueValues\n      },\n      {\n        key:\n          process.env.NODE_ENV === 'development' &&\n          'getFacetedUniqueValues_' + columnId,\n        debug: () => table.options.debugAll ?? table.options.debugTable,\n        onChange: () => {},\n      }\n    )\n}\n","import { Table, RowData } from '../types'\nimport { memo } from '../utils'\n\nexport function getFacetedMinMaxValues(): (\n  table: Table,\n  columnId: string\n) => () => undefined | [number, number] {\n  return (table, columnId) =>\n    memo(\n      () => [table.getColumn(columnId)?.getFacetedRowModel()],\n      facetedRowModel => {\n        if (!facetedRowModel) return undefined\n\n        const firstValue =\n          facetedRowModel.flatRows[0]?.getUniqueValues(columnId)\n\n        if (typeof firstValue === 'undefined') {\n          return undefined\n        }\n\n        let facetedMinMaxValues: [any, any] = [firstValue, firstValue]\n\n        for (let i = 0; i < facetedRowModel.flatRows.length; i++) {\n          const values =\n            facetedRowModel.flatRows[i]!.getUniqueValues(columnId)\n\n          for (let j = 0; j < values.length; j++) {\n            const value = values[j]!\n\n            if (value < facetedMinMaxValues[0]) {\n              facetedMinMaxValues[0] = value\n            } else if (value > facetedMinMaxValues[1]) {\n              facetedMinMaxValues[1] = value\n            }\n          }\n        }\n\n        return facetedMinMaxValues\n      },\n      {\n        key:\n          process.env.NODE_ENV === 'development' &&\n          'getFacetedMinMaxValues_' + columnId,\n        debug: () => table.options.debugAll ?? table.options.debugTable,\n        onChange: () => {},\n      }\n    )\n}\n","import { Table, Row, RowModel, RowData } from '../types'\nimport { SortingFn } from '../features/Sorting'\nimport { memo } from '../utils'\n\nexport function getSortedRowModel(): (\n  table: Table\n) => () => RowModel {\n  return table =>\n    memo(\n      () => [table.getState().sorting, table.getPreSortedRowModel()],\n      (sorting, rowModel) => {\n        if (!rowModel.rows.length || !sorting?.length) {\n          return rowModel\n        }\n\n        const sortingState = table.getState().sorting\n\n        const sortedFlatRows: Row[] = []\n\n        // Filter out sortings that correspond to non existing columns\n        const availableSorting = sortingState.filter(sort =>\n          table.getColumn(sort.id)?.getCanSort()\n        )\n\n        const columnInfoById: Record<\n          string,\n          {\n            sortUndefined?: false | -1 | 1\n            invertSorting?: boolean\n            sortingFn: SortingFn\n          }\n        > = {}\n\n        availableSorting.forEach(sortEntry => {\n          const column = table.getColumn(sortEntry.id)\n          if (!column) return\n\n          columnInfoById[sortEntry.id] = {\n            sortUndefined: column.columnDef.sortUndefined,\n            invertSorting: column.columnDef.invertSorting,\n            sortingFn: column.getSortingFn(),\n          }\n        })\n\n        const sortData = (rows: Row[]) => {\n          // This will also perform a stable sorting using the row index\n          // if needed.\n          const sortedData = [...rows]\n\n          sortedData.sort((rowA, rowB) => {\n            for (let i = 0; i < availableSorting.length; i += 1) {\n              const sortEntry = availableSorting[i]!\n              const columnInfo = columnInfoById[sortEntry.id]!\n              const isDesc = sortEntry?.desc ?? false\n\n              if (columnInfo.sortUndefined) {\n                const aValue = rowA.getValue(sortEntry.id)\n                const bValue = rowB.getValue(sortEntry.id)\n\n                const aUndefined = typeof aValue === 'undefined'\n                const bUndefined = typeof bValue === 'undefined'\n\n                if (aUndefined || bUndefined) {\n                  return aUndefined && bUndefined\n                    ? 0\n                    : aUndefined\n                    ? columnInfo.sortUndefined\n                    : -columnInfo.sortUndefined\n                }\n              }\n\n              // This function should always return in ascending order\n              let sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id)\n\n              if (sortInt !== 0) {\n                if (isDesc) {\n                  sortInt *= -1\n                }\n\n                if (columnInfo.invertSorting) {\n                  sortInt *= -1\n                }\n\n                return sortInt\n              }\n            }\n\n            return rowA.index - rowB.index\n          })\n\n          // If there are sub-rows, sort them\n          sortedData.forEach(row => {\n            sortedFlatRows.push(row)\n            if (row.subRows?.length) {\n              row.subRows = sortData(row.subRows)\n            }\n          })\n\n          return sortedData\n        }\n\n        return {\n          rows: sortData(rowModel.rows),\n          flatRows: sortedFlatRows,\n          rowsById: rowModel.rowsById,\n        }\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getSortedRowModel',\n        debug: () => table.options.debugAll ?? table.options.debugTable,\n        onChange: () => {\n          table._autoResetPageIndex()\n        },\n      }\n    )\n}\n","import { createRow } from '../core/row'\nimport { Table, Row, RowModel, RowData } from '../types'\nimport { flattenBy, memo } from '../utils'\n\nexport function getGroupedRowModel(): (\n  table: Table\n) => () => RowModel {\n  return table =>\n    memo(\n      () => [table.getState().grouping, table.getPreGroupedRowModel()],\n      (grouping, rowModel) => {\n        if (!rowModel.rows.length || !grouping.length) {\n          return rowModel\n        }\n\n        // Filter the grouping list down to columns that exist\n        const existingGrouping = grouping.filter(columnId =>\n          table.getColumn(columnId)\n        )\n\n        const groupedFlatRows: Row[] = []\n        const groupedRowsById: Record> = {}\n        // const onlyGroupedFlatRows: Row[] = [];\n        // const onlyGroupedRowsById: Record = {};\n        // const nonGroupedFlatRows: Row[] = [];\n        // const nonGroupedRowsById: Record = {};\n\n        // Recursively group the data\n        const groupUpRecursively = (\n          rows: Row[],\n          depth = 0,\n          parentId?: string\n        ) => {\n          // Grouping depth has been been met\n          // Stop grouping and simply rewrite thd depth and row relationships\n          if (depth >= existingGrouping.length) {\n            return rows.map(row => {\n              row.depth = depth\n\n              groupedFlatRows.push(row)\n              groupedRowsById[row.id] = row\n\n              if (row.subRows) {\n                row.subRows = groupUpRecursively(row.subRows, depth + 1, row.id)\n              }\n\n              return row\n            })\n          }\n\n          const columnId: string = existingGrouping[depth]!\n\n          // Group the rows together for this level\n          const rowGroupsMap = groupBy(rows, columnId)\n\n          // Peform aggregations for each group\n          const aggregatedGroupedRows = Array.from(rowGroupsMap.entries()).map(\n            ([groupingValue, groupedRows], index) => {\n              let id = `${columnId}:${groupingValue}`\n              id = parentId ? `${parentId}>${id}` : id\n\n              // First, Recurse to group sub rows before aggregation\n              const subRows = groupUpRecursively(groupedRows, depth + 1, id)\n\n              // Flatten the leaf rows of the rows in this group\n              const leafRows = depth\n                ? flattenBy(groupedRows, row => row.subRows)\n                : groupedRows\n\n              const row = createRow(\n                table,\n                id,\n                leafRows[0]!.original,\n                index,\n                depth,\n                undefined,\n                parentId\n              )\n\n              Object.assign(row, {\n                groupingColumnId: columnId,\n                groupingValue,\n                subRows,\n                leafRows,\n                getValue: (columnId: string) => {\n                  // Don't aggregate columns that are in the grouping\n                  if (existingGrouping.includes(columnId)) {\n                    if (row._valuesCache.hasOwnProperty(columnId)) {\n                      return row._valuesCache[columnId]\n                    }\n\n                    if (groupedRows[0]) {\n                      row._valuesCache[columnId] =\n                        groupedRows[0].getValue(columnId) ?? undefined\n                    }\n\n                    return row._valuesCache[columnId]\n                  }\n\n                  if (row._groupingValuesCache.hasOwnProperty(columnId)) {\n                    return row._groupingValuesCache[columnId]\n                  }\n\n                  // Aggregate the values\n                  const column = table.getColumn(columnId)\n                  const aggregateFn = column?.getAggregationFn()\n\n                  if (aggregateFn) {\n                    row._groupingValuesCache[columnId] = aggregateFn(\n                      columnId,\n                      leafRows,\n                      groupedRows\n                    )\n\n                    return row._groupingValuesCache[columnId]\n                  }\n                },\n              })\n\n              subRows.forEach(subRow => {\n                groupedFlatRows.push(subRow)\n                groupedRowsById[subRow.id] = subRow\n                // if (subRow.getIsGrouped?.()) {\n                //   onlyGroupedFlatRows.push(subRow);\n                //   onlyGroupedRowsById[subRow.id] = subRow;\n                // } else {\n                //   nonGroupedFlatRows.push(subRow);\n                //   nonGroupedRowsById[subRow.id] = subRow;\n                // }\n              })\n\n              return row\n            }\n          )\n\n          return aggregatedGroupedRows\n        }\n\n        const groupedRows = groupUpRecursively(rowModel.rows, 0)\n\n        groupedRows.forEach(subRow => {\n          groupedFlatRows.push(subRow)\n          groupedRowsById[subRow.id] = subRow\n          // if (subRow.getIsGrouped?.()) {\n          //   onlyGroupedFlatRows.push(subRow);\n          //   onlyGroupedRowsById[subRow.id] = subRow;\n          // } else {\n          //   nonGroupedFlatRows.push(subRow);\n          //   nonGroupedRowsById[subRow.id] = subRow;\n          // }\n        })\n\n        return {\n          rows: groupedRows,\n          flatRows: groupedFlatRows,\n          rowsById: groupedRowsById,\n        }\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getGroupedRowModel',\n        debug: () => table.options.debugAll ?? table.options.debugTable,\n        onChange: () => {\n          table._queue(() => {\n            table._autoResetExpanded()\n            table._autoResetPageIndex()\n          })\n        },\n      }\n    )\n}\n\nfunction groupBy(rows: Row[], columnId: string) {\n  const groupMap = new Map[]>()\n\n  return rows.reduce((map, row) => {\n    const resKey = `${row.getGroupingValue(columnId)}`\n    const previous = map.get(resKey)\n    if (!previous) {\n      map.set(resKey, [row])\n    } else {\n      previous.push(row)\n    }\n    return map\n  }, groupMap)\n}\n","import { Table, Row, RowModel, RowData } from '../types'\nimport { memo } from '../utils'\n\nexport function getExpandedRowModel(): (\n  table: Table\n) => () => RowModel {\n  return table =>\n    memo(\n      () => [\n        table.getState().expanded,\n        table.getPreExpandedRowModel(),\n        table.options.paginateExpandedRows,\n      ],\n      (expanded, rowModel, paginateExpandedRows) => {\n        if (\n          !rowModel.rows.length ||\n          (expanded !== true && !Object.keys(expanded ?? {}).length)\n        ) {\n          return rowModel\n        }\n\n        if (!paginateExpandedRows) {\n          // Only expand rows at this point if they are being paginated\n          return rowModel\n        }\n\n        return expandRows(rowModel)\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getExpandedRowModel',\n        debug: () => table.options.debugAll ?? table.options.debugTable,\n      }\n    )\n}\n\nexport function expandRows(rowModel: RowModel) {\n  const expandedRows: Row[] = []\n\n  const handleRow = (row: Row) => {\n    expandedRows.push(row)\n\n    if (row.subRows?.length && row.getIsExpanded()) {\n      row.subRows.forEach(handleRow)\n    }\n  }\n\n  rowModel.rows.forEach(handleRow)\n\n  return {\n    rows: expandedRows,\n    flatRows: rowModel.flatRows,\n    rowsById: rowModel.rowsById,\n  }\n}\n","import { Table, RowModel, Row, RowData } from '../types'\nimport { memo } from '../utils'\nimport { expandRows } from './getExpandedRowModel'\n\nexport function getPaginationRowModel(opts?: {\n  initialSync: boolean\n}): (table: Table) => () => RowModel {\n  return table =>\n    memo(\n      () => [\n        table.getState().pagination,\n        table.getPrePaginationRowModel(),\n        table.options.paginateExpandedRows\n          ? undefined\n          : table.getState().expanded,\n      ],\n      (pagination, rowModel) => {\n        if (!rowModel.rows.length) {\n          return rowModel\n        }\n\n        const { pageSize, pageIndex } = pagination\n        let { rows, flatRows, rowsById } = rowModel\n        const pageStart = pageSize * pageIndex\n        const pageEnd = pageStart + pageSize\n\n        rows = rows.slice(pageStart, pageEnd)\n\n        let paginatedRowModel: RowModel\n\n        if (!table.options.paginateExpandedRows) {\n          paginatedRowModel = expandRows({\n            rows,\n            flatRows,\n            rowsById,\n          })\n        } else {\n          paginatedRowModel = {\n            rows,\n            flatRows,\n            rowsById,\n          }\n        }\n\n        paginatedRowModel.flatRows = []\n\n        const handleRow = (row: Row) => {\n          paginatedRowModel.flatRows.push(row)\n          if (row.subRows.length) {\n            row.subRows.forEach(handleRow)\n          }\n        }\n\n        paginatedRowModel.rows.forEach(handleRow)\n\n        return paginatedRowModel\n      },\n      {\n        key: process.env.NODE_ENV === 'development' && 'getPaginationRowModel',\n        debug: () => table.options.debugAll ?? table.options.debugTable,\n      }\n    )\n}\n"],"names":["functionalUpdate","updater","input","noop","makeStateUpdater","key","instance","setState","old","isFunction","d","Function","isNumberArray","Array","isArray","every","val","flattenBy","arr","getChildren","flat","recurse","subArr","forEach","item","push","children","length","memo","getDeps","fn","opts","deps","result","depTime","debug","Date","now","newDeps","depsChanged","some","dep","index","resultTime","onChange","depEndTime","Math","round","resultEndTime","resultFpsPercentage","pad","str","num","String","console","info","max","min","createColumn","table","columnDef","depth","parent","_ref","_resolvedColumnDef$id","defaultColumn","_getDefaultColumnDef","resolvedColumnDef","accessorKey","id","replace","undefined","header","accessorFn","includes","originalRow","split","_result","process","env","NODE_ENV","warn","Error","column","columns","getFlatColumns","_column$columns","flatMap","_table$options$debugA","options","debugAll","debugColumns","getLeafColumns","_getOrderColumnsFn","orderColumns","_column$columns2","leafColumns","_table$options$debugA2","_features","reduce","obj","feature","Object","assign","createHeader","_options$id","isPlaceholder","placeholderId","subHeaders","colSpan","rowSpan","headerGroup","getLeafHeaders","leafHeaders","recurseHeader","h","map","getContext","Headers","createTable","getHeaderGroups","getAllColumns","getVisibleLeafColumns","getState","columnPinning","left","right","allColumns","_left$map$filter","_right$map$filter","leftColumns","columnId","find","filter","Boolean","rightColumns","centerColumns","headerGroups","buildHeaderGroups","debugHeaders","getCenterHeaderGroups","getLeftHeaderGroups","_left$map$filter2","orderedLeafColumns","_table$options$debugA3","getRightHeaderGroups","_right$map$filter2","_table$options$debugA4","getFooterGroups","reverse","_table$options$debugA5","getLeftFooterGroups","_table$options$debugA6","getCenterFooterGroups","_table$options$debugA7","getRightFooterGroups","_table$options$debugA8","getFlatHeaders","headers","_table$options$debugA9","getLeftFlatHeaders","_table$options$debugA10","getCenterFlatHeaders","_table$options$debugA11","getRightFlatHeaders","_table$options$debugA12","getCenterLeafHeaders","flatHeaders","_header$subHeaders","_table$options$debugA13","getLeftLeafHeaders","_header$subHeaders2","_table$options$debugA14","getRightLeafHeaders","_header$subHeaders3","_table$options$debugA15","center","_left$0$headers","_left$","_center$0$headers","_center$","_right$0$headers","_right$","_table$options$debugA16","columnsToGroup","headerFamily","_headerGroups$0$heade","_headerGroups$","maxDepth","findMaxDepth","getIsVisible","createHeaderGroup","headersToGroup","join","pendingParentHeaders","headerToGroup","latestPendingParentHeader","isLeafHeader","bottomHeaders","recurseHeadersForSpans","filteredHeaders","childRowSpans","childColSpan","childRowSpan","minChildRowSpan","defaultColumnSizing","size","minSize","maxSize","Number","MAX_SAFE_INTEGER","getDefaultColumnSizingInfoState","startOffset","startSize","deltaOffset","deltaPercentage","isResizingColumn","columnSizingStart","ColumnSizing","getDefaultColumnDef","getInitialState","state","columnSizing","columnSizingInfo","getDefaultOptions","columnResizeMode","onColumnSizingChange","onColumnSizingInfoChange","getSize","_column$columnDef$min","_column$columnDef$max","columnSize","getStart","position","getLeftVisibleLeafColumns","getRightVisibleLeafColumns","findIndex","prevSiblingColumn","resetSize","setColumnSizing","_ref2","_","rest","getCanResize","_column$columnDef$ena","_table$options$enable","enableResizing","enableColumnResizing","getIsResizing","sum","_header$column$getSiz","prevSiblingHeader","getResizeHandler","getColumn","canResize","e","persist","isTouchStartEvent","touches","clientX","newColumnSizing","updateOffset","eventType","clientXPos","setColumnSizingInfo","_old$startOffset","_old$startSize","_ref3","headerSize","onMove","onEnd","mouseEvents","moveHandler","upHandler","document","removeEventListener","touchEvents","cancelable","preventDefault","stopPropagation","_e$touches$","passiveIfSupported","passiveEventSupported","passive","addEventListener","resetColumnSizing","defaultState","_table$initialState$c","initialState","resetHeaderSizeInfo","_table$initialState$c2","getTotalSize","_table$getHeaderGroup","_table$getHeaderGroup2","getLeftTotalSize","_table$getLeftHeaderG","_table$getLeftHeaderG2","getCenterTotalSize","_table$getCenterHeade","_table$getCenterHeade2","getRightTotalSize","_table$getRightHeader","_table$getRightHeader2","passiveSupported","supported","window","err","type","Expanding","expanded","onExpandedChange","paginateExpandedRows","registered","queued","_autoResetExpanded","_table$options$autoRe","_queue","autoResetAll","autoResetExpanded","manualExpanding","resetExpanded","setExpanded","toggleAllRowsExpanded","getIsAllRowsExpanded","_table$initialState$e","_table$initialState","getCanSomeRowsExpand","getPrePaginationRowModel","flatRows","row","getCanExpand","getToggleAllRowsExpandedHandler","getIsSomeRowsExpanded","values","keys","getRowModel","getIsExpanded","getExpandedDepth","rowIds","rowsById","splitId","getPreExpandedRowModel","getSortedRowModel","getExpandedRowModel","_getExpandedRowModel","createRow","toggleExpanded","_expanded","exists","oldExpanded","rowId","_table$options$getIsR","getIsRowExpanded","_table$options$getRow","_row$subRows","getRowCanExpand","enableExpanding","subRows","getToggleExpandedHandler","canExpand","includesString","filterValue","_row$getValue","_row$getValue$toStrin","_row$getValue$toStrin2","search","toLowerCase","getValue","toString","autoRemove","testFalsey","includesStringSensitive","_row$getValue2","_row$getValue2$toStri","equalsString","_row$getValue3","_row$getValue3$toStri","arrIncludes","_row$getValue4","arrIncludesAll","_row$getValue5","arrIncludesSome","_row$getValue6","equals","weakEquals","inNumberRange","rowValue","resolveFilterValue","unsafeMin","unsafeMax","parsedMin","parseFloat","parsedMax","isNaN","Infinity","temp","filterFns","Filters","filterFn","columnFilters","globalFilter","onColumnFiltersChange","onGlobalFilterChange","filterFromLeafRows","maxLeafRowFilterDepth","globalFilterFn","getColumnCanGlobalFilter","_table$getCoreRowMode","_table$getCoreRowMode2","value","getCoreRowModel","_getAllCellsByColumnId","getAutoFilterFn","firstRow","getFilterFn","_table$options$filter","_table$options$filter2","getCanFilter","_table$options$enable2","enableColumnFilter","enableColumnFilters","enableFilters","getCanGlobalFilter","_column$columnDef$ena2","_table$options$enable3","_table$options$enable4","_table$options$getCol","enableGlobalFilter","getIsFiltered","getFilterIndex","getFilterValue","_table$getState$colum","_table$getState$colum2","_table$getState$colum3","_table$getState$colum4","setFilterValue","setColumnFilters","previousfilter","newFilter","shouldAutoRemoveFilter","_old$filter","newFilterObj","_old$map","_getFacetedRowModel","getFacetedRowModel","getPreFilteredRowModel","_getFacetedUniqueValues","getFacetedUniqueValues","Map","_getFacetedMinMaxValues","getFacetedMinMaxValues","columnFiltersMeta","getGlobalAutoFilterFn","getGlobalFilterFn","_table$options$filter3","_table$options$filter4","getAllLeafColumns","updateFn","_functionalUpdate","setGlobalFilter","resetGlobalFilter","resetColumnFilters","getFilteredRowModel","_getFilteredRowModel","manualFiltering","_getGlobalFacetedRowModel","getGlobalFacetedRowModel","_getGlobalFacetedUniqueValues","getGlobalFacetedUniqueValues","_getGlobalFacetedMinMaxValues","getGlobalFacetedMinMaxValues","_leafRows","childRows","next","nextValue","extent","mean","leafRows","count","median","mid","floor","nums","sort","a","b","unique","from","Set","uniqueCount","_columnId","aggregationFns","Grouping","aggregatedCell","props","_toString","_props$getValue","aggregationFn","grouping","onGroupingChange","groupedColumnMode","toggleGrouping","setGrouping","getCanGroup","enableGrouping","getIsGrouped","_table$getState$group","getGroupedIndex","_table$getState$group2","indexOf","getToggleGroupingHandler","canGroup","getAutoAggregationFn","prototype","call","getAggregationFn","_table$options$aggreg","_table$options$aggreg2","resetGrouping","_table$initialState$g","getPreGroupedRowModel","getGroupedRowModel","_getGroupedRowModel","manualGrouping","groupingColumnId","getGroupingValue","_groupingValuesCache","hasOwnProperty","original","createCell","cell","getIsPlaceholder","getIsAggregated","nonGroupingColumns","col","groupingColumns","g","Ordering","columnOrder","onColumnOrderChange","setColumnOrder","resetColumnOrder","orderedColumns","columnOrderCopy","columnsCopy","targetColumnId","shift","foundIndex","splice","defaultPageIndex","defaultPageSize","getDefaultPaginationState","pageIndex","pageSize","Pagination","pagination","onPaginationChange","_autoResetPageIndex","autoResetPageIndex","manualPagination","resetPageIndex","setPagination","safeUpdater","newState","resetPagination","_table$initialState$p","setPageIndex","maxPageIndex","pageCount","_table$initialState$p2","_table$initialState$p3","resetPageSize","_table$initialState$p4","_table$initialState2","_table$initialState2$","setPageSize","topRowIndex","setPageCount","_table$options$pageCo","newPageCount","getPageOptions","getPageCount","pageOptions","fill","i","debugTable","getCanPreviousPage","getCanNextPage","previousPage","nextPage","getPaginationRowModel","_getPaginationRowModel","_table$options$pageCo2","ceil","rows","getDefaultPinningState","Pinning","onColumnPinningChange","pin","columnIds","setColumnPinning","_old$left3","_old$right3","_old$left","_old$right","_old$left2","_old$right2","getCanPin","_d$columnDef$enablePi","enablePinning","getIsPinned","leafColumnIds","isLeft","isRight","getPinnedIndex","getCenterVisibleCells","_getAllVisibleCells","allCells","leftAndRight","debugRows","getLeftVisibleCells","cells","getRightVisibleCells","resetColumnPinning","getIsSomeColumnsPinned","_pinningState$positio","pinningState","_pinningState$left","_pinningState$right","getLeftLeafColumns","getRightLeafColumns","getCenterLeafColumns","RowSelection","rowSelection","onRowSelectionChange","enableRowSelection","enableMultiRowSelection","enableSubRowSelection","setRowSelection","resetRowSelection","_table$initialState$r","toggleAllRowsSelected","getIsAllRowsSelected","preGroupedFlatRows","getCanSelect","toggleAllPageRowsSelected","resolvedValue","getIsAllPageRowsSelected","mutateRowIsSelected","getPreSelectedRowModel","getSelectedRowModel","rowModel","selectRowsFn","getFilteredSelectedRowModel","getGroupedSelectedRowModel","isAllRowsSelected","paginationFlatRows","isAllPageRowsSelected","getIsSomeRowsSelected","_table$getState$rowSe","totalSelected","getIsSomePageRowsSelected","getIsSelected","getIsSomeSelected","getToggleAllRowsSelectedHandler","target","checked","getToggleAllPageRowsSelectedHandler","toggleSelected","isSelected","selectedRowIds","isRowSelected","isSubRowSelected","getIsAllSubRowsSelected","getCanSelectSubRows","getCanMultiSelect","getToggleSelectedHandler","canSelect","_target","getRow","newSelectedFlatRows","newSelectedRowsById","recurseRows","_row$subRows2","selection","_selection$row$id","allChildrenSelected","someSelected","subRow","reSplitAlphaNumeric","alphanumeric","rowA","rowB","compareAlphanumeric","alphanumericCaseSensitive","text","compareBasic","textCaseSensitive","datetime","basic","aStr","bStr","aa","bb","an","parseInt","bn","combo","sortingFns","Sorting","sorting","sortingFn","onSortingChange","isMultiSortEvent","shiftKey","getAutoSortingFn","firstRows","slice","isString","getAutoSortDir","getSortingFn","_table$options$sortin","_table$options$sortin2","toggleSorting","desc","multi","nextSortingOrder","getNextSortingOrder","hasManualValue","setSorting","existingSorting","existingIndex","newSorting","sortAction","nextDesc","getCanMultiSort","_table$options$maxMul","maxMultiSortColCount","getFirstSortDir","_column$columnDef$sor","sortDescFirst","firstSortDirection","isSorted","getIsSorted","enableSortingRemoval","enableMultiRemove","getCanSort","enableSorting","enableMultiSort","_table$getState$sorti","columnSort","getSortIndex","_table$getState$sorti2","_table$getState$sorti3","clearSorting","getToggleSortingHandler","canSort","resetSorting","_table$initialState$s","getPreSortedRowModel","_getSortedRowModel","manualSorting","Visibility","columnVisibility","onColumnVisibilityChange","toggleVisibility","getCanHide","setColumnVisibility","enableHiding","getToggleVisibilityHandler","getAllCells","getVisibleCells","makeVisibleColumnsMethod","getColumns","getVisibleFlatColumns","getAllFlatColumns","getCenterVisibleLeafColumns","resetColumnVisibility","toggleAllColumnsVisible","_value","getIsAllColumnsVisible","getIsSomeColumnsVisible","getToggleAllColumnsVisibilityHandler","features","_options$initialState","defaultOptions","mergeOptions","coreInitialState","_feature$getInitialSt","queuedTimeout","coreInstance","cb","Promise","resolve","then","catch","error","setTimeout","reset","setOptions","newOptions","onStateChange","_getRowId","getRowId","_getCoreRowModel","_defaultColumn","_props$renderValue$to","_props$renderValue","renderValue","_getColumnDefs","columnDefs","recurseColumns","groupingColumnDef","_getAllFlatColumnsById","flatColumns","acc","getRenderValue","_cell$getValue","renderFallbackValue","rowIndex","parentId","_valuesCache","_uniqueValuesCache","getUniqueValues","getLeafRows","getParentRow","getParentRows","parentRows","currentRow","parentRow","createColumnHelper","accessor","display","group","data","accessRows","originalRows","getSubRows","_row$originalSubRows","originalSubRows","filterRows","filterRowImpl","filterRowModelFromLeafs","filterRowModelFromRoot","rowsToFilter","filterRow","_table$options$maxLea","newFilteredFlatRows","newFilteredRowsById","recurseFilterRows","newRow","_table$options$maxLea2","pass","resolvedColumnFilters","resolvedGlobalFilters","_filterFn$resolveFilt","filterableIds","globallyFilterableColumns","_globalFilterFn$resol","currentColumnFilter","currentGlobalFilter","j","filterMeta","__global__","filterRowsImpl","preRowModel","_table$getColumn","facetedRowModel","facetedUniqueValues","has","_facetedUniqueValues$","set","get","_facetedRowModel$flat","firstValue","facetedMinMaxValues","sortingState","sortedFlatRows","availableSorting","columnInfoById","sortEntry","sortUndefined","invertSorting","sortData","sortedData","_sortEntry$desc","columnInfo","isDesc","aValue","bValue","aUndefined","bUndefined","sortInt","existingGrouping","groupedFlatRows","groupedRowsById","groupUpRecursively","rowGroupsMap","groupBy","aggregatedGroupedRows","entries","groupingValue","groupedRows","_groupedRows$0$getVal","aggregateFn","groupMap","resKey","previous","expandRows","expandedRows","handleRow","pageStart","pageEnd","paginatedRowModel"],"mappings":";;;;;;;;;;AA4BA;;AAOA;;AAsCA;;AAEO,SAASA,gBAAgBA,CAAIC,OAAmB,EAAEC,KAAQ,EAAK;EACpE,OAAO,OAAOD,OAAO,KAAK,UAAU,GAC/BA,OAAO,CAAqBC,KAAK,CAAC,GACnCD,OAAO,CAAA;AACb,CAAA;AAEO,SAASE,IAAIA,GAAG;AACrB;AAAA,CAAA;AAGK,SAASC,gBAAgBA,CAC9BC,GAAM,EACNC,QAAiB,EACjB;AACA,EAAA,OAAQL,OAA+B,IAAK;AACxCK,IAAAA,Q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