"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const reactBindingUi = require("@contember/react-binding-ui");
const defaultUploader = require("../../defaultUploader.cjs");
const getVideoFileDataExtractor = require("../../fileDataExtractors/getVideoFileDataExtractor.cjs");
const getFileUrlDataExtractor = require("../../fileDataExtractors/getFileUrlDataExtractor.cjs");
const getGenericFileMetadataExtractor = require("../../fileDataExtractors/getGenericFileMetadataExtractor.cjs");
const acceptVideoFile = ({ file }) => file.type.startsWith("video");
const renderVideoFilePreview = ({ objectUrl }) => /* @__PURE__ */ jsxDevRuntime.jsxDEV("video", { src: objectUrl, controls: true }, void 0, false, {
  fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileKinds/factories/getStockVideoFileKind.tsx",
  lineNumber: 18,
  columnNumber: 84
}, void 0);
const getStockVideoFileKind = ({
  additionalExtractors = [],
  acceptMimeTypes = "video/*",
  acceptFile = acceptVideoFile,
  baseEntity,
  children,
  durationField,
  fileSizeField,
  fileTypeField,
  lastModifiedField,
  fileNameField,
  renderFilePreview = renderVideoFilePreview,
  renderUploadedFile,
  heightField,
  widthField,
  uploader = defaultUploader.defaultUploader,
  urlField,
  childrenOutsideBaseEntity
}) => {
  const extractors = [
    getFileUrlDataExtractor.getFileUrlDataExtractor({ urlField }),
    getGenericFileMetadataExtractor.getGenericFileMetadataExtractor({ fileNameField, fileSizeField, fileTypeField, lastModifiedField }),
    getVideoFileDataExtractor.getVideoFileDataExtractor({ heightField, widthField, durationField }),
    ...additionalExtractors
  ];
  return {
    acceptMimeTypes,
    acceptFile,
    renderFilePreview,
    uploader,
    renderUploadedFile: renderUploadedFile ?? /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBindingUi.VideoFieldView, { srcField: urlField }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileKinds/factories/getStockVideoFileKind.tsx",
      lineNumber: 50,
      columnNumber: 45
    }, void 0),
    children,
    childrenOutsideBaseEntity,
    baseEntity,
    extractors
  };
};
exports.acceptVideoFile = acceptVideoFile;
exports.getStockVideoFileKind = getStockVideoFileKind;
exports.renderVideoFilePreview = renderVideoFilePreview;
//# sourceMappingURL=getStockVideoFileKind.cjs.map
