import {DragAndDropContext as $49776fcddfd94ccc$export$d188a835a7bc5783, DropIndicator as $49776fcddfd94ccc$export$62ed72bc21f6b8a6, DropIndicatorContext as $49776fcddfd94ccc$export$f55761759794cf55} from "./DragAndDrop.js";
import {useDroppableItem as $deUbz$useDroppableItem, useDroppableCollection as $deUbz$useDroppableCollection, useDropIndicator as $deUbz$useDropIndicator} from "react-aria/useDroppableCollection";
import {useDraggableCollection as $deUbz$useDraggableCollection, useDraggableItem as $deUbz$useDraggableItem} from "react-aria/useDraggableCollection";
import {useDraggableCollectionState as $deUbz$useDraggableCollectionState} from "react-stately/useDraggableCollectionState";
import {DragPreview as $deUbz$DragPreview} from "react-aria/DragPreview";
import {useDroppableCollectionState as $deUbz$useDroppableCollectionState} from "react-stately/useDroppableCollectionState";
import {isVirtualDragging as $deUbz$isVirtualDragging} from "react-aria/private/dnd/DragManager";
import {useMemo as $deUbz$useMemo} from "react";
import {ListDropTargetDelegate as $deUbz$ListDropTargetDelegate} from "react-aria/ListDropTargetDelegate";

/*
 * Copyright 2022 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */ 








function $f7f9f96335a17b66$export$2cfc5be7a55829f6(options) {
    let dragAndDropHooks = (0, $deUbz$useMemo)(()=>{
        let { onDrop: onDrop, onInsert: onInsert, onItemDrop: onItemDrop, onReorder: onReorder, onMove: onMove, onRootDrop: onRootDrop, getItems: getItems, renderDragPreview: renderDragPreview, renderDropIndicator: renderDropIndicator, dropTargetDelegate: dropTargetDelegate } = options;
        let isDraggable = !!getItems;
        let isDroppable = !!(onDrop || onInsert || onItemDrop || onReorder || onMove || onRootDrop);
        let hooks = {};
        if (isDraggable) {
            hooks.useDraggableCollectionState = function useDraggableCollectionStateOverride(props) {
                return (0, $deUbz$useDraggableCollectionState)({
                    ...props,
                    ...options
                });
            };
            hooks.useDraggableCollection = (0, $deUbz$useDraggableCollection);
            hooks.useDraggableItem = (0, $deUbz$useDraggableItem);
            hooks.DragPreview = (0, $deUbz$DragPreview);
            hooks.renderDragPreview = renderDragPreview;
            hooks.isVirtualDragging = (0, $deUbz$isVirtualDragging);
        }
        if (isDroppable) {
            hooks.useDroppableCollectionState = function useDroppableCollectionStateOverride(props) {
                return (0, $deUbz$useDroppableCollectionState)({
                    ...props,
                    ...options
                });
            };
            hooks.useDroppableItem = (0, $deUbz$useDroppableItem);
            hooks.useDroppableCollection = function useDroppableCollectionOverride(props, state, ref) {
                return (0, $deUbz$useDroppableCollection)({
                    ...props,
                    ...options
                }, state, ref);
            };
            hooks.useDropIndicator = (0, $deUbz$useDropIndicator);
            hooks.renderDropIndicator = renderDropIndicator;
            hooks.dropTargetDelegate = dropTargetDelegate;
            hooks.ListDropTargetDelegate = (0, $deUbz$ListDropTargetDelegate);
        }
        return hooks;
    }, [
        options
    ]);
    return {
        dragAndDropHooks: dragAndDropHooks
    };
}


export {$f7f9f96335a17b66$export$2cfc5be7a55829f6 as useDragAndDrop, $49776fcddfd94ccc$export$62ed72bc21f6b8a6 as DropIndicator, $49776fcddfd94ccc$export$f55761759794cf55 as DropIndicatorContext, $49776fcddfd94ccc$export$d188a835a7bc5783 as DragAndDropContext};
//# sourceMappingURL=useDragAndDrop.js.map
