import { useContext as v, useRef as y, useLayoutEffect as u } from "react";
import { StyleSheet as h } from "./index-emotion-sheet.esm.js";
import { w as g, T as c } from "./index-emotion-element-8ce3e063.browser.esm.js";
import { C as M } from "./index-emotion-element-8ce3e063.browser.esm.js";
import "./index-hoist-non-react-statics.cjs.js";
import { insertStyles as b } from "./index-emotion-utils.browser.esm.js";
import { serializeStyles as p } from "./index-emotion-serialize.esm.js";
var E = {
  version: "11.0.0"
}, l = !1, A = /* @__PURE__ */ g(function(r, e) {
  process.env.NODE_ENV !== "production" && !l && // check for className as well since the user is
  // probably using the custom createElement which
  // means it will be turned into a className prop
  // $FlowFixMe I don't really want to add it to the type since it shouldn't be used
  (r.className || r.css) && (l = !0);
  var t = r.styles, s = p([t], void 0, typeof t == "function" || Array.isArray(t) ? v(c) : void 0), i = y();
  return u(function() {
    var n = e.key + "-global", o = new h({
      key: n,
      nonce: e.sheet.nonce,
      container: e.sheet.container,
      speedy: e.sheet.isSpeedy
    }), a = document.querySelector('style[data-emotion="' + n + " " + s.name + '"]');
    return e.sheet.tags.length && (o.before = e.sheet.tags[0]), a !== null && o.hydrate([a]), i.current = o, function() {
      o.flush();
    };
  }, [e]), u(function() {
    s.next !== void 0 && b(e, s.next, !0);
    var n = i.current;
    if (n.tags.length) {
      var o = n.tags[n.tags.length - 1].nextElementSibling;
      n.before = o, n.flush();
    }
    e.insert("", s, n, !1);
  }, [e, s.name]), null;
});
function S() {
  for (var r = arguments.length, e = new Array(r), t = 0; t < r; t++)
    e[t] = arguments[t];
  return p(e);
}
var T = function() {
  var e = S.apply(void 0, arguments), t = "animation-" + e.name;
  return {
    name: t,
    styles: "@keyframes " + t + "{" + e.styles + "}",
    anim: 1,
    toString: function() {
      return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
    }
  };
};
if (process.env.NODE_ENV !== "production") {
  var f = !0, _ = typeof jest < "u";
  if (f && !_) {
    var m = f ? window : global, d = "__EMOTION_REACT_" + E.version.split(".")[0] + "__";
    m[d], m[d] = !0;
  }
}
export {
  M as CacheProvider,
  A as Global,
  c as ThemeContext,
  S as css,
  T as keyframes,
  g as withEmotionCache
};
