import { utils } from "../../vitest/browser/context.js";
import { render } from "lit";
const { debug, getElementLocatorSelectors } = utils;
const containers = /* @__PURE__ */ new Set();
function render$1(template, { baseElement = document.body, container = baseElement.appendChild(document.createElement("div")), ...options } = {}) {
  containers.add(container);
  render(template, container, options);
  return {
    container,
    baseElement,
    debug,
    unmount() {
      containers.delete(container);
      container.remove();
    },
    rerender(newTemplate) {
      render(newTemplate, container, options);
    },
    asFragment() {
      return document.createRange().createContextualFragment(container.innerHTML);
    },
    ...getElementLocatorSelectors(container)
  };
}
function cleanup() {
  for (const container of containers) container.remove();
  containers.clear();
}
export {
  cleanup,
  render$1 as render
};
//# sourceMappingURL=pure-D9bcvh0k.js.map
