import { defineComponent, mergeModels, useModel, computed, createElementBlock, createCommentVNode, openBlock, createElementVNode, createVNode, Fragment } from "vue";
import { isLocalUrl } from "@scalar/helpers/url/is-local-url";
import _sfc_main$1 from "./components/ApiReferenceToolbarTitle.vue.js";
import _sfc_main$4 from "./components/DeployApiReference.vue.js";
import _sfc_main$2 from "./components/ModifyConfiguration.vue.js";
import _sfc_main$3 from "./components/ShareApiReference.vue.js";
const _hoisted_1 = {
  key: 0,
  "aria-label": "Developer Tools",
  class: "api-reference-toolbar bg-b-1 relative z-10 flex h-10 justify-center border-b px-15"
};
const _hoisted_2 = { class: "-mx-2 flex max-w-(--refs-content-max-width) flex-1 items-center" };
const _hoisted_3 = { class: "flex flex-1 items-center" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "DeveloperTools",
  props: /* @__PURE__ */ mergeModels({
    workspace: {},
    configuration: {}
  }, {
    "overrides": {},
    "overridesModifiers": {}
  }),
  emits: ["update:overrides"],
  setup(__props) {
    const overrides = useModel(__props, "overrides");
    const showDeveloperTools = computed(() => {
      if (__props.configuration?.showDeveloperTools === "always") {
        return true;
      }
      if (__props.configuration?.showDeveloperTools === "never") {
        return false;
      }
      if (typeof window === "undefined") {
        return false;
      }
      return isLocalUrl(window.location.href);
    });
    return (_ctx, _cache) => {
      return showDeveloperTools.value ? (openBlock(), createElementBlock("header", _hoisted_1, [
        createElementVNode("div", _hoisted_2, [
          createElementVNode("div", _hoisted_3, [
            createVNode(_sfc_main$1)
          ]),
          createVNode(_sfc_main$2, {
            overrides: overrides.value,
            "onUpdate:overrides": _cache[0] || (_cache[0] = ($event) => overrides.value = $event),
            configuration: __props.configuration
          }, null, 8, ["overrides", "configuration"]),
          __props.workspace ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
            createVNode(_sfc_main$3, { workspace: __props.workspace }, null, 8, ["workspace"]),
            createVNode(_sfc_main$4, { workspace: __props.workspace }, null, 8, ["workspace"])
          ], 64)) : createCommentVNode("", true)
        ])
      ])) : createCommentVNode("", true);
    };
  }
});
export {
  _sfc_main as default
};
