import { createElement } from "react";
import { defaultUploader } from "../../defaultUploader.js";
import { getVideoFileDataExtractor } from "../../fileDataExtractors/getVideoFileDataExtractor.js";
import { VideoFieldView } from "../../../fieldViews/VideoFieldView.js";
import { getFileUrlDataExtractor } from "../../fileDataExtractors/getFileUrlDataExtractor.js";
import { getGenericFileMetadataExtractor } from "../../fileDataExtractors/getGenericFileMetadataExtractor.js";
const acceptVideoFile = ({ file }) => file.type.startsWith("video");
const renderVideoFilePreview = ({ objectUrl }) => /* @__PURE__ */ createElement("video", {
  src: objectUrl,
  controls: true
});
const getStockVideoFileKind = ({
  additionalExtractors = [],
  acceptMimeTypes = "video/*",
  acceptFile = acceptVideoFile,
  baseEntity,
  children,
  durationField,
  fileSizeField,
  fileTypeField,
  lastModifiedField,
  fileNameField,
  renderFilePreview = renderVideoFilePreview,
  renderUploadedFile,
  heightField,
  widthField,
  uploader = defaultUploader,
  urlField,
  childrenOutsideBaseEntity
}) => {
  const extractors = [
    getFileUrlDataExtractor({ urlField }),
    getGenericFileMetadataExtractor({ fileNameField, fileSizeField, fileTypeField, lastModifiedField }),
    getVideoFileDataExtractor({ heightField, widthField, durationField }),
    ...additionalExtractors
  ];
  return {
    acceptMimeTypes,
    acceptFile,
    renderFilePreview,
    uploader,
    renderUploadedFile: renderUploadedFile ?? /* @__PURE__ */ createElement(VideoFieldView, {
      srcField: urlField
    }),
    children,
    childrenOutsideBaseEntity,
    baseEntity,
    extractors
  };
};
export { acceptVideoFile, getStockVideoFileKind, renderVideoFilePreview };
//# sourceMappingURL=getStockVideoFileKind.js.map
