"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chunkWF7Z2VITcjs = require('./chunk-WF7Z2VIT.cjs');

// src/components/Loading.tsx
var _react = require('@emotion/react');
var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);
var _jsxruntime = require('@emotion/react/jsx-runtime');
var loadingKinds = ["primary", "secondary"];
function Loading({
  center = true,
  size = 60,
  ml = 0,
  mt = 0,
  kind = "primary",
  color = void 0
}) {
  const theme = _react.useTheme.call(void 0, );
  const iconName = resolveLoadingProp(null, kind, "defaultIconName", theme);
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LoadingWrapper, { center, ml, mt, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Rotate, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWF7Z2VITcjs.Icon, { name: iconName, width: size, color }) }) });
}
var LoadingWrapper = _styled2.default.div`
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin-left: ${({ ml }) => ml}px;
  margin-top: ${({ mt }) => mt}px;

  ${({ center }) => center && `
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 !important;
  `}
`;
var Rotate = _styled2.default.div`
  display: inline-flex;
  animation: rotate 0.5s linear infinite;

  @keyframes rotate {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
`;
function resolveLoadingProp(prop, kind, defaultKey, theme) {
  var _a;
  return (
    /** props may be unset for a given kind but theme defaults always exist,
     * so this will always resolve a value: */
    prop || ((_a = theme.loading.kinds[kind]) == null ? void 0 : _a[defaultKey]) || theme.loading[defaultKey]
  );
}





exports.loadingKinds = loadingKinds; exports.Loading = Loading; exports.LoadingWrapper = LoadingWrapper;
