import { j as jsxRuntimeExports } from "../../../../../_virtual/jsx-runtime.js";
import { CollisionPriority } from "../../../../../node_modules/.pnpm/@dnd-kit_abstract@0.1.21/node_modules/@dnd-kit/abstract/index.js";
import { directionBiased } from "../../../../../node_modules/.pnpm/@dnd-kit_collision@0.1.21/node_modules/@dnd-kit/collision/dist/index.js";
import { useDroppable } from "../../../../../node_modules/.pnpm/@dnd-kit_react@0.1.21_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@dnd-kit/react/index.js";
import { tx as D } from "../../../../style-system/dist/twind.js";
function BrickRoot({
  as,
  children,
  manifest,
  className,
  editable,
  brick,
  ...props
}) {
  const droppable = useDroppable({
    id: brick.id,
    data: { brick, manifest },
    disabled: !editable || !manifest.isContainer,
    type: "brick",
    accept: (source) => source.type === "brick" || source.type === "library",
    collisionDetector: directionBiased,
    collisionPriority: CollisionPriority.High
  });
  const Component = as || "div";
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    Component,
    {
      ...props,
      ref: droppable.ref,
      className: D(
        !manifest.isContainer && "min-h-fit min-w-fit",
        "flex flex-1 rounded-[inherit] w-fill h-fill flex-wrap",
        className
      ),
      children
    }
  );
}
export {
  BrickRoot as default
};
//# sourceMappingURL=BrickRoot.js.map
