"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const c = require("./c.js");
const utils = require("./utils.js");
function CssRender(config = {}) {
  let styleSheet = null;
  const cssr = {
    c: (...args) => c.c(cssr, ...args),
    use: (plugin, ...args) => plugin.install(cssr, ...args),
    find: utils.queryElement,
    context: {},
    config,
    get __styleSheet() {
      if (!styleSheet) {
        const style = document.createElement("style");
        document.head.appendChild(style);
        styleSheet = document.styleSheets[document.styleSheets.length - 1];
        return styleSheet;
      }
      return styleSheet;
    }
  };
  return cssr;
}
exports.CssRender = CssRender;
