import { jsxDEV } from "react/jsx-dev-runtime";
import { Component, useEnvironment } from "@contember/react-binding";
import { useResolvedSingleKindFileSelection } from "./selection/useResolvedSingleKindFileSelection.js";
import { createEntityConnectorFactory } from "../fileHandler/utils/createEntityConnector.js";
import { BareFileRepeater } from "./BareFileRepeater.js";
import { useCallback } from "react";
import { useSingleKindFileHandler } from "../fileHandler/useSingleKindFileHandler.js";
import { SingleKindFileHandler, isEmptyByUrlField } from "../fileHandler/SingleKindFileHandler.js";
const SingleKindFileRepeater = Component(
  (props) => {
    const env = useEnvironment();
    const connectorFactoryFactory = useCallback(
      () => createEntityConnectorFactory(env, props.baseEntity),
      [env, props.baseEntity]
    );
    return /* @__PURE__ */ jsxDEV(
      BareFileRepeater,
      {
        ...props,
        fileSelection: useResolvedSingleKindFileSelection(props, connectorFactoryFactory),
        fileHandler: useSingleKindFileHandler(props, props.kindFactory)
      },
      void 0,
      false,
      {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindFileRepeater.tsx",
        lineNumber: 35,
        columnNumber: 4
      },
      void 0
    );
  },
  (props) => /* @__PURE__ */ jsxDEV(
    BareFileRepeater,
    {
      ...props,
      fileHandler: new SingleKindFileHandler(
        props.kindFactory(props),
        isEmptyByUrlField(props.urlField)
      )
    },
    void 0,
    false,
    {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindFileRepeater.tsx",
      lineNumber: 43,
      columnNumber: 3
    },
    void 0
  ),
  "SingleKindFileRepeater"
);
export {
  SingleKindFileRepeater
};
//# sourceMappingURL=SingleKindFileRepeater.js.map
