import { jsx as a } from "react/jsx-runtime";
import { createContext as m, useState as c, useMemo as C, useContext as d } from "react";
const o = m(
  void 0
);
function f({
  apiUrl: t,
  assistantId: s,
  identity: e,
  children: r
}) {
  const [n, u] = c(s), i = C(() => ({
    apiUrl: t,
    assistantId: n,
    setAssistantId: u,
    identity: e
  }), [t, n, e]);
  return /* @__PURE__ */ a(o.Provider, { value: i, children: r });
}
function v() {
  const t = d(o);
  if (!t)
    throw new Error("useChatRuntime must be used within a ChatRuntimeProvider");
  return t;
}
export {
  f as ChatRuntimeProvider,
  v as useChatRuntime
};
//# sourceMappingURL=ChatRuntime.es.js.map
