import React, { useState, useEffect } from 'react';
import VerificationCheckDisplay from './vc.check.svg';
import { C as CircleLoadingState, a as CircleSpinner } from './CircleSpinner-03a329fc.js';

const VCVerificationCheck = ({ size = "44px" }) => {
  var _a;
  const imageSize = {
    width: size,
    height: size
  };
  return /* @__PURE__ */ React.createElement("div", { className: "vc-verification-wrapper", style: { position: "relative" } }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-center bg-white rounded-full overflow-hidden" }, /* @__PURE__ */ React.createElement(
    "img",
    {
      className: "h-full w-full object-contain p-1",
      src: (_a = VerificationCheckDisplay) != null ? _a : "",
      style: imageSize,
      alt: "Verification Icon"
    }
  )));
};
const VCVerificationCheckWithSpinner = ({ size = "44px", spinnerSize = "60px", loading = true, withBorder = false }) => {
  const loadingState = loading ? CircleLoadingState.spin : CircleLoadingState.stop;
  const spinnerStyle = {
    position: "absolute",
    top: 0,
    left: 0,
    height: spinnerSize,
    width: spinnerSize
  };
  const spinnerSizeNumber = parseInt(spinnerSize.replace("px", ""));
  const offset = spinnerSizeNumber > 50 ? 3 : 2;
  return /* @__PURE__ */ React.createElement(
    "div",
    {
      style: { width: spinnerSize, height: spinnerSize, position: "relative" },
      className: `flex items-center justify-center bg-white rounded-full overflow-hidden select-none ${withBorder ? " ml-3 mr-3" : ""}`
    },
    /* @__PURE__ */ React.createElement(VCVerificationCheck, { size, loading }),
    /* @__PURE__ */ React.createElement("div", { className: "vc-verification-spinner-overlay", style: spinnerStyle }, /* @__PURE__ */ React.createElement(
      CircleSpinner,
      {
        loadingState,
        size: spinnerSizeNumber,
        marginOffset: offset
      }
    ))
  );
};
const VCVerificationCheckWithText = ({ size = "44px", spinnerSize = "60px", loading = true }) => {
  const [defaultLoading, setDefaultLoading] = useState(true);
  useEffect(() => {
    let timer1 = setTimeout(() => setDefaultLoading(false), 3 * 1e3);
    return () => {
      clearTimeout(timer1);
    };
  });
  return /* @__PURE__ */ React.createElement("div", { className: "flex justify-center items-center translate-x-[10px] w-full vc-verification-full-wrapper" }, /* @__PURE__ */ React.createElement("span", { className: "text-white font-bold tracking-wider" }, "Verified"), /* @__PURE__ */ React.createElement(
    VCVerificationCheckWithSpinner,
    {
      size,
      spinnerSize,
      loading: loading || defaultLoading,
      withBorder: true
    }
  ), /* @__PURE__ */ React.createElement("span", { className: "text-white font-bold tracking-wider" }, "Credential"));
};

export { VCVerificationCheck as V, VCVerificationCheckWithSpinner as a, VCVerificationCheckWithText as b };
//# sourceMappingURL=VCVerificationCheck-8b8b7a76.js.map
