import { objectMerge as u } from "@scalar/oas-utils/helpers";
import { reactive as p, createApp as m } from "vue";
import f from "./components/ApiReference.vue.js";
/* empty css                             */
function S(o, c, a = !0) {
  const t = p(c), r = m(f, { configuration: t });
  function n(e = o) {
    if (!e) {
      console.warn(
        "Invalid HTML element provided. Cannot mount Scalar References"
      );
      return;
    }
    r.mount(e);
  }
  return a && n(), {
    /** Update the configuration for a mounted reference */
    updateConfig(e, i = !0) {
      i ? Object.assign(t, e) : u(t, e);
    },
    updateSpec(e) {
      t.spec = e;
    },
    /** Mount the references to a given element */
    mount: n,
    /** Unmount the app from an element */
    unmount: () => r.unmount()
  };
}
export {
  S as createScalarReferences
};
