import { createContext as d, forwardRef as O, useContext as _, createElement as y } from "react";
import P from "./index-emotion-cache.browser.esm.js";
import "./index-hoist-non-react-statics.cjs.js";
import { getRegisteredStyles as p, insertStyles as C } from "./index-emotion-utils.browser.esm.js";
import { serializeStyles as E } from "./index-emotion-serialize.esm.js";
var g = Object.prototype.hasOwnProperty, N = /* @__PURE__ */ d(
  // we're doing this to avoid preconstruct's dead code elimination in this one case
  // because this module is primarily intended for the browser and node
  // but it's also required in react native and similar environments sometimes
  // and we could have a special build just for that
  // but this is much easier and the native packages
  // might use a different theme context in the future anyway
  typeof HTMLElement < "u" ? /* @__PURE__ */ P({
    key: "css"
  }) : null
), I = N.Provider, h = function(t) {
  return /* @__PURE__ */ O(function(f, r) {
    var i = _(N);
    return t(f, i, r);
  });
}, T = /* @__PURE__ */ d({}), c = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", v = "__EMOTION_LABEL_PLEASE_DO_NOT_USE__", w = h(function(e, t, f) {
  var r = e.css;
  typeof r == "string" && t.registered[r] !== void 0 && (r = t.registered[r]);
  var i = e[c], m = [r], s = "";
  typeof e.className == "string" ? s = p(t.registered, m, e.className) : e.className != null && (s = e.className + " ");
  var n = E(m, void 0, typeof r == "function" || Array.isArray(r) ? _(T) : void 0);
  if (process.env.NODE_ENV !== "production" && n.name.indexOf("-") === -1) {
    var l = e[v];
    l && (n = E([n, "label:" + l + ";"]));
  }
  C(t, n, typeof i == "string"), s += t.key + "-" + n.name;
  var o = {};
  for (var a in e)
    g.call(e, a) && a !== "css" && a !== c && (process.env.NODE_ENV === "production" || a !== v) && (o[a] = e[a]);
  o.ref = f, o.className = s;
  var u = /* @__PURE__ */ y(i, o);
  return u;
});
process.env.NODE_ENV !== "production" && (w.displayName = "EmotionCssPropInternal");
export {
  I as C,
  w as E,
  T,
  g as h,
  h as w
};
