import { getCurrentInstance as l, inject as c } from "vue";
const r = /* @__PURE__ */ new WeakMap(), s = (...e) => {
  var t;
  const n = e[0], a = (t = l()) == null ? void 0 : t.proxy;
  if (a == null)
    throw new Error("injectLocal must be called in setup");
  return r.has(a) && n in r.get(a) ? r.get(a)[n] : c(...e);
};
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const i = {
  rowKey: "id",
  title: "Fast Start",
  routerMode: "hash",
  basename: "/"
}, u = Symbol("FAST_START_CONTEXT"), T = () => s(u, i), $ = () => {
  const { basename: e } = T();
  return ({ resource: t, id: n, type: a }) => {
    switch (a) {
      case "list":
        return o(`${e}/${t}`);
      case "create":
        return o(`${e}/${t}/create`);
      case "edit":
        return n == null ? o(`${e}/${t}/edit`) : o(`${e}/${t}/edit/${encodeURIComponent(n)}`);
      case "detail":
        return n == null ? o(`${e}/${t}/detail`) : o(
          `${e}/${t}/detail/${encodeURIComponent(n)}`
        );
      default:
        return a;
    }
  };
}, o = (e) => e.replace("//", "/");
export {
  o as removeDoubleSlashes,
  $ as useCreatePath
};
//# sourceMappingURL=useCreatePath.mjs.map
