import { getCurrentInstance as c, provide as i, inject as s } from "vue";
const t = /* @__PURE__ */ new WeakMap(), u = (o, n) => {
  var r;
  const e = (r = c()) == null ? void 0 : r.proxy;
  if (e == null)
    throw new Error("provideLocal must be called in setup");
  t.has(e) || t.set(e, /* @__PURE__ */ Object.create(null));
  const a = t.get(e);
  a[o] = n, i(o, n);
}, d = (...o) => {
  var n;
  const r = o[0], e = (n = c()) == null ? void 0 : n.proxy;
  if (e == null)
    throw new Error("injectLocal must be called in setup");
  return t.has(e) && r in t.get(e) ? t.get(e)[r] : s(...o);
};
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const l = Symbol("FORM_PROVIDER_CONTEXT"), v = (o) => u(l, o), f = () => d(l);
export {
  l as FORM_PROVIDER_CONTEXT,
  v as createFormProvider,
  f as useFormContext
};
//# sourceMappingURL=form.mjs.map
