import { defineComponent as f, computed as c, createElementBlock as h, openBlock as r, createBlock as i, createCommentVNode as s, createElementVNode as n, unref as t, withCtx as u, createTextVNode as O, toDisplayString as l, withModifiers as y, createVNode as k, normalizeStyle as C, normalizeClass as V } from "vue";
import { getHttpMethodInfo as b } from "@scalar/helpers/http/http-info";
import { ScalarIconWebhooksLogo as g } from "@scalar/icons";
import { isOperationDeprecated as v } from "../../../libs/openapi.js";
import { useSidebar as w } from "../../../features/sidebar/hooks/useSidebar.js";
import S from "../../Section/SectionHeaderTag.vue.js";
import B from "../../HttpMethod/HttpMethod.vue.js";
const H = ["href"], N = { class: "flex min-w-[62px] flex-row items-center justify-end gap-2" }, W = /* @__PURE__ */ f({
  __name: "OperationsListItem",
  props: {
    transformedOperation: {},
    collection: {},
    isCollapsed: { type: Boolean }
  },
  setup(a) {
    const { scrollToOperation: m } = w(), p = async (e) => {
      m(e.id, !0);
    }, d = c(
      () => {
        var e, o;
        return ((e = a.transformedOperation) == null ? void 0 : e.name) || ((o = a.transformedOperation) == null ? void 0 : o.path);
      }
    );
    return (e, o) => (r(), h("li", {
      key: e.transformedOperation.id,
      class: "contents"
    }, [
      e.isCollapsed ? (r(), i(t(S), {
        key: 0,
        class: "sr-only",
        level: 3
      }, {
        default: u(() => [
          O(l(d.value) + " (Hidden) ", 1)
        ]),
        _: 1
      })) : s("", !0),
      n("a", {
        class: "endpoint",
        href: `#${e.transformedOperation.id}`,
        onClick: o[0] || (o[0] = y((I) => p(e.transformedOperation), ["prevent"]))
      }, [
        n("div", N, [
          e.transformedOperation.isWebhook ? (r(), i(t(g), {
            key: 0,
            style: C({
              color: t(b)(e.transformedOperation.httpVerb).colorVar
            })
          }, null, 8, ["style"])) : s("", !0),
          k(t(B), {
            class: "endpoint-method min-w-0",
            method: e.transformedOperation.httpVerb
          }, null, 8, ["method"])
        ]),
        n("span", {
          class: V(["endpoint-path", {
            deprecated: t(v)(
              e.transformedOperation.information
            )
          }])
        }, l(e.transformedOperation.path), 3)
      ], 8, H)
    ]));
  }
});
export {
  W as default
};
