var $16c7f9b22cce3838$exports = require("./Button.cjs");
var $365d89633c2041bc$exports = require("./Checkbox.cjs");
var $048d76b84370f141$exports = require("./utils.cjs");
var $f7b82bedbb70abac$exports = require("./Collection.cjs");
var $d3d8871226fc64f2$exports = require("./DragAndDrop.cjs");
var $433949643203e332$exports = require("./Autocomplete.cjs");
var $5724b511a2687756$exports = require("./intlStrings.cjs");
var $61557b2a9b2862a8$exports = require("./SelectionIndicator.cjs");
var $9a60bd90621ebc78$exports = require("./SharedElementTransition.cjs");
var $56f56e0916461149$exports = require("./TreeDropTargetDelegate.cjs");
var $4d5fb986d6106af2$exports = require("./TableLayout.cjs");
var $ke19Y$reactariaprivatecollectionsBaseCollection = require("react-aria/private/collections/BaseCollection");
var $ke19Y$reactstatelyprivatetableTableCollection = require("react-stately/private/table/TableCollection");
var $ke19Y$reactariaCollection = require("react-aria/Collection");
var $ke19Y$reactariaCollectionBuilder = require("react-aria/CollectionBuilder");
var $ke19Y$reactariafilterDOMProps = require("react-aria/filterDOMProps");
var $ke19Y$reactariaFocusScope = require("react-aria/FocusScope");
var $ke19Y$reactariaprivateutilsinertValue = require("react-aria/private/utils/inertValue");
var $ke19Y$reactariaprivateutilsisScrollable = require("react-aria/private/utils/isScrollable");
var $ke19Y$reactariaListKeyboardDelegate = require("react-aria/ListKeyboardDelegate");
var $ke19Y$reactariaprivateutilsuseLoadMoreSentinel = require("react-aria/private/utils/useLoadMoreSentinel");
var $ke19Y$reactariamergeProps = require("react-aria/mergeProps");
var $ke19Y$reactariamergeRefs = require("react-aria/mergeRefs");
var $ke19Y$react = require("react");
var $ke19Y$reactdom = require("react-dom");
var $ke19Y$reactstatelyuseTableState = require("react-stately/useTableState");
var $ke19Y$reactariaprivatecollectionsuseCachedChildren = require("react-aria/private/collections/useCachedChildren");
var $ke19Y$reactstatelyuseControlledState = require("react-stately/useControlledState");
var $ke19Y$reactariauseFocusRing = require("react-aria/useFocusRing");
var $ke19Y$reactariauseHover = require("react-aria/useHover");
var $ke19Y$reactariaprivateutilsuseLayoutEffect = require("react-aria/private/utils/useLayoutEffect");
var $ke19Y$reactariaI18nProvider = require("react-aria/I18nProvider");
var $ke19Y$reactariauseLocalizedStringFormatter = require("react-aria/useLocalizedStringFormatter");
var $ke19Y$reactstatelyuseMultipleSelectionState = require("react-stately/useMultipleSelectionState");
var $ke19Y$reactariauseObjectRef = require("react-aria/useObjectRef");
var $ke19Y$reactariaprivateutilsuseResizeObserver = require("react-aria/private/utils/useResizeObserver");
var $ke19Y$reactariauseTable = require("react-aria/useTable");
var $ke19Y$reactariaVisuallyHidden = require("react-aria/VisuallyHidden");


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}

function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}

$parcel$export(module.exports, "ResizableTableContainer", function () { return $af9b3e5459f1bf61$export$7063e69b8a954175; });
$parcel$export(module.exports, "TableContext", function () { return $af9b3e5459f1bf61$export$93e4b0b2cc49b648; });
$parcel$export(module.exports, "TableStateContext", function () { return $af9b3e5459f1bf61$export$38de1cb0526c21fb; });
$parcel$export(module.exports, "TableColumnResizeStateContext", function () { return $af9b3e5459f1bf61$export$a2680a798823803c; });
$parcel$export(module.exports, "Table", function () { return $af9b3e5459f1bf61$export$54ec01a60f47d33d; });
$parcel$export(module.exports, "useTableOptions", function () { return $af9b3e5459f1bf61$export$fddc468cd8cb4db9; });
$parcel$export(module.exports, "TableHeader", function () { return $af9b3e5459f1bf61$export$f850895b287ef28e; });
$parcel$export(module.exports, "Column", function () { return $af9b3e5459f1bf61$export$816b5d811295e6bc; });
$parcel$export(module.exports, "ColumnResizer", function () { return $af9b3e5459f1bf61$export$ee689e97a7664bfd; });
$parcel$export(module.exports, "TableBody", function () { return $af9b3e5459f1bf61$export$76ccd210b9029917; });
$parcel$export(module.exports, "Row", function () { return $af9b3e5459f1bf61$export$b59bdbef9ce70de2; });
$parcel$export(module.exports, "Cell", function () { return $af9b3e5459f1bf61$export$f6f0c3fe4ec306ea; });
$parcel$export(module.exports, "TableLoadMoreItem", function () { return $af9b3e5459f1bf61$export$8f5bea0338ed243c; });






































class $af9b3e5459f1bf61$var$TableCollection extends (0, $ke19Y$reactariaprivatecollectionsBaseCollection.BaseCollection) {
    withExpandedKeys(expandedKeys) {
        let collection = this.clone();
        collection.expandedKeys = expandedKeys;
        collection.frozen = this.frozen;
        collection.rows = Array.from(collection.getChildren(collection.body.key));
        return collection;
    }
    addNode(node) {
        super.addNode(node);
        this.columnsDirty ||= node.type === 'column';
        if (node.type === 'tableheader') this.head = node;
        if (node.type === 'tablebody') this.body = node;
    }
    commit(firstKey, lastKey, isSSR = false) {
        this.updateColumns(isSSR);
        this.rows = [];
        for (let row of this.getChildren(this.body.key)){
            let lastChildKey = row.lastChildKey;
            if (lastChildKey != null) {
                let lastCell = this.getItem(lastChildKey);
                while(lastCell && lastCell.type !== 'cell')lastCell = lastCell.prevKey ? this.getItem(lastCell.prevKey) : null;
                if (lastCell) {
                    let numberOfCellsInRow = (lastCell.colIndex ?? lastCell.index) + (lastCell.colSpan ?? 1);
                    if (numberOfCellsInRow !== this.columns.length && !isSSR) throw new Error(`Cell count must match column count. Found ${numberOfCellsInRow} cells and ${this.columns.length} columns.`);
                }
            }
            this.rows.push(row);
        }
        super.commit(firstKey, lastKey, isSSR);
    }
    updateColumns(isSSR) {
        if (!this.columnsDirty) return;
        this.rowHeaderColumnKeys = new Set();
        this.columns = [];
        let columnKeyMap = new Map();
        let visit = (node)=>{
            switch(node.type){
                case 'column':
                    columnKeyMap.set(node.key, node);
                    if (!node.hasChildNodes) {
                        node.index = this.columns.length;
                        this.columns.push(node);
                        if (node.props.isRowHeader) this.rowHeaderColumnKeys.add(node.key);
                    }
                    break;
            }
            for (let child of this.getChildren(node.key))visit(child);
        };
        for (let node of this.getChildren(this.head.key))visit(node);
        this.headerRows = (0, $ke19Y$reactstatelyprivatetableTableCollection.buildHeaderRows)(columnKeyMap, this.columns);
        this.columnsDirty = false;
        if (this.rowHeaderColumnKeys.size === 0 && this.columns.length > 0 && !isSSR) throw new Error('A table must have at least one Column with the isRowHeader prop set to true');
    }
    get columnCount() {
        return this.columns.length;
    }
    *[Symbol.iterator]() {
        // Wait until the collection is initialized.
        if (this.head.key === -1) return;
        yield this.head;
        yield this.body;
    }
    getFirstKey() {
        return this.body.firstChildKey;
    }
    getLastKey() {
        let key = this.body.lastChildKey;
        if (key == null) return null;
        let node = this.getItem(key);
        while(node?.lastChildKey != null && (node.type !== 'item' || this.expandedKeys.has(node.key)))node = this.getItem(node.lastChildKey);
        return node?.key;
    }
    getKeyAfter(key) {
        let node = this.getItem(key);
        if (node?.type === 'column') return node.nextKey ?? null;
        if (!node) return null;
        // If this is an expanded item, return the first child item if any.
        if (node.type === 'item' && node.firstChildKey != null && this.expandedKeys.has(node.key)) {
            let child = this.getItem(node.firstChildKey);
            while(child){
                if (child.type === 'item') return child.key;
                child = child.nextKey != null ? this.getItem(child.nextKey) : null;
            }
        }
        return super.getKeyAfter(key);
    }
    getKeyBefore(key) {
        let node = this.getItem(key);
        if (node?.type === 'column') return node.prevKey ?? null;
        if (!node) return null;
        let k = null;
        if (node.prevKey != null) {
            node = this.getItem(node.prevKey);
            // Traverse to the deepest expanded child.
            while(node && (node.type !== 'item' || this.expandedKeys.has(node.key)) && node.lastChildKey != null)node = this.getItem(node.lastChildKey);
            k = node?.key ?? null;
        }
        if (k == null) k = node.parentKey;
        if (k != null && this.getItem(k)?.type === 'tablebody') return null;
        return k;
    }
    getChildren(key) {
        if (!this.getItem(key)) for (let row of this.headerRows){
            if (row.key === key) return row.childNodes;
        }
        // Flatten all rows into the body.
        let self = this;
        if (key === this.body.key) return {
            *[Symbol.iterator] () {
                let firstKey = self.getFirstKey();
                let node = firstKey != null ? self.getItem(firstKey) : null;
                while(node){
                    yield node;
                    let key = self.getKeyAfter(node.key);
                    node = key ? self.getItem(key) : null;
                }
            }
        };
        return {
            *[Symbol.iterator] () {
                let parent = self.getItem(key);
                let node = parent?.firstChildKey != null ? self.getItem(parent.firstChildKey) : null;
                while(node){
                    yield node;
                    node = node.nextKey != null ? self.getItem(node.nextKey) : null;
                    // Return only cells as children of rows (nested rows are flattened into the body).
                    if (parent?.type === 'item' && node?.type !== 'cell') break;
                }
            }
        };
    }
    clone() {
        let collection = super.clone();
        collection.headerRows = this.headerRows;
        collection.columns = this.columns;
        collection.rows = this.rows;
        collection.rowHeaderColumnKeys = this.rowHeaderColumnKeys;
        collection.head = this.head;
        collection.body = this.body;
        return collection;
    }
    getTextValue(key) {
        let row = this.getItem(key);
        if (!row) return '';
        // If the row has a textValue, use that.
        if (row.textValue) return row.textValue;
        // Otherwise combine the text of each of the row header columns.
        let rowHeaderColumnKeys = this.rowHeaderColumnKeys;
        let text = [];
        for (let cell of this.getChildren(key)){
            let column = this.columns[cell.index];
            if (rowHeaderColumnKeys.has(column.key) && cell.textValue) text.push(cell.textValue);
            if (text.length === rowHeaderColumnKeys.size) break;
        }
        return text.join(' ');
    }
    constructor(...args){
        super(...args), this.headerRows = [], this.columns = [], this.rows = [], this.rowHeaderColumnKeys = new Set(), this.head = new $af9b3e5459f1bf61$var$TableHeaderNode(-1), this.body = new $af9b3e5459f1bf61$var$TableBodyNode(-2), this.columnsDirty = true, this.expandedKeys = new Set();
    }
}
const $af9b3e5459f1bf61$var$ResizableTableContainerContext = /*#__PURE__*/ (0, $ke19Y$react.createContext)(null);
const $af9b3e5459f1bf61$export$7063e69b8a954175 = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function ResizableTableContainer(props, ref) {
    let containerRef = (0, $ke19Y$reactariauseObjectRef.useObjectRef)(ref);
    let tableRef = (0, $ke19Y$react.useRef)(null);
    let scrollRef = (0, $ke19Y$react.useRef)(null);
    let [width, setWidth] = (0, $ke19Y$react.useState)(0);
    (0, $ke19Y$reactariaprivateutilsuseLayoutEffect.useLayoutEffect)(()=>{
        // Walk up the DOM from the Table to the ResizableTableContainer and stop
        // when we reach the first scrollable element. This is what we'll measure
        // to determine column widths (important due to width of scrollbars).
        // This will usually be the ResizableTableContainer for native tables, and
        // the Table itself for virtualized tables.
        let table = tableRef.current;
        while(table && table !== containerRef.current && !(0, $ke19Y$reactariaprivateutilsisScrollable.isScrollable)(table))table = table.parentElement;
        scrollRef.current = table;
    }, [
        containerRef
    ]);
    (0, $ke19Y$reactariaprivateutilsuseResizeObserver.useResizeObserver)({
        ref: scrollRef,
        box: 'border-box',
        onResize () {
            setWidth(scrollRef.current?.clientWidth ?? 0);
        }
    });
    (0, $ke19Y$reactariaprivateutilsuseLayoutEffect.useLayoutEffect)(()=>{
        setWidth(scrollRef.current?.clientWidth ?? 0);
    }, []);
    let ctx = (0, $ke19Y$react.useMemo)(()=>({
            tableRef: tableRef,
            scrollRef: scrollRef,
            tableWidth: width,
            useTableColumnResizeState: $ke19Y$reactstatelyuseTableState.useTableColumnResizeState,
            onResizeStart: props.onResizeStart,
            onResize: props.onResize,
            onResizeEnd: props.onResizeEnd
        }), [
        tableRef,
        width,
        props.onResizeStart,
        props.onResize,
        props.onResizeEnd
    ]);
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        render: props.render,
        ...(0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
            global: true
        }),
        ref: containerRef,
        className: props.className || 'react-aria-ResizableTableContainer',
        style: props.style,
        onScroll: props.onScroll
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$ResizableTableContainerContext.Provider, {
        value: ctx
    }, props.children));
});
const $af9b3e5459f1bf61$export$93e4b0b2cc49b648 = /*#__PURE__*/ (0, $ke19Y$react.createContext)(null);
const $af9b3e5459f1bf61$export$38de1cb0526c21fb = /*#__PURE__*/ (0, $ke19Y$react.createContext)(null);
const $af9b3e5459f1bf61$export$a2680a798823803c = /*#__PURE__*/ (0, $ke19Y$react.createContext)(null);
const $af9b3e5459f1bf61$export$54ec01a60f47d33d = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function Table(props, ref) {
    [props, ref] = (0, $048d76b84370f141$exports.useContextProps)(props, ref, $af9b3e5459f1bf61$export$93e4b0b2cc49b648);
    // Separate selection state so we have access to it from collection components via useTableOptions.
    let selectionState = (0, $ke19Y$reactstatelyuseMultipleSelectionState.useMultipleSelectionState)(props);
    let { selectionBehavior: selectionBehavior, selectionMode: selectionMode, disallowEmptySelection: disallowEmptySelection } = selectionState;
    let hasDragHooks = !!props.dragAndDropHooks?.useDraggableCollectionState;
    let ctx = (0, $ke19Y$react.useMemo)(()=>({
            selectionBehavior: selectionMode === 'none' ? null : selectionBehavior,
            selectionMode: selectionMode,
            disallowEmptySelection: disallowEmptySelection,
            allowsDragging: hasDragHooks
        }), [
        selectionBehavior,
        selectionMode,
        disallowEmptySelection,
        hasDragHooks
    ]);
    let content = /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableOptionsContext.Provider, {
        value: ctx
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $ke19Y$reactariaCollection.Collection), props));
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $ke19Y$reactariaCollectionBuilder.CollectionBuilder), {
        content: content,
        createCollection: ()=>new $af9b3e5459f1bf61$var$TableCollection()
    }, (collection)=>/*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableInner, {
            props: props,
            forwardedRef: ref,
            selectionState: selectionState,
            collection: collection
        }));
});
let $af9b3e5459f1bf61$var$TableElementType = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function TableElementType(props, ref) {
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    if (isVirtualized) return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        ...props,
        ref: ref
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).table, {
        ...props,
        ref: ref
    });
});
const $af9b3e5459f1bf61$var$EXPANSION_KEYS = {
    'expand': {
        ltr: 'ArrowRight',
        rtl: 'ArrowLeft'
    },
    'collapse': {
        ltr: 'ArrowLeft',
        rtl: 'ArrowRight'
    }
};
function $af9b3e5459f1bf61$var$TableInner({ props: props, forwardedRef: ref, selectionState: selectionState, collection: collection }) {
    [props, ref] = (0, $048d76b84370f141$exports.useContextProps)(props, ref, (0, $433949643203e332$exports.SelectableCollectionContext));
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    let { shouldUseVirtualFocus: shouldUseVirtualFocus, disallowTypeAhead: disallowTypeAhead, filter: filter, ...DOMCollectionProps } = props;
    let tableContainerContext = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$var$ResizableTableContainerContext);
    ref = (0, $ke19Y$reactariauseObjectRef.useObjectRef)((0, $ke19Y$react.useMemo)(()=>(0, $ke19Y$reactariamergeRefs.mergeRefs)(ref, tableContainerContext?.tableRef), [
        ref,
        tableContainerContext?.tableRef
    ]));
    let [expandedKeys, setExpandedKeys] = (0, $ke19Y$reactstatelyuseControlledState.useControlledState)(props.expandedKeys ? new Set(props.expandedKeys) : undefined, props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : new Set(), props.onExpandedChange);
    collection = (0, $ke19Y$react.useMemo)(()=>collection.withExpandedKeys(expandedKeys), [
        collection,
        expandedKeys
    ]);
    let tableState = (0, $ke19Y$reactstatelyuseTableState.useTableState)({
        ...DOMCollectionProps,
        collection: collection,
        children: undefined,
        UNSAFE_selectionState: selectionState,
        expandedKeys: expandedKeys,
        onExpandedChange: setExpandedKeys
    });
    let filteredState = (0, $ke19Y$reactstatelyuseTableState.UNSTABLE_useFilteredTableState)(tableState, filter);
    let { isVirtualized: isVirtualized, layoutDelegate: layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate, CollectionRoot: CollectionRoot } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    let { dragAndDropHooks: dragAndDropHooks } = props;
    let { gridProps: gridProps } = (0, $ke19Y$reactariauseTable.useTable)({
        ...DOMCollectionProps,
        layoutDelegate: layoutDelegate,
        isVirtualized: isVirtualized
    }, filteredState, ref);
    let selectionManager = filteredState.selectionManager;
    let hasDragHooks = !!dragAndDropHooks?.useDraggableCollectionState;
    let hasDropHooks = !!dragAndDropHooks?.useDroppableCollectionState;
    let dragHooksProvided = (0, $ke19Y$react.useRef)(hasDragHooks);
    let dropHooksProvided = (0, $ke19Y$react.useRef)(hasDropHooks);
    (0, $ke19Y$react.useEffect)(()=>{
        if (process.env.NODE_ENV === 'production') return;
        if (dragHooksProvided.current !== hasDragHooks) console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');
        if (dropHooksProvided.current !== hasDropHooks) console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');
    }, [
        hasDragHooks,
        hasDropHooks
    ]);
    let dragState = undefined;
    let dropState = undefined;
    let droppableCollection = undefined;
    let isRootDropTarget = false;
    let dragPreview = null;
    let preview = (0, $ke19Y$react.useRef)(null);
    let { direction: direction } = (0, $ke19Y$reactariaI18nProvider.useLocale)();
    let [treeDropTargetDelegate] = (0, $ke19Y$react.useState)(()=>new (0, $56f56e0916461149$exports.TreeDropTargetDelegate)());
    if (hasDragHooks && dragAndDropHooks) {
        dragState = dragAndDropHooks.useDraggableCollectionState({
            collection: filteredState.collection,
            selectionManager: selectionManager,
            preview: dragAndDropHooks.renderDragPreview ? preview : undefined
        });
        dragAndDropHooks.useDraggableCollection({}, dragState, ref);
        let DragPreview = dragAndDropHooks.DragPreview;
        dragPreview = dragAndDropHooks.renderDragPreview ? /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement(DragPreview, {
            ref: preview
        }, dragAndDropHooks.renderDragPreview) : null;
    }
    if (hasDropHooks && dragAndDropHooks) {
        dropState = dragAndDropHooks.useDroppableCollectionState({
            collection: filteredState.collection,
            selectionManager: selectionManager
        });
        let keyboardDelegate = new (0, $ke19Y$reactariaListKeyboardDelegate.ListKeyboardDelegate)({
            collection: filteredState.collection,
            disabledKeys: selectionManager.disabledKeys,
            disabledBehavior: selectionManager.disabledBehavior,
            ref: ref,
            layoutDelegate: layoutDelegate
        });
        let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection.rows, ref);
        treeDropTargetDelegate.setup(dropTargetDelegate, tableState, direction);
        droppableCollection = dragAndDropHooks.useDroppableCollection({
            keyboardDelegate: keyboardDelegate,
            dropTargetDelegate: treeDropTargetDelegate,
            onDropActivate: (e)=>{
                // Expand collapsed item when dragging over. For keyboard, allow collapsing.
                if (e.target.type === 'item') {
                    let key = e.target.key;
                    let item = tableState.collection.getItem(key);
                    let isExpanded = expandedKeys.has(key);
                    if (item && item.hasChildNodes && (!isExpanded || dragAndDropHooks?.isVirtualDragging?.())) tableState.toggleKey(key);
                }
            },
            onKeyDown: (e)=>{
                let target = dropState?.target;
                if (target && target.type === 'item' && target.dropPosition === 'on') {
                    let item = tableState.collection.getItem(target.key);
                    if (e.key === $af9b3e5459f1bf61$var$EXPANSION_KEYS['expand'][direction] && item?.hasChildNodes && !tableState.expandedKeys.has(target.key)) tableState.toggleKey(target.key);
                    else if (e.key === $af9b3e5459f1bf61$var$EXPANSION_KEYS['collapse'][direction] && item?.hasChildNodes && tableState.expandedKeys.has(target.key)) tableState.toggleKey(target.key);
                }
            }
        }, dropState, ref);
        isRootDropTarget = dropState.isDropTarget({
            type: 'root'
        });
    }
    let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $ke19Y$reactariauseFocusRing.useFocusRing)();
    let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
        ...props,
        children: undefined,
        defaultClassName: 'react-aria-Table',
        values: {
            isDropTarget: isRootDropTarget,
            isFocused: isFocused,
            isFocusVisible: isFocusVisible,
            state: filteredState
        }
    });
    let isListDraggable = !!(hasDragHooks && !dragState?.isDisabled);
    let style = renderProps.style;
    let layoutState = null;
    if (tableContainerContext) {
        layoutState = tableContainerContext.useTableColumnResizeState({
            tableWidth: tableContainerContext.tableWidth
        }, filteredState);
        if (!isVirtualized) style = {
            ...style,
            tableLayout: 'fixed',
            width: 'fit-content'
        };
    }
    let DOMProps = (0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
        global: true
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.Provider), {
        values: [
            [
                $af9b3e5459f1bf61$export$38de1cb0526c21fb,
                filteredState
            ],
            [
                $af9b3e5459f1bf61$export$a2680a798823803c,
                layoutState
            ],
            [
                (0, $d3d8871226fc64f2$exports.DragAndDropContext),
                {
                    dragAndDropHooks: dragAndDropHooks,
                    dragState: dragState,
                    dropState: dropState
                }
            ],
            [
                (0, $d3d8871226fc64f2$exports.DropIndicatorContext),
                {
                    render: $af9b3e5459f1bf61$var$TableDropIndicatorWrapper
                }
            ],
            [
                (0, $433949643203e332$exports.SelectableCollectionContext),
                null
            ],
            [
                (0, $433949643203e332$exports.FieldInputContext),
                null
            ]
        ]
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $ke19Y$reactariaFocusScope.FocusScope), null, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableElementType, {
        ...(0, $ke19Y$reactariamergeProps.mergeProps)(DOMProps, renderProps, gridProps, focusProps, droppableCollection?.collectionProps),
        style: style,
        ref: ref,
        slot: props.slot || undefined,
        onScroll: props.onScroll,
        "data-allows-dragging": isListDraggable || undefined,
        "data-drop-target": isRootDropTarget || undefined,
        "data-focused": isFocused || undefined,
        "data-focus-visible": isFocusVisible || undefined
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $9a60bd90621ebc78$exports.SharedElementTransition), null, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement(CollectionRoot, {
        collection: filteredState.collection,
        scrollRef: tableContainerContext?.scrollRef ?? ref,
        persistedKeys: (0, $d3d8871226fc64f2$exports.useDndPersistedKeys)(selectionManager, dragAndDropHooks, dropState)
    })))), dragPreview);
}
const $af9b3e5459f1bf61$var$TableOptionsContext = /*#__PURE__*/ (0, $ke19Y$react.createContext)(null);
function $af9b3e5459f1bf61$export$fddc468cd8cb4db9() {
    return (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$var$TableOptionsContext);
}
class $af9b3e5459f1bf61$var$TableHeaderNode extends (0, $ke19Y$reactariaprivatecollectionsBaseCollection.CollectionNode) {
    static{
        this.type = 'tableheader';
    }
}
let $af9b3e5459f1bf61$var$THeadElementType = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function THeadElementType(props, ref) {
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    if (isVirtualized) return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        ...props,
        ref: ref
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).thead, {
        ...props,
        ref: ref
    });
});
const $af9b3e5459f1bf61$export$f850895b287ef28e = /*#__PURE__*/ (0, $ke19Y$reactariaCollectionBuilder.createBranchComponent)($af9b3e5459f1bf61$var$TableHeaderNode, (props, ref)=>{
    let collection = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$38de1cb0526c21fb).collection;
    let headerRows = (0, $ke19Y$reactariaprivatecollectionsuseCachedChildren.useCachedChildren)({
        items: collection.headerRows,
        children: (0, $ke19Y$react.useCallback)((item)=>{
            switch(item.type){
                case 'headerrow':
                    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableHeaderRow, {
                        item: item
                    });
                default:
                    throw new Error('Unsupported node type in TableHeader: ' + item.type);
            }
        }, [])
    });
    let { rowGroupProps: rowGroupProps } = (0, $ke19Y$reactariauseTable.useTableRowGroup)();
    let { hoverProps: hoverProps, isHovered: isHovered } = (0, $ke19Y$reactariauseHover.useHover)({
        onHoverStart: props.onHoverStart,
        onHoverChange: props.onHoverChange,
        onHoverEnd: props.onHoverEnd
    });
    let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
        ...props,
        children: undefined,
        defaultClassName: 'react-aria-TableHeader',
        values: {
            isHovered: isHovered
        }
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$THeadElementType, {
        ...(0, $ke19Y$reactariamergeProps.mergeProps)((0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
            global: true
        }), rowGroupProps, hoverProps),
        ...renderProps,
        ref: ref,
        "data-hovered": isHovered || undefined
    }, headerRows);
}, (props)=>/*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $ke19Y$reactariaCollection.Collection), {
        dependencies: props.dependencies,
        items: props.columns
    }, props.children));
let $af9b3e5459f1bf61$var$TableHeaderRowElementType = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function TableHeaderRowElementType(props, ref) {
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    if (isVirtualized) return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement("div", {
        ...props,
        ref: ref
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement("tr", {
        ...props,
        ref: ref
    });
});
function $af9b3e5459f1bf61$var$TableHeaderRow({ item: item }) {
    let ref = (0, $ke19Y$react.useRef)(null);
    let state = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$38de1cb0526c21fb);
    let { isVirtualized: isVirtualized, CollectionBranch: CollectionBranch } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    let { rowProps: rowProps } = (0, $ke19Y$reactariauseTable.useTableHeaderRow)({
        node: item,
        isVirtualized: isVirtualized
    }, state, ref);
    let { checkboxProps: checkboxProps } = (0, $ke19Y$reactariauseTable.useTableSelectAllCheckbox)(state);
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableHeaderRowElementType, {
        ...rowProps,
        ref: ref
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.Provider), {
        values: [
            [
                (0, $365d89633c2041bc$exports.CheckboxContext),
                {
                    slots: {
                        selection: checkboxProps
                    }
                }
            ]
        ]
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement(CollectionBranch, {
        collection: state.collection,
        parent: item
    })));
}
class $af9b3e5459f1bf61$var$TableColumnNode extends (0, $ke19Y$reactariaprivatecollectionsBaseCollection.CollectionNode) {
    static{
        this.type = 'column';
    }
}
let $af9b3e5459f1bf61$var$ColumnElementType = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function ColumnElementType(props, ref) {
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    if (isVirtualized) return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        ...props,
        ref: ref
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).th, {
        ...props,
        ref: ref
    });
});
const $af9b3e5459f1bf61$export$816b5d811295e6bc = /*#__PURE__*/ (0, $ke19Y$reactariaCollectionBuilder.createLeafComponent)($af9b3e5459f1bf61$var$TableColumnNode, (props, forwardedRef, column)=>{
    let ref = (0, $ke19Y$reactariauseObjectRef.useObjectRef)(forwardedRef);
    let state = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$38de1cb0526c21fb);
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    let { columnHeaderProps: columnHeaderProps, isPressed: isPressed } = (0, $ke19Y$reactariauseTable.useTableColumnHeader)({
        node: column,
        isVirtualized: isVirtualized
    }, state, ref);
    let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $ke19Y$reactariauseFocusRing.useFocusRing)();
    let layoutState = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$a2680a798823803c);
    let isResizing = false;
    if (layoutState) isResizing = layoutState.resizingColumn === column.key;
    else if (process.env.NODE_ENV !== 'production') {
        for(let prop in [
            'width',
            'defaultWidth',
            'minWidth',
            'maxWidth'
        ])if (prop in column.props) console.warn(`The ${prop} prop on a <Column> only applies when a <Table> is wrapped in a <ResizableTableContainer>. If you aren't using column resizing, you can set the width of a column with CSS.`);
    }
    let { hoverProps: hoverProps, isHovered: isHovered } = (0, $ke19Y$reactariauseHover.useHover)({
        isDisabled: !props.allowsSorting
    });
    let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
        ...props,
        id: undefined,
        children: column.rendered,
        defaultClassName: 'react-aria-Column',
        values: {
            isHovered: isHovered,
            isPressed: isPressed,
            isFocused: isFocused,
            isFocusVisible: isFocusVisible,
            allowsSorting: column.props.allowsSorting,
            sortDirection: state.sortDescriptor?.column === column.key ? state.sortDescriptor.direction : undefined,
            isResizing: isResizing,
            startResize: ()=>{
                if (layoutState) {
                    layoutState.startResize(column.key);
                    state.setKeyboardNavigationDisabled(true);
                } else throw new Error('Wrap your <Table> in a <ResizableTableContainer> to enable column resizing');
            },
            sort: (direction)=>{
                state.sort(column.key, direction);
            }
        }
    });
    let style = renderProps.style;
    if (layoutState) style = {
        ...style,
        width: layoutState.getColumnWidth(column.key)
    };
    let DOMProps = (0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
        global: true
    });
    delete DOMProps.id;
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$ColumnElementType, {
        ...(0, $ke19Y$reactariamergeProps.mergeProps)(DOMProps, columnHeaderProps, focusProps, hoverProps),
        ...renderProps,
        style: style,
        ref: ref,
        "data-hovered": isHovered || undefined,
        "data-pressed": isPressed || undefined,
        "data-focused": isFocused || undefined,
        "data-focus-visible": isFocusVisible || undefined,
        "data-resizing": isResizing || undefined,
        "data-allows-sorting": column.props.allowsSorting || undefined,
        "data-sort-direction": state.sortDescriptor?.column === column.key ? state.sortDescriptor.direction : undefined
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.Provider), {
        values: [
            [
                $af9b3e5459f1bf61$var$ColumnResizerContext,
                {
                    column: column,
                    triggerRef: ref
                }
            ],
            [
                (0, $f7b82bedbb70abac$exports.CollectionRendererContext),
                (0, $f7b82bedbb70abac$exports.DefaultCollectionRenderer)
            ]
        ]
    }, renderProps.children));
});
const $af9b3e5459f1bf61$var$ColumnResizerContext = /*#__PURE__*/ (0, $ke19Y$react.createContext)(null);
const $af9b3e5459f1bf61$export$ee689e97a7664bfd = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function ColumnResizer(props, ref) {
    let layoutState = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$a2680a798823803c);
    if (!layoutState) throw new Error('Wrap your <Table> in a <ResizableTableContainer> to enable column resizing');
    let stringFormatter = (0, $ke19Y$reactariauseLocalizedStringFormatter.useLocalizedStringFormatter)((0, ($parcel$interopDefault($5724b511a2687756$exports))), 'react-aria-components');
    let { onResizeStart: onResizeStart, onResize: onResize, onResizeEnd: onResizeEnd } = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$var$ResizableTableContainerContext);
    let { column: column, triggerRef: triggerRef } = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$var$ColumnResizerContext);
    let inputRef = (0, $ke19Y$react.useRef)(null);
    let { resizerProps: resizerProps, inputProps: inputProps, isResizing: isResizing } = (0, $ke19Y$reactariauseTable.useTableColumnResize)({
        column: column,
        'aria-label': props['aria-label'] || stringFormatter.format('tableResizer'),
        onResizeStart: onResizeStart,
        onResize: onResize,
        onResizeEnd: onResizeEnd,
        triggerRef: triggerRef
    }, layoutState, inputRef);
    let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $ke19Y$reactariauseFocusRing.useFocusRing)();
    let { hoverProps: hoverProps, isHovered: isHovered } = (0, $ke19Y$reactariauseHover.useHover)(props);
    let isEResizable = layoutState.getColumnMinWidth(column.key) >= layoutState.getColumnWidth(column.key);
    let isWResizable = layoutState.getColumnMaxWidth(column.key) <= layoutState.getColumnWidth(column.key);
    let { direction: direction } = (0, $ke19Y$reactariaI18nProvider.useLocale)();
    let resizableDirection = 'both';
    if (isEResizable) resizableDirection = direction === 'rtl' ? 'right' : 'left';
    else if (isWResizable) resizableDirection = direction === 'rtl' ? 'left' : 'right';
    else resizableDirection = 'both';
    let objectRef = (0, $ke19Y$reactariauseObjectRef.useObjectRef)(ref);
    let [cursor, setCursor] = (0, $ke19Y$react.useState)('');
    (0, $ke19Y$react.useEffect)(()=>{
        if (!objectRef.current) return;
        let style = window.getComputedStyle(objectRef.current);
        setCursor(style.cursor);
    }, [
        objectRef,
        resizableDirection
    ]);
    let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
        ...props,
        defaultClassName: 'react-aria-ColumnResizer',
        values: {
            isFocused: isFocused,
            isFocusVisible: isFocusVisible,
            isResizing: isResizing,
            isHovered: isHovered,
            resizableDirection: resizableDirection
        }
    });
    let [isMouseDown, setMouseDown] = (0, $ke19Y$react.useState)(false);
    let onPointerDown = (e)=>{
        if (e.pointerType === 'mouse') setMouseDown(true);
    };
    if (!isResizing && isMouseDown) setMouseDown(false);
    let DOMProps = (0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
        global: true
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        ref: objectRef,
        role: "presentation",
        ...(0, $ke19Y$reactariamergeProps.mergeProps)(DOMProps, renderProps, resizerProps, {
            onPointerDown: onPointerDown
        }, hoverProps),
        "data-hovered": isHovered || undefined,
        "data-focused": isFocused || undefined,
        "data-focus-visible": isFocusVisible || undefined,
        "data-resizing": isResizing || undefined,
        "data-resizable-direction": resizableDirection
    }, renderProps.children, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement("input", {
        ref: inputRef,
        ...(0, $ke19Y$reactariamergeProps.mergeProps)(inputProps, focusProps)
    }), isResizing && isMouseDown && /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$reactdom))).createPortal(/*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement("div", {
        style: {
            position: 'fixed',
            top: 0,
            left: 0,
            bottom: 0,
            right: 0,
            cursor: cursor
        }
    }), document.body));
});
class $af9b3e5459f1bf61$var$TableBodyNode extends (0, $ke19Y$reactariaprivatecollectionsBaseCollection.FilterableNode) {
    static{
        this.type = 'tablebody';
    }
}
let $af9b3e5459f1bf61$var$TableBodyElementType = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function TableBodyElementType(props, ref) {
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    if (isVirtualized) return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        ...props,
        ref: ref
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).tbody, {
        ...props,
        ref: ref
    });
});
const $af9b3e5459f1bf61$export$76ccd210b9029917 = /*#__PURE__*/ (0, $ke19Y$reactariaCollectionBuilder.createBranchComponent)($af9b3e5459f1bf61$var$TableBodyNode, (props, ref)=>{
    let state = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$38de1cb0526c21fb);
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    let collection = state.collection;
    let { CollectionBranch: CollectionBranch } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    let { dragAndDropHooks: dragAndDropHooks, dropState: dropState } = (0, $ke19Y$react.useContext)((0, $d3d8871226fc64f2$exports.DragAndDropContext));
    let isDroppable = !!dragAndDropHooks?.useDroppableCollectionState && !dropState?.isDisabled;
    let isRootDropTarget = isDroppable && !!dropState && (dropState.isDropTarget({
        type: 'root'
    }) ?? false);
    let isEmpty = collection.size === 0;
    let renderValues = {
        isDropTarget: isRootDropTarget,
        isEmpty: isEmpty
    };
    let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
        ...props,
        id: undefined,
        children: undefined,
        defaultClassName: 'react-aria-TableBody',
        values: renderValues
    });
    let emptyState;
    let numColumns = collection.columnCount;
    if (isEmpty && props.renderEmptyState && state) {
        let rowProps = {};
        let rowHeaderProps = {};
        let style = {};
        if (isVirtualized) {
            rowHeaderProps['aria-colspan'] = numColumns;
            style = {
                display: 'contents'
            };
        } else rowHeaderProps['colSpan'] = numColumns;
        emptyState = /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableRowElementType, {
            role: "row",
            ...rowProps,
            style: style
        }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableCellElementType, {
            role: "rowheader",
            ...rowHeaderProps,
            style: style
        }, props.renderEmptyState(renderValues)));
    }
    let { rowGroupProps: rowGroupProps } = (0, $ke19Y$reactariauseTable.useTableRowGroup)();
    let DOMProps = (0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
        global: true
    });
    // TODO: TableBody doesn't support being the scrollable body of the table yet, to revisit if needed. Would need to
    // call useLoadMore here and walk up the DOM to the nearest scrollable element to set scrollRef
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableBodyElementType, {
        ...(0, $ke19Y$reactariamergeProps.mergeProps)(DOMProps, renderProps, rowGroupProps),
        ref: ref,
        "data-empty": isEmpty || undefined
    }, isDroppable && /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$RootDropIndicator, null), /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement(CollectionBranch, {
        collection: collection,
        parent: collection.body,
        renderDropIndicator: (0, $d3d8871226fc64f2$exports.useRenderDropIndicator)(dragAndDropHooks, dropState)
    }), emptyState);
});
class $af9b3e5459f1bf61$var$TableRowNode extends (0, $ke19Y$reactariaprivatecollectionsBaseCollection.CollectionNode) {
    static{
        this.type = 'item';
    }
    filter(collection, newCollection, filterFn) {
        let cells = collection.getChildren(this.key);
        for (let cell of cells)if (filterFn(cell.textValue, cell)) {
            let clone = this.clone();
            newCollection.addDescendants(clone, collection);
            return clone;
        }
        return null;
    }
}
let $af9b3e5459f1bf61$var$TableRowElementType = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function TableRowElementType(props, ref) {
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    if (isVirtualized) return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        ...props,
        ref: ref
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).tr, {
        ...props,
        ref: ref
    });
});
const $af9b3e5459f1bf61$export$b59bdbef9ce70de2 = /*#__PURE__*/ (0, $ke19Y$reactariaCollectionBuilder.createBranchComponent)($af9b3e5459f1bf61$var$TableRowNode, (props, forwardedRef, item)=>{
    let ref = (0, $ke19Y$reactariauseObjectRef.useObjectRef)(forwardedRef);
    let state = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$38de1cb0526c21fb);
    let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (0, $ke19Y$react.useContext)((0, $d3d8871226fc64f2$exports.DragAndDropContext));
    let { isVirtualized: isVirtualized, CollectionBranch: CollectionBranch } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    let { rowProps: rowProps, expandButtonProps: expandButtonProps, ...states } = (0, $ke19Y$reactariauseTable.useTableRow)({
        node: item,
        shouldSelectOnPressUp: !!dragState,
        isVirtualized: isVirtualized
    }, state, ref);
    let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $ke19Y$reactariauseFocusRing.useFocusRing)();
    let { isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps } = (0, $ke19Y$reactariauseFocusRing.useFocusRing)({
        within: true
    });
    let { hoverProps: hoverProps, isHovered: isHovered } = (0, $ke19Y$reactariauseHover.useHover)({
        isDisabled: !states.allowsSelection && !states.hasAction,
        onHoverStart: props.onHoverStart,
        onHoverChange: props.onHoverChange,
        onHoverEnd: props.onHoverEnd
    });
    let { checkboxProps: checkboxProps } = (0, $ke19Y$reactariauseTable.useTableSelectionCheckbox)({
        key: item.key
    }, state);
    let draggableItem = undefined;
    if (dragState && dragAndDropHooks) draggableItem = dragAndDropHooks.useDraggableItem({
        key: item.key,
        hasDragButton: true
    }, dragState);
    let dropIndicator = undefined;
    let dropIndicatorRef = (0, $ke19Y$react.useRef)(null);
    let { visuallyHiddenProps: visuallyHiddenProps } = (0, $ke19Y$reactariaVisuallyHidden.useVisuallyHidden)();
    if (dropState && dragAndDropHooks) dropIndicator = dragAndDropHooks.useDropIndicator({
        target: {
            type: 'item',
            key: item.key,
            dropPosition: 'on'
        }
    }, dropState, dropIndicatorRef);
    let dragButtonRef = (0, $ke19Y$react.useRef)(null);
    (0, $ke19Y$react.useEffect)(()=>{
        if (dragState && !dragButtonRef.current && process.env.NODE_ENV !== 'production') console.warn('Draggable items in a Table must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.');
    // eslint-disable-next-line
    }, []);
    let isDragging = dragState && dragState.isDragging(item.key);
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    let { children: _, ...restProps } = props;
    let hasChildItems = props.hasChildItems || state.collection.getItem(item.lastChildKey)?.type !== 'cell';
    let isExpanded = hasChildItems && state.expandedKeys.has(item.key);
    let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
        ...restProps,
        id: undefined,
        defaultClassName: 'react-aria-Row',
        defaultStyle: {
            // @ts-ignore
            '--table-row-level': item.level + 1
        },
        values: {
            ...states,
            isHovered: isHovered,
            isFocused: isFocused,
            isFocusVisible: isFocusVisible,
            selectionMode: state.selectionManager.selectionMode,
            selectionBehavior: state.selectionManager.selectionBehavior,
            isDragging: isDragging,
            isDropTarget: dropIndicator?.isDropTarget,
            isFocusVisibleWithin: isFocusVisibleWithin,
            id: item.key,
            hasChildItems: hasChildItems,
            isExpanded: isExpanded,
            level: item.level + 1
        }
    });
    let DOMProps = (0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
        global: true
    });
    delete DOMProps.id;
    delete DOMProps.onClick;
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, ($parcel$interopDefault($ke19Y$react))).Fragment, null, dropIndicator && !dropIndicator.isHidden && /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableRowElementType, {
        role: "row",
        style: {
            height: 0
        }
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableCellElementType, {
        role: "gridcell",
        colSpan: state.collection.columnCount,
        style: {
            padding: 0
        }
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement("div", {
        role: "button",
        ...visuallyHiddenProps,
        ...dropIndicator.dropIndicatorProps,
        ref: dropIndicatorRef
    }))), /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableRowElementType, {
        ...(0, $ke19Y$reactariamergeProps.mergeProps)(DOMProps, renderProps, rowProps, focusProps, hoverProps, draggableItem?.dragProps, focusWithinProps),
        ref: ref,
        "data-disabled": states.isDisabled || undefined,
        "data-selected": states.isSelected || undefined,
        "data-hovered": isHovered || undefined,
        "data-focused": states.isFocused || undefined,
        "data-focus-visible": isFocusVisible || undefined,
        "data-pressed": states.isPressed || undefined,
        "data-dragging": isDragging || undefined,
        "data-drop-target": dropIndicator?.isDropTarget || undefined,
        "data-selection-mode": state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode,
        "data-focus-visible-within": isFocusVisibleWithin || undefined,
        "data-expanded": isExpanded || undefined,
        "data-has-child-items": hasChildItems || undefined,
        "data-level": item.level + 1
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.Provider), {
        values: [
            [
                (0, $365d89633c2041bc$exports.CheckboxContext),
                {
                    slots: {
                        [(0, $048d76b84370f141$exports.DEFAULT_SLOT)]: {},
                        selection: checkboxProps
                    }
                }
            ],
            [
                (0, $16c7f9b22cce3838$exports.ButtonContext),
                {
                    slots: {
                        [(0, $048d76b84370f141$exports.DEFAULT_SLOT)]: {},
                        chevron: expandButtonProps,
                        drag: {
                            ...draggableItem?.dragButtonProps,
                            ref: dragButtonRef,
                            style: {
                                pointerEvents: 'none'
                            }
                        }
                    }
                }
            ],
            [
                (0, $61557b2a9b2862a8$exports.SelectionIndicatorContext),
                {
                    isSelected: states.isSelected
                }
            ]
        ]
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement(CollectionBranch, {
        collection: state.collection,
        parent: item
    }))));
}, (props)=>{
    if (props.id == null && typeof props.children === 'function') throw new Error('No id detected for the Row element. The Row element requires a id to be provided to it when the cells are rendered dynamically.');
    let dependencies = [
        props.value
    ].concat(props.dependencies);
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $ke19Y$reactariaCollection.Collection), {
        dependencies: dependencies,
        items: props.columns,
        idScope: props.id
    }, props.children);
});
class $af9b3e5459f1bf61$var$TableCellNode extends (0, $ke19Y$reactariaprivatecollectionsBaseCollection.CollectionNode) {
    static{
        this.type = 'cell';
    }
}
let $af9b3e5459f1bf61$var$TableCellElementType = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function TableCellElementType(props, ref) {
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    if (isVirtualized) return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        ...props,
        ref: ref
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).td, {
        ...props,
        ref: ref
    });
});
const $af9b3e5459f1bf61$export$f6f0c3fe4ec306ea = /*#__PURE__*/ (0, $ke19Y$reactariaCollectionBuilder.createLeafComponent)($af9b3e5459f1bf61$var$TableCellNode, (props, forwardedRef, cell)=>{
    let ref = (0, $ke19Y$reactariauseObjectRef.useObjectRef)(forwardedRef);
    let state = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$38de1cb0526c21fb);
    let { dragState: dragState } = (0, $ke19Y$react.useContext)((0, $d3d8871226fc64f2$exports.DragAndDropContext));
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    cell.column = state.collection.columns[cell.index];
    let { gridCellProps: gridCellProps, isPressed: isPressed } = (0, $ke19Y$reactariauseTable.useTableCell)({
        node: cell,
        shouldSelectOnPressUp: !!dragState,
        isVirtualized: isVirtualized
    }, state, ref);
    let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $ke19Y$reactariauseFocusRing.useFocusRing)();
    let { hoverProps: hoverProps, isHovered: isHovered } = (0, $ke19Y$reactariauseHover.useHover)({});
    let isSelected = cell.parentKey != null ? state.selectionManager.isSelected(cell.parentKey) : false;
    // colIndex is null, when there is so span, falling back to using the index
    let columnIndex = cell.colIndex || cell.index;
    let row = state.collection.getItem(cell.parentKey);
    let hasChildItems = row.props.hasChildItems || state.collection.getItem(row.lastChildKey)?.type !== 'cell';
    let isExpanded = hasChildItems && state.expandedKeys.has(cell.parentKey);
    let isDisabled = state.selectionManager.isDisabled(cell.parentKey);
    let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
        ...props,
        id: undefined,
        defaultClassName: 'react-aria-Cell',
        values: {
            isFocused: isFocused,
            isFocusVisible: isFocusVisible,
            isPressed: isPressed,
            isHovered: isHovered,
            isSelected: isSelected,
            id: cell.key,
            columnIndex: columnIndex,
            hasChildItems: hasChildItems,
            isExpanded: isExpanded,
            isDisabled: isDisabled,
            level: row.level + 1,
            isTreeColumn: cell.column.key === state.treeColumn
        }
    });
    let DOMProps = (0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
        global: true
    });
    delete DOMProps.id;
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableCellElementType, {
        ...(0, $ke19Y$reactariamergeProps.mergeProps)(DOMProps, renderProps, gridCellProps, focusProps, hoverProps),
        ref: ref,
        "data-focused": isFocused || undefined,
        "data-focus-visible": isFocusVisible || undefined,
        "data-pressed": isPressed || undefined,
        "data-selected": isSelected || undefined,
        "data-column-index": columnIndex,
        "data-expanded": isExpanded || undefined,
        "data-has-child-items": hasChildItems || undefined,
        "data-level": row.level + 1,
        "data-tree-column": cell.column.key === state.treeColumn || undefined,
        "data-disabled": isDisabled || undefined
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $f7b82bedbb70abac$exports.CollectionRendererContext).Provider, {
        value: (0, $f7b82bedbb70abac$exports.DefaultCollectionRenderer)
    }, renderProps.children));
});
function $af9b3e5459f1bf61$var$TableDropIndicatorWrapper(props, ref) {
    ref = (0, $ke19Y$reactariauseObjectRef.useObjectRef)(ref);
    let { dragAndDropHooks: dragAndDropHooks, dropState: dropState } = (0, $ke19Y$react.useContext)((0, $d3d8871226fc64f2$exports.DragAndDropContext));
    let buttonRef = (0, $ke19Y$react.useRef)(null);
    let { dropIndicatorProps: dropIndicatorProps, isHidden: isHidden, isDropTarget: isDropTarget } = dragAndDropHooks.useDropIndicator(props, dropState, buttonRef);
    if (isHidden) return null;
    let level = dropState && props.target.type === 'item' ? (dropState.collection.getItem(props.target.key)?.level || 0) + 1 : 1;
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableDropIndicatorForwardRef, {
        ...props,
        dropIndicatorProps: dropIndicatorProps,
        isDropTarget: isDropTarget,
        buttonRef: buttonRef,
        level: level,
        ref: ref
    });
}
let $af9b3e5459f1bf61$var$TableDropIndicatorRowElementType = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function TableDropIndicatorRowElementType(props, ref) {
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    if (isVirtualized) return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        ...props,
        ref: ref
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).tr, {
        ...props,
        ref: ref
    });
});
let $af9b3e5459f1bf61$var$TableDropIndicatorTDElementType = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)(function TableDropIndicatorTDElementType(props, ref) {
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    if (isVirtualized) return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
        ...props,
        ref: ref
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, $048d76b84370f141$exports.dom).td, {
        ...props,
        ref: ref
    });
});
function $af9b3e5459f1bf61$var$TableDropIndicator(props, ref) {
    let { dropIndicatorProps: dropIndicatorProps, isDropTarget: isDropTarget, buttonRef: buttonRef, level: level, ...otherProps } = props;
    let state = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$38de1cb0526c21fb);
    let { visuallyHiddenProps: visuallyHiddenProps } = (0, $ke19Y$reactariaVisuallyHidden.useVisuallyHidden)();
    let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
        ...otherProps,
        defaultClassName: 'react-aria-DropIndicator',
        defaultStyle: {
            // @ts-ignore
            '--table-row-level': level + 1
        },
        values: {
            isDropTarget: isDropTarget
        }
    });
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableDropIndicatorRowElementType, {
        ...(0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
            global: true
        }),
        ...renderProps,
        role: "row",
        ref: ref,
        "data-drop-target": isDropTarget || undefined,
        "aria-level": level
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableDropIndicatorTDElementType, {
        role: "gridcell",
        colSpan: state.collection.columnCount,
        style: {
            padding: 0
        }
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement("div", {
        ...visuallyHiddenProps,
        role: "button",
        ...dropIndicatorProps,
        ref: buttonRef
    }), renderProps.children));
}
const $af9b3e5459f1bf61$var$TableDropIndicatorForwardRef = /*#__PURE__*/ (0, $ke19Y$react.forwardRef)($af9b3e5459f1bf61$var$TableDropIndicator);
function $af9b3e5459f1bf61$var$RootDropIndicator() {
    let state = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$38de1cb0526c21fb);
    let { dragAndDropHooks: dragAndDropHooks, dropState: dropState } = (0, $ke19Y$react.useContext)((0, $d3d8871226fc64f2$exports.DragAndDropContext));
    let ref = (0, $ke19Y$react.useRef)(null);
    let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator({
        target: {
            type: 'root'
        }
    }, dropState, ref);
    let isDropTarget = dropState.isDropTarget({
        type: 'root'
    });
    let { visuallyHiddenProps: visuallyHiddenProps } = (0, $ke19Y$reactariaVisuallyHidden.useVisuallyHidden)();
    if (!isDropTarget && dropIndicatorProps['aria-hidden']) return null;
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableRowElementType, {
        role: "row",
        "aria-hidden": dropIndicatorProps['aria-hidden'],
        style: {
            height: 0
        }
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableCellElementType, {
        role: "gridcell",
        colSpan: state.collection.columnCount,
        style: {
            padding: 0
        }
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement("div", {
        role: "button",
        ...visuallyHiddenProps,
        ...dropIndicatorProps,
        ref: ref
    })));
}
const $af9b3e5459f1bf61$export$8f5bea0338ed243c = (0, $ke19Y$reactariaCollectionBuilder.createLeafComponent)((0, $ke19Y$reactariaprivatecollectionsBaseCollection.LoaderNode), function TableLoadingIndicator(props, ref, item) {
    let state = (0, $ke19Y$react.useContext)($af9b3e5459f1bf61$export$38de1cb0526c21fb);
    let { isVirtualized: isVirtualized } = (0, $ke19Y$react.useContext)((0, $f7b82bedbb70abac$exports.CollectionRendererContext));
    let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
    let numColumns = state.collection.columns.length;
    let sentinelRef = (0, $ke19Y$react.useRef)(null);
    let memoedLoadMoreProps = (0, $ke19Y$react.useMemo)(()=>({
            onLoadMore: onLoadMore,
            collection: state?.collection,
            sentinelRef: sentinelRef,
            scrollOffset: scrollOffset
        }), [
        onLoadMore,
        scrollOffset,
        state?.collection
    ]);
    (0, $ke19Y$reactariaprivateutilsuseLoadMoreSentinel.useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
    let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
        ...otherProps,
        id: undefined,
        children: item.rendered,
        defaultClassName: 'react-aria-TableLoadingIndicator',
        defaultStyle: {
            // @ts-ignore
            '--table-row-level': item.level + 1
        },
        values: undefined
    });
    let rowProps = {};
    let rowHeaderProps = {};
    let style = {};
    if (isVirtualized) {
        // For now don't include aria-rowindex on loader since they aren't keyboard focusable
        // Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the
        // row count
        rowHeaderProps['aria-colspan'] = numColumns;
        style = {
            display: 'contents'
        };
    } else rowHeaderProps['colSpan'] = numColumns;
    return /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement((0, ($parcel$interopDefault($ke19Y$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableRowElementType, {
        style: {
            height: 0
        },
        inert: (0, $ke19Y$reactariaprivateutilsinertValue.inertValue)(true)
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableCellElementType, {
        style: {
            padding: 0,
            border: 0
        }
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement("div", {
        "data-testid": "loadMoreSentinel",
        ref: sentinelRef,
        style: {
            position: 'relative',
            height: 1,
            width: 1
        }
    }))), isLoading && renderProps.children && /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableRowElementType, {
        ...(0, $ke19Y$reactariamergeProps.mergeProps)((0, $ke19Y$reactariafilterDOMProps.filterDOMProps)(props, {
            global: true
        }), rowProps),
        ...renderProps,
        role: "row",
        ref: ref,
        "aria-level": item.level + 1,
        "data-level": item.level + 1
    }, /*#__PURE__*/ (0, ($parcel$interopDefault($ke19Y$react))).createElement($af9b3e5459f1bf61$var$TableCellElementType, {
        role: "rowheader",
        ...rowHeaderProps,
        style: style
    }, renderProps.children)));
});


//# sourceMappingURL=Table.cjs.map
