{"version":3,"file":"RemoteContextProvider.mjs","names":[],"sources":["../../../src/components/RemoteContextProvider.tsx"],"sourcesContent":["import type { RemoteToHostConnection } from \"@mittwald/flow-remote-core\";\nimport { createContext, useContext } from \"react\";\n\ninterface RemoteContext {\n  connection: RemoteToHostConnection;\n}\n\nconst remoteContext = createContext<RemoteContext | null>(null);\n\nexport const RemoteContextProvider = remoteContext.Provider;\n\nexport const useRemoteContext = () => {\n  const context = useContext(remoteContext);\n  if (!context) {\n    throw new Error(\n      \"useRemoteContext must be used within a RemoteContextProvider\",\n    );\n  }\n  return context;\n};\n"],"mappings":";;;;AAOA,IAAM,gBAAgB,cAAoC,IAAI;AAE9D,IAAa,wBAAwB,cAAc;AAEnD,IAAa,yBAAyB;CACpC,MAAM,UAAU,WAAW,aAAa;CACxC,IAAI,CAAC,SACH,MAAM,IAAI,MACR,8DACF;CAEF,OAAO;AACT"}