import * as React from "react";
import { createTable } from "../../../../../../@tanstack_table-core@8.20.5/node_modules/@tanstack/table-core/build/lib/index.mjs";
import { ColumnFaceting, ColumnFiltering, ColumnGrouping, ColumnOrdering, ColumnPinning, ColumnSizing, ColumnVisibility, GlobalFaceting, GlobalFiltering, Headers, RowExpanding, RowPagination, RowPinning, RowSelection, RowSorting, _getVisibleLeafColumns, aggregationFns, buildHeaderGroups, createCell, createColumn, createRow, defaultColumnSizing, expandRows, filterFns, flattenBy, functionalUpdate, getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getMemoOptions, getPaginationRowModel, getSortedRowModel, isFunction, isNumberArray, isRowSelected, isSubRowSelected, makeStateUpdater, memo, orderColumns, passiveEventSupported, reSplitAlphaNumeric, selectRowsFn, shouldAutoRemoveFilter, sortingFns } from "../../../../../../@tanstack_table-core@8.20.5/node_modules/@tanstack/table-core/build/lib/index.mjs";
/**
   * react-table
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */
function flexRender(Comp, props) {
  return !Comp ? null : isReactComponent(Comp) ? /* @__PURE__ */ React.createElement(Comp, props) : Comp;
}
function isReactComponent(component) {
  return isClassComponent(component) || typeof component === "function" || isExoticComponent(component);
}
function isClassComponent(component) {
  return typeof component === "function" && (() => {
    const proto = Object.getPrototypeOf(component);
    return proto.prototype && proto.prototype.isReactComponent;
  })();
}
function isExoticComponent(component) {
  return typeof component === "object" && typeof component.$$typeof === "symbol" && ["react.memo", "react.forward_ref"].includes(component.$$typeof.description);
}
function useReactTable(options) {
  const resolvedOptions = {
    state: {},
    // Dummy state
    onStateChange: () => {
    },
    // noop
    renderFallbackValue: null,
    ...options
  };
  const [tableRef] = React.useState(() => ({
    current: createTable(resolvedOptions)
  }));
  const [state, setState] = React.useState(() => tableRef.current.initialState);
  tableRef.current.setOptions((prev) => ({
    ...prev,
    ...options,
    state: {
      ...state,
      ...options.state
    },
    // Similarly, we'll maintain both our internal state and any user-provided
    // state.
    onStateChange: (updater) => {
      setState(updater);
      options.onStateChange == null || options.onStateChange(updater);
    }
  }));
  return tableRef.current;
}
export {
  ColumnFaceting,
  ColumnFiltering,
  ColumnGrouping,
  ColumnOrdering,
  ColumnPinning,
  ColumnSizing,
  ColumnVisibility,
  GlobalFaceting,
  GlobalFiltering,
  Headers,
  RowExpanding,
  RowPagination,
  RowPinning,
  RowSelection,
  RowSorting,
  _getVisibleLeafColumns,
  aggregationFns,
  buildHeaderGroups,
  createCell,
  createColumn,
  createRow,
  createTable,
  defaultColumnSizing,
  expandRows,
  filterFns,
  flattenBy,
  flexRender,
  functionalUpdate,
  getCoreRowModel,
  getExpandedRowModel,
  getFacetedMinMaxValues,
  getFacetedRowModel,
  getFacetedUniqueValues,
  getFilteredRowModel,
  getGroupedRowModel,
  getMemoOptions,
  getPaginationRowModel,
  getSortedRowModel,
  isFunction,
  isNumberArray,
  isRowSelected,
  isSubRowSelected,
  makeStateUpdater,
  memo,
  orderColumns,
  passiveEventSupported,
  reSplitAlphaNumeric,
  selectRowsFn,
  shouldAutoRemoveFilter,
  sortingFns,
  useReactTable
};
