"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/molecules/curriculumV2/CurriculumContents/curriculum-video.tsx
var curriculum_video_exports = {};
__export(curriculum_video_exports, {
  default: () => curriculum_video_default
});
module.exports = __toCommonJS(curriculum_video_exports);
var import_react = require("react");

// src/atoms/flex.tsx
var import_themes = require("@radix-ui/themes");

// src/atoms/spinner.tsx
var import_themes2 = require("@radix-ui/themes");

// src/molecules/curriculumV2/CurriculumContents/curriculum-video.tsx
var import_jsx_runtime = require("react/jsx-runtime");
function CurriculumVideo(props) {
  const { item } = props;
  const { url } = item;
  const [isLoading, setIsLoading] = (0, import_react.useState)(true);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
    import_themes.Flex,
    {
      align: "center",
      justify: "center",
      style: {
        width: "100%",
        height: "100%",
        backgroundColor: "black",
        position: "relative"
      },
      children: [
        isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          import_themes.Flex,
          {
            align: "center",
            height: "100%",
            justify: "center",
            position: "absolute",
            style: {
              position: "absolute",
              top: 0,
              left: 0,
              zIndex: 1,
              color: "white"
            },
            width: "100%",
            children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes2.Spinner, { size: "3", style: { width: 48, height: 48 } })
          }
        ) : null,
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          "iframe",
          {
            allowFullScreen: true,
            onLoad: () => {
              setIsLoading(false);
            },
            src: `${url}?theme=light`,
            style: { width: "100%", height: "100%", border: "none" },
            title: "Curriculum Video",
            onError: () => {
              setIsLoading(false);
            }
          }
        )
      ]
    }
  );
}
var curriculum_video_default = CurriculumVideo;
//# sourceMappingURL=curriculum-video.cjs.map