@oeave/bakery3 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +562 -2
  3. package/dist/animation-B1h0Ryvj.d.ts +97 -0
  4. package/dist/bake/index.d.ts +369 -0
  5. package/dist/bake/index.js +9 -0
  6. package/dist/bake/index.js.map +1 -0
  7. package/dist/bake-DaOlenyx.d.ts +1357 -0
  8. package/dist/catalog/index.d.ts +100 -0
  9. package/dist/catalog/index.js +154 -0
  10. package/dist/catalog/index.js.map +1 -0
  11. package/dist/catalog.gen-BM-aNf7n.d.ts +733 -0
  12. package/dist/chunk-25ZXSVQ3.js +1107 -0
  13. package/dist/chunk-25ZXSVQ3.js.map +1 -0
  14. package/dist/chunk-3G5QL4F4.js +145 -0
  15. package/dist/chunk-3G5QL4F4.js.map +1 -0
  16. package/dist/chunk-4E5VV4QY.js +12 -0
  17. package/dist/chunk-4E5VV4QY.js.map +1 -0
  18. package/dist/chunk-54WJDN5R.js +3286 -0
  19. package/dist/chunk-54WJDN5R.js.map +1 -0
  20. package/dist/chunk-6NYR73Y7.js +832 -0
  21. package/dist/chunk-6NYR73Y7.js.map +1 -0
  22. package/dist/chunk-6YVQANMW.js +1463 -0
  23. package/dist/chunk-6YVQANMW.js.map +1 -0
  24. package/dist/chunk-AF5BIELI.js +70 -0
  25. package/dist/chunk-AF5BIELI.js.map +1 -0
  26. package/dist/chunk-APBOWWSV.js +92 -0
  27. package/dist/chunk-APBOWWSV.js.map +1 -0
  28. package/dist/chunk-ARMTTZXZ.js +1157 -0
  29. package/dist/chunk-ARMTTZXZ.js.map +1 -0
  30. package/dist/chunk-CX4WTVGH.js +4492 -0
  31. package/dist/chunk-CX4WTVGH.js.map +1 -0
  32. package/dist/chunk-HQTUFVMM.js +1412 -0
  33. package/dist/chunk-HQTUFVMM.js.map +1 -0
  34. package/dist/chunk-MD2U6S4N.js +1952 -0
  35. package/dist/chunk-MD2U6S4N.js.map +1 -0
  36. package/dist/chunk-S4AJTLLN.js +23 -0
  37. package/dist/chunk-S4AJTLLN.js.map +1 -0
  38. package/dist/chunk-TGFNQBKC.js +551 -0
  39. package/dist/chunk-TGFNQBKC.js.map +1 -0
  40. package/dist/chunk-V3QINEEG.js +87 -0
  41. package/dist/chunk-V3QINEEG.js.map +1 -0
  42. package/dist/chunk-W6WQ5UP7.js +91 -0
  43. package/dist/chunk-W6WQ5UP7.js.map +1 -0
  44. package/dist/chunk-WBIAFIHV.js +346 -0
  45. package/dist/chunk-WBIAFIHV.js.map +1 -0
  46. package/dist/chunk-ZEBVAIJJ.js +156 -0
  47. package/dist/chunk-ZEBVAIJJ.js.map +1 -0
  48. package/dist/devtools/index.d.ts +536 -0
  49. package/dist/devtools/index.js +15 -0
  50. package/dist/devtools/index.js.map +1 -0
  51. package/dist/environments/index.d.ts +93 -0
  52. package/dist/environments/index.js +382 -0
  53. package/dist/environments/index.js.map +1 -0
  54. package/dist/hotspots/index.d.ts +111 -0
  55. package/dist/hotspots/index.js +285 -0
  56. package/dist/hotspots/index.js.map +1 -0
  57. package/dist/index.d.ts +944 -0
  58. package/dist/index.js +15 -0
  59. package/dist/index.js.map +1 -0
  60. package/dist/node/index.cjs +5115 -0
  61. package/dist/node/index.cjs.map +1 -0
  62. package/dist/node/index.d.cts +4862 -0
  63. package/dist/node/index.d.ts +576 -0
  64. package/dist/node/index.js +1279 -0
  65. package/dist/node/index.js.map +1 -0
  66. package/dist/prepare-C5qVvaw4.d.ts +112 -0
  67. package/dist/presets/index.d.ts +526 -0
  68. package/dist/presets/index.js +14 -0
  69. package/dist/presets/index.js.map +1 -0
  70. package/dist/r3f/index.d.ts +159 -0
  71. package/dist/r3f/index.js +592 -0
  72. package/dist/r3f/index.js.map +1 -0
  73. package/dist/room-S5TLCK4F.js +9 -0
  74. package/dist/room-S5TLCK4F.js.map +1 -0
  75. package/dist/rooms.gen-vhj6sFW5.d.ts +1434 -0
  76. package/dist/session-YCQS4MRH.js +9 -0
  77. package/dist/session-YCQS4MRH.js.map +1 -0
  78. package/dist/shapes/index.d.ts +222 -0
  79. package/dist/shapes/index.js +836 -0
  80. package/dist/shapes/index.js.map +1 -0
  81. package/dist/testRun-BIPXaVPb.d.ts +1130 -0
  82. package/dist/timeline-ChwgD7bT.d.ts +470 -0
  83. package/dist/tsl/index.d.ts +165 -0
  84. package/dist/tsl/index.js +310 -0
  85. package/dist/tsl/index.js.map +1 -0
  86. package/package.json +170 -4
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/r3f/store.ts","../../src/r3f/canvas.ts","../../src/r3f/renderState.ts","../../src/r3f/provider.tsx","../../src/r3f/Bakery3Material.tsx","../../src/r3f/Devtools.tsx","../../src/r3f/Bakery3Timeline.tsx"],"names":["listeners","r3fContext","apiKey","context","options","useRef","useCallback","useEffect","jsx","reactVersion","warned","useContext","useSyncExternalStore","useState","_roots"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0CA,IAAI,QAAA,GAA4B,IAAA;AAChC,IAAM,SAAA,uBAAgB,GAAA,EAAgB;AAEtC,IAAM,UAAA,uBAAiB,GAAA,EAA0C;AAG1D,SAAS,OAAA,CACd,OACA,IAAA,EACM;AACN,EAAA,MAAM,QAAA,GAAW,UAAA,CAAW,GAAA,CAAI,KAAK,CAAA;AAIrC,EAAA,IACE,QAAA,IACA,QAAA,CAAS,OAAA,KAAY,IAAA,CAAK,OAAA,IAC1B,QAAA,CAAS,OAAA,KAAY,IAAA,CAAK,OAAA,IAC1B,QAAA,CAAS,KAAA,KAAU,IAAA,CAAK,KAAA,EACxB;AACA,IAAA;AAAA,EACF;AACA,EAAA,UAAA,CAAW,GAAA,CAAI,OAAO,IAAI,CAAA;AAC1B,EAAA,MAAA,EAAO;AACT;AAIO,SAAS,UAAU,KAAA,EAAqB;AAC7C,EAAA,IAAI,UAAA,CAAW,MAAA,CAAO,KAAK,CAAA,EAAG,MAAA,EAA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AAA,KAAgB,MAAA,GAC/B,EAAE,WAAA,EAAa,MAAA,CAAO,OAAA,CAAQ,WAAA,EAAY,GAC1C,EAAC;AAAA,MACL,kBAAkB,CAAC,MAAA,KAAW,MAAA,CAAO,OAAA,CAAQ,mBAAmB,MAAM,CAAA;AAAA,MACtE,GAAI,MAAA,CAAO,OAAA,CAAQ,aAAA,GACf;AAAA,QACE,eAAe,CAAC,QAAA,KACd,MAAA,CAAO,OAAA,CAAQ,gBAAgB,QAAQ;AAAA,UAE3C;AAAC,KACN,CAAA;AACD,IAAA,OAAO,MAAM;AACX,MAAA,KAAA,CAAM,SAAS,OAAA,EAAQ;AACvB,MAAA,KAAA,CAAM,OAAA,GAAU,IAAA;AAAA,IAClB,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,KAAA,CAAM,QAAQ,CAAC,CAAA;AAGnB,EAAA,OAAO,IAAA;AACT","file":"index.js","sourcesContent":["/**\n * A tiny external store so HTML can live outside `<Canvas>`: the devtools\n * panel, and any component calling `useBakery3()` from the ordinary DOM tree.\n *\n * `<Bakery3Provider>` has to be inside the Canvas: `useThree` only resolves\n * against R3F's store, and holding the live scene and camera is the provider's\n * entire job. But the devtools are HTML, and HTML inside an R3F tree needs a\n * portal helper (drei's `<Html>`) that this package should not force on\n * anyone.\n *\n * So the provider publishes here, and `<Bakery3Devtools />` and `useBakery3()`\n * work anywhere in the ordinary DOM tree by subscribing. Two React trees, one\n * source of truth, no extra dependency.\n *\n * Several providers may be mounted at once (one per canvas). Each publishes\n * under its own owner; the one that mounted last is the one an outside caller\n * gets, and unmounting it hands the page back to the one before, never to\n * nothing while another is still mounted.\n *\n * The second half is the job feed: every render a `useBakery3()` starts, with\n * or without a provider, is announced here, so the devtools panel shows a\n * render started from the developer's own button beside its own.\n */\n\nimport type { Bakery3 } from '../index.js';\nimport type { RenderJob } from '../job.js';\nimport type { CanvasStore } from './canvas.js';\nimport type { RenderKind, RenderTracker } from './renderState.js';\n\nexport type Bakery3Snapshot = {\n bakery3: Bakery3;\n /** The provider's render state, shared by every `useBakery3()` under it. */\n renders: RenderTracker;\n /**\n * R3F's store for the canvas the provider is in. The live scene, camera and\n * renderer are read from it when they are needed rather than mirrored here,\n * so a camera change does not re-render every subscriber or remount the\n * devtools panel.\n */\n store: CanvasStore;\n} | null;\n\nlet snapshot: Bakery3Snapshot = null;\nconst listeners = new Set<() => void>();\n/** In mount order: Map keeps a key where it was first set. */\nconst publishers = new Map<object, NonNullable<Bakery3Snapshot>>();\n\n/** What `owner` publishes, until `unpublish(owner)`. */\nexport function publish(\n owner: object,\n next: NonNullable<Bakery3Snapshot>,\n): void {\n const previous = publishers.get(owner);\n // Reference equality is the subscription contract for useSyncExternalStore:\n // publishing a fresh object with identical contents would re-render every\n // subscriber each time the provider re-renders.\n if (\n previous &&\n previous.bakery3 === next.bakery3 &&\n previous.renders === next.renders &&\n previous.store === next.store\n ) {\n return;\n }\n publishers.set(owner, next);\n settle();\n}\n\n/** Only ever removes `owner`'s own entry: one provider unmounting must not\n * clear the page while another is still mounted. */\nexport function unpublish(owner: object): void {\n if (publishers.delete(owner)) settle();\n}\n\nfunction settle(): void {\n let current: Bakery3Snapshot = null;\n for (const entry of publishers.values()) current = entry;\n if (current === snapshot) return;\n snapshot = current;\n for (const listener of listeners) listener();\n}\n\nexport function subscribe(listener: () => void): () => void {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n\nexport function getSnapshot(): Bakery3Snapshot {\n return snapshot;\n}\n\n/** Server render: there is no provider yet, and there never will be on the\n * server, so the panel renders nothing rather than mismatching on hydration. */\nexport function getServerSnapshot(): Bakery3Snapshot {\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// The job feed\n// ---------------------------------------------------------------------------\n\nexport type AnnouncedJob = (job: RenderJob, kind: RenderKind) => void;\n\nconst jobListeners = new Set<AnnouncedJob>();\n/** Jobs still running, so a panel that mounts mid-render picks them up. */\nconst running = new Map<RenderJob, RenderKind>();\n\nexport function announceJob(job: RenderJob, kind: RenderKind): void {\n running.set(job, kind);\n for (const listener of jobListeners) listener(job, kind);\n const done = () => running.delete(job);\n job.result().then(done, done);\n}\n\n/** Every job announced from now on, and every one still running. */\nexport function subscribeJobs(listener: AnnouncedJob): () => void {\n jobListeners.add(listener);\n for (const [job, kind] of running) listener(job, kind);\n return () => jobListeners.delete(listener);\n}\n","/**\n * Which `<Canvas>` a provider-less `useBakery3({ apiKey })` renders, and which\n * one a `<Bakery3Devtools apiKey>` shows.\n *\n * Called inside a canvas, the answer is R3F's own store for it. Called in the\n * ordinary DOM, where a render button lives, the hook has no store of its own\n * to read, so it looks at the canvases R3F has mounted (`_roots`): with one,\n * that is the scene; with none, nothing has mounted yet; with several, it\n * cannot know which one was meant and refuses rather than render the wrong\n * scene. A provider inside the chosen canvas is the answer to that.\n *\n * Pure, and typed structurally, so the rule is tested without React or a GPU.\n */\n\nimport type { Camera, Scene } from 'three';\nimport { Bakery3Error } from '../errors.js';\n\nexport type CanvasState = { scene: Scene; camera: Camera; gl: unknown };\nexport type CanvasStore = { getState(): CanvasState };\n\n/**\n * @param caller A method name (`render`, read as `render()`) or a component\n * (`<Bakery3Devtools>`), so the refusal names what the developer wrote.\n */\nexport function findCanvas(\n inside: CanvasStore | null,\n roots: ReadonlyMap<unknown, { store: CanvasStore }>,\n caller: string,\n): CanvasStore {\n if (inside) return inside;\n if (roots.size === 1) return [...roots.values()][0]!.store;\n const component = caller.startsWith('<');\n const who = component ? caller : `${caller}()`;\n if (roots.size === 0) {\n throw new Bakery3Error({\n code: 'InvalidRequest',\n message: component\n ? `${who} found no <Canvas> on the page.`\n : `${who} was called before a <Canvas> mounted.`,\n why: 'useBakery3() renders the scene in your <Canvas>, and there is none on the page yet.',\n fix: 'Mount the <Canvas> first, or call it from a component inside the <Canvas>.',\n docs: 'https://bakery3.com/docs#your-first-render',\n });\n }\n throw new Bakery3Error({\n code: 'InvalidRequest',\n message: `${who} cannot tell which of the ${roots.size} canvases on this page to ${component ? 'show' : 'render'}.`,\n why: component\n ? `${caller} with apiKey or token finds your scene on its own only when the page has one <Canvas>.`\n : 'useBakery3({ apiKey }) finds your scene on its own only when the page has one <Canvas>.',\n fix: component\n ? `Put <Bakery3Provider apiKey=\"…\"> inside the <Canvas> you want, and mount ${caller.replace(/>$/, ' />')} without apiKey or token.`\n : 'Put <Bakery3Provider apiKey=\"…\"> inside the <Canvas> you want to render, and call useBakery3() without options.',\n docs: 'https://bakery3.com/docs#render-from-several-canvases-or-components',\n });\n}\n","/**\n * What `useBakery3()` reports about a render, kept in one place.\n *\n * `job`, `progress`, `previewUrl`, `isRendering`, `error` and `result` are one\n * piece of state about one render: the latest one started. They live in a\n * tracker rather than in each component's own `useState`, so a component that\n * started a render, a progress bar elsewhere and the devtools panel all read\n * the same answer. `<Bakery3Provider>` holds one tracker that every\n * `useBakery3()` under it shares; a hook with options of its own holds its\n * own.\n *\n * Only the latest render is followed. When a second render starts before the\n * first finishes, the first one's progress, preview and outcome stop reaching\n * the state: a first job finishing must not clear `isRendering` while the\n * second is still tracing.\n *\n * Plain JavaScript with a subscribe/getState pair, which is what React's\n * `useSyncExternalStore` takes, so the rule is tested without React.\n */\n\nimport type { RenderResult } from '../protocol/index.js';\nimport type { RenderJob } from '../job.js';\n\nexport type RenderTrackerState = {\n /** The latest render, once it was accepted. */\n job: RenderJob | null;\n /** True from the call until the latest render settles, whichever way. */\n isRendering: boolean;\n /** 0 to 1. */\n progress: number;\n /** The low-sample preview, on `studio` and `ultra`, while it traces. */\n previewUrl: string | undefined;\n /** The finished render. `result.url` is the image or the video. */\n result: RenderResult | null;\n error: Error | null;\n};\n\nexport type RenderKind = 'render' | 'video';\n\nexport type RenderTracker = {\n getState(): RenderTrackerState;\n subscribe(listener: () => void): () => void;\n /** Start a render and follow it. Resolves with the job as `render()` does. */\n watch(start: () => Promise<RenderJob>, kind?: RenderKind): Promise<RenderJob>;\n /**\n * Stop polling the render it follows, for an unmount. The render keeps\n * running on the server; a pending `job.result()` rejects with an\n * `AbortError`. The state keeps what it last said, and the tracker can\n * watch again.\n */\n stop(): void;\n};\n\nexport type RenderTrackerOptions = {\n /** Told about every job the tracker starts following, so the devtools\n * panel can show a render started from the developer's own button. */\n onJob?: (job: RenderJob, kind: RenderKind) => void;\n};\n\nexport const IDLE: RenderTrackerState = Object.freeze({\n job: null,\n isRendering: false,\n progress: 0,\n previewUrl: undefined,\n result: null,\n error: null,\n});\n\nexport function createRenderTracker(\n options: RenderTrackerOptions = {},\n): RenderTracker {\n let state: RenderTrackerState = IDLE;\n /** Bumped by every watch(): a callback from a render that is no longer\n * the latest compares its own number and does nothing. */\n let latest = 0;\n let detach: Array<() => void> = [];\n const listeners = new Set<() => void>();\n\n function set(patch: Partial<RenderTrackerState>): void {\n state = { ...state, ...patch };\n for (const listener of listeners) listener();\n }\n\n return {\n getState: () => state,\n\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n\n async watch(start, kind = 'render') {\n const mine = ++latest;\n for (const off of detach) off();\n detach = [];\n set({\n job: null,\n isRendering: true,\n progress: 0,\n previewUrl: undefined,\n result: null,\n error: null,\n });\n\n let job: RenderJob;\n try {\n job = await start();\n } catch (cause) {\n if (mine === latest) set({ isRendering: false, error: asError(cause) });\n throw cause;\n }\n // A newer render started while this one was uploading. The caller still\n // gets its job; the state belongs to the newer one.\n if (mine !== latest) return job;\n\n set({\n job,\n progress: job.progress ?? 0,\n previewUrl: job.previewUrl,\n });\n detach = [\n job.on('progress', ({ percent }) => {\n if (mine === latest) set({ progress: percent / 100 });\n }),\n job.on('preview', ({ url }) => {\n if (mine === latest) set({ previewUrl: url });\n }),\n ];\n options.onJob?.(job, kind);\n // Settles the flag whichever way the render ends. Handled here, so a\n // caller who never awaits `job.result()` does not get an unhandled\n // rejection from a render that failed.\n job.result().then(\n (result) => {\n if (mine === latest) {\n set({ isRendering: false, progress: 1, result });\n }\n },\n (cause) => {\n if (mine === latest)\n set({ isRendering: false, error: asError(cause) });\n },\n );\n return job;\n },\n\n stop() {\n latest++;\n for (const off of detach) off();\n detach = [];\n state.job?.stop?.();\n },\n };\n}\n\nfunction asError(cause: unknown): Error {\n return cause instanceof Error ? cause : new Error(String(cause));\n}\n","'use client';\n\n/**\n * React Three Fiber bindings.\n *\n * The whole job is to make the developer stop passing `scene` and `camera`\n * around. R3F already owns them, so a render button is two lines:\n *\n * const { render } = useBakery3({ apiKey });\n * await render({ quality: 'studio' });\n *\n * Two ways in. The hook with options is a client of its own and needs nothing\n * else: it finds the scene when called (see canvas.ts). `<Bakery3Provider>`\n * inside `<Canvas>` holds one client that every `useBakery3()` without options\n * shares, which is what a page with several canvases, several components that\n * render, or the devtools panel wants.\n *\n * The hook reads two of R3F's exports that are not part of its documented\n * API: `context` (the store of the canvas it is called inside) and `_roots`\n * (every mounted canvas). An R3F upgrade can move either.\n */\n\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type ReactNode,\n} from 'react';\nimport { _roots, context as r3fContext, useThree } from '@react-three/fiber';\nimport type { Scene } from 'three';\nimport type {\n CompatibilityReport,\n CostEstimate,\n RenderResult,\n} from '../protocol/index.js';\nimport {\n createBakery3,\n type Bakery3,\n type Bakery3Options,\n type EstimateOptions,\n type RenderCamerasOptions,\n type RenderOptions,\n type RenderVideoOptions,\n} from '../index.js';\nimport type { Timeline, TimelineOptions } from '../timeline/index.js';\nimport type { TokenProvider } from '../client.js';\nimport type { RenderJob } from '../job.js';\nimport { rememberEnvironmentSource } from '../capture/environmentSource.js';\nimport { Bakery3Error } from '../errors.js';\nimport {\n announceJob,\n getServerSnapshot,\n getSnapshot,\n publish,\n subscribe,\n unpublish,\n} from './store.js';\nimport { findCanvas, type CanvasStore } from './canvas.js';\nimport { createRenderTracker, type RenderTracker } from './renderState.js';\n\nexport type Bakery3ContextValue = {\n bakery3: Bakery3;\n /** The render state every `useBakery3()` under this provider shares, which\n * the devtools panel also follows. */\n renders: RenderTracker;\n /** R3F's store for the canvas this provider is in: the live scene, camera\n * and renderer, read when they are needed. */\n store: CanvasStore;\n};\n\nexport const Bakery3Context = createContext<Bakery3ContextValue | null>(null);\n\n/**\n * Mount INSIDE `<Canvas>`.\n *\n * It has to be: `useThree` only resolves against R3F's own store, and the\n * point of the provider is to hold the live scene and camera. Wrapping\n * `<Canvas>` with it instead yields an error from `useThree`, not from here.\n *\n * The client is rebuilt when `apiKey` or `baseUrl` changes. `token` is read\n * through a ref, so a token function written inline does not rebuild it.\n */\nexport function Bakery3Provider({\n children,\n ...options\n}: Bakery3Options & { children?: ReactNode }) {\n const scene = useThree((state) => state.scene);\n const camera = useThree((state) => state.camera);\n const gl = useThree((state) => state.gl);\n const store = useContext(r3fContext) as unknown as CanvasStore;\n const [renders] = useState(newTracker);\n const [owner] = useState(() => ({}));\n\n const bakery3 = useClient(options)!;\n\n useEffect(() => {\n bakery3.attach({ scene, camera, renderer: gl });\n }, [bakery3, scene, camera, gl]);\n\n // For a capture that goes straight through `bakery3`, which the hook and\n // the panel do not wrap. They read it again before every call of theirs.\n useEffect(() => rememberDreiEnvironment(scene), [scene, scene.environment]);\n\n const value = useMemo(\n () => ({ bakery3, renders, store }),\n [bakery3, renders, store],\n );\n\n // Mirrored to the module store so <Bakery3Devtools />, which is HTML and\n // therefore lives outside <Canvas>, can see the same client and renders.\n // Two effects, not one with a cleanup: a cleanup on every change would\n // take this provider out of the mount order and put it back last.\n useEffect(() => () => unpublish(owner), [owner]);\n // Unmounted: stop polling the render it follows. The render still runs on\n // the server; nothing on this page is left to show it.\n useEffect(() => () => renders.stop(), [renders]);\n useEffect(() => {\n publish(owner, { bakery3, renders, store });\n }, [owner, bakery3, renders, store]);\n\n return (\n <Bakery3Context.Provider value={value}>{children}</Bakery3Context.Provider>\n );\n}\n\nfunction newTracker(): RenderTracker {\n return createRenderTracker({ onJob: announceJob });\n}\n\ntype LooseOptions = {\n token?: TokenProvider;\n apiKey?: string;\n baseUrl?: string;\n fetch?: typeof fetch;\n};\n\n/**\n * One client, or null without options.\n *\n * The client holds a cached token and nothing else mutable, so it must not be\n * rebuilt on every render: a new one per frame would re-mint a browser token\n * against the developer's own server every frame. It is rebuilt when what it\n * talks to changes (`apiKey`, `baseUrl`, a token arriving or going), and only\n * then. `token` and `fetch` are read through a ref, so a function written\n * inline in JSX, which is nearly all of them, does not count as a change.\n * The rest (`defaults`, `retry`) is read when the client is built.\n */\nexport function useClient(options: Bakery3Options | undefined): Bakery3 | null {\n const optionsRef = useRef(options);\n optionsRef.current = options;\n const present = options !== undefined;\n const loose = (options ?? {}) as LooseOptions;\n const { apiKey, baseUrl } = loose;\n // Named at all, even as undefined: an `apiKey={process.env.KEY}` whose\n // variable is unset is told so (\"apiKey is empty\"), not \"no key\".\n const keyNamed = options !== undefined && 'apiKey' in options;\n const tokenNamed = options !== undefined && 'token' in options;\n const hasToken = loose.token !== undefined;\n const hasFetch = loose.fetch !== undefined;\n\n return useMemo(() => {\n if (!optionsRef.current) return null;\n const given = optionsRef.current as Bakery3Options & LooseOptions;\n const { token, apiKey, fetch, ...rest } = given;\n // Only what was written is passed on, so the client's refusal names the\n // real problem: no key at all, an empty one, both, a token that is not a\n // function. It owns those errors and says more than a provider could.\n const auth = {\n ...('apiKey' in given ? { apiKey } : {}),\n ...('token' in given\n ? {\n token:\n typeof token === 'function'\n ? () => (optionsRef.current as { token: TokenProvider }).token()\n : token,\n }\n : {}),\n };\n const transport = fetch\n ? {\n fetch: ((input: Parameters<typeof fetch>[0], init?: RequestInit) =>\n (\n (optionsRef.current as LooseOptions | undefined)?.fetch ??\n globalThis.fetch\n )(input, init)) as typeof fetch,\n }\n : {};\n return createBakery3({\n ...dropUndefined(rest),\n ...auth,\n ...transport,\n } as Bakery3Options);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- read through\n // the ref on purpose; see above.\n }, [present, apiKey, baseUrl, keyNamed, tokenNamed, hasToken, hasFetch]);\n}\n\nfunction dropUndefined<T extends object>(value: T): Partial<T> {\n return Object.fromEntries(\n Object.entries(value).filter(([, entry]) => entry !== undefined),\n ) as Partial<T>;\n}\n\n/**\n * drei's <Environment> puts the loaded texture on scene.environment, and by\n * then it has been through PMREM: the original equirect pixels are gone. Its\n * `userData` still carries the URL drei loaded it from, so record that and the\n * HDRI reaches the renderer instead of falling back to a flat ambient dome.\n * See rememberEnvironmentSource.\n *\n * Called before every capture rather than once at mount, because an\n * <Environment> switched after mount (a preset picker, a day/night toggle)\n * replaces the texture without re-rendering anything of ours.\n */\nexport function rememberDreiEnvironment(scene: Scene): void {\n const texture = scene.environment;\n const url = texture?.userData?.url ?? texture?.userData?.src;\n if (texture && typeof url === 'string') {\n rememberEnvironmentSource(texture, url);\n }\n}\n\nexport type UseBakery3 = {\n /**\n * One render, watched: `job`, `progress`, `previewUrl` and `result` follow\n * it. With `cameras` it is a set of pictures instead, handed back as it is:\n * a set reports through `set.wait({ onProgress })`, not through one job's\n * state.\n */\n render: Bakery3['render'];\n /** Every variant, from every camera. The provider's live scene is the default. */\n renderVariants: Bakery3['renderVariants'];\n /** What that run would cost, with nothing admitted. */\n quoteVariants: Bakery3['quoteVariants'];\n /** Three variants, every camera, small and fast: look before paying. */\n testVariants: Bakery3['testVariants'];\n /** A render by id, as a job: after a reload, in another tab, from a\n * webhook. Needs no canvas. */\n getRender: Bakery3['getRender'];\n /** A timeline bound to the provider's live scene and camera. */\n timeline: (options?: TimelineOptions) => Timeline;\n /** The same capture as `render`, plus a baked timeline, as a video. */\n renderVideo: (options: RenderVideoOptions) => Promise<RenderJob>;\n estimate: (options?: EstimateOptions) => Promise<CostEstimate>;\n check: () => CompatibilityReport;\n /**\n * The latest render or video, once it was accepted. With a provider it is\n * shared: every `useBakery3()` under it, and the devtools panel, see the\n * same one, whichever component started it.\n */\n job: RenderJob | null;\n /** True from the call until the latest render settles, whichever way. */\n isRendering: boolean;\n /** Available seconds before the final image, on `studio` and `ultra`. */\n previewUrl: string | undefined;\n /** 0 to 1. */\n progress: number;\n /** The finished render: `result.url` is the image or the video. */\n result: RenderResult | null;\n error: Error | null;\n /**\n * The client itself. Without options, null outside `<Canvas>` until the\n * provider inside it has mounted; `ready` says the same thing as a boolean.\n */\n bakery3: Bakery3 | null;\n /** Without options, false until a `<Bakery3Provider>` has mounted. Disable\n * a render button on it. */\n ready: boolean;\n};\n\n/**\n * Works on both sides of `<Canvas>`, with or without a provider.\n *\n * With options (`{ apiKey }` or `{ token }`) it is a client of its own. Each\n * call renders the canvas it is inside, or, from the ordinary DOM, the one\n * canvas on the page; with several it refuses and points at the provider.\n *\n * Without options it uses `<Bakery3Provider>`. Inside the provider it reads\n * React context. Outside, where a render button actually lives (R3F's\n * reconciler has no `<button>`), it reads the store the provider publishes\n * to. With two providers on one page, the one that mounted last is the one an\n * outside caller gets, so call the hook inside the provider when that matters.\n */\nexport function useBakery3(options?: Bakery3Options): UseBakery3 {\n const own = useClient(options);\n // R3F's store when called inside a <Canvas>, null in the ordinary DOM.\n const canvas = useContext(r3fContext) as CanvasStore | null;\n const context = useContext(Bakery3Context);\n const published = useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot,\n );\n // A tracker of its own for a hook with options, and for a call made before\n // any provider mounted (so its refusal still lands in `error`). Made for\n // every hook, since it is a few closures, so hook order never depends on\n // the options.\n const [ownRenders] = useState(newTracker);\n // Its own tracker's render stops polling when the component unmounts. A\n // provider's is the provider's to stop: other components share it.\n useEffect(() => () => ownRenders.stop(), [ownRenders]);\n const shared = own ? null : (context ?? published);\n const bakery3 = own ?? shared?.bakery3 ?? null;\n const renders = shared?.renders ?? ownRenders;\n const sharedStore = shared?.store ?? null;\n\n const state = useSyncExternalStore(\n renders.subscribe,\n renders.getState,\n renders.getState,\n );\n\n // The client, pointed at the scene as it is now. A client of its own\n // attaches on every call rather than once: from the ordinary DOM the canvas\n // may mount, remount or change camera after this component did, and\n // attaching is only storing three references.\n const client = useCallback(\n (method: string): Bakery3 => {\n if (!own) {\n const found = mounted(bakery3, method);\n if (sharedStore) rememberDreiEnvironment(sharedStore.getState().scene);\n return found;\n }\n const { scene, camera, gl } = findCanvas(\n canvas,\n _roots as never,\n method,\n ).getState();\n rememberDreiEnvironment(scene);\n own.attach({ scene, camera, renderer: gl as never });\n return own;\n },\n [own, canvas, bakery3, sharedStore],\n );\n\n /** Start a job and follow it in the one place render state lives. */\n const watch = useCallback(\n (kind: 'render' | 'video', start: () => Promise<RenderJob>) =>\n renders.watch(start, kind),\n [renders],\n );\n\n return useMemo<UseBakery3>(\n () => ({\n bakery3,\n job: state.job,\n isRendering: state.isRendering,\n previewUrl: state.previewUrl,\n progress: state.progress,\n result: state.result,\n error: state.error,\n ready: bakery3 !== null,\n check: () => client('check').check(),\n estimate: async (options) => client('estimate').estimate(options),\n timeline: (options) => client('timeline').timeline(options),\n getRender: async (id) =>\n (own ?? mounted(bakery3, 'getRender')).getRender(id),\n // Both go through `watch` so a video reports progress, previews and\n // failures through exactly the same state a still does: a component\n // showing a progress bar should not care which one it is watching.\n render: ((options?: RenderOptions | RenderCamerasOptions) =>\n options && 'cameras' in options && Array.isArray(options.cameras)\n ? client('render').render(options as RenderCamerasOptions)\n : watch('render', async () =>\n client('render').render(options as RenderOptions),\n )) as Bakery3['render'],\n renderVariants: async (options) =>\n client('renderVariants').renderVariants(options),\n quoteVariants: async (options) =>\n client('quoteVariants').quoteVariants(options),\n testVariants: async (options, test) =>\n client('testVariants').testVariants(options, test),\n renderVideo: (options) =>\n watch('video', async () => client('renderVideo').renderVideo(options)),\n }),\n [own, bakery3, client, watch, state],\n );\n}\n\n/** The client, or the refusal for a call made before any provider mounted. */\nfunction mounted(bakery3: Bakery3 | null, method: string): Bakery3 {\n if (bakery3) return bakery3;\n throw new Bakery3Error({\n code: 'InvalidRequest',\n message: `${method}() was called before <Bakery3Provider> mounted.`,\n why: 'useBakery3() without options reads the client from the provider, and no provider is mounted on this page yet. It belongs inside <Canvas>, which mounts its children after the first frame.',\n fix: 'Pass your key to the hook, useBakery3({ apiKey }) or useBakery3({ token }), or put <Bakery3Provider> inside <Canvas> and disable the button until `ready` is true.',\n docs: 'https://bakery3.com/docs#render-from-several-canvases-or-components',\n });\n}\n","'use client';\n\n/**\n * Two materials, one surface: the one WebGL draws and the one the renderer gets.\n *\n * <Bakery3Material\n * web={<CarPaintShader />}\n * render={<meshPhysicalMaterial color=\"#830000\" metalness={0.9} clearcoat={1} />}\n * />\n *\n * A custom GLSL shader cannot be translated for the renderer, and the SDK\n * never pretends otherwise. What you can do is say, once, in your own\n * component tree, what the path tracer should use instead.\n *\n * The web material is what mounts. The render material is never added to the\n * scene at all: it is read for its props, which travel in the manifest as a\n * `MaterialFallback`. That means it costs no GPU memory and cannot\n * accidentally be drawn.\n */\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n version as reactVersion,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport type { Material } from 'three';\nimport type { MaterialFallback } from '../protocol/index.js';\n\ntype Props = {\n /**\n * What the browser renders. Mounted normally. A material element\n * (`<shaderMaterial>`, `<meshStandardMaterial>`), or a component that\n * forwards its ref to one: the fallback is written onto the material that\n * ref reaches. A ref of your own on it still receives the material.\n */\n web: ReactNode;\n /**\n * What the render shows instead. A `<meshPhysicalMaterial>` element, read\n * for its props and never mounted.\n */\n render: ReactElement<Record<string, unknown>>;\n};\n\nconst warned = new Set<string>();\n\nexport function Bakery3Material({ web, render }: Props) {\n const ref = useRef<Material | null>(null);\n const child = Children.only(web);\n const element = isValidElement(child) ? child : null;\n const theirs = element ? refOf(element) : undefined;\n\n // Both refs, so the developer's own ref on the web material keeps working.\n const merged = useCallback(\n (material: Material | null) => {\n ref.current = material;\n assignRef(theirs, material);\n },\n [theirs],\n );\n\n useEffect(() => {\n const material = ref.current;\n if (!material || !(material as { isMaterial?: boolean }).isMaterial) {\n // Silently rendering without the fallback is the one outcome to avoid:\n // the render would show the web material's approximation, or none.\n const message =\n '[bakery3] <Bakery3Material> could not reach the web material, so the render will not use the fallback. The web element must be a material element, such as <shaderMaterial>, or a component that forwards its ref to one.\\n\\nDocs: https://bakery3.com/docs/material-fallbacks';\n if (!warned.has(message)) {\n warned.add(message);\n console.warn(message);\n }\n return;\n }\n // Written onto the material rather than the mesh so a shared material\n // carries its fallback everywhere it is used, which is what a developer\n // who declared it once expects. `collectFallbacks` reads exactly this.\n material.userData = material.userData ?? {};\n material.userData.bakery3 = {\n ...material.userData.bakery3,\n fallback: fallbackFromProps(render.props),\n };\n return () => {\n if (material.userData?.bakery3) delete material.userData.bakery3.fallback;\n };\n }, [render]);\n\n if (!element) return <>{web}</>;\n // The ref is attached to the web material so the fallback can be written\n // onto the same object the exporter will later walk.\n return cloneElement(element as ReactElement<{ ref?: unknown }>, {\n ref: merged,\n });\n}\n\n/**\n * The ref already on the web element. React 19 keeps it in `props`; React 18\n * on the element, where reading it in 19 logs a deprecation warning.\n */\nfunction refOf(element: ReactElement): Ref<Material> | undefined {\n if (Number.parseInt(reactVersion, 10) >= 19) {\n return (element.props as { ref?: Ref<Material> }).ref;\n }\n return (element as unknown as { ref?: Ref<Material> }).ref ?? undefined;\n}\n\nfunction assignRef(target: Ref<Material> | undefined, value: Material | null) {\n if (typeof target === 'function') target(value);\n else if (target) (target as { current: Material | null }).current = value;\n}\n\n/**\n * The props that reach the manifest as a fallback: only the fields the\n * renderer can act on. An unknown prop is dropped rather than passed through,\n * so the manifest stays a contract that can be validated at the far end.\n */\nconst FALLBACK_KEYS = [\n 'color',\n 'metalness',\n 'roughness',\n 'clearcoat',\n 'clearcoatRoughness',\n 'transmission',\n 'thickness',\n 'ior',\n 'emissive',\n 'emissiveIntensity',\n 'opacity',\n 'sheen',\n 'sheenColor',\n 'iridescence',\n 'anisotropy',\n] as const;\n\nfunction fallbackFromProps(\n props: Record<string, unknown>,\n): Omit<MaterialFallback, 'materialId' | 'type'> {\n const out: Record<string, unknown> = {};\n for (const key of FALLBACK_KEYS) {\n if (props[key] !== undefined) out[key] = props[key];\n }\n return out as Omit<MaterialFallback, 'materialId' | 'type'>;\n}\n","'use client';\n\n/**\n * `<Bakery3Devtools />`: a floating panel inside the app you are already in.\n *\n * Rotate the product, change a configuration, hit Render, and watch the\n * path-traced version of exactly that arrive, without leaving the page.\n *\n * Mount it anywhere: next to `<Canvas>` in the ordinary DOM, or inside it.\n * It gets its client one of two ways, the same two `useBakery3()` has:\n *\n * // A client of its own, on the page's one canvas.\n * <>\n * <Canvas><Scene /></Canvas>\n * {import.meta.env.DEV && <Bakery3Devtools apiKey=\"bk_sk_…\" />}\n * </>\n *\n * // The provider's client, through the module store (see store.ts), on\n * // the canvas the provider is in. A page with several canvases needs it.\n * <>\n * <Canvas><Bakery3Provider token={…}><Scene /></Bakery3Provider></Canvas>\n * {import.meta.env.DEV && <Bakery3Devtools />}\n * </>\n *\n * No HTML-in-Canvas portal helper is needed either way.\n *\n * This component is a shell over `mountBakery3Devtools` in\n * ../devtools/bakery3Devtools.ts, where the panel and every callback behind\n * its buttons live in vanilla DOM. It finds the client and the canvas, hands\n * the panel the live scene, camera and renderer as getters, holds the\n * callbacks in a ref so a parent re-render does not tear the panel down\n * mid-edit, follows every render a `useBakery3()` on the page starts, and\n * renders nothing itself.\n *\n * The Bake tab goes through `bakery3.bake()` by default: the hosted\n * `/v1/bakes`, textures back on signed URLs. A `bakeTransport` prop swaps in\n * a function of your own that turns a `BakeSpec` into a `BakeBundle` (a local\n * worker, a farm you already run); nothing else about this component changes.\n */\n\nimport {\n useContext,\n useEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { _roots, context as r3fContext } from '@react-three/fiber';\nimport type { QualityPreset } from '../protocol/index.js';\nimport type { Bakery3, Bakery3Options } from '../index.js';\nimport type { TokenProvider } from '../client.js';\nimport { Bakery3Error } from '../errors.js';\nimport {\n getServerSnapshot,\n getSnapshot,\n subscribe,\n subscribeJobs,\n} from './store.js';\nimport { findCanvas, type CanvasStore } from './canvas.js';\nimport {\n Bakery3Context,\n rememberDreiEnvironment,\n useClient,\n} from './provider.js';\nimport { mountBakery3Devtools } from '../devtools/bakery3Devtools.js';\nimport type {\n BakeTransport,\n Bakery3DevtoolsClient,\n} from '../devtools/bakery3Devtools.js';\nimport type {\n DevPanelHistoryOptions,\n DevPanelTab,\n} from '../devtools/devPanel.js';\nimport type { TimelinePanelTarget } from '../devtools/timelinePanel.js';\nimport type { Timeline } from '../timeline/index.js';\n\nexport type { BakeTransport };\n\nexport type Bakery3DevtoolsProps = {\n /**\n * A client of its own, as `useBakery3({ apiKey })` has: no\n * `<Bakery3Provider>` needed. The panel shows the page's one `<Canvas>`\n * (or the one it is inside), waiting for it to mount. Leave out `apiKey`\n * and `token` to use the provider's client instead.\n */\n apiKey?: string;\n /** A function that mints a browser token, as the provider takes. */\n token?: TokenProvider;\n /** With `apiKey` or `token`: the API to talk to. */\n baseUrl?: string;\n /** With `apiKey` or `token`: the `fetch` the client uses. */\n fetch?: typeof fetch;\n /** With `apiKey` or `token`: defaults folded into every render. */\n defaults?: Bakery3Options['defaults'];\n /** Corner to sit in. */\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';\n defaultQuality?: QualityPreset;\n defaultOpen?: boolean;\n defaultTab?: DevPanelTab;\n /**\n * The timeline the Video tab films. Without one the panel makes its own on\n * the live scene and camera, empty: frame a shot and press Keyframe camera.\n */\n timeline?: Timeline;\n /** Objects offered in the timeline's \"add track\" picker. */\n timelineTargets?: TimelinePanelTarget[];\n /** Fired when the timeline takes the camera and when it gives it back.\n * Suspend your orbit controls here. */\n onPlaybackChange?: (active: boolean) => void;\n /** Bake with your own worker instead of the hosted one. */\n bakeTransport?: BakeTransport;\n /** Where a bundle's relative uris resolve against, when it has any. */\n bakeBaseUrl?: string;\n /** Zero the realtime lights when a generation is applied. Off by default:\n * the session already replaces diffuse lighting with the lightmap (see\n * bake/shading.ts), so muting only removes the lamps' highlights. It is a\n * look to switch on from the panel, not a correction. */\n muteLightsOnApply?: boolean;\n history?: DevPanelHistoryOptions;\n};\n\n/** The provider mounts after the canvas's first frame, so \"no client\" is only\n * said once the page has had a moment to mount one. */\nconst NO_CLIENT_GRACE_MS = 2500;\n/** How often a panel with a client of its own looks for the canvas: to find\n * it once it mounts, and to follow it when it remounts or goes. */\nconst CANVAS_POLL_MS = 500;\n\nconst warned = new Set<string>();\nfunction warnOnce(message: string): void {\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(`[bakery3] ${message}`);\n}\n\nexport function Bakery3Devtools(props: Bakery3DevtoolsProps) {\n const inside = useContext(r3fContext) as unknown as CanvasStore | null;\n const provider = useContext(Bakery3Context);\n const published = useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot,\n );\n const shared = provider ?? published;\n const auth = authOf(props);\n // No credentials and no provider, once the provider has had its moment:\n // the panel still opens, on a client with no credentials, so the line\n // where the price would be says what is missing and where to get a key.\n const orphaned = useOrphaned(auth === undefined && shared === null);\n const own = useClient(auth ?? (orphaned ? transportOf(props) : undefined));\n const canvas = useCanvas(own !== null, inside);\n\n // Which client, on which canvas. Only these two remount the panel: a new\n // client is a different account, and a new canvas is a different scene,\n // whose bake session and ticked objects belong to the scene that is gone.\n const bakery3: Bakery3 | null = own ?? shared?.bakery3 ?? null;\n const store: CanvasStore | null = own\n ? canvas.store\n : (shared?.store ?? null);\n\n // The callbacks go through a ref so that a parent re-rendering with fresh\n // arrow functions does not remount the panel and lose the developer's tab,\n // their ticked objects and their applied bake.\n const latest = useRef(props);\n latest.current = props;\n\n useEffect(() => {\n if (canvas.error) warnOnce(canvas.error.toDisplayString());\n }, [canvas.error]);\n\n // Which tabs exist is structural, so a panel is remounted when it changes,\n // and only then.\n const shape = `${Boolean(props.bakeTransport)}|${Boolean(props.history)}`;\n\n useEffect(() => {\n if (!bakery3 || !store) return;\n const live = () => store.getState();\n\n const panel = mountBakery3Devtools({\n bakery3: rememberingEnvironment(bakery3, () => live().scene),\n // Getters: R3F swaps the camera (a resize, a `makeDefault` camera)\n // without remounting anything, and a remount here is exactly what\n // would close the panel and revert the bake on screen.\n get scene() {\n return live().scene;\n },\n get camera() {\n return live().camera;\n },\n get renderer() {\n return live().gl as never;\n },\n ...(latest.current.position ? { position: latest.current.position } : {}),\n ...(latest.current.defaultOpen !== undefined\n ? { defaultOpen: latest.current.defaultOpen }\n : {}),\n ...(latest.current.defaultTab\n ? { defaultTab: latest.current.defaultTab }\n : {}),\n defaultQuality: latest.current.defaultQuality ?? 'studio',\n ...(props.timeline ? { timeline: props.timeline } : {}),\n ...(latest.current.timelineTargets\n ? { timelineTargets: latest.current.timelineTargets }\n : {}),\n ...(latest.current.history ? { history: latest.current.history } : {}),\n onPlaybackChange: (active: boolean) =>\n latest.current.onPlaybackChange?.(active),\n ...(props.bakeTransport\n ? {\n bakeTransport: (spec, assets) =>\n latest.current.bakeTransport!(spec, assets),\n }\n : {}),\n // Getters, because these two are read when a bake finishes rather than\n // when the panel mounts: changing either has to take effect without a\n // remount, and a remount is exactly what would lose the bake it applies\n // to.\n get bakeBaseUrl() {\n return latest.current.bakeBaseUrl;\n },\n get muteLightsOnApply() {\n return latest.current.muteLightsOnApply;\n },\n });\n\n // Renders started from the developer's own button, through useBakery3(),\n // show in the jobs strip beside the panel's own.\n const untrack: Array<() => void> = [];\n const offJobs = subscribeJobs((job, kind) => {\n untrack.push(\n panel.trackJob(\n job,\n kind === 'video' ? 'video from your app' : 'render from your app',\n ),\n );\n });\n\n // Disposing reverts the scene and frees the lightmaps: unmounting the\n // devtools must not leave a bake baked into the developer's application.\n return () => {\n offJobs();\n for (const off of untrack) off();\n panel.dispose();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- everything else\n // is read through `latest`; see the file header.\n }, [bakery3, store, shape, props.timeline]);\n\n // The panel owns its own fixed-position element; React renders nothing.\n return null;\n}\n\n/** The auth props as client options, or undefined to use the provider. */\nfunction authOf(props: Bakery3DevtoolsProps): Bakery3Options | undefined {\n // Written at all, even as `apiKey={process.env.KEY}` with the variable\n // unset, is a panel with a client of its own: it then says the key is\n // missing where the price would be, rather than looking for a provider the\n // developer never meant to mount.\n if (!('apiKey' in props) && !('token' in props)) return undefined;\n return {\n ...('apiKey' in props ? { apiKey: props.apiKey } : {}),\n ...('token' in props ? { token: props.token } : {}),\n ...transportOf(props),\n } as Bakery3Options;\n}\n\n/** Everything but the credentials: where to call, how, and the defaults. */\nfunction transportOf(props: Bakery3DevtoolsProps): Bakery3Options {\n return {\n ...(props.baseUrl !== undefined ? { baseUrl: props.baseUrl } : {}),\n ...(props.fetch !== undefined ? { fetch: props.fetch } : {}),\n ...(props.defaults !== undefined ? { defaults: props.defaults } : {}),\n } as Bakery3Options;\n}\n\ntype FoundCanvas = { store: CanvasStore | null; error: Bakery3Error | null };\nconst NOT_YET: FoundCanvas = { store: null, error: null };\n\n/**\n * The canvas a panel with a client of its own shows: the one it is inside,\n * or the page's one canvas, by the same rule `useBakery3({ apiKey })` uses.\n * Before any canvas mounts it waits; with several it carries the refusal.\n */\nfunction useCanvas(enabled: boolean, inside: CanvasStore | null): FoundCanvas {\n const [found, setFound] = useState<FoundCanvas>(NOT_YET);\n useEffect(() => {\n if (!enabled) {\n setFound(NOT_YET);\n return;\n }\n const roots = _roots as unknown as ReadonlyMap<\n unknown,\n { store: CanvasStore }\n >;\n const look = () => {\n let next: FoundCanvas = NOT_YET;\n if (inside || roots.size > 0) {\n try {\n next = {\n store: findCanvas(inside, roots, '<Bakery3Devtools>'),\n error: null,\n };\n } catch (error) {\n next = { store: null, error: error as Bakery3Error };\n }\n }\n setFound((previous) =>\n previous.store === next.store &&\n previous.error?.message === next.error?.message\n ? previous\n : next,\n );\n };\n look();\n if (inside) return;\n const timer = setInterval(look, CANVAS_POLL_MS);\n return () => clearInterval(timer);\n }, [enabled, inside]);\n return found;\n}\n\n/**\n * True once the page has had its moment to mount a provider and has not:\n * said once in the console too. A provider that mounts later takes over.\n */\nfunction useOrphaned(missing: boolean): boolean {\n const [orphaned, setOrphaned] = useState(false);\n useEffect(() => {\n if (!missing) {\n setOrphaned(false);\n return;\n }\n const timer = setTimeout(() => {\n warnOnce(\n '<Bakery3Devtools> found no client. Pass apiKey or token to it, or put <Bakery3Provider> inside your <Canvas>.\\n\\nDocs: https://bakery3.com/docs/devtools#mount-it',\n );\n setOrphaned(true);\n }, NO_CLIENT_GRACE_MS);\n return () => clearTimeout(timer);\n }, [missing]);\n return orphaned;\n}\n\n/**\n * The client, with drei's `<Environment>` remembered before every capture.\n * An environment switched after mount replaces the texture without\n * re-rendering anything of ours, so it is read when it is used.\n */\nfunction rememberingEnvironment(\n bakery3: Bakery3,\n scene: () => Parameters<typeof rememberDreiEnvironment>[0],\n): Bakery3DevtoolsClient {\n const remember = () => rememberDreiEnvironment(scene());\n return {\n check: (target) => bakery3.check(target),\n estimate: (options) => bakery3.estimate(options),\n render: (options) => {\n remember();\n return bakery3.render(options);\n },\n renderVideo: (options) => {\n remember();\n return bakery3.renderVideo(options);\n },\n bake: (options) => {\n remember();\n return bakery3.bake(options);\n },\n };\n}\n","'use client';\n\n/**\n * `<Bakery3Timeline timeline={tl} />`: the vanilla timeline panel, in React.\n *\n * A wrapper rather than a reimplementation: this mounts the same DOM as\n * `mountTimelinePanel`, and everything about the behavior lives in\n * ../devtools/timelinePanel.ts.\n *\n * Mount it outside `<Canvas>`, next to it, exactly like `<Bakery3Devtools/>`.\n *\n * <>\n * <Canvas>…</Canvas>\n * {import.meta.env.DEV && (\n * <Bakery3Timeline\n * timeline={tl}\n * onPlaybackChange={(active) => (controls.current.enabled = !active)}\n * onRenderVideo={(tl) => bakery3.renderVideo({ timeline: tl })}\n * />\n * )}\n * </>\n */\n\nimport { useEffect, useRef } from 'react';\nimport { mountTimelinePanel } from '../devtools/index.js';\nimport type { TimelinePanel, TimelinePanelOptions } from '../devtools/index.js';\n\n/** Everything the vanilla panel takes except `container`: the element is\n * fixed-positioned and appended to the body, so a React parent choosing where\n * it lands in the tree would change nothing except when it unmounts. */\nexport type Bakery3TimelineProps = Omit<TimelinePanelOptions, 'container'>;\n\n/** Mounts the devtools timeline panel for as long as this component is\n * rendered. Renders nothing itself. */\nexport function Bakery3Timeline(props: Bakery3TimelineProps) {\n const panel = useRef<TimelinePanel | null>(null);\n // The callbacks go through a ref so that a parent re-rendering with a fresh\n // arrow function does not tear the panel down and lose the developer's\n // selection mid-edit. The panel is remounted only when the timeline itself\n // changes, which genuinely is a different set of lanes.\n const latest = useRef(props);\n latest.current = props;\n\n useEffect(() => {\n panel.current = mountTimelinePanel({\n timeline: props.timeline,\n ...(latest.current.targets ? { targets: latest.current.targets } : {}),\n ...(latest.current.position ? { position: latest.current.position } : {}),\n ...(latest.current.defaultOpen !== undefined\n ? { defaultOpen: latest.current.defaultOpen }\n : {}),\n onPlaybackChange: (active) => latest.current.onPlaybackChange?.(active),\n ...(latest.current.onRenderVideo\n ? {\n onRenderVideo: (timeline) =>\n latest.current.onRenderVideo?.(timeline),\n }\n : {}),\n });\n return () => {\n panel.current?.dispose();\n panel.current = null;\n };\n }, [props.timeline]);\n\n // The panel owns its own fixed-position element; React renders nothing.\n return null;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ export { applyPresetRoomCamera, coverFit, createPresetRoom, plainFloatGeometry, presetRoomBounds, presetRoomUrl, roomLensFovDeg, stampRoomIds, stampRoomStandIns } from './chunk-6YVQANMW.js';
2
+ export { findPresetRooms, roomPresetFactsOf, roomPresetSpecOf } from './chunk-AF5BIELI.js';
3
+ import './chunk-4E5VV4QY.js';
4
+ import './chunk-W6WQ5UP7.js';
5
+ import './chunk-6NYR73Y7.js';
6
+ export { ROOM_PRESETS } from './chunk-MD2U6S4N.js';
7
+ import './chunk-3G5QL4F4.js';
8
+ //# sourceMappingURL=room-S5TLCK4F.js.map
9
+ //# sourceMappingURL=room-S5TLCK4F.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"room-S5TLCK4F.js"}