import { unescapeJsonPointer as a } from "@scalar/openapi-parser";
import { computed as p } from "vue";
function d({ store: t, location: e, collection: o }) {
  return {
    operation: p(() => {
      if (!(t != null && t.collections) || !t.requests)
        return;
      const n = Object.values(t.requests).filter(
        (s) => o.requests.includes(s.uid)
      );
      if (!e.startsWith("#/paths/") && !e.startsWith("#/webhooks/"))
        throw new Error(
          "Invalid location, try using #/paths/$YOUR_ENDPOINT/$HTTP_METHOD. You can use the getPointer helper to generate a valid location: getPointer(['paths', '/planets/{planetId}', 'get'])"
        );
      return n.find((s) => {
        const r = a(e.split("/")[2]), i = e.split("/")[3].toLocaleLowerCase();
        return s.method === i && s.path === r;
      });
    })
  };
}
export {
  d as useBlockProps
};
